Cadabra
Computer algebra system for field theory problems
Public Types | Public Member Functions | Private Attributes | List of all members
cadabra::Adjform Class Reference

Description

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
 

Member Typedef Documentation

◆ array_type

◆ const_iterator

using cadabra::Adjform::const_iterator = array_type::const_iterator

◆ const_reference

using cadabra::Adjform::const_reference = array_type::const_reference

◆ difference_type

◆ size_type

◆ value_type

The maximal number of index slots is set by value_type: for a short, the maximal number of slots is 127.

Constructor & Destructor Documentation

◆ Adjform() [1/3]

cadabra::Adjform::Adjform ( )

◆ Adjform() [2/3]

template<typename IndexIterator >
cadabra::Adjform::Adjform ( IndexIterator  beg,
IndexIterator  end,
IndexMap index_map,
const Kernel kernel 
)

◆ Adjform() [3/3]

template<typename ValueIterator >
cadabra::Adjform::Adjform ( ValueIterator  beg,
ValueIterator  end,
bool  push_as_coordinates 
)

Member Function Documentation

◆ begin()

Adjform::const_iterator cadabra::Adjform::begin ( ) const

◆ empty()

bool cadabra::Adjform::empty ( ) const

◆ end()

Adjform::const_iterator cadabra::Adjform::end ( ) const

◆ index_of()

Adjform::size_type cadabra::Adjform::index_of ( value_type  index,
size_type  offset = 0 
) const

◆ is_dummy_index()

bool cadabra::Adjform::is_dummy_index ( Adjform::size_type  pos) const

◆ is_free_index()

bool cadabra::Adjform::is_free_index ( Adjform::size_type  pos) const

◆ max_lehmer_code()

uint64_t cadabra::Adjform::max_lehmer_code ( ) const

◆ max_size()

Adjform::size_type cadabra::Adjform::max_size ( ) const

◆ n_dummy_indices()

Adjform::size_type cadabra::Adjform::n_dummy_indices ( ) const

◆ n_free_indices()

Adjform::size_type cadabra::Adjform::n_free_indices ( ) const

◆ operator!=()

bool cadabra::Adjform::operator!= ( const Adjform other) const

◆ operator<()

bool cadabra::Adjform::operator< ( const Adjform other) const

◆ operator==()

bool cadabra::Adjform::operator== ( const Adjform other) const

◆ operator[]()

Adjform::const_reference cadabra::Adjform::operator[] ( Adjform::size_type  idx) const

◆ push()

void cadabra::Adjform::push ( Ex::iterator  iterator,
IndexMap index_map,
const Kernel kernel 
)

◆ push_coordinate()

void cadabra::Adjform::push_coordinate ( value_type  value)

◆ push_coordinates()

void cadabra::Adjform::push_coordinates ( const Adjform other)

◆ push_index()

void cadabra::Adjform::push_index ( value_type  value)

◆ push_indices()

void cadabra::Adjform::push_indices ( const Adjform other)

◆ resolve_dummy()

bool cadabra::Adjform::resolve_dummy ( value_type  value)

◆ rotate()

void cadabra::Adjform::rotate ( size_type  n)

◆ size()

Adjform::size_type cadabra::Adjform::size ( ) const

◆ sort()

void cadabra::Adjform::sort ( )

◆ swap()

void cadabra::Adjform::swap ( size_type  a,
size_type  b 
)

◆ to_lehmer_code()

uint64_t cadabra::Adjform::to_lehmer_code ( ) const

◆ to_string()

std::string cadabra::Adjform::to_string ( ) const

Member Data Documentation

◆ data

array_type cadabra::Adjform::data
private

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