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

Simple routines used to interact with MPSolve without going into the internals. More...

#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <gmp.h>
#include <mps/mps.h>

Go to the source code of this file.

Macros

#define mps_new(type)   ((type*)mps_malloc (sizeof(type)))
 
#define mps_newv(type, n)   ((type*)mps_malloc (sizeof(type) * (n)))
 

Functions

void mps_set_default_values (mps_context *s)
 
void mps_mpsolve (mps_context *s)
 Call the real polynomial (or secular equation, or whatever) solver and do the computation. More...
 
void mps_standard_mpsolve (mps_context *s)
 Main routine of the program that implements the algorithm in the standard polynomial version. More...
 
void * mps_malloc (size_t size)
 Allocator for memory to be used in mpsolve.
 
void * mps_realloc (void *pointer, size_t size)
 Reallocator for memory used in MPSolve.
 
void mps_mpsolve_async (mps_context *s, mps_callback callback, void *user_data)
 

Detailed Description

Simple routines used to interact with MPSolve without going into the internals.

Function Documentation

◆ mps_mpsolve()

void mps_mpsolve ( mps_context s)

Call the real polynomial (or secular equation, or whatever) solver and do the computation.

The algorithm used must be selected before this call with mps_select_algorithm and the data (the coefficients, or whatever the algorithm may require) should be provided after that.

Roots can then be obtained with the functions mps_context_get_roots_*

◆ mps_standard_mpsolve()

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