An concrete class for dealing with dense serial matrices. More...
#include <DenseSerialMatrixData.h>

Public Member Functions | |
| template<class TYPE > | |
| void | addValuesByGlobalID (size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, const TYPE *values) |
| Add values to those in the matrix. | |
| 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. | |
| virtual size_t | beginCol () const |
| Get the global id of first column in diagonal block. | |
| virtual size_t | beginRow () const |
| Get the global id of the beginning row. | |
| std::shared_ptr< MatrixData > | cloneMatrixData () const override |
| Return a matrix with the same non-zero and distributed structure. | |
| DenseSerialMatrixData ()=delete | |
| DenseSerialMatrixData (const DenseSerialMatrixData &)=delete | |
| DenseSerialMatrixData (std::shared_ptr< MatrixParametersBase > params) | |
| Constructor. | |
| virtual size_t | endCol () const |
| Get the global id of last column in diagonal block. | |
| virtual size_t | endRow () const |
| Get the global id of the ending row. | |
| virtual AMP::Utilities::Backend | getBackend () const |
| Get the backend. | |
| typeID | getCoeffType () const override |
| Return the typeid of the matrix coeffs. | |
| 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. | |
| virtual AMP_MPI | getComm () const |
| Get the comm. | |
| uint64_t | getID () const |
| Get a unique id hash for the vector. | |
| std::shared_ptr< Discretization::DOFManager > | getLeftDOFManager () const override |
| Get the DOFManager associated with a left vector( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a left vector ) | |
| virtual std::shared_ptr< Variable > | getLeftVariable () const |
| Get the variable associated with a left vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a left vector ) | |
| std::shared_ptr< Discretization::DOFManager > | getRightDOFManager () const override |
| Get the DOFManager associated with a right vector( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{x}\) is a right vector ) | |
| virtual std::shared_ptr< Variable > | getRightVariable () const |
| Get the variable associated with a right vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{x}\) is a right vector ) | |
| 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. | |
| template<class TYPE > | |
| void | getValuesByGlobalID (size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, TYPE *values) const |
| Get values in the matrix. | |
| 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 | makeConsistent (AMP::LinearAlgebra::ScatterType) override |
| Perform communication to ensure values in the matrix are the same across cores. | |
| virtual std::uint16_t | mode () const |
| Return CSR mode of the matrix. | |
| size_t | numberColumnIDs (size_t row) const override |
| Given a row, retrieve the number of non-zero column indices of the matrix. | |
| size_t | numGlobalColumns () const override |
| Get the number of global columns in the matrix. | |
| size_t | numGlobalRows () const override |
| Get the number of global rows in the matrix. | |
| size_t | numLocalColumns () const override |
| Get the number of local columns in the matrix. | |
| size_t | numLocalRows () const override |
| Get the number of local rows in the matrix. | |
| DenseSerialMatrixData & | operator= (const DenseSerialMatrixData &)=delete |
| virtual void | registerChildObjects (AMP::IO::RestartManager *manager) const |
| Register any child objects. | |
| void | removeRange (AMP::Scalar, AMP::Scalar) override |
| Remove matrix entries within given range. | |
| virtual void | setBackend (AMP::Utilities::Backend backend) |
| template<class TYPE > | |
| void | setValuesByGlobalID (size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, const TYPE *values) |
| Set 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. | |
| std::shared_ptr< MatrixData > | shared_from_this () |
| std::shared_ptr< const MatrixData > | shared_from_this () const |
| std::shared_ptr< MatrixData > | transpose () const override |
| Transpose. | |
| std::string | type () const override |
| Return the type of the matrix. | |
| virtual void | writeRestart (int64_t fid) const |
| Write restart data to file. | |
| virtual | ~DenseSerialMatrixData () |
| Destructor. | |
Protected Attributes | |
| size_t | d_cols |
| std::shared_ptr< AMP::Discretization::DOFManager > | d_DOFManagerLeft |
| std::shared_ptr< AMP::Discretization::DOFManager > | d_DOFManagerRight |
| uint64_t | d_hash = 0 |
| double * | d_M = nullptr |
| std::shared_ptr< MatrixParametersBase > | d_pParameters |
| size_t | d_rows |
| std::weak_ptr< MatrixData > | weak_ptr_ |
Friends | |
| class | DenseSerialMatrix |
| class | DenseSerialMatrixOperations |
An concrete class for dealing with dense serial matrices.
This is a concrete class that stores a dense local matrix. This is not a distributed matrix and requires that the comm is AMP_COMM_SELF.
Definition at line 21 of file DenseSerialMatrixData.h.
|
explicit |
Constructor.
| [in] | params | Description of the matrix |
|
delete |
|
delete |
|
virtual |
Destructor.
|
inherited |
Add values to those in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [in] | values | The values to add to the matrix (row-major ordering) |
This method may fail if the matrix has not allocated a particular (row,col) specified, depending on the actual subclass of matrix used.
|
overridevirtual |
Add values to those in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [in] | values | The values to add to the matrix |
| [in] | id | typeID of raw data |
This method may fail if the matrix has not allocated a particular(row,col) specified, depending on the actual subclass of matrix used.
Implements AMP::LinearAlgebra::MatrixData.
|
virtualinherited |
Get the global id of first column in diagonal block.
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
virtualinherited |
Get the global id of the beginning row.
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
overridevirtual |
Return a matrix with the same non-zero and distributed structure.
Implements AMP::LinearAlgebra::MatrixData.
|
virtualinherited |
Get the global id of last column in diagonal block.
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
virtualinherited |
Get the global id of the ending row.
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
inlinevirtualinherited |
Get the backend.
Definition at line 268 of file MatrixData.h.
References AMP_ASSERT, and AMP::LinearAlgebra::MatrixData::d_pParameters.
|
inlineoverridevirtual |
Return the typeid of the matrix coeffs.
Implements AMP::LinearAlgebra::MatrixData.
Definition at line 163 of file DenseSerialMatrixData.h.
References type().
|
overridevirtual |
Given a row, retrieve the non-zero column indices of the matrix in compressed format.
| [in] | row | Which row |
Implements AMP::LinearAlgebra::MatrixData.
|
inlinevirtualinherited |
Get the comm.
Reimplemented in AMP::LinearAlgebra::NativePetscMatrixData, and AMP::LinearAlgebra::EpetraMatrixData.
Definition at line 261 of file MatrixData.h.
References AMP_ASSERT, and AMP::LinearAlgebra::MatrixData::d_pParameters.
|
inherited |
Get a unique id hash for the vector.
|
overridevirtual |
Get the DOFManager associated with a left vector( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a left vector )
Implements AMP::LinearAlgebra::MatrixData.
|
inlinevirtualinherited |
Get the variable associated with a left vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a left vector )
Definition at line 215 of file MatrixData.h.
References AMP::LinearAlgebra::MatrixData::d_pParameters.
|
overridevirtual |
Get the DOFManager associated with a right vector( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{x}\) is a right vector )
Implements AMP::LinearAlgebra::MatrixData.
|
inlinevirtualinherited |
Get the variable associated with a right vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{x}\) is a right vector )
Definition at line 205 of file MatrixData.h.
References AMP::LinearAlgebra::MatrixData::d_pParameters.
|
overridevirtual |
Retrieve a row of the matrix in compressed format.
| [in] | row | Which row |
| [out] | cols | The column ids of the returned values |
| [out] | values | The values in the row |
Implements AMP::LinearAlgebra::MatrixData.
|
inherited |
Get values in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [out] | values | The values to get from the matrix (row-major ordering) |
This method will return zero for any entries that have not been allocated or are not ghosts on the current processor.
|
overridevirtual |
Get values in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [in] | values | The values to get from the matrix (row-major ordering) |
| [in] | id | typeID of raw data |
This method will return zero for any entries that have not been allocated or are not ghosts on the current processor.
Implements AMP::LinearAlgebra::MatrixData.
|
inlineoverridevirtual |
Perform communication to ensure values in the matrix are the same across cores.
Implements AMP::LinearAlgebra::MatrixData.
Definition at line 125 of file DenseSerialMatrixData.h.
|
inlinevirtualinherited |
Return CSR mode of the matrix.
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
Definition at line 57 of file MatrixData.h.
|
overridevirtual |
Given a row, retrieve the number of non-zero column indices of the matrix.
| [in] | row | Which row |
Implements AMP::LinearAlgebra::MatrixData.
|
inlineoverridevirtual |
Get the number of global columns in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
Definition at line 159 of file DenseSerialMatrixData.h.
References d_cols.
|
inlineoverridevirtual |
Get the number of global rows in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
Definition at line 149 of file DenseSerialMatrixData.h.
References d_rows.
|
inlineoverridevirtual |
Get the number of local columns in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
Definition at line 154 of file DenseSerialMatrixData.h.
References d_cols.
|
inlineoverridevirtual |
Get the number of local rows in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
Definition at line 144 of file DenseSerialMatrixData.h.
References d_rows.
|
delete |
|
virtualinherited |
Register any child objects.
This function will register child objects with the manager
| manager | Restart manager |
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
inlineoverridevirtual |
Remove matrix entries within given range.
Implements AMP::LinearAlgebra::MatrixData.
Definition at line 47 of file DenseSerialMatrixData.h.
References AMP_ERROR.
|
inlinevirtualinherited |
Definition at line 274 of file MatrixData.h.
References AMP_ASSERT, and AMP::LinearAlgebra::MatrixData::d_pParameters.
|
inherited |
Set values in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [in] | values | The values to set to the matrix (row-major ordering) |
This method may fail if the matrix has not allocated a particular (row,col) specified, depending on the actual subclass of matrix used.
|
overridevirtual |
Set values in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [in] | values | The values to set to the matrix |
| [in] | id | typeID of raw data |
This method may fail if the matrix has not allocated a particular(row,col) specified, depending on the actual subclass of matrix used.
Implements AMP::LinearAlgebra::MatrixData.
|
inlineinherited |
Definition at line 28 of file enable_shared_from_this.h.
|
inlineinherited |
Definition at line 46 of file enable_shared_from_this.h.
|
overridevirtual |
Transpose.
Implements AMP::LinearAlgebra::MatrixData.
|
inlineoverridevirtual |
Return the type of the matrix.
Implements AMP::LinearAlgebra::MatrixData.
Definition at line 38 of file DenseSerialMatrixData.h.
Referenced by getCoeffType().
|
virtualinherited |
Write restart data to file.
This function will write the mesh to an HDF5 file
| fid | File identifier to write |
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
friend |
Definition at line 179 of file DenseSerialMatrixData.h.
|
friend |
Definition at line 180 of file DenseSerialMatrixData.h.
|
protected |
Definition at line 176 of file DenseSerialMatrixData.h.
Referenced by numGlobalColumns(), and numLocalColumns().
|
protected |
Definition at line 171 of file DenseSerialMatrixData.h.
|
protected |
Definition at line 172 of file DenseSerialMatrixData.h.
|
protectedinherited |
Definition at line 311 of file MatrixData.h.
|
protected |
Definition at line 177 of file DenseSerialMatrixData.h.
|
protectedinherited |
Definition at line 308 of file MatrixData.h.
Referenced by AMP::LinearAlgebra::MatrixData::getBackend(), AMP::LinearAlgebra::MatrixData::getComm(), AMP::LinearAlgebra::MatrixData::getLeftVariable(), AMP::LinearAlgebra::MatrixData::getRightVariable(), and AMP::LinearAlgebra::MatrixData::setBackend().
|
protected |
Definition at line 175 of file DenseSerialMatrixData.h.
Referenced by numGlobalRows(), and numLocalRows().
|
mutableprotectedinherited |
Definition at line 69 of file enable_shared_from_this.h.
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |