Morpheus 1.0.0
Dynamic matrix type and algorithms for sparse matrices
Loading...
Searching...
No Matches
Functions
Operations

Operations for manipulating the various containers. More...

Collaboration diagram for Operations:

Functions

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...
 

Detailed Description

Operations for manipulating the various containers.

Function Documentation

◆ 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
ExecSpaceExecution space to run the algorithm
MatrixThe type of the matrix container
VectorThe type of the extracted diagonal
Parameters
AThe matrix to extract the diagonal from
diagonalThe 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
ExecSpaceExecution space to run the algorithm
MatrixThe type of the matrix container
IndexTypeThe type of the indices of the matrix
ValueTypeThe type of the values of the matrix
Parameters
AThe matrix to update
rowThe row location of the entry
colThe column location of the entry
valueThe 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
ExecSpaceExecution space to run the algorithm
MatrixThe type of the matrix container
IndexVectorThe type of the container holding the indices
ValueVectorThe type of the container holding the values
Parameters
AThe matrix to update
mThe number of rows
idxmRow global indices
nThe number of columns
idxnColumn global indices
valuesA 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
ExecSpaceExecution space to run the algorithm
MatrixThe type of the matrix container
TransposeMatrixThe type of the transposed matrix container
Parameters
AThe matrix to transpose
BThe 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
ExecSpaceExecution space to run the algorithm
MatrixThe type of the matrix container
VectorThe type of the vector representing the diagonal
Parameters
AThe matrix to update the diagonal for
diagonalThe 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.