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

#include <Tensor.hh>

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

Detailed Description

template<class T>
class CASM::Tensor< T >

Definition at line 32 of file Tensor.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

 Tensor (Index tNrank, Array< Index > tNdim)
 
 Tensor (Index tNrank, Array< Index > tNdim, T init_val)
 
 Tensor (Index tNrank=0)
 
 Tensor (const Eigen::Matrix< T, 3, 3 > &mat_init)
 
 Tensor (ReturnTensor< T > &init_cont)
 
Tensoroperator= (ReturnTensor< T > &RHS)
 
Tensoroperator= (const T &RHS)
 
template<int dim1, int dim2, int flag1>
Tensoroperator= (const Eigen::Matrix< T, dim1, dim2, flag1 > &LHS)
 
void swap (Tensor &RHS)
 
void redefine (Array< Index > _Ndim)
 
void redefine (Array< Index > _Ndim, T fill_val)
 
Tensordim_permute (const Array< Index > &iperm)
 
Tensordim_permute (const Permutation &perm)
 
Tensordim_ipermute (const Array< Index > &perm)
 
Tensordim_ipermute (const Permutation &perm)
 
Tensordim_unpermute ()
 
bool next_permute ()
 
void permute_symmetrize ()
 Symmetrize tensor with respect to index permutation. More...
 
void permute_symmetrize (const Array< Array< Index > > &unique_dim)
 
void reset_idim ()
 
Counter< Array< Index > > element_counter () const
 
Index rank () const
 
const Array< Index > & ind_max () const
 
const Array< Index > & dim () const
 
Index dim (Index i) const
 
const Array< Index > & mult_array () const
 
const T & get (const Array< Index > &inds) const
 
T & at (const Array< Index > &inds)
 
const T & at (const Array< Index > &inds) const
 
T & operator() (const Array< Index > &inds)
 
const T & operator() (const Array< Index > &inds) const
 
T & operator() (Index i, Index j)
 
const T & operator() (Index i, Index j) const
 
Tensoroperator+= (const Tensor &RHS)
 
Tensoroperator-= (const Tensor &RHS)
 
Tensoroperator*= (T RHS)
 
Tensoroperator/= (T RHS)
 
ReturnTensor< T > operator- ()
 
ReturnTensor< T > operator+ (const Tensor &RHS)
 
ReturnTensor< T > operator- (const Tensor &RHS)
 
scalar_prod (const Tensor &RHS) const
 
ReturnTensor< T > tensor_prod (const Tensor &RHS)
 
Tensornormalize ()
 
Tensortransform (const Eigen::MatrixXd &op)
 
Tensortransform (const SymOp &op, Array< SymGroupRepID > rep_IDs)
 
Tensorapply_sym (const SymOp &op)
 
Tensorsymmetrize_index (const SymOp &op, Array< SymGroupRepID > rep_IDs, Array< Index > inner_ind)
 
Tensor slice (Array< Index > slice_Ndim, Array< Index > slice_ind)
 
void read (std::istream &stream)
 
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > convert_to_Eigen () const
 
template<int dim1, int dim2, int flag1>
Tensor< T > & operator= (const Eigen::Matrix< T, dim1, dim2, flag1 > &LHS)
 
Index size () const
 
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 * begin ()
 
T const * cbegin () const
 
T const * end () const
 
T * end ()
 
T const * cend () const
 
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)
 
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 ReturnTensor< T > identity (Index trank, Index tdim)
 
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 Nrank
 
Array< IndexNdim
 
Array< Indexidim
 
Array< Indexmax_ind
 
Index N
 
Index NMax
 
T * Vals
 

Member Typedef Documentation

◆ const_iterator

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

Definition at line 73 of file Array.hh.

◆ iterator

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

Definition at line 72 of file Array.hh.

◆ size_type

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

Definition at line 71 of file Array.hh.

◆ value_type

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

Definition at line 70 of file Array.hh.

◆ X1

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

Definition at line 60 of file Array.hh.

◆ X2

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

Definition at line 61 of file Array.hh.

◆ X3

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

Definition at line 62 of file Array.hh.

◆ X4

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

Definition at line 63 of file Array.hh.

◆ X5

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

Definition at line 64 of file Array.hh.

◆ X6

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

Definition at line 65 of file Array.hh.

◆ X7

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

Definition at line 66 of file Array.hh.

◆ X8

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

Definition at line 67 of file Array.hh.

◆ X9

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

Definition at line 68 of file Array.hh.

Constructor & Destructor Documentation

◆ Tensor() [1/5]

template<class T >
CASM::Tensor< T >::Tensor ( Index  tNrank,
Array< Index tNdim 
)
inline

Definition at line 43 of file Tensor.hh.

◆ Tensor() [2/5]

template<class T >
CASM::Tensor< T >::Tensor ( Index  tNrank,
Array< Index tNdim,
init_val 
)
inline

Definition at line 56 of file Tensor.hh.

◆ Tensor() [3/5]

template<class T >
CASM::Tensor< T >::Tensor ( Index  tNrank = 0)
inline

Definition at line 70 of file Tensor.hh.

◆ Tensor() [4/5]

template<class T >
CASM::Tensor< T >::Tensor ( const Eigen::Matrix< T, 3, 3 > &  mat_init)
inline

Definition at line 82 of file Tensor.hh.

◆ Tensor() [5/5]

template<class T >
CASM::Tensor< T >::Tensor ( ReturnTensor< T > &  init_cont)
inline

Definition at line 96 of file Tensor.hh.

Member Function Documentation

◆ almost_contains()

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

Definition at line 240 of file Array.hh.

◆ ARRAY_EXTENSION_FACTOR()

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

Definition at line 48 of file Array.hh.

◆ ARRAY_MIN_EXTRA_SPACE()

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

Definition at line 47 of file Array.hh.

◆ at() [1/2]

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

Definition at line 140 of file Array.hh.

◆ at() [2/2]

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

Definition at line 145 of file Array.hh.

◆ back() [1/2]

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

Definition at line 160 of file Array.hh.

◆ back() [2/2]

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

Definition at line 161 of file Array.hh.

◆ begin() [1/2]

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

Definition at line 167 of file Array.hh.

◆ begin() [2/2]

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

Definition at line 164 of file Array.hh.

◆ cbegin()

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

Definition at line 166 of file Array.hh.

◆ cend()

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

Definition at line 172 of file Array.hh.

◆ clear()

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

Definition at line 182 of file Array.hh.

◆ contains()

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

Definition at line 239 of file Array.hh.

◆ end() [1/2]

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

Definition at line 173 of file Array.hh.

◆ end() [2/2]

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

Definition at line 170 of file Array.hh.

◆ operator!=()

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

Definition at line 224 of file Array.hh.

◆ operator<=()

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

Definition at line 227 of file Array.hh.

◆ operator=() [1/3]

template<class T >
template<int dim1, int dim2, int flag1>
Tensor& CASM::Tensor< T >::operator= ( const Eigen::Matrix< T, dim1, dim2, flag1 > &  LHS)

◆ operator=() [2/3]

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

Definition at line 103 of file Tensor.hh.

◆ operator=() [3/3]

template<class T >
Tensor& CASM::Tensor< T >::operator= ( ReturnTensor< T > &  RHS)
inline

Definition at line 98 of file Tensor.hh.

◆ operator>=()

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

Definition at line 228 of file Array.hh.

◆ operator[]() [1/2]

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

Definition at line 155 of file Array.hh.

◆ operator[]() [2/2]

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

Definition at line 150 of file Array.hh.

◆ pop_back()

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

Definition at line 178 of file Array.hh.

◆ size()

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

Definition at line 131 of file Array.hh.

◆ slice()

template<class T >
Tensor CASM::Tensor< T >::slice ( Array< Index slice_Ndim,
Array< Index slice_ind 
)

◆ swap_elem()

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

Definition at line 197 of file Array.hh.

Member Data Documentation

◆ idim

template<class T >
Array<Index> CASM::Tensor< T >::idim
private

Definition at line 34 of file Tensor.hh.

◆ max_ind

template<class T >
Array<Index> CASM::Tensor< T >::max_ind
private

Definition at line 34 of file Tensor.hh.

◆ N

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

Definition at line 53 of file Array.hh.

◆ Ndim

template<class T >
Array<Index> CASM::Tensor< T >::Ndim
private

Definition at line 34 of file Tensor.hh.

◆ NMax

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

Definition at line 54 of file Array.hh.

◆ Nrank

template<class T >
Index CASM::Tensor< T >::Nrank
private

Definition at line 33 of file Tensor.hh.

◆ Vals

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

Definition at line 55 of file Array.hh.


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