26 #if ! defined (octave_oct_sparse_h)
27 #define octave_oct_sparse_h 1
29 #include "octave-config.h"
33 #if defined (HAVE_CHOLMOD)
38 #if defined (HAVE_SUITESPARSE_AMD_H)
39 # include <suitesparse/amd.h>
40 #elif defined (HAVE_AMD_AMD_H)
42 #elif defined (HAVE_AMD_H)
46 #if defined (HAVE_SUITESPARSE_CCOLAMD_H)
47 # include <suitesparse/ccolamd.h>
48 #elif defined (HAVE_CCOLAMD_CCOLAMD_H)
49 # include <ccolamd/ccolamd.h>
50 #elif defined (HAVE_CCOLAMD_H)
54 #if defined (HAVE_SUITESPARSE_CHOLMOD_H)
55 # include <suitesparse/cholmod.h>
56 #elif defined (HAVE_CHOLMOD_CHOLMOD_H)
57 # include <cholmod/cholmod.h>
58 #elif defined (HAVE_CHOLMOD_H)
62 #if defined (HAVE_SUITESPARSE_COLAMD_H)
63 # include <suitesparse/colamd.h>
64 #elif defined (HAVE_COLAMD_COLAMD_H)
65 # include <colamd/colamd.h>
66 #elif defined (HAVE_COLAMD_H)
70 #if defined (HAVE_SUITESPARSE_CS_H)
71 # include <suitesparse/cs.h>
72 #elif defined (HAVE_CXSPARSE_CS_H)
73 # include <cxsparse/cs.h>
74 #elif defined (HAVE_CS_H)
78 #if defined (HAVE_SUITESPARSE_UMFPACK_H)
79 # include <suitesparse/umfpack.h>
80 #elif defined (HAVE_UMFPACK_UMFPACK_H)
81 # include <umfpack/umfpack.h>
82 #elif defined (HAVE_UMFPACK_H)
86 #if defined (HAVE_SUITESPARSE_SUITESPARSEQR_HPP)
87 # include <suitesparse/SuiteSparseQR.hpp>
88 #elif defined (HAVE_SUITESPARSEQR_HPP)
89 # include <SuiteSparseQR.hpp>
94 #if defined (SUITESPARSE_VERSION)
95 # if (SUITESPARSE_VERSION >= SUITESPARSE_VER_CODE (7, 0))
96 # define SUITESPARSE_NAME(name) SuiteSparse_ ## name
97 # define SUITESPARSE_SET_FCN(name) SuiteSparse_config_ ## name ## _set
98 # define SUITESPARSE_ASSIGN_FPTR(f_name, f_var, f_assign) \
99 SUITESPARSE_SET_FCN(f_name) (f_assign)
100 # define SUITESPARSE_ASSIGN_FPTR2(f_name, f_var, f_assign) \
101 SUITESPARSE_SET_FCN(f_name) (SUITESPARSE_NAME (f_assign))
102 # elif (SUITESPARSE_VERSION >= SUITESPARSE_VER_CODE (4, 3))
103 # define SUITESPARSE_NAME(name) SuiteSparse_ ## name
104 # define SUITESPARSE_ASSIGN_FPTR(f_name, f_var, f_assign) \
105 (SuiteSparse_config.f_name = f_assign)
106 # define SUITESPARSE_ASSIGN_FPTR2(f_name, f_var, f_assign) \
107 (SuiteSparse_config.f_name = SUITESPARSE_NAME (f_assign))
109 # define SUITESPARSE_ASSIGN_FPTR(f_name, f_var, f_assign) \
111 # define SUITESPARSE_ASSIGN_FPTR2(f_name, f_var, f_assign) \
112 (f_var = CHOLMOD_NAME (f_assign))
118 #if defined (HAVE_AMD)
119 # if defined (OCTAVE_ENABLE_64)
120 # define AMD_NAME(name) amd_l ## name
122 # define AMD_NAME(name) amd ## name
126 #if defined (HAVE_CCOLAMD)
127 # if defined (OCTAVE_ENABLE_64)
128 # define CCOLAMD_NAME(name) ccolamd_l ## name
129 # define CSYMAMD_NAME(name) csymamd_l ## name
131 # define CCOLAMD_NAME(name) ccolamd ## name
132 # define CSYMAMD_NAME(name) csymamd ## name
136 #if defined (HAVE_CHOLMOD)
137 # if defined (OCTAVE_ENABLE_64)
138 # define CHOLMOD_NAME(name) cholmod_l_ ## name
140 # define CHOLMOD_NAME(name) cholmod_ ## name
144 #if defined (HAVE_COLAMD)
145 # if defined (OCTAVE_ENABLE_64)
146 # define COLAMD_NAME(name) colamd_l ## name
147 # define SYMAMD_NAME(name) symamd_l ## name
149 # define COLAMD_NAME(name) colamd ## name
150 # define SYMAMD_NAME(name) symamd ## name
154 #if defined (HAVE_CXSPARSE)
155 # if defined (OCTAVE_ENABLE_64)
156 # define CXSPARSE_DNAME(name) cs_dl ## name
157 # define CXSPARSE_ZNAME(name) cs_cl ## name
159 # define CXSPARSE_DNAME(name) cs_di ## name
160 # define CXSPARSE_ZNAME(name) cs_ci ## name
164 #if defined (HAVE_UMFPACK)
165 # if defined (OCTAVE_ENABLE_64)
166 # define UMFPACK_DNAME(name) umfpack_dl_ ## name
167 # define UMFPACK_ZNAME(name) umfpack_zl_ ## name
169 # define UMFPACK_DNAME(name) umfpack_di_ ## name
170 # define UMFPACK_ZNAME(name) umfpack_zi_ ## name
174 #if (defined (HAVE_AMD) || defined (HAVE_CCOLAMD) \
175 || defined (HAVE_CHOLMOD) || defined (HAVE_COLAMD) \
176 || defined (HAVE_CXSPARSE) || defined (HAVE_SPQR) \
177 || defined (HAVE_UMFPACK))
181 # if defined (OCTAVE_ENABLE_64)
204 (*current_liboctave_error_handler)
205 (
"integer dimension or index out of range for Octave's indexing type");
215 (*current_liboctave_error_handler)
216 (
"integer dimension or index out of range for Octave's index type");
charNDArray max(char d, const charNDArray &m)
charNDArray min(char d, const charNDArray &m)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_DBLE * x
OCTAVE_API suitesparse_integer * to_suitesparse_intptr(octave_idx_type *i)
OCTAVE_API octave_idx_type * to_octave_idx_type_ptr(suitesparse_integer *i)
octave_idx_type from_suitesparse_long(SuiteSparse_long x)
octave_idx_type from_size_t(std::size_t x)