![]() |
|
A class for compressed column matrices that store doubles. More...
#include <complex_matrices.h>
Public Member Functions | |
CCComplexMatrix () | |
Default constructor. More... | |
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) | |
CCComplexMatrix (const CCComplexMatrix &matrix)=delete | |
Broken copy constructor. More... | |
void | operator= (const CCComplexMatrix &)=delete |
Broken assignment operator. More... | |
virtual | ~CCComplexMatrix () |
Destructor: Kill the LU factors if they have been setup. 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 |
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 residulal to x of Ax=b, ie 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... | |
![]() | |
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) |
![]() | |
CCMatrix () | |
Default constructor. More... | |
CCMatrix (const Vector< std::complex< double > > &value, const Vector< int > &row_index_, const Vector< int > &column_start_, const unsigned long &n, const unsigned long &m) | |
CCMatrix (const CCMatrix &source_matrix) | |
Copy constructor. More... | |
void | operator= (const CCMatrix &)=delete |
Broken assignment operator. More... | |
virtual | ~CCMatrix () |
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) |
int * | column_start () |
Access to C-style column_start array. More... | |
const int * | column_start () const |
Access to C-style column_start array (const version) More... | |
int * | row_index () |
Access to C-style row index array. More... | |
const int * | row_index () const |
Access to C-style row 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 > &row_index, const Vector< int > &column_start, const unsigned long &n, const unsigned long &m) |
void | build_without_copy (std::complex< double > *value, int *row_index, int *column_start, const unsigned long &nnz, const unsigned long &n, const unsigned long &m) |
![]() | |
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... | |
![]() | |
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 |
Protected Attributes | |
bool | Doc_stats_during_solve |
![]() | |
int * | Row_index |
Row index. More... | |
int * | Column_start |
Start index for column. More... | |
![]() | |
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 | |
![]() | |
void | range_check (const unsigned long &i, const unsigned long &j) const |
![]() | |
static T | Zero = T(0) |
Dummy zero. More... | |
A class for compressed column matrices that store doubles.
|
inline |
Default constructor.
References Doc_stats_during_solve.
|
inline |
Constructor: Pass vector of values, vector of row indices, vector of column starts and number of rows (can be suppressed for square matrices). Number of nonzero entries is read off from value, so make sure the vector has been shrunk to its correct length.
References Doc_stats_during_solve.
|
delete |
Broken copy constructor.
|
inlinevirtual |
Destructor: Kill the LU factors if they have been setup.
References clean_up_memory().
void oomph::CCComplexMatrix::clean_up_memory | ( | ) |
LU clean up (perhaps this should happen in the destructor)
Cleanup storage.
References oomph::CCMatrix< std::complex< double > >::Column_start, Doc_stats_during_solve, F_factors, i, Info, int(), oomph::SparseMatrix< T, MATRIX_TYPE >::N, oomph::SparseMatrix< T, MATRIX_TYPE >::Nnz, oomph::CCMatrix< std::complex< double > >::Row_index, oomph::superlu_complex(), anonymous_namespace{skew_symmetric_matrix3.cpp}::transpose(), and oomph::SparseMatrix< T, MATRIX_TYPE >::Value.
Referenced by ~CCComplexMatrix().
|
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 the backsubstitution.
RHS vector
Reimplemented from oomph::ComplexMatrixBase.
References b, oomph::CCMatrix< std::complex< double > >::Column_start, 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::CCMatrix< std::complex< double > >::Row_index, oomph::superlu_complex(), anonymous_namespace{skew_symmetric_matrix3.cpp}::transpose(), and oomph::SparseMatrix< T, MATRIX_TYPE >::Value.
|
virtual |
LU decomposition using SuperLU.
Perform LU decomposition. Return the sign of the determinant.
Reimplemented from oomph::ComplexMatrixBase.
References oomph::CCMatrix< std::complex< double > >::Column_start, 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::CCMatrix< std::complex< double > >::Row_index, 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::CCMatrix< std::complex< double > >::Column_start, i, j, k, oomph::SparseMatrix< T, MATRIX_TYPE >::N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::CCMatrix< std::complex< double > >::Row_index, 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::CCMatrix< std::complex< double > >::Column_start, i, j, k, oomph::SparseMatrix< T, MATRIX_TYPE >::M, oomph::SparseMatrix< T, MATRIX_TYPE >::N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::CCMatrix< std::complex< double > >::Row_index, 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 to provide read-only (const) access to the data
Implements oomph::ComplexMatrixBase.
References oomph::CCMatrix< std::complex< double > >::get_entry(), i, and j.
|
delete |
Broken assignment operator.
|
virtual |
Find the residulal to x of Ax=b, ie r=b-Ax.
Work out residual vector r = b-Ax for candidate solution x.
Implements oomph::ComplexMatrixBase.
References oomph::CCMatrix< std::complex< double > >::Column_start, i, j, k, oomph::SparseMatrix< T, MATRIX_TYPE >::N, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::CCMatrix< std::complex< double > >::Row_index, 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 CCComplexMatrix(), clean_up_memory(), 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().