1#ifndef included_CSRLocalMatrixOperationsDevice_H_
2#define included_CSRLocalMatrixOperationsDevice_H_
6template<
typename Config,
typename LocalMatrixData = CSRLocalMatrixData<Config>>
10 using gidx_t =
typename Config::gidx_t;
11 using lidx_t =
typename Config::lidx_t;
31 std::shared_ptr<LocalMatrixData> A,
32 std::vector<scalar_t> &vvals,
33 std::vector<size_t> &rcols );
40 static void scale(
scalar_t alpha, std::shared_ptr<LocalMatrixData> A );
49 axpy(
scalar_t alpha, std::shared_ptr<LocalMatrixData>
X, std::shared_ptr<LocalMatrixData> Y );
61 static void zero( std::shared_ptr<LocalMatrixData> A );
78 static void setIdentity( std::shared_ptr<LocalMatrixData> A );
91 static void copy( std::shared_ptr<const LocalMatrixData>
X,
92 std::shared_ptr<LocalMatrixData> Y );
99 template<
typename ConfigIn>
103 std::shared_ptr<LocalMatrixData> Y );
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.
typename Config::allocator_type allocator_type
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.
typename Config::gidx_t gidx_t
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.
typename Config::scalar_t scalar_t
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.
typename Config::lidx_t lidx_t
static void setScalar(scalar_t alpha, std::shared_ptr< LocalMatrixData > A)
Set the non-zeros of the matrix to a scalar.