]> www.ginac.de Git - ginac.git/blob - ginac/flags.h
* shift stuff into CVS before I start breaking things. :-)
[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                 expand_indexed = 0x0002
33         };
34 };
35
36 /** Flags to control series expansion. */
37 class series_options {
38 public:
39         enum {
40                 suppress_branchcut = 0x0001
41         };
42 };
43
44 /** Switch to control algorithm for determinant computation. */
45 class determinant_algo {
46 public:
47         enum {
48                 automatic,                      ///< Let the system choose
49                 gauss,                          ///< Gauss elimiation
50                 divfree,                        ///< Division-free elimination
51                 laplace,                        ///< Laplace (or minor) elimination
52                 bareiss                         ///< Bareiss fraction-free elimination
53         };
54 };
55
56 /** Switch to control algorithm for linear system solving. */
57 class solve_algo {
58 public:
59         enum {
60                 automatic,                      ///< Let the system choose
61                 gauss,                          ///< Gauss elimiation
62                 divfree,                        ///< Division-free elimination
63                 bareiss                         ///< Bareiss fraction-free elimination
64         };
65 };
66
67 /** Flags to store information about the state of an object.
68  *  @see basic::flags */
69 class status_flags {
70 public:
71         enum {
72                 dynallocated    = 0x0001,       ///< Heap-allocated (i.e. created by new if we want to be clever and bypass the stack, @see ex::construct_from_basic() )
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 };
135
136 class return_types {
137 public:
138         enum {
139                 commutative,
140                 noncommutative,
141                 noncommutative_composite
142         };
143 };
144
145 /** Strategies how to clean up the function remember cache.
146  *  @see remember_table */
147 class remember_strategies {
148 public:
149         enum {
150                 delete_never,   ///< Let table grow undefinitely
151                 delete_lru,     ///< Least recently used
152                 delete_lfu,     ///< Least frequently used
153                 delete_cyclic   ///< First (oldest) one in list
154         };
155 };
156
157 } // namespace GiNaC
158
159 #endif // ndef __GINAC_FLAGS_H__