Institut de Robòtica i Informàtica Industrial
KRD Group

The CuikSuite Project

parameters.h File Reference

Definition of the Tparameters type and the associated functions. More...

#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  Tparameter
 Information about a single parameter. More...

Defines

#define DEFAULT_PARAMS   "share/default.param"
 Default file of parameters.
#define CT_EPSILON   0
 Numerical tolerance.
#define CT_RHO   1
 Reduction threshold.
#define CT_SMALL_SIGMA   2
 Box size threshold.
#define CT_SIGMA   3
 Box size threshold.
#define CT_STATE_PERIOD   4
 Period between two consecutive savings of the state.
#define CT_DUMMIFY   5
 Dummification level.
#define CT_SPLIT_TYPE   6
 Split type.
#define CT_SAFE_SIMPLEX   7
 Trade off between speed and numerical stability when using the simplex.
#define CT_SIMPLIFICATION_LEVEL   8
 Simplification level.
#define CT_LR2TM_Q   9
 Threshold to switch from linear relaxations to Taylor models for quadratic equations.
#define CT_LR2TM_S   10
 Threshold to switch from linear relaxations to Taylor models for saddle equations.
#define NPARAMETERS   (CT_LR2TM_S+1)

Typedefs

typedef Tparameter Tparameters [NPARAMETERS]
 A table of parameters.

Functions

void InitParameters (Tparameters *p)
 Constructor.
void InitParametersFromFile (char *file, Tparameters *p)
 Constructor from a file.
double GetParameter (unsigned int n, Tparameters *p)
 Gets the value for a particular parameter.
void SetParameter (unsigned int n, char *name, double v, Tparameters *p)
 Sets the name and value for a particular parameter.
void ChangeParameter (unsigned int n, double v, Tparameters *p)
 Sets the value for a particular parameter.
void PrintParameters (FILE *f, Tparameters *p)
 Prints a parameter set.
void DeleteParameters (Tparameters *p)
 Destructor.

Detailed Description

Definition of the Tparameters type and the associated functions.

See also:
Tparameters, parameters.c, readparameters.l readparameters.y.

Definition in file parameters.h.


Define Documentation

#define DEFAULT_PARAMS   "share/default.param"

Default file of parameters. This is the file of parameters read in the first place, before reading the file specific for the problem at hand. In this way, the problem specific parameter need only to include values for the parameters whose value is not to be the default value.

Definition at line 24 of file parameters.h.

Referenced by InitParametersFromFile().

#define CT_EPSILON   0

Threshold to turn any number into 0 before passing it to the simplex. This should be larger than 1e-6, the threshold hard-coded in many simplex packages.

Definition at line 33 of file parameters.h.

Referenced by ComputeSplitDimInt(), CSRemoveLCVars(), CSRemoveUnusedVars(), CSRemoveVarsWithCtRange(), DummifyAndAddEquation(), DummifyCuikSystem(), ReduceBox(), ReduceBoxEquationWise(), SampleCuikSystemInBox(), SimplifyCuikSystem(), and UpdateCuikSystem().

#define CT_RHO   1

If boxes reduce more that RHO the reduction process is repeated.

Definition at line 40 of file parameters.h.

Referenced by ReduceBox(), and ReduceBoxEquationWise().

#define CT_SMALL_SIGMA   2

Size of the boxes bounding isolated solutions.

Size of the boxes close to obtacles.

Definition at line 49 of file parameters.h.

Referenced by ReduceBox(), ReduceBoxEquationWise(), and SampleCuikSystemInBox().

#define CT_SIGMA   3

Size of the boxes bounding continuous solution sets.

Size of the boxes in collision-free areas.

Definition at line 57 of file parameters.h.

Referenced by PostProcessBox(), and ReduceBox().

#define CT_STATE_PERIOD   4

Period between two consecutive savings of the internal cuik state.

Definition at line 64 of file parameters.h.

Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().

#define CT_DUMMIFY   5

Dummification level.

  • 0 keep in original form
  • 1 keep lineal,circles and spheres (the rest are transformed into linear,parabolas and saddles)
  • 2 keep lineal (the rest are transformed into linear,parabolas and saddles)
  • 3 keep lineal,circles, spheres and all inequalities (the rest are transformed into linear,parabolas and saddles)
  • 4 keep lineal and all inequalities (the rest are transformed into linear,parabolas and saddles)

Definition at line 77 of file parameters.h.

Referenced by DummifyAndAddEquation(), DummifyCuikSystem(), and main().

#define CT_SPLIT_TYPE   6

TRUE to use a linearization error minimization criterion to select the split dimension. FALSE to split along the largest side.

Definition at line 84 of file parameters.h.

Referenced by ComputeSplitDimInt(), and SampleCuikSystemInBox().

#define CT_SAFE_SIMPLEX   7

Trade off between speed and numerical stability when using the simplex Possible values are

  • 0 : no special numerical tricks are used
  • 1 : 0 + The output of the simplex are "corrected" to get safe bounds for the new ranges
  • 2 : 1 + The simplex tableau is reseted before the min/max for each range
  • 3 : 2 + The simlex tableau is reseted before all optimization.

Definition at line 96 of file parameters.h.

Referenced by ReduceBox().

#define CT_SIMPLIFICATION_LEVEL   8

Simplification level:

  • 0 No simplification is applied.
  • 1 Only equations of the form $x=a$ or $x^2=0$ are considered (with x a variable and a a constant).
  • 2 Equations of the form $x + a y=b$ are also considered (with x and y variables and a and b constants).
  • 3 Equations of the form $a x + b y=c$ are also considered (with x and y variables and a and b constants).

The less the simplification the more the numerical stability, but the slower the solution process.

A simplification level 2 should be Ok except for extremely ill conditioned cases.

Definition at line 116 of file parameters.h.

Referenced by CSRemoveLCVars(), PrintCuikSystemWithSimplification(), and SimplifyCuikSystem().

#define CT_LR2TM_Q   9

Threshold to switch from a specific linearization (one based on linear relaxations) to a general one (based on Taylorm models) for purely quadratic equations: parabolas, circles, and spheres.

Definition at line 127 of file parameters.h.

Referenced by ReduceBox().

#define CT_LR2TM_S   10

Threshold to switch from a specific linearization (one based on linear relaxations ) to a general one (based on Taylorm models) for saddle equations.

Definition at line 136 of file parameters.h.

Referenced by ReduceBox().

#define NPARAMETERS   (CT_LR2TM_S+1)

Total number of parameters.

Definition at line 143 of file parameters.h.

Referenced by ChangeParameter(), GetParameter(), InitParameters(), PrintParameters(), and SetParameter().


Typedef Documentation

typedef Tparameter Tparameters[NPARAMETERS]

A set of parameters. Each parameter is identified with a constant defined in file parameters.h.

This is basically a set of constants, but only a small, predefined set of constants are allowed. This is why we do not re-use Tconstants but provide a different implementation.

See also:
parameters.h, parameters.c

Definition at line 178 of file parameters.h.


Function Documentation

void InitParameters ( Tparameters p  ) 

Defines an empty set of parameters.

Parameters:
p The set to be initialized.

Definition at line 36 of file parameters.c.

References NPARAMETERS.

Referenced by InitParametersFromFile().

Here is the caller graph for this function:

void InitParametersFromFile ( char *  file,
Tparameters p 
)

Defines an set of parameters from a file. It first read the default set of parameters and then the given set of parameters.

Parameters:
file Name of the file with the set of parameters particular for the problem at hand.
p Set of parameters to define.
See also:
ReadParameters, defines.h

Definition at line 50 of file parameters.c.

References CreateFileName(), DEFAULT_PARAMS, DeleteFileName(), Error(), GetFileFullName(), InitParameters(), PARAM_EXT, and ReadParameters().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

double GetParameter ( unsigned int  n,
Tparameters p 
)

Gets the value for a particular parameter.

Parameters:
n Number of parameter.
p Set of parameters.
Returns:
The value of the parameter. If there is no parameter with the given number this functions triggers an error.

Definition at line 76 of file parameters.c.

References Error(), and NPARAMETERS.

Referenced by ComputeSplitDimInt(), CSRemoveLCVars(), CSRemoveUnusedVars(), CSRemoveVarsWithCtRange(), DummifyAndAddEquation(), DummifyCuikSystem(), MPI_SolveCuikSystem(), PostProcessBox(), PrintCuikSystemWithSimplification(), ReduceBox(), ReduceBoxEquationWise(), SampleCuikSystemInBox(), SimplifyCuikSystem(), SolveCuikSystem(), and UpdateCuikSystem().

Here is the call graph for this function:

Here is the caller graph for this function:

void SetParameter ( unsigned int  n,
char *  name,
double  v,
Tparameters p 
)

Sets the name and value for a particular parameter.

Parameters:
n Number of parameter.
name The name for the parameter. This is a string that is used when printing the parameter.
v The value.
p Set of parameters.

Definition at line 93 of file parameters.c.

References ChangeParameter(), Error(), and NPARAMETERS.

Here is the call graph for this function:

void ChangeParameter ( unsigned int  n,
double  v,
Tparameters p 
)

Sets the value for a particular parameter.

Parameters:
n Number of parameter.
v The new value for the parameter.
p Set of parameters.

Definition at line 112 of file parameters.c.

References Error(), NEW, and NPARAMETERS.

Referenced by main(), SampleCuikSystemInBox(), and SetParameter().

Here is the call graph for this function:

Here is the caller graph for this function:

void PrintParameters ( FILE *  f,
Tparameters p 
)

Writes a parameter set to a stream, that can be stdout.

Parameters:
f The stream
p Set of parameters to print.

Definition at line 133 of file parameters.c.

References NPARAMETERS.

Referenced by main().

Here is the caller graph for this function:

void DeleteParameters ( Tparameters p  ) 

Deletes a set of parameters and frees the allocated memory.

Parameters:
p Set of parameters to be deleted.

Definition at line 152 of file parameters.c.

Referenced by main().

Here is the caller graph for this function: