API

full

template<typename T>
inline matrix<T> castor::full(hmatrix<T> const &Ah)

Hierarchical to dense matrix conversion.

gmres

template<typename T>
matrix<T> castor::gmres(hmatrix<T> const &Ah, matrix<T> const &B, double tol, std::size_t maxit, hmatrix<T> const &Lh, hmatrix<T> const &Uh, matrix<T> const &X0 = matrix<T>())
template<typename T>
matrix<T> castor::gmres(hmatrix<T> const &Ah, matrix<T> const &B, double tol, std::size_t maxit, hmatrix<T> const &Ahm1, matrix<T> const &X0 = matrix<T>())
template<typename T>
matrix<T> castor::gmres(hmatrix<T> const &Ah, matrix<T> const &B, double tol = 1e-6, std::size_t maxit = 10, std::function<matrix<T>(matrix<T> const&)> const &Am1 = std::function<matrix<T>(matrix<T> const&)>(), matrix<T> const &X0 = matrix<T>())

Iterative solver using hierarchical matrix-vector product, eventually using hierarchical preconditionners.

inv

template<typename T>
inline hmatrix<T> castor::inv(hmatrix<T> const &Ah)

Inverse of hierarchical matrix.

linsolve

template<typename T>
matrix<T> castor::linsolve(hmatrix<T> const &Ah, matrix<T> const &B)

Solve linear system Ah*X=B where Ah is a hierarchical matrix, using hierarchical LU factorization.

lu

template<typename T>
inline auto castor::lu(hmatrix<T> const &Ah, double tol = 0)

Hierarchical lower/upper factorization.

mtimes

template<typename T>
inline hmatrix<T> castor::mtimes(hmatrix<T> const &Ah, hmatrix<T> const &Bh)
template<typename T>
inline matrix<T> castor::mtimes(matrix<T> const &A, hmatrix<T> const &Bh)
template<typename T>
inline matrix<T> castor::mtimes(hmatrix<T> const &Ah, matrix<T> const &B)

Hierarchical-matrix multiply with dense or hierarchical matrix.

size

template<typename T>
inline matrix<std::size_t> castor::size(hmatrix<T> const &Ah)

Size of H-matrix.

See length, numel.

spydata

template<typename T>
inline auto castor::spydata(hmatrix<T> const &Ah)

H-matrix leaf structure in sparse matrix format, both for full and compressed leaves.

tgeabm

template<typename T>
inline void castor::tgeabm(T alpha, matrix<T> const &A, matrix<T> const &B, T beta, hmatrix<T> &Ch)

In-place low-rank matrix product with hierarchical matrix: C = alpha*A*B + beta*Ch,

tgemm

template<typename T>
inline void castor::tgemm(T alpha, hmatrix<T> const &Ah, hmatrix<T> const &Bh, T beta, hmatrix<T> &Ch)

In-place hierarchical matrix product: C = alpha*Ah*Bh + beta*Ch,

transpose

template<typename T>
inline hmatrix<T> castor::transpose(hmatrix<T> const &Ah)

Non-conjugate transpose of hierarchical matrix.

operators

operator<<

template<typename T>
std::ostream &castor::operator<<(std::ostream &flux, hmatrix<T> const &Ah)

Flux operator to display hmatrix size and statistics using standard C++ convention of disp(Ah) operator.

operator+

template<typename T>
inline hmatrix<T> castor::operator+(T a, hmatrix<T> const &Bh)
template<typename T>
inline hmatrix<T> castor::operator+(hmatrix<T> const &Ah, hmatrix<T> const &Bh)
template<typename T>
inline hmatrix<T> castor::operator+(hmatrix<T> const &Ah, T b)

External hmatrix addition : Ch = Ah + b, Ch = Ah + Bh.

operator-

template<typename T>
inline hmatrix<T> castor::operator-(T a, hmatrix<T> const &Bh)
template<typename T>
inline hmatrix<T> castor::operator-(hmatrix<T> const &Ah, hmatrix<T> const &Bh)
template<typename T>
inline hmatrix<T> castor::operator-(hmatrix<T> const &Ah, T b)
template<typename T>
inline hmatrix<T> castor::operator-(hmatrix<T> const &Ah)

External hmatrix unitary minus or substraction : Ch = -Ah, Ch = Ah - b, Ch = Ah - Bh.

operator*

template<typename T>
inline hmatrix<T> castor::operator*(T a, hmatrix<T> const &Bh)
template<typename T>
inline hmatrix<T> castor::operator*(hmatrix<T> const &Ah, T b)

External hmatrix terms by terms scalar multiplication : Ch = Ah * b.

operator/

template<typename T>
inline hmatrix<T> castor::operator/(hmatrix<T> const &Ah, T b)

External hmatrix terms by terms scalar division : Ch = Ah / b.

operator+=

hmatrix<T> &castor::hmatrix::operator+=(hmatrix<T> const &Bh)
hmatrix<T> &castor::hmatrix::operator+=(T b)

In-place addition of hmatrix or scalar : Ah -> Ah + b, Ah -> Ah + Bh.

operator*=

hmatrix<T> &castor::hmatrix::operator*=(T b)

In-place hmatrix scalar multiplication : Ah -> Ah*b.