23 #ifndef SELDON_FILE_MATRIX_TRIANGULAR_HXX
25 #include "../share/Common.hxx"
26 #include "../share/Properties.hxx"
27 #include "../share/Storage.hxx"
28 #include "../share/Errors.hxx"
29 #include "../share/Allocator.hxx"
36 template <
class T,
class Prop,
class Storage,
class Allocator
37 =
typename SeldonDefaultAllocator<Storage, T>::allocator>
42 typedef typename Allocator::value_type value_type;
43 typedef typename Allocator::pointer pointer;
44 typedef typename Allocator::const_pointer const_pointer;
45 typedef typename Allocator::reference reference;
46 typedef typename Allocator::const_reference const_reference;
47 typedef typename Allocator::value_type entry_type;
48 typedef typename Allocator::value_type access_type;
49 typedef typename Allocator::value_type const_access_type;
61 Storage, Allocator>& A);
74 void SetData(
int i,
int j, pointer data);
78 const value_type
operator() (
int i,
int j)
const;
79 const_reference
Val(
int i,
int j)
const;
80 reference
Val(
int i,
int j);
81 const_reference
Get(
int i,
int j)
const;
82 reference
Get(
int i,
int j);
87 void Set(
int i,
int j,
const T& x);
95 void Fill(
const T0& x);
102 void Print(
int a,
int b,
int m,
int n)
const;
103 void Print(
int l)
const;
106 void Write(
string FileName)
const;
107 void Write(ostream& FileStream)
const;
109 void WriteText(ostream& FileStream)
const;
110 void Read(
string FileName);
111 void Read(istream& FileStream);
115 #ifdef SELDON_WITH_VIRTUAL
116 typedef typename ClassComplexType<T>::Treal Treal;
117 typedef typename ClassComplexType<T>::Tcplx Tcplx;
119 virtual void MltAddVector(
const Treal& alpha,
const Vector<Treal>& x,
122 virtual void MltAddVector(
const Tcplx& alpha,
const Vector<Tcplx>& x,
142 virtual bool IsSymmetric()
const;
149 template <
class T,
class Prop,
class Allocator>
155 typedef typename Allocator::value_type value_type;
156 typedef Prop property;
158 typedef Allocator allocator;
162 explicit Matrix(
int i,
int j);
175 template <
class T,
class Prop,
class Allocator>
181 typedef typename Allocator::value_type value_type;
182 typedef Prop property;
184 typedef Allocator allocator;
188 explicit Matrix(
int i,
int j);
201 template <
class T,
class Prop,
class Allocator>
207 typedef typename Allocator::value_type value_type;
208 typedef Prop property;
210 typedef Allocator allocator;
214 explicit Matrix(
int i,
int j);
227 template <
class T,
class Prop,
class Allocator>
233 typedef typename Allocator::value_type value_type;
234 typedef Prop property;
236 typedef Allocator allocator;
240 explicit Matrix(
int i,
int j);
253 #define SELDON_FILE_MATRIX_TRIANGULAR_HXX
void Nullify()
Clears the matrix without releasing memory.
reference operator[](int i)
Access to elements of the data array.
Base class for all matrices.
void Read(string FileName)
Reads the matrix from a file.
const_reference Val(int i, int j) const
Access operator.
Column-major lower-triangular full-matrix class.
Matrix_Triangular()
Default constructor.
Row-major lower-triangular full-matrix class.
void ReadText(string FileName)
Reads the matrix from a file.
void Write(string FileName) const
Writes the matrix in a file.
void WriteText(string FileName) const
Writes the matrix in a file.
void Clear()
Clears the matrix.
Row-major upper-triangular full-matrix class.
size_t GetMemorySize() const
Returns size of A in bytes used to store the matrix.
void Print() const
Displays the matrix on the standard output.
void Zero()
Sets all elements to zero.
void Resize(int i, int j)
Reallocates memory to resize the matrix and keeps previous entries.
Column-major upper-triangular full-matrix class.
~Matrix_Triangular()
Destructor.
void SetData(int i, int j, pointer data)
Changes the size of the matrix and sets its data array (low level method).
void Fill()
Fills the matrix with 0, 1, 2, ...
long GetDataSize() const
Returns the number of elements stored in memory.
const_reference Get(int i, int j) const
Returns the element (i, j)
Matrix_Triangular< T, Prop, Storage, Allocator > & operator=(const Matrix_Triangular< T, Prop, Storage, Allocator > &A)
Duplicates a matrix (assignment operator).
void SetIdentity()
Sets the matrix to the identity.
void Set(int i, int j, const T &x)
Sets an element of the matrix.
void Copy(const Matrix_Triangular< T, Prop, Storage, Allocator > &A)
Duplicates a matrix.
const value_type operator()(int i, int j) const
Access operator.
void Reallocate(int i, int j)
Reallocates memory to resize the matrix.
void FillRand()
Fills the matrix randomly.
Triangular matrix stored in a full matrix.