22 #ifndef KALDI_MATRIX_TP_MATRIX_H_ 23 #define KALDI_MATRIX_TP_MATRIX_H_ 32 template<
typename Real>
class TpMatrix;
35 template<
typename Real>
36 class TpMatrix :
public PackedMatrix<Real> {
54 if (static_cast<UnsignedMatrixIndexT>(c) >
55 static_cast<UnsignedMatrixIndexT>(r)) {
57 static_cast<UnsignedMatrixIndexT>(this->
num_rows_));
61 static_cast<UnsignedMatrixIndexT>(this->
num_rows_));
63 return *(this->
data_ + (r*(r+1)) / 2 + c);
69 static_cast<UnsignedMatrixIndexT>(this->
num_rows_));
71 static_cast<UnsignedMatrixIndexT>(r) &&
72 "you cannot access the upper triangle of TpMatrix using " 73 "a non-const matrix object.");
74 return *(this->
data_ + (r*(r+1)) / 2 + c);
86 (*this).CopyFromTp(dmat);
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Packed symetric matrix class.
Real operator()(MatrixIndexT r, MatrixIndexT c) const
Base class which provides matrix operations not involving resizing or allocation. ...
void Resize(MatrixIndexT nRows, MatrixResizeType resize_type=kSetZero)
void AddPacked(const Real alpha, const PackedMatrix< Real > &M)
TpMatrix(MatrixIndexT r, MatrixResizeType resize_type=kSetZero)
void AddTp(const Real alpha, const TpMatrix< Real > &M)
AddTp does *this += alpha * M.
Real Determinant()
Returns the determinant of the matrix (product of diagonals)
void CopyFromTp(const TpMatrix< OtherReal > &other)
TpMatrix(const TpMatrix< OtherReal > &orig)
void Cholesky(const SpMatrix< Real > &orig)
Packed matrix: base class for triangular and symmetric matrices.
Packed symetric matrix class.
TpMatrix< Real > & operator=(const TpMatrix< Real > &other)
void CopyFromTp(const TpMatrix< Real > &other)
CopyFromTp copies another triangular matrix into this one.
PackedMatrix< Real > & operator=(const PackedMatrix< Real > &other)
TpMatrix(const TpMatrix< Real > &orig)
void CopyFromPacked(const PackedMatrix< OtherReal > &orig)
#define KALDI_ASSERT(cond)
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)...
void Swap(TpMatrix< Real > *other)
Shallow swap.
void Resize(MatrixIndexT nRows, MatrixResizeType resize_type=kSetZero)
Set packed matrix to a specified size (can be zero).