13#ifndef CHOLMOD_SOLVE_HH
14#define CHOLMOD_SOLVE_HH
28namespace CholmodDetail
46template <
class Scalar,
class Index =
int>
63 std::vector<Index>
const& ridx,
64 std::vector<Index>
const& cidx,
65 std::vector<Scalar>
const& values,
77 void solve(std::vector<Scalar>
const& b, std::vector<Scalar>& x,
bool =
false)
const
79 assert(b.size() >= n);
81 solve_internal(&b[0],&x[0]);
101 void solve(std::vector<Scalar>
const& b, std::vector<Scalar>& x,
int nr,
104 assert(b.size()>=n*nr);
106 for(
int i=0; i<nr; ++i)
107 solve_internal(&b[i*n],&x[i*n]);
120 void solve(std::vector<Scalar>& b)
const
122 assert(b.size() >= n);
123 std::vector<Scalar> x(n);
140 std::vector<Scalar> x(n);
142 std::copy(x.begin(),x.end(),b);
156 void solve_internal(
Scalar const* bp,
Scalar* xp)
const;
159 std::unique_ptr<CholmodDetail::Cholmod> cholmod;
void solve(std::vector< Scalar > const &b, std::vector< Scalar > &x, int nr, bool=false) const
Solves the system for nr right hand sides.
virtual size_t size() const
reports the dimension of the system
void solve(std::vector< Scalar > &b) const
Solves the system for the given right hand side.
CholmodFactorization(Index n_, std::vector< Index > const &ridx, std::vector< Index > const &cidx, std::vector< Scalar > const &values, FactorizationOptions opt)
Constructor keeping input data in triplet format (aka coordinate format) constant.
void solve(Scalar *b) const
Solves the system for the given right hand side.
void solve(Scalar const *b, Scalar *x, bool=false) const
Solves the system for the given right hand side.
void solve(std::vector< Scalar > const &b, std::vector< Scalar > &x, bool=false) const
Solves the system for the given right hand side.
The Options struct allows to specify several options of factorization.