MPSolve 3.2.1
Loading...
Searching...
No Matches
data.h File Reference

Implementation of the routines that handle the management of data inside mps_context objects. More...

#include <mps/mps.h>

Go to the source code of this file.

Functions

MPS_BEGIN_DECLS void mps_mp_set_prec (mps_context *s, long int prec)
 Globally set the current precision of mp variables. More...
 
void mps_allocate_data (mps_context *s)
 Allocate all the data needed by MPSolve. Must be called after setting the degree of the polynomial (or, more generally, the number of root of the equation) in s->deg. More...
 
void mps_prepare_data (mps_context *s, long int prec)
 Compute the mp_complex values of the coefficients of p(x) with the current precision of mpwds words, given the rational or integer coefficients. More...
 
void mps_restore_data (mps_context *s)
 Resets the data to the highest used precision. More...
 
void mps_free_data (mps_context *s)
 Free all the data allocated with mps_allocate_data() More...
 
long int mps_raise_data (mps_context *s, long int prec)
 Raise precision performing a real computation of the data. More...
 
void mps_raise_data_raw (mps_context *s, long int prec)
 The same of mps_raise_data() but using raw routines of GMP, that will not change allocations. More...
 
void mps_setup (mps_context *s)
 Setup vectors and variables.
 
void mps_check_data (mps_context *s, char *which_case)
 Check consistency of data and makes some basic adjustments. More...
 
void mps_compute_sep (mps_context *s)
 Compute the minimum distance that can separate two roots of the input polynomial.
 

Detailed Description

Implementation of the routines that handle the management of data inside mps_context objects.

Function Documentation

◆ mps_allocate_data()

void mps_allocate_data ( mps_context s)

Allocate all the data needed by MPSolve. Must be called after setting the degree of the polynomial (or, more generally, the number of root of the equation) in s->deg.

Parameters
sThe mps_context of the computation.

◆ mps_check_data()

void mps_check_data ( mps_context s,
char *  which_case 
)

Check consistency of data and makes some basic adjustments.

This routine check, for example, if there are zero roots in the polynomial (i.e. no costant term) and deflates the polynomial if necessary (shifting the coefficients).

It sets the value of the parameter which_case to 'f' if a floating point phase is enough, or to 'd' if a dpe phase is needed.

Parameters
sThe mps_context associated with the current computation.
which_casethe address of the variable which_case;

◆ mps_free_data()

void mps_free_data ( mps_context s)

Free all the data allocated with mps_allocate_data()

Parameters
sThe mps_context of the computation.

◆ mps_mp_set_prec()

MPS_BEGIN_DECLS void mps_mp_set_prec ( mps_context s,
long int  prec 
)

Globally set the current precision of mp variables.

Parameters
sThe mps_context of the computation.
precThe precision that is desired for the next MP computations.

◆ mps_prepare_data()

void mps_prepare_data ( mps_context s,
long int  prec 
)

Compute the mp_complex values of the coefficients of p(x) with the current precision of mpwds words, given the rational or integer coefficients.

Parameters
sThe mps_context of the computation.
precThe precision that should be set and to which the data should be adjusted.

◆ mps_raise_data()

long int mps_raise_data ( mps_context s,
long int  prec 
)

Raise precision performing a real computation of the data.

Parameters
sThe mps_context of the computation.
precThe desired precision.
Returns
The precision set (that may be different from the one requested since GMP works only with precision divisible by some given integer.

◆ mps_raise_data_raw()

void mps_raise_data_raw ( mps_context s,
long int  prec 
)

The same of mps_raise_data() but using raw routines of GMP, that will not change allocations.

Parameters
sThe mps_context of the computation.
precThe desired precision.

◆ mps_restore_data()

void mps_restore_data ( mps_context s)

Resets the data to the highest used precision.

Parameters
sThe mps_context of the computation.