irlba
A C++ library for IRLBA
Loading...
Searching...
No Matches
irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ > Class Template Referencefinal

Deferred centering of a matrix. More...

#include <centered.hpp>

Inheritance diagram for irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >:
Collaboration diagram for irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >:

Public Member Functions

 CenteredMatrix (const MatrixPointer_ &matrix, const CenterPointer_ &center)
 
Eigen::Index rows () const
 
Eigen::Index cols () const
 
std::unique_ptr< Workspace< EigenVector_ > > new_workspace () const
 
std::unique_ptr< AdjointWorkspace< EigenVector_ > > new_adjoint_workspace () const
 
std::unique_ptr< RealizeWorkspace< EigenMatrix_ > > new_realize_workspace () const
 
std::unique_ptr< CenteredWorkspace< EigenVector_, I< decltype(*my_matrix)>, I< decltype(*my_center)> > > new_known_workspace () const
 
std::unique_ptr< CenteredAdjointWorkspace< EigenVector_, I< decltype(*my_matrix)>, I< decltype(*my_center)> > > new_known_adjoint_workspace () const
 
std::unique_ptr< CenteredRealizeWorkspace< EigenMatrix_, I< decltype(*my_matrix)>, I< decltype(*my_center)> > > new_known_realize_workspace () const
 
- Public Member Functions inherited from irlba::Matrix< EigenVector_, EigenMatrix_ >
std::unique_ptr< Workspace< EigenVector_ > > new_known_workspace () const
 
std::unique_ptr< AdjointWorkspace< EigenVector_ > > new_known_adjoint_workspace () const
 
std::unique_ptr< RealizeWorkspace< EigenMatrix_ > > new_known_realize_workspace () const
 

Detailed Description

template<class EigenVector_, class EigenMatrix_, class MatrixPointer_ = const Matrix<EigenVector_, EigenMatrix_>*, class CenterPointer_ = const EigenVector_*>
class irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >

Deferred centering of a matrix.

Template Parameters
EigenVector_A floating-point Eigen::Vector to be used as input/output of multiplication operations.
EigenMatrix_A dense floating-point Eigen::Matrix in which to store the realized matrix. Typically of the same scalar type as EigenVector_.
MatrixPointer_Pointer to an instance of a class satisfying the Matrix interface. This can be a smart or raw pointer.
CenterPointer_Pointer to an instance of an Eigen vector class to hold the column centers. This can be a smart or raw pointer.

This class computes the matrix-vector product after centering all columns in the matrix, i.e., subtracting the mean of each column from the values of that column. Naively doing such an operation would involve loss of sparsity, which we avoid by deferring the subtraction into the subspace defined by right.

Constructor & Destructor Documentation

◆ CenteredMatrix()

template<class EigenVector_ , class EigenMatrix_ , class MatrixPointer_ = const Matrix<EigenVector_, EigenMatrix_>*, class CenterPointer_ = const EigenVector_*>
irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >::CenteredMatrix ( const MatrixPointer_ & matrix,
const CenterPointer_ & center )
inline
Parameters
matrixPointer to a matrix to be column-centered.
centerPointer to a vector of length equal to the number of columns of matrix, containing the value to subtract from each column.

Member Function Documentation

◆ cols()

template<class EigenVector_ , class EigenMatrix_ , class MatrixPointer_ = const Matrix<EigenVector_, EigenMatrix_>*, class CenterPointer_ = const EigenVector_*>
Eigen::Index irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >::cols ( ) const
inlinevirtual
Returns
Number of columns in the matrix.

Implements irlba::Matrix< EigenVector_, EigenMatrix_ >.

◆ new_adjoint_workspace()

template<class EigenVector_ , class EigenMatrix_ , class MatrixPointer_ = const Matrix<EigenVector_, EigenMatrix_>*, class CenterPointer_ = const EigenVector_*>
std::unique_ptr< AdjointWorkspace< EigenVector_ > > irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >::new_adjoint_workspace ( ) const
inlinevirtual
Returns
Pointer to a new workspace for adjoint matrix multiplication. The lifetime of this object should not exceed that of its parent Matrix.

Implements irlba::Matrix< EigenVector_, EigenMatrix_ >.

◆ new_known_adjoint_workspace()

template<class EigenVector_ , class EigenMatrix_ , class MatrixPointer_ = const Matrix<EigenVector_, EigenMatrix_>*, class CenterPointer_ = const EigenVector_*>
std::unique_ptr< CenteredAdjointWorkspace< EigenVector_, I< decltype(*my_matrix)>, I< decltype(*my_center)> > > irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >::new_known_adjoint_workspace ( ) const
inline

Overrides Matrix::new_known_adjoint_workspace() to enable devirtualization.

◆ new_known_realize_workspace()

template<class EigenVector_ , class EigenMatrix_ , class MatrixPointer_ = const Matrix<EigenVector_, EigenMatrix_>*, class CenterPointer_ = const EigenVector_*>
std::unique_ptr< CenteredRealizeWorkspace< EigenMatrix_, I< decltype(*my_matrix)>, I< decltype(*my_center)> > > irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >::new_known_realize_workspace ( ) const
inline

Overrides Matrix::new_known_realize_workspace() to enable devirtualization.

◆ new_known_workspace()

template<class EigenVector_ , class EigenMatrix_ , class MatrixPointer_ = const Matrix<EigenVector_, EigenMatrix_>*, class CenterPointer_ = const EigenVector_*>
std::unique_ptr< CenteredWorkspace< EigenVector_, I< decltype(*my_matrix)>, I< decltype(*my_center)> > > irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >::new_known_workspace ( ) const
inline

Overrides Matrix::new_known_workspace() to enable devirtualization.

◆ new_realize_workspace()

template<class EigenVector_ , class EigenMatrix_ , class MatrixPointer_ = const Matrix<EigenVector_, EigenMatrix_>*, class CenterPointer_ = const EigenVector_*>
std::unique_ptr< RealizeWorkspace< EigenMatrix_ > > irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >::new_realize_workspace ( ) const
inlinevirtual
Returns
Pointer to a new workspace for matrix realization. The lifetime of this object should not exceed that of its parent Matrix.

Implements irlba::Matrix< EigenVector_, EigenMatrix_ >.

◆ new_workspace()

template<class EigenVector_ , class EigenMatrix_ , class MatrixPointer_ = const Matrix<EigenVector_, EigenMatrix_>*, class CenterPointer_ = const EigenVector_*>
std::unique_ptr< Workspace< EigenVector_ > > irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >::new_workspace ( ) const
inlinevirtual
Returns
Pointer to a new workspace for matrix multiplication. The lifetime of this object should not exceed that of its parent Matrix.

Implements irlba::Matrix< EigenVector_, EigenMatrix_ >.

◆ rows()

template<class EigenVector_ , class EigenMatrix_ , class MatrixPointer_ = const Matrix<EigenVector_, EigenMatrix_>*, class CenterPointer_ = const EigenVector_*>
Eigen::Index irlba::CenteredMatrix< EigenVector_, EigenMatrix_, MatrixPointer_, CenterPointer_ >::rows ( ) const
inlinevirtual
Returns
Number of rows in the matrix.

Implements irlba::Matrix< EigenVector_, EigenMatrix_ >.


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