#include <CSRMatrixData.h>

Public Types | |
| using | allocator_type = typename Config::allocator_type |
| using | gidx_t = typename Config::gidx_t |
| using | gidxAllocator_t = typename std::allocator_traits< allocator_type >::template rebind_alloc< gidx_t > |
| using | lidx_t = typename Config::lidx_t |
| using | lidxAllocator_t = typename std::allocator_traits< allocator_type >::template rebind_alloc< lidx_t > |
| using | localmatrixdata_t = CSRLocalMatrixData< Config > |
| using | mask_t = typename localmatrixdata_t::mask_t |
| using | scalar_t = typename Config::scalar_t |
| using | scalarAllocator_t = typename std::allocator_traits< allocator_type >::template rebind_alloc< scalar_t > |
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. | |
| void | assemble (bool force_dm_reset=false) |
| Convenience function to triger internal setup. | |
| size_t | beginCol () const override |
| Get the global id of the first column in diagonal block (inclusive) | |
| size_t | beginRow () const override |
| Get the global id of the first stored row (inclusive) | |
| std::shared_ptr< MatrixData > | cloneMatrixData () const override |
| Clone the data. | |
| CSRMatrixData () | |
| Empty constructor. | |
| CSRMatrixData (const CSRMatrixData &)=delete | |
| Copy constructor. | |
| CSRMatrixData (int64_t fid, AMP::IO::RestartManager *manager) | |
| Constructor from restart data. | |
| CSRMatrixData (std::shared_ptr< MatrixParametersBase > params) | |
| Constructor. | |
| size_t | endCol () const override |
| Get the global id of the last column in diagonal block (exclusive) | |
| size_t | endRow () const override |
| Get the global id of the last stored row (exclusive) | |
| 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 |
| Get the global indices of nonzeros in a given row. | |
| virtual AMP_MPI | getComm () const |
| Get the comm. | |
| std::shared_ptr< localmatrixdata_t > | getDiagMatrix () |
| Get pointer to diagonal block. | |
| std::shared_ptr< const localmatrixdata_t > | getDiagMatrix () const |
| lidx_t * | getDiagRowStarts () |
| Get row pointers from diagonal block. | |
| uint64_t | getID () const |
| Get a unique id hash for the vector. | |
| std::shared_ptr< CommunicationList > | getLeftCommList () const |
| Get the CommList associated with a left vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a left 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 ) | |
| auto | getMemoryLocation () const |
| Get the memory space where data is stored. | |
| lidx_t * | getOffDiagRowStarts () |
| Get row pointers from off-diagonal block. | |
| std::shared_ptr< localmatrixdata_t > | getOffdMatrix () |
| Get pointer to off-diagonal block. | |
| std::shared_ptr< const localmatrixdata_t > | getOffdMatrix () const |
| std::shared_ptr< CommunicationList > | getRightCommList () const |
| Get the CommList associated with a right vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a right 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 from the matrix. | |
| void | globalToLocalColumns () |
| Convert global columns in blocks to local columns and free global columns. | |
| bool | hasOffDiag () const |
| Check if off-diagonal block is non-empty. | |
| bool | isEmpty () const noexcept |
| Check if matrix is globally square. | |
| bool | isSquare () const noexcept |
| Check if matrix is globally square. | |
| void | makeConsistent (AMP::LinearAlgebra::ScatterType t) override |
| Perform communication to ensure values in the matrix are the same across cores. | |
| template<typename ConfigOut > | |
| std::shared_ptr< CSRMatrixData< ConfigOut > > | migrate (AMP::Utilities::Backend backend) const |
| Migrate data to different configuration, mostly for moving memory spaces. | |
| virtual std::uint16_t | mode () const override |
| 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. | |
| auto | numberOfNonZeros () const |
| Get total number of nonzeros in both blocks. | |
| auto | numberOfNonZerosDiag () const |
| Get total number of nonzeros in diagonal block. | |
| auto | numberOfNonZerosOffDiag () const |
| Get total number of nonzeros in off-diagonal block. | |
| 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. | |
| void | printStats (bool verbose, bool show_zeros) const |
| Print information about matrix blocks. | |
| void | registerChildObjects (AMP::IO::RestartManager *manager) const override |
| Register any child objects. | |
| void | removeRange (AMP::Scalar bnd_lo, AMP::Scalar bnd_up) override |
| Remove matrix entries within given range. | |
| void | resetDOFManagers (bool force_dm_reset=false) |
| Replace left/right DOFManagers and CommunicationLists to match NNZ structure. | |
| virtual void | setBackend (AMP::Utilities::Backend backend) |
| void | setNNZ (bool do_accum) |
| Set the number of nonzeros in each block and allocate space internally. | |
| void | setNNZ (const lidx_t *nnz_diag, const lidx_t *nnz_offd) |
| Set the number of nonzeros in each block and allocate space internally. | |
| void | setNNZ (lidx_t tot_nnz_diag, lidx_t tot_nnz_offd) |
| Set the number of nonzeros in each block and allocate space internally. | |
| 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< localmatrixdata_t > | subsetCols (const gidx_t idx_lo, const gidx_t idx_up, const bool is_diag) const |
| Extract subset of each row containing global columns in some range. | |
| std::shared_ptr< localmatrixdata_t > | subsetRows (const std::vector< gidx_t > &rows) const |
| Extract subset of locally owned rows into new local matrix. | |
| std::shared_ptr< MatrixData > | transpose () const override |
| Transpose. | |
| std::string | type () const override |
| Return the type of the matrix. | |
| void | writeRestart (int64_t fid) const override |
| Write restart data to file. | |
| virtual | ~CSRMatrixData () |
| Destructor. | |
Public Attributes | |
| AMP::Utilities::MemoryType | d_memory_location |
| Memory location, set by examining type of Allocator. | |
Protected Member Functions | |
| void | readRestartMapData (const int64_t fid, const std::string &prefix, std::map< gidx_t, std::map< gidx_t, scalar_t > > &data) |
| void | setOtherData (std::map< gidx_t, std::map< gidx_t, scalar_t > > &, AMP::LinearAlgebra::ScatterType) |
| Update matrix data off-core. | |
| std::shared_ptr< localmatrixdata_t > | transposeOffd (std::shared_ptr< MatrixParametersBase > params) const |
| void | writeRestartMapData (const int64_t fid, const std::string &prefix, const std::map< gidx_t, std::map< gidx_t, scalar_t > > &data) const |
Protected Attributes | |
| std::shared_ptr< localmatrixdata_t > | d_diag_matrix |
| Diagonal matrix block [d_first_row,d_last_row] x [d_first_col,d_last_col]. | |
| gidx_t | d_first_col = 0 |
| Global index of first column of diagonal block. | |
| gidx_t | d_first_row = 0 |
| Global index of first row of this block. | |
| std::map< gidx_t, std::map< gidx_t, scalar_t > > | d_ghost_data |
| \(A_{i,j}\) storage of off core matrix data to set | |
| gidxAllocator_t | d_gidxAllocator |
| Allocator for gidx_t matched to template parameter. | |
| uint64_t | d_hash = 0 |
| bool | d_is_square = true |
| Matrix is square if true. | |
| gidx_t | d_last_col = 0 |
| Global index of last column of diagonal block. | |
| gidx_t | d_last_row = 0 |
| Global index of last row of this block. | |
| std::shared_ptr< CommunicationList > | d_leftCommList |
| CommunicationList for left vectors. | |
| std::shared_ptr< Discretization::DOFManager > | d_leftDOFManager |
| DOFManager for left vectors. | |
| lidxAllocator_t | d_lidxAllocator |
| Allocator for lidx_t matched to template parameter. | |
| std::shared_ptr< localmatrixdata_t > | d_offd_matrix |
| Diagonal matrix block [d_first_row,d_last_row] x ]d_first_col,d_last_col[. | |
| std::map< gidx_t, std::map< gidx_t, scalar_t > > | d_other_data |
| \(A_{i,j}\) storage of off core matrix data | |
| std::shared_ptr< MatrixParametersBase > | d_pParameters |
| std::shared_ptr< CommunicationList > | d_rightCommList |
| CommunicationList for right vectors. | |
| std::shared_ptr< Discretization::DOFManager > | d_rightDOFManager |
| DOFManager for right vectors. | |
| scalarAllocator_t | d_scalarAllocator |
| Allocator for scalar_t matched to template parameter. | |
| std::weak_ptr< MatrixData > | weak_ptr_ |
Friends | |
| template<typename C > | |
| class | CSRMatrixData |
| template<typename C > | |
| class | CSRMatrixSpGEMMDefault |
Definition at line 30 of file CSRMatrixData.h.
| using AMP::LinearAlgebra::CSRMatrixData< Config >::allocator_type = typename Config::allocator_type |
Definition at line 41 of file CSRMatrixData.h.
| using AMP::LinearAlgebra::CSRMatrixData< Config >::gidx_t = typename Config::gidx_t |
Definition at line 38 of file CSRMatrixData.h.
| using AMP::LinearAlgebra::CSRMatrixData< Config >::gidxAllocator_t = typename std::allocator_traits<allocator_type>::template rebind_alloc<gidx_t> |
Definition at line 43 of file CSRMatrixData.h.
| using AMP::LinearAlgebra::CSRMatrixData< Config >::lidx_t = typename Config::lidx_t |
Definition at line 39 of file CSRMatrixData.h.
| using AMP::LinearAlgebra::CSRMatrixData< Config >::lidxAllocator_t = typename std::allocator_traits<allocator_type>::template rebind_alloc<lidx_t> |
Definition at line 45 of file CSRMatrixData.h.
| using AMP::LinearAlgebra::CSRMatrixData< Config >::localmatrixdata_t = CSRLocalMatrixData<Config> |
Definition at line 49 of file CSRMatrixData.h.
| using AMP::LinearAlgebra::CSRMatrixData< Config >::mask_t = typename localmatrixdata_t::mask_t |
Definition at line 50 of file CSRMatrixData.h.
| using AMP::LinearAlgebra::CSRMatrixData< Config >::scalar_t = typename Config::scalar_t |
Definition at line 40 of file CSRMatrixData.h.
| using AMP::LinearAlgebra::CSRMatrixData< Config >::scalarAllocator_t = typename std::allocator_traits<allocator_type>::template rebind_alloc<scalar_t> |
Definition at line 47 of file CSRMatrixData.h.
|
explicit |
Constructor.
| [in] | params | Description of the matrix |
|
virtual |
Destructor.
| AMP::LinearAlgebra::CSRMatrixData< Config >::CSRMatrixData | ( | ) |
Empty constructor.
|
delete |
Copy constructor.
| AMP::LinearAlgebra::CSRMatrixData< Config >::CSRMatrixData | ( | int64_t | fid, |
| AMP::IO::RestartManager * | manager | ||
| ) |
Constructor from restart data.
|
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 |
If the matrix has not allocated a particular (row,col) specified, those values will be ignored.
Implements AMP::LinearAlgebra::MatrixData.
| void AMP::LinearAlgebra::CSRMatrixData< Config >::assemble | ( | bool | force_dm_reset = false | ) |
Convenience function to triger internal setup.
| [in] | force_dm_reset | Flag to force DOFManager/CommList resets |
This just calls globalToLocalColumns and resetDOFManagers in succession.
|
overridevirtual |
Get the global id of the first column in diagonal block (inclusive)
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Get the global id of the first stored row (inclusive)
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Clone the data.
Implements AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Get the global id of the last column in diagonal block (exclusive)
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Get the global id of the last stored row (exclusive)
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
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 209 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::type().
|
overridevirtual |
Get the global indices of nonzeros in a given 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.
|
inline |
Get pointer to diagonal block.
Definition at line 216 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_diag_matrix.
|
inline |
Definition at line 217 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_diag_matrix.
|
inline |
Get row pointers from diagonal block.
Definition at line 224 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_diag_matrix.
|
inherited |
Get a unique id hash for the vector.
| std::shared_ptr< CommunicationList > AMP::LinearAlgebra::CSRMatrixData< Config >::getLeftCommList | ( | ) | const |
Get the CommList associated with a left vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a left 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.
|
inline |
Get the memory space where data is stored.
Definition at line 248 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_memory_location.
|
inline |
Get row pointers from off-diagonal block.
Definition at line 227 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_offd_matrix.
|
inline |
Get pointer to off-diagonal block.
Definition at line 220 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_offd_matrix.
|
inline |
Definition at line 221 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_offd_matrix.
| std::shared_ptr< CommunicationList > AMP::LinearAlgebra::CSRMatrixData< Config >::getRightCommList | ( | ) | const |
Get the CommList associated with a right vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a right vector )
|
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 from 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 | Place to write retrieved values |
| [in] | id | typeID of raw data |
If the matrix has not allocated a particular (row,col) specified those values will be set to zero.
Implements AMP::LinearAlgebra::MatrixData.
| void AMP::LinearAlgebra::CSRMatrixData< Config >::globalToLocalColumns | ( | ) |
Convert global columns in blocks to local columns and free global columns.
|
inline |
Check if off-diagonal block is non-empty.
Definition at line 245 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_offd_matrix.
|
inlinenoexcept |
Check if matrix is globally square.
Definition at line 233 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_diag_matrix, and AMP::LinearAlgebra::CSRMatrixData< Config >::d_offd_matrix.
|
inlinenoexcept |
Check if matrix is globally square.
Definition at line 230 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_is_square.
|
overridevirtual |
Perform communication to ensure values in the matrix are the same across cores.
Implements AMP::LinearAlgebra::MatrixData.
| std::shared_ptr< CSRMatrixData< ConfigOut > > AMP::LinearAlgebra::CSRMatrixData< Config >::migrate | ( | AMP::Utilities::Backend | backend | ) | const |
Migrate data to different configuration, mostly for moving memory spaces.
|
inlineoverridevirtual |
Return CSR mode of the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
Definition at line 80 of file CSRMatrixData.h.
|
overridevirtual |
Given a row, retrieve the number of non-zero column indices of the matrix.
| [in] | row | Which row |
Implements AMP::LinearAlgebra::MatrixData.
|
inline |
Get total number of nonzeros in both blocks.
Definition at line 236 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_diag_matrix, and AMP::LinearAlgebra::CSRMatrixData< Config >::d_offd_matrix.
|
inline |
Get total number of nonzeros in diagonal block.
Definition at line 239 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_diag_matrix.
|
inline |
Get total number of nonzeros in off-diagonal block.
Definition at line 242 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_offd_matrix.
|
overridevirtual |
Get the number of global columns in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
Referenced by AMP::LinearAlgebra::CSRMatrixData< Config >::printStats().
|
overridevirtual |
Get the number of global rows in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
Referenced by AMP::LinearAlgebra::CSRMatrixData< Config >::printStats().
|
overridevirtual |
Get the number of local columns in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Get the number of local rows in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
inline |
Print information about matrix blocks.
Definition at line 293 of file CSRMatrixData.h.
References AMP::LinearAlgebra::CSRMatrixData< Config >::d_diag_matrix, AMP::LinearAlgebra::CSRMatrixData< Config >::d_memory_location, AMP::LinearAlgebra::CSRMatrixData< Config >::d_offd_matrix, AMP::Utilities::getString(), AMP::LinearAlgebra::CSRMatrixData< Config >::numGlobalColumns(), and AMP::LinearAlgebra::CSRMatrixData< Config >::numGlobalRows().
|
protected |
|
overridevirtual |
Register any child objects.
This function will register child objects with the manager
| manager | Restart manager |
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Remove matrix entries within given range.
| [in] | bnd_lo | Lower bound of range to discard |
| [in] | bnd_up | Upper bound of range to discard |
Implements AMP::LinearAlgebra::MatrixData.
| void AMP::LinearAlgebra::CSRMatrixData< Config >::resetDOFManagers | ( | bool | force_dm_reset = false | ) |
Replace left/right DOFManagers and CommunicationLists to match NNZ structure.
| [in] | force_dm_reset | Flag to force DOFManager/CommList resets |
This is necessary for matrices not created from pairs of vectors, e.g. result matrices from SpGEMM and prolongators in AMG
|
inlinevirtualinherited |
Definition at line 274 of file MatrixData.h.
References AMP_ASSERT, and AMP::LinearAlgebra::MatrixData::d_pParameters.
| void AMP::LinearAlgebra::CSRMatrixData< Config >::setNNZ | ( | bool | do_accum | ) |
Set the number of nonzeros in each block and allocate space internally.
| [in] | do_accum | Flag for whether entries in row pointers need to be accumulated |
This version assumes that either the nnz per row have been written into the row_pointer fields of the individual blocks, or the accumulated row pointers have been written.
| void AMP::LinearAlgebra::CSRMatrixData< Config >::setNNZ | ( | const lidx_t * | nnz_diag, |
| const lidx_t * | nnz_offd | ||
| ) |
Set the number of nonzeros in each block and allocate space internally.
| [in] | nnz_diag | Number of nonzeros in each row of diagonal block |
| [in] | nnz_offd | Number of nonzeros in each row of off-diagonal block |
| void AMP::LinearAlgebra::CSRMatrixData< Config >::setNNZ | ( | lidx_t | tot_nnz_diag, |
| lidx_t | tot_nnz_offd | ||
| ) |
Set the number of nonzeros in each block and allocate space internally.
| [in] | tot_nnz_diag | Number of nonzeros in whole diagonal block |
| [in] | tot_nnz_offd | Number of nonzeros in whole off-diagonal block |
|
protected |
Update matrix data off-core.
|
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 |
If the matrix has not allocated a particular (row,col) specified, those values will be ignored.
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.
| std::shared_ptr< localmatrixdata_t > AMP::LinearAlgebra::CSRMatrixData< Config >::subsetCols | ( | const gidx_t | idx_lo, |
| const gidx_t | idx_up, | ||
| const bool | is_diag | ||
| ) | const |
Extract subset of each row containing global columns in some range.
| [in] | idx_lo | Lower global column index (inclusive) |
| [in] | idx_up | Upper global column index (exclusive) |
| [in] | is_diag | Flag if produced matrix should be marked as diag block |
Returned matrix concatenates contributions for both diag and offd components. Row and column extents are inherited from this matrix, but are neither sorted nor converted to local indices.
| std::shared_ptr< localmatrixdata_t > AMP::LinearAlgebra::CSRMatrixData< Config >::subsetRows | ( | const std::vector< gidx_t > & | rows | ) | const |
Extract subset of locally owned rows into new local matrix.
| [in] | rows | vector of global row indices to extract |
Returned matrix concatenates contributions for both diag and offd components. Row extents are set to [0,rows.size) and column extents are set to [0,numGlobalColumns).
|
overridevirtual |
Transpose.
Implements AMP::LinearAlgebra::MatrixData.
|
protected |
|
inlineoverridevirtual |
Return the type of the matrix.
Implements AMP::LinearAlgebra::MatrixData.
Definition at line 77 of file CSRMatrixData.h.
Referenced by AMP::LinearAlgebra::CSRMatrixData< Config >::getCoeffType().
|
overridevirtual |
Write restart data to file.
This function will write the mesh to an HDF5 file
| fid | File identifier to write |
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
protected |
Definition at line 36 of file CSRMatrixData.h.
Definition at line 34 of file CSRMatrixData.h.
|
protected |
Diagonal matrix block [d_first_row,d_last_row] x [d_first_col,d_last_col].
Definition at line 385 of file CSRMatrixData.h.
Referenced by AMP::LinearAlgebra::CSRMatrixData< Config >::getDiagMatrix(), AMP::LinearAlgebra::CSRMatrixData< Config >::getDiagMatrix(), AMP::LinearAlgebra::CSRMatrixData< Config >::getDiagRowStarts(), AMP::LinearAlgebra::CSRMatrixData< Config >::isEmpty(), AMP::LinearAlgebra::CSRMatrixData< Config >::numberOfNonZeros(), AMP::LinearAlgebra::CSRMatrixData< Config >::numberOfNonZerosDiag(), and AMP::LinearAlgebra::CSRMatrixData< Config >::printStats().
|
protected |
Global index of first column of diagonal block.
Definition at line 373 of file CSRMatrixData.h.
|
protected |
Global index of first row of this block.
Definition at line 369 of file CSRMatrixData.h.
|
protected |
\(A_{i,j}\) storage of off core matrix data to set
Definition at line 403 of file CSRMatrixData.h.
|
mutableprotected |
Allocator for gidx_t matched to template parameter.
Definition at line 378 of file CSRMatrixData.h.
|
protectedinherited |
Definition at line 311 of file MatrixData.h.
|
protected |
Matrix is square if true.
Definition at line 367 of file CSRMatrixData.h.
Referenced by AMP::LinearAlgebra::CSRMatrixData< Config >::isSquare().
|
protected |
Global index of last column of diagonal block.
Definition at line 375 of file CSRMatrixData.h.
|
protected |
Global index of last row of this block.
Definition at line 371 of file CSRMatrixData.h.
|
protected |
CommunicationList for left vectors.
Definition at line 395 of file CSRMatrixData.h.
|
protected |
DOFManager for left vectors.
Definition at line 390 of file CSRMatrixData.h.
|
mutableprotected |
Allocator for lidx_t matched to template parameter.
Definition at line 380 of file CSRMatrixData.h.
| AMP::Utilities::MemoryType AMP::LinearAlgebra::CSRMatrixData< Config >::d_memory_location |
Memory location, set by examining type of Allocator.
Definition at line 363 of file CSRMatrixData.h.
Referenced by AMP::LinearAlgebra::CSRMatrixData< Config >::getMemoryLocation(), and AMP::LinearAlgebra::CSRMatrixData< Config >::printStats().
|
protected |
Diagonal matrix block [d_first_row,d_last_row] x ]d_first_col,d_last_col[.
Definition at line 387 of file CSRMatrixData.h.
Referenced by AMP::LinearAlgebra::CSRMatrixData< Config >::getOffDiagRowStarts(), AMP::LinearAlgebra::CSRMatrixData< Config >::getOffdMatrix(), AMP::LinearAlgebra::CSRMatrixData< Config >::getOffdMatrix(), AMP::LinearAlgebra::CSRMatrixData< Config >::hasOffDiag(), AMP::LinearAlgebra::CSRMatrixData< Config >::isEmpty(), AMP::LinearAlgebra::CSRMatrixData< Config >::numberOfNonZeros(), AMP::LinearAlgebra::CSRMatrixData< Config >::numberOfNonZerosOffDiag(), and AMP::LinearAlgebra::CSRMatrixData< Config >::printStats().
|
protected |
\(A_{i,j}\) storage of off core matrix data
Definition at line 400 of file CSRMatrixData.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 |
CommunicationList for right vectors.
Definition at line 397 of file CSRMatrixData.h.
|
protected |
DOFManager for right vectors.
Definition at line 392 of file CSRMatrixData.h.
|
mutableprotected |
Allocator for scalar_t matched to template parameter.
Definition at line 382 of file CSRMatrixData.h.
|
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 |