21 #ifndef SELDON_FILE_MATRIX_PETSCMATRIX_HXX
24 #include "../share/Common.hxx"
25 #include "../share/Properties.hxx"
26 #include "../share/Storage.hxx"
27 #include "../share/Errors.hxx"
28 #include "../share/Allocator.hxx"
38 template <
class T,
class Prop,
class Storage,
class Allocator
39 =
typename SeldonDefaultAllocator<VectFull, T>::allocator>
44 typedef typename Allocator::value_type value_type;
45 typedef typename Allocator::pointer pointer;
46 typedef typename Allocator::const_pointer const_pointer;
47 typedef typename Allocator::reference reference;
48 typedef typename Allocator::const_reference const_reference;
49 typedef typename Allocator::value_type entry_type;
50 typedef typename Allocator::value_type access_type;
51 typedef typename Allocator::value_type const_access_type;
84 void SetData(
int i,
int j, pointer data);
86 const_reference
Val(
int i,
int j)
const;
87 reference
Val(
int i,
int j);
90 void Set(
int,
int, T);
94 void Copy(
const Mat& A);
101 void Fill(
const T0& x);
104 void Print(
int a,
int b,
int m,
int n)
const;
105 void Print(
int l)
const;
108 void Write(
string FileName,
bool with_size)
const;
109 void Write(ostream& FileStream,
bool with_size)
const;
111 void WriteText(ostream& FileStream)
const;
113 void Read(
string FileName);
114 void Read(istream& FileStream);
120 template <
class T,
class Prop,
class Allocator>
125 typedef typename Allocator::value_type value_type;
126 typedef typename Allocator::pointer pointer;
127 typedef typename Allocator::const_pointer const_pointer;
128 typedef typename Allocator::reference reference;
129 typedef typename Allocator::const_reference const_reference;
130 typedef typename Allocator::value_type entry_type;
131 typedef typename Allocator::value_type access_type;
132 typedef typename Allocator::value_type const_access_type;
140 void Reallocate(
int i,
int j);
142 value_type operator() (
int i,
int j);
143 value_type operator() (
int i,
int j)
const;
153 template <
class T,
class Prop,
class Allocator>
158 typedef typename Allocator::value_type value_type;
159 typedef typename Allocator::pointer pointer;
160 typedef typename Allocator::const_pointer const_pointer;
161 typedef typename Allocator::reference reference;
162 typedef typename Allocator::const_reference const_reference;
163 typedef typename Allocator::value_type entry_type;
164 typedef typename Allocator::value_type access_type;
165 typedef typename Allocator::value_type const_access_type;
173 void Reallocate(
int i,
int j,
int local_i = PETSC_DECIDE,
174 int local_j = PETSC_DECIDE);
176 value_type operator() (
int i,
int j);
177 value_type operator() (
int i,
int j)
const;
187 template <
class T,
class Prop,
class Allocator>
192 typedef typename Allocator::value_type value_type;
193 typedef typename Allocator::pointer pointer;
194 typedef typename Allocator::const_pointer const_pointer;
195 typedef typename Allocator::reference reference;
196 typedef typename Allocator::const_reference const_reference;
197 typedef typename Allocator::value_type entry_type;
198 typedef typename Allocator::value_type access_type;
199 typedef typename Allocator::value_type const_access_type;
207 void Reallocate(
int i,
int j,
int local_i = PETSC_DECIDE,
208 int local_j = PETSC_DECIDE);
210 value_type operator() (
int i,
int j);
211 value_type operator() (
int i,
int j)
const;
217 template <
class T0,
class Allocator0>
220 int GetLocalM()
const;
221 int GetLocalN()
const;
230 #define SELDON_FILE_MATRIX_PETSCMATRIX_HXX