]> www.ginac.de Git - ginac.git/blob - ginac/exprseq.h
179cfbde767e83d6357838eb7c5a151a73ab3766
[ginac.git] / ginac / exprseq.h
1 /** @file exprseq.h
2  *
3  *  Definition of GiNaC's exprseq. 
4  *  This file was generated automatically by container.pl.
5  *  Please do not modify it directly, edit the perl script instead!
6  *  container.pl options: $CONTAINER=exprseq
7  *                        $STLHEADER=vector
8  *                        $reserve=1
9  *                        $prepend=0
10  *                        $let_op=0
11  *                        $open_bracket=(
12  *                        $close_bracket=) */
13
14 /*
15  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
16  *
17  *  This program is free software; you can redistribute it and/or modify
18  *  it under the terms of the GNU General Public License as published by
19  *  the Free Software Foundation; either version 2 of the License, or
20  *  (at your option) any later version.
21  *
22  *  This program is distributed in the hope that it will be useful,
23  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
24  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  *  GNU General Public License for more details.
26  *
27  *  You should have received a copy of the GNU General Public License
28  *  along with this program; if not, write to the Free Software
29  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
30  */
31
32 #ifndef __GINAC_EXPRSEQ_H__
33 #define __GINAC_EXPRSEQ_H__
34
35 #include <vector>
36 #include <ginac/basic.h>
37
38 typedef vector<ex> exvector;
39
40 class exprseq : public basic
41 {
42
43 public:
44     exprseq();
45     ~exprseq();
46     exprseq(exprseq const & other);
47     exprseq const & operator=(exprseq const & other);
48 protected:
49     void copy(exprseq const & other);
50     void destroy(bool call_parent);
51
52 public:
53     exprseq(exvector const & s, bool discardable=0);
54     exprseq(exvector * vp); // vp will be deleted
55     explicit exprseq(ex const & e1);
56     explicit exprseq(ex const & e1, ex const & e2);
57     explicit exprseq(ex const & e1, ex const & e2, ex const & e3);
58     explicit exprseq(ex const & e1, ex const & e2, ex const & e3,
59              ex const & e4);
60     explicit exprseq(ex const & e1, ex const & e2, ex const & e3,
61              ex const & e4, ex const & e5);
62     explicit exprseq(ex const & e1, ex const & e2, ex const & e3,
63              ex const & e4, ex const & e5, ex const & e6);
64     explicit exprseq(ex const & e1, ex const & e2, ex const & e3,
65              ex const & e4, ex const & e5, ex const & e6,
66              ex const & e7);
67     explicit exprseq(ex const & e1, ex const & e2, ex const & e3,
68              ex const & e4, ex const & e5, ex const & e6,
69              ex const & e7, ex const & e8);
70     explicit exprseq(ex const & e1, ex const & e2, ex const & e3,
71              ex const & e4, ex const & e5, ex const & e6,
72              ex const & e7, ex const & e8, ex const & e9);
73     explicit exprseq(ex const & e1, ex const & e2, ex const & e3,
74              ex const & e4, ex const & e5, ex const & e6,
75              ex const & e7, ex const & e8, ex const & e9,
76              ex const &e10);
77
78 public:
79     basic * duplicate() const;
80     void printraw(ostream & os) const;
81     void print(ostream & os, unsigned upper_precedence=0) const;
82     void printtree(ostream & os, unsigned indent) const;
83     bool info(unsigned inf) const;
84     int nops() const;
85     ex & let_op(int const i);
86     ex expand(unsigned options=0) const;
87     bool has(ex const & other) const;
88     ex eval(int level=0) const;
89     ex evalf(int level=0) const;
90     ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
91     ex diff(symbol const & s) const;
92     ex subs(lst const & ls, lst const & lr) const;
93 protected:
94     int compare_same_type(basic const & other) const;
95     bool is_equal_same_type(basic const & other) const;
96     unsigned return_type(void) const;
97
98     // new virtual functions which can be overridden by derived classes
99 public:
100     virtual exprseq & append(ex const & b);
101     // no prepend possible for exprseq
102 protected:
103     virtual void printseq(ostream & os, char openbracket, char delim,
104                           char closebracket, unsigned this_precedence,
105                           unsigned upper_precedence=0) const;
106     virtual ex thisexprseq(exvector const & v) const;
107     virtual ex thisexprseq(exvector * vp) const;
108
109 protected:
110     bool is_canonical() const;
111     exvector evalchildren(int level) const;
112     exvector evalfchildren(int level) const;
113     exvector normalchildren(int level) const;
114     exvector diffchildren(symbol const & s) const;
115     exvector * subschildren(lst const & ls, lst const & lr) const;
116
117 protected:
118     exvector seq;
119     static unsigned precedence;
120 };
121
122 // global constants
123
124 extern const exprseq some_exprseq;
125 extern type_info const & typeid_exprseq;
126
127 // macros
128
129 #define ex_to_exprseq(X) (static_cast<exprseq const &>(*(X).bp))
130
131 #endif // ndef __GINAC_EXPRSEQ_H__
132