#include <iostream>
#include <cla3p/dense.hpp>
#include <cla3p/sparse.hpp>
#include <cla3p/linsol.hpp>
#include <cla3p/algebra.hpp>
{
static cla3p::int_t rowptr[] = {0, 3, 5, 8, 11, 13};
static cla3p::int_t colidx[] = {0, 1, 3, 0, 1, 2, 3, 4, 0, 2, 3, 1, 4};
static cla3p::real_t values[] = {1, -1, -3, -2, 5, 4, 6, 4, -4, 2, 7, 8, -5};
}
{
static cla3p::int_t rowptr[] = {0, 3, 5, 7, 8, 9};
static cla3p::int_t colidx[] = {0, 1, 3, 1, 4, 2, 3, 3, 4};
}
template <typename T_Rhs>
{
T_Rhs X;
std::string type_name = "Unknown";
if(std::is_same<T_Rhs, cla3p::dns::RdVector>::value) type_name = "Vector";
if(std::is_same<T_Rhs, cla3p::dns::RdMatrix>::value) type_name = "Matrix";
std::cout << " " << type_name << " rhs::";
std::cout << "Absolute error: " << (B - A * X).evaluate().normOne() << std::endl;
}
int main()
{
std::cout << "General lhs\n";
solve_linear_system(Age, b);
solve_linear_system(Age, B);
std::cout << "\nSymmetric lhs\n";
solve_linear_system(Asy, b);
solve_linear_system(Asy, B);
return 0;
}
The definite Cholesky (LL') linear solver for sparse matrices.
Definition pardiso_auto.hpp:35
void decompose(const T_Matrix &mat)
Performs matrix decomposition.
void analysis(const T_Matrix &mat)
Performs matrix analysis & symbolic decomposition.
void solve(const dns::XxMatrix< T_Scalar > &rhs, dns::XxMatrix< T_Scalar > &sol)
Performs matrix solution.
static Property SymmetricUpper()
Factory method for upper-triangular symmetric property.
static XxMatrix< real_t > random(int_t nr, int_t nc, const Property &pr=Property::General(), T_RScalar lo=T_RScalar(0), T_RScalar hi=T_RScalar(1))
static XxVector< real_t > random(int_t n, T_RScalar lo=T_RScalar(0), T_RScalar hi=T_RScalar(1))
double real_t
Double precision real.
Definition scalar.hpp:44
XxMatrix< real_t > RdMatrix
Double precision real matrix.
Definition dense.hpp:55
XxMatrix< int_t, real_t > RdMatrix
Double precision real CSR (Compressed Sparse Row) matrix.
Definition sparse.hpp:35
XxVector< real_t > RdVector
Double precision real vector.
Definition dense.hpp:31