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_RELATION_TYPES

Values:

SICONOS_LE
SICONOS_EQ
SICONOS_GE
enum SICONOS_SET_ID

Values:

SICONOS_SET_POSITIVE_ORTHANT
SICONOS_SET_BOX
SICONOS_SET_POLYHEDRON
SICONOS_SET_POLYHEDRON_UNIFIED

Functions

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

void free_siconos_set(void *set)

free a set

Parameters
  • set: struct to be freed

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

static void set_set_id(void *set, unsigned id)

set set id

Parameters
  • set: the set which id should be set
  • id: the id of the set

struct box_constraints
#include <SiconosSets.h>

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 generic_set
#include <SiconosSets.h>

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 polyhedron
#include <SiconosSets.h>

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

Public Members

NumericsMatrix *H

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

NumericsMatrix *Heq

Heq matrix for the equality constraints Heq x = Keq.

int id

id of the structure, usually solver specific

double *K

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

double *Keq

Keq vector for the equality constraints Heq x = Keq.

unsigned size_eq

number of equalities

unsigned size_ineq

number of inequalities

union polyhedron_set

Public Members

generic_set *set
polyhedron *split
polyhedron_unified *unif
struct polyhedron_unified
#include <SiconosSets.h>

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

Public Members

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\)

int id

id of the structure, usually solver specific

char *type

type of constraint of type SICONOS_RELATION_TYPES