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

Cross Class Reference

#include <cross.hpp>

Inheritance diagram for Cross:

Inheritance graph
[legend]
Collaboration diagram for Cross:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class of Cross approximation method to find skeleton decomposition of matrix.

Class find skeleton decomposition of real mxn matrix A by adaptive Cross approximation method with intermidiate 1-rank approximation. Implementation based on the algorithm described in "A Parallel Implementation of the Matrix Cross Approximation Method" D. A. Zheltkov and E. E. Tyrtyshnikov, 2015, https://www.mathnet.ru/vmp548.

Definition at line 30 of file cross.hpp.

Public Types

enum  mv_mode { normal, transpose }
 Matrix for which operations be used: matrix itself or its transpose. More...

Public Member Functions

 Cross (const Matrix &M)
 Initialize Cross approximation for matrix M.
void Approximate (double _eps)
 Find Cross approximation with tolerance paramater eps.
double GetEps () const
 Get last used tolerance eps.
unsigned GetNumRows () const
 Get number of rows.
unsigned GetNumCols () const
 Get number of columns.
double elem (unsigned i, unsigned j) const
 Get element in position i,j.
const MatrixGetM () const
 Get the original matrix.
const MatrixGetU () const
 Return U factor of skeleton decomposition.
const MatrixGetV () const
 Return V factor of skeleton decomposition.
 ~Cross ()
 The destructor.
unsigned GetRank () const
 Get rank of matrix.
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.
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 [inherited]
 

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

Cross::Cross const Matrix M  ) 
 

Initialize Cross approximation for matrix M.

Definition at line 4 of file cross.cpp.

Cross::~Cross  ) 
 

The destructor.

Definition at line 9 of file cross.cpp.


Member Function Documentation

void Cross::Approximate double  _eps  ) 
 

Find Cross approximation with tolerance paramater eps.

Definition at line 110 of file cross.cpp.

References IndexList::AddIndex(), ReallocatableMatrix::elem(), MatrixSub::elem(), Matrix::GetCol(), IndexList::GetFirstNotListed(), GetNumCols(), GetNumRows(), Matrix::GetRow(), and ReallocatableMatrix::Resize().

double Cross::GetEps  )  const
 

Get last used tolerance eps.

Definition at line 37 of file cross.cpp.

unsigned Cross::GetNumRows  )  const [virtual]
 

Get number of rows.

Implements Matrix.

Definition at line 26 of file cross.cpp.

References Matrix::GetNumRows().

Referenced by Approximate(), and elem().

unsigned Cross::GetNumCols  )  const [virtual]
 

Get number of columns.

Implements Matrix.

Definition at line 31 of file cross.cpp.

References Matrix::GetNumCols().

Referenced by Approximate(), and elem().

double Cross::elem unsigned  i,
unsigned  j
const [virtual]
 

Get element in position i,j.

Implements Matrix.

Definition at line 42 of file cross.cpp.

References GetNumCols(), and GetNumRows().

const Matrix & Cross::GetM  )  const [virtual]
 

Get the original matrix.

Implements Skeleton.

Definition at line 11 of file cross.cpp.

const Matrix & Cross::GetU  )  const [virtual]
 

Return U factor of skeleton decomposition.

Implements Skeleton.

Definition at line 16 of file cross.cpp.

const Matrix & Cross::GetV  )  const [virtual]
 

Return V factor of skeleton decomposition.

Implements Skeleton.

Definition at line 21 of file cross.cpp.

unsigned Skeleton::GetRank  )  const [inherited]
 

Get rank of matrix.

Definition at line 7 of file skeleton.cpp.

References Skeleton::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().

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

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(), Skeleton::GetU(), Skeleton::GetV(), Skeleton::normal, and Skeleton::rank.

Referenced by SmoluchowskiCalcFast::calc_L5().

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

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(), Skeleton::GetU(), Skeleton::GetV(), Skeleton::normal, and Skeleton::rank.

Referenced by SmoluchowskiCalcFast::calc_L4().

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

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(), Skeleton::GetU(), Skeleton::GetV(), Skeleton::normal, and Skeleton::rank.

Referenced by SmoluchowskiCalcFast::calc_L3().

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


Member Data Documentation

unsigned Skeleton::rank [protected, inherited]
 

Definition at line 24 of file skeleton.hpp.

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


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