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