Greens-code
A modular quantum transport code
|
General interface to inversion of large, sparse Matrices. More...
#include <supermatrix.hpp>
Public Types | |
typedef STD_TR1::shared_ptr< super_Matrix_iterator_factory > | p_iterator_factory |
typedef STD_TR1::shared_ptr< const super_Matrix_iterator_factory > | p_const_iterator_factory |
typedef std::pair< int, int > | indexpair |
typedef super_Matrix_strategy::status | status |
typedef STD_TR1::shared_ptr< super_Matrix > | ref |
typedef STD_TR1::shared_ptr< const super_Matrix > | const_ref |
![]() | |
typedef STD_TR1::shared_ptr< calculation_Matrix > | ref |
typedef STD_TR1::shared_ptr< const calculation_Matrix > | const_ref |
Public Member Functions | |
super_Matrix (MPI_Comm comm, const int N) | |
Construct with a size N of the problem (invert a NxN matrix) | |
status | get_status () |
Return the current phase. | |
p_iterator_factory | provide_iterator () |
Return an iterator factory over non-zero elements. | |
p_const_iterator_factory | provide_const_iterator () const |
void | set_param (const std::string &, double) |
Store optional parameters. | |
void | set_param (const std::string &, int) |
bool | get_double_param (const std::string &, double &) const |
bool | get_int_param (const std::string &, int &) const |
void | obtain_Diagonal (complex *) |
Return the diagonal elements of the inverse. | |
void | Add_To (Matrix &m) const |
Add superMatrix to another matrix. | |
void | Output (std::ostream &os) const |
Output the matrix. | |
void | Bake_to_Multiply (bool use_mkl=true) |
Finish SetUp phase, proceed to Multiplication. | |
void | Bake_to_Distributed_Multiply () |
Finish SetUp phase, proceed to Multiplication. | |
void | Bake_to_Factorize (bool distributed=false) |
Finish SetUp phase, proceed to Factorization. | |
void | Factorize () |
Factorize, will call Bake_to_Factorize() if needed. | |
void | Reset () |
Reset, return to SetUp phase. | |
ref | deep_copy () const |
Create a deep copy of all matrix elements. | |
MPI_Comm | get_comm () const |
Return MPI Communicator. | |
![]() | |
void | Apply (const complex *phi, complex *result) const |
Apply a vector (stored in a pointer, for legacy code only!) to the matrix. | |
void | Apply (const Vector &phi, Vector &result) const |
Apply a vector to the matrix. | |
void | Apply (complex *phi) const |
Overload of Apply to directly overwrite the input vector. | |
void | Apply (Vector &phi) const |
Overload of Apply to directly overwrite the input vector. | |
void | Scale (complex v) |
Scale the entire matrix by a complex constant. | |
![]() | |
void | assert_size (row r, column c) |
assert that the Matrix has a minimum number of rows and columns, if not try to resize | |
void | assert_size (row r, column c) const |
assert that the Matrix has a minimum number of rows and columns, if not throw an exception | |
void | Insert (row r, column c, complex v) |
Insert an element at a given position (overwritten if already there) | |
void | Add (row r, column c, complex v) |
Add an element at a given position. | |
complex | Get (row r, column c) const |
Obtain an element at a given position. | |
row | nrows () const |
Number of rows. | |
size_t | num_of_rows () const |
column | ncols () const |
Number of Columns. | |
size_t | num_of_cols () const |
void | add_diagonal (complex e) |
Add a number to the entire diagonal of the Matrix. | |
void | insert_diagonal (complex e) |
Insert a number to the entire diagonal of the Matrix. | |
void | multiply_by_number (complex v) |
multiply whole Matrix by a complex number | |
void | print (std::ostream &) const |
Output matrix to the stream. | |
void | formatted_print (std::ostream &) const |
bool | check_hermitian () const |
bool | check_realsymmetric () const |
Matrix & | operator+= (Matrix const &rhs) |
General interface to inversion of large, sparse Matrices.
super_Matrix is a general Matrix object, that can interface with different sparse matrix-inversion routines. Currently SuperLU, intelMKL, PETSc, and MUMPS are implemented. MUMPS is used as default on the vsc, see also http://graal.ens-lyon.fr/MUMPS/ .
Super_Matrix works in three phases. A strategy pattern is used to switch between phases. The enum of super_Matrix_strategy gives information about the current status:
enum status {SetUp, Baked, Multiply, Factorized, Factorized_dist};