00001 #ifndef included_CTBmatrixDsc
00002 #define included_CTBmatrixDsc 1
00003
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "CTBrange.hxx"
00017 #include "CTBvectorDsc.hxx"
00018
00019 template <class T>
00020 class CTBmatrixCDsc {
00021 public:
00022 CTBmatrixCDsc();
00023 CTBmatrixCDsc(const T* p_data, CTBint i_nrow,
00024 CTBint i_ncol);
00025 CTBmatrixCDsc(const T* p_data, CTBint i_nrow, CTBint i_ncol,
00026 CTBint i_strrow, CTBint i_strcol=1);
00027 CTBmatrixCDsc(const T* p_data, CTBint i_ncol,
00028 const CTBrange& rrow, const CTBrange& rcol);
00029
00030 const T* Data() const;
00031 CTBint NRow() const;
00032 CTBint NColumn() const;
00033 CTBint Size() const;
00034 CTBint StrideRow() const;
00035 CTBint StrideColumn() const;
00036
00037 CTBvectorCDsc<T> Row(CTBint i_row) const;
00038 CTBvectorCDsc<T> Column(CTBint i_col) const;
00039 CTBvectorCDsc<T> Diagonal() const;
00040
00041 void Dump(int i_indent=0, ostream& os=cout,
00042 const char* p_text=0) const;
00043
00044 CTBvectorCDsc<T> operator[](CTBint i_row) const;
00045
00046 const T& operator()(CTBint i_row, CTBint i_col) const;
00047
00048 bool operator!() const;
00049 operator void* () const;
00050
00051 protected:
00052
00053 T* mp_data;
00054 CTBint mi_nrow;
00055 CTBint mi_ncol;
00056 CTBint mi_strrow;
00057 CTBint mi_strcol;
00058 };
00059
00060 template <class T>
00061 ostream& operator<<(ostream& os, CTBmatrixCDsc<T> obj);
00062
00063
00064
00065 template <class T>
00066 class CTBmatrixDsc : public CTBmatrixCDsc<T> {
00067 public:
00068 CTBmatrixDsc();
00069 CTBmatrixDsc(T* p_data, CTBint i_nrow, CTBint i_ncol);
00070 CTBmatrixDsc(T* p_data, CTBint i_nrow, CTBint i_ncol,
00071 CTBint i_strrow, CTBint i_strcol=1);
00072 CTBmatrixDsc(T* p_data, CTBint i_ncol,
00073 const CTBrange& rrow, const CTBrange& rcol);
00074
00075 T* Data() const;
00076
00077 CTBvectorDsc<T> Row(CTBint i_row) const;
00078 CTBvectorDsc<T> Column(CTBint i_col) const;
00079 CTBvectorDsc<T> Diagonal() const;
00080
00081 CTBvectorDsc<T> operator[](CTBint i_row) const;
00082
00083 T& operator()(CTBint i_row, CTBint i_col) const;
00084
00085 const CTBmatrixDsc<T>& operator=(const T& rhs) const;
00086 const CTBmatrixDsc<T>& operator=(const CTBmatrixDsc<T>& rhs) const;
00087 const CTBmatrixDsc<T>& operator=(const CTBmatrixCDsc<T>& rhs) const;
00088 };
00089
00090
00091 #include "CTBmatrixDsc.icc"
00092
00093 #endif