complex_matrices.h
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Version 1.0; svn revision $LastChangedRevision$
7 //LIC//
8 //LIC// $LastChangedDate$
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 //This header file contains classes and inline function definitions for
31 //matrices of complex numbers and their derived types
32 
33 //Include guards to prevent multiple inclusion of the header
34 #ifndef OOMPH_COMPLEX_MATRICES_HEADER
35 #define OOMPH_COMPLEX_MATRICES_HEADER
36 
37 // Config header generated by autoconfig
38 #ifdef HAVE_CONFIG_H
39 #include <oomph-lib-config.h>
40 #endif
41 
42 #ifdef OOMPH_HAS_MPI
43 #include "mpi.h"
44 #endif
45 
46 //Of course we need the complex type
47 #include <complex>
48 
49 //Also need the standard matrices header
50 #include "matrices.h"
51 
52 namespace oomph
53 {
54 
55 //===================================================================
56 /// \short Abstract base class for matrices of complex doubles -- adds
57 /// abstract interfaces for solving, LU decomposition and
58 /// multiplication by vectors.
59 //===================================================================
61 {
62  public:
63 
64  /// (Empty) constructor.
66 
67  /// Broken copy constructor
69  {
70  BrokenCopy::broken_copy("ComplexMatrixBase");
71  }
72 
73  /// Broken assignment operator
75  {
76  BrokenCopy::broken_assign("ComplexMatrixBase");
77  }
78 
79  /// Return the number of rows of the matrix
80  virtual unsigned long nrow() const=0;
81 
82  /// Return the number of columns of the matrix
83  virtual unsigned long ncol() const=0;
84 
85  /// virtual (empty) destructor
86  virtual ~ComplexMatrixBase() { }
87 
88  /// \short Round brackets to give access as a(i,j) for read only
89  /// (we're not providing a general interface for component-wise write
90  /// access since not all matrix formats allow efficient direct access!)
91  virtual std::complex<double> operator()(const unsigned long &i,
92  const unsigned long &j)
93  const=0;
94 
95  /// \short LU decomposition of the matrix using the appropriate
96  /// linear solver. Return the sign of the determinant
97  virtual int ludecompose()
98  {
99  throw OomphLibError(
100  "ludecompose() has not been written for this matrix class\n",
101  OOMPH_CURRENT_FUNCTION,
102  OOMPH_EXCEPTION_LOCATION);
103 
104  /// Dummy return
105  return 1;
106  }
107 
108  /// \short LU backsubstitue a previously LU-decomposed matrix;
109  /// The passed rhs will be over-written with the solution vector
110  virtual void lubksub(Vector<std::complex<double> > &rhs)
111  {
112  throw OomphLibError(
113  "lubksub() has not been written for this matrix class\n",
114  OOMPH_CURRENT_FUNCTION,
115  OOMPH_EXCEPTION_LOCATION);
116  }
117 
118 
119  /// \short Complete LU solve (replaces matrix by its LU decomposition
120  /// and overwrites RHS with solution). The default should not need
121  /// to be over-written
122  virtual void solve(Vector<std::complex<double> > &rhs);
123 
124  /// \short Complete LU solve (Nothing gets overwritten!). The default should
125  /// not need to be overwritten
126  virtual void solve(const Vector<std::complex<double> > &rhs,
127  Vector<std::complex<double> > &soln);
128 
129  /// \short Find the residual, i.e. r=b-Ax the residual
130  virtual void residual(const Vector<std::complex<double> > &x,
131  const Vector<std::complex<double> > &b,
132  Vector<std::complex<double> > &residual)=0;
133 
134  /// \short Find the maximum residual r=b-Ax -- generic version, can be
135  /// overloaded for specific derived classes where the
136  /// max. can be determined "on the fly"
137  virtual double max_residual(const Vector<std::complex<double> > &x,
138  const Vector<std::complex<double> > &rhs)
139  {
140  unsigned long n=rhs.size();
142  residual(x,rhs,res);
143  double ans=0.0;
144  for (unsigned long i=0;i<n;i++)
145  {
146  ans = std::max(ans,std::abs(res[i]));
147  }
148  return ans;
149  }
150 
151  /// \short Multiply the matrix by the vector x: soln=Ax.
152  virtual void multiply(const Vector<std::complex<double> > &x,
153  Vector<std::complex<double> > &soln)=0;
154 
155  /// \short Multiply the transposed matrix by the vector x: soln=A^T x
156  virtual void multiply_transpose(const Vector<std::complex<double> > &x,
157  Vector<std::complex<double> > &soln)=0;
158 
159 };
160 
162 {
163 public:
164 
165  DiagonalComplexMatrix(const unsigned long n): Matrixdata(n) {}
166 
167  DiagonalComplexMatrix(const unsigned long n, std::complex<double>& z) :
168  Matrixdata(n,z)
169  {}
170 
171  //
172  virtual std::complex<double> operator()(const unsigned long &i,
173  const unsigned long &j) const;
174 
175  //
176  virtual std::complex<double>& operator()(const unsigned long &i,
177  const unsigned long &j);
178 
179  void multiply(const Vector<std::complex<double> > &x,
180  Vector<std::complex<double> > &result);
181 
182  void multiply_transpose(const Vector<std::complex<double> > &x,
183  Vector<std::complex<double> > &result)
184  {
185  return multiply(x, result);
186  }
187 
188  /// \short Find the residual, i.e. r=b-Ax the residual
189  virtual void residual(const Vector<std::complex<double> > &x,
190  const Vector<std::complex<double> > &b,
191  Vector<std::complex<double> > &residual)
192  {}
193 
194  void resize(const unsigned& N, const unsigned& M);
195 
196  void resize(const unsigned& N, const unsigned& M, std::complex<double> z);
197 
198  unsigned long nrow() const { return Matrixdata.size(); }
199 
200  unsigned long ncol() const { return Matrixdata.size(); }
201 
202 private:
203 
205 };
206 
207 
208 //=================================================================
209 /// \short Class of matrices containing double complex, and stored as a
210 /// DenseMatrix<complex<double> >, but with solving functionality inherited
211 /// from the abstract ComplexMatrix class.
212 //=================================================================
214  public DenseMatrix<std::complex<double> >
215  {
216  private:
217 
218  /// Pointer to storage for the index of permutations in the LU solve
220 
221  /// Pointer to storage for the LU decomposition
222  std::complex<double>* LU_factors;
223 
224  /// Boolean flag used to decided whether the LU decomposition is stored
225  /// separately, or not
227 
228  /// Function that deletes the storage for the LU_factors, if it is
229  /// not the same as the matrix storage
230  void delete_lu_factors();
231 
232  public:
233 
234  /// Empty constructor, simply assign the lengths N and M to 0
235  DenseComplexMatrix(): DenseMatrix<std::complex<double> >(),
236  Index(0), LU_factors(0),
237  Overwrite_matrix_storage(false) {}
238 
239  /// Constructor to build a square n by n matrix.
240  DenseComplexMatrix(const unsigned long &n) :
241  DenseMatrix<std::complex<double> >(n), Index(0), LU_factors(0),
242  Overwrite_matrix_storage(false) {}
243 
244  /// Constructor to build a matrix with n rows and m columns.
245  DenseComplexMatrix(const unsigned long &n, const unsigned long &m) :
246  DenseMatrix<std::complex<double> >(n,m), Index(0), LU_factors(0),
247  Overwrite_matrix_storage(false) {}
248 
249  /// \short Constructor to build a matrix with n rows and m columns,
250  /// with initial value initial_val
251  DenseComplexMatrix(const unsigned long &n, const unsigned long &m,
252  const std::complex<double> &initial_val) :
253  DenseMatrix<std::complex<double> >(n,m,initial_val),
254  Index(0), LU_factors(0),
255  Overwrite_matrix_storage(false) {}
256 
257  /// \short Constructor to build a dense matrix from a diagonal matrix
258  DenseComplexMatrix(const DiagonalComplexMatrix& diagonal_matrix) :
259  DenseMatrix<std::complex<double> >(diagonal_matrix.nrow(),
260  diagonal_matrix.nrow(),std::complex<double>(0.0,0.0)),
261  Index(0), LU_factors(0), Overwrite_matrix_storage(false)
262  {
263  for (unsigned i=0; i<diagonal_matrix.nrow(); i++)
264  {
265  this->entry(i,i) = diagonal_matrix(i,i);
266  }
267  }
268 
269 
270  /// Broken copy constructor
272  {
273  BrokenCopy::broken_copy("DenseComplexMatrix");
274  }
275 
276  /// Broken assignment operator
278  {
279  BrokenCopy::broken_assign("DenseComplexMatrix");
280  }
281 
282 
283  /// Return the number of rows of the matrix
284  inline unsigned long nrow() const
286 
287  /// Return the number of columns of the matrix
288  inline unsigned long ncol() const
290 
291  /// \short Overload the const version of the round-bracket access operator
292  /// for read-only access.
293  inline std::complex<double> operator()(const unsigned long &i,
294  const unsigned long &j)
295  const {return DenseMatrix<std::complex<double> >::get_entry(i,j);}
296 
297  /// \short Overload the non-const version of the round-bracket access
298  /// operator for read-write access
299  inline std::complex<double>& operator()(const unsigned long &i,
300  const unsigned long &j)
301  {return DenseMatrix<std::complex<double> >::entry(i,j);}
302 
303  /// Destructor, delete the storage for Index vector and LU storage (if any)
304  virtual ~DenseComplexMatrix();
305 
306  /// \short Overload the LU decomposition.
307  /// For this storage scheme the matrix storage will be over-writeen
308  /// by its LU decomposition
309  int ludecompose();
310 
311  /// \short Overload the LU back substitution. Note that the rhs will be
312  /// overwritten with the solution vector
313  void lubksub(Vector<std::complex<double> >&rhs);
314 
315  /// \short Find the residual of Ax=b, ie r=b-Ax for the
316  /// "solution" x.
317  void residual(const Vector<std::complex<double> >& x,
318  const Vector<std::complex<double> >& rhs,
319  Vector<std::complex<double> >& residual);
320 
321  /// \short Multiply the matrix by the vector x: soln=Ax
322  void multiply(const Vector<std::complex<double> > &x,
323  Vector<std::complex<double> > &soln);
324 
325  /// \short Multiply the transposed matrix by the vector x: soln=A^T x
326  void multiply_transpose(const Vector<std::complex<double> > &x,
327  Vector<std::complex<double> > &soln);
328 
329  /// Multiply this matrix by the DenseComplexMatrix matrix_in
330  void multiply(const DenseComplexMatrix &matrix_in, DenseComplexMatrix& result);
331 
332  /// Scale this matrix by a double c
333  void scale(const double& c);
334 
335  /// Scale this matrix by a complex number c
336  void scale(const std::complex<double>& c);
337 };
338 
339 
340 //=================================================================
341 /// \short A class for compressed row matrices
342 //=================================================================
343 class CRComplexMatrix : public CRMatrix<std::complex<double> >,
344  public ComplexMatrixBase
345 {
346  private:
347 
348  /// \short Storage for the LU factors as required by SuperLU
349  void* F_factors;
350 
351  /// \short Info flag for the SuperLU solver
352  int Info;
353 
354  public:
355 
356  /// Default constructor
357  CRComplexMatrix() : CRMatrix<std::complex<double> >(), F_factors(0), Info(0)
358  {
359  // By default SuperLU solves linear systems quietly
360  Doc_stats_during_solve=false;
361  }
362 
363  /// \short Constructor: Pass vector of values, vector of column indices,
364  /// vector of row starts and number of columns (can be suppressed
365  /// for square matrices)
366  CRComplexMatrix(const Vector<std::complex<double> >& value,
367  const Vector<int>& column_index,
368  const Vector<int>& row_start,
369  const unsigned long &n,
370  const unsigned long &m) :
371  CRMatrix<std::complex<double> >(value,column_index,row_start,n,m),
372  F_factors(0), Info(0)
373  {
374  // By default SuperLU solves linear systems quietly
375  Doc_stats_during_solve=false;
376  }
377 
378 
379  /// Broken copy constructor
381  {
382  BrokenCopy::broken_copy("CRComplexMatrix");
383  }
384 
385 
386  /// Broken assignment operator
388  {
389  BrokenCopy::broken_assign("CRComplexMatrix");
390  }
391 
392  /// Destructor: Kill the LU decomposition if it has been computed
393  virtual ~CRComplexMatrix() {clean_up_memory();}
394 
395  /// \short Set flag to indicate that stats are to be displayed during
396  /// solution of linear system with SuperLU
397  void enable_doc_stats() {Doc_stats_during_solve=true;}
398 
399  // \short Set flag to indicate that stats are not to be displayed during
400  /// the solve
401  void disable_doc_stats() {Doc_stats_during_solve=false;}
402 
403  /// Return the number of rows of the matrix
404  inline unsigned long nrow() const
406 
407  /// Return the number of columns of the matrix
408  inline unsigned long ncol() const
410 
411  /// Overload the round-bracket access operator for read-only access
412  inline std::complex<double> operator()(const unsigned long &i,
413  const unsigned long &j)
414  const {return CRMatrix<std::complex<double> >::get_entry(i,j);}
415 
416  /// \short LU decomposition using SuperLU
417  int ludecompose();
418 
419  /// \short LU back solve for given RHS
420  void lubksub(Vector<std::complex<double> > &rhs);
421 
422  /// \short LU clean up (perhaps this should happen in the destructor)
423  void clean_up_memory();
424 
425  /// \short Find the residual to x of Ax=b, i.e. r=b-Ax
426  void residual(const Vector<std::complex<double> > &x,
427  const Vector<std::complex<double> > &b,
428  Vector<std::complex<double> > &residual);
429 
430  /// \short Multiply the matrix by the vector x: soln=Ax
431  void multiply(const Vector<std::complex<double> > &x,
432  Vector<std::complex<double> > &soln);
433 
434 
435  /// \short Multiply the transposed matrix by the vector x: soln=A^T x
436  void multiply_transpose(const Vector<std::complex<double> > &x,
437  Vector<std::complex<double> > &soln);
438 
439  protected:
440 
441  /// \short Flag to indicate if stats are to be displayed during
442  /// solution of linear system with SuperLU
444 
445 };
446 
447 
448 
449 //=================================================================
450 /// \short A class for compressed column matrices that store doubles
451 //=================================================================
453  public CCMatrix<std::complex<double> >
454 {
455  private:
456 
457  /// \short Storage for the LU factors as required by SuperLU
458  void* F_factors;
459 
460  /// \short Info flag for the SuperLU solver
461  int Info;
462 
463  protected:
464 
465  /// \short Flag to indicate if stats are to be displayed during
466  /// solution of linear system with SuperLU
468 
469  public:
470 
471  /// Default constructor
472  CCComplexMatrix() : CCMatrix<std::complex<double> >(), F_factors(0), Info(0)
473  {
474  // By default SuperLU solves linear systems quietly
475  Doc_stats_during_solve=false;
476  }
477 
478  /// \short Constructor: Pass vector of values, vector of row indices,
479  /// vector of column starts and number of rows (can be suppressed
480  /// for square matrices). Number of nonzero entries is read
481  /// off from value, so make sure the vector has been shrunk
482  /// to its correct length.
483  CCComplexMatrix(const Vector<std::complex<double> >& value,
484  const Vector<int>& row_index,
485  const Vector<int>& column_start,
486  const unsigned long &n,
487  const unsigned long &m) :
488  CCMatrix<std::complex<double> >(value,row_index,column_start,n,m),
489  F_factors(0), Info(0)
490  {
491  // By default SuperLU solves linear systems quietly
492  Doc_stats_during_solve=false;
493  }
494 
495  /// Broken copy constructor
497  {
498  BrokenCopy::broken_copy("CCComplexMatrix");
499  }
500 
501  /// Broken assignment operator
503  {
504  BrokenCopy::broken_assign("CCComplexMatrix");
505  }
506 
507  /// Destructor: Kill the LU factors if they have been setup.
508  virtual ~CCComplexMatrix() {clean_up_memory();}
509 
510  /// \short Set flag to indicate that stats are to be displayed during
511  /// solution of linear system with SuperLU
512  void enable_doc_stats() {Doc_stats_during_solve=true;}
513 
514  // \short Set flag to indicate that stats are not to be displayed during
515  /// the solve
516  void disable_doc_stats() {Doc_stats_during_solve=false;}
517 
518  /// Return the number of rows of the matrix
519  inline unsigned long nrow() const
521 
522  /// Return the number of columns of the matrix
523  inline unsigned long ncol() const
525 
526  /// \short Overload the round-bracket access operator to provide
527  /// read-only (const) access to the data
528  inline std::complex<double> operator()(const unsigned long &i,
529  const unsigned long &j)
530  const {return CCMatrix<std::complex<double> >::get_entry(i,j);}
531 
532  /// \short LU decomposition using SuperLU
533  int ludecompose();
534 
535  /// \short LU back solve for given RHS
536  void lubksub(Vector<std::complex<double> > &rhs);
537 
538  /// \short LU clean up (perhaps this should happen in the destructor)
539  void clean_up_memory();
540 
541  /// \short Find the residulal to x of Ax=b, ie r=b-Ax
542  void residual(const Vector<std::complex<double> > &x,
543  const Vector<std::complex<double> > &b,
544  Vector<std::complex<double> > &residual);
545 
546 
547  /// \short Multiply the matrix by the vector x: soln=Ax
548  void multiply(const Vector<std::complex<double> > &x,
549  Vector<std::complex<double> > &soln);
550 
551 
552  /// \short Multiply the transposed matrix by the vector x: soln=A^T x
553  void multiply_transpose(const Vector<std::complex<double> > &x,
554  Vector<std::complex<double> > &soln);
555 
556 };
557 }
558 
559 #endif
virtual double max_residual(const Vector< std::complex< double > > &x, const Vector< std::complex< double > > &rhs)
Find the maximum residual r=b-Ax – generic version, can be overloaded for specific derived classes w...
Vector< std::complex< double > > Matrixdata
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
virtual void multiply_transpose(const Vector< std::complex< double > > &x, Vector< std::complex< double > > &soln)=0
Multiply the transposed matrix by the vector x: soln=A^T x.
Abstract base class for matrices of complex doubles – adds abstract interfaces for solving...
CRComplexMatrix(const Vector< std::complex< double > > &value, const Vector< int > &column_index, const Vector< int > &row_start, const unsigned long &n, const unsigned long &m)
Constructor: Pass vector of values, vector of column indices, vector of row starts and number of colu...
DenseComplexMatrix(const unsigned long &n, const unsigned long &m)
Constructor to build a matrix with n rows and m columns.
bool Doc_stats_during_solve
Flag to indicate if stats are to be displayed during solution of linear system with SuperLU...
cstr elem_len * i
Definition: cfortran.h:607
unsigned long ncol() const
Return the number of columns of the matrix.
virtual ~ComplexMatrixBase()
virtual (empty) destructor
Vector< long > * Index
Pointer to storage for the index of permutations in the LU solve.
std::complex< double > operator()(const unsigned long &i, const unsigned long &j) const
Overload the const version of the round-bracket access operator for read-only access.
virtual ~CCComplexMatrix()
Destructor: Kill the LU factors if they have been setup.
std::complex< double > operator()(const unsigned long &i, const unsigned long &j) const
Overload the round-bracket access operator for read-only access.
ComplexMatrixBase()
(Empty) constructor.
CCComplexMatrix(const Vector< std::complex< double > > &value, const Vector< int > &row_index, const Vector< int > &column_start, const unsigned long &n, const unsigned long &m)
Constructor: Pass vector of values, vector of row indices, vector of column starts and number of rows...
A class for compressed row matrices.
bool Doc_stats_during_solve
Flag to indicate if stats are to be displayed during solution of linear system with SuperLU...
virtual unsigned long nrow() const =0
Return the number of rows of the matrix.
unsigned long nrow() const
Return the number of rows of the matrix.
DenseComplexMatrix(const DenseComplexMatrix &matrix)
Broken copy constructor.
DiagonalComplexMatrix(const unsigned long n, std::complex< double > &z)
unsigned long nrow() const
Return the number of rows of the matrix.
void disable_doc_stats()
the solve
CRComplexMatrix()
Default constructor.
void enable_doc_stats()
Set flag to indicate that stats are to be displayed during solution of linear system with SuperLU...
virtual ~CRComplexMatrix()
Destructor: Kill the LU decomposition if it has been computed.
void * F_factors
Storage for the LU factors as required by SuperLU.
int Info
Info flag for the SuperLU solver.
CCComplexMatrix(const CCComplexMatrix &matrix)
Broken copy constructor.
void multiply_transpose(const Vector< std::complex< double > > &x, Vector< std::complex< double > > &result)
Multiply the transposed matrix by the vector x: soln=A^T x.
void disable_doc_stats()
the solve
void operator=(const ComplexMatrixBase &)
Broken assignment operator.
void operator=(const DenseComplexMatrix &)
Broken assignment operator.
virtual std::complex< double > operator()(const unsigned long &i, const unsigned long &j) const =0
Round brackets to give access as a(i,j) for read only (we&#39;re not providing a general interface for co...
A class for compressed column matrices: a sparse matrix format The class is passed as the MATRIX_TYPE...
Definition: matrices.h:2377
virtual void residual(const Vector< std::complex< double > > &x, const Vector< std::complex< double > > &b, Vector< std::complex< double > > &residual)=0
Find the residual, i.e. r=b-Ax the residual.
int Info
Info flag for the SuperLU solver.
ComplexMatrixBase(const ComplexMatrixBase &matrix)
Broken copy constructor.
DenseComplexMatrix(const unsigned long &n, const unsigned long &m, const std::complex< double > &initial_val)
Constructor to build a matrix with n rows and m columns, with initial value initial_val.
std::complex< double > * LU_factors
Pointer to storage for the LU decomposition.
void operator=(const CCComplexMatrix &)
Broken assignment operator.
virtual void multiply(const Vector< std::complex< double > > &x, Vector< std::complex< double > > &soln)=0
Multiply the matrix by the vector x: soln=Ax.
void * F_factors
Storage for the LU factors as required by SuperLU.
unsigned long ncol() const
Return the number of columns of the matrix.
CRComplexMatrix(const CRComplexMatrix &matrix)
Broken copy constructor.
A class for compressed row matrices, a sparse storage format Once again the recursive template trick ...
Definition: matrices.h:675
virtual void residual(const Vector< std::complex< double > > &x, const Vector< std::complex< double > > &b, Vector< std::complex< double > > &residual)
Find the residual, i.e. r=b-Ax the residual.
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
virtual void lubksub(Vector< std::complex< double > > &rhs)
LU backsubstitue a previously LU-decomposed matrix; The passed rhs will be over-written with the solu...
DenseComplexMatrix(const unsigned long &n)
Constructor to build a square n by n matrix.
unsigned long nrow() const
Return the number of rows of the matrix.
A class for compressed column matrices that store doubles.
Class for dense matrices, storing all the values of the matrix as a pointer to a pointer with assorte...
Definition: communicator.h:50
unsigned long ncol() const
Return the number of columns of the matrix.
DenseComplexMatrix()
Empty constructor, simply assign the lengths N and M to 0.
unsigned long ncol() const
Return the number of columns of the matrix.
CCComplexMatrix()
Default constructor.
std::complex< double > operator()(const unsigned long &i, const unsigned long &j) const
Overload the round-bracket access operator to provide read-only (const) access to the data...
void operator=(const CRComplexMatrix &)
Broken assignment operator.
DenseComplexMatrix(const DiagonalComplexMatrix &diagonal_matrix)
Constructor to build a dense matrix from a diagonal matrix.
std::complex< double > & operator()(const unsigned long &i, const unsigned long &j)
Overload the non-const version of the round-bracket access operator for read-write access...
virtual void solve(Vector< std::complex< double > > &rhs)
Complete LU solve (replaces matrix by its LU decomposition and overwrites RHS with solution)...
DiagonalComplexMatrix(const unsigned long n)
unsigned long nrow() const
Return the number of rows of the matrix.
virtual int ludecompose()
LU decomposition of the matrix using the appropriate linear solver. Return the sign of the determinan...
Class of matrices containing double complex, and stored as a DenseMatrix<complex<double> >...
void enable_doc_stats()
Set flag to indicate that stats are to be displayed during solution of linear system with SuperLU...
virtual unsigned long ncol() const =0
Return the number of columns of the matrix.