MPSolve 3.2.1
Loading...
Searching...
No Matches
options.h
Go to the documentation of this file.
1/*
2 * This file is part of MPSolve 3.2.1
3 *
4 * Copyright (C) 2001-2020, Dipartimento di Matematica "L. Tonelli", Pisa.
5 * License: http://www.gnu.org/licenses/gpl.html GPL version 3 or higher
6 *
7 * Authors:
8 * Leonardo Robol <leonardo.robol@unipi.it>
9 */
10
11#ifndef MPS_OPTIONS_H_
12#define MPS_OPTIONS_H_
13
19#include <mps/mps.h>
20
21MPS_BEGIN_DECLS
22
36 char format;
37
44 mps_boolean argument;
45
50 mps_boolean mandatory;
51
57};
58
71};
72
97struct mps_opt {
98 char optchar;
99 char *optvalue;
100};
101
102
114 mps_option_key flag;
115
120 char *value;
121};
122
123/* STRUCTURES truth tables */
124const static short int mps_rational_structures[] = { 0, 1, 0, 0, 0, 1, 0, 0, 0 };
125const static short int mps_integer_structures[] = { 1, 0, 0, 0, 1, 0, 0, 0, 0 };
126const static short int mps_fp_structures[] = { 0, 0, 1, 0, 0, 0, 1, 0, 0 };
127const static short int mps_real_structures[] = { 1, 1, 1, 1, 0, 0, 0, 0, 0 };
128const static short int mps_complex_structures[] = { 0, 0, 0, 0, 1, 1, 1, 1, 0 };
129const static short int mps_bigfloat_structures[] = { 0, 0, 0, 1, 0, 0, 0, 1, 0 };
130
131/* STRUCTURE related macros */
132#define MPS_STRUCTURE_IS_RATIONAL(x) (mps_rational_structures[(x)])
133#define MPS_STRUCTURE_IS_INTEGER(x) (mps_integer_structures[(x)])
134#define MPS_STRUCTURE_IS_FP(x) (mps_fp_structures[(x)])
135#define MPS_STRUCTURE_IS_REAL(x) (mps_real_structures[(x)])
136#define MPS_STRUCTURE_IS_COMPLEX(x) (mps_complex_structures[(x)])
137
138
139const static short int mps_user_representations[] = { 0, 0, 1 };
140const static short int mps_sparse_representations[] = { 0, 1, 0 };
141const static short int mps_dense_representations[] = { 1, 0, 0 };
142
143#define MPS_DENSITY_IS_SPARSE(x) (mps_sparse_representations[(x)])
144#define MPS_DENSITY_IS_DENSE(x) (mps_dense_representations[(x)])
145
159 mps_phase starting_phase;
160};
161
162/* Properties of the root */
163#define MPS_OUTPUT_PROPERTY_NONE (0x00)
164#define MPS_OUTPUT_PROPERTY_REAL (0x01)
165#define MPS_OUTPUT_PROPERTY_IMAGINARY (0x01 << 1)
166
178 long int prec;
179
184 mps_output_goal goal;
185
190 mps_boolean multiplicity;
191
195 mps_search_set search_set;
196
206
220 mps_output_format format;
221};
222
223/* Function in getopts.c */
224void mps_parse_opts (mps_context * s, int argc, char *argv[]);
225mps_boolean mps_getopts (mps_opt ** opt, int *argc_ptr, char ***argv_ptr,
226 const char *opt_format);
227
228
229mps_command_line_option_configuration * mps_command_line_option_configuration_new (void);
230
231MPS_END_DECLS
232
233#endif /* Header end */
Header file for libmps.
mps_boolean mps_getopts(mps_opt **opt, int *argc_ptr, char ***argv_ptr, const char *opt_format)
Parse command line options in a similar way of getopts.
Definition: getopts.c:52
Configuration for a command line parser.
Definition: options.h:65
mps_list * command_options
A list of mps_command_option instances that have been provided for this parser configuration.
Definition: options.h:70
This struct holds a configuration for a command line option. This is a step towards a more flexible i...
Definition: options.h:28
mps_boolean mandatory
If this value is true then the argument for the option is mandatory. Note that this value should be t...
Definition: options.h:50
char * long_format
An optional long format for the option, or NULL if no long format is specified.
Definition: options.h:56
mps_boolean argument
This value is true if an argument may be specified for the option.
Definition: options.h:44
char format
This is the character that is recognized as starting the option specification on the command line.
Definition: options.h:36
this struct holds the state of the mps computation
Definition: context.h:55
Configuration for an input stream; this struct contains the information on how the input stream shoul...
Definition: options.h:151
mps_phase starting_phase
Selet the starting phase for the computation.
Definition: options.h:159
This struct holds a key and the value associated with it. It's used for options that require a value ...
Definition: options.h:110
char * value
Value of the flag, or NULL if no value is provided.
Definition: options.h:120
mps_option_key flag
Key associated with the option.
Definition: options.h:114
Definition: list.h:50
Struct holding the options passed on the command line.
Definition: options.h:97
Configuration for the output.
Definition: options.h:174
mps_search_set search_set
The set in which the roots must be searched.
Definition: options.h:195
mps_output_goal goal
Condition to be reached to return the computed approximations.
Definition: options.h:184
mps_boolean multiplicity
True if the mulitplicity check is enabled in MPSolve.
Definition: options.h:190
long int prec
Digits of required output precision.
Definition: options.h:178
mps_output_format format
Desired output format.
Definition: options.h:220
char root_properties
These flags are used to determined which properties of the roots must be determined by MPSolve.
Definition: options.h:205