]> www.ginac.de Git - ginac.git/blob - ginac/flags.h
pseries::expand(): do not generate zero terms.
[ginac.git] / ginac / flags.h
1 /** @file flags.h
2  *
3  *  Collection of all flags used through the GiNaC framework. */
4
5 /*
6  *  GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef __GINAC_FLAGS_H__
24 #define __GINAC_FLAGS_H__
25
26 #ifndef NO_NAMESPACE_GINAC
27 namespace GiNaC {
28 #endif // ndef NO_NAMESPACE_GINAC
29
30 class expand_options {
31 public:
32         enum {
33                 expand_trigonometric = 0x0001
34         };
35 };
36
37 /** Flags to control series expansion. */
38 class series_options {
39 public:
40         enum {
41                 suppress_branchcut = 0x0001
42         };
43 };
44
45 /** Switch to control algorithm for determinant computation. */
46 class determinant_algo {
47 public:
48         enum {
49                 automatic,                      //! Let the system choose
50                 gauss,                          //! Gauss elimiation
51                 divfree,                        //! Division-free elimination
52                 laplace,                        //! Laplace (or minor) elimination
53                 bareiss                         //! Bareiss fraction-free elimination
54         };
55 };
56
57 /** Switch to control algorithm for linear system solving. */
58 class solve_algo {
59 public:
60         enum {
61                 automatic,                      //! Let the system choose
62                 gauss,                          //! Gauss elimiation
63                 divfree,                        //! Division-free elimination
64                 bareiss                         //! Bareiss fraction-free elimination
65         };
66 };
67
68 /** Flags to store information about the stato of an object. */
69 class status_flags {
70 public:
71         enum {
72                 dynallocated    = 0x0001,       //! Heap-allocated (i.e. created by new)
73                 evaluated       = 0x0002,       //! .eval() has already done its job
74                 expanded        = 0x0004,       //! .expand() has already done its job
75                 hash_calculated = 0x0008        //! .calchash() has already done its job
76         };
77 };
78
79 /** Possible attributes an object can have. */
80 class info_flags {
81 public:
82         enum {
83                 // answered by class numeric
84                 numeric,
85                 real,
86                 rational,
87                 integer,
88                 crational,
89                 cinteger,
90                 positive,
91                 negative,
92                 nonnegative,
93                 posint,
94                 negint,
95                 nonnegint,
96                 even,
97                 odd,
98                 prime,
99
100                 // answered by class relation
101                 relation,
102                 relation_equal,
103                 relation_not_equal,
104                 relation_less,
105                 relation_less_or_equal,
106                 relation_greater,
107                 relation_greater_or_equal,
108
109                 // answered by class symbol
110                 symbol,
111
112                 // answered by class lst
113                 list,
114
115                 // answered by class exprseq
116                 exprseq,
117
118                 // answered by classes numeric, symbol, add, mul, power
119                 polynomial,
120                 integer_polynomial,
121                 cinteger_polynomial,
122                 rational_polynomial,
123                 crational_polynomial,
124                 rational_function,
125                 algebraic,
126
127                 // answered by class indexed
128                 indexed,      // class can carry indices
129                 has_indices,  // object has at least one index
130
131                 // answered by class idx
132                 idx,
133
134                 // answered by class coloridx
135                 coloridx,
136
137                 // answered by class lorentzidx
138                 lorentzidx
139         };
140 };
141
142 class return_types {
143 public:
144         enum {
145                 commutative,
146                 noncommutative,
147                 noncommutative_composite
148         };
149 };
150
151 class csrc_types {
152 public:
153         enum {
154                 ctype_float,
155                 ctype_double,
156                 ctype_cl_N
157         };
158 };
159
160 /** Strategies how to clean up the function remember cache.
161  *  @see remember_table */
162 class remember_strategies {
163 public:
164         enum {
165                 delete_never,   //! Let table grow undefinitely, not recommmended, but currently default
166                 delete_lru,     //! Least recently used
167                 delete_lfu,     //! Least frequently used
168                 delete_cyclic   //! First (oldest) one in list
169         };
170 };
171
172 #ifndef NO_NAMESPACE_GINAC
173 } // namespace GiNaC
174 #endif // ndef NO_NAMESPACE_GINAC
175
176 #endif // ndef __GINAC_FLAGS_H__