3 * Interface to GiNaC's index carrying objects. */
15 /** Base class for non-commutative indexed objects */
16 class indexed : public exprseq
20 // default constructor, destructor, copy constructor assignment operator and helpers
24 indexed(indexed const & other);
25 indexed const & operator=(indexed const & other);
27 void copy(indexed const & other);
28 void destroy(bool call_parent);
32 indexed(ex const & i1);
33 indexed(ex const & i1, ex const & i2);
34 indexed(ex const & i1, ex const & i2, ex const & i3);
35 indexed(exvector const & iv);
36 indexed(exvector * iv);
38 // functions overriding virtual functions from base classes
40 basic * duplicate() const;
41 void printraw(ostream & os) const;
42 void printtree(ostream & os, unsigned indent) const;
43 void print(ostream & os, unsigned upper_precedence=0) const;
44 void printcsrc(ostream & os, unsigned type, unsigned upper_precedence) const;
45 bool info(unsigned inf) const;
46 ex diff(symbol const & s) const;
47 exvector get_indices(void) const;
49 int compare_same_type(basic const & other) const;
50 bool is_equal_same_type(basic const & other) const;
51 unsigned return_type(void) const;
52 unsigned return_type_tinfo(void) const;
53 ex thisexprseq(exvector const & v) const;
54 ex thisexprseq(exvector * vp) const;
56 // new virtual functions which can be overridden by derived classes
59 // non-virtual functions in this class
61 void printrawindices(ostream & os) const;
62 void printtreeindices(ostream & os, unsigned indent) const;
63 void printindices(ostream & os) const;
64 bool all_of_type_idx(void) const;
72 extern const indexed some_indexed;
73 extern type_info const & typeid_indexed;
77 #define ex_to_indexed(X) static_cast<indexed const &>(*(X).bp)
79 #endif // ndef _INDEXED_H_