Cadabra
Computer algebra system for field theory problems
|
Representation of the index structure of a tensor monomial, using a storage format which resembles an adjacency matrix.
The structure is stored as a vector of integers. Negative integers denote free indices. Positive indices denote a contraction with an index at the indicated position.
Example:
A_{m n} B_{p n} -> -1 3 -2 1 0 1 2 3
The tensor names themselves ('A' and 'B' above) are not stored.
#include <Adjform.hh>
Public Types | |
using | value_type = short |
The maximal number of index slots is set by value_type : for a short, the maximal number of slots is 127. More... | |
using | size_type = value_type |
using | difference_type = value_type |
using | array_type = std::vector< value_type > |
using | const_reference = array_type::const_reference |
using | const_iterator = array_type::const_iterator |
Public Member Functions | |
Adjform () | |
template<typename IndexIterator > | |
Adjform (IndexIterator beg, IndexIterator end, IndexMap &index_map, const Kernel &kernel) | |
template<typename ValueIterator > | |
Adjform (ValueIterator beg, ValueIterator end, bool push_as_coordinates) | |
const_iterator | begin () const |
const_iterator | end () const |
size_type | index_of (value_type index, size_type offset=0) const |
bool | operator< (const Adjform &other) const |
bool | operator== (const Adjform &other) const |
bool | operator!= (const Adjform &other) const |
const_reference | operator[] (size_type idx) const |
size_type | size () const |
size_type | max_size () const |
bool | empty () const |
bool | is_free_index (size_type pos) const |
bool | is_dummy_index (size_type pos) const |
size_type | n_free_indices () const |
size_type | n_dummy_indices () const |
bool | resolve_dummy (value_type value) |
void | push_index (value_type value) |
void | push_indices (const Adjform &other) |
void | push_coordinate (value_type value) |
void | push_coordinates (const Adjform &other) |
void | push (Ex::iterator iterator, IndexMap &index_map, const Kernel &kernel) |
void | swap (size_type a, size_type b) |
void | rotate (size_type n) |
void | sort () |
uint64_t | to_lehmer_code () const |
uint64_t | max_lehmer_code () const |
std::string | to_string () const |
Private Attributes | |
array_type | data |
using cadabra::Adjform::array_type = std::vector<value_type> |
using cadabra::Adjform::const_iterator = array_type::const_iterator |
using cadabra::Adjform::const_reference = array_type::const_reference |
using cadabra::Adjform::value_type = short |
The maximal number of index slots is set by value_type
: for a short, the maximal number of slots is 127.
cadabra::Adjform::Adjform | ( | ) |
cadabra::Adjform::Adjform | ( | IndexIterator | beg, |
IndexIterator | end, | ||
IndexMap & | index_map, | ||
const Kernel & | kernel | ||
) |
cadabra::Adjform::Adjform | ( | ValueIterator | beg, |
ValueIterator | end, | ||
bool | push_as_coordinates | ||
) |
Adjform::const_iterator cadabra::Adjform::begin | ( | ) | const |
bool cadabra::Adjform::empty | ( | ) | const |
Adjform::const_iterator cadabra::Adjform::end | ( | ) | const |
Adjform::size_type cadabra::Adjform::index_of | ( | value_type | index, |
size_type | offset = 0 |
||
) | const |
bool cadabra::Adjform::is_dummy_index | ( | Adjform::size_type | pos | ) | const |
bool cadabra::Adjform::is_free_index | ( | Adjform::size_type | pos | ) | const |
uint64_t cadabra::Adjform::max_lehmer_code | ( | ) | const |
Adjform::size_type cadabra::Adjform::max_size | ( | ) | const |
Adjform::size_type cadabra::Adjform::n_dummy_indices | ( | ) | const |
Adjform::size_type cadabra::Adjform::n_free_indices | ( | ) | const |
bool cadabra::Adjform::operator!= | ( | const Adjform & | other | ) | const |
bool cadabra::Adjform::operator< | ( | const Adjform & | other | ) | const |
bool cadabra::Adjform::operator== | ( | const Adjform & | other | ) | const |
Adjform::const_reference cadabra::Adjform::operator[] | ( | Adjform::size_type | idx | ) | const |
void cadabra::Adjform::push_coordinate | ( | value_type | value | ) |
void cadabra::Adjform::push_coordinates | ( | const Adjform & | other | ) |
void cadabra::Adjform::push_index | ( | value_type | value | ) |
void cadabra::Adjform::push_indices | ( | const Adjform & | other | ) |
bool cadabra::Adjform::resolve_dummy | ( | value_type | value | ) |
void cadabra::Adjform::rotate | ( | size_type | n | ) |
Adjform::size_type cadabra::Adjform::size | ( | ) | const |
void cadabra::Adjform::sort | ( | ) |
uint64_t cadabra::Adjform::to_lehmer_code | ( | ) | const |
std::string cadabra::Adjform::to_string | ( | ) | const |
|
private |