1#ifndef included_AMP_RandomAccessIndexer
2#define included_AMP_RandomAccessIndexer
6#include "AMP/vectors/VectorIndexer.h"
23 std::map<size_t, size_t>::iterator c =
d_SuperToSub.begin();
36 std::map<size_t, size_t>::iterator c =
d_SuperToSub.find( i );
40 return ( c->first - i );
49 size_t start = v->getCommunicationList()->getStartGID();
50 size_t end = v->getCommunicationList()->numLocalRows() + start;
52 std::map<size_t, size_t>::iterator c =
d_SuperToSub.begin();
54 if ( c->first >= start )
59 std::map<size_t, size_t>::reverse_iterator d =
d_SuperToSub.rbegin();
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 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.
std::map< size_t, size_t > d_SuperToSub
std::map< size_t, size_t > d_SubToSuper
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...
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.
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
#define AMP_ASSERT(EXP)
Assert error.