File numerics/src/tools/SiconosSets.h

Go to the source code of this file

Sets structures used in Siconos:

  • box constraints \( K = \{ x \in \mathbb{R}^n | lb_i \leq x_i \leq ub_i\quad i = 1 .. n\}\)

  • polytopes and polyhedra \( \{ x \in \mathbb{R}^n | Hx\leq K\}\)

  • sets defined by a set of inequalities \(\{g_i(x)\leq 0\}\) ( work in progress)

Typedefs

typedef generic_set positive_orthant

The positive orthant does not need to contain much info.

Enums

enum SICONOS_SET_ID

Values:

enumerator SICONOS_SET_POSITIVE_ORTHANT
enumerator SICONOS_SET_BOX
enumerator SICONOS_SET_POLYHEDRON
enumerator SICONOS_SET_POLYHEDRON_UNIFIED
enum SICONOS_RELATION_TYPES

Values:

enumerator SICONOS_LE
enumerator SICONOS_EQ
enumerator SICONOS_GE

Functions

static inline void set_set_id(void *set, int id)

set set id

Parameters
  • set – the set which id should be set

  • id – the id of the set

void project_on_set(int n, double *x, void *set)

project the point x on a set

Parameters
  • n – the size of x

  • x – the point to project

  • set – the set on which we project x

void free_siconos_set(void *set)

free a set

Parameters

set – struct to be freed

void free_box(box_constraints *b)

free a box struct

Parameters

b – the box struct to free

void free_polyhedron(polyhedron *poly)

free a Polyhedron struct

Parameters

poly – the Polyhedron struct to free

void free_polyhedron_unified(polyhedron_unified *poly)

free a Polyhedron struct

Parameters

poly – the Polyhedron struct to free

struct generic_set
#include <>

Generic set (can be seen as a kind of `base class’).

Mainly used to infer the type of set (box, polytope, …) to properly operate on it

Public Members

int id

type of the set

struct box_constraints
#include <>

Definition of a rectangular set, also known as box.

Public Members

int id

id of the structure, usually solver specific

double *lb

lower bounds

double *ub

upper bounds

struct polyhedron
#include <>

Definition of a polytope in terms of (H,K) representation.

Public Members

int id

id of the structure, usually solver specific

unsigned size_ineq

number of inequalities

unsigned size_eq

number of equalities

NumericsMatrix *H

H matrix in an (H,K) representation of a polytope H x <= K.

double *K

K vector in an (H,K) representation of a polytope H x <= K.

NumericsMatrix *Heq

Heq matrix for the equality constraints Heq x = Keq.

double *Keq

Keq vector for the equality constraints Heq x = Keq.

struct polyhedron_unified
#include <>

Definition of a polytope in terms of (H,K) representation.

Public Members

int id

id of the structure, usually solver specific

NumericsMatrix *A

A matrix in an (A,b) representation of a polytope \(Ax (\leq,=,\geq) b\).

double *b

b vector in an (A,b) representation of a polytope \(Ax (\leq,=,\geq) b\)

char *type

type of constraint of type SICONOS_RELATION_TYPES

union polyhedron_set

Public Members

generic_set *set
polyhedron *split
polyhedron_unified *unif