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

Detailed Description

Basic std::vector like container (deprecated)

Classes

class  CASM::Array< T >
 Basic std::vector like container (deprecated) More...
 
class  CASM::ReturnArray< T >
 
class  CASM::ArraySizeLessThan
 

Functions

template<typename T >
jsonParser & CASM::to_json (const Array< T > &value, jsonParser &json)
 
template<typename T >
void CASM::from_json (Array< T > &value, const jsonParser &json)
 This requires that 'T::T()' exists, if not, you must do this by hand. More...
 
template<class T >
Array< T > CASM::array_cat (const Array< T > &A1, const Array< T > &A2)
 
template<class T >
std::ostream & CASM::operator<< (std::ostream &out, const Array< T > &array_out)
 
template<typename T >
void CASM::swap (Array< T > &A1, Array< T > &A2)
 
 CASM::Array< T >::Array (ReturnArray< T > &RHS)
 
static ReturnArray< T > CASM::Array< T >::sequence (const T &initial, const T &final)
 Returns an array with the sequence (initial, ++initial, ..., final), inclusive. More...
 
static ReturnArray< T > CASM::Array< T >::sequence (const T &initial, const T &increment, const T &final)
 
Array & CASM::Array< T >::operator= (const Array &RHS)
 
Array & CASM::Array< T >::operator= (ReturnArray< T > &RHS)
 
void CASM::Array< T >::swap (Array< T > &RHS)
 
void CASM::Array< T >::resize (Index new_N)
 
void CASM::Array< T >::resize (Index new_N, const T &fill_val)
 
void CASM::Array< T >::reserve (Index new_max)
 
void CASM::Array< T >::push_back (const T &toPush)
 
void CASM::Array< T >::remove (Index ind)
 
bool CASM::Array< T >::operator== (const Array< T > &RHS) const
 
bool CASM::Array< T >::operator< (const Array< T > &RHS) const
 
bool CASM::Array< T >::operator> (const Array< T > &RHS) const
 
const T & CASM::Array< T >::max () const
 
const T & CASM::Array< T >::min () const
 
CASM::Array< T >::sum () const
 
ReturnArray< T > CASM::Array< T >::sub_array (Index ind_begin, Index ind_end) const
 
bool CASM::Array< T >::all_in (const Array &superset) const
 
Index CASM::Array< T >::coincidence (const Array &superset) const
 
Index CASM::Array< T >::incidences (const T &test_elem) const
 
Index CASM::Array< T >::find (const T &test_elem) const
 
Index CASM::Array< T >::reverse_find (const T &test_elem) const
 Same as find, but starts from the last element of the Array. More...
 
Index CASM::Array< T >::almost_find (const T &test_elem, double tol_val=TOL) const
 
void CASM::Array< T >::print_column (std::ostream &stream, const std::string &indent="") const
 
Index CASM::Array< T >::almost_reverse_find (const T &test_elem, double tol_val=TOL) const
 Same as almost_find, but start from the last element of the Array. More...
 
template<typename CompareType >
void CASM::Array< T >::sort (const CompareType &comp)
 
void CASM::Array< T >::sort (Array< Index > &ind_order)
 
void CASM::Array< T >::sort ()
 
Array & CASM::Array< T >::append (const Array &new_tail)
 
Array & CASM::Array< T >::append_unique (const Array &new_tail)
 
Array & CASM::Array< T >::permute (const Array< Index > &perm_array)
 
Array & CASM::Array< T >::ipermute (const Array< Index > &perm_array)
 
bool CASM::Array< T >::next_permute ()
 
ReturnArray< Index > CASM::Array< T >::as_perm_inverse () const
 
ReturnArray< Index > CASM::Array< T >::as_perm_transform_by (const Array< Index > &trans_perm) const
 
bool CASM::Array< T >::is_ascending () const
 
bool CASM::Array< T >::is_descending () const
 
bool CASM::Array< T >::is_constant () const
 
bool CASM::Array< T >::is_permute () const
 
bool CASM::Array< T >::has_fixed_points () const
 Checks whether any values are equal to their index – only valid for Array<Index> More...
 

Function Documentation

template<typename T >
bool CASM::Array< T >::all_in ( const Array< T > &  superset) const

Definition at line 664 of file Array.hh.

template<typename T>
Index CASM::Array< T >::almost_find ( const T &  test_elem,
double  tol_val = TOL 
) const

Definition at line 733 of file Array.hh.

template<typename T>
Index CASM::Array< T >::almost_reverse_find ( const T &  test_elem,
double  tol_val = TOL 
) const

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

Definition at line 752 of file Array.hh.

template<typename T >
Array< T > & CASM::Array< T >::append ( const Array< T > &  new_tail)

Definition at line 897 of file Array.hh.

template<typename T >
Array< T > & CASM::Array< T >::append_unique ( const Array< T > &  new_tail)

Definition at line 908 of file Array.hh.

template<typename T>
CASM::Array< T >::Array ( ReturnArray< T > &  RHS)

Definition at line 336 of file Array.hh.

template<class T >
Array<T> CASM::array_cat ( const Array< T > &  A1,
const Array< T > &  A2 
)

Definition at line 1072 of file Array.hh.

template<typename T >
ReturnArray< Index > CASM::Array< T >::as_perm_inverse ( ) const

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

Definition at line 986 of file Array.hh.

template<typename T >
ReturnArray< Index > CASM::Array< T >::as_perm_transform_by ( const Array< Index > &  trans_perm) const

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 1004 of file Array.hh.

template<typename T >
Index CASM::Array< T >::coincidence ( const Array< T > &  superset) const

Definition at line 679 of file Array.hh.

template<typename T>
Index CASM::Array< T >::find ( const T &  test_elem) const

Definition at line 707 of file Array.hh.

template<typename T >
void CASM::from_json ( Array< T > &  value,
const jsonParser &  json 
)

This requires that 'T::T()' exists, if not, you must do this by hand.

re-throw exceptions

Definition at line 302 of file Array.hh.

template<typename T >
bool CASM::Array< T >::has_fixed_points ( ) const

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

Definition at line 1061 of file Array.hh.

template<typename T>
Index CASM::Array< T >::incidences ( const T &  test_elem) const

Definition at line 693 of file Array.hh.

template<typename T >
Array< T > & CASM::Array< T >::ipermute ( const Array< Index > &  perm_array)

Definition at line 940 of file Array.hh.

template<typename T >
bool CASM::Array< T >::is_ascending ( ) const

Definition at line 1011 of file Array.hh.

template<typename T >
bool CASM::Array< T >::is_constant ( ) const

Definition at line 1035 of file Array.hh.

template<typename T >
bool CASM::Array< T >::is_descending ( ) const

Definition at line 1023 of file Array.hh.

template<typename T >
bool CASM::Array< T >::is_permute ( ) const

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 1049 of file Array.hh.

template<typename T >
const T & CASM::Array< T >::max ( ) const

Definition at line 604 of file Array.hh.

template<typename T >
const T & CASM::Array< T >::min ( ) const

Definition at line 623 of file Array.hh.

template<typename T >
bool CASM::Array< T >::next_permute ( )

Definition at line 956 of file Array.hh.

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

Definition at line 574 of file Array.hh.

template<class T >
std::ostream& CASM::operator<< ( std::ostream &  out,
const Array< T > &  array_out 
)

Definition at line 1079 of file Array.hh.

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

Definition at line 412 of file Array.hh.

template<typename T>
Array< T > & CASM::Array< T >::operator= ( ReturnArray< T > &  RHS)

Definition at line 443 of file Array.hh.

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

Definition at line 558 of file Array.hh.

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

Definition at line 589 of file Array.hh.

template<typename T >
Array< T > & CASM::Array< T >::permute ( const Array< Index > &  perm_array)

Definition at line 923 of file Array.hh.

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

Definition at line 745 of file Array.hh.

template<typename T>
void CASM::Array< T >::push_back ( const T &  toPush)

Definition at line 513 of file Array.hh.

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

Definition at line 546 of file Array.hh.

template<typename T >
void CASM::Array< T >::reserve ( Index  new_max)

Definition at line 491 of file Array.hh.

template<typename T >
void CASM::Array< T >::resize ( Index  new_N)

Definition at line 468 of file Array.hh.

template<typename T>
void CASM::Array< T >::resize ( Index  new_N,
const T &  fill_val 
)

Definition at line 481 of file Array.hh.

template<typename T>
Index CASM::Array< T >::reverse_find ( const T &  test_elem) const

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

Definition at line 720 of file Array.hh.

template<typename T>
ReturnArray< T > CASM::Array< T >::sequence ( const T &  initial,
const T &  final 
)
static

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

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

Definition at line 343 of file Array.hh.

template<typename T>
ReturnArray< T > CASM::Array< T >::sequence ( const T &  initial,
const T &  increment,
const T &  final 
)
static

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 361 of file Array.hh.

template<typename T >
template<typename CompareType >
void CASM::Array< T >::sort ( const CompareType &  comp)

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 766 of file Array.hh.

template<typename T >
void CASM::Array< T >::sort ( Array< Index > &  ind_order)

Definition at line 866 of file Array.hh.

template<typename T >
void CASM::Array< T >::sort ( )

Definition at line 885 of file Array.hh.

template<typename T >
ReturnArray< T > CASM::Array< T >::sub_array ( Index  ind_begin,
Index  ind_end 
) const

Definition at line 652 of file Array.hh.

template<typename T >
T CASM::Array< T >::sum ( ) const

Definition at line 641 of file Array.hh.

template<typename T>
void CASM::Array< T >::swap ( Array< T > &  RHS)

Definition at line 449 of file Array.hh.

template<typename T >
void CASM::swap ( Array< T > &  A1,
Array< T > &  A2 
)

Definition at line 1106 of file Array.hh.

template<typename T >
jsonParser& CASM::to_json ( const Array< T > &  value,
jsonParser &  json 
)

Definition at line 293 of file Array.hh.