Packed symetric matrix class. More...
#include <matrix-common.h>
Public Member Functions | |
TpMatrix () | |
TpMatrix (MatrixIndexT r, MatrixResizeType resize_type=kSetZero) | |
TpMatrix (const TpMatrix< Real > &orig) | |
TpMatrix (const CuTpMatrix< Real > &cu) | |
Copy constructor from CUDA TpMatrix This is defined in ../cudamatrix/cu-tp-matrix.cc. More... | |
template<typename OtherReal > | |
TpMatrix (const TpMatrix< OtherReal > &orig) | |
Real | operator() (MatrixIndexT r, MatrixIndexT c) const |
Real & | operator() (MatrixIndexT r, MatrixIndexT c) |
void | Cholesky (const SpMatrix< Real > &orig) |
void | Invert () |
void | InvertDouble () |
void | Swap (TpMatrix< Real > *other) |
Shallow swap. More... | |
Real | Determinant () |
Returns the determinant of the matrix (product of diagonals) More... | |
void | CopyFromMat (const MatrixBase< Real > &M, MatrixTransposeType Trans=kNoTrans) |
CopyFromMat copies the lower triangle of M into *this (or the upper triangle, if Trans == kTrans). More... | |
void | CopyFromMat (const CuTpMatrix< Real > &other) |
This is implemented in ../cudamatrix/cu-tp-matrix.cc. More... | |
void | CopyFromTp (const TpMatrix< Real > &other) |
CopyFromTp copies another triangular matrix into this one. More... | |
template<typename OtherReal > | |
void | CopyFromTp (const TpMatrix< OtherReal > &other) |
void | AddTp (const Real alpha, const TpMatrix< Real > &M) |
AddTp does *this += alpha * M. More... | |
TpMatrix< Real > & | operator= (const TpMatrix< Real > &other) |
void | Resize (MatrixIndexT nRows, MatrixResizeType resize_type=kSetZero) |
Public Member Functions inherited from PackedMatrix< Real > | |
PackedMatrix () | |
PackedMatrix (MatrixIndexT r, MatrixResizeType resize_type=kSetZero) | |
PackedMatrix (const PackedMatrix< Real > &orig) | |
template<typename OtherReal > | |
PackedMatrix (const PackedMatrix< OtherReal > &orig) | |
void | SetZero () |
void | SetUnit () |
< Set to zero More... | |
void | SetRandn () |
< Set to unit matrix. More... | |
Real | Trace () const |
< Set to random values of a normal distribution More... | |
PackedMatrix< Real > & | operator= (const PackedMatrix< Real > &other) |
~PackedMatrix () | |
void | Resize (MatrixIndexT nRows, MatrixResizeType resize_type=kSetZero) |
Set packed matrix to a specified size (can be zero). More... | |
void | AddToDiag (const Real r) |
void | ScaleDiag (const Real alpha) |
void | SetDiag (const Real alpha) |
template<typename OtherReal > | |
void | CopyFromPacked (const PackedMatrix< OtherReal > &orig) |
template<typename OtherReal > | |
void | CopyFromVec (const SubVector< OtherReal > &orig) |
CopyFromVec just interprets the vector as having the same layout as the packed matrix. More... | |
Real * | Data () |
const Real * | Data () const |
MatrixIndexT | NumRows () const |
MatrixIndexT | NumCols () const |
size_t | SizeInBytes () const |
Real | operator() (MatrixIndexT r, MatrixIndexT c) const |
Real & | operator() (MatrixIndexT r, MatrixIndexT c) |
Real | Max () const |
Real | Min () const |
void | Scale (Real c) |
void | Read (std::istream &in, bool binary, bool add=false) |
void | Write (std::ostream &out, bool binary) const |
void | Destroy () |
void | Swap (PackedMatrix< Real > *other) |
Swaps the contents of *this and *other. Shallow swap. More... | |
void | Swap (Matrix< Real > *other) |
Friends | |
class | CuTpMatrix< float > |
class | CuTpMatrix< double > |
Additional Inherited Members | |
Protected Member Functions inherited from PackedMatrix< Real > | |
void | AddPacked (const Real alpha, const PackedMatrix< Real > &M) |
Protected Attributes inherited from PackedMatrix< Real > | |
Real * | data_ |
MatrixIndexT | num_rows_ |
Packed symetric matrix class.
Definition at line 63 of file matrix-common.h.
|
inline |
Definition at line 40 of file tp-matrix.h.
Referenced by TpMatrix< float >::TpMatrix().
|
inlineexplicit |
Definition at line 41 of file tp-matrix.h.
Definition at line 43 of file tp-matrix.h.
|
explicit |
Copy constructor from CUDA TpMatrix This is defined in ../cudamatrix/cu-tp-matrix.cc.
Definition at line 114 of file cu-tp-matrix.cc.
Definition at line 50 of file tp-matrix.h.
|
inline |
AddTp does *this += alpha * M.
Definition at line 113 of file tp-matrix.h.
void Cholesky | ( | const SpMatrix< Real > & | orig | ) |
Definition at line 88 of file tp-matrix.cc.
Referenced by SpMatrix< float >::ApplyFloor(), CuMatrixBase< float >::Cholesky(), kaldi::CholeskyUnitTestTr(), IvectorExtractorStats::CommitStatsForW(), Fmpe::ComputeC(), kaldi::ComputeFeatureNormalizingTransform(), AmSgmm2::ComputeFmllrPreXform(), Sgmm2Project::ComputeLdaTransform(), kaldi::ComputeNormalizingTransform(), LdaEstimate::Estimate(), BasisFmllrEstimate::EstimateFmllrBasis(), FeatureTransformEstimate::EstimateInternal(), SpMatrix< float >::IsPosDef(), SpMatrix< float >::LogPosDefDet(), main(), TpMatrix< float >::operator()(), FullGmm::Perturb(), CompressedAffineXformStats::PrepareOneG(), rand_posdef_spmatrix(), kaldi::unittest::RandPosdefSpMatrix(), RandPosdefSpMatrix(), kaldi::RandPosdefSpMatrix(), MleAmSgmm2Updater::RenormalizeV(), OnlineNaturalGradient::ReorthogonalizeRt1(), OnlinePreconditioner::ReorthogonalizeXt1(), kaldi::SolveDoubleQuadraticMatrixProblem(), FullGmm::Split(), CuMatrixBase< float >::SymInvertPosDef(), kaldi::UnitTestCuTpMatrixCholesky(), kaldi::UnitTestPldaEstimation(), and PldaUnsupervisedAdaptor::UpdatePlda().
void CopyFromMat | ( | const MatrixBase< Real > & | M, |
MatrixTransposeType | Trans = kNoTrans |
||
) |
CopyFromMat copies the lower triangle of M into *this (or the upper triangle, if Trans == kTrans).
Definition at line 117 of file tp-matrix.cc.
Referenced by TpMatrix< float >::CopyFromMat(), TpMatrix< float >::InvertDouble(), kaldi::UnitTestCuTpMatrixCopyFromMat(), and kaldi::UnitTestSymAddMat2().
void CopyFromMat | ( | const CuTpMatrix< Real > & | other | ) |
This is implemented in ../cudamatrix/cu-tp-matrix.cc.
Definition at line 122 of file cu-tp-matrix.cc.
|
inline |
CopyFromTp copies another triangular matrix into this one.
Definition at line 104 of file tp-matrix.h.
Referenced by FeatureTransformEstimate::EstimateInternal(), and kaldi::UnitTestTpInvert().
Definition at line 108 of file tp-matrix.h.
Real Determinant | ( | ) |
Returns the determinant of the matrix (product of diagonals)
Definition at line 71 of file tp-matrix.cc.
Referenced by TpMatrix< float >::InvertDouble().
void Invert | ( | ) |
Definition at line 31 of file tp-matrix.cc.
Referenced by SpMatrix< float >::ApplyFloor(), CuMatrixBase< float >::Cholesky(), kaldi::CholeskyUnitTestTr(), Sgmm2Project::ComputeLdaTransform(), kaldi::ComputeNormalizingTransform(), TpMatrix< float >::Invert(), TpMatrix< float >::InvertDouble(), main(), TpMatrix< float >::operator()(), MleAmSgmm2Updater::RenormalizeV(), OnlineNaturalGradient::ReorthogonalizeRt1(), OnlinePreconditioner::ReorthogonalizeXt1(), kaldi::SolveDoubleQuadraticMatrixProblem(), kaldi::UnitTestPldaEstimation(), kaldi::UnitTestTpInvert(), and PldaUnsupervisedAdaptor::UpdatePlda().
|
inline |
Definition at line 83 of file tp-matrix.h.
Referenced by kaldi::ComputeFeatureNormalizingTransform(), AmSgmm2::ComputeFmllrPreXform(), and BasisFmllrEstimate::EstimateFmllrBasis().
|
inline |
Definition at line 53 of file tp-matrix.h.
|
inline |
Definition at line 67 of file tp-matrix.h.
Definition at line 117 of file tp-matrix.h.
|
inline |
Definition at line 124 of file tp-matrix.h.
Referenced by FeatureTransformEstimate::EstimateInternal().
void Swap | ( | TpMatrix< Real > * | other | ) |
Shallow swap.
Definition at line 81 of file tp-matrix.cc.
Referenced by TpMatrix< float >::InvertDouble().
|
friend |
Definition at line 38 of file tp-matrix.h.
|
friend |
Definition at line 37 of file tp-matrix.h.