30 template<
typename Real>
34 KaldiBlasInt rows =
static_cast<int>(this->num_rows_);
42 KALDI_ERR <<
"Call to CLAPACK stptri_ function failed";
43 }
else if (result > 0) {
48 template<
typename Real>
53 int rows =
static_cast<int>(this->num_rows_);
58 int result = clapack_Xtrtri( rows, tmp.
Data(), tmp.
Stride());
62 KALDI_ERR <<
"Call to ATLAS strtri function failed";
63 }
else if (result > 0) {
66 (*this).CopyFromMat(tmp);
70 template<
typename Real>
76 return static_cast<Real
>(det);
80 template<
typename Real>
87 template<
typename Real>
92 Real *data = this->
data_, *jdata = data;
93 const Real *orig_jdata = orig.
Data();
100 jdata[k] = s = (orig_jdata[k] - s)/kdata[k];
104 d = orig_jdata[
j] -
d;
108 jdata[
j] = std::sqrt(d);
110 KALDI_ERR <<
"Cholesky decomposition failed. Maybe matrix " 111 "is not positive definite.";
116 template<
typename Real>
122 const Real *in_i = M.
Data();
124 Real *out_i = this->
data_;
131 const Real *in_i = M.
Data();
133 Real *out_i = this->
data_;
136 out_i[
j] = in_i[stride*
j];
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Packed symetric matrix class.
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
Base class which provides matrix operations not involving resizing or allocation. ...
const Real * Data() const
Gives pointer to raw data (const).
void swap(basic_filebuf< CharT, Traits > &x, basic_filebuf< CharT, Traits > &y)
A class for storing matrices.
MatrixIndexT NumRows() const
Real Determinant()
Returns the determinant of the matrix (product of diagonals)
float cblas_Xdot(const int N, const float *const X, const int incX, const float *const Y, const int incY)
void Cholesky(const SpMatrix< Real > &orig)
MatrixIndexT Stride() const
Stride (distance in memory between each row). Will be >= NumCols.
void clapack_Xtptri(KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *result)
Packed symetric matrix class.
#define KALDI_ASSERT(cond)
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
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.