MPSolve  3.2.1
convex.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 
17 #ifndef MPS_CONVEX_H_
18 #define MPS_CONVEX_H_
19 
20 #include <mps/mps.h>
21 
25 struct mps_vertex {
29  int x;
30 
34  double y;
35 
40  struct mps_vertex * next;
41 
46  struct mps_vertex * previous;
47 };
48 
49 typedef struct mps_vertex mps_vertex;
50 
58  int n;
59 
60  mps_vertex * last;
61 
62  mps_vertex * first;
63 };
64 
66 
67 mps_linear_hypograph * mps_convex_hull (mps_context * s, mps_linear_hypograph * l);
68 
69 int * mps_fconvex (mps_context * s, int n, double a[]);
70 
71 mps_linear_hypograph * mps_linear_hypograph_new (mps_context * ctx);
72 
73 void mps_linear_hypograph_free (mps_context * ctx, mps_linear_hypograph * l);
74 
75 #endif /* endif MPS_CONVEX_H_ */
76 
77 
int * mps_fconvex(mps_context *s, int n, double a[])
compute the convex hull of the data set a[].
Definition: convex.c:165
Header file for libmps.
this struct holds the state of the mps computation
Definition: context.h:55
A set described as hypograph of a piecewise linear function.
Definition: convex.h:57
Generic vertex of a linear hypograph.
Definition: convex.h:25
struct mps_vertex * next
A pointer to the next vertex in the hypograph, or NULL if this is the last vertex or a detached one.
Definition: convex.h:40
int x
The x coordinate of the vertex.
Definition: convex.h:29
double y
The y coordinate of the vertex.
Definition: convex.h:34
struct mps_vertex * previous
A pointer to the previous vertex in the hypograph, or NULL if this is the first vertex or a detached ...
Definition: convex.h:46