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