irlba
A C++ library for IRLBA
|
Wrapper for a scaled matrix. More...
#include <wrappers.hpp>
Public Member Functions | |
Scaled (const Matrix_ &matrix, const EigenVector_ &scale, bool divide) | |
Wrapper for a scaled matrix.
by_column_ | Whether to scale the columns. If false , scaling is applied to the rows instead. |
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.
|
inline |
matrix | Underlying matrix to be column-scaled (if by_column_ = true ) or row-scaled (otherwise). |
scale | Vector 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. |
divide | Whether to divide by the supplied scaling factors. |