00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SELDON_FILE_MATRIX_HERMITIAN_HXX
00023
00024 #include "../Common/Common.hxx"
00025 #include "../Common/Properties.hxx"
00026 #include "../Common/Storage.hxx"
00027 #include "../Common/Errors.cxx"
00028 #include "../Common/Allocator.hxx"
00029
00030 namespace Seldon
00031 {
00032
00033
00035 template <class T, class Prop, class Storage,
00036 class Allocator = SELDON_DEFAULT_ALLOCATOR<T> >
00037 class Matrix_Hermitian: public Spacetown, public Matrix_Base<T, Allocator>
00038 {
00039
00040 public:
00041 typedef typename Allocator::value_type value_type;
00042 typedef typename Allocator::pointer pointer;
00043 typedef typename Allocator::const_pointer const_pointer;
00044 typedef typename Allocator::reference reference;
00045 typedef typename Allocator::const_reference const_reference;
00046
00047
00048 protected:
00049 pointer* me_;
00050
00051
00052 public:
00053
00054 Matrix_Hermitian();
00055 Matrix_Hermitian(int i, int j = 0);
00056
00057
00058 ~Matrix_Hermitian();
00059 void Clear();
00060
00061
00062 int GetDataSize() const;
00063
00064
00065 void Reallocate(int i, int j);
00066 void SetData(int i, int j, pointer data);
00067 void Nullify();
00068
00069
00070 value_type operator() (int i, int j);
00071 value_type operator() (int i, int j) const;
00072 const_reference Val(int i, int j) const;
00073 reference Val(int i, int j);
00074 reference operator[] (int i);
00075 const_reference operator[] (int i) const;
00076 Matrix_Hermitian<T, Prop, Storage, Allocator>&
00077 operator= (const Matrix_Hermitian<T, Prop, Storage, Allocator>& A);
00078 void Copy(const Matrix_Hermitian<T, Prop, Storage, Allocator>& A);
00079
00080
00081 void Zero();
00082 void SetIdentity();
00083 void Fill();
00084 template <class T0>
00085 void Fill(const T0& x);
00086 template <class T0>
00087 Matrix_Hermitian<T, Prop, Storage, Allocator>&
00088 operator= (const T0& x);
00089 void FillRand();
00090 void Print() const;
00091 void Print(int a, int b, int m, int n) const;
00092 void Print(int l) const;
00093
00094
00095 value_type GetNormInf() const;
00096
00097
00098 void Write(string FileName) const;
00099 void Write(ofstream& FileStream) const;
00100 void WriteText(string FileName) const;
00101 void WriteText(ofstream& FileStream) const;
00102 void Read(string FileName);
00103 void Read(ifstream& FileStream);
00104
00105 };
00106
00107
00109 template <class T, class Prop, class Allocator>
00110 class Matrix<T, Prop, ColHerm, Allocator>:
00111 public Matrix_Hermitian<T, Prop, ColHerm, Allocator>
00112 {
00113 public:
00114 Matrix() throw();
00115 Matrix(int i, int j = 0);
00116
00117 template <class T0>
00118 Matrix<T, Prop, ColHerm, Allocator>& operator= (const T0& x);
00119 };
00120
00121
00123 template <class T, class Prop, class Allocator>
00124 class Matrix<T, Prop, RowHerm, Allocator>:
00125 public Matrix_Hermitian<T, Prop, RowHerm, Allocator>
00126 {
00127 public:
00128 Matrix() throw();
00129 Matrix(int i, int j = 0);
00130
00131 template <class T0>
00132 Matrix<T, Prop, RowHerm, Allocator>& operator= (const T0& x);
00133 };
00134
00135
00136 }
00137
00138 #define SELDON_FILE_MATRIX_HERMITIAN_HXX
00139 #endif