CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
PolyTrie

Detailed Description

A trie structure for representing polynomials.

Namespaces

 CASM::ComparePTLeaf
 

Classes

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

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)
 at() provides non-const access and changes trie if leaf does not exist at ind More...
 
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())
 removes zero entries, if there are any, and returns true if entries were removed. More...
 
void CASM::PolyTrie< T >::print_sparse (std::ostream &out) const
 
PolyTrie & CASM::PolyTrie< T >::operator*= (const T &scale)
 
PolyTrie & CASM::PolyTrie< T >::operator+= (const PolyTrie< T > &RHS)
 
PolyTrie & CASM::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

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

Definition at line 805 of file PolyTrie.hh.

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 587 of file PolyTrie.hh.

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

Definition at line 649 of file PolyTrie.hh.

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

Definition at line 791 of file PolyTrie.hh.

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 544 of file PolyTrie.hh.

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

Definition at line 442 of file PolyTrie.hh.

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

List insertion methods.

Definition at line 449 of file PolyTrie.hh.

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

Definition at line 471 of file PolyTrie.hh.

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

Definition at line 642 of file PolyTrie.hh.

template<typename T >
Index CASM::PolyTrie< T >::num_nonzero ( ) const
private

Definition at line 533 of file PolyTrie.hh.

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

Definition at line 603 of file PolyTrie.hh.

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

Definition at line 619 of file PolyTrie.hh.

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

Definition at line 736 of file PolyTrie.hh.

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

Definition at line 776 of file PolyTrie.hh.

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

Definition at line 752 of file PolyTrie.hh.

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

Definition at line 783 of file PolyTrie.hh.

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

Definition at line 764 of file PolyTrie.hh.

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

Definition at line 798 of file PolyTrie.hh.

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

Definition at line 515 of file PolyTrie.hh.

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

Definition at line 725 of file PolyTrie.hh.

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 710 of file PolyTrie.hh.

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

Definition at line 355 of file PolyTrie.hh.

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

Clears all leaves and resets depth.

Definition at line 659 of file PolyTrie.hh.

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

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

Definition at line 394 of file PolyTrie.hh.

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

Remove entry at 'ind'.

Definition at line 694 of file PolyTrie.hh.

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

Definition at line 504 of file PolyTrie.hh.

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 565 of file PolyTrie.hh.

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

Definition at line 818 of file PolyTrie.hh.

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

Efficient swap of this PolyTrie with another.

Definition at line 667 of file PolyTrie.hh.

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 434 of file PolyTrie.hh.

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

Definition at line 371 of file PolyTrie.hh.

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

Definition at line 361 of file PolyTrie.hh.

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

Definition at line 525 of file PolyTrie.hh.

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

Definition at line 489 of file PolyTrie.hh.

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

Definition at line 423 of file PolyTrie.hh.