1313// IWYU pragma: private
1414#include " ./InternalHeaderCheck.h"
1515
16+ #ifndef R_MATRIX_CHOLMOD
17+ # define R_MATRIX_CHOLMOD (_NAME_ ) cholmod_ ## _NAME_
18+ #endif
19+
1620namespace Eigen {
1721
1822namespace internal {
@@ -84,8 +88,8 @@ cholmod_sparse viewAsCholmod(Ref<SparseMatrix<Scalar_, Options_, StorageIndex_>
8488
8589 if (internal::is_same<StorageIndex_, int >::value) {
8690 res.itype = CHOLMOD_INT;
87- } else if (internal::is_same<StorageIndex_, SuiteSparse_long>::value) {
88- res.itype = CHOLMOD_LONG;
91+ // } else if (internal::is_same<StorageIndex_, SuiteSparse_long>::value) {
92+ // res.itype = CHOLMOD_LONG;
8993 } else {
9094 eigen_assert (false && " Index type not supported yet" );
9195 }
@@ -172,21 +176,13 @@ namespace internal {
172176#define EIGEN_CHOLMOD_SPECIALIZE0 (ret, name ) \
173177 template <typename StorageIndex_> \
174178 inline ret cm_##name(cholmod_common& Common) { \
175- return cholmod_##name (&Common); \
176- } \
177- template <> \
178- inline ret cm_##name<SuiteSparse_long>(cholmod_common & Common) { \
179- return cholmod_l_##name (&Common); \
179+ return R_MATRIX_CHOLMOD (name)(&Common); \
180180 }
181181
182- #define EIGEN_CHOLMOD_SPECIALIZE1 (ret, name, t1, a1 ) \
183- template <typename StorageIndex_> \
184- inline ret cm_##name(t1& a1, cholmod_common& Common) { \
185- return cholmod_##name (&a1, &Common); \
186- } \
187- template <> \
188- inline ret cm_##name<SuiteSparse_long>(t1 & a1, cholmod_common & Common) { \
189- return cholmod_l_##name (&a1, &Common); \
182+ #define EIGEN_CHOLMOD_SPECIALIZE1 (ret, name, t1, a1 ) \
183+ template <typename StorageIndex_> \
184+ inline ret cm_##name(t1& a1, cholmod_common& Common) { \
185+ return R_MATRIX_CHOLMOD (name) (&a1, &Common); \
190186 }
191187
192188EIGEN_CHOLMOD_SPECIALIZE0 (int , start)
@@ -201,33 +197,33 @@ EIGEN_CHOLMOD_SPECIALIZE1(cholmod_sparse*, factor_to_sparse, cholmod_factor, L)
201197
202198template <typename StorageIndex_>
203199inline cholmod_dense* cm_solve (int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
204- return cholmod_solve (sys, &L, &B, &Common);
205- }
206- template <>
207- inline cholmod_dense* cm_solve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
208- return cholmod_l_solve (sys, &L, &B, &Common);
200+ return R_MATRIX_CHOLMOD (solve) (sys, &L, &B, &Common);
209201}
202+ // template <>
203+ // inline cholmod_dense* cm_solve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
204+ // return cholmod_l_solve(sys, &L, &B, &Common);
205+ // }
210206
211207template <typename StorageIndex_>
212208inline cholmod_sparse* cm_spsolve (int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common& Common) {
213- return cholmod_spsolve (sys, &L, &B, &Common);
214- }
215- template <>
216- inline cholmod_sparse* cm_spsolve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_sparse& B,
217- cholmod_common& Common) {
218- return cholmod_l_spsolve (sys, &L, &B, &Common);
209+ return R_MATRIX_CHOLMOD (spsolve) (sys, &L, &B, &Common);
219210}
211+ // template <>
212+ // inline cholmod_sparse* cm_spsolve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_sparse& B,
213+ // cholmod_common& Common) {
214+ // return cholmod_l_spsolve(sys, &L, &B, &Common);
215+ // }
220216
221217template <typename StorageIndex_>
222218inline int cm_factorize_p (cholmod_sparse* A, double beta[2 ], StorageIndex_* fset, std::size_t fsize, cholmod_factor* L,
223219 cholmod_common& Common) {
224- return cholmod_factorize_p (A, beta, fset, fsize, L, &Common);
225- }
226- template <>
227- inline int cm_factorize_p<SuiteSparse_long>(cholmod_sparse* A, double beta[2 ], SuiteSparse_long* fset,
228- std::size_t fsize, cholmod_factor* L, cholmod_common& Common) {
229- return cholmod_l_factorize_p (A, beta, fset, fsize, L, &Common);
220+ return R_MATRIX_CHOLMOD (factorize_p) (A, beta, fset, fsize, L, &Common);
230221}
222+ // template <>
223+ // inline int cm_factorize_p<SuiteSparse_long>(cholmod_sparse* A, double beta[2], SuiteSparse_long* fset,
224+ // std::size_t fsize, cholmod_factor* L, cholmod_common& Common) {
225+ // return cholmod_l_factorize_p(A, beta, fset, fsize, L, &Common);
226+ // }
231227
232228#undef EIGEN_CHOLMOD_SPECIALIZE0
233229#undef EIGEN_CHOLMOD_SPECIALIZE1
0 commit comments