24#define MPS_SECULAR_EQUATION(t) (MPS_POLYNOMIAL_CAST (mps_secular_equation, t))
25#define MPS_IS_SECULAR_EQUATION(t) (mps_polynomial_check_type (t, "mps_secular_equation"))
35#define MPS_SECULAR_STARTING_MP_PRECISION 128
43#define MPS_SECULAR_EQUIVALENT_FP_PRECISION (MPS_SECULAR_STARTING_MP_PRECISION / 2)
251#define mps_secular_equation_from_status(s) (mps_secular_equation*)(s)->secular_equation
297 unsigned long int n);
300 unsigned long int n);
309mps_boolean mps_secular_poly_feval_with_error (
mps_context * ctx,
mps_polynomial * p, cplx_t x, cplx_t value,
double * error);
311mps_boolean mps_secular_poly_deval_with_error (
mps_context * ctx,
mps_polynomial * p, cdpe_t x, cdpe_t value, rdpe_t error);
313mps_boolean mps_secular_poly_meval_with_error (
mps_context * ctx,
mps_polynomial * p, mpc_t x, mpc_t value, rdpe_t error);
322 mps_structure structure, mps_density density,
mps_secular_equation * mps_secular_equation_new(mps_context *s, cplx_t *afpc, cplx_t *bfpc, unsigned long int n)
Create a new secular equation struct.
Definition: secular-equation.c:310
int mps_secular_ga_miterate(mps_context *s, int maxit, mps_boolean just_regenerated)
Routine that performs a block of iteration in floating point on the secular equation using CDPE.
Definition: secular-iteration.c:625
mps_secular_equation * mps_secular_equation_read_from_stream(mps_context *ctx, mps_input_buffer *buffer, mps_structure structure, mps_density density, long int precision)
Parse the stream that has been loaded into buffer and that describe a mps_secular_equation.
Definition: secular-parser.c:26
int mps_secular_ga_fiterate(mps_context *s, int maxit, mps_boolean just_regenerated)
Routine that performs a block of iteration in floating point on the secular equation.
Definition: secular-iteration.c:133
void mps_secular_equation_set_coefficient_q(mps_context *ctx, mps_secular_equation *p, int i, mpq_t ar, mpq_t ai, mpq_t br, mpq_t bi)
Sets a coefficient of a secular equation.
Definition: secular-equation.c:405
void mps_secular_switch_phase(mps_context *s, mps_phase phase)
Prepare data for the iteration in the new phase specified in the second parameter.
Definition: secular-equation.c:695
void mps_secular_equation_free(mps_context *ctx, mps_polynomial *p)
Free a secular equation and the data in it.
Definition: secular-equation.c:441
void mps_secular_fstart(mps_context *s, mps_secular_equation *sec, mps_approximation **approximations)
Compute some sensible starting points for the given secular equation (floating point version).
Definition: secular-starting.c:26
void mps_secular_check_data(mps_context *s, char *which_case)
Secular version of mps_check_data () that does nothing except to set the starting case according to s...
Definition: secular-equation.c:544
int mps_secular_ga_diterate(mps_context *s, int maxit, mps_boolean just_regenerated)
Routine that performs a block of iteration in floating point on the secular equation using CDPE.
Definition: secular-iteration.c:374
mps_boolean mps_secular_ga_regenerate_coefficients(mps_context *s)
Regenerate and setting , i.e. the current root approximation and recomputing accordingly.
Definition: secular-regeneration.c:637
void mps_secular_raise_root_precision(mps_context *s, int wp)
Raise precision of the roots (not the coefficients nor the system) to wp bits.
Definition: secular-equation.c:638
void mps_secular_ga_update_coefficients(mps_context *s)
Update all the coefficients of the secular equation, and their moduli, using the recomputed one store...
Definition: secular-ga.c:41
mps_secular_equation * mps_secular_equation_new_raw(mps_context *s, unsigned long int n)
Raw version of mps_secular_equation_new that only allocate space for the coefficients but relies on t...
Definition: secular-equation.c:210
void mps_secular_equation_set_coefficient_f(mps_context *ctx, mps_secular_equation *p, int i, mpc_t a, mpc_t b)
Sets a coefficient of a secular equation.
Definition: secular-equation.c:358
void mps_secular_mstart(mps_context *s, mps_secular_equation *sec, mps_approximation **approximations)
Compute some sensible starting points for the given secular equation (MP version).
Definition: secular-starting.c:93
mps_boolean mps_secular_ga_check_stop(mps_context *s)
Check if iterations can terminate, i.e. if newton isolation has been reached, if the target was appro...
Definition: secular-ga.c:72
void mps_secular_deflate(mps_context *s, mps_secular_equation *sec)
Deflate a secular equation lowering the degree of the polynomial that represent it,...
Definition: secular-equation.c:107
void mps_secular_set_radii(mps_context *s)
Update radii of the roots according to the coefficients of the secular equation in this moment,...
Definition: secular-equation.c:765
void mps_secular_raise_precision(mps_context *s, int wp)
Raise (or lower) the precision of the coefficients to wp bits. This will change precision of the coef...
Definition: secular-equation.c:661
void mps_secular_dstart(mps_context *s, mps_secular_equation *sec, mps_approximation **approximations)
Compute some sensible starting points for the given secular equation (DPE version).
Definition: secular-starting.c:56
long int mps_secular_raise_coefficient_precision(mps_context *s, mps_polynomial *p, long int wp)
Raise precision of the coefficient of the secular equation (not the roots and neither the precison of...
Definition: secular-equation.c:564
Definition: approximation.h:24
this struct holds the state of the mps computation
Definition: context.h:55
Struct that represents an abstract polynomial. All the other real polynomial implementations (such as...
Definition: polynomial.h:111
Definition: secular-equation.h:45
Secular equation data.
Definition: secular-equation.h:63
pthread_mutex_t * ampc_mutex
Mutexes thatn need to be locked to ensure consistent access to ampc[j] variable.
Definition: secular-equation.h:102
mpq_t * initial_bmpqrc
Initial rational coefficients, if rational input is selected. This value is the real part of the coe...
Definition: secular-equation.h:162
mpc_t * bmpc
Same as bfpc, but the multiprecision version.
Definition: secular-equation.h:108
mpc_t * ampc
Same as afpc, but the multiprecision version.
Definition: secular-equation.h:96
mpc_t * initial_ampc
Initial multiprecision coefficients saved for latter regeneration in mps_secular_ga_regenerate_coeffi...
Definition: secular-equation.h:144
rdpe_t * aadpc
DPE Moduli of the CDPE of Multiprecision a_i coefficients of the secular equation.
Definition: secular-equation.h:132
cdpe_t * bdpc
Same as bfpc, but the dpe version.
Definition: secular-equation.h:90
pthread_mutex_t * bmpc_mutex
Mutexes that need to be locked to ensure consistent access to bmpc[j] variable.
Definition: secular-equation.h:114
rdpe_t * abdpc
DPE Moduli of the CDPE of Multiprecision b_i coefficients of the secular equation.
Definition: secular-equation.h:138
cplx_t * bfpc
Vector with the values of as complex floating point numbers.
Definition: secular-equation.h:84
cplx_t * afpc
Vector of as complex floating point numbers.
Definition: secular-equation.h:72
mpq_t * initial_bmpqic
Initial rational coefficients, if rational input is selected. This value is the imaginary part of the...
Definition: secular-equation.h:174
pthread_mutex_t precision_mutex
This mutex is locked while changing precision.
Definition: secular-equation.h:179
double * abfpc
Moduli of the floating point b_i coefficients of the secular equation.
Definition: secular-equation.h:126
mpc_t * initial_bmpc
Initial multiprecision coefficients saved for latter regeneration in mps_secular_ga_regenerate_coeffi...
Definition: secular-equation.h:150
mpq_t * initial_ampqrc
Initial rational coefficients, if rational input is selected. This value is the real part of the coe...
Definition: secular-equation.h:156
mpq_t * initial_ampqic
Initial rational coefficients, if rational input is selected. This value is the imaginary part of the...
Definition: secular-equation.h:168
cdpe_t * adpc
Same as afpc, but the dpe version.
Definition: secular-equation.h:78
double * aafpc
Moduli of the floating point a_i coefficients of the secular equation.
Definition: secular-equation.h:120
This is a struct that represent an iteration on a root. It contains information that could be useful ...
Definition: secular-equation.h:189
cdpe_t * local_bdpc
Thread local copy of the CDPE coefficients of the secular equation.
Definition: secular-equation.h:244
cplx_t * local_bfpc
Thread local copy of the floating point coefficients of the secular equation.
Definition: secular-equation.h:232
long int k
The index of the roots on which the iterations is being carried out.
Definition: secular-equation.h:194
pthread_mutex_t * gs_mutex
Global mutex used to synchronization, but mainly while testing new MP implementations.
Definition: secular-equation.h:208
mpc_t * local_bmpc
Thread local copy of the coefficients of the secular equation.
Definition: secular-equation.h:220
mps_boolean radius_set
The state of the iteration. This is a pointer to a boolean that tells if the iterator has been able t...
Definition: secular-equation.h:202
cdpe_t * local_adpc
Thread local copy of the CDPE coefficients of the secular equation.
Definition: secular-equation.h:238
mpc_t * local_ampc
Thread local copy of the coefficients of the secular equation.
Definition: secular-equation.h:214
cplx_t * local_afpc
Thread local copy of the floating point coefficients of the secular equation.
Definition: secular-equation.h:226