irlba
A C++ library for IRLBA
Loading...
Searching...
No Matches
Public Member Functions | List of all members
irlba::Scaled< column_, Matrix_, EigenVector_ > Class Template Reference

Wrapper for a scaled matrix. More...

#include <wrappers.hpp>

Public Member Functions

 Scaled (const Matrix_ &matrix, const EigenVector_ &scale, bool divide)
 

Detailed Description

template<bool column_, class Matrix_, class EigenVector_>
class irlba::Scaled< column_, Matrix_, EigenVector_ >

Wrapper for a scaled matrix.

Parameters
by_column_Whether to scale the columns. If false, scaling is applied to the rows instead.
Template Parameters
Matrix_Class satisfying the MockMatrix interface, or a floating-point Eigen::Matrix.
EigenVector_A floating-point Eigen::Vector class for the scaling factors and matrix-vector product.

This class computes the matrix-vector product after scaling all rows or columns in Matrix_, i.e., multiplying or dividing the values of each row/column by some arbitrary value. For example, we can use this to divide each column by the standard deviation to achieve unit variance in principal components analyses. Naively doing such an operation would involve a copy of the matrix, which we avoid by deferring the scaling into the subspace defined by rhs.

This class satisfies the MockMatrix interface and implements all of its methods/typedefs.

Constructor & Destructor Documentation

◆ Scaled()

template<bool column_, class Matrix_ , class EigenVector_ >
irlba::Scaled< column_, Matrix_, EigenVector_ >::Scaled ( const Matrix_ matrix,
const EigenVector_ scale,
bool  divide 
)
inline
Parameters
matrixUnderlying matrix to be column-scaled (if by_column_ = true) or row-scaled (otherwise).
scaleVector of length equal to the number of columns (if by_column_ = true) or rows (otherwise) of m, containing the scaling factor to divide (if divide = true) or multiply (otherwise) to each column/row.
divideWhether to divide by the supplied scaling factors.

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