5typedef const char * mps_string;
8#ifndef __MPS_NOT_DEFINE_BOOL
9typedef _Bool mps_boolean;
20typedef bool mps_boolean;
23#define mps_boolean_to_string(x) ((x) == true) ? "true" : "false"
26typedef int mps_debug_level;
32 (sizeof(x) == sizeof(long double) ? isnan_ld (x) \
33 : sizeof(x) == sizeof(double) ? isnan_d (x) \
35static inline int isnan_f (
float x)
39static inline int isnan_d (
double x)
43static inline int isnan_ld (
long double x)
51 (sizeof(x) == sizeof(long double) ? isinf_ld (x) \
52 : sizeof(x) == sizeof(double) ? isinf_d (x) \
54static inline int isinf_f (
float x)
56 return !isnan (x) && isnan (x - x);
58static inline int isinf_d (
double x)
60 return !isnan (x) && isnan (x - x);
62static inline int isinf_ld (
long double x)
64 return !isnan (x) && isnan (x - x);
171typedef enum mps_root_status mps_root_status;
172typedef enum mps_root_inclusion mps_root_inclusion;
173typedef enum mps_root_attrs mps_root_attrs;
175typedef enum mps_algorithm mps_algorithm;
176typedef enum mps_operation mps_operation;
177typedef enum mps_option_key mps_option_key;
178typedef enum mps_structure mps_structure;
179typedef enum mps_representation mps_representation;
180typedef enum mps_density mps_density;
181typedef enum mps_output_format mps_output_format;
182typedef enum mps_output_goal mps_output_goal;
183typedef enum mps_search_set mps_search_set;
184typedef enum mps_phase mps_phase;
185typedef enum mps_starting_strategy mps_starting_strategy;
214 no_phase, float_phase, dpe_phase, mp_phase
217static const mps_string mps_phase_string [] = {
218 "No phase",
"Float phase",
"DPE phase",
"MP phase"
220#define MPS_PHASE_TO_STRING(phase) (mps_phase_string[phase])
227 MPS_OPERATION_CLUSTER_ANALYSIS,
228 MPS_OPERATION_ABERTH_FP_ITERATIONS,
229 MPS_OPERATION_ABERTH_DPE_ITERATIONS,
230 MPS_OPERATION_ABERTH_MP_ITERATIONS,
231 MPS_OPERATION_REGENERATION,
232 MPS_OPERATION_STARTING_POINTS_FP,
233 MPS_OPERATION_STARTING_POINTS_DPE,
234 MPS_OPERATION_STARTING_POINTS_MP,
236 MPS_OPERATION_REFINEMENT
238static const mps_string mps_operation_string [] = {
239 "Cluster Analysis",
"Aberth floating point iterations",
"Aberth DPE iterations",
240 "Aberth multiprecision iterations",
"Regeneration",
"Starting point computation in floating point",
241 "Starting point computatino in DPE",
"Starting point computation in multiprecision",
242 "Shift of the polynomial",
"Refinement of the approximation"
244#define MPS_OPERATION_TO_STRING(operation) (mps_operation_string[operation])
249enum mps_root_status {
250 MPS_ROOT_STATUS_NEW_CLUSTERED,
251 MPS_ROOT_STATUS_CLUSTERED,
252 MPS_ROOT_STATUS_ISOLATED,
253 MPS_ROOT_STATUS_APPROXIMATED,
254 MPS_ROOT_STATUS_APPROXIMATED_IN_CLUSTER,
255 MPS_ROOT_STATUS_NOT_FLOAT,
256 MPS_ROOT_STATUS_NOT_DPE,
257 MPS_ROOT_STATUS_MULTIPLE
261static const mps_boolean mps_table_of_approximated_roots [] = {
false,
false,
false,
true,
true,
false,
false,
false };
262static const mps_boolean mps_table_of_computed_roots [] = {
false,
false,
true,
true,
true,
false,
false,
false };
263static const mps_boolean mps_table_of_improvable_roots [] = {
false,
false,
true,
true,
false,
false,
false,
false };
264#define MPS_ROOT_STATUS_IS_APPROXIMATED(status) (mps_table_of_approximated_roots[status])
265#define MPS_ROOT_STATUS_IS_COMPUTED(status) (mps_table_of_computed_roots[status])
266#define MPS_ROOT_STATUS_IS_IMPROVABLE(status) (mps_table_of_improvable_roots[status])
269static const mps_string mps_root_status_string[] = {
270 "Clustered (pinned)",
274 "Approximated in a cluster",
275 "Not representable as floating point",
276 "Not representable as DPE",
279#define MPS_ROOT_STATUS_TO_STRING(status) (mps_root_status_string[status])
288 MPS_ROOT_ATTRS_NOT_REAL,
290 MPS_ROOT_ATTRS_NOT_IMAG,
291 MPS_ROOT_ATTRS_NOT_REAL_AND_IMAG
295static const mps_string mps_root_attrs_string [] = {
301 "Not Real nor imaginary"
303#define MPS_ROOT_ATTRS_TO_STRING(attrs) (mps_root_attrs_string[attrs])
309enum mps_root_inclusion {
310 MPS_ROOT_INCLUSION_UNKNOWN,
311 MPS_ROOT_INCLUSION_IN,
312 MPS_ROOT_INCLUSION_OUT
316static const mps_string mps_root_inclusion_string [] = {
321#define MPS_ROOT_INCLUSION_TO_STRING(inclusion) (mps_root_inclusion_string[inclusion])
331 MPS_ALGORITHM_STANDARD_MPSOLVE,
336 MPS_ALGORITHM_SECULAR_GA
377 MPS_STRUCTURE_REAL_INTEGER,
378 MPS_STRUCTURE_REAL_RATIONAL,
379 MPS_STRUCTURE_REAL_FP,
380 MPS_STRUCTURE_REAL_BIGFLOAT,
381 MPS_STRUCTURE_COMPLEX_INTEGER,
382 MPS_STRUCTURE_COMPLEX_RATIONAL,
383 MPS_STRUCTURE_COMPLEX_FP,
384 MPS_STRUCTURE_COMPLEX_BIGFLOAT,
385 MPS_STRUCTURE_UNKNOWN
403enum mps_output_format {
404 MPS_OUTPUT_FORMAT_COMPACT,
405 MPS_OUTPUT_FORMAT_GNUPLOT,
406 MPS_OUTPUT_FORMAT_GNUPLOT_FULL,
407 MPS_OUTPUT_FORMAT_BARE,
408 MPS_OUTPUT_FORMAT_FULL,
409 MPS_OUTPUT_FORMAT_VERBOSE
415enum mps_output_goal {
416 MPS_OUTPUT_GOAL_ISOLATE,
417 MPS_OUTPUT_GOAL_APPROXIMATE,
418 MPS_OUTPUT_GOAL_COUNT
428 MPS_SEARCH_SET_COMPLEX_PLANE,
433 MPS_SEARCH_SET_POSITIVE_REAL_PART,
438 MPS_SEARCH_SET_NEGATIVE_REAL_PART,
443 MPS_SEARCH_SET_POSITIVE_IMAG_PART,
448 MPS_SEARCH_SET_NEGATIVE_IMAG_PART,
454 MPS_SEARCH_SET_UNITARY_DISC,
460 MPS_SEARCH_SET_UNITARY_DISC_COMPL,
475 MPS_SEARCH_SET_CUSTOM
481enum mps_representation {
482 MPS_REPRESENTATION_SECULAR,
483 MPS_REPRESENTATION_MONOMIAL,
484 MPS_REPRESENTATION_CHEBYSHEV
490enum mps_starting_strategy {
491 MPS_STARTING_STRATEGY_DEFAULT,
492 MPS_STARTING_STRATEGY_RECURSIVE,
493 MPS_STARTING_STRATEGY_FILE
Implementation of some thread-safe types that can be easily used with the macro MPS_LOCK() and MPS_UN...
Definition: approximation.h:24
Cluster held in a mps_clusterization.
Definition: cluster.h:72
A cluster of mps_roots.
Definition: cluster.h:51
A list of mps_cluster.
Definition: cluster.h:100
Configuration for a command line parser.
Definition: options.h:65
This struct holds a configuration for a command line option. This is a step towards a more flexible i...
Definition: options.h:28
this struct holds the state of the mps computation
Definition: context.h:55
This is the struct that holds all the data of the matrix polynomial.
Definition: monomial-matrix-poly.h:39
Data regarding a polynomial represented in the monomial base.
Definition: monomial-poly.h:44
Struct holding the options passed on the command line.
Definition: options.h:97
Configuration for the output.
Definition: options.h:174
Struct that represents an abstract polynomial. All the other real polynomial implementations (such as...
Definition: polynomial.h:111
This type represent an abstract implementation of a driver for the regeneration step of the main algo...
Definition: regeneration-driver.h:31
This struct represent a root inside of a mps_cluster.
Definition: cluster.h:30
Secular equation data.
Definition: secular-equation.h:63
This is a struct that represent an iteration on a root. It contains information that could be useful ...
Definition: secular-equation.h:189
Struct holding a job queue.
Definition: threading.h:76
A new job for mps_thread_fsolve(), mps_thread_dsolve() or mps_thread_msolve().
Definition: threading.h:44
An item that can be inserted and/or extracted from a mps_thread_pool_queue.
Definition: threading.h:265
A queue of work items that thread can consume.
Definition: threading.h:285
A thread pool that contains a set of mps_thread and allow to manage them as a set of worker.
Definition: threading.h:303
Data packed to be passed to a new thread that will perform floating point, dpe or multiprecision iter...
Definition: threading.h:116
A thread that is part of a thread pool.
Definition: threading.h:198