Cadabra
Computer algebra system for field theory problems
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Modules | Namespaces | Classes | Functions
Core

Module Description

All computer algebra functionality in the form of C++ classes.

Modules

 Cleanup
 Functionality to clean up expressions so that they satisfy the requirements of a consistent expression tree.
 
 Expression display
 Classes to handle printing of expressions in various formats.
 
 Expression comparison
 Functions to compare and match expressions stored in Ex objects.
 
 Python Core
 Python wrapper around the C++ core module, making the entire functionality of Cadabra accessible from Python.
 
 Scalar algebra
 Functionality to make Cadabra interface with the scalar computer algebra systems (e.g.
 
 Algorithms
 Containing all algorithms acting on symbolic expression trees.
 
 Properties
 Containing all properties that can be attached to symbolic expressions.
 

Namespaces

 cadabra
 Functions to handle the exchange properties of two or more symbols in a product.
 

Classes

class  cadabra::Algorithm
 Base class for all algorithms, containing generic routines and in particular the logic for index classification. More...
 
class  cadabra::Ex_is_equivalent
 Basic comparison operator for tree iterators, so we can use them as keys in maps. More...
 
class  cadabra::index_iterator
 An iterator which iterates over indices even if they are at lower levels, i.e. More...
 
class  PermutationException
 Generic permutation group material. More...
 
class  preprocessor
 Preprocessing class which takes infix mathematical notation with all sorts of maths shortcuts and transforms it into a string which is properly formatted in prefix notation. More...
 
class  cadabra::property
 Base class for all properties, handling argument parsing and defining the interface. More...
 
class  cadabra::Properties
 Class holding a collection of properties attached to expressions. More...
 
class  cadabra::str_node
 Elementary building block for a mathematical expression. More...
 
class  cadabra::Ex
 Basic storage class for symbolic mathemematical expressions. More...
 
class  cadabra::nset_it_less
 Compare two nset iterators by comparing the strings to which they point. More...
 
class  cadabra::DependsBase
 

Functions

void cadabra::do_list (const Ex &tr, Ex::iterator it, std::function< bool(Ex::iterator)> f)
 Apply a function on every element of a list, or if the iterator 'it' does not point to a list, only on that single element. More...
 
int cadabra::list_size (const Ex &tr, Ex::iterator it)
 For lists as defined above for 'do_list', return their size (in case you really need to know the size before iterating over the elements). More...
 
Ex::iterator cadabra::do_subtree (const Ex &tr, Ex::iterator it, std::function< Ex::iterator(Ex::iterator)> f)
 Apply a function on every node in the tree at and below the given node, depth-first. More...
 
Ex::iterator cadabra::find_in_list (const Ex &tr, Ex::iterator it, std::function< Ex::iterator(Ex::iterator)> f)
 Returns an iterator to the first element for which 'f' does not return tr.end(). More...
 
Ex::iterator cadabra::find_in_subtree (const Ex &tr, Ex::iterator it, std::function< bool(Ex::iterator)> f, bool including_head=true)
 Returns an iterator to the first element for which 'f' returns 'true', or 'tr.end()'. More...
 
Ex cadabra::make_list (Ex el)
 Ensure that the tree is a list, even if it contains only a single element. More...
 
void cadabra::multiply (rset_t::iterator &, multiplier_t)
 Helper functions for manipulation of multipliers. More...
 
std::ostream & operator<< (std::ostream &, const cadabra::Ex &)
 Bare output operator for Ex objects, mainly to provide a simple way to generate debugging output. More...
 

Function Documentation

void cadabra::do_list ( const Ex &  tr,
Ex::iterator  it,
std::function< bool(Ex::iterator)>  f 
)

Apply a function on every element of a list, or if the iterator 'it' does not point to a list, only on that single element.

Handles lists wrapped in an node as well. It is safe to remove the node pointed to by 'it' in 'f'. If your 'f' returns false, the loop is aborted immediately.

Ex::iterator cadabra::do_subtree ( const Ex &  tr,
Ex::iterator  it,
std::function< Ex::iterator(Ex::iterator)>  f 
)

Apply a function on every node in the tree at and below the given node, depth-first.

Return an iterator to the top node, which replaces 'it' (may be the same).

Ex::iterator cadabra::find_in_list ( const Ex &  tr,
Ex::iterator  it,
std::function< Ex::iterator(Ex::iterator)>  f 
)

Returns an iterator to the first element for which 'f' does not return tr.end().

Ex::iterator cadabra::find_in_subtree ( const Ex &  tr,
Ex::iterator  it,
std::function< bool(Ex::iterator)>  f,
bool  including_head = true 
)

Returns an iterator to the first element for which 'f' returns 'true', or 'tr.end()'.

int cadabra::list_size ( const Ex &  tr,
Ex::iterator  it 
)

For lists as defined above for 'do_list', return their size (in case you really need to know the size before iterating over the elements).

Ex cadabra::make_list ( Ex  el)

Ensure that the tree is a list, even if it contains only a single element.

void cadabra::multiply ( rset_t::iterator &  ,
multiplier_t   
)

Helper functions for manipulation of multipliers.

std::ostream& operator<< ( std::ostream &  ,
const cadabra::Ex  
)

Bare output operator for Ex objects, mainly to provide a simple way to generate debugging output.

Does not do any fancy formatting; just prints a nested list representation. For more fancy output, look at DisplayTeX, DisplaySympy and DisplayTerminal.