37typedef void* (*mps_callback)(
mps_context * status,
void * user_data);
43#define MPS_FNEWTON_PTR(x) (mps_fnewton_ptr) & (x)
44#define MPS_DNEWTON_PTR(x) (mps_dnewton_ptr) & (x)
45#define MPS_MNEWTON_PTR(x) (mps_mnewton_ptr) & (x)
46#define MPS_CHECK_DATA_PTR(x) (mps_check_data_ptr) & (x)
47#define MPS_FSTART_PTR(x) (mps_fstart_ptr) & (x)
48#define MPS_DSTART_PTR(x) (mps_dstart_ptr) & (x)
49#define MPS_MPSOLVE_PTR(x) (mps_mpsolve_ptr) & (x)
52#define MPS_OUTPUT_PROPERTY_NONE (0x00)
53#define MPS_OUTPUT_PROPERTY_REAL (0x01)
54#define MPS_OUTPUT_PROPERTY_IMAGINARY (0x01 << 1)
510 unsigned long int regeneration_time;
511 unsigned long int mp_iteration_time;
512 unsigned long int dpe_iteration_time;
513 unsigned long int fp_iteration_time;
515 mps_boolean exit_required;
517 long int minimum_gmp_precision;
555int mps_context_set_poly_d (
mps_context * s, cplx_t * coeff,
556 long unsigned int n);
558int mps_context_set_poly_i (
mps_context * s,
int *coeff,
long unsigned int n);
559void mps_context_select_algorithm (
mps_context * s, mps_algorithm algorithm);
560void mps_context_set_degree (
mps_context * s,
int n);
563void mps_context_allocate_poly_inplace (
mps_context * s,
int n);
567long int mps_context_get_data_prec_max (
mps_context * s);
568long int mps_context_get_minimum_precision (
mps_context * s);
570int mps_context_get_roots_d (
mps_context * s, cplx_t ** roots,
double **radius);
571int mps_context_get_roots_m (
mps_context * s, mpc_t ** roots, rdpe_t ** radius);
573mps_root_status mps_context_get_root_status (
mps_context * ctx,
int i);
574mps_boolean mps_context_get_over_max (
mps_context * s);
579void mps_context_set_input_prec (
mps_context * s,
long int prec);
580void mps_context_set_output_prec (
mps_context * s,
long int prec);
581void mps_context_set_output_format (
mps_context * s, mps_output_format format);
582void mps_context_set_output_goal (
mps_context * s, mps_output_goal goal);
583void mps_context_set_search_set (
mps_context * s, mps_search_set set);
584void mps_context_set_starting_phase (
mps_context * s, mps_phase phase);
585void mps_context_set_log_stream (
mps_context * s, FILE * logstr);
586void mps_context_set_root_stream (
mps_context * s, FILE * rtstr);
587void mps_context_set_jacobi_iterations (
mps_context * s, mps_boolean jacobi_iterations);
588void mps_context_select_starting_strategy (
mps_context * s, mps_starting_strategy strategy);
589void mps_context_set_avoid_multiprecision (
mps_context * s, mps_boolean avoid_multiprecision);
590void mps_context_set_crude_approximation_mode (
mps_context * s, mps_boolean crude_approximation_mode);
592void mps_context_set_n_threads (
mps_context * s,
int n_threads);
593void mps_context_set_root_properties (
mps_context * s,
char root_properties);
596void mps_context_set_debug_level (
mps_context * s, mps_debug_level level);
597void mps_context_add_debug_domain (
mps_context * s, mps_debug_level level);
604mps_boolean mps_context_has_errors (
mps_context * s);
void *(*) mps_callback(mps_context *status, void *user_data)
Pointer to the callback for the async version of mpsolve.
Definition context.h:37
void(*) mps_mpsolve_ptr(mps_context *status)
Routine that performs the computation loop to solve the polynomial or the secular equation.
Definition context.h:32
Definition approximation.h:24
A list of mps_cluster.
Definition cluster.h:100
this struct holds the state of the mps computation
Definition context.h:60
rdpe_t eps_in
Input precision of the coefficients.
Definition context.h:313
mps_boolean crude_approximation_mode
This flags enables the "crude" only approximation mode of MPSolve.
Definition context.h:536
int max_pack
number of max packets of iterations
Definition context.h:200
void * user_data
Pointer to user_data passed to the callback.
Definition context.h:104
mps_boolean best_approx
Set to true if the approximation are the best that can be obtained with the current precision.
Definition context.h:273
mps_phase starting_case
Selected starting case, can be 'd' for DPE or 'f' for floating point.
Definition context.h:267
mps_boolean avoid_multiprecision
In case this field is set to true MPSolve will avoid a multiprecision phase, and exit instead.
Definition context.h:526
mps_boolean over_max
True if the computation has reached the maximum allowed precision.
Definition context.h:127
mps_output_configuration * output_config
Output configuration for MPSolve.
Definition context.h:137
mps_boolean chkrad
True if check of radius should be performed at the end of the algorithm.
Definition context.h:93
mps_boolean * again_old
Temporary vector containing the old value of again.
Definition context.h:450
mpc_t * mfpc1
Multiprecision complex coefficients of the polynomial.
Definition context.h:381
double sep
Log of the lower bound to the minumum distance of the roots.
Definition context.h:338
mps_phase lastphase
Last computing phase.
Definition context.h:261
int newtis
Newton isolation of the cluster.
Definition context.h:142
const char * gnuplot_format
Char to be intersted after the with statement in the output piped to gnuplot.
Definition context.h:506
mps_debug_level debug_level
Bytes containing the flags of debug enabled.
Definition context.h:122
FILE * logstr
Default log stream.
Definition context.h:185
double * fap1
Vector containing the moduli of the coefficients of the polynomial as floating point numbers.
Definition context.h:418
mps_boolean just_raised_precision
True if this is the first iteration after the precision has been raised.
Definition context.h:234
cdpe_t * dpc1
dpe complex coefficients of the polynomial.
Definition context.h:365
FILE * outstr
Default output stream.
Definition context.h:180
mps_starting_strategy starting_strategy
Strategy used to dispose the starting approximations.
Definition context.h:463
mps_long_int_mt data_prec_max
Maximum precision reached during the computation.
Definition context.h:222
mps_boolean initialized
This value is true if the data for the computation has been allocated by calling mps_allocate_data()....
Definition context.h:117
mps_secular_equation * secular_equation
Pointer to the secular equation used in computations.
Definition context.h:479
mps_input_configuration * input_config
Configuration of the input of MPSolve.
Definition context.h:132
rdpe_t eps_out
Output precision of the roots.
Definition context.h:318
mpc_t * mfppc1
Multiprecision complex coefficients of the first derivative of the polynomial.
Definition context.h:390
int deg
input degree and allocation size.
Definition context.h:254
long int mpwp
Bits of working precision that mpsolve is using.
Definition context.h:328
FILE * instr
Default input stream.
Definition context.h:175
mps_callback callback
Callback called when the async version of mps_mpsolve(), i.e. terminate the computation.
Definition context.h:99
double * fap2
Vector containing the logarithm of the moduli of the coefficients of the polynomial as floating point...
Definition context.h:431
mps_regeneration_driver * regeneration_driver
This is a pointer to the regeneration driver that performs the standard regeneration step....
Definition context.h:543
cplx_t * fppc1
Standard complex coefficients of the polynomial.
Definition context.h:357
mps_approximation ** root
Vector of points to the current root approximations.
Definition context.h:302
int newtis_old
Old value for the newton isolation of the cluster.
Definition context.h:147
mps_boolean skip_float
true if the float phase should be skipped, passing directly do dpe phase.
Definition context.h:308
pthread_mutex_t precision_mutex
Precision operation give best results when done one thread at a time :).
Definition context.h:228
char * last_error
The text describing the last error occurred.
Definition context.h:69
mps_boolean jacobi_iterations
True if Jacobi-style iterations must be used in the secular algorithm.
Definition context.h:501
mps_boolean random_seed
mps_boolean value that determine if we should use a random seed for starting points
Definition context.h:240
int max_it
number of max iterations per packet
Definition context.h:205
cdpe_t * dpc2
dpe complex coefficients of the polynomial.
Definition context.h:373
mps_clusterization * clusterization
Clusterization object that represent the clusterization detected on the roots.
Definition context.h:349
mps_boolean DOWARN
true if warning are needed.
Definition context.h:164
mps_boolean * spar1
Vector representing sparsity of the polynomial in the same way that spar does.
Definition context.h:400
mps_boolean error_state
true if an error has occurred during the computation.
Definition context.h:64
long int mpwp_max
Maximum allowed number of bits for mp numbers: used in high precision shift.
Definition context.h:217
mps_boolean DOSORT
true if root sorting is desired. It will be performed with routines in mps_sort.c.
Definition context.h:170
mps_boolean DOLOG
true if log are needed. They will be written to logstr
Definition context.h:159
mps_operation operation
The operation running now. Can be used to debug what's happening event if mpsolve was launched withou...
Definition context.h:110
rdpe_t * dap1
Vector containing the moduli of the coefficients of the polynomial as dpe numbers.
Definition context.h:442
FILE * rtstr
Stream used to resume an interrupted computation or to load the approximations from a custom file.
Definition context.h:191
mps_boolean resume
true if we are trying to resume previously interrupted.
Definition context.h:85
int * order
Output index order.
Definition context.h:296
mps_polynomial * active_poly
This is the polynomial that is currently being solved in MPSolve.
Definition context.h:474
int * oldpunt
Old value of punt (temporary vector).
Definition context.h:407
int count[3]
Vector containing count of in, out and uncertaing roots.
Definition context.h:286
mps_thread_pool * self_thread_pool
This value is non NULL if mpsolve is launched via mps_mpsolve_async() and in that case holds a pointe...
Definition context.h:78
int n
degree of zero-deflated polynomial.
Definition context.h:249
mps_thread_pool * pool
The thread pool used for the concurrent part of MPSolve.
Definition context.h:489
rdpe_t mp_epsilon
Current multiprecision epsilon.
Definition context.h:333
mps_algorithm algorithm
This is used in the program to switch behavious based on the algorithm that is been used now.
Definition context.h:458
void(*) mpsolve_ptr(mps_context *status)
Routine that performs the loop needed to coordinate root finding. It has to be called to do the hard ...
Definition context.h:469
mpc_t * bmpc
Auxiliary memory used in regeneation to avoid thread-safeness issues.
Definition context.h:495
int n_threads
Number of threads to be spawned.
Definition context.h:484
int max_newt_it
Number of max newton iterations for gravity center computations.
Definition context.h:211
double lmax_coeff
Logarithm of the max modulus of the coefficients.
Definition context.h:323
int zero_roots
Number of zero roots.
Definition context.h:291
double last_sigma
shift in the angle in the positioning of the starting approximation for the last cluster....
Definition context.h:281
A thread safe version of mps_boolean.
Definition mt-types.h:46
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
Secular equation data.
Definition secular-equation.h:63
A thread pool that contains a set of mps_thread and allow to manage them as a set of worker.
Definition threading.h:303