1#ifndef included_AMP_CSRMatrix
2#define included_AMP_CSRMatrix
4#include "AMP/matrices/CSRConfig.h"
5#include "AMP/matrices/Matrix.h"
6#include "AMP/utils/Memory.h"
7#include "AMP/vectors/Vector.h"
16template<
typename Policy>
31 static_assert( std::is_same_v<typename allocator_type::value_type, void> );
38 explicit CSRMatrix( std::shared_ptr<MatrixParametersBase> params );
44 explicit CSRMatrix( std::shared_ptr<MatrixData> data );
55 virtual std::string
type()
const override {
return "CSRMatrix"; }
58 virtual std::uint16_t
mode()
const override
60 return static_cast<std::uint16_t
>( Config::mode );
91 template<
typename ConfigOut>
98 template<
typename ConfigOut>
Class to manage reading/writing restart data.
An concrete class for dealing with dense serial matrices.
virtual std::uint16_t mode() const override
Return CSR mode of the matrix.
shared_ptr migrate(AMP::Utilities::Backend backend) const
Return a copy of the matrix with the specified ConfigOut.
Vector::shared_ptr extractDiagonal(Vector::shared_ptr buf=Vector::shared_ptr()) const override
Extract the diagonal from a matrix.
typename Config::allocator_type allocator_type
Vector::shared_ptr createOutputVector() const override
Get a left vector( For , is a left vector )
shared_ptr migrate() const
Return a copy of the matrix with the specified ConfigOut.
Vector::shared_ptr createInputVector() const override
Get a right vector( For , is a right vector )
shared_ptr clone() const override
Return a matrix with the same non-zero and distributed structure.
CSRMatrix(std::shared_ptr< MatrixData > data)
Constructor.
CSRMatrix & operator=(const CSRMatrix &)=delete
CSRMatrixData< Config > matrixdata_t
shared_ptr migrate(AMP::Utilities::MemoryType memType, AMP::Utilities::Backend backend) const
Return a copy of the matrix in the specified memory space.
void setBackend(AMP::Utilities::Backend backend) override
Replace current backend with different one, no-op if same.
CSRMatrix(std::shared_ptr< MatrixParametersBase > params)
Constructor.
virtual ~CSRMatrix()
Destructor.
shared_ptr migrate(AMP::Utilities::MemoryType memType) const
Return a copy of the matrix in the specified memory space.
CSRMatrix(int64_t fid, AMP::IO::RestartManager *manager)
CSRMatrix(const CSRMatrix &)=delete
shared_ptr transpose() const override
Return a new matrix that is the transpose of this one.
virtual std::string type() const override
Return the type of the matrix.
void multiply(shared_ptr other_op, shared_ptr &result) override
Multiply two matrices and store in a third.
An abstract interface for using and manipulating matrices.
std::shared_ptr< Matrix > shared_ptr
Convenience typedef.
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Backend
Enum to store the backend used for gpu acceleration.
MemoryType
Enum to store pointer type.