Doxygen 1.9.1
Toolkit for Adaptive Stochastic Modeling and Non-Intrusive ApproximatioN: Tasmanian v8.2 (development)
TasGrid::TasSparse::WaveletBasisMatrix Class Reference

Used to manipulate the wavelet values and solve for the wavelet coefficients. More...

#include <tsgLinearSolvers.hpp>

Public Member Functions

 WaveletBasisMatrix ()
 Default constructor, create an empty matrix.
 
 WaveletBasisMatrix (AccelerationContext const *acceleration, const std::vector< int > &lpntr, const std::vector< std::vector< int >> &lindx, const std::vector< std::vector< double >> &lvals)
 Initialize the matrix with the given set of indexes.
 
 WaveletBasisMatrix (AccelerationContext const *acceleration, int cnum_rows, GpuVector< double > &&matrix)
 Initialize the matrix in dense mode with the given data.
 
 ~WaveletBasisMatrix ()=default
 Default destructor.
 
 WaveletBasisMatrix (WaveletBasisMatrix const &)=delete
 Cannot copy.
 
 WaveletBasisMatrix (WaveletBasisMatrix &&)=default
 Move constructor.
 
WaveletBasisMatrixoperator= (WaveletBasisMatrix const &)=delete
 Cannot copy.
 
WaveletBasisMatrixoperator= (WaveletBasisMatrix &&)=default
 Move assignment.
 
bool isSparse () const
 Return true if using the sparse mode and false is using dense mode or empty.
 
bool isDense () const
 Return true if using the dense mode and false is using sparse mode or empty.
 
int getNumRows () const
 Return the number of rows in the matrix.
 
void invertTransposed (AccelerationContext const *acceleration, double b[]) const
 Overwrites vector b with x that solves $ A^T x = b $.
 
void invert (AccelerationContext const *acceleration, int num_colums, double B[])
 Overwrites the row-major matrix B with X that solves $ A X = B $.
 
template<bool transpose, bool blas>
void solve (const double b[], double x[]) const
 Solve op(A) x = b where op is either identity (find the coefficients) or transpose (find the interpolation weights).
 

Static Public Member Functions

static bool useDense (AccelerationContext const *acceleration, int nrows)
 Decide between sparse and dense variant of the algorithms.
 

Protected Member Functions

void factorize (AccelerationContext const *acceleration)
 Computes the factorization of the matrix, ILU or PLU using the provided acceleration context (called by the constructor).
 
void computeILU ()
 Compute the incomplete lower-upper decomposition of the matrix (zero extra fill).
 
template<bool transpose>
void applyILU (double x[]) const
 Apply the preconditioner on a vector.
 
template<bool transpose>
void apply (double const x[], double r[]) const
 Sets to be the product of the sparse matrix times x.
 
void residual (double const x[], double const b[], double r[]) const
 Computes the residual.
 

Static Protected Attributes

static constexpr bool use_transpose = true
 Expressive call to transpose method.
 
static constexpr bool no_transpose = false
 Expressive call to no transpose method.
 
static constexpr bool use_blas = true
 Expressive call to blas variant method.
 
static constexpr bool no_blas = false
 Expressive call to no-blas variant method.
 

Detailed Description

Used to manipulate the wavelet values and solve for the wavelet coefficients.


The documentation for this class was generated from the following file: