Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

Skeleton Class Reference

#include <skeleton.hpp>

Inheritance diagram for Skeleton:

Inheritance graph
[legend]
Collaboration diagram for Skeleton:

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstract class of skeleton/rank decomposition of matrix.

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 MatrixGetM () const =0
 Return matrix of which skeleton decomposition is made.
virtual const MatrixGetU () const =0
 Return U factor of skeleton decomposition.
virtual const MatrixGetV () 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


Member Enumeration Documentation

enum Skeleton::mv_mode
 

Matrix for which operations be used: matrix itself or its transpose.

Enumeration values:
normal 
transpose 

Definition at line 37 of file skeleton.hpp.


Constructor & Destructor Documentation

Skeleton::Skeleton unsigned  r  ) 
 

Initialize skeleton decompostion of rank r.

Definition at line 3 of file skeleton.cpp.

Skeleton::~Skeleton  ) 
 

The destructor.

Definition at line 12 of file skeleton.cpp.


Member Function Documentation

unsigned Skeleton::GetRank  )  const
 

Get rank of matrix.

Definition at line 7 of file skeleton.cpp.

References rank.

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(), SmoluchowskiCalcFast::fix_f_arg(), SmoluchowskiCalcDirect::fix_f_arg(), and SmoluchowskiCalcFast::SmoluchowskiCalcFast().

virtual const Matrix& Skeleton::GetM  )  const [pure virtual]
 

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().

virtual const Matrix& Skeleton::GetU  )  const [pure virtual]
 

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().

virtual const Matrix& Skeleton::GetV  )  const [pure virtual]
 

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().

void Skeleton::MatvecF double  alpha,
const double *  vec,
double *  res,
double *  calc,
mv_mode  mode = normal
const
 

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.

Parameters:
alpha real scalar multiplier
vec double vector of size n
res double vector of size m; the result will be save in res
calc double vector of size r; required to calculation
mode if mode=normal then A=M else A=M.T

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().

void Skeleton::MatvecUT double  alpha,
const double *  vec,
double *  res,
mv_mode  mode = normal
const
 

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.

Parameters:
alpha real scalar multiplier
vec double vector of size n
res double vector of size m; the result will be save in res
mode if mode=normal then A=M else A=M.T

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().

void Skeleton::MatvecLT double  alpha,
const double *  vec,
double *  res,
mv_mode  mode = normal
const
 

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.

Parameters:
alpha real scalar multiplier
vec double vector of size n
res double vector of size m; the result will be save in res
mode if mode=normal then A=M else A=M.T

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().

virtual unsigned Matrix::GetNumRows  )  const [pure virtual, inherited]
 

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().

virtual unsigned Matrix::GetNumCols  )  const [pure virtual, inherited]
 

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().

virtual double Matrix::elem unsigned  i,
unsigned  j
const [pure virtual, inherited]
 

Get element in position i,j.

Implemented in Cross, MatrixSum, MatrixSub, ReallocatableMatrix, and FunctionMatrix.

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(), SmoluchowskiCalcFast::calc_L3(), SmoluchowskiCalcDirect::calc_L3(), SmoluchowskiCalcFast::calc_L4(), SmoluchowskiCalcDirect::calc_L4(), SmoluchowskiCalcFast::calc_L5(), SmoluchowskiCalcDirect::calc_L5(), Matrix::Column::elem(), Matrix::Row::elem(), SmoluchowskiCalcFast::fix_f_arg(), SmoluchowskiCalcDirect::fix_f_arg(), MatvecF(), MatvecLT(), and MatvecUT().

Matrix::Row Matrix::GetRow unsigned  i  )  const [inherited]
 

Get view of i row of matrix.

Definition at line 19 of file matrix.cpp.

Referenced by Cross::Approximate().

Matrix::Column Matrix::GetCol unsigned  j  )  const [inherited]
 

Get view of j column of matrix.

Definition at line 39 of file matrix.cpp.

Referenced by Cross::Approximate().


Member Data Documentation

unsigned Skeleton::rank [protected]
 

Definition at line 24 of file skeleton.hpp.

Referenced by GetRank(), MatvecF(), MatvecLT(), and MatvecUT().


The documentation for this class was generated from the following files:
Generated on Sun May 25 01:58:11 2025 for SmoluchowskiSolver by Doxygen