MPSolve 3.2.1
Loading...
Searching...
No Matches
interface.h
Go to the documentation of this file.
1/*
2 * This file is part of MPSolve 3.2.1
3 *
4 * Copyright (C) 2001-2020, Dipartimento di Matematica "L. Tonelli", Pisa.
5 * License: http://www.gnu.org/licenses/gpl.html GPL version 3 or higher
6 *
7 * Authors:
8 * Leonardo Robol <leonardo.robol@unipi.it>
9 */
10
11#ifndef MPS_INTERFACE_H_
12#define MPS_INTERFACE_H_
13
14#include <stdlib.h>
15#include <stdio.h>
16#include <pthread.h>
17#include <gmp.h>
18#include <mps/mps.h>
19
20#ifdef __cplusplus
21extern "C"
22{
23#endif
24
30/* Since this is the interface header it contains also the documentation that doxygen
31 * will output in HTML form. */
32
203/*
204 * ====== ROUTINES EXPOSED TO THE INTERFACE ======
205 */
206
207/* functions in mps_defaults.c */
208void mps_set_default_values (mps_context * s);
209
210/* Functions in mps_main.c */
211void mps_mpsolve (mps_context * s);
213
214/* functions in mps_interface.c */
215void * mps_malloc (size_t size);
216void * mps_realloc (void * pointer, size_t size);
217
218void mps_mpsolve_async (mps_context * s, mps_callback callback, void * user_data);
219
220/* Macros to init pointer and/or vectors in a convenient way */
221#define mps_new(type) ((type*)mps_malloc (sizeof(type)))
222#define mps_newv(type, n) ((type*)mps_malloc (sizeof(type) * (n)))
223
224#ifdef __cplusplus
225}
226#endif
227
228#ifdef __UNDEF_CPLUSPLUS
229}
230#endif
231
232#endif /* MPS_INTERFACE_H */
void *(* mps_callback)(mps_context *status, void *user_data)
Pointer to the callback for the async version of mpsolve.
Definition: context.h:37
void * mps_realloc(void *pointer, size_t size)
Reallocator for memory used in MPSolve.
Definition: interface.c:131
void * mps_malloc(size_t size)
Allocator for memory to be used in mpsolve.
Definition: interface.c:114
void mps_mpsolve(mps_context *s)
Call the real polynomial (or secular equation, or whatever) solver and do the computation.
Definition: interface.c:63
void mps_standard_mpsolve(mps_context *s)
Main routine of the program that implements the algorithm in the standard polynomial version.
Definition: main.c:41
Header file for libmps.
this struct holds the state of the mps computation
Definition: context.h:55