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