Greens-code
A modular quantum transport code
|
Obtain a part of a larger Matrix as sub-Matrix that can be accessed like a Matrix. More...
#include <matrix.hpp>
Public Member Functions | |
sub_Matrix (Matrix &t, row r, column c) | |
Construct a sub_Matrix from a Matrix, where the sub_Matrix starts at given Position. | |
![]() | |
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) |
Obtain a part of a larger Matrix as sub-Matrix that can be accessed like a Matrix.
When dealing with Matrices, one often needs to access part of a larger Matrix as sub_Matrix, and give this sub-Matrix as argument to an algorithm handling a matrix. Generate a sub_Matrix by giving a Matrix, and a position inside the matrix. Currently, the sub_Matrix will have the maximal size compatible with its starting point in the original matrix