Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

matrix_member_inline.hh

Go to the documentation of this file.
00001 #ifndef _MATRIX_MEMBER_INLINE_HH_
00002 #define _MATRIX_MEMBER_INLINE_HH_
00003 
00004 // This header contains the inline definitions of any inline
00005 // matrix member functions.  It is designed to be included in matrix.hh
00006 // and should not be used on its own.  Member functions that don't appear
00007 // here can be found in matrix.cc
00008 
00009 //
00010 // Matrix::MatrixData info
00011 //
00012 inline bool Matrix::MatrixData::IsEmpty() const {
00013   return l == 0;
00014 }
00015 inline bool Matrix::MatrixData::IsReal() const {
00016   return im == NULL;
00017 }
00018 inline bool Matrix::MatrixData::IsComplex() const {
00019   return im != NULL;
00020 }
00021 
00022 inline double* Matrix::GetPr() {
00023   return ref->GetPr();
00024 }
00025 inline const double* Matrix::GetPr() const {
00026   return ref->GetPr();
00027 }
00028 inline double* Matrix::GetPi() {
00029   return ref->GetPi();
00030 }
00031 inline const double* Matrix::GetPi() const {
00032   return ref->GetPi();
00033 }
00034 
00035 //
00036 // Arithmetic plus assign
00037 //
00038 inline Matrix& Matrix::operator += (const MatMTimesMat& M) {
00039   return MatMTimesMatPlusEq(*this,M.m1,M.m2);
00040 }
00041 inline Matrix& Matrix::operator += (const MatTimesMat& M) {
00042   return MatTimesMatPlusEq(*this,M.m1,M.m2);
00043 }
00044 inline Matrix& Matrix::operator += (const MatCrossMat& M) {
00045   return MatCrossMatPlusEq(*this,M.m1,M.m2);
00046 }
00047 inline Matrix& Matrix::operator *= (const Matrix& b) {
00048   *this = *this * b;
00049   return *this;
00050 }
00051 inline Matrix& Matrix::operator /= (const Matrix& b) {
00052   *this = *this / b;
00053   return *this;
00054 }
00055 
00056 //
00057 // Matrix indexing
00058 //
00059 
00060 template <class T>
00061 inline SubMatrix 
00062 Matrix::operator () (const T& idx) {
00063   return SubMatrix(this, idx);
00064 }
00065 
00066 template <class T>
00067 inline SubMatrix 
00068 Matrix::operator () (const T& idx) const {
00069   return SubMatrix(this, idx);
00070 }
00071 
00072 template <class T, class U>
00073 inline SubMatrix 
00074 Matrix::operator () (const T& idx, const U& jdx) {
00075   return SubMatrix(this, idx, jdx);
00076 }
00077 
00078 template <class T, class U>
00079 inline SubMatrix 
00080 Matrix::operator () (const T& idx, const U& jdx) const {
00081   return SubMatrix(this, idx, jdx);
00082 }
00083 
00084 //
00085 // Matrix info
00086 //
00087 inline void Matrix::Size(int *dims) const {
00088   dims[0] = ref->m;
00089   dims[1] = ref->n;
00090   return;
00091 }
00092 inline bool Matrix::IsEmpty() const {
00093   return ref->IsEmpty();
00094 }
00095 inline bool Matrix::IsDIN() const {
00096   return ref->isdin;
00097 }
00098 inline bool Matrix::IsColon() const {
00099   return ref->iscolon;
00100 }
00101 inline bool Matrix::IsVector() const {
00102   return ref->m == 1 || ref->n == 1;
00103 }
00104 inline bool Matrix::IsScalar() const {
00105   return ref->m == 1 && ref->n == 1;
00106 }
00107 inline bool Matrix::IsReal() const {
00108   return ref->IsReal();
00109 }
00110 inline bool Matrix::IsComplex() const {
00111   return ref->IsComplex();
00112 }
00113 
00114 //
00115 // Private members
00116 //
00117 inline void
00118 Matrix::Assign(const Matrix& mat) {
00119   ref.Assign(mat.ref);
00120 }
00121 
00122 #endif

Generated on Wed Jun 18 09:16:20 2003 for admc++ by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002