]> www.ginac.de Git - ginac.git/blob - ginac/flags.h
- added idx::replace_dim() and idx::minimal_dim()
[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-2002 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                 expand_function_args = 0x0004
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 state of an object.
69  *  @see basic::flags */
70 class status_flags {
71 public:
72         enum {
73                 dynallocated    = 0x0001,       ///< Heap-allocated (i.e. created by new if we want to be clever and bypass the stack, @see ex::construct_from_basic() )
74                 evaluated       = 0x0002,       ///< .eval() has already done its job
75                 expanded        = 0x0004,       ///< .expand(0) has already done its job (other expand() options ignore this flag)
76                 hash_calculated = 0x0008        ///< .calchash() has already done its job
77         };
78 };
79
80 /** Possible attributes an object can have. */
81 class info_flags {
82 public:
83         enum {
84                 // answered by class numeric
85                 numeric,
86                 real,
87                 rational,
88                 integer,
89                 crational,
90                 cinteger,
91                 positive,
92                 negative,
93                 nonnegative,
94                 posint,
95                 negint,
96                 nonnegint,
97                 even,
98                 odd,
99                 prime,
100
101                 // answered by class relation
102                 relation,
103                 relation_equal,
104                 relation_not_equal,
105                 relation_less,
106                 relation_less_or_equal,
107                 relation_greater,
108                 relation_greater_or_equal,
109
110                 // answered by class symbol
111                 symbol,
112
113                 // answered by class lst
114                 list,
115
116                 // answered by class exprseq
117                 exprseq,
118
119                 // answered by classes numeric, symbol, add, mul, power
120                 polynomial,
121                 integer_polynomial,
122                 cinteger_polynomial,
123                 rational_polynomial,
124                 crational_polynomial,
125                 rational_function,
126                 algebraic,
127
128                 // answered by class indexed
129                 indexed,      // class can carry indices
130                 has_indices,  // object has at least one index
131
132                 // answered by class idx
133                 idx
134         };
135 };
136
137 class return_types {
138 public:
139         enum {
140                 commutative,
141                 noncommutative,
142                 noncommutative_composite
143         };
144 };
145
146 /** Strategies how to clean up the function remember cache.
147  *  @see remember_table */
148 class remember_strategies {
149 public:
150         enum {
151                 delete_never,   ///< Let table grow undefinitely
152                 delete_lru,     ///< Least recently used
153                 delete_lfu,     ///< Least frequently used
154                 delete_cyclic   ///< First (oldest) one in list
155         };
156 };
157
158 } // namespace GiNaC
159
160 #endif // ndef __GINAC_FLAGS_H__