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

Implementation of the convex hull computation. More...

#include <mps/mps.h>

Go to the source code of this file.

Classes

struct  mps_vertex
 Generic vertex of a linear hypograph. More...
 
struct  mps_linear_hypograph
 A set described as hypograph of a piecewise linear function. More...
 

Functions

mps_linear_hypographmps_convex_hull (mps_context *s, mps_linear_hypograph *l)
 
int * mps_fconvex (mps_context *s, int n, double a[])
 compute the convex hull of the data set a[]. More...
 
mps_linear_hypographmps_linear_hypograph_new (mps_context *ctx)
 
void mps_linear_hypograph_free (mps_context *ctx, mps_linear_hypograph *l)
 

Detailed Description

Implementation of the convex hull computation.

Function Documentation

◆ mps_fconvex()

int * mps_fconvex ( mps_context s,
int  n,
double  a[] 
)

compute the convex hull of the data set a[].

The result is in the mps_boolean vector h[]. The algorithm successively merges adjacent convex hulls of sizes 2, 4, 8, ...

Parameters
sThe mps_context associated with the current computation.
avector of points whose convex hull must be computed.
nsize of the vector a.
Returns
h An integer array that is 1 only in the positions corresponding to selected vertexes.