Advanced Multi-Physics (AMP)
On-Line Documentation
CSRLocalMatrixOperationsDevice.h
Go to the documentation of this file.
1#ifndef included_CSRLocalMatrixOperationsDevice_H_
2#define included_CSRLocalMatrixOperationsDevice_H_
3
4namespace AMP::LinearAlgebra {
5
6template<typename Config, typename LocalMatrixData = CSRLocalMatrixData<Config>>
8{
9public:
10 using gidx_t = typename Config::gidx_t;
11 using lidx_t = typename Config::lidx_t;
12 using scalar_t = typename Config::scalar_t;
13 using allocator_type = typename Config::allocator_type;
14
21 static void mult( const scalar_t *in, std::shared_ptr<LocalMatrixData> A, scalar_t *out );
22
30 static void multTranspose( const scalar_t *in,
31 std::shared_ptr<LocalMatrixData> A,
32 std::vector<scalar_t> &vvals,
33 std::vector<size_t> &rcols );
34
40 static void scale( scalar_t alpha, std::shared_ptr<LocalMatrixData> A );
41
48 static void
49 axpy( scalar_t alpha, std::shared_ptr<LocalMatrixData> X, std::shared_ptr<LocalMatrixData> Y );
50
55 static void setScalar( scalar_t alpha, std::shared_ptr<LocalMatrixData> A );
56
61 static void zero( std::shared_ptr<LocalMatrixData> A );
62
67 static void setDiagonal( const scalar_t *in, std::shared_ptr<LocalMatrixData> A );
68
73 static void extractDiagonal( std::shared_ptr<LocalMatrixData> A, scalar_t *buf );
74
78 static void setIdentity( std::shared_ptr<LocalMatrixData> A );
79
84 static void LinfNorm( std::shared_ptr<LocalMatrixData> A, scalar_t *rowSums );
85
91 static void copy( std::shared_ptr<const LocalMatrixData> X,
92 std::shared_ptr<LocalMatrixData> Y );
93
99 template<typename ConfigIn>
100 static void
101 copyCast( std::shared_ptr<
102 CSRLocalMatrixData<typename ConfigIn::template set_alloc_t<Config::allocator>>> X,
103 std::shared_ptr<LocalMatrixData> Y );
104};
105
106} // namespace AMP::LinearAlgebra
107
108#endif
#define X(C)
static void LinfNorm(std::shared_ptr< LocalMatrixData > A, scalar_t *rowSums)
Compute the maximum row sum.
static void mult(const scalar_t *in, std::shared_ptr< LocalMatrixData > A, scalar_t *out)
Matrix-vector multiplication.
static void setIdentity(std::shared_ptr< LocalMatrixData > A)
Set the matrix to the identity matrix.
static void copyCast(std::shared_ptr< CSRLocalMatrixData< typename ConfigIn::template set_alloc_t< Config::allocator > > > X, std::shared_ptr< LocalMatrixData > Y)
Set Y matrix with the same non-zero and distributed structure as X and copy the coefficients after up...
static void extractDiagonal(std::shared_ptr< LocalMatrixData > A, scalar_t *buf)
Extract the diagonal values into a vector.
static void copy(std::shared_ptr< const LocalMatrixData > X, std::shared_ptr< LocalMatrixData > Y)
Set this matrix with the same non-zero and distributed structure as x and copy the coefficients.
static void axpy(scalar_t alpha, std::shared_ptr< LocalMatrixData > X, std::shared_ptr< LocalMatrixData > Y)
Compute the linear combination of two matrices.
static void setDiagonal(const scalar_t *in, std::shared_ptr< LocalMatrixData > A)
Set the diagonal to the values in a vector.
static void zero(std::shared_ptr< LocalMatrixData > A)
Set the non-zeros of the matrix to zero.
static void multTranspose(const scalar_t *in, std::shared_ptr< LocalMatrixData > A, std::vector< scalar_t > &vvals, std::vector< size_t > &rcols)
Matrix transpose-vector multiplication.
static void scale(scalar_t alpha, std::shared_ptr< LocalMatrixData > A)
Scale the matrix by a scalar.
static void setScalar(scalar_t alpha, std::shared_ptr< LocalMatrixData > A)
Set the non-zeros of the matrix to a scalar.



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