00001 00002 // $Id: doc.H,v 1.8 2009/10/01 17:01:55 stanchen Exp $ 00003 00004 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00005 * This header file is just for generating doxygen documentation. 00006 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00007 00008 00009 #ifndef _DOC_H 00010 #define _DOC_H 00011 00012 00013 /** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** 00014 * Boost Matrix class 00015 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00016 template<typename T> 00017 class matrix 00018 { 00019 public: 00020 /** Type for representing size values. **/ 00021 typedef size_t size_type; 00022 00023 /** Creates empty object. **/ 00024 matrix(); 00025 00026 /** Creates object w/ @p size1 rows, @p size 2 columns. 00027 * Matrix values are uninitialized. 00028 **/ 00029 matrix(size_type size1, size_type size2); 00030 00031 /** Copy constructor. **/ 00032 matrix(const matrix& m); 00033 00034 /** Resizes object to @p size1 rows, @p size 2 columns. 00035 * Existing values are preserved, but new values are 00036 * uninitialized. 00037 **/ 00038 void resize(size_type size1, size_type size2); 00039 00040 /** Returns number of rows. **/ 00041 size_type size1() const; 00042 00043 /** Returns number of columns. **/ 00044 size_type size2() const; 00045 00046 /** Sets all values to 0; keeps size unchanged. **/ 00047 void clear(); 00048 00049 /** Swaps value of this object and that of the matrix @p m. **/ 00050 void swap(matrix& m); 00051 00052 /** Returns value of element in @p i-th row and @p j-th column 00053 * (C++ only). 00054 * For example, for a matrix <tt>m</tt>, you can use a 00055 * syntax like <tt>m(2, 3)</tt> to access an element. 00056 * Rows and columns are numbered starting from 0. 00057 * @note Only available in C++. 00058 **/ 00059 const T& operator()(size_type i, size_type j) const; 00060 00061 /** Returns reference to element in @p i-th row and @p j-th column 00062 * (C++ only). 00063 * For example, for a matrix <tt>m</tt>, you can use a 00064 * syntax like <tt>m(3, 0) = 4</tt> to assign an element. 00065 * Rows and columns are numbered starting from 0. 00066 * @note Only available in C++. 00067 **/ 00068 T& operator()(size_type i, size_type j); 00069 00070 /** Returns value of element in @p i-th row and @p j-th column, 00071 * if elements are a primitive type, e.g., int, double, etc. 00072 * (non-C++ only). 00073 * Rows and columns are numbered starting from 0. 00074 * @note Only available in Java, Py, etc. 00075 **/ 00076 T get(size_type i, size_type j) const; 00077 00078 /** Returns reference to element in @p i-th row and @p j-th column, 00079 * if elements are non-primitive type, i.e., objects (non-C++ only). 00080 * Rows and columns are numbered starting from 0. 00081 * @note Only available in Java, Py, etc. 00082 **/ 00083 T& get(size_type i, size_type j); 00084 00085 /** Sets value of element in @p i-th row and @p j-th column to @p val 00086 * (non-C++ only). 00087 * Rows and columns are numbered starting from 0. 00088 * @note Only available in Java, Py, etc. 00089 **/ 00090 void set(size_type i, size_type j, const T& val); 00091 }; 00092 00093 00094 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00095 * 00096 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00097 00098 #endif 00099 00100