Go to the documentation of this file.00001 #ifndef __NEW_MAT_TRIANGULAR_MATRIX_H__
00002 #define __NEW_MAT_TRIANGULAR_MATRIX_H__
00003
00005 class UpperTriangularMatrix : public GeneralMatrix
00006 {
00007 GeneralMatrix* Image() const;
00008 public:
00009 UpperTriangularMatrix() {}
00010 ~UpperTriangularMatrix() {}
00011 UpperTriangularMatrix(ArrayLengthSpecifier);
00012 void operator=(const BaseMatrix&);
00013 void operator=(const UpperTriangularMatrix& m) { Eq(m); }
00014 UpperTriangularMatrix(const BaseMatrix&);
00015 UpperTriangularMatrix(const UpperTriangularMatrix& gm)
00016 : GeneralMatrix() { GetMatrix(&gm); }
00017 void operator=(Real f) { GeneralMatrix::operator=(f); }
00018 Real& operator()(int, int);
00019 Real& element(int, int);
00020 Real operator()(int, int) const;
00021 Real element(int, int) const;
00022 #ifdef SETUP_C_SUBSCRIPTS
00023 Real* operator[](int m) { return store+m*ncols_val-(m*(m+1))/2; }
00024 const Real* operator[](int m) const
00025 { return store+m*ncols_val-(m*(m+1))/2; }
00026 #endif
00027 MatrixType type() const;
00028 GeneralMatrix* MakeSolver() { return this; }
00029 void Solver(MatrixColX&, const MatrixColX&);
00030 LogAndSign log_determinant() const;
00031 Real trace() const;
00032 void GetRow(MatrixRowCol&);
00033 void GetCol(MatrixRowCol&);
00034 void GetCol(MatrixColX&);
00035 void RestoreCol(MatrixRowCol&);
00036 void RestoreCol(MatrixColX& c) { RestoreCol((MatrixRowCol&)c); }
00037 void NextRow(MatrixRowCol&);
00038 void resize(int);
00039 void ReSize(int m) { resize(m); }
00040 void resize(const GeneralMatrix& A);
00041 void ReSize(const GeneralMatrix& A) { resize(A); }
00042 void resize_keep(int);
00043 MatrixBandWidth bandwidth() const;
00044 void operator+=(const UpperTriangularMatrix& M) { PlusEqual(M); }
00045 void operator-=(const UpperTriangularMatrix& M) { MinusEqual(M); }
00046 void operator+=(Real f) { GeneralMatrix::operator+=(f); }
00047 void operator-=(Real f) { GeneralMatrix::operator-=(f); }
00048 void swap(UpperTriangularMatrix& gm)
00049 { GeneralMatrix::swap((GeneralMatrix&)gm); }
00050 NEW_DELETE(UpperTriangularMatrix)
00051 };
00052
00054 class LowerTriangularMatrix : public GeneralMatrix
00055 {
00056 GeneralMatrix* Image() const;
00057 public:
00058 LowerTriangularMatrix() {}
00059 ~LowerTriangularMatrix() {}
00060 LowerTriangularMatrix(ArrayLengthSpecifier);
00061 LowerTriangularMatrix(const LowerTriangularMatrix& gm)
00062 : GeneralMatrix() { GetMatrix(&gm); }
00063 LowerTriangularMatrix(const BaseMatrix& M);
00064 void operator=(const BaseMatrix&);
00065 void operator=(Real f) { GeneralMatrix::operator=(f); }
00066 void operator=(const LowerTriangularMatrix& m) { Eq(m); }
00067 Real& operator()(int, int);
00068 Real& element(int, int);
00069 Real operator()(int, int) const;
00070 Real element(int, int) const;
00071 #ifdef SETUP_C_SUBSCRIPTS
00072 Real* operator[](int m) { return store+(m*(m+1))/2; }
00073 const Real* operator[](int m) const { return store+(m*(m+1))/2; }
00074 #endif
00075 MatrixType type() const;
00076 GeneralMatrix* MakeSolver() { return this; }
00077 void Solver(MatrixColX&, const MatrixColX&);
00078 LogAndSign log_determinant() const;
00079 Real trace() const;
00080 void GetRow(MatrixRowCol&);
00081 void GetCol(MatrixRowCol&);
00082 void GetCol(MatrixColX&);
00083 void RestoreCol(MatrixRowCol&);
00084 void RestoreCol(MatrixColX& c) { RestoreCol((MatrixRowCol&)c); }
00085 void NextRow(MatrixRowCol&);
00086 void resize(int);
00087 void ReSize(int m) { resize(m); }
00088 void resize_keep(int);
00089 void resize(const GeneralMatrix& A);
00090 void ReSize(const GeneralMatrix& A) { resize(A); }
00091 MatrixBandWidth bandwidth() const;
00092 void operator+=(const LowerTriangularMatrix& M) { PlusEqual(M); }
00093 void operator-=(const LowerTriangularMatrix& M) { MinusEqual(M); }
00094 void operator+=(Real f) { GeneralMatrix::operator+=(f); }
00095 void operator-=(Real f) { GeneralMatrix::operator-=(f); }
00096 void swap(LowerTriangularMatrix& gm)
00097 { GeneralMatrix::swap((GeneralMatrix&)gm); }
00098 NEW_DELETE(LowerTriangularMatrix)
00099 };
00100
00101 #endif
00102