]> www.ginac.de Git - ginac.git/blob - ginac/lst.h
- modified the comment blocks so the copyright message no longer appears in
[ginac.git] / ginac / lst.h
1 /** @file lst.h
2  *
3  *  Definition of GiNaC's lst. 
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=lst
7  *                        $STLHEADER=list
8  *                        $reserve=0
9  *                        $prepend=1
10  *                        $let_op=1
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_LST_H__
33 #define __GINAC_LST_H__
34
35 #include <list>
36 #include <ginac/basic.h>
37
38 typedef list<ex> exlist;
39
40 class lst : public basic
41 {
42
43 public:
44     lst();
45     ~lst();
46     lst(lst const & other);
47     lst const & operator=(lst const & other);
48 protected:
49     void copy(lst const & other);
50     void destroy(bool call_parent);
51
52 public:
53     lst(exlist const & s, bool discardable=0);
54     lst(exlist * vp); // vp will be deleted
55     explicit lst(ex const & e1);
56     explicit lst(ex const & e1, ex const & e2);
57     explicit lst(ex const & e1, ex const & e2, ex const & e3);
58     explicit lst(ex const & e1, ex const & e2, ex const & e3,
59              ex const & e4);
60     explicit lst(ex const & e1, ex const & e2, ex const & e3,
61              ex const & e4, ex const & e5);
62     explicit lst(ex const & e1, ex const & e2, ex const & e3,
63              ex const & e4, ex const & e5, ex const & e6);
64     explicit lst(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 lst(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 lst(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 lst(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 lst & append(ex const & b);
101     virtual lst & prepend(ex const & b);
102
103 protected:
104     virtual void printseq(ostream & os, char openbracket, char delim,
105                           char closebracket, unsigned this_precedence,
106                           unsigned upper_precedence=0) const;
107     virtual ex thislst(exlist const & v) const;
108     virtual ex thislst(exlist * vp) const;
109
110 protected:
111     bool is_canonical() const;
112     exlist evalchildren(int level) const;
113     exlist evalfchildren(int level) const;
114     exlist normalchildren(int level) const;
115     exlist diffchildren(symbol const & s) const;
116     exlist * subschildren(lst const & ls, lst const & lr) const;
117
118 protected:
119     exlist seq;
120     static unsigned precedence;
121 };
122
123 // global constants
124
125 extern const lst some_lst;
126 extern type_info const & typeid_lst;
127
128 // macros
129
130 #define ex_to_lst(X) (static_cast<lst const &>(*(X).bp))
131
132 #endif // ndef __GINAC_LST_H__
133