CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::PTNode< T > Class Template Reference

#include <PolyTrie.hh>

+ Inheritance diagram for CASM::PTNode< T >:

Detailed Description

template<typename T>
class CASM::PTNode< T >

Definition at line 41 of file PolyTrie.hh.

Public Member Functions

 PTNode (PTNode< T > *_up, const T &_val=0)
 
const T & val () const
 
virtual ~PTNode ()
 
virtual void remove ()
 

Protected Types

typedef Array< PTNode< T > * > X1
 
typedef Array< X1X2
 
typedef Array< X2X3
 
typedef Array< X3X4
 
typedef Array< X4X5
 
typedef Array< X5X6
 
typedef Array< X6X7
 
typedef Array< X7X8
 
typedef Array< X8X9
 
typedef PTNode< T > * value_type
 
typedef Index size_type
 
typedef PTNode< T > * * iterator
 
typedef const PTNode< T > * * const_iterator
 

Protected Member Functions

PTNode< T > * valid_node_at (Index i)
 
PTNode< T > * valid_leaf_at (PolyTrie< T > &home_trie, const Array< Index > &ind)
 
Index size () const
 
void swap (Array< PTNode< T > * > &RHS)
 
PTNode< T > * & at (Index ind)
 
const PTNode< T > * & at (Index ind) const
 
const PTNode< T > * & operator[] (Index ind) const
 
PTNode< T > * & operator[] (Index ind)
 
PTNode< T > * & back ()
 
const PTNode< T > * & back () const
 
PTNode< T > * const * begin () const
 
PTNode< T > * * begin ()
 
PTNode< T > * const * cbegin () const
 
PTNode< T > * const * end () const
 
PTNode< T > * * end ()
 
PTNode< T > * const * cend () const
 
void push_back (const PTNode< T > * &toPush)
 
void pop_back ()
 
void remove (Index ind)
 
void clear ()
 
void resize (Index new_N)
 
void resize (Index new_N, const PTNode< T > * &fill_val)
 
void reserve (Index new_max)
 
void sort (const CompareType &comp)
 
void sort (Array< Index > &ind_order)
 
void sort ()
 
Arrayappend (const Array &new_tail)
 
Arrayappend_unique (const Array &new_tail)
 
void swap_elem (Index i, Index j)
 
Arraypermute (const Array< Index > &perm_array)
 
Arrayipermute (const Array< Index > &perm_array)
 
bool next_permute ()
 
ReturnArray< Indexas_perm_inverse () const
 
ReturnArray< Indexas_perm_transform_by (const Array< Index > &trans_perm) const
 
const PTNode< T > * & max () const
 
const PTNode< T > * & min () const
 
ReturnArray< PTNode< T > * > sub_array (Index ind_begin, Index ind_end) const
 
PTNode< T > * sum () const
 
bool is_ascending () const
 
bool is_descending () const
 
bool is_constant () const
 
bool is_permute () const
 
bool has_fixed_points () const
 
bool operator== (const Array< PTNode< T > * > &RHS) const
 
bool operator!= (const Array< PTNode< T > * > &RHS) const
 
bool operator< (const Array< PTNode< T > * > &RHS) const
 
bool operator> (const Array< PTNode< T > * > &RHS) const
 
bool operator<= (const Array< PTNode< T > * > &RHS) const
 
bool operator>= (const Array< PTNode< T > * > &RHS) const
 
bool all_in (const Array &superset) const
 
Index coincidence (const Array &superset) const
 
Index incidences (const PTNode< T > * &test_elem) const
 
Index find (const PTNode< T > * &test_elem) const
 
Index reverse_find (const PTNode< T > * &test_elem) const
 Same as find, but starts from the last element of the Array. More...
 
Index almost_find (const PTNode< T > * &test_elem, double tol_val=TOL) const
 
Index almost_reverse_find (const PTNode< T > * &test_elem, double tol_val=TOL) const
 Same as almost_find, but start from the last element of the Array. More...
 
bool contains (const PTNode< T > * &test_elem) const
 
bool almost_contains (const PTNode< T > * &test_elem, double tol_val=TOL) const
 
void print_column (std::ostream &stream, const std::string &indent="") const
 

Static Protected Member Functions

static double PT_TOL ()
 
static ReturnArray< PTNode< T > * > sequence (const PTNode< T > * &initial, const PTNode< T > * &final)
 
static ReturnArray< PTNode< T > * > sequence (const PTNode< T > * &initial, const PTNode< T > * &increment, const PTNode< T > * &final)
 

Protected Attributes

PTNode< T > * up_node
 
m_val
 

Static Private Member Functions

static Index ARRAY_MIN_EXTRA_SPACE ()
 
static double ARRAY_EXTENSION_FACTOR ()
 

Private Attributes

Index N
 
Index NMax
 
PTNode< T > * * Vals
 

Friends

class PolyTrie< T >
 

Member Typedef Documentation

◆ const_iterator

typedef const PTNode< T > * * CASM::Array< PTNode< T > * >::const_iterator
inherited

Definition at line 73 of file Array.hh.

◆ iterator

typedef PTNode< T > * * CASM::Array< PTNode< T > * >::iterator
inherited

Definition at line 72 of file Array.hh.

◆ size_type

typedef Index CASM::Array< PTNode< T > * >::size_type
inherited

Definition at line 71 of file Array.hh.

◆ value_type

typedef PTNode< T > * CASM::Array< PTNode< T > * >::value_type
inherited

Definition at line 70 of file Array.hh.

◆ X1

typedef Array<PTNode< T > * > CASM::Array< PTNode< T > * >::X1
inherited

Definition at line 60 of file Array.hh.

◆ X2

typedef Array<X1> CASM::Array< PTNode< T > * >::X2
inherited

Definition at line 61 of file Array.hh.

◆ X3

typedef Array<X2> CASM::Array< PTNode< T > * >::X3
inherited

Definition at line 62 of file Array.hh.

◆ X4

typedef Array<X3> CASM::Array< PTNode< T > * >::X4
inherited

Definition at line 63 of file Array.hh.

◆ X5

typedef Array<X4> CASM::Array< PTNode< T > * >::X5
inherited

Definition at line 64 of file Array.hh.

◆ X6

typedef Array<X5> CASM::Array< PTNode< T > * >::X6
inherited

Definition at line 65 of file Array.hh.

◆ X7

typedef Array<X6> CASM::Array< PTNode< T > * >::X7
inherited

Definition at line 66 of file Array.hh.

◆ X8

typedef Array<X7> CASM::Array< PTNode< T > * >::X8
inherited

Definition at line 67 of file Array.hh.

◆ X9

typedef Array<X8> CASM::Array< PTNode< T > * >::X9
inherited

Definition at line 68 of file Array.hh.

Constructor & Destructor Documentation

◆ PTNode()

template<typename T >
CASM::PTNode< T >::PTNode ( PTNode< T > *  _up,
const T &  _val = 0 
)
inline

Definition at line 56 of file PolyTrie.hh.

Member Function Documentation

◆ all_in()

bool CASM::Array< PTNode< T > * >::all_in ( const Array< PTNode< T > * > &  superset) const
inherited

Definition at line 230 of file Array.hh.

◆ almost_contains()

bool CASM::Array< PTNode< T > * >::almost_contains ( const T &  test_elem,
double  tol_val = TOL 
) const
inlineinherited

Definition at line 240 of file Array.hh.

◆ almost_find()

Index CASM::Array< PTNode< T > * >::almost_find ( const T &  test_elem,
double  tol_val = TOL 
) const
inherited

Definition at line 236 of file Array.hh.

◆ almost_reverse_find()

Index CASM::Array< PTNode< T > * >::almost_reverse_find ( const T &  test_elem,
double  tol_val = TOL 
) const
inherited

Same as almost_find, but start from the last element of the Array.

Definition at line 238 of file Array.hh.

◆ append()

Array< PTNode< T > * > & CASM::Array< PTNode< T > * >::append ( const Array< PTNode< T > * > &  new_tail)
inherited

Definition at line 194 of file Array.hh.

◆ append_unique()

Array< PTNode< T > * > & CASM::Array< PTNode< T > * >::append_unique ( const Array< PTNode< T > * > &  new_tail)
inherited

Definition at line 195 of file Array.hh.

◆ ARRAY_EXTENSION_FACTOR()

static double CASM::Array< PTNode< T > * >::ARRAY_EXTENSION_FACTOR ( )
inlinestaticprivateinherited

Definition at line 48 of file Array.hh.

◆ ARRAY_MIN_EXTRA_SPACE()

static Index CASM::Array< PTNode< T > * >::ARRAY_MIN_EXTRA_SPACE ( )
inlinestaticprivateinherited

Definition at line 47 of file Array.hh.

◆ as_perm_inverse()

ReturnArray< Index > CASM::Array< PTNode< T > * >::as_perm_inverse
inherited

Construct permutation that undoes the permutation performed by 'this' Inverse operation is calculated the same, regardless of permutation convention

Definition at line 203 of file Array.hh.

◆ as_perm_transform_by()

ReturnArray< Index > CASM::Array< PTNode< T > * >::as_perm_transform_by ( const Array< Index > &  trans_perm) const
inherited

Given N distinct objects labeled from 0 to N-1, a permutation 'P_permute' that physically permutes the objects (with labels) in terms of their labels, and a permutation 'L_permute' that permutes their labels only, rewrite 'P_permute' in terms of the relabeling induced by 'L_permute' Rearrange 'this' permutation to form an equivalent permutation for any list that has already been permuted by trans_perm. Does not (nearly certain of this) depend on permutation convention

Definition at line 204 of file Array.hh.

◆ at() [1/2]

PTNode< T > * & CASM::Array< PTNode< T > * >::at ( Index  ind)
inlineinherited

Definition at line 140 of file Array.hh.

◆ at() [2/2]

const PTNode< T > * & CASM::Array< PTNode< T > * >::at ( Index  ind) const
inlineinherited

Definition at line 145 of file Array.hh.

◆ back() [1/2]

PTNode< T > * & CASM::Array< PTNode< T > * >::back ( )
inlineinherited

Definition at line 160 of file Array.hh.

◆ back() [2/2]

const PTNode< T > * & CASM::Array< PTNode< T > * >::back ( ) const
inlineinherited

Definition at line 161 of file Array.hh.

◆ begin() [1/2]

PTNode< T > * * CASM::Array< PTNode< T > * >::begin ( )
inlineinherited

Definition at line 167 of file Array.hh.

◆ begin() [2/2]

PTNode< T > * const* CASM::Array< PTNode< T > * >::begin ( ) const
inlineinherited

Definition at line 164 of file Array.hh.

◆ cbegin()

PTNode< T > * const* CASM::Array< PTNode< T > * >::cbegin ( ) const
inlineinherited

Definition at line 166 of file Array.hh.

◆ cend()

PTNode< T > * const* CASM::Array< PTNode< T > * >::cend ( ) const
inlineinherited

Definition at line 172 of file Array.hh.

◆ clear()

void CASM::Array< PTNode< T > * >::clear ( )
inlineinherited

Definition at line 182 of file Array.hh.

◆ coincidence()

Index CASM::Array< PTNode< T > * >::coincidence ( const Array< PTNode< T > * > &  superset) const
inherited

Definition at line 231 of file Array.hh.

◆ contains()

bool CASM::Array< PTNode< T > * >::contains ( const T &  test_elem) const
inlineinherited

Definition at line 239 of file Array.hh.

◆ end() [1/2]

PTNode< T > * * CASM::Array< PTNode< T > * >::end ( )
inlineinherited

Definition at line 173 of file Array.hh.

◆ end() [2/2]

PTNode< T > * const* CASM::Array< PTNode< T > * >::end ( ) const
inlineinherited

Definition at line 170 of file Array.hh.

◆ find()

Index CASM::Array< PTNode< T > * >::find ( const T &  test_elem) const
inherited

Definition at line 233 of file Array.hh.

◆ has_fixed_points()

bool CASM::Array< PTNode< T > * >::has_fixed_points
inherited

Checks whether any values are equal to their index – only valid for Array<Index>

Definition at line 219 of file Array.hh.

◆ incidences()

Index CASM::Array< PTNode< T > * >::incidences ( const T &  test_elem) const
inherited

Definition at line 232 of file Array.hh.

◆ ipermute()

Array< PTNode< T > * > & CASM::Array< PTNode< T > * >::ipermute ( const Array< Index > &  perm_array)
inherited

Definition at line 200 of file Array.hh.

◆ is_ascending()

bool CASM::Array< PTNode< T > * >::is_ascending
inherited

Definition at line 215 of file Array.hh.

◆ is_constant()

bool CASM::Array< PTNode< T > * >::is_constant
inherited

Definition at line 217 of file Array.hh.

◆ is_descending()

bool CASM::Array< PTNode< T > * >::is_descending
inherited

Definition at line 216 of file Array.hh.

◆ is_permute()

bool CASM::Array< PTNode< T > * >::is_permute
inherited

Checks that Array contains values from 0 to perm_array.size()-1 and that no value is repeated does not depend on definition of permutation convention

Definition at line 218 of file Array.hh.

◆ max()

const PTNode< T > * & CASM::Array< PTNode< T > * >::max
inherited

Definition at line 207 of file Array.hh.

◆ min()

const PTNode< T > * & CASM::Array< PTNode< T > * >::min
inherited

Definition at line 208 of file Array.hh.

◆ next_permute()

bool CASM::Array< PTNode< T > * >::next_permute
inherited

Definition at line 201 of file Array.hh.

◆ operator!=()

bool CASM::Array< PTNode< T > * >::operator!= ( const Array< T > &  RHS) const
inlineinherited

Definition at line 224 of file Array.hh.

◆ operator<()

bool CASM::Array< PTNode< T > * >::operator< ( const Array< T > &  RHS) const
inherited

Definition at line 225 of file Array.hh.

◆ operator<=()

bool CASM::Array< PTNode< T > * >::operator<= ( const Array< T > &  RHS) const
inlineinherited

Definition at line 227 of file Array.hh.

◆ operator==()

bool CASM::Array< PTNode< T > * >::operator== ( const Array< T > &  RHS) const
inherited

Definition at line 223 of file Array.hh.

◆ operator>()

bool CASM::Array< PTNode< T > * >::operator> ( const Array< T > &  RHS) const
inherited

Definition at line 226 of file Array.hh.

◆ operator>=()

bool CASM::Array< PTNode< T > * >::operator>= ( const Array< T > &  RHS) const
inlineinherited

Definition at line 228 of file Array.hh.

◆ operator[]() [1/2]

PTNode< T > * & CASM::Array< PTNode< T > * >::operator[] ( Index  ind)
inlineinherited

Definition at line 155 of file Array.hh.

◆ operator[]() [2/2]

const PTNode< T > * & CASM::Array< PTNode< T > * >::operator[] ( Index  ind) const
inlineinherited

Definition at line 150 of file Array.hh.

◆ permute()

Array< PTNode< T > * > & CASM::Array< PTNode< T > * >::permute ( const Array< Index > &  perm_array)
inherited

Definition at line 199 of file Array.hh.

◆ pop_back()

void CASM::Array< PTNode< T > * >::pop_back ( )
inlineinherited

Definition at line 178 of file Array.hh.

◆ print_column()

void CASM::Array< PTNode< T > * >::print_column ( std::ostream &  stream,
const std::string &  indent = "" 
) const
inherited

Definition at line 245 of file Array.hh.

◆ PT_TOL()

template<typename T >
static double CASM::PTNode< T >::PT_TOL ( )
inlinestaticprotected

Definition at line 43 of file PolyTrie.hh.

◆ push_back()

void CASM::Array< PTNode< T > * >::push_back ( const T &  toPush)
inherited

Definition at line 176 of file Array.hh.

◆ remove()

void CASM::Array< PTNode< T > * >::remove ( Index  ind)
inherited

Definition at line 181 of file Array.hh.

◆ reserve()

void CASM::Array< PTNode< T > * >::reserve ( Index  new_max)
inherited

Definition at line 188 of file Array.hh.

◆ resize() [1/2]

void CASM::Array< PTNode< T > * >::resize ( Index  new_N)
inherited

Definition at line 186 of file Array.hh.

◆ resize() [2/2]

void CASM::Array< PTNode< T > * >::resize ( Index  new_N,
const T &  fill_val 
)
inherited

Definition at line 187 of file Array.hh.

◆ reverse_find()

Index CASM::Array< PTNode< T > * >::reverse_find ( const T &  test_elem) const
inherited

Same as find, but starts from the last element of the Array.

Definition at line 235 of file Array.hh.

◆ sequence() [1/2]

ReturnArray< PTNode< T > * > CASM::Array< PTNode< T > * >::sequence ( const T &  initial,
const T &  final 
)
staticinherited

Returns an array with the sequence (initial, ++initial, ..., final), inclusive requires that operator<() and operator++() are defined on type T

Returns an array with the sequence (initial, ++initial, ..., final), inclusive

Definition at line 123 of file Array.hh.

◆ sequence() [2/2]

ReturnArray< PTNode< T > * > CASM::Array< PTNode< T > * >::sequence ( const T &  initial,
const T &  increment,
const T &  final 
)
staticinherited

Returns an array with the sequence (initial, initial+increment, ..., final?), inclusive if final is in the sequence requires that operator<() and operator+=() are defined on type T

Returns an array with the sequence (initial, initial+increment, ..., final?), inclusive if final is in the sequence

Definition at line 128 of file Array.hh.

◆ size()

Index CASM::Array< PTNode< T > * >::size ( ) const
inlineinherited

Definition at line 131 of file Array.hh.

◆ sort() [1/3]

void CASM::Array< PTNode< T > * >::sort
inherited

Definition at line 193 of file Array.hh.

◆ sort() [2/3]

void CASM::Array< PTNode< T > * >::sort ( Array< Index > &  ind_order)
inherited

Definition at line 192 of file Array.hh.

◆ sort() [3/3]

void CASM::Array< PTNode< T > * >::sort ( const CompareType &  comp)
inherited

quicksort sorting algorithm

  • assumes that CompareType::compare(T a_thing, T b_thing) exists
  • End results is that CompareType::compare(at(i), at(j)) is true for all i<j

Definition at line 191 of file Array.hh.

◆ sub_array()

ReturnArray< PTNode< T > * > CASM::Array< PTNode< T > * >::sub_array ( Index  ind_begin,
Index  ind_end 
) const
inherited

Definition at line 211 of file Array.hh.

◆ sum()

PTNode< T > * CASM::Array< PTNode< T > * >::sum
inherited

Definition at line 213 of file Array.hh.

◆ swap()

void CASM::Array< PTNode< T > * >::swap ( Array< T > &  RHS)
inherited

Definition at line 136 of file Array.hh.

◆ swap_elem()

void CASM::Array< PTNode< T > * >::swap_elem ( Index  i,
Index  j 
)
inlineinherited

Definition at line 197 of file Array.hh.

◆ val()

template<typename T >
const T& CASM::PTNode< T >::val ( ) const
inline

Definition at line 58 of file PolyTrie.hh.

Friends And Related Function Documentation

◆ PolyTrie< T >

template<typename T >
friend class PolyTrie< T >
friend

Definition at line 43 of file PolyTrie.hh.

Member Data Documentation

◆ m_val

template<typename T >
T CASM::PTNode< T >::m_val
protected

Definition at line 46 of file PolyTrie.hh.

◆ N

Index CASM::Array< PTNode< T > * >::N
privateinherited

Definition at line 53 of file Array.hh.

◆ NMax

Index CASM::Array< PTNode< T > * >::NMax
privateinherited

Definition at line 54 of file Array.hh.

◆ up_node

template<typename T >
PTNode<T>* CASM::PTNode< T >::up_node
protected

Definition at line 45 of file PolyTrie.hh.

◆ Vals

PTNode< T > * * CASM::Array< PTNode< T > * >::Vals
privateinherited

Definition at line 55 of file Array.hh.


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