#include <cksequence.h>
Public Types | |
typedef CkSequenceIterator< T > | iterator |
Public Member Functions | |
CkSequence () | |
Creates a RandomSequence by default. | |
template<typename GenericIterator> | |
CkSequence (const GenericIterator begin, const GenericIterator end) | |
Creates Sequence object based on the vector passed in. | |
template<typename GenericIterator> | |
void | Insert (const GenericIterator begin, const GenericIterator end) |
~CkSequence () | |
void | Insert (const T &element) |
Inserts the element in to the CkSequence Data Structure. | |
void | InsertIntoStrided (typename std::list< CkSequenceInternal< T > * >::iterator iter, const T &element) |
void | Remove (const T &element) |
Removes the element from the CkSequence Data Structure. | |
void | DoneInserting () |
Called when the elements have been inserted into the sequence and no further modification would happen. | |
int | num_elements () const |
Identifies if the sequence has a stride pattern and if so returns true and sets stride to the identified stride. | |
int | mem_size () const |
iterator | begin () |
Returns the begin of the CkSequence. | |
iterator | end () |
Returns the end of the CkSequence Sample Usage: CkSequence<int>::iterator it = s.end();. | |
void | pup (PUP::er &p) |
Private Member Functions | |
void | Compact () |
Private Attributes | |
T | min_ |
T | max_ |
T | num_elements_ |
bool | compact_ |
char * | bit_vector_ |
std::list< CkSequenceInternal < T > * > | subsequence_list_ |
Two types of CkSequences are currently supported, RANDOM and STRIDE. By default, a RandomCkSequence is created. This class Delegates the calls to the internal implementation of CkSequence
Sample Usage: CkSequence<int> s_default; CkSequence<int> seq_random(CkSequence<int>::RANDOM);
T |
Definition at line 120 of file cksequence.h.
typedef CkSequenceIterator<T> CkSequence< T >::iterator |
Definition at line 245 of file cksequence.h.
CkSequence< T >::CkSequence | ( | ) | [inline] |
CkSequence< T >::CkSequence | ( | const GenericIterator | begin, | |
const GenericIterator | end | |||
) | [inline] |
Creates Sequence object based on the vector passed in.
The default sequence created is RandomSequence.
l containing the elements to be stored
Definition at line 137 of file cksequence.h.
References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, malloc(), CkSequence< T >::max_, CkSequence< T >::min_, and CkSequence< T >::num_elements_.
CkSequence< T >::~CkSequence | ( | ) | [inline] |
Definition at line 199 of file cksequence.h.
References CkSequence< T >::bit_vector_, and CkSequence< T >::subsequence_list_.
void CkSequence< T >::Insert | ( | const GenericIterator | begin, | |
const GenericIterator | end | |||
) | [inline] |
Definition at line 168 of file cksequence.h.
References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, malloc(), CkSequence< T >::max_, CkSequence< T >::min_, and CkSequence< T >::num_elements_.
void CkSequence< T >::Insert | ( | const T & | element | ) | [inline] |
Inserts the element in to the CkSequence Data Structure.
element to be inserted
Definition at line 336 of file cksequence.h.
References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, CkSequence< T >::max_, CkSequence< T >::min_, and realloc().
void CkSequence< T >::InsertIntoStrided | ( | typename std::list< CkSequenceInternal< T > * >::iterator | iter, | |
const T & | element | |||
) |
void CkSequence< T >::Remove | ( | const T & | element | ) | [inline] |
Removes the element from the CkSequence Data Structure.
element to be removed
Definition at line 356 of file cksequence.h.
References CkSequence< T >::bit_vector_, and CkSequence< T >::compact_.
void CkSequence< T >::DoneInserting | ( | ) | [inline] |
Called when the elements have been inserted into the sequence and no further modification would happen.
Definition at line 460 of file cksequence.h.
References CkSequence< T >::Compact().
int CkSequence< T >::num_elements | ( | ) | const [inline] |
Identifies if the sequence has a stride pattern and if so returns true and sets stride to the identified stride.
stride sets it to be the stride for the given sequence
true if there is a stride pattern else false
Definition at line 364 of file cksequence.h.
References CkSequence< T >::subsequence_list_.
int CkSequence< T >::mem_size | ( | ) | const [inline] |
iterator CkSequence< T >::begin | ( | void | ) | [inline] |
Returns the begin of the CkSequence.
Sample Usage: CkSequence<int>::iterator it = s.begin();
the iterator pointing to the begin
Definition at line 254 of file cksequence.h.
References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, CkSequence< T >::max_, CkSequence< T >::min_, and CkSequence< T >::subsequence_list_.
iterator CkSequence< T >::end | ( | void | ) | [inline] |
Returns the end of the CkSequence Sample Usage: CkSequence<int>::iterator it = s.end();.
the iterator to the end
Definition at line 269 of file cksequence.h.
References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, and CkSequence< T >::max_.
void CkSequence< T >::pup | ( | PUP::er & | p | ) | [inline] |
Definition at line 277 of file cksequence.h.
References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, PUP::er::isUnpacking(), list, malloc(), CkSequence< T >::max_, CkSequence< T >::min_, CkSequence< T >::num_elements_, PUP::PUParray(), size, STRIDE, CkSequence< T >::subsequence_list_, and type.
void CkSequence< T >::Compact | ( | ) | [inline, private] |
Definition at line 381 of file cksequence.h.
References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, CkSequenceFactory< T >::CreateRandomSequence(), CkSequenceFactory< T >::CreateStridedSequence(), endl(), CkSequence< T >::max_, CkSequence< T >::min_, stride, and CkSequence< T >::subsequence_list_.
Referenced by CkSequence< T >::DoneInserting().
T CkSequence< T >::min_ [private] |
Definition at line 321 of file cksequence.h.
Referenced by CkSequence< T >::begin(), CkSequence< T >::CkSequence(), CkSequence< T >::Compact(), CkSequence< T >::Insert(), and CkSequence< T >::pup().
T CkSequence< T >::max_ [private] |
Definition at line 322 of file cksequence.h.
Referenced by CkSequence< T >::begin(), CkSequence< T >::CkSequence(), CkSequence< T >::Compact(), CkSequence< T >::end(), CkSequence< T >::Insert(), and CkSequence< T >::pup().
T CkSequence< T >::num_elements_ [private] |
Definition at line 323 of file cksequence.h.
Referenced by CkSequence< T >::CkSequence(), CkSequence< T >::Insert(), and CkSequence< T >::pup().
bool CkSequence< T >::compact_ [private] |
Definition at line 326 of file cksequence.h.
Referenced by CkSequence< T >::begin(), CkSequence< T >::CkSequence(), CkSequence< T >::Compact(), CkSequence< T >::end(), CkSequence< T >::Insert(), CkSequence< T >::pup(), and CkSequence< T >::Remove().
char* CkSequence< T >::bit_vector_ [private] |
Definition at line 327 of file cksequence.h.
Referenced by CkSequence< T >::begin(), CkSequence< T >::CkSequence(), CkSequence< T >::Compact(), CkSequence< T >::end(), CkSequence< T >::Insert(), CkSequence< T >::pup(), CkSequence< T >::Remove(), and CkSequence< T >::~CkSequence().
std::list<CkSequenceInternal<T>*> CkSequence< T >::subsequence_list_ [private] |
Definition at line 331 of file cksequence.h.
Referenced by CkSequence< T >::begin(), CkSequence< T >::Compact(), CkSequence< T >::mem_size(), CkSequence< T >::num_elements(), CkSequence< T >::pup(), and CkSequence< T >::~CkSequence().