kaldi-matrix-inl.h
Go to the documentation of this file.
1 // matrix/kaldi-matrix-inl.h
2 
3 // Copyright 2009-2011 Microsoft Corporation; Haihua Xu
4 
5 // See ../../COPYING for clarification regarding multiple authors
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15 // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16 // MERCHANTABLITY OR NON-INFRINGEMENT.
17 // See the Apache 2 License for the specific language governing permissions and
18 // limitations under the License.
19 
20 #ifndef KALDI_MATRIX_KALDI_MATRIX_INL_H_
21 #define KALDI_MATRIX_KALDI_MATRIX_INL_H_ 1
22 
23 #include "matrix/kaldi-vector.h"
24 
25 namespace kaldi {
26 
28 template<typename Real>
29 Matrix<Real>::Matrix(): MatrixBase<Real>(NULL, 0, 0, 0) { }
30 
31 
32 template<>
33 template<>
34 void MatrixBase<float>::AddVecVec(const float alpha, const VectorBase<float> &ra, const VectorBase<float> &rb);
35 
36 template<>
37 template<>
38 void MatrixBase<double>::AddVecVec(const double alpha, const VectorBase<double> &ra, const VectorBase<double> &rb);
39 
40 template<typename Real>
41 inline std::ostream & operator << (std::ostream & os, const MatrixBase<Real> & M) {
42  M.Write(os, false);
43  return os;
44 }
45 
46 template<typename Real>
47 inline std::istream & operator >> (std::istream & is, Matrix<Real> & M) {
48  M.Read(is, false);
49  return is;
50 }
51 
52 
53 template<typename Real>
54 inline std::istream & operator >> (std::istream & is, MatrixBase<Real> & M) {
55  M.Read(is, false);
56  return is;
57 }
58 
59 }// namespace kaldi
60 
61 
62 #endif // KALDI_MATRIX_KALDI_MATRIX_INL_H_
63 
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
Matrix()
Empty constructor.
Base class which provides matrix operations not involving resizing or allocation. ...
Definition: kaldi-matrix.h:49
A class for storing matrices.
Definition: kaldi-matrix.h:823
void Read(std::istream &in, bool binary, bool add=false)
stream read.
void Read(std::istream &in, bool binary, bool add=false)
read from stream.
std::istream & operator>>(std::istream &is, MatrixBase< Real > &M)