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;
36 (sizeof(x) == sizeof(long double) ? isnan_ld (x) \
37 : sizeof(x) == sizeof(double) ? isnan_d (x) \
39static inline int isnan_f (
float x)
43static inline int isnan_d (
double x)
47static inline int isnan_ld (
long double x)
55 (sizeof(x) == sizeof(long double) ? isinf_ld (x) \
56 : sizeof(x) == sizeof(double) ? isinf_d (x) \
58static inline int isinf_f (
float x)
60 return !isnan (x) && isnan (x - x);
62static inline int isinf_d (
double x)
64 return !isnan (x) && isnan (x - x);
66static inline int isinf_ld (
long double x)
68 return !isnan (x) && isnan (x - x);
175typedef enum mps_root_status mps_root_status;
176typedef enum mps_root_inclusion mps_root_inclusion;
177typedef enum mps_root_attrs mps_root_attrs;
179typedef enum mps_algorithm mps_algorithm;
180typedef enum mps_operation mps_operation;
181typedef enum mps_option_key mps_option_key;
182typedef enum mps_structure mps_structure;
183typedef enum mps_representation mps_representation;
184typedef enum mps_density mps_density;
185typedef enum mps_output_format mps_output_format;
186typedef enum mps_output_goal mps_output_goal;
187typedef enum mps_search_set mps_search_set;
188typedef enum mps_phase mps_phase;
189typedef enum mps_starting_strategy mps_starting_strategy;
218 no_phase, float_phase, dpe_phase, mp_phase
221static const mps_string mps_phase_string [] = {
222 "No phase",
"Float phase",
"DPE phase",
"MP phase"
224#define MPS_PHASE_TO_STRING(phase) (mps_phase_string[phase])
231 MPS_OPERATION_CLUSTER_ANALYSIS,
232 MPS_OPERATION_ABERTH_FP_ITERATIONS,
233 MPS_OPERATION_ABERTH_DPE_ITERATIONS,
234 MPS_OPERATION_ABERTH_MP_ITERATIONS,
235 MPS_OPERATION_REGENERATION,
236 MPS_OPERATION_STARTING_POINTS_FP,
237 MPS_OPERATION_STARTING_POINTS_DPE,
238 MPS_OPERATION_STARTING_POINTS_MP,
240 MPS_OPERATION_REFINEMENT
242static const mps_string mps_operation_string [] = {
243 "Cluster Analysis",
"Aberth floating point iterations",
"Aberth DPE iterations",
244 "Aberth multiprecision iterations",
"Regeneration",
"Starting point computation in floating point",
245 "Starting point computatino in DPE",
"Starting point computation in multiprecision",
246 "Shift of the polynomial",
"Refinement of the approximation"
248#define MPS_OPERATION_TO_STRING(operation) (mps_operation_string[operation])
253enum mps_root_status {
254 MPS_ROOT_STATUS_NEW_CLUSTERED,
255 MPS_ROOT_STATUS_CLUSTERED,
256 MPS_ROOT_STATUS_ISOLATED,
257 MPS_ROOT_STATUS_APPROXIMATED,
258 MPS_ROOT_STATUS_APPROXIMATED_IN_CLUSTER,
259 MPS_ROOT_STATUS_NOT_FLOAT,
260 MPS_ROOT_STATUS_NOT_DPE,
261 MPS_ROOT_STATUS_MULTIPLE
265static const mps_boolean mps_table_of_approximated_roots [] = {
false,
false,
false,
true,
true,
false,
false,
false };
266static const mps_boolean mps_table_of_computed_roots [] = {
false,
false,
true,
true,
true,
false,
false,
false };
267static const mps_boolean mps_table_of_improvable_roots [] = {
false,
false,
true,
true,
false,
false,
false,
false };
268#define MPS_ROOT_STATUS_IS_APPROXIMATED(status) (mps_table_of_approximated_roots[status])
269#define MPS_ROOT_STATUS_IS_COMPUTED(status) (mps_table_of_computed_roots[status])
270#define MPS_ROOT_STATUS_IS_IMPROVABLE(status) (mps_table_of_improvable_roots[status])
273static const mps_string mps_root_status_string[] = {
274 "Clustered (pinned)",
278 "Approximated in a cluster",
279 "Not representable as floating point",
280 "Not representable as DPE",
283#define MPS_ROOT_STATUS_TO_STRING(status) (mps_root_status_string[status])
292 MPS_ROOT_ATTRS_NOT_REAL,
294 MPS_ROOT_ATTRS_NOT_IMAG,
295 MPS_ROOT_ATTRS_NOT_REAL_AND_IMAG
299static const mps_string mps_root_attrs_string [] = {
305 "Not Real nor imaginary"
307#define MPS_ROOT_ATTRS_TO_STRING(attrs) (mps_root_attrs_string[attrs])
313enum mps_root_inclusion {
314 MPS_ROOT_INCLUSION_UNKNOWN,
315 MPS_ROOT_INCLUSION_IN,
316 MPS_ROOT_INCLUSION_OUT
320static const mps_string mps_root_inclusion_string [] = {
325#define MPS_ROOT_INCLUSION_TO_STRING(inclusion) (mps_root_inclusion_string[inclusion])
335 MPS_ALGORITHM_STANDARD_MPSOLVE,
340 MPS_ALGORITHM_SECULAR_GA
381 MPS_STRUCTURE_REAL_INTEGER,
382 MPS_STRUCTURE_REAL_RATIONAL,
383 MPS_STRUCTURE_REAL_FP,
384 MPS_STRUCTURE_REAL_BIGFLOAT,
385 MPS_STRUCTURE_COMPLEX_INTEGER,
386 MPS_STRUCTURE_COMPLEX_RATIONAL,
387 MPS_STRUCTURE_COMPLEX_FP,
388 MPS_STRUCTURE_COMPLEX_BIGFLOAT,
389 MPS_STRUCTURE_UNKNOWN
407enum mps_output_format {
408 MPS_OUTPUT_FORMAT_COMPACT,
409 MPS_OUTPUT_FORMAT_GNUPLOT,
410 MPS_OUTPUT_FORMAT_GNUPLOT_FULL,
411 MPS_OUTPUT_FORMAT_BARE,
412 MPS_OUTPUT_FORMAT_FULL,
413 MPS_OUTPUT_FORMAT_VERBOSE
419enum mps_output_goal {
420 MPS_OUTPUT_GOAL_ISOLATE,
421 MPS_OUTPUT_GOAL_APPROXIMATE,
422 MPS_OUTPUT_GOAL_COUNT
432 MPS_SEARCH_SET_COMPLEX_PLANE,
437 MPS_SEARCH_SET_POSITIVE_REAL_PART,
442 MPS_SEARCH_SET_NEGATIVE_REAL_PART,
447 MPS_SEARCH_SET_POSITIVE_IMAG_PART,
452 MPS_SEARCH_SET_NEGATIVE_IMAG_PART,
458 MPS_SEARCH_SET_UNITARY_DISC,
464 MPS_SEARCH_SET_UNITARY_DISC_COMPL,
479 MPS_SEARCH_SET_CUSTOM
485enum mps_representation {
486 MPS_REPRESENTATION_SECULAR,
487 MPS_REPRESENTATION_MONOMIAL,
488 MPS_REPRESENTATION_CHEBYSHEV
494enum mps_starting_strategy {
495 MPS_STARTING_STRATEGY_DEFAULT,
496 MPS_STARTING_STRATEGY_RECURSIVE,
497 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:60
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:169
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