]> www.ginac.de Git - ginac.git/blob - ginac/flags.h
93506f107d9adb125db7231d664143653727b4a2
[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 namespace GiNaC {
27
28 class expand_options {
29 public:
30         enum {
31                 expand_trigonometric = 0x0001
32         };
33 };
34
35 /** Flags to control series expansion. */
36 class series_options {
37 public:
38         enum {
39                 suppress_branchcut = 0x0001
40         };
41 };
42
43 /** Switch to control algorithm for determinant computation. */
44 class determinant_algo {
45 public:
46         enum {
47                 automatic,                      ///< Let the system choose
48                 gauss,                          ///< Gauss elimiation
49                 divfree,                        ///< Division-free elimination
50                 laplace,                        ///< Laplace (or minor) elimination
51                 bareiss                         ///< Bareiss fraction-free elimination
52         };
53 };
54
55 /** Switch to control algorithm for linear system solving. */
56 class solve_algo {
57 public:
58         enum {
59                 automatic,                      ///< Let the system choose
60                 gauss,                          ///< Gauss elimiation
61                 divfree,                        ///< Division-free elimination
62                 bareiss                         ///< Bareiss fraction-free elimination
63         };
64 };
65
66 /** Flags to store information about the state of an object.
67  *  @see basic::flags */
68 class status_flags {
69 public:
70         enum {
71                 dynallocated    = 0x0001,       ///< Heap-allocated (i.e. created by new if we want to be clever and bypass the stack)
72                 evaluated       = 0x0002,       ///< .eval() has already done its job
73                 expanded        = 0x0004,       ///< .expand() has already done its job
74                 hash_calculated = 0x0008        ///< .calchash() has already done its job
75         };
76 };
77
78 /** Possible attributes an object can have. */
79 class info_flags {
80 public:
81         enum {
82                 // answered by class numeric
83                 numeric,
84                 real,
85                 rational,
86                 integer,
87                 crational,
88                 cinteger,
89                 positive,
90                 negative,
91                 nonnegative,
92                 posint,
93                 negint,
94                 nonnegint,
95                 even,
96                 odd,
97                 prime,
98
99                 // answered by class relation
100                 relation,
101                 relation_equal,
102                 relation_not_equal,
103                 relation_less,
104                 relation_less_or_equal,
105                 relation_greater,
106                 relation_greater_or_equal,
107
108                 // answered by class symbol
109                 symbol,
110
111                 // answered by class lst
112                 list,
113
114                 // answered by class exprseq
115                 exprseq,
116
117                 // answered by classes numeric, symbol, add, mul, power
118                 polynomial,
119                 integer_polynomial,
120                 cinteger_polynomial,
121                 rational_polynomial,
122                 crational_polynomial,
123                 rational_function,
124                 algebraic,
125
126                 // answered by class indexed
127                 indexed,      // class can carry indices
128                 has_indices,  // object has at least one index
129
130                 // answered by class idx
131                 idx,
132
133                 // answered by class coloridx
134                 coloridx,
135
136                 // answered by class lorentzidx
137                 lorentzidx
138         };
139 };
140
141 class return_types {
142 public:
143         enum {
144                 commutative,
145                 noncommutative,
146                 noncommutative_composite
147         };
148 };
149
150 class csrc_types {
151 public:
152         enum {
153                 ctype_float,
154                 ctype_double,
155                 ctype_cl_N
156         };
157 };
158
159 /** Strategies how to clean up the function remember cache.
160  *  @see remember_table */
161 class remember_strategies {
162 public:
163         enum {
164                 delete_never,   ///< Let table grow undefinitely
165                 delete_lru,     ///< Least recently used
166                 delete_lfu,     ///< Least frequently used
167                 delete_cyclic   ///< First (oldest) one in list
168         };
169 };
170
171 } // namespace GiNaC
172
173 #endif // ndef __GINAC_FLAGS_H__