Matrix_ArrayComplexSparse.hxx
1 // Copyright (C) 2003-2011 Marc DuruflĂ©
2 //
3 // This file is part of the linear-algebra library Seldon,
4 // http://seldon.sourceforge.net/.
5 //
6 // Seldon is free software; you can redistribute it and/or modify it under the
7 // terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 2.1 of the License, or (at your option)
9 // any later version.
10 //
11 // Seldon is distributed in the hope that it will be useful, but WITHOUT ANY
12 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
14 // more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with Seldon. If not, see http://www.gnu.org/licenses/.
18 
19 
20 // To be included by Seldon.hxx
21 
22 #ifndef SELDON_FILE_MATRIX_ARRAY_COMPLEX_SPARSE_HXX
23 
24 namespace Seldon
25 {
26 
28  template<class T>
30  {
31  public :
32  typedef typename
34  ::allocator allocator;
35  };
36 
37  template<>
39  {
40  public:
41  typedef
42  SeldonDefaultAllocator<VectFull, float>::allocator allocator;
43  };
44 
45  template<>
47  {
48  public:
49  typedef
50  SeldonDefaultAllocator<VectFull, double>::allocator allocator;
51  };
52 
53  template<>
54  class SeldonDefaultAllocator<ArrayColComplexSparse, complex<long double> >
55  {
56  public:
57  typedef
58  SeldonDefaultAllocator<VectFull, long double>::allocator allocator;
59  };
60 
62  template<class T>
64  {
65  public :
66  typedef typename
68  ::allocator allocator;
69  };
70 
71  template<>
73  {
74  public:
75  typedef
76  SeldonDefaultAllocator<VectFull, float>::allocator allocator;
77  };
78 
79  template<>
81  {
82  public:
83  typedef
84  SeldonDefaultAllocator<VectFull, double>::allocator allocator;
85  };
86 
87  template<>
88  class SeldonDefaultAllocator<ArrayRowComplexSparse, complex<long double> >
89  {
90  public:
91  typedef
92  SeldonDefaultAllocator<VectFull, long double>::allocator allocator;
93  };
94 
95 
97  template<class T>
99  {
100  public :
101  typedef typename
103  ::allocator allocator;
104  };
105 
106  template<>
108  {
109  public:
110  typedef
111  SeldonDefaultAllocator<VectFull, float>::allocator allocator;
112  };
113 
114  template<>
116  {
117  public:
118  typedef
119  SeldonDefaultAllocator<VectFull, double>::allocator allocator;
120  };
121 
122  template<>
123  class SeldonDefaultAllocator<ArrayColSymComplexSparse, complex<long double> >
124  {
125  public:
126  typedef
127  SeldonDefaultAllocator<VectFull, long double>::allocator allocator;
128  };
129 
130 
132  template<class T>
134  {
135  public :
136  typedef typename
138  ::allocator allocator;
139  };
140 
141  template<>
143  {
144  public:
145  typedef
146  SeldonDefaultAllocator<VectFull, float>::allocator allocator;
147  };
148 
149  template<>
151  {
152  public:
153  typedef
154  SeldonDefaultAllocator<VectFull, double>::allocator allocator;
155  };
156 
157  template<>
158  class SeldonDefaultAllocator<ArrayRowSymComplexSparse, complex<long double> >
159  {
160  public:
161  typedef
162  SeldonDefaultAllocator<VectFull, long double>::allocator allocator;
163  };
164 
165 
167 
174  template <class T, class Prop, class Storage, class Allocator
175  = typename SeldonDefaultAllocator<Storage, T>::allocator>
177  {
178  // typedef declaration.
179  public:
180  typedef typename Allocator::value_type value_type;
181  typedef typename Allocator::pointer pointer;
182  typedef typename Allocator::const_pointer const_pointer;
183  typedef typename Allocator::reference reference;
184  typedef typename Allocator::const_reference const_reference;
185  typedef complex<value_type> entry_type;
186  typedef complex<value_type> access_type;
187  typedef complex<value_type> const_access_type;
188 
189  // Attributes.
190  protected:
197 
198  // Methods.
199  public:
200  // Constructors.
202  explicit Matrix_ArrayComplexSparse(int i, int j);
203 
204  // Destructor.
206  void Clear();
207 
208  // Memory management.
209  void Reallocate(int i, int j);
210  void Resize(int i, int j);
211 
212  // Basic methods.
213  long GetRealNonZeros() const;
214  long GetImagNonZeros() const;
215  long GetNonZeros() const;
216  long GetRealDataSize() const;
217  long GetImagDataSize() const;
218  long GetDataSize() const;
219  size_t GetMemorySize() const;
220  int* GetRealInd(int i) const;
221  int* GetImagInd(int i) const;
222  value_type* GetRealData(int i) const;
223  value_type* GetImagData(int i) const;
224  Vector<value_type, VectSparse, Allocator>* GetRealData() const;
225  Vector<value_type, VectSparse, Allocator>* GetImagData() const;
226 
227  // Element acess and affectation.
228  const entry_type operator() (int i, int j) const;
229  entry_type& Val(int i, int j);
230  const entry_type& Val(int i, int j) const;
231  entry_type& Get(int i, int j);
232  const entry_type& Get(int i, int j) const;
233 
234  value_type& ValReal(int i, int j);
235  const value_type& ValReal(int i, int j) const;
236  value_type& ValImag(int i, int j);
237  const value_type& ValImag(int i, int j) const;
238  value_type& GetReal(int i, int j);
239  const value_type& GetReal(int i, int j) const;
240  value_type& GetImag(int i, int j);
241  const value_type& GetImag(int i, int j) const;
242 
243  void Set(int i, int j, const entry_type& x);
244 
245  const value_type& ValueReal(int num_row,int i) const;
246  value_type& ValueReal(int num_row,int i);
247  int IndexReal(int num_row,int i) const;
248  int& IndexReal(int num_row,int i);
249  const value_type& ValueImag(int num_row,int i) const;
250  value_type& ValueImag(int num_row,int i);
251  int IndexImag(int num_row,int i) const;
252  int& IndexImag(int num_row,int i);
253 
256  void SetRealData(int, int, value_type*, int*);
257  void SetImagData(int, int, value_type*, int*);
258  void NullifyReal(int i);
259  void NullifyImag(int i);
260  void NullifyReal();
261  void NullifyImag();
262 
263  // Convenient functions.
264  void Print() const;
265  void Write(string FileName) const;
266  void Write(ostream& FileStream) const;
267  void WriteText(string FileName, bool cplx = false) const;
268  void WriteText(ostream& FileStream, bool cplx = false) const;
269  void Read(string FileName);
270  void Read(istream& FileStream);
271  void ReadText(string FileName, bool cplx = false);
272  void ReadText(istream& FileStream, bool cplx = false);
273 
274  void Assemble();
275 
276  template<class T0>
277  void RemoveSmallEntry(const T0& epsilon);
278 
279  void SetIdentity();
280  void Zero();
281  void Fill();
282  template <class T0>
283  void Fill(const complex<T0>& x);
284  template <class T0>
286  (const complex<T0>& x);
287  void FillRand();
288 
289 #ifdef SELDON_WITH_VIRTUAL
290  typedef typename ClassComplexType<T>::Treal Treal;
291  typedef typename ClassComplexType<T>::Tcplx Tcplx;
292 
293  virtual void ApplySor(const SeldonTranspose& trans, Vector<Treal>& x, const Vector<Treal>& r,
294  const typename ClassComplexType<T>::Treal& omega,
295  int nb_iter, int stage_ssor) const;
296 
297  virtual void ApplySor(const SeldonTranspose&, Vector<Tcplx>& x, const Vector<Tcplx>& r,
298  const typename ClassComplexType<T>::Treal& omega,
299  int nb_iter, int stage_ssor) const;
300 
301  virtual void MltAddVector(const Treal& alpha, const Vector<Treal>& x,
302  const Treal& beta, Vector<Treal>& y) const;
303 
304  virtual void MltAddVector(const Tcplx& alpha, const Vector<Tcplx>& x,
305  const Tcplx& beta, Vector<Tcplx>& y) const;
306 
307  virtual void MltAddVector(const Treal& alpha, const SeldonTranspose&,
308  const Vector<Treal>& x,
309  const Treal& beta, Vector<Treal>& y) const;
310 
311  virtual void MltAddVector(const Tcplx& alpha, const SeldonTranspose&,
312  const Vector<Tcplx>& x,
313  const Tcplx& beta, Vector<Tcplx>& y) const;
314 
315  virtual void MltVector(const Vector<Treal>& x, Vector<Treal>& y) const;
316  virtual void MltVector(const Vector<Tcplx>& x, Vector<Tcplx>& y) const;
317 
318  virtual void MltVector(const SeldonTranspose&,
319  const Vector<Treal>& x, Vector<Treal>& y) const;
320 
321  virtual void MltVector(const SeldonTranspose&,
322  const Vector<Tcplx>& x, Vector<Tcplx>& y) const;
323 
324  virtual bool IsSymmetric() const;
325 #endif
326 
327  };
328 
329 
331  template <class T, class Prop, class Allocator>
332  class Matrix<T, Prop, ArrayColComplexSparse, Allocator> :
333  public Matrix_ArrayComplexSparse<T, Prop, ArrayColComplexSparse, Allocator>
334  {
335  // typedef declaration.
336  public:
337  typedef typename Allocator::value_type value_type;
338  typedef Prop property;
340  typedef Allocator allocator;
341  typedef complex<value_type> entry_type;
342 
343  public:
344  Matrix();
345  explicit Matrix(int i, int j);
346 
347  // Memory management.
348  void ClearRealColumn(int i);
349  void ClearImagColumn(int i);
350  void ReallocateRealColumn(int i, int j);
351  void ReallocateImagColumn(int i, int j);
352  void ResizeRealColumn(int i, int j);
353  void ResizeImagColumn(int i, int j);
354  void SwapRealColumn(int i, int i_);
355  void SwapImagColumn(int i, int i_);
356  void ReplaceRealIndexColumn(int i, IVect& new_index);
357  void ReplaceImagIndexColumn(int i, IVect& new_index);
358 
359  int GetRealColumnSize(int i) const;
360  int GetImagColumnSize(int i) const;
361  void PrintRealColumn(int i) const;
362  void PrintImagColumn(int i) const;
363  void AssembleRealColumn(int i);
364  void AssembleImagColumn(int i);
365 
366  void AddInteraction(int i, int j, const entry_type& val);
367 
368  void AddInteractionRow(int i, int nb, const IVect& col,
369  const Vector<entry_type>& val,
370  bool sorted = false);
371 
372  void AddInteractionColumn(int i, int nb, const IVect& row,
373  const Vector<entry_type>& val,
374  bool sorted = false);
375  };
376 
377 
379  template <class T, class Prop, class Allocator>
380  class Matrix<T, Prop, ArrayRowComplexSparse, Allocator> :
381  public Matrix_ArrayComplexSparse<T, Prop, ArrayRowComplexSparse, Allocator>
382  {
383  // typedef declaration.
384  public:
385  typedef typename Allocator::value_type value_type;
386  typedef Prop property;
388  typedef Allocator allocator;
389  typedef complex<value_type> entry_type;
390 
391  public:
392  Matrix();
393  explicit Matrix(int i, int j);
394 
395  // Memory management.
396  void ClearRealRow(int i);
397  void ClearImagRow(int i);
398  void ClearRow(int i);
399  void ReallocateRealRow(int i, int j);
400  void ReallocateImagRow(int i, int j);
401  void ResizeRealRow(int i, int j);
402  void ResizeImagRow(int i, int j);
403  void SwapRealRow(int i, int i_);
404  void SwapImagRow(int i, int i_);
405  void ReplaceRealIndexRow(int i, IVect& new_index);
406  void ReplaceImagIndexRow(int i, IVect& new_index);
407 
408  int GetRealRowSize(int i) const;
409  int GetImagRowSize(int i) const;
410  void PrintRealRow(int i) const;
411  void PrintImagRow(int i) const;
412  void AssembleRealRow(int i);
413  void AssembleImagRow(int i);
414 
415  void AddInteraction(int i, int j, const entry_type& val);
416 
417  void AddInteractionRow(int i, int nb, const IVect& col,
418  const Vector<entry_type>& val,
419  bool sorted = false);
420 
421  void AddInteractionColumn(int i, int nb, const IVect& row,
422  const Vector<entry_type>& val,
423  bool sorted = false);
424 
425  };
426 
427 
429  template <class T, class Prop, class Allocator>
430  class Matrix<T, Prop, ArrayColSymComplexSparse, Allocator>:
431  public Matrix_ArrayComplexSparse<T, Prop, ArrayColSymComplexSparse, Allocator>
432  {
433  // typedef declaration.
434  public:
435  typedef typename Allocator::value_type value_type;
436  typedef Prop property;
438  typedef Allocator allocator;
439  typedef complex<value_type> entry_type;
440 
441  public:
442  Matrix();
443  explicit Matrix(int i, int j);
444 
445  const entry_type operator() (int i, int j) const;
446 
447  value_type& ValReal(int i, int j);
448  const value_type& ValReal(int i, int j) const;
449  value_type& ValImag(int i, int j);
450  const value_type& ValImag(int i, int j) const;
451  value_type& GetReal(int i, int j);
452  const value_type& GetReal(int i, int j) const;
453  value_type& GetImag(int i, int j);
454  const value_type& GetImag(int i, int j) const;
455 
456  void Set(int i, int j, const entry_type& x);
457 
458  // Memory management.
459  void ClearRealColumn(int i);
460  void ClearImagColumn(int i);
461  void ReallocateRealColumn(int i, int j);
462  void ReallocateImagColumn(int i, int j);
463  void ResizeRealColumn(int i, int j);
464  void ResizeImagColumn(int i, int j);
465  void SwapRealColumn(int i, int i_);
466  void SwapImagColumn(int i, int i_);
467  void ReplaceRealIndexColumn(int i, IVect& new_index);
468  void ReplaceImagIndexColumn(int i, IVect& new_index);
469 
470  int GetRealColumnSize(int i) const;
471  int GetImagColumnSize(int i) const;
472  void PrintRealColumn(int i) const;
473  void PrintImagColumn(int i) const;
474  void AssembleRealColumn(int i);
475  void AssembleImagColumn(int i);
476 
477  void AddInteraction(int i, int j, const entry_type& val);
478 
479  void AddInteractionRow(int i, int nb, const IVect& col,
480  const Vector<entry_type>& val,
481  bool sorted = false);
482 
483  void AddInteractionColumn(int i, int nb, const IVect& row,
484  const Vector<entry_type>& val,
485  bool sorted = false);
486 
487  };
488 
489 
491  template <class T, class Prop, class Allocator>
492  class Matrix<T, Prop, ArrayRowSymComplexSparse, Allocator>:
493  public Matrix_ArrayComplexSparse<T, Prop, ArrayRowSymComplexSparse, Allocator>
494  {
495  // typedef declaration.
496  public:
497  typedef typename Allocator::value_type value_type;
498  typedef Prop property;
500  typedef Allocator allocator;
501  typedef complex<value_type> entry_type;
502 
503  public:
504  Matrix();
505  explicit Matrix(int i, int j);
506 
507  const entry_type operator() (int i, int j) const;
508 
509  value_type& ValReal(int i, int j);
510  const value_type& ValReal(int i, int j) const;
511  value_type& ValImag(int i, int j);
512  const value_type& ValImag(int i, int j) const;
513  value_type& GetReal(int i, int j);
514  const value_type& GetReal(int i, int j) const;
515  value_type& GetImag(int i, int j);
516  const value_type& GetImag(int i, int j) const;
517 
518  void Set(int i, int j, const entry_type& x);
519 
520  // Memory management.
521  void ClearRealRow(int i);
522  void ClearImagRow(int i);
523  void ClearRow(int i);
524  void ReallocateRealRow(int i, int j);
525  void ReallocateImagRow(int i, int j);
526  void ResizeRealRow(int i, int j);
527  void ResizeImagRow(int i, int j);
528  void SwapRealRow(int i, int i_);
529  void SwapImagRow(int i, int i_);
530  void ReplaceRealIndexRow(int i, IVect& new_index);
531  void ReplaceImagIndexRow(int i, IVect& new_index);
532 
533  int GetRealRowSize(int i) const;
534  int GetImagRowSize(int i) const;
535  void PrintRealRow(int i) const;
536  void PrintImagRow(int i) const;
537  void AssembleRealRow(int i);
538  void AssembleImagRow(int i);
539 
540  void AddInteraction(int i, int j, const entry_type& val);
541 
542  void AddInteractionRow(int i, int nb, const IVect& col,
543  const Vector<entry_type>& val,
544  bool sorted = false);
545 
546  void AddInteractionColumn(int i, int nb, const IVect& row,
547  const Vector<entry_type>& val,
548  bool sorted= false);
549  };
550 
551 } // namespace Seldon
552 
553 #define SELDON_FILE_MATRIX_ARRAY_COMPLEX_SPARSE_HXX
554 #endif
Seldon::Matrix_ArrayComplexSparse::NullifyImag
void NullifyImag()
Clears the matrix without releasing memory.
Definition: Matrix_ArrayComplexSparseInline.cxx:693
Seldon::SeldonDefaultAllocator
Selection of default allocator depending on storage and value type.
Definition: Allocator.hxx:174
Seldon::Matrix_ArrayComplexSparse::ValReal
value_type & ValReal(int i, int j)
Returns acces to real part of A(i, j)
Definition: Matrix_ArrayComplexSparseInline.cxx:312
Seldon::SeldonTranspose
Definition: MatrixFlag.hxx:32
Seldon::Matrix_ArrayComplexSparse::Clear
void Clear()
Clears the matrix.
Definition: Matrix_ArrayComplexSparseInline.cxx:79
Seldon::Matrix_ArrayComplexSparse::IndexReal
int IndexReal(int num_row, int i) const
Returns column number of j-th non-zero value of row i (real part).
Definition: Matrix_ArrayComplexSparseInline.cxx:473
Seldon::Matrix_ArrayComplexSparse::IndexImag
int IndexImag(int num_row, int i) const
Returns column number of j-th non-zero value of row i (imaginary part).
Definition: Matrix_ArrayComplexSparseInline.cxx:555
Seldon::Matrix_ArrayComplexSparse::ValImag
value_type & ValImag(int i, int j)
Returns acces to imaginary part of A(i, j)
Definition: Matrix_ArrayComplexSparseInline.cxx:342
Seldon::Matrix_ArrayComplexSparse::val_imag_
Vector< Vector< value_type, VectSparse, Allocator >, VectFull, NewAlloc< Vector< value_type, VectSparse, Allocator > > > val_imag_
imaginary part rows or columns
Definition: Matrix_ArrayComplexSparse.hxx:196
Seldon::Matrix_ArrayComplexSparse::Resize
void Resize(int i, int j)
Reallocates additional memory to resize the matrix.
Definition: Matrix_ArrayComplexSparse.cxx:115
Seldon::Matrix_ArrayComplexSparse::WriteText
void WriteText(string FileName, bool cplx=false) const
Writes the matrix in a file.
Definition: Matrix_ArrayComplexSparse.cxx:291
Seldon::Matrix_ArrayComplexSparse
Sparse Array-matrix class.
Definition: Matrix_ArrayComplexSparse.hxx:176
Seldon::Matrix_ArrayComplexSparse::GetDataSize
long GetDataSize() const
Returns the number of elements stored in memory (real+imaginary part).
Definition: Matrix_ArrayComplexSparseInline.cxx:143
Seldon::Matrix_ArrayComplexSparse::SetImagData
void SetImagData(int, int, Vector< value_type, VectSparse, Allocator > *)
Redefines the imaginary part of the matrix.
Definition: Matrix_ArrayComplexSparseInline.cxx:665
Seldon::ArrayColSymComplexSparse
Definition: Storage.hxx:458
Seldon::Matrix_ArrayComplexSparse::Matrix_ArrayComplexSparse
Matrix_ArrayComplexSparse()
Default constructor.
Definition: Matrix_ArrayComplexSparseInline.cxx:40
Seldon::ArrayColComplexSparse
Definition: Storage.hxx:454
Seldon::Matrix_ArrayComplexSparse::FillRand
void FillRand()
Non-zero entries take a random value.
Definition: Matrix_ArrayComplexSparse.cxx:554
Seldon::Vector
Definition: SeldonHeader.hxx:207
Seldon::Matrix_ArrayComplexSparse::Write
void Write(string FileName) const
Writes the matrix in a file.
Definition: Matrix_ArrayComplexSparse.cxx:232
Seldon::Matrix_ArrayComplexSparse::GetImag
value_type & GetImag(int i, int j)
Returns acces to imaginary part of A(i, j)
Definition: Matrix_ArrayComplexSparseInline.cxx:402
Seldon::Matrix
Definition: SeldonHeader.hxx:226
Seldon::Matrix_ArrayComplexSparse::Read
void Read(string FileName)
Reads the matrix from a file.
Definition: Matrix_ArrayComplexSparse.cxx:346
Seldon::Matrix_ArrayComplexSparse::GetMemorySize
size_t GetMemorySize() const
returns size of matrix in bytes
Definition: Matrix_ArrayComplexSparse.cxx:64
Seldon::NewAlloc
Definition: Allocator.hxx:91
Seldon::Matrix_ArrayComplexSparse::NullifyReal
void NullifyReal()
Clears the matrix without releasing memory.
Definition: Matrix_ArrayComplexSparseInline.cxx:679
Seldon::Matrix_ArrayComplexSparse::GetRealInd
int * GetRealInd(int i) const
Returns column indices of non-zero entries in row (real part).
Definition: Matrix_ArrayComplexSparseInline.cxx:157
Seldon::ArrayRowComplexSparse
Definition: Storage.hxx:446
Seldon::Matrix_ArrayComplexSparse::Reallocate
void Reallocate(int i, int j)
Reallocates memory to resize the matrix.
Definition: Matrix_ArrayComplexSparse.cxx:92
Seldon::Matrix_ArrayComplexSparse::Get
entry_type & Get(int i, int j)
Unavailable access method.
Definition: Matrix_ArrayComplexSparseInline.cxx:280
Seldon::Matrix_ArrayComplexSparse::GetNonZeros
long GetNonZeros() const
Returns the number of elements stored in memory (real+imaginary part).
Definition: Matrix_ArrayComplexSparseInline.cxx:101
Seldon::VectFull
Definition: StorageInline.cxx:74
Seldon::Matrix_ArrayComplexSparse::RemoveSmallEntry
void RemoveSmallEntry(const T0 &epsilon)
removes small entries
Definition: Matrix_ArrayComplexSparse.cxx:470
Seldon::Matrix_ArrayComplexSparse::Set
void Set(int i, int j, const entry_type &x)
Sets element (i, j) of matrix.
Definition: Matrix_ArrayComplexSparse.cxx:162
Seldon::Matrix_ArrayComplexSparse::operator()
const entry_type operator()(int i, int j) const
Access operator.
Definition: Matrix_ArrayComplexSparseInline.cxx:221
Seldon::Matrix_ArrayComplexSparse::Fill
void Fill()
Non-zero entries are filled with values 0, 1, 2, 3 ...
Definition: Matrix_ArrayComplexSparse.cxx:510
Seldon::Matrix_ArrayComplexSparse::SetRealData
void SetRealData(int, int, Vector< value_type, VectSparse, Allocator > *)
Redefines the real part of the matrix.
Definition: Matrix_ArrayComplexSparseInline.cxx:649
Seldon::Matrix_ArrayComplexSparse::~Matrix_ArrayComplexSparse
~Matrix_ArrayComplexSparse()
Destructor.
Definition: Matrix_ArrayComplexSparseInline.cxx:68
Seldon::Matrix_ArrayComplexSparse::SetIdentity
void SetIdentity()
Matrix is initialized to the identity matrix.
Definition: Matrix_ArrayComplexSparse.cxx:483
Seldon::ArrayRowSymComplexSparse
Definition: Storage.hxx:450
Seldon::Matrix_ArrayComplexSparse::GetRealDataSize
long GetRealDataSize() const
Returns the number of elements stored in memory (real part).
Definition: Matrix_ArrayComplexSparseInline.cxx:115
Seldon::Matrix_ArrayComplexSparse::Assemble
void Assemble()
Assembles the matrix.
Definition: Matrix_ArrayComplexSparse.cxx:457
Seldon::Matrix_ArrayComplexSparse::GetImagNonZeros
long GetImagNonZeros() const
Returns the number of non-zero elements (imaginary part).
Definition: Matrix_ArrayComplexSparse.cxx:51
Seldon::Matrix_ArrayComplexSparse::val_real_
Vector< Vector< value_type, VectSparse, Allocator >, VectFull, NewAlloc< Vector< value_type, VectSparse, Allocator > > > val_real_
real part rows or columns
Definition: Matrix_ArrayComplexSparse.hxx:193
Seldon::Matrix_ArrayComplexSparse::GetImagDataSize
long GetImagDataSize() const
Returns the number of elements stored in memory (imaginary part).
Definition: Matrix_ArrayComplexSparseInline.cxx:129
Seldon::Matrix_ArrayComplexSparse::Print
void Print() const
Displays the matrix on the standard output.
Definition: Matrix_ArrayComplexSparse.cxx:195
Seldon::Matrix_ArrayComplexSparse::GetRealNonZeros
long GetRealNonZeros() const
Returns the number of non-zero elements (real part).
Definition: Matrix_ArrayComplexSparse.cxx:35
Seldon
Seldon namespace.
Definition: Array.cxx:24
Seldon::Matrix_ArrayComplexSparse::GetImagInd
int * GetImagInd(int i) const
Returns column indices of non-zero entries in row (imaginary part).
Definition: Matrix_ArrayComplexSparseInline.cxx:185
Seldon::Matrix_ArrayComplexSparse::GetReal
value_type & GetReal(int i, int j)
Returns acces to real part of A(i, j)
Definition: Matrix_ArrayComplexSparseInline.cxx:372
Seldon::Matrix_ArrayComplexSparse::ReadText
void ReadText(string FileName, bool cplx=false)
Reads the matrix from a file.
Definition: Matrix_ArrayComplexSparse.cxx:414
Seldon::Matrix_ArrayComplexSparse::ValueReal
const value_type & ValueReal(int num_row, int i) const
Returns j-th non-zero value of row i (real part).
Definition: Matrix_ArrayComplexSparseInline.cxx:432
Seldon::VirtualMatrix
Abstract base class for all matrices.
Definition: Matrix_Base.hxx:42
Seldon::Matrix_ArrayComplexSparse::Val
entry_type & Val(int i, int j)
Unavailable access method.
Definition: Matrix_ArrayComplexSparseInline.cxx:246
Seldon::Matrix_ArrayComplexSparse::Zero
void Zero()
Non-zero entries are set to 0 (but not removed).
Definition: Matrix_ArrayComplexSparse.cxx:498
Seldon::Matrix_ArrayComplexSparse::ValueImag
const value_type & ValueImag(int num_row, int i) const
Returns j-th non-zero value of row i (imaginary part).
Definition: Matrix_ArrayComplexSparseInline.cxx:514