CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
Loading...
Searching...
No Matches
cla3p::lra::RankModerator< T_Matrix > Class Template Reference

The rank moderator class. More...

Constructors

 RankModerator ()
 Default constructor.
 RankModerator (T_RScalar tol, lraMethod_t method, T_RScalar ref=autoReference())
 The parameterized constructor.
 ~RankModerator ()
 Destructor.

Arguments

T_RScalar cutTolerance () const
 The cutoff tolerance.
lraMethod_t reductionMethod () const
 The reduction method.
T_RScalar maxReference () const
 The reference value.
void setCutTolerance (T_RScalar tol)
 Sets the cutoff tolerance.
void setReductionMethod (lraMethod_t method)
 Sets the reduction method.
void setMaxReference (T_RScalar ref)
 The reference value.

Public Member Functions

void clear ()
 Clears the rank moderator.
XxMatrix< T_Matrix > reduce (const T_Matrix &mat) const
 Full-rank to low-rank convertor.

Advanced Public Member Functions

XxMatrix< T_Matrix > reduceUsingDefaultSVD (const T_Matrix &mat, DefaultSVD< T_Matrix > &svd) const
 Full-rank to low-rank convertor.
XxMatrix< T_Matrix > reduceUsingFastQR (const T_Matrix &mat, PartialQR< T_Matrix > &pqr, DefaultSVD< T_Matrix > &svd) const
 Full-rank to low-rank convertor.

Global Options

static constexpr T_RScalar autoReference ()
 Reference value will be set automaticaly.

Detailed Description

template<typename T_Matrix>
class cla3p::lra::RankModerator< T_Matrix >

The rank moderator class.

Controls the rank truncation strategy for low-rank approximations based on singular values.

Template Parameters
T_MatrixThe matrix type (e.g., dns::XxMatrix<T_Scalar>).

Constructor & Destructor Documentation

◆ RankModerator() [1/2]

template<typename T_Matrix>
cla3p::lra::RankModerator< T_Matrix >::RankModerator ( )

Default constructor.

Creates a rank moderator with default parameter values.

◆ RankModerator() [2/2]

template<typename T_Matrix>
cla3p::lra::RankModerator< T_Matrix >::RankModerator ( T_RScalar tol,
lraMethod_t method,
T_RScalar ref = autoReference() )
explicit

The parameterized constructor.

Constructs a rank moderator with user defined parameters. Ranks kept must satisfy \( \sigma_j > \mathrm{ref} \cdot \mathrm{tol} \).

Parameters
[in]tolThe cutoff tolerance.
[in]methodThe reduction method.
[in]refUse an auto/fixed value as reference. If negative, the maximum singular value will be used instead.

◆ ~RankModerator()

template<typename T_Matrix>
cla3p::lra::RankModerator< T_Matrix >::~RankModerator ( )

Destructor.

Destroys the rank moderator object.

Member Function Documentation

◆ cutTolerance()

template<typename T_Matrix>
T_RScalar cla3p::lra::RankModerator< T_Matrix >::cutTolerance ( ) const

The cutoff tolerance.

Controls the level of detail in the low-rank matrix. Ranks kept must satisfy \( \sigma_j > \mathrm{maxReference}() \cdot \mathrm{cutTolerance}() \).

Returns
The cutoff tolerance value.

◆ reductionMethod()

template<typename T_Matrix>
lraMethod_t cla3p::lra::RankModerator< T_Matrix >::reductionMethod ( ) const

The reduction method.

Controls the full-rank to low-rank conversion method.

Returns
The reduction method.

◆ maxReference()

template<typename T_Matrix>
T_RScalar cla3p::lra::RankModerator< T_Matrix >::maxReference ( ) const

The reference value.

Controls the level of detail in the low-rank matrix. Ranks kept must satisfy \( \sigma_j > \mathrm{maxReference}() \cdot \mathrm{cutTolerance}() \). If negative, the maximum singular value will be used instead.

Returns
The reference value.

◆ setCutTolerance()

template<typename T_Matrix>
void cla3p::lra::RankModerator< T_Matrix >::setCutTolerance ( T_RScalar tol)

Sets the cutoff tolerance.

Controls the level of detail in the low-rank matrix. Ranks kept must satisfy \( \sigma_j > \mathrm{maxReference}() \cdot \mathrm{cutTolerance}() \).

Parameters
[in]tolThe desired cutoff tolerance.

◆ setReductionMethod()

template<typename T_Matrix>
void cla3p::lra::RankModerator< T_Matrix >::setReductionMethod ( lraMethod_t method)

Sets the reduction method.

Controls the full-rank to low-rank conversion method.

Parameters
[in]methodThe desired reduction method.

◆ setMaxReference()

template<typename T_Matrix>
void cla3p::lra::RankModerator< T_Matrix >::setMaxReference ( T_RScalar ref)

The reference value.

Controls the level of detail in the low-rank matrix. Ranks kept must satisfy \( \sigma_j > \mathrm{maxReference}() \cdot \mathrm{cutTolerance}() \). If negative, the maximum singular value will be used instead.

Parameters
[in]refThe desired auto/fixed reference value.

◆ clear()

template<typename T_Matrix>
void cla3p::lra::RankModerator< T_Matrix >::clear ( )

Clears the rank moderator.

Resets all members to match those of the default rank moderator.

◆ reduce()

template<typename T_Matrix>
XxMatrix< T_Matrix > cla3p::lra::RankModerator< T_Matrix >::reduce ( const T_Matrix & mat) const

Full-rank to low-rank convertor.

Converts a full rank dense matrix to low-rank using internal parameterization.

Parameters
[in]matThe dense matrix to be reduced.
Returns
The low-rank approximation of mat.

◆ reduceUsingDefaultSVD()

template<typename T_Matrix>
XxMatrix< T_Matrix > cla3p::lra::RankModerator< T_Matrix >::reduceUsingDefaultSVD ( const T_Matrix & mat,
DefaultSVD< T_Matrix > & svd ) const

Full-rank to low-rank convertor.

Converts a full rank dense matrix to low-rank using the standard SVD method. A user parameterized svd object is supplied in order to avoid repeated (de-)allocations.

Parameters
[in]matThe dense matrix to be reduced.
[in,out]svdThe Singular Value Decomposition object to be used.
Returns
The low-rank approximation of mat.

◆ reduceUsingFastQR()

template<typename T_Matrix>
XxMatrix< T_Matrix > cla3p::lra::RankModerator< T_Matrix >::reduceUsingFastQR ( const T_Matrix & mat,
PartialQR< T_Matrix > & pqr,
DefaultSVD< T_Matrix > & svd ) const

Full-rank to low-rank convertor.

Converts a full rank dense matrix to low-rank using the hybrid QR/SVD method. User parameterized pqr/svd objects are supplied in order to avoid repeated (de-)allocations.

Parameters
[in]matThe dense matrix to be reduced.
[in,out]pqrThe Partial QR Decomposition object to be used.
[in,out]svdThe Singular Value Decomposition object to be used.
Returns
The low-rank approximation of mat.

◆ autoReference()

template<typename T_Matrix>
constexpr T_RScalar cla3p::lra::RankModerator< T_Matrix >::autoReference ( )
inlinestaticconstexpr

Reference value will be set automaticaly.

The default value for automatic deduction of the reference value \( \sigma_{\mathrm{max}} \).

Returns
The automatic reference sentinel value.