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

#include <Array.hh>

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

Detailed Description

template<class T>
class CASM::Array< T >

Basic std::vector like container (deprecated)

  • Legacy container that incorporated various useful algorithms, now being slowly replaced
  • Prefer to use std::vector except when necessary for compatibility

Definition at line 45 of file Array.hh.

Public Types

typedef Array< 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 T value_type
 
typedef Index size_type
 
typedef T * iterator
 
typedef const T * const_iterator
 

Public Member Functions

 Array ()
 
 Array (Index init_N)
 
 Array (Index init_N, const T &init_val)
 
 Array (const Array &RHS)
 
template<typename Iterator , typename = CASM_TMP::enable_if_iterator_of<Iterator, T>>
 Array (Iterator begin, Iterator end)
 
 Array (std::initializer_list< T > in)
 
 Array (ReturnArray< T > &RHS)
 
 ~Array ()
 
Index size () const
 
Arrayoperator= (const Array &RHS)
 
Arrayoperator= (ReturnArray< T > &RHS)
 
void swap (Array< T > &RHS)
 
T & at (Index ind)
 
const T & at (Index ind) const
 
const T & operator[] (Index ind) const
 
T & operator[] (Index ind)
 
T & back ()
 
const T & back () const
 
T const * begin () const
 
T const * cbegin () const
 
T * begin ()
 
T const * end () const
 
T const * cend () const
 
T * end ()
 
void push_back (const T &toPush)
 
void pop_back ()
 
void remove (Index ind)
 
void clear ()
 
void resize (Index new_N)
 
void resize (Index new_N, const T &fill_val)
 
void reserve (Index new_max)
 
template<typename CompareType >
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 T & max () const
 
const T & min () const
 
ReturnArray< T > sub_array (Index ind_begin, Index ind_end) const
 
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< T > &RHS) const
 
bool operator!= (const Array< T > &RHS) const
 
bool operator< (const Array< T > &RHS) const
 
bool operator> (const Array< T > &RHS) const
 
bool operator<= (const Array< T > &RHS) const
 
bool operator>= (const Array< T > &RHS) const
 
bool all_in (const Array &superset) const
 
Index coincidence (const Array &superset) const
 
Index incidences (const T &test_elem) const
 
Index find (const T &test_elem) const
 
Index reverse_find (const T &test_elem) const
 Same as find, but starts from the last element of the Array. More...
 
Index almost_find (const T &test_elem, double tol_val=TOL) const
 
Index 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...
 
bool contains (const T &test_elem) const
 
bool almost_contains (const T &test_elem, double tol_val=TOL) const
 
void print_column (std::ostream &stream, const std::string &indent="") const
 

Static Public Member Functions

static ReturnArray< T > sequence (const T &initial, const T &final)
 
static ReturnArray< T > sequence (const T &initial, const T &increment, const T &final)
 

Static Private Member Functions

static Index ARRAY_MIN_EXTRA_SPACE ()
 
static double ARRAY_EXTENSION_FACTOR ()
 

Private Attributes

Index N
 
Index NMax
 
T * Vals
 

Member Typedef Documentation

◆ const_iterator

template<class T >
typedef const T* CASM::Array< T >::const_iterator

Definition at line 73 of file Array.hh.

◆ iterator

template<class T >
typedef T* CASM::Array< T >::iterator

Definition at line 72 of file Array.hh.

◆ size_type

template<class T >
typedef Index CASM::Array< T >::size_type

Definition at line 71 of file Array.hh.

◆ value_type

template<class T >
typedef T CASM::Array< T >::value_type

Definition at line 70 of file Array.hh.

◆ X1

template<class T >
typedef Array<T> CASM::Array< T >::X1

Definition at line 60 of file Array.hh.

◆ X2

template<class T >
typedef Array<X1> CASM::Array< T >::X2

Definition at line 61 of file Array.hh.

◆ X3

template<class T >
typedef Array<X2> CASM::Array< T >::X3

Definition at line 62 of file Array.hh.

◆ X4

template<class T >
typedef Array<X3> CASM::Array< T >::X4

Definition at line 63 of file Array.hh.

◆ X5

template<class T >
typedef Array<X4> CASM::Array< T >::X5

Definition at line 64 of file Array.hh.

◆ X6

template<class T >
typedef Array<X5> CASM::Array< T >::X6

Definition at line 65 of file Array.hh.

◆ X7

template<class T >
typedef Array<X6> CASM::Array< T >::X7

Definition at line 66 of file Array.hh.

◆ X8

template<class T >
typedef Array<X7> CASM::Array< T >::X8

Definition at line 67 of file Array.hh.

◆ X9

template<class T >
typedef Array<X8> CASM::Array< T >::X9

Definition at line 68 of file Array.hh.

Constructor & Destructor Documentation

◆ Array() [1/6]

template<class T >
CASM::Array< T >::Array ( )
inline

Definition at line 76 of file Array.hh.

◆ Array() [2/6]

template<class T >
CASM::Array< T >::Array ( Index  init_N)
inline

Definition at line 80 of file Array.hh.

◆ Array() [3/6]

template<class T >
CASM::Array< T >::Array ( Index  init_N,
const T &  init_val 
)
inline

Definition at line 84 of file Array.hh.

◆ Array() [4/6]

template<class T >
CASM::Array< T >::Array ( const Array< T > &  RHS)
inline

Definition at line 90 of file Array.hh.

◆ Array() [5/6]

template<class T >
template<typename Iterator , typename = CASM_TMP::enable_if_iterator_of<Iterator, T>>
CASM::Array< T >::Array ( Iterator  begin,
Iterator  end 
)
inline

Definition at line 99 of file Array.hh.

◆ Array() [6/6]

template<class T >
CASM::Array< T >::Array ( std::initializer_list< T >  in)
inline

Definition at line 106 of file Array.hh.

◆ ~Array()

template<class T >
CASM::Array< T >::~Array ( )
inline

Definition at line 116 of file Array.hh.

Member Function Documentation

◆ almost_contains()

template<class T >
bool CASM::Array< T >::almost_contains ( const T &  test_elem,
double  tol_val = TOL 
) const
inline

Definition at line 240 of file Array.hh.

◆ ARRAY_EXTENSION_FACTOR()

template<class T >
static double CASM::Array< T >::ARRAY_EXTENSION_FACTOR ( )
inlinestaticprivate

Definition at line 48 of file Array.hh.

◆ ARRAY_MIN_EXTRA_SPACE()

template<class T >
static Index CASM::Array< T >::ARRAY_MIN_EXTRA_SPACE ( )
inlinestaticprivate

Definition at line 47 of file Array.hh.

◆ at() [1/2]

template<class T >
T& CASM::Array< T >::at ( Index  ind)
inline

Definition at line 140 of file Array.hh.

◆ at() [2/2]

template<class T >
const T& CASM::Array< T >::at ( Index  ind) const
inline

Definition at line 145 of file Array.hh.

◆ back() [1/2]

template<class T >
T& CASM::Array< T >::back ( )
inline

Definition at line 160 of file Array.hh.

◆ back() [2/2]

template<class T >
const T& CASM::Array< T >::back ( ) const
inline

Definition at line 161 of file Array.hh.

◆ begin() [1/2]

template<class T >
T* CASM::Array< T >::begin ( )
inline

Definition at line 167 of file Array.hh.

◆ begin() [2/2]

template<class T >
T const* CASM::Array< T >::begin ( ) const
inline

Definition at line 164 of file Array.hh.

◆ cbegin()

template<class T >
T const* CASM::Array< T >::cbegin ( ) const
inline

Definition at line 166 of file Array.hh.

◆ cend()

template<class T >
T const* CASM::Array< T >::cend ( ) const
inline

Definition at line 172 of file Array.hh.

◆ clear()

template<class T >
void CASM::Array< T >::clear ( )
inline

Definition at line 182 of file Array.hh.

◆ contains()

template<class T >
bool CASM::Array< T >::contains ( const T &  test_elem) const
inline

Definition at line 239 of file Array.hh.

◆ end() [1/2]

template<class T >
T* CASM::Array< T >::end ( )
inline

Definition at line 173 of file Array.hh.

◆ end() [2/2]

template<class T >
T const* CASM::Array< T >::end ( ) const
inline

Definition at line 170 of file Array.hh.

◆ operator!=()

template<class T >
bool CASM::Array< T >::operator!= ( const Array< T > &  RHS) const
inline

Definition at line 224 of file Array.hh.

◆ operator<=()

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

Definition at line 227 of file Array.hh.

◆ operator>=()

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

Definition at line 228 of file Array.hh.

◆ operator[]() [1/2]

template<class T >
T& CASM::Array< T >::operator[] ( Index  ind)
inline

Definition at line 155 of file Array.hh.

◆ operator[]() [2/2]

template<class T >
const T& CASM::Array< T >::operator[] ( Index  ind) const
inline

Definition at line 150 of file Array.hh.

◆ pop_back()

template<class T >
void CASM::Array< T >::pop_back ( )
inline

Definition at line 178 of file Array.hh.

◆ size()

template<class T >
Index CASM::Array< T >::size ( ) const
inline

Definition at line 131 of file Array.hh.

◆ swap_elem()

template<class T >
void CASM::Array< T >::swap_elem ( Index  i,
Index  j 
)
inline

Definition at line 197 of file Array.hh.

Member Data Documentation

◆ N

template<class T >
Index CASM::Array< T >::N
private

Definition at line 53 of file Array.hh.

◆ NMax

template<class T >
Index CASM::Array< T >::NMax
private

Definition at line 54 of file Array.hh.

◆ Vals

template<class T >
T* CASM::Array< T >::Vals
private

Definition at line 55 of file Array.hh.


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