#include <iostream>
#include <cla3p/dense.hpp>
#include <cla3p/linsol.hpp>
#include <cla3p/algebra.hpp>
template <typename T_Rhs>
{
T_Rhs X = B;
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 linear solver for dense matrices with automatic method detection.
Definition lapack_auto.hpp:39
void solve(T_Matrix &rhs) const
Performs in-place matrix solution.
void decompose(const T_Matrix &mat)
Performs matrix decomposition.
The property class.
Definition property.hpp:42
static Property SymmetricLower()
Factory method for lower-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))
XxMatrix< real_t > RdMatrix
Double precision real matrix.
Definition dense.hpp:55
XxVector< real_t > RdVector
Double precision real vector.
Definition dense.hpp:31