Operations for manipulating the various containers.
More...
|
template<typename ExecSpace , typename Matrix , typename Vector > |
void | Morpheus::update_diagonal (Matrix &A, const Vector &diagonal) |
| Updates the main diagonal of the matrix with contents of the diagonal vector. More...
|
|
template<typename ExecSpace , typename Matrix , typename Vector > |
void | Morpheus::get_diagonal (const Matrix &A, Vector &diagonal) |
| Gets the main diagonal of the matrix and places it in a vector. More...
|
|
template<typename ExecSpace , typename Matrix , typename SizeType , typename ValueType > |
void | Morpheus::set_value (Matrix &A, SizeType row, SizeType col, ValueType value) |
| Set a single entry into a matrix. More...
|
|
template<typename ExecSpace , typename Matrix , typename IndexVector , typename ValueVector > |
void | Morpheus::set_values (Matrix &A, typename IndexVector::value_type m, const IndexVector idxm, typename IndexVector::value_type n, const IndexVector idxn, ValueVector values) |
| Inserts or adds a block of values into a matrix. More...
|
|
template<typename ExecSpace , typename Matrix , typename TransposeMatrix > |
void | Morpheus::transpose (const Matrix &A, TransposeMatrix &At) |
| Computes the transpose of the given matrix. More...
|
|
Operations for manipulating the various containers.
◆ get_diagonal()
template<typename ExecSpace , typename Matrix , typename Vector >
void Morpheus::get_diagonal |
( |
const Matrix & |
A, |
|
|
Vector & |
diagonal |
|
) |
| |
Gets the main diagonal of the matrix and places it in a vector.
- Template Parameters
-
ExecSpace | Execution space to run the algorithm |
Matrix | The type of the matrix container |
Vector | The type of the extracted diagonal |
- Parameters
-
A | The matrix to extract the diagonal from |
diagonal | The main matrix diagonal represented as a vector |
◆ set_value()
template<typename ExecSpace , typename Matrix , typename SizeType , typename
ValueType >
void Morpheus::set_value |
( |
Matrix & |
A, |
|
|
SizeType |
row, |
|
|
SizeType |
col, |
|
|
ValueType |
value |
|
) |
| |
Set a single entry into a matrix.
- Template Parameters
-
ExecSpace | Execution space to run the algorithm |
Matrix | The type of the matrix container |
IndexType | The type of the indices of the matrix |
ValueType | The type of the values of the matrix |
- Parameters
-
A | The matrix to update |
row | The row location of the entry |
col | The column location of the entry |
value | The value to insert |
◆ set_values()
template<typename ExecSpace , typename Matrix , typename IndexVector , typename ValueVector >
void Morpheus::set_values |
( |
Matrix & |
A, |
|
|
typename IndexVector::value_type |
m, |
|
|
const IndexVector |
idxm, |
|
|
typename IndexVector::value_type |
n, |
|
|
const IndexVector |
idxn, |
|
|
ValueVector |
values |
|
) |
| |
Inserts or adds a block of values into a matrix.
- Template Parameters
-
ExecSpace | Execution space to run the algorithm |
Matrix | The type of the matrix container |
IndexVector | The type of the container holding the indices |
ValueVector | The type of the container holding the values |
- Parameters
-
A | The matrix to update |
m | The number of rows |
idxm | Row global indices |
n | The number of columns |
idxn | Column global indices |
values | A logically two-dimensional array of values |
◆ transpose()
template<typename ExecSpace , typename Matrix , typename TransposeMatrix >
void Morpheus::transpose |
( |
const Matrix & |
A, |
|
|
TransposeMatrix & |
At |
|
) |
| |
Computes the transpose of the given matrix.
- Template Parameters
-
ExecSpace | Execution space to run the algorithm |
Matrix | The type of the matrix container |
TransposeMatrix | The type of the transposed matrix container |
- Parameters
-
A | The matrix to transpose |
B | The transposed matrix |
◆ update_diagonal()
template<typename ExecSpace , typename Matrix , typename Vector >
void Morpheus::update_diagonal |
( |
Matrix & |
A, |
|
|
const Vector & |
diagonal |
|
) |
| |
Updates the main diagonal of the matrix with contents of the diagonal vector.
- Template Parameters
-
ExecSpace | Execution space to run the algorithm |
Matrix | The type of the matrix container |
Vector | The type of the vector representing the diagonal |
- Parameters
-
A | The matrix to update the diagonal for |
diagonal | The matrix diagonal represented as a vector |
- Note
- The sparsity pattern of the matrix remains unchanged i.e it only updates the non-zero elements on the main diagonal.