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