![]() |
|
A class for compressed row matrices. More...
#include <complex_matrices.h>
Inheritance diagram for oomph::CRComplexMatrix:Public Member Functions | |
| CRComplexMatrix () | |
| Default constructor. More... | |
| 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) | |
| CRComplexMatrix (const CRComplexMatrix &matrix)=delete | |
| Broken copy constructor. More... | |
| void | operator= (const CRComplexMatrix &)=delete |
| Broken assignment operator. More... | |
| virtual | ~CRComplexMatrix () |
| Destructor: Kill the LU decomposition if it has been computed. More... | |
| void | enable_doc_stats () |
| void | disable_doc_stats () |
| the solve More... | |
| unsigned long | nrow () const |
| Return the number of rows of the matrix. More... | |
| unsigned long | ncol () const |
| Return the number of columns of the matrix. More... | |
| std::complex< double > | operator() (const unsigned long &i, const unsigned long &j) const |
| Overload the round-bracket access operator for read-only access. More... | |
| int | ludecompose () |
| LU decomposition using SuperLU. More... | |
| void | lubksub (Vector< std::complex< double >> &rhs) |
| LU back solve for given RHS. More... | |
| void | clean_up_memory () |
| LU clean up (perhaps this should happen in the destructor) More... | |
| void | residual (const Vector< std::complex< double >> &x, const Vector< std::complex< double >> &b, Vector< std::complex< double >> &residual) |
| Find the residual to x of Ax=b, i.e. r=b-Ax. More... | |
| void | multiply (const Vector< std::complex< double >> &x, Vector< std::complex< double >> &soln) |
| Multiply the matrix by the vector x: soln=Ax. More... | |
| void | multiply_transpose (const Vector< std::complex< double >> &x, Vector< std::complex< double >> &soln) |
| Multiply the transposed matrix by the vector x: soln=A^T x. More... | |
Public Member Functions inherited from oomph::CRMatrix< std::complex< double > > | |
| CRMatrix () | |
| Default constructor. More... | |
| CRMatrix (const Vector< std::complex< double > > &value, const Vector< int > &column_index_, const Vector< int > &row_start_, const unsigned long &n, const unsigned long &m) | |
| CRMatrix (const CRMatrix &source_matrix) | |
| Copy constructor. More... | |
| void | operator= (const CRMatrix &)=delete |
| Broken assignment operator. More... | |
| virtual | ~CRMatrix () |
| Destructor, delete any allocated memory. More... | |
| std::complex< double > | get_entry (const unsigned long &i, const unsigned long &j) const |
| std::complex< double > & | entry (const unsigned long &i, const unsigned long &j) |
| The read-write access function is deliberately broken. More... | |
| int * | row_start () |
| Access to C-style row_start array. More... | |
| const int * | row_start () const |
| Access to C-style row_start array (const version) More... | |
| int * | column_index () |
| Access to C-style column index array. More... | |
| const int * | column_index () const |
| Access to C-style column index array (const version) More... | |
| void | output_bottom_right_zero_helper (std::ostream &outfile) const |
| void | sparse_indexed_output_helper (std::ostream &outfile) const |
| void | clean_up_memory () |
| Wipe matrix data and set all values to 0. More... | |
| void | build (const Vector< std::complex< double > > &value, const Vector< int > &column_index, const Vector< int > &row_start, const unsigned long &n, const unsigned long &m) |
| void | build_without_copy (std::complex< double > *value, int *column_index, int *row_start, const unsigned long &nnz, const unsigned long &n, const unsigned long &m) |
Public Member Functions inherited from oomph::SparseMatrix< T, MATRIX_TYPE > | |
| SparseMatrix () | |
| Default constructor. More... | |
| SparseMatrix (const SparseMatrix &source_matrix) | |
| Copy constructor. More... | |
| void | operator= (const SparseMatrix &)=delete |
| Broken assignment operator. More... | |
| virtual | ~SparseMatrix () |
| Destructor, delete the memory associated with the values. More... | |
| T * | value () |
| Access to C-style value array. More... | |
| const T * | value () const |
| Access to C-style value array (const version) More... | |
| unsigned long | nrow () const |
| Return the number of rows of the matrix. More... | |
| unsigned long | ncol () const |
| Return the number of columns of the matrix. More... | |
| unsigned long | nnz () const |
| Return the number of nonzero entries. More... | |
Public Member Functions inherited from oomph::Matrix< T, MATRIX_TYPE > | |
| Matrix () | |
| (Empty) constructor More... | |
| Matrix (const Matrix &matrix)=delete | |
| Broken copy constructor. More... | |
| void | operator= (const Matrix &)=delete |
| Broken assignment operator. More... | |
| virtual | ~Matrix () |
| Virtual (empty) destructor. More... | |
| T | operator() (const unsigned long &i, const unsigned long &j) const |
| T & | operator() (const unsigned long &i, const unsigned long &j) |
| virtual void | output (std::ostream &outfile) const |
| void | sparse_indexed_output (std::ostream &outfile, const unsigned &precision=0, const bool &output_bottom_right_zero=false) const |
| void | sparse_indexed_output (std::string filename, const unsigned &precision=0, const bool &output_bottom_right_zero=false) const |
Public Member Functions inherited from oomph::ComplexMatrixBase | |
| ComplexMatrixBase () | |
| (Empty) constructor. More... | |
| ComplexMatrixBase (const ComplexMatrixBase &matrix)=delete | |
| Broken copy constructor. More... | |
| void | operator= (const ComplexMatrixBase &)=delete |
| Broken assignment operator. More... | |
| virtual | ~ComplexMatrixBase () |
| virtual (empty) destructor More... | |
| virtual void | solve (Vector< std::complex< double >> &rhs) |
| virtual void | solve (const Vector< std::complex< double >> &rhs, Vector< std::complex< double >> &soln) |
| virtual double | max_residual (const Vector< std::complex< double >> &x, const Vector< std::complex< double >> &rhs) |
Protected Attributes | |
| bool | Doc_stats_during_solve |
Protected Attributes inherited from oomph::CRMatrix< std::complex< double > > | |
| int * | Column_index |
| Column index. More... | |
| int * | Row_start |
| Start index for row. More... | |
Protected Attributes inherited from oomph::SparseMatrix< T, MATRIX_TYPE > | |
| T * | Value |
| Internal representation of the matrix values, a pointer. More... | |
| unsigned long | N |
| Number of rows. More... | |
| unsigned long | M |
| Number of columns. More... | |
| unsigned long | Nnz |
| Number of non-zero values (i.e. size of Value array) More... | |
Private Attributes | |
| void * | F_factors |
| Storage for the LU factors as required by SuperLU. More... | |
| int | Info |
| Info flag for the SuperLU solver. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from oomph::Matrix< T, MATRIX_TYPE > | |
| void | range_check (const unsigned long &i, const unsigned long &j) const |
Static Protected Attributes inherited from oomph::SparseMatrix< T, MATRIX_TYPE > | |
| static T | Zero = T(0) |
| Dummy zero. More... | |
A class for compressed row matrices.
|
inline |
Default constructor.
References Doc_stats_during_solve.
|
inline |
Constructor: Pass vector of values, vector of column indices, vector of row starts and number of columns (can be suppressed for square matrices)
References Doc_stats_during_solve.
|
delete |
Broken copy constructor.
|
inlinevirtual |
Destructor: Kill the LU decomposition if it has been computed.
References clean_up_memory().
| void oomph::CRComplexMatrix::clean_up_memory | ( | ) |
LU clean up (perhaps this should happen in the destructor)
Cleanup memory.
References oomph::CRMatrix< std::complex< double > >::Column_index, Doc_stats_during_solve, F_factors, i, Info, int(), oomph::SparseMatrix< T, MATRIX_TYPE >::N, oomph::SparseMatrix< T, MATRIX_TYPE >::Nnz, oomph::CRMatrix< std::complex< double > >::Row_start, oomph::superlu_complex(), anonymous_namespace{skew_symmetric_matrix3.cpp}::transpose(), and oomph::SparseMatrix< T, MATRIX_TYPE >::Value.
Referenced by ~CRComplexMatrix().
|
inline |
|
inline |
Set flag to indicate that stats are to be displayed during solution of linear system with SuperLU
References Doc_stats_during_solve.
LU back solve for given RHS.
Do back-substitution.
RHS vector
Reimplemented from oomph::ComplexMatrixBase.
References b, oomph::CRMatrix< std::complex< double > >::Column_index, Doc_stats_during_solve, F_factors, i, Info, int(), oomph::SparseMatrix< T, MATRIX_TYPE >::N, oomph::SparseMatrix< T, MATRIX_TYPE >::Nnz, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::CRMatrix< std::complex< double > >::Row_start, oomph::superlu_complex(), anonymous_namespace{skew_symmetric_matrix3.cpp}::transpose(), and oomph::SparseMatrix< T, MATRIX_TYPE >::Value.
|
virtual |
LU decomposition using SuperLU.
Do LU decomposition and return sign of determinant.
///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
Reimplemented from oomph::ComplexMatrixBase.
References oomph::CRMatrix< std::complex< double > >::Column_index, Doc_stats_during_solve, F_factors, i, Info, int(), oomph::SparseMatrix< T, MATRIX_TYPE >::N, oomph::SparseMatrix< T, MATRIX_TYPE >::Nnz, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::CRMatrix< std::complex< double > >::Row_start, SYCL::sign(), oomph::superlu_complex(), anonymous_namespace{skew_symmetric_matrix3.cpp}::transpose(), and oomph::SparseMatrix< T, MATRIX_TYPE >::Value.
|
virtual |
Multiply the matrix by the vector x: soln=Ax.
Multiply the matrix by the vector x.
Implements oomph::ComplexMatrixBase.
References oomph::CRMatrix< std::complex< double > >::Column_index, i, j, k, oomph::SparseMatrix< T, MATRIX_TYPE >::N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::CRMatrix< std::complex< double > >::Row_start, oomph::SparseMatrix< T, MATRIX_TYPE >::Value, and plotDoE::x.
|
virtual |
Multiply the transposed matrix by the vector x: soln=A^T x.
Implements oomph::ComplexMatrixBase.
References oomph::CRMatrix< std::complex< double > >::Column_index, i, j, k, oomph::SparseMatrix< T, MATRIX_TYPE >::M, oomph::SparseMatrix< T, MATRIX_TYPE >::N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::CRMatrix< std::complex< double > >::Row_start, oomph::SparseMatrix< T, MATRIX_TYPE >::Value, and plotDoE::x.
|
inlinevirtual |
Return the number of columns of the matrix.
Implements oomph::ComplexMatrixBase.
|
inlinevirtual |
Return the number of rows of the matrix.
Implements oomph::ComplexMatrixBase.
|
inlinevirtual |
Overload the round-bracket access operator for read-only access.
Implements oomph::ComplexMatrixBase.
References oomph::CRMatrix< std::complex< double > >::get_entry(), i, and j.
|
delete |
Broken assignment operator.
|
virtual |
Find the residual to x of Ax=b, i.e. r=b-Ax.
Find the residulal to x of Ax=b, ie r=b-Ax.
Implements oomph::ComplexMatrixBase.
References oomph::CRMatrix< std::complex< double > >::Column_index, i, j, k, oomph::SparseMatrix< T, MATRIX_TYPE >::N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::CRMatrix< std::complex< double > >::Row_start, oomph::SparseMatrix< T, MATRIX_TYPE >::Value, and plotDoE::x.
|
protected |
Flag to indicate if stats are to be displayed during solution of linear system with SuperLU
Referenced by clean_up_memory(), CRComplexMatrix(), disable_doc_stats(), enable_doc_stats(), lubksub(), and ludecompose().
|
private |
Storage for the LU factors as required by SuperLU.
Referenced by clean_up_memory(), lubksub(), and ludecompose().
|
private |
Info flag for the SuperLU solver.
Referenced by clean_up_memory(), lubksub(), and ludecompose().