Advanced Multi-Physics (AMP)
On-Line Documentation
Public Member Functions | Private Attributes | List of all members
AMP::LinearAlgebra::RandomAccessIndexer Class Referenceabstract

#include <RandomAccessIndexer.h>

Inheritance diagram for AMP::LinearAlgebra::RandomAccessIndexer:
Inheritance graph
[legend]

Public Member Functions

void addID (size_t i)
 
void finalize ()
 
virtual size_t getIncrement (size_t i) const
 Given a global id in the underlying vector, return the distance to the next id in the SubsetVector.
 
virtual size_t getNumLocalElements (std::shared_ptr< Vector > v) const =0
 Given a particular underlying vector, compute the number of local elements that are in this mapping.
 
virtual size_t getNumLocalElements (Vector::shared_ptr v) const
 
virtual size_t getSubID (size_t i) const
 Given a global id in the underlying vector, return the subset global id.
 
virtual size_t getSuperID (size_t i) const
 Given a global id in the SubsetVector, return the corresponding global id in the underlying vector.
 
virtual bool isInSub (size_t i) const
 Given a global id in the underlying vector, this returns true if the global id is in the SubsetVector.
 
 RandomAccessIndexer ()
 

Private Attributes

std::map< size_t, size_t > d_SubToSuper
 
std::map< size_t, size_t > d_SuperToSub
 

Detailed Description

Definition at line 11 of file RandomAccessIndexer.h.

Constructor & Destructor Documentation

◆ RandomAccessIndexer()

AMP::LinearAlgebra::RandomAccessIndexer::RandomAccessIndexer ( )
inline

Definition at line 19 of file RandomAccessIndexer.h.

Member Function Documentation

◆ addID()

void AMP::LinearAlgebra::RandomAccessIndexer::addID ( size_t  i)
inline

Definition at line 20 of file RandomAccessIndexer.h.

References d_SuperToSub.

◆ finalize()

void AMP::LinearAlgebra::RandomAccessIndexer::finalize ( )
inline

Definition at line 21 of file RandomAccessIndexer.h.

References d_SubToSuper, and d_SuperToSub.

◆ getIncrement()

virtual size_t AMP::LinearAlgebra::RandomAccessIndexer::getIncrement ( size_t  underlyingID) const
inlinevirtual

Given a global id in the underlying vector, return the distance to the next id in the SubsetVector.

Parameters
[in]underlyingIDThe global ID of the underlying vector
Returns
getSubID ( underlyingID + 1 ) - getSubID ( underlyingID )

Implements AMP::LinearAlgebra::VectorIndexer.

Definition at line 34 of file RandomAccessIndexer.h.

References AMP_ASSERT, and d_SuperToSub.

◆ getNumLocalElements() [1/2]

virtual size_t AMP::LinearAlgebra::VectorIndexer::getNumLocalElements ( std::shared_ptr< Vector v) const
pure virtualinherited

Given a particular underlying vector, compute the number of local elements that are in this mapping.

Parameters
[in]vA vector
Returns
The number of local objects in the vector also in the subset.

◆ getNumLocalElements() [2/2]

virtual size_t AMP::LinearAlgebra::RandomAccessIndexer::getNumLocalElements ( Vector::shared_ptr  v) const
inlinevirtual

Definition at line 47 of file RandomAccessIndexer.h.

References d_SuperToSub.

◆ getSubID()

virtual size_t AMP::LinearAlgebra::RandomAccessIndexer::getSubID ( size_t  underlyingID) const
inlinevirtual

Given a global id in the underlying vector, return the subset global id.

Parameters
[in]underlyingIDThe global ID of the underlying vector
Returns
The global ID in the SubsetVector

Implements AMP::LinearAlgebra::VectorIndexer.

Definition at line 45 of file RandomAccessIndexer.h.

References d_SuperToSub.

◆ getSuperID()

virtual size_t AMP::LinearAlgebra::RandomAccessIndexer::getSuperID ( size_t  subsetID) const
inlinevirtual

Given a global id in the SubsetVector, return the corresponding global id in the underlying vector.

Parameters
[in]subsetIDThe global ID of the SubsetVector
Returns
The global ID in underlying vector

Implements AMP::LinearAlgebra::VectorIndexer.

Definition at line 46 of file RandomAccessIndexer.h.

References d_SubToSuper.

◆ isInSub()

virtual bool AMP::LinearAlgebra::RandomAccessIndexer::isInSub ( size_t  underlyingID) const
inlinevirtual

Given a global id in the underlying vector, this returns true if the global id is in the SubsetVector.

Parameters
[in]underlyingIDThe global ID of the underlying vector
Returns
True if the underlying ID is in the subset. False otherwise.

Implements AMP::LinearAlgebra::VectorIndexer.

Definition at line 33 of file RandomAccessIndexer.h.

References d_SuperToSub.

Member Data Documentation

◆ d_SubToSuper

std::map<size_t, size_t> AMP::LinearAlgebra::RandomAccessIndexer::d_SubToSuper
mutableprivate

Definition at line 16 of file RandomAccessIndexer.h.

Referenced by finalize(), and getSuperID().

◆ d_SuperToSub

std::map<size_t, size_t> AMP::LinearAlgebra::RandomAccessIndexer::d_SuperToSub
mutableprivate

The documentation for this class was generated from the following file:



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:43.
Comments on this page