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_HERMPACKED_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_HermPacked: 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
00050
00051 public:
00052
00053 Matrix_HermPacked();
00054 Matrix_HermPacked(int i, int j = 0);
00055
00056
00057 ~Matrix_HermPacked();
00058 void Clear();
00059
00060
00061 int GetDataSize() const;
00062
00063
00064 void Reallocate(int i, int j);
00065 void SetData(int i, int j, pointer data);
00066
00067
00068 value_type operator() (int i, int j);
00069 value_type operator() (int i, int j) const;
00070 reference Val(int i, int j);
00071 const_reference Val(int i, int j) const;
00072 reference operator[] (int i);
00073 const_reference operator[] (int i) const;
00074 Matrix_HermPacked<T, Prop, Storage, Allocator>&
00075 operator= (const Matrix_HermPacked<T, Prop, Storage, Allocator>& A);
00076 void Copy(const Matrix_HermPacked<T, Prop, Storage, Allocator>& A);
00077
00078
00079 void Zero();
00080 void SetIdentity();
00081 void Fill();
00082 template <class T0>
00083 void Fill(const T0& x);
00084 template <class T0>
00085 Matrix_HermPacked<T, Prop, Storage, Allocator>& operator= (const T0& x);
00086 void FillRand();
00087 void Print() const;
00088 void Print(int a, int b, int m, int n) const;
00089 void Print(int l) const;
00090
00091
00092 value_type GetNormInf() const;
00093
00094
00095 void Write(string FileName) const;
00096 void Write(ofstream& FileStream) const;
00097 void WriteText(string FileName) const;
00098 void WriteText(ofstream& FileStream) const;
00099 void Read(string FileName);
00100 void Read(ifstream& FileStream);
00101
00102 };
00103
00104
00106 template <class T, class Prop, class Allocator>
00107 class Matrix<T, Prop, ColHermPacked, Allocator>:
00108 public Matrix_HermPacked<T, Prop, ColHermPacked, Allocator>
00109 {
00110 public:
00111 Matrix();
00112 Matrix(int i, int j = 0);
00113
00114 template <class T0>
00115 Matrix<T, Prop, ColHermPacked, Allocator>& operator= (const T0& x);
00116 };
00117
00118
00120 template <class T, class Prop, class Allocator>
00121 class Matrix<T, Prop, RowHermPacked, Allocator>:
00122 public Matrix_HermPacked<T, Prop, RowHermPacked, Allocator>
00123 {
00124 public:
00125 Matrix();
00126 Matrix(int i, int j = 0);
00127
00128 template <class T0>
00129 Matrix<T, Prop, RowHermPacked, Allocator>& operator= (const T0& x);
00130 };
00131
00132
00133 }
00134
00135 #define SELDON_FILE_MATRIX_HERMPACKED_HXX
00136 #endif