]> www.ginac.de Git - ginac.git/blob - ginac/indexed.h
- switched to automake build environment
[ginac.git] / ginac / indexed.h
1 /** @file indexed.h
2  *
3  *  Interface to GiNaC's index carrying objects. */
4
5 #ifndef _INDEXED_H_
6 #define _INDEXED_H_
7
8 #include <string>
9
10 class indexed;
11
12 #include "exprseq.h"
13 #include "idx.h"
14
15 /** Base class for non-commutative indexed objects */
16 class indexed : public exprseq
17 {
18 // member functions
19
20     // default constructor, destructor, copy constructor assignment operator and helpers
21 public:
22     indexed();
23     ~indexed();
24     indexed(indexed const & other);
25     indexed const & operator=(indexed const & other);
26 protected:
27     void copy(indexed const & other); 
28     void destroy(bool call_parent);
29
30     // other constructors
31 public:
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);
37
38     // functions overriding virtual functions from base classes
39 public:
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;
48 protected:
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;
55
56     // new virtual functions which can be overridden by derived classes
57     // none
58     
59     // non-virtual functions in this class
60 protected:
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;
65
66 // member variables
67     // none
68 };
69
70 // global constants
71
72 extern const indexed some_indexed;
73 extern type_info const & typeid_indexed;
74
75 // macros
76
77 #define ex_to_indexed(X) static_cast<indexed const &>(*(X).bp)
78
79 #endif // ndef _INDEXED_H_
80
81