1#ifndef included_AMP_DenseSerialMatrixData
2#define included_AMP_DenseSerialMatrixData
4#include "AMP/discretization/DOF_Manager.h"
5#include "AMP/matrices/Matrix.h"
6#include "AMP/vectors/Vector.h"
10class DenseSerialMatrix;
11class DenseSerialMatrixOperations;
38 std::string
type()
const override {
return "DenseSerialMatrixData"; }
45 std::shared_ptr<MatrixData>
transpose()
const override;
65 const typeID &
id )
override;
83 const typeID &
id )
override;
100 const typeID &
id )
const override;
109 std::vector<size_t> &cols,
110 std::vector<double> &values )
const override;
165 constexpr auto type = getTypeID<double>();
An concrete class for dealing with dense serial matrices.
virtual ~DenseSerialMatrixData()
Destructor.
std::shared_ptr< MatrixData > transpose() const override
Transpose.
size_t numLocalRows() const override
Get the number of local rows in the matrix.
void getRowByGlobalID(size_t row, std::vector< size_t > &cols, std::vector< double > &values) const override
Retrieve a row of the matrix in compressed format.
std::shared_ptr< AMP::Discretization::DOFManager > d_DOFManagerRight
std::string type() const override
Return the type of the matrix.
size_t numGlobalColumns() const override
Get the number of global columns in the matrix.
size_t numLocalColumns() const override
Get the number of local columns in the matrix.
DenseSerialMatrixData()=delete
DenseSerialMatrixData(std::shared_ptr< MatrixParametersBase > params)
Constructor.
size_t numGlobalRows() const override
Get the number of global rows in the matrix.
size_t numberColumnIDs(size_t row) const override
Given a row, retrieve the number of non-zero column indices of the matrix.
std::shared_ptr< Discretization::DOFManager > getLeftDOFManager() const override
Get the DOFManager associated with a left vector( For , is a left vector )
void getValuesByGlobalID(size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, void *values, const typeID &id) const override
Get values in the matrix.
void setValuesByGlobalID(size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, const void *values, const typeID &id) override
Set values in the matrix.
void removeRange(AMP::Scalar, AMP::Scalar) override
Remove matrix entries within given range.
std::shared_ptr< Discretization::DOFManager > getRightDOFManager() const override
Get the DOFManager associated with a right vector( For , is a right vector )
std::shared_ptr< AMP::Discretization::DOFManager > d_DOFManagerLeft
DenseSerialMatrixData & operator=(const DenseSerialMatrixData &)=delete
DenseSerialMatrixData(const DenseSerialMatrixData &)=delete
void makeConsistent(AMP::LinearAlgebra::ScatterType) override
Perform communication to ensure values in the matrix are the same across cores.
typeID getCoeffType() const override
Return the typeid of the matrix coeffs.
std::shared_ptr< MatrixData > cloneMatrixData() const override
Return a matrix with the same non-zero and distributed structure.
void addValuesByGlobalID(size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, const void *values, const typeID &id) override
Add values to those in the matrix.
std::vector< size_t > getColumnIDs(size_t row) const override
Given a row, retrieve the non-zero column indices of the matrix in compressed format.
An concrete class for dealing with dense serial matrices.
Scalar is a class used to store a scalar variable that may be different types/precision.
#define AMP_ERROR(MSG)
Throw error.
ScatterType
Flag to choose algorithm for makeConsistent.
Class to store type info.