Implementation of the routines that handle the management of data inside mps_context objects.
More...
Go to the source code of this file.
Implementation of the routines that handle the management of data inside mps_context objects.
◆ mps_allocate_data()
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
-
◆ 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
-
s | The mps_context associated with the current computation. |
which_case | the address of the variable which_case; |
◆ mps_free_data()
Free all the data allocated with mps_allocate_data()
- Parameters
-
◆ 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
-
s | The mps_context of the computation. |
prec | The 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
-
s | The mps_context of the computation. |
prec | The 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
-
s | The mps_context of the computation. |
prec | The 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
-
s | The mps_context of the computation. |
prec | The desired precision. |
◆ mps_restore_data()
Resets the data to the highest used precision.
- Parameters
-