Morpheus 1.0.0
Dynamic matrix type and algorithms for sparse matrices
Loading...
Searching...
No Matches
Morpheus_MatrixOperations.hpp
1
24#ifndef MORPHEUS_MATRIXOPERATIONS_HPP
25#define MORPHEUS_MATRIXOPERATIONS_HPP
26
27#include <impl/Morpheus_MatrixOperations_Impl.hpp>
28#include <impl/Dynamic/Morpheus_MatrixOperations_Impl.hpp>
29
30namespace Morpheus {
54template <typename ExecSpace, typename Matrix, typename Vector>
55void update_diagonal(Matrix& A, const Vector& diagonal) {
56 Impl::update_diagonal<ExecSpace>(A, diagonal);
57}
58
70template <typename ExecSpace, typename Matrix, typename Vector>
71void get_diagonal(const Matrix& A, Vector& diagonal) {
72 Impl::get_diagonal<ExecSpace>(A, diagonal);
73}
74
88template <typename ExecSpace, typename Matrix, typename SizeType,
89 typename ValueType>
90void set_value(Matrix& A, SizeType row, SizeType col, ValueType value) {
91 Impl::set_value(A, row, col, value);
92}
93
109template <typename ExecSpace, typename Matrix, typename IndexVector,
110 typename ValueVector>
111void set_values(Matrix& A, typename IndexVector::value_type m,
112 const IndexVector idxm, typename IndexVector::value_type n,
113 const IndexVector idxn, ValueVector values) {
114 Impl::set_values<ExecSpace>(A, m, idxm, n, idxn, values);
115}
116
127template <typename ExecSpace, typename Matrix, typename TransposeMatrix>
128void transpose(const Matrix& A, TransposeMatrix& At) {
129 Impl::transpose<ExecSpace>(A, At);
130}
133} // namespace Morpheus
134
135#endif // MORPHEUS_MATRIXOPERATIONS_HPP
void get_diagonal(const Matrix &A, Vector &diagonal)
Gets the main diagonal of the matrix and places it in a vector.
Definition: Morpheus_MatrixOperations.hpp:71
void update_diagonal(Matrix &A, const Vector &diagonal)
Updates the main diagonal of the matrix with contents of the diagonal vector.
Definition: Morpheus_MatrixOperations.hpp:55
void transpose(const Matrix &A, TransposeMatrix &At)
Computes the transpose of the given matrix.
Definition: Morpheus_MatrixOperations.hpp:128
void set_value(Matrix &A, SizeType row, SizeType col, ValueType value)
Set a single entry into a matrix.
Definition: Morpheus_MatrixOperations.hpp:90
void 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.
Definition: Morpheus_MatrixOperations.hpp:111
Generic Morpheus interfaces.
Definition: dummy.cpp:24
A wrapper that checks if the provided type is a scalar type.
Definition: Morpheus_TypeTraits.hpp:85