Advanced Multi-Physics (AMP)
On-Line Documentation
CSRLocalMatrixOperationsDefault.h
Go to the documentation of this file.
1#ifndef included_CSRLocalMatrixOperationsDefault_H_
2#define included_CSRLocalMatrixOperationsDefault_H_
3
4namespace AMP::LinearAlgebra {
5
6template<typename Config>
8{
9public:
10 using config_type = Config;
11 using allocator_type = typename Config::allocator_type;
13 using gidx_t = typename Config::gidx_t;
14 using lidx_t = typename Config::lidx_t;
15 using scalar_t = typename Config::scalar_t;
16
17 static_assert( std::is_same_v<typename allocator_type::value_type, void> );
18
25 static void mult( const scalar_t *in, std::shared_ptr<localmatrixdata_t> A, scalar_t *out );
26
34 static void multTranspose( const scalar_t *in,
35 std::shared_ptr<localmatrixdata_t> A,
36 std::vector<scalar_t> &vvals,
37 std::vector<size_t> &rcols );
38
44 static void scale( scalar_t alpha, std::shared_ptr<localmatrixdata_t> A );
45
52 static void scale( scalar_t alpha, const scalar_t *D, std::shared_ptr<localmatrixdata_t> A );
53
60 static void scaleInv( scalar_t alpha, const scalar_t *D, std::shared_ptr<localmatrixdata_t> A );
61
68 static void axpy( scalar_t alpha,
69 std::shared_ptr<localmatrixdata_t> X,
70 std::shared_ptr<localmatrixdata_t> Y );
71
76 static void setScalar( scalar_t alpha, std::shared_ptr<localmatrixdata_t> A );
77
82 static void zero( std::shared_ptr<localmatrixdata_t> A );
83
88 static void setDiagonal( const scalar_t *in, std::shared_ptr<localmatrixdata_t> A );
89
94 static void extractDiagonal( std::shared_ptr<localmatrixdata_t> A, scalar_t *buf );
95
100 static void getRowSums( std::shared_ptr<localmatrixdata_t> A, scalar_t *buf );
101
106 static void getRowSumsAbsolute( std::shared_ptr<localmatrixdata_t> A, scalar_t *buf );
107
111 static void setIdentity( std::shared_ptr<localmatrixdata_t> A );
112
118 static void copy( std::shared_ptr<const localmatrixdata_t> X,
119 std::shared_ptr<localmatrixdata_t> Y );
120
126 template<typename ConfigIn>
127 static void
128 copyCast( std::shared_ptr<
129 CSRLocalMatrixData<typename ConfigIn::template set_alloc_t<Config::allocator>>> X,
130 std::shared_ptr<localmatrixdata_t> Y );
131};
132
133} // namespace AMP::LinearAlgebra
134
135#endif
#define X(C)
static void scaleInv(scalar_t alpha, const scalar_t *D, std::shared_ptr< localmatrixdata_t > A)
Scale the matrix by a scalar and inverse of diagonal matrix.
static void setScalar(scalar_t alpha, std::shared_ptr< localmatrixdata_t > A)
Set the non-zeros of the matrix to a scalar.
static void zero(std::shared_ptr< localmatrixdata_t > A)
Set the non-zeros of the matrix to zero.
static void axpy(scalar_t alpha, std::shared_ptr< localmatrixdata_t > X, std::shared_ptr< localmatrixdata_t > Y)
Compute the linear combination of two matrices.
static void getRowSumsAbsolute(std::shared_ptr< localmatrixdata_t > A, scalar_t *buf)
Extract the absolute row sums into a vector.
static void scale(scalar_t alpha, const scalar_t *D, std::shared_ptr< localmatrixdata_t > A)
Scale the matrix by a scalar and diagonal matrix.
static void setIdentity(std::shared_ptr< localmatrixdata_t > A)
Set the matrix to the identity matrix.
static void scale(scalar_t alpha, std::shared_ptr< localmatrixdata_t > A)
Scale the matrix by a scalar.
static void copy(std::shared_ptr< const localmatrixdata_t > X, std::shared_ptr< localmatrixdata_t > Y)
Set this matrix with the same non-zero and distributed structure as x and copy the coefficients.
static void extractDiagonal(std::shared_ptr< localmatrixdata_t > A, scalar_t *buf)
Extract the diagonal values into a vector.
static void mult(const scalar_t *in, std::shared_ptr< localmatrixdata_t > A, scalar_t *out)
Matrix-vector multiplication.
static void getRowSums(std::shared_ptr< localmatrixdata_t > A, scalar_t *buf)
Extract the row sums into a vector.
static void setDiagonal(const scalar_t *in, std::shared_ptr< localmatrixdata_t > A)
Set the diagonal to the values in a vector.
static void copyCast(std::shared_ptr< CSRLocalMatrixData< typename ConfigIn::template set_alloc_t< Config::allocator > > > X, std::shared_ptr< localmatrixdata_t > Y)
Set Y matrix with the same non-zero and distributed structure as X and copy the coefficients after up...
static void multTranspose(const scalar_t *in, std::shared_ptr< localmatrixdata_t > A, std::vector< scalar_t > &vvals, std::vector< size_t > &rcols)
Matrix transpose-vector multiplication.



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:40.
Comments on this page