49 bool info(
unsigned inf)
const override;
50 size_t nops()
const override;
51 ex op(
size_t i)
const override;
254 exvector free_indices, dummy_indices;
256 return dummy_indices.size();
262 exvector free_indices, dummy_indices;
264 return free_indices.size();
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
This class is the ABC (abstract base class) of GiNaC's class hierarchy.
Wrapper template for making GiNaC classes out of STL containers.
Lightweight wrapper for GiNaC's symbolic objects.
This class holds one index of an indexed object.
ex map(map_function &f) const override
Construct new expression by applying the specified function to all sub-expressions (one level only,...
void print_index(const print_context &c, unsigned level) const
ex derivative(const symbol &s) const override
Implementation of ex::diff() for an index always returns 0.
ex dim
Dimension of space (can be symbolic or numeric)
idx(const ex &v, const ex &dim)
Construct index with given value and dimension.
void do_print_csrc(const print_csrc &c, unsigned level) const
bool is_dim_numeric() const
Check whether the dimension is numeric.
unsigned calchash() const override
Compute the hash value of an object and if it makes sense to store it in the objects status_flags,...
ex subs(const exmap &m, unsigned options=0) const override
Substitute a set of objects by arbitrary expressions.
ex replace_dim(const ex &new_dim) const
Make a new index with the same value but a different dimension.
ex op(size_t i) const override
Return operand/member at position i.
ex value
Expression that constitutes the index (numeric or symbolic name)
bool match_same_type(const basic &other) const override
Returns true if the attributes of two objects are similar enough for a match.
virtual bool is_dummy_pair_same_type(const basic &other) const
Check whether the index forms a dummy index pair with another index of the same type.
bool info(unsigned inf) const override
Information about the object.
ex get_dim() const
Get dimension of index space.
void do_print_latex(const print_latex &c, unsigned level) const
bool is_symbolic() const
Check whether the index is symbolic.
size_t nops() const override
Number of operands/members.
void do_print_tree(const print_tree &c, unsigned level) const
void read_archive(const archive_node &n, lst &syms) override
Load (deserialize) the object from an archive node.
ex minimal_dim(const idx &other) const
Return the minimum of the dimensions of this and another index.
void do_print(const print_context &c, unsigned level) const
ex get_value() const
Get value of index.
bool is_dim_symbolic() const
Check whether the dimension is symbolic.
void archive(archive_node &n) const override
Save (serialize) the object into archive node.
ex evalf() const override
By default, basic::evalf would evaluate the index value but we don't want a.1 to become a.
bool is_numeric() const
Check whether the index is numeric.
Base class for print_contexts.
Base context for C source output.
Context for latex-parsable output.
Context for tree-like output for debugging.
This class holds a spinor index that can be dotted or undotted and that also has a variance.
void read_archive(const archive_node &n, lst &syms) override
Load (deserialize) the object from an archive node.
void do_print_latex(const print_latex &c, unsigned level) const
void do_print(const print_context &c, unsigned level) const
void archive(archive_node &n) const override
Save (serialize) the object into archive node.
spinidx(const ex &v, const ex &dim=2, bool covariant=false, bool dotted=false)
Construct index with given value, dimension, variance and dot.
ex conjugate() const override
bool match_same_type(const basic &other) const override
Returns true if the attributes of two objects are similar enough for a match.
bool is_dotted() const
Check whether the index is dotted.
ex toggle_dot() const
Make a new index with the same value and variance but the opposite dottedness.
bool is_undotted() const
Check whether the index is not dotted.
bool is_dummy_pair_same_type(const basic &other) const override
Check whether the index forms a dummy index pair with another index of the same type.
void do_print_tree(const print_tree &c, unsigned level) const
ex toggle_variance_dot() const
Make a new index with the same value but opposite variance and dottedness.
This class holds an index with a variance (co- or contravariant).
void read_archive(const archive_node &n, lst &syms) override
Load (deserialize) the object from an archive node.
bool is_dummy_pair_same_type(const basic &other) const override
Check whether the index forms a dummy index pair with another index of the same type.
varidx(const ex &v, const ex &dim, bool covariant=false)
Construct index with given value, dimension and variance.
void do_print(const print_context &c, unsigned level) const
void archive(archive_node &n) const override
Save (serialize) the object into archive node.
bool match_same_type(const basic &other) const override
Returns true if the attributes of two objects are similar enough for a match.
bool is_covariant() const
Check whether the index is covariant.
bool covariant
x.mu, default is contravariant: x~mu
void do_print_tree(const print_tree &c, unsigned level) const
bool is_contravariant() const
Check whether the index is contravariant (not covariant).
ex toggle_variance() const
Make a new index with the same value but the opposite variance.
Interface to GiNaC's light-weight expression handles.
ex minimal_dim(const ex &dim1, const ex &dim2)
Return the minimum of two index dimensions.
std::map< ex, ex, ex_is_less > exmap
GINAC_DECLARE_UNARCHIVER(add)
size_t count_dummy_indices(const exvector &v)
Count the number of dummy index pairs in an index vector.
bool is_dummy_pair(const idx &i1, const idx &i2)
Check whether two indices form a dummy pair.
size_t count_free_indices(const exvector &v)
Count the number of dummy index pairs in an index vector.
void find_dummy_indices(const exvector &v, exvector &out_dummy)
Given a vector of indices, find the dummy indices.
void find_free_and_dummy(exvector::const_iterator it, exvector::const_iterator itend, exvector &out_free, exvector &out_dummy)
Given a vector of indices, split them into two vectors, one containing the free indices,...
std::vector< ex > exvector
Makes the interface to the underlying bignum package available.
#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the declaration of each registered class.
Function object for map().