1#ifndef included_CSRLocalMatrixOperationsDefault_H_
2#define included_CSRLocalMatrixOperationsDefault_H_
6template<
typename Config>
13 using gidx_t =
typename Config::gidx_t;
14 using lidx_t =
typename Config::lidx_t;
17 static_assert( std::is_same_v<typename allocator_type::value_type, void> );
35 std::shared_ptr<localmatrixdata_t> A,
36 std::vector<scalar_t> &vvals,
37 std::vector<size_t> &rcols );
44 static void scale(
scalar_t alpha, std::shared_ptr<localmatrixdata_t> A );
69 std::shared_ptr<localmatrixdata_t>
X,
70 std::shared_ptr<localmatrixdata_t> Y );
82 static void zero( std::shared_ptr<localmatrixdata_t> A );
118 static void copy( std::shared_ptr<const localmatrixdata_t>
X,
119 std::shared_ptr<localmatrixdata_t> Y );
126 template<
typename ConfigIn>
130 std::shared_ptr<localmatrixdata_t> Y );
typename Config::gidx_t gidx_t
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.
typename Config::scalar_t scalar_t
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.
typename Config::allocator_type allocator_type
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.
typename Config::lidx_t lidx_t
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.