doc/matrixdoc.h

00001 /*
00002     Copyright (c) 2005 Paul Smith
00003 
00004     Permission is granted to copy, distribute and/or modify this document under
00005     the terms of the GNU Free Documentation License, Version 1.2 or any later
00006     version published by the Free Software Foundation; with no Invariant
00007     Sections, no Front-Cover Texts, and no Back-Cover Texts.
00008 
00009     You should have received a copy of the GNU Free Documentation License
00010     License along with this library; if not, write to the Free Software
00011     Foundation, Inc.
00012     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00013 
00014 */
00015 // A proxy version of the Matrix class,
00016 // cleaned up to present a comprehensible
00017 // version of the Mector interface
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

Generated on Thu May 7 20:28:40 2009 for TooN by  doxygen 1.5.3