CASM  1.1.0
A Clusters Approach to Statistical Mechanics
PolyTrie

Detailed Description

A trie structure for representing polynomials.

Classes

class  CASM::PolyTrie< T >
 
class  CASM::PTNode< T >
 
class  CASM::PTLeaf< T >
 
class  CASM::PTIterator< PTType, IsConst >
 

Functions

 CASM::PTIterator< PTType, IsConst >::PTIterator (const PTIterator< PTType, false > &_it)
 
PTNode< T > * CASM::PTNode< T >::valid_node_at (Index i)
 
PTNode< T > * CASM::PTNode< T >::valid_leaf_at (PolyTrie< T > &home_trie, const Array< Index > &ind)
 
virtual void CASM::PTNode< T >::remove ()
 
virtual CASM::PTNode< T >::~PTNode ()
 
void CASM::PTLeaf< T >::swap_after_prev (PTLeaf< T > *other)
 
void CASM::PTLeaf< T >::insert_after (PTLeaf< T > *prev)
 
void CASM::PTLeaf< T >::insert_at (PTLeaf< T > *&insertion_ptr)
 List insertion methods. More...
 
void CASM::PTLeaf< T >::insert_before (PTLeaf< T > *next)
 
 CASM::PTLeaf< T >::~PTLeaf ()
 
PTLeaf< T > * CASM::PTLeaf< T >::remove_and_next ()
 
 CASM::PolyTrie< T >::PolyTrie (const PolyTrie< T > &orig)
 
 CASM::PolyTrie< T >::~PolyTrie ()
 
Index CASM::PolyTrie< T >::num_nonzero () const
 
CASM::PolyTrie< T >::get (const Array< Index > &ind) const
 get() provides constant access does not change trie structure More...
 
void CASM::PolyTrie< T >::set (const Array< Index > &ind, const T &_val)
 set() allows assignment that prunes the trie if _val is approximately 0; More...
 
T & CASM::PolyTrie< T >::at (const Array< Index > &ind)
 
T & CASM::PolyTrie< T >::operator() (const Array< Index > &ind)
 
CASM::PolyTrie< T >::operator() (const Array< Index > &ind) const
 
void CASM::PolyTrie< T >::list_leaf (PTLeaf< T > *new_leaf)
 
void CASM::PolyTrie< T >::clear ()
 
void CASM::PolyTrie< T >::redefine (Index new_depth)
 Clears all leaves and resets depth. More...
 
void CASM::PolyTrie< T >::swap (PolyTrie< T > &other)
 Efficient swap of this PolyTrie with another. More...
 
void CASM::PolyTrie< T >::remove (const Array< Index > &ind)
 Remove entry at 'ind'. More...
 
bool CASM::PolyTrie< T >::prune_zeros (double tol=PTNode< T >::PT_TOL())
 
void CASM::PolyTrie< T >::print_sparse (std::ostream &out) const
 
PolyTrieCASM::PolyTrie< T >::operator*= (const T &scale)
 
PolyTrieCASM::PolyTrie< T >::operator+= (const PolyTrie< T > &RHS)
 
PolyTrieCASM::PolyTrie< T >::operator-= (const PolyTrie< T > &RHS)
 
PolyTrie CASM::PolyTrie< T >::operator+ (const PolyTrie< T > &RHS) const
 
PolyTrie CASM::PolyTrie< T >::operator- (const PolyTrie< T > &RHS) const
 
bool CASM::PolyTrie< T >::compare (const PolyTrie< T > &RHS, double tol=2 *PTNode< T >::PT_TOL()) const
 
bool CASM::PolyTrie< T >::operator== (const PolyTrie< T > &RHS) const
 
bool CASM::PolyTrie< T >::almost_zero (double tol=2 *PTNode< T >::PT_TOL()) const
 
template<typename CompareType >
void CASM::PolyTrie< T >::sort_leaves (const CompareType &compare)
 

Function Documentation

◆ almost_zero()

template<typename T >
bool CASM::PolyTrie< T >::almost_zero ( double  tol = 2 * PTNode<T>::PT_TOL()) const

Definition at line 761 of file PolyTrie.hh.

◆ at()

template<typename T >
T & CASM::PolyTrie< T >::at ( const Array< Index > &  ind)

at() provides non-const access and changes trie if leaf does not exist at ind

Definition at line 545 of file PolyTrie.hh.

◆ clear()

template<typename T >
void CASM::PolyTrie< T >::clear

Definition at line 606 of file PolyTrie.hh.

◆ compare()

template<typename T >
bool CASM::PolyTrie< T >::compare ( const PolyTrie< T > &  RHS,
double  tol = 2 * PTNode<T>::PT_TOL() 
) const

Definition at line 747 of file PolyTrie.hh.

◆ get()

template<typename T >
T CASM::PolyTrie< T >::get ( const Array< Index > &  ind) const

get() provides constant access does not change trie structure

Definition at line 503 of file PolyTrie.hh.

◆ insert_after()

template<typename T >
void CASM::PTLeaf< T >::insert_after ( PTLeaf< T > *  prev)

Definition at line 401 of file PolyTrie.hh.

◆ insert_at()

template<typename T >
void CASM::PTLeaf< T >::insert_at ( PTLeaf< T > *&  insertion_ptr)

List insertion methods.

Definition at line 408 of file PolyTrie.hh.

◆ insert_before()

template<typename T >
void CASM::PTLeaf< T >::insert_before ( PTLeaf< T > *  next)

Definition at line 429 of file PolyTrie.hh.

◆ list_leaf()

template<typename T >
void CASM::PolyTrie< T >::list_leaf ( PTLeaf< T > *  new_leaf)

Definition at line 599 of file PolyTrie.hh.

◆ num_nonzero()

template<typename T >
Index CASM::PolyTrie< T >::num_nonzero
private

Definition at line 493 of file PolyTrie.hh.

◆ operator()() [1/2]

template<typename T >
T & CASM::PolyTrie< T >::operator() ( const Array< Index > &  ind)

Definition at line 561 of file PolyTrie.hh.

◆ operator()() [2/2]

template<typename T >
T CASM::PolyTrie< T >::operator() ( const Array< Index > &  ind) const

Definition at line 578 of file PolyTrie.hh.

◆ operator*=()

template<typename T >
PolyTrie< T > & CASM::PolyTrie< T >::operator*= ( const T &  scale)

Definition at line 693 of file PolyTrie.hh.

◆ operator+()

template<typename T >
PolyTrie< T > CASM::PolyTrie< T >::operator+ ( const PolyTrie< T > &  RHS) const

Definition at line 732 of file PolyTrie.hh.

◆ operator+=()

template<typename T >
PolyTrie< T > & CASM::PolyTrie< T >::operator+= ( const PolyTrie< T > &  RHS)

Definition at line 708 of file PolyTrie.hh.

◆ operator-()

template<typename T >
PolyTrie< T > CASM::PolyTrie< T >::operator- ( const PolyTrie< T > &  RHS) const

Definition at line 739 of file PolyTrie.hh.

◆ operator-=()

template<typename T >
PolyTrie< T > & CASM::PolyTrie< T >::operator-= ( const PolyTrie< T > &  RHS)

Definition at line 720 of file PolyTrie.hh.

◆ operator==()

template<typename T >
bool CASM::PolyTrie< T >::operator== ( const PolyTrie< T > &  RHS) const

Definition at line 754 of file PolyTrie.hh.

◆ PolyTrie()

template<typename T >
CASM::PolyTrie< T >::PolyTrie ( const PolyTrie< T > &  orig)

Definition at line 474 of file PolyTrie.hh.

◆ print_sparse()

template<typename T >
void CASM::PolyTrie< T >::print_sparse ( std::ostream &  out) const

Definition at line 682 of file PolyTrie.hh.

◆ prune_zeros()

template<typename T >
bool CASM::PolyTrie< T >::prune_zeros ( double  tol = PTNode<T>::PT_TOL())

removes zero entries, if there are any, and returns true if entries were removed.

Definition at line 667 of file PolyTrie.hh.

◆ PTIterator()

template<typename PTType , bool IsConst>
CASM::PTIterator< PTType, IsConst >::PTIterator ( const PTIterator< PTType, false > &  _it)

Definition at line 316 of file PolyTrie.hh.

◆ redefine()

template<typename T >
void CASM::PolyTrie< T >::redefine ( Index  new_depth)

Clears all leaves and resets depth.

Definition at line 616 of file PolyTrie.hh.

◆ remove() [1/2]

template<typename T >
void CASM::PTNode< T >::remove
virtual

Reimplemented in CASM::PolyTrie< T >, and CASM::PolyTrie< double >.

Definition at line 357 of file PolyTrie.hh.

◆ remove() [2/2]

template<typename T >
void CASM::PolyTrie< T >::remove ( const Array< Index > &  ind)

Remove entry at 'ind'.

Definition at line 649 of file PolyTrie.hh.

◆ remove_and_next()

template<typename T >
PTLeaf< T > * CASM::PTLeaf< T >::remove_and_next

Definition at line 463 of file PolyTrie.hh.

◆ set()

template<typename T >
void CASM::PolyTrie< T >::set ( const Array< Index > &  ind,
const T &  _val 
)

set() allows assignment that prunes the trie if _val is approximately 0;

Definition at line 524 of file PolyTrie.hh.

◆ sort_leaves()

template<typename T >
template<typename CompareType >
void CASM::PolyTrie< T >::sort_leaves ( const CompareType &  compare)

Definition at line 774 of file PolyTrie.hh.

◆ swap()

template<typename T >
void CASM::PolyTrie< T >::swap ( PolyTrie< T > &  other)

Efficient swap of this PolyTrie with another.

Definition at line 624 of file PolyTrie.hh.

◆ swap_after_prev()

template<typename T >
void CASM::PTLeaf< T >::swap_after_prev ( PTLeaf< T > *  other)

Do a swap with 'other' and 'this' so that leaf previous to 'other' now points to 'this' and leaf previous to 'this' now points to 'other'

Definition at line 394 of file PolyTrie.hh.

◆ valid_leaf_at()

template<typename T >
PTNode< T > * CASM::PTNode< T >::valid_leaf_at ( PolyTrie< T > &  home_trie,
const Array< Index > &  ind 
)
protected

Definition at line 332 of file PolyTrie.hh.

◆ valid_node_at()

template<typename T >
PTNode< T > * CASM::PTNode< T >::valid_node_at ( Index  i)
protected

Definition at line 322 of file PolyTrie.hh.

◆ ~PolyTrie()

template<typename T >
CASM::PolyTrie< T >::~PolyTrie

Definition at line 486 of file PolyTrie.hh.

◆ ~PTLeaf()

template<typename T >
CASM::PTLeaf< T >::~PTLeaf< T >

Definition at line 429 of file PolyTrie.hh.

◆ ~PTNode()

template<typename T >
CASM::PTNode< T >::~PTNode< T >
virtual

Definition at line 357 of file PolyTrie.hh.