32 #include <suitesparse/cholmod.h> 33 #include <suitesparse/SuiteSparseQR.hpp> 45 cholmod_common*
const c;
48 operator cholmod_common*()
const;
52 std::unique_ptr<cholmod_common>
c;
63 using ptr_type = std::unique_ptr<cholmod_sparse, std::function<void(cholmod_sparse*)>>;
70 CholmodSparse(
const size_t _m,
const size_t _n,
const size_t _N);
74 CholmodSparse(
const std::map<size_t, double>& _input,
const size_t _m,
const size_t _n,
const bool _transpose);
77 std::map<size_t, double> to_map(
double _alpha=1.0)
const;
87 const size_t _leftDim,
88 const size_t _rightDim,
90 const std::map<size_t, double>& _A,
91 const bool _transposeA,
93 const std::map<size_t, double>& _B,
94 const bool _transposeB);
97 static void solve_sparse_rhs(std::map<size_t, double>& _x,
99 const std::map<size_t, double>& _A,
100 const bool _transposeA,
101 const std::map<size_t, double>&
_b,
106 static void solve_dense_rhs(
double * _x,
108 const std::map<size_t, double>& _A,
109 const bool _transposeA,
119 static std::tuple<std::map<size_t, double>, std::map<size_t, double>,
size_t>
qc(
120 const std::map<size_t, double> &_A,
121 const bool _transposeA,
132 static std::tuple<std::map<size_t, double>, std::map<size_t, double>,
size_t>
cq(
133 const std::map<size_t, double> &_A,
134 const bool _transposeA,
std::tuple< std::unique_ptr< double[]>, std::unique_ptr< double[]>, size_t > cq(const double *const _A, const size_t _m, const size_t _n)
: splits A = C*Q, with _C an rxm matrix (where r is the rank of _A) and _Q orthogonal.
thread_local CholmodCommon cholmodObject
std::function< void(cholmod_sparse *)> get_deleter()
std::tuple< std::unique_ptr< double[]>, std::unique_ptr< double[]>, size_t > qc(const double *const _A, const size_t _m, const size_t _n)
: splits A = Q*C, with _C an rxn matrix (where r is the rank of _A) and _Q orthogonal.
RestrictedAccess(cholmod_common *const _c, std::mutex &_lock)
The main namespace of xerus.
wrapper class for the cholmod sparse matrix objects
wrapper object for the cholmod_common struct to automatically call the constructor and destructor ...
std::unique_ptr< cholmod_common > c
std::unique_ptr< cholmod_sparse, std::function< void(cholmod_sparse *)> > ptr_type
XERUS_force_inline void transpose(double *const __restrict _out, const double *const __restrict _in, const size_t _leftDim, const size_t _rightDim)
void matrix_matrix_product(double *const _C, const size_t _leftDim, const size_t _rightDim, const double _alpha, const std::map< size_t, double > &_A, const bool _transposeA, const size_t _midDim, const double *const _B, const bool _transposeB)
IndexedTensorMoveable< tensor_type > operator*(const value_t _factor, IndexedTensorMoveable< tensor_type > &&_tensor)