MPSolve 3.2.1
Loading...
Searching...
No Matches
main.c File Reference

File with the implementation of the driver routines for MPSolve. More...

#include <math.h>
#include <float.h>
#include <mps/mps.h>

Functions

MPS_PRIVATE void mps_standard_mpsolve (mps_context *s)
 Main routine of the program that implements the algorithm in the standard polynomial version. More...
 
MPS_PRIVATE void mps_setup (mps_context *s)
 Setup vectors and variables.
 
MPS_PRIVATE void mps_check_data (mps_context *s, char *which_case)
 Check consistency of data and makes some basic adjustments. More...
 
MPS_PRIVATE void mps_compute_sep (mps_context *s)
 Compute the minimum distance that can separate two roots of the input polynomial.
 

Detailed Description

File with the implementation of the driver routines for MPSolve.

Function Documentation

◆ mps_check_data()

MPS_PRIVATE 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_standard_mpsolve()

MPS_PRIVATE void mps_standard_mpsolve ( mps_context s)

Main routine of the program that implements the algorithm in the standard polynomial version.

The program is divided into many parts

  • Check the correctness of data, scale coefficients if needed, and select cases: the variable which_case is 'f' or 'd' according to float or dpe case.
  • Call msolve or dsolve according to the value of which_case.
  • Allocate MP variables mfpc, mroot, drad (if needed).
  • Start MPsolve loop
    • prepare data according to the current precision and to the data_type (density/sparsity/user)
    • Call msolve with the current precision
  • check for termination