@@ -195,23 +195,23 @@ class CholmodBase : public SparseSolverBase<Derived>
195
195
{
196
196
EIGEN_STATIC_ASSERT ((internal::is_same<double ,RealScalar>::value), CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY);
197
197
m_shiftOffset[0 ] = m_shiftOffset[1 ] = 0.0 ;
198
- cholmod_start (&m_cholmod);
198
+ R_MATRIX_CHOLMOD (start) (&m_cholmod);
199
199
}
200
200
201
201
explicit CholmodBase (const MatrixType& matrix)
202
202
: m_cholmodFactor(0 ), m_info(Success), m_factorizationIsOk(false ), m_analysisIsOk(false )
203
203
{
204
204
EIGEN_STATIC_ASSERT ((internal::is_same<double ,RealScalar>::value), CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY);
205
205
m_shiftOffset[0 ] = m_shiftOffset[1 ] = 0.0 ;
206
- cholmod_start (&m_cholmod);
206
+ R_MATRIX_CHOLMOD (start) (&m_cholmod);
207
207
compute (matrix);
208
208
}
209
209
210
210
~CholmodBase ()
211
211
{
212
212
if (m_cholmodFactor)
213
- cholmod_free_factor (&m_cholmodFactor, &m_cholmod);
214
- cholmod_finish (&m_cholmod);
213
+ R_MATRIX_CHOLMOD (free_factor) (&m_cholmodFactor, &m_cholmod);
214
+ R_MATRIX_CHOLMOD (finish) (&m_cholmod);
215
215
}
216
216
217
217
inline StorageIndex cols () const { return internal::convert_index<StorageIndex, Index>(m_cholmodFactor->n ); }
@@ -246,11 +246,11 @@ class CholmodBase : public SparseSolverBase<Derived>
246
246
{
247
247
if (m_cholmodFactor)
248
248
{
249
- cholmod_free_factor (&m_cholmodFactor, &m_cholmod);
249
+ R_MATRIX_CHOLMOD (free_factor) (&m_cholmodFactor, &m_cholmod);
250
250
m_cholmodFactor = 0 ;
251
251
}
252
252
cholmod_sparse A = viewAsCholmod (matrix.template selfadjointView <UpLo>());
253
- m_cholmodFactor = cholmod_analyze (&A, &m_cholmod);
253
+ m_cholmodFactor = R_MATRIX_CHOLMOD (analyze) (&A, &m_cholmod);
254
254
255
255
this ->m_isInitialized = true ;
256
256
this ->m_info = Success;
@@ -268,7 +268,7 @@ class CholmodBase : public SparseSolverBase<Derived>
268
268
{
269
269
eigen_assert (m_analysisIsOk && " You must first call analyzePattern()" );
270
270
cholmod_sparse A = viewAsCholmod (matrix.template selfadjointView <UpLo>());
271
- cholmod_factorize_p (&A, m_shiftOffset, 0 , 0 , m_cholmodFactor, &m_cholmod);
271
+ R_MATRIX_CHOLMOD (factorize_p) (&A, m_shiftOffset, 0 , 0 , m_cholmodFactor, &m_cholmod);
272
272
273
273
// If the factorization failed, minor is the column at which it did. On success minor == n.
274
274
this ->m_info = (m_cholmodFactor->minor == m_cholmodFactor->n ? Success : NumericalIssue);
@@ -293,15 +293,15 @@ class CholmodBase : public SparseSolverBase<Derived>
293
293
Ref<const Matrix<typename Rhs::Scalar,Dynamic,Dynamic,ColMajor> > b_ref (b.derived ());
294
294
295
295
cholmod_dense b_cd = viewAsCholmod (b_ref);
296
- cholmod_dense* x_cd = cholmod_solve (CHOLMOD_A, m_cholmodFactor, &b_cd, &m_cholmod);
296
+ cholmod_dense* x_cd = R_MATRIX_CHOLMOD (solve) (CHOLMOD_A, m_cholmodFactor, &b_cd, &m_cholmod);
297
297
if (!x_cd)
298
298
{
299
299
this ->m_info = NumericalIssue;
300
300
return ;
301
301
}
302
302
// TODO optimize this copy by swapping when possible (be careful with alignment, etc.)
303
303
dest = Matrix<Scalar,Dest::RowsAtCompileTime,Dest::ColsAtCompileTime>::Map (reinterpret_cast <Scalar*>(x_cd->x ),b.rows (),b.cols ());
304
- cholmod_free_dense (&x_cd, &m_cholmod);
304
+ R_MATRIX_CHOLMOD (free_dense) (&x_cd, &m_cholmod);
305
305
}
306
306
307
307
/* * \internal */
@@ -316,15 +316,15 @@ class CholmodBase : public SparseSolverBase<Derived>
316
316
// note: cs stands for Cholmod Sparse
317
317
Ref<SparseMatrix<typename RhsDerived::Scalar,ColMajor,typename RhsDerived::StorageIndex> > b_ref (b.const_cast_derived ());
318
318
cholmod_sparse b_cs = viewAsCholmod (b_ref);
319
- cholmod_sparse* x_cs = cholmod_spsolve (CHOLMOD_A, m_cholmodFactor, &b_cs, &m_cholmod);
319
+ cholmod_sparse* x_cs = R_MATRIX_CHOLMOD (spsolve) (CHOLMOD_A, m_cholmodFactor, &b_cs, &m_cholmod);
320
320
if (!x_cs)
321
321
{
322
322
this ->m_info = NumericalIssue;
323
323
return ;
324
324
}
325
325
// TODO optimize this copy by swapping when possible (be careful with alignment, etc.)
326
326
dest.derived () = viewAsEigen<typename DestDerived::Scalar,ColMajor,typename DestDerived::StorageIndex>(*x_cs);
327
- cholmod_free_sparse (&x_cs, &m_cholmod);
327
+ R_MATRIX_CHOLMOD (free_sparse) (&x_cs, &m_cholmod);
328
328
}
329
329
#endif // EIGEN_PARSED_BY_DOXYGEN
330
330
0 commit comments