31 KALDI_WARN <<
"Ignoring 'num_gs' (=" << num_gs <<
") argument since " 51 if (!binary) out <<
'\n';
54 if (!binary) out <<
'\n';
57 tmp_k.
Write(out, binary);
61 if (!binary) out <<
'\n';
63 end =
G_.end(); itr != end; ++itr) {
65 tmp_g.
Write(out, binary);
76 tmp_k.
Read(in, binary);
91 for (
size_t i = 0;
i <
G_.size();
i++) {
92 tmp_g.
Read(in, binary,
false );
96 G_[
i].AddSp(1.0, tmp_g_d);
98 G_[
i].CopyFromSp(tmp_g);
109 end =
G_.end(); it != end; ++it) {
119 for (
size_t i = 0;
i <
G_.size();
i++)
120 G_[
i].CopyFromSp(other.
G_[
i]);
128 for (
size_t i = 0;
i <
G_.size();
i++)
129 G_[
i].AddSp(1.0, other.
G_[
i]);
136 KALDI_WARN <<
"Empty matrix in ComposeTransforms";
162 KALDI_ERR <<
"ComposeTransforms: mismatched dimensions, a has " << a.
NumCols()
163 <<
" columns and b has " << b.
NumRows() <<
" rows.";
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void Write(std::ostream &out, bool binary) const
write to stream.
void Read(std::istream &in, bool binary, bool add=false)
void Write(std::ostream &out, bool binary) const
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
Base class which provides matrix operations not involving resizing or allocation. ...
void ReadBasicType(std::istream &is, bool binary, T *t)
ReadBasicType is the name of the read function for bool, integer types, and floating-point types...
void AddMat(const Real alpha, const MatrixBase< Real > &M, MatrixTransposeType transA=kNoTrans)
*this += alpha * M [or M^T]
void CopyFromMat(const MatrixBase< OtherReal > &M, MatrixTransposeType trans=kNoTrans)
Copy given matrix. (no resize is done).
MatrixIndexT NumRows() const
void CopyFromSp(const SpMatrix< Real > &other)
void CopyFromVec(const VectorBase< Real > &v)
Copy data from another vector (must match own size).
void Read(std::istream &in, bool binary, bool add=false)
read from stream.
void ExpectToken(std::istream &is, bool binary, const char *token)
ExpectToken tries to read in the given token, and throws an exception on failure. ...
void AddMatMat(const Real alpha, const MatrixBase< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, MatrixTransposeType transB, const Real beta)
void WriteToken(std::ostream &os, bool binary, const char *token)
The WriteToken functions are for writing nonempty sequences of non-space characters.
MatrixIndexT Dim() const
Returns the dimension of the vector.
void SetZero()
Sets matrix to zero.
void AddMatVec(const Real alpha, const MatrixBase< Real > &M, const MatrixTransposeType trans, const VectorBase< Real > &v, const Real beta)
Add matrix times vector : this <– beta*this + alpha*M*v.
A class representing a vector.
bool ComposeTransforms(const Matrix< BaseFloat > &a, const Matrix< BaseFloat > &b, bool b_is_affine, Matrix< BaseFloat > *c)
#define KALDI_ASSERT(cond)
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
void WriteBasicType(std::ostream &os, bool binary, T t)
WriteBasicType is the name of the write function for bool, integer types, and floating-point types...
void Resize(const MatrixIndexT r, const MatrixIndexT c, MatrixResizeType resize_type=kSetZero, MatrixStrideType stride_type=kDefaultStride)
Sets matrix to a specified size (zero is OK as long as both r and c are zero).
void Resize(MatrixIndexT nRows, MatrixResizeType resize_type=kSetZero)
Provides a vector abstraction class.
void ApplyAffineTransform(const MatrixBase< BaseFloat > &xform, VectorBase< BaseFloat > *vec)
Applies the affine transform 'xform' to the vector 'vec' and overwrites the contents of 'vec'...
Sub-matrix representation.
Represents a non-allocating general vector which can be defined as a sub-vector of higher-level vecto...