#include <skeleton.hpp>
Inheritance diagram for Skeleton:
Class stored skeleton decomposition of real mxn matrix M that is M = U * V.T where U and V is real matrices of sizes mxr and nxr. This class implement functions to fast calculation of matvec with M, M.T or their upper/lower triangular parts.
Definition at line 22 of file skeleton.hpp.
Public Types | |
enum | mv_mode { normal, transpose } |
Matrix for which operations be used: matrix itself or its transpose. More... | |
Public Member Functions | |
Skeleton (unsigned r) | |
Initialize skeleton decompostion of rank r. | |
unsigned | GetRank () const |
Get rank of matrix. | |
virtual const Matrix & | GetM () const =0 |
Return matrix of which skeleton decomposition is made. | |
virtual const Matrix & | GetU () const =0 |
Return U factor of skeleton decomposition. | |
virtual const Matrix & | GetV () const =0 |
Return V factor of skeleton decomposition. | |
void | MatvecF (double alpha, const double *vec, double *res, double *calc, mv_mode mode=normal) const |
Matvec with Full part of matrix. | |
void | MatvecUT (double alpha, const double *vec, double *res, mv_mode mode=normal) const |
Matvec with Upper Triangular part of matrix. | |
void | MatvecLT (double alpha, const double *vec, double *res, mv_mode mode=normal) const |
Matvec with Lower Triangular part of matrix. | |
~Skeleton () | |
The destructor. | |
virtual unsigned | GetNumRows () const =0 |
Get number of rows. | |
virtual unsigned | GetNumCols () const =0 |
Get number of columns. | |
virtual double | elem (unsigned i, unsigned j) const =0 |
Get element in position i,j. | |
Row | GetRow (unsigned i) const |
Get view of i row of matrix. | |
Column | GetCol (unsigned j) const |
Get view of j column of matrix. | |
Protected Attributes | |
unsigned | rank |
|
Matrix for which operations be used: matrix itself or its transpose.
Definition at line 37 of file skeleton.hpp. |
|
Initialize skeleton decompostion of rank r.
Definition at line 3 of file skeleton.cpp. |
|
The destructor.
Definition at line 12 of file skeleton.cpp. |
|
|
Return matrix of which skeleton decomposition is made.
Implemented in Cross. Referenced by SmoluchowskiCalcFast::calc_L3(), SmoluchowskiCalcDirect::calc_L3(), SmoluchowskiCalcFast::calc_L4(), SmoluchowskiCalcDirect::calc_L4(), SmoluchowskiCalcFast::calc_L5(), and SmoluchowskiCalcDirect::calc_L5(). |
|
Return U factor of skeleton decomposition.
Implemented in Cross. Referenced by SmoluchowskiCalcFast::calc_L1(), SmoluchowskiCalcDirect::calc_L1(), SmoluchowskiCalcFast::calc_L2(), SmoluchowskiCalcDirect::calc_L2(), SmoluchowskiCalcFast::fix_f_arg(), SmoluchowskiCalcDirect::fix_f_arg(), MatvecF(), MatvecLT(), and MatvecUT(). |
|
Return V factor of skeleton decomposition.
Implemented in Cross. Referenced by SmoluchowskiCalcFast::calc_L1(), SmoluchowskiCalcDirect::calc_L1(), SmoluchowskiCalcFast::calc_L1_fix_f(), SmoluchowskiCalcDirect::calc_L1_fix_f(), SmoluchowskiCalcFast::calc_L2(), SmoluchowskiCalcDirect::calc_L2(), SmoluchowskiCalcFast::calc_L2_fix_f(), SmoluchowskiCalcDirect::calc_L2_fix_f(), MatvecF(), MatvecLT(), and MatvecUT(). |
|
Matvec with Full part of matrix. Calculate res = alpha * A * vec, where A is mxn matrix (A equal M or M.T) with rank r.
Definition at line 16 of file skeleton.cpp. References Matrix::elem(), Matrix::GetNumCols(), Matrix::GetNumRows(), GetU(), GetV(), normal, and rank. Referenced by SmoluchowskiCalcFast::calc_L5(). |
|
Matvec with Upper Triangular part of matrix. Calculate res = alpha * upper_triangular_part(A) * vec, where A is mxn matrix (A equal M or M.T), upper_triangular_part(A) is a mxn matrix which upper triangular part equal to A.
Definition at line 41 of file skeleton.cpp. References Matrix::elem(), Matrix::GetNumCols(), Matrix::GetNumRows(), GetU(), GetV(), normal, and rank. Referenced by SmoluchowskiCalcFast::calc_L4(). |
|
Matvec with Lower Triangular part of matrix. Calculate res = alpha * lower_triangular_part(A) * vec, where A is mxn matrix (A equal M or M.T), lower_triangular_part(A) is a mxn matrix which lower triangular part equal to A.
Definition at line 67 of file skeleton.cpp. References Matrix::elem(), Matrix::GetNumCols(), Matrix::GetNumRows(), GetU(), GetV(), normal, and rank. Referenced by SmoluchowskiCalcFast::calc_L3(). |
|
Get number of rows.
Implemented in Cross, MatrixBinExpr, ReallocatableMatrix, and FunctionMatrix. Referenced by MatrixBinExpr::GetNumRows(), Cross::GetNumRows(), Matrix::Column::GetSize(), MatrixBinExpr::MatrixBinExpr(), MatvecF(), MatvecLT(), and MatvecUT(). |
|
Get number of columns.
Implemented in Cross, MatrixBinExpr, ReallocatableMatrix, and FunctionMatrix. Referenced by MatrixBinExpr::GetNumCols(), Cross::GetNumCols(), Matrix::Row::GetSize(), MatrixBinExpr::MatrixBinExpr(), MatvecF(), MatvecLT(), and MatvecUT(). |
|
|
Get view of i row of matrix.
Definition at line 19 of file matrix.cpp. Referenced by Cross::Approximate(). |
|
Get view of j column of matrix.
Definition at line 39 of file matrix.cpp. Referenced by Cross::Approximate(). |
|
Definition at line 24 of file skeleton.hpp. Referenced by GetRank(), MatvecF(), MatvecLT(), and MatvecUT(). |