00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifdef DOXYGEN_INCLUDE_ONLY_FOR_DOCS
00020
00021 #include <iostream>
00022
00024 namespace TooN
00025 {
00026
00112 template<int Rows, int Cols>
00113 class Matrix
00114 {
00115 public:
00117
00118
00121 initialise the vector to any particular values.
00123 Matrix();
00124
00137 Matrix(double darray[Rows*Cols]);
00138
00148 Matrix(double darray[Rows][Cols]);
00149
00151 Matrix(const Matrix<Rows, Cols>& from);
00152
00154
00155
00157
00158
00161 are mismatched.
00162 Matrix<Rows, Cols>& operator=(const Matrix<Rows, Cols>& from);
00163
00165 resize(int rows, int cols);
00166
00176 const double& operator() (int r, int c) const;
00177
00189 double& operator() (int r, int c);
00190
00205 const Vector& operator[] (int r) const;
00206
00223 Vector& operator[] (int r);
00224
00226 int num_rows() const;
00227
00229 int num_cols() const;
00230
00232 {RowMajor, ColMajor} layout const;
00234
00236
00237
00250 const Matrix<Cols, Rows>& T() const;
00251
00269 Matrix<Cols, Rows>& T();
00270
00282 template<Rstart, Cstart, Rsize, Csize>
00283 const Matrix<Rsize, Csize>& slice() const;
00284
00296 template<Rstart, Cstart, Rsize, Csize>
00297 Matrix<Rsize, Csize>& slice();
00298
00309 const Matrix<>& slice(int rstart, int cstart, int rsize, int csize) const;
00310
00320 Matrix<>& slice(int rstart, int cstart, int rsize, int csize);
00321
00323 };
00324
00326
00327
00334 template <int Rows, Cols>
00335 std::ostream& operator<< (std::ostream& os, const Matrix<Rows, Cols>& v);
00336
00343 template <int Rows, Cols>
00344 std::istream& operator<< (std::istream& is, Matrix<Rows, Cols>& v);
00346
00347
00348 }
00349
00350 #endif