cuiksystem.h File Reference

Detailed Description

Definition of the TCuikSystem type and the associated functions.

See also
TCuikSystem, cuiksystem.c, readcuiksystem.l, readcuiksystem.y,

Definition in file cuiksystem.h.

Data Structures

struct  TStatistics
 Information about the performace of the solver. More...
 
struct  TCuikBox
 A box. More...
 
struct  TCuikSystem
 A cuiksystem, i.e., a set of variables and equations defining a position analysis problem. More...
 

Macros

#define ANGULAR_SPACE   1
 Work in angular space. More...
 
#define CONTRACTED   0
 One of the possible outcomes when reducing a box along a range. More...
 
#define REDUCED   1
 One of the possible outcomes when reducing a box along a range. More...
 
#define REDUCED_WITH_SOLUTION   2
 One of the possible outcomes when reducing a box along a range. More...
 
#define EMPTY   3
 One of the possible outcomes when reducing a box along a range. More...
 
#define NOT_REDUCED   4
 One of the possible outcomes when reducing a box along a range. More...
 
#define DEPTH_FIRST_SEARCH   1
 Depth first search. More...
 
#define BREADTH_FIRST_SEARCH   2
 Breadth first search. More...
 
#define SEARCH_MODE   DEPTH_FIRST_SEARCH
 Select the search mode. More...
 
#define CUT_POINT   0.5
 Point, relative to the size of the selected box side, where we split a box. More...
 

Functions

void InitStatistics (unsigned int nBoxes, unsigned int nReductions, unsigned int nBisected, unsigned int nEmpty, unsigned int nSols, unsigned int vSols, unsigned int maxLevel, TStatistics *st)
 Initializes statistics. More...
 
void ResetStatistics (TStatistics *st)
 Resets statistics. More...
 
void AccumulateStatistics (TStatistics *st, TStatistics *stg)
 Accumulates statistics. More...
 
void PrintStatistics (FILE *f, char *title, TStatistics *st)
 Prints the statistics. More...
 
void DeleteStatistics (TStatistics *st)
 Destructor. More...
 
void InitCuikBox (double *l, double *u, unsigned int d, TCuikBox *b)
 Initializes a cuik box. More...
 
void PrintCuikBox (FILE *f, TCuikBox *b)
 Prints a box. More...
 
void DeleteCuikBox (TCuikBox *b)
 Destructor. More...
 
void ReadCuikBoxList (FILE *f, Tlist *l)
 Reads a cuikbox list from a file. More...
 
void SaveCuikBoxList (FILE *f, unsigned int k, boolean angles, boolean offset, boolean error, boolean verified, TCuikSystem *cs, Tlist *l)
 Saves a cuikbox list to a file. More...
 
void VerifyCuikBoxes (Tparameters *p, boolean angles, FILE *f_out, unsigned int ns, TCuikSystem *cs, Tlist *s)
 Verifies solutions. More...
 
void CleanCuikBoxes (Tparameters *p, boolean angles, FILE *f_out, unsigned int ns, TCuikSystem *cs, Tlist *s)
 Removes spourious solutions. More...
 
void ClusterCuikBoxes (Tlist *c, double tol, boolean angles, Tlist *s)
 Groups boxes that are in contact. More...
 
void CuikBoxes2Angles (boolean *usedVars, unsigned int *varType, Tlist *s)
 Converts boxes in angular space. More...
 
double CuikBoxListVolume (boolean *used, Tlist *l)
 Volume of a list of boxes. More...
 
void DeleteCuikBoxList (Tlist *l)
 Deletes a cuikbox list from a file. More...
 
void InitCuikSystem (TCuikSystem *cs)
 Constructor. More...
 
unsigned int ReadProblemFromFile (Tparameters *p, char *filename, TCuikSystem **csa)
 Constructor from a file. More...
 
unsigned int Read6RFile (Tparameters *p, char *filename, TCuikSystem **csa)
 Constructor from a file. More...
 
void Loops2Cuik (Tparameters *p, char *filename)
 Converts from loops to a cuik file. More...
 
unsigned int ReadLoopsFile (Tparameters *p, char *filename, TCuikSystem **csa)
 Read a problem from a loops file. More...
 
unsigned int ReadCuikFile (Tparameters *p, char *filename, TCuikSystem **csa)
 Generate the cuik data from a file with equations/variables. More...
 
unsigned int ReadMAFFile (Tparameters *p, char *filename, TCuikSystem **csa)
 Read a problem from a MAF file. More...
 
void SaveCuikSystemToMAF (char *filename, unsigned int ns, TCuikSystem *csa)
 Saves a cuiksystem to a MAF file. More...
 
void CopyCuikSystem (TCuikSystem *cs_dst, TCuikSystem *cs_src)
 Copy constructor. More...
 
unsigned int GetCSNumVariables (TCuikSystem *cs)
 Gets the number of variables already in the cuiksystem. More...
 
unsigned int GetCSNumEquations (TCuikSystem *cs)
 Gets the number of equations already in the cuiksystem. More...
 
void SolveCuikSystem (unsigned int s, Tparameters *p, Tlist *searchSpace, FILE *f_out, Tlist *solutions, Tlist *verifiedS, TStatistics *st, TCuikSystem *cs)
 Determines the solution set for a cuiksystem. More...
 
void PropagateSolutions (unsigned int simplify, double epsilon, Tlist *solutions, TCuikSystem *cs)
 Defines ranges for the unused variables for a list of solutions. More...
 
boolean PropagateRanges (double epsilon, TCuikBox *b, TCuikSystem *cs)
 Defines ranges for the unused variables in a box. More...
 
void IntersectWithCuikSystem (Tparameters *p, Tlist *listIn, Tlist *listOut, TCuikSystem *cs)
 Intersect the boxes in a list with a given (sub-)problem. More...
 
unsigned int ComputeSplitDim (Tparameters *p, TCuikBox *b, TCuikSystem *cs)
 Determines the best dimensions to split a given box. More...
 
void EvaluateCSEquations (double *p, double *r, TCuikSystem *cs)
 Evaluates the equation set on a point. More...
 
void PrintCuikSystem (Tparameters *p, FILE *f, TCuikSystem *cs)
 Prints a cuiksystem. More...
 
void DeleteCuikSystem (TCuikSystem *cs)
 Destructor. More...
 

Macro Definition Documentation

◆ ANGULAR_SPACE

#define ANGULAR_SPACE   1

If set, the box sizes/volumes are computed in angular space.

Definition at line 21 of file cuiksystem.h.

◆ CONTRACTED

#define CONTRACTED   0

One of the possible outcomes when reducing a box along a range.

Definition at line 30 of file cuiksystem.h.

◆ REDUCED

#define REDUCED   1

One of the possible outcomes when reducing a box along a range.

Definition at line 37 of file cuiksystem.h.

◆ REDUCED_WITH_SOLUTION

#define REDUCED_WITH_SOLUTION   2

One of the possible outcomes when reducing a box along a range.

Definition at line 44 of file cuiksystem.h.

◆ EMPTY

#define EMPTY   3

One of the possible outcomes when reducing a box along a range.

Definition at line 51 of file cuiksystem.h.

◆ NOT_REDUCED

#define NOT_REDUCED   4

One of the possible outcomes when reducing a box along a range.

Definition at line 58 of file cuiksystem.h.

◆ DEPTH_FIRST_SEARCH

#define DEPTH_FIRST_SEARCH   1

In this mode, boxes to be reduced are sorted so that boxes with a higher level (i.e., resulting from more bisections) are treated first.

Definition at line 66 of file cuiksystem.h.

◆ BREADTH_FIRST_SEARCH

#define BREADTH_FIRST_SEARCH   2

In this mode, boxes to be reduced are sorted so that boxes with a smaller level (i.e., resulting from less bisections) are treated first.

Definition at line 74 of file cuiksystem.h.

◆ SEARCH_MODE

#define SEARCH_MODE   DEPTH_FIRST_SEARCH

Select the search mode.

Definition at line 81 of file cuiksystem.h.

◆ CUT_POINT

#define CUT_POINT   0.5

Point, relative to the size of the selected box side, where we split a box.

Definition at line 104 of file cuiksystem.h.

Function Documentation

◆ InitStatistics()

void InitStatistics ( unsigned int  nBoxes,
unsigned int  nReductions,
unsigned int  nBisected,
unsigned int  nEmpty,
unsigned int  nSols,
unsigned int  vSols,
unsigned int  maxLevel,
TStatistics st 
)
inline

Initializes the statistics.

Parameters
nBoxesThe number of processed boxes.
nReductionsThe number of reductions.
nBisectedThe number of bisected boxes.
nEmptyThe number of empty boxes.
nSolsThe number of solution boxes.
vSolsThe number of verified solution boxes.
maxLevelMaximum level of the processed boxes.
stThe statistics initialize.

Definition at line 70 of file cuiksystem.c.

References TStatistics::maxLevel, TStatistics::nBisected, TStatistics::nBoxes, TStatistics::nEmpty, TStatistics::nReductions, TStatistics::nSols, and TStatistics::vSols.

Referenced by SolveCuikSystem().

◆ ResetStatistics()

void ResetStatistics ( TStatistics st)

Sets all the statistics to 0.

Parameters
stThe statistics to initialize.

Definition at line 86 of file cuiksystem.c.

References TStatistics::maxLevel, TStatistics::nBisected, TStatistics::nBoxes, TStatistics::nEmpty, TStatistics::nReductions, TStatistics::nSols, and TStatistics::vSols.

Referenced by main().

◆ AccumulateStatistics()

void AccumulateStatistics ( TStatistics st,
TStatistics stg 
)

◆ PrintStatistics()

void PrintStatistics ( FILE *  f,
char *  title,
TStatistics st 
)

Prints the statistics.

Parameters
fThe file where to print the statistics.
titleTitle of the statistics.
stThe statistics to print.

Definition at line 115 of file cuiksystem.c.

References TStatistics::maxLevel, TStatistics::nBisected, TStatistics::nBoxes, TStatistics::nEmpty, TStatistics::nReductions, TStatistics::nSols, REDUNDANT_6R, and TStatistics::vSols.

Referenced by main().

◆ DeleteStatistics()

void DeleteStatistics ( TStatistics st)
inline

Releases any memory used by the statistics.

Parameters
stThe statistics to delete.

Definition at line 131 of file cuiksystem.c.

Referenced by main().

◆ InitCuikBox()

void InitCuikBox ( double *  l,
double *  u,
unsigned int  d,
TCuikBox b 
)

Initializes a cuik box.

Parameters
lThe lower limits.
uThe upper limits.
dDimension. Number of ranges in the box.
bThe box.

Definition at line 664 of file cuiksystem.c.

References TCuikBox::d, TCuikBox::l, TCuikBox::level, NEW, and TCuikBox::u.

Referenced by ReadMAFFile().

◆ PrintCuikBox()

void PrintCuikBox ( FILE *  f,
TCuikBox b 
)

Prints the limits of a box.

Parameters
fThe file.
bThe box.

Definition at line 1023 of file cuiksystem.c.

References TCuikBox::d, TCuikBox::l, and TCuikBox::u.

Referenced by CleanCuikBoxes(), PropagateRanges(), ReduceBox(), SaveCuikBoxList(), SolveCuikSystem(), SplitCuikBox(), and VerifyCuikBoxes().

◆ DeleteCuikBox()

void DeleteCuikBox ( TCuikBox b)

Releases memory.

Parameters
bThe box.

Definition at line 1091 of file cuiksystem.c.

References TCuikBox::l.

Referenced by DeleteCuikBoxList(), DeleteCuikSystem(), PropagateSolutions(), and SolveCuikSystem().

◆ ReadCuikBoxList()

void ReadCuikBoxList ( FILE *  f,
Tlist l 
)

Reads a cuikbox list from a file.

Parameters
fThe file.
lThe list.

Definition at line 1099 of file cuiksystem.c.

References AddLastElement(), InitList(), NEW, and ReadCuikBox().

Referenced by main().

◆ SaveCuikBoxList()

void SaveCuikBoxList ( FILE *  f,
unsigned int  k,
boolean  angles,
boolean  offset,
boolean  error,
boolean  verified,
TCuikSystem cs,
Tlist l 
)

Saves a cuikbox list to a file.

Parameters
fThe file.
kNumber solutions from this value.
anglesTRUE if we want to save in angular space.
offsetTRUE if the box has to be offset.
errorTRUE if we have to print the error.
verifiedTRUE if the list includes verified solutions.
csThe cuiksystem.
lThe list.

Definition at line 1134 of file cuiksystem.c.

References Advance(), CuikBox2Angles(), CuikBox2AnglesWithOffset(), CuikBoxOffset(), EndOfList(), ErrorInSolution(), First(), GetCurrent(), InitIterator(), TCuikSystem::offset, PrintCuikBox(), TCuikSystem::usedVars, and TCuikSystem::varType.

Referenced by main().

◆ VerifyCuikBoxes()

void VerifyCuikBoxes ( Tparameters p,
boolean  angles,
FILE *  f_out,
unsigned int  ns,
TCuikSystem cs,
Tlist s 
)

Tries to verify the existence of a solution in the input boxes.

Parameters
pThe set of parameters.
anglesTRUE if the boxes contain angles (not tangent parameters).
f_outThe file where to store the remaining solutions.
nsNumber of cuiksystems.
csThe cuiksystems.
sThe list of temptative solutions.

Definition at line 1204 of file cuiksystem.c.

References Advance(), CT_VERIFY, CuikBox2AnglesWithOffset(), CuikBox2TangentWithOffset(), CuikBoxOffset(), CuikBoxUnOffset(), EndOfList(), Error(), ErrorInSolution(), First(), GetCuikBoxOffset(), GetCurrent(), GetParameter(), InitIterator(), NEW, TCuikSystem::nv, PrintCuikBox(), REDUCED_WITH_SOLUTION, VERIFY_NEWTON, VERIFY_NEWTON_REPLACE, and VerifyBox().

Referenced by main().

◆ CleanCuikBoxes()

void CleanCuikBoxes ( Tparameters p,
boolean  angles,
FILE *  f_out,
unsigned int  ns,
TCuikSystem cs,
Tlist s 
)

Uses the simplex procedure to clean a list of solutions obtained with the trapezoid reduction method.

Parameters
pThe set of parameters.
anglesTRUE if the boxes contain angles (not tangent parameters).
f_outThe file where to store the remaining solutions.
nsNumber of cuiksystems.
csThe cuiksystems.
sThe list of temptative solutions.

Definition at line 1256 of file cuiksystem.c.

References Advance(), CLEAN_SIMPLEX, CT_CLEAN, CT_EPSILON, CuikBox2AnglesWithOffset(), CuikBox2TangentWithOffset(), CuikBoxOffset(), CuikBoxUnOffset(), EMPTY, EndOfList(), Error(), ErrorInSolution(), First(), GetCuikBoxOffset(), GetCurrent(), GetParameter(), InitIterator(), PrintCuikBox(), and REDUCED_WITH_SOLUTION.

Referenced by main().

◆ ClusterCuikBoxes()

void ClusterCuikBoxes ( Tlist c,
double  tol,
boolean  angles,
Tlist s 
)

Groups boxes that are in contact.

NOTE: The boxes resulting from the clustering are not updated (the evaluation of the equations in the corners are not up to date).

Parameters
cThe clustered boxes.
tolTolerance for the intersection.
anglesTRUE if the input boxes are angles.
sThe boxes to cluster.

Definition at line 1318 of file cuiksystem.c.

References AddLastElement(), Advance(), CopyCuikBox(), CuikBoxesIntersect(), CuikBoxUnion(), EndOfList(), FALSE, First(), GetCurrent(), InitIterator(), InitList(), ListSize(), NEW, and TRUE.

Referenced by main().

◆ CuikBoxes2Angles()

void CuikBoxes2Angles ( boolean usedVars,
unsigned int *  varType,
Tlist s 
)

Converts boxes in angular space.

Note that we convert the boxes "in place", without copying them. If you need the original boxes, better copy them before the conversion.

Moreover, the operation does not take into account the offsets in the angles. We assume that the input box is already offeset in tangent space (CuikBoxOffset).

Parameters
usedVarsThe used variables.
varTypeThe variable types.
sThe boxes to cluster.

Definition at line 1414 of file cuiksystem.c.

References Advance(), CuikBox2Angles(), EndOfList(), First(), GetCurrent(), and InitIterator().

◆ CuikBoxListVolume()

double CuikBoxListVolume ( boolean used,
Tlist l 
)

Adds the sum of the volumes of all the boxes in the list.

Parameters
usedUsed variables.
lThe list.
Returns
The volume.

Definition at line 1174 of file cuiksystem.c.

References Advance(), CuikBoxVolume(), EndOfList(), First(), GetCurrent(), and InitIterator().

Referenced by main().

◆ DeleteCuikBoxList()

void DeleteCuikBoxList ( Tlist l)

Deletes a cuikbox list from a file.

Parameters
lThe list.

Definition at line 1192 of file cuiksystem.c.

References DeleteCuikBox(), ExtractFirst(), and ListEmpty().

Referenced by main(), and SolveCuikSystem().

◆ InitCuikSystem()

◆ ReadProblemFromFile()

unsigned int ReadProblemFromFile ( Tparameters p,
char *  filename,
TCuikSystem **  csa 
)

Creates one or more cuiksystems from the information on a file.

The input file can be either a 6R description (following the convention by Manocha and Canny), a maf file (encoding a multi-affine system) or a cuik file (explicitly giving the variables and equations). In the later case, the maf file is generated on the fly.

Parameters
pThe set of parameters.
filenameThe name of the file from which to read the variables and equations.
csaThe array with the read cuiksytems.
Returns
The number of cuiksystems actually read.

Definition at line 2790 of file cuiksystem.c.

References TCuikSystem::boxL, TCuikSystem::boxU, CreateFileName(), CUIK_EXT, DeleteFileName(), Error(), TCuikSystem::f, GetFileExtension(), GetFileFullName(), TCuikSystem::J, LOOPS_EXT, TCuikSystem::lwork, MAF_EXT, TCuikSystem::maxEV, TCuikSystem::minEV, TCuikSystem::nc, TCuikSystem::ne, NEW, TCuikSystem::nv, TCuikSystem::outG, TCuikSystem::perm, Read6RFile(), ReadCuikFile(), ReadLoopsFile(), ReadMAFFile(), TCuikSystem::sing, TCuikSystem::veq, and TCuikSystem::work.

Referenced by main().

◆ Read6RFile()

unsigned int Read6RFile ( Tparameters p,
char *  filename,
TCuikSystem **  csa 
)

Creates one or more cuiksystems from the information on a 6R file defined uisng the Manocha convention:

  • a_1 ... a_6
  • d_1 ... d_6
  • alpha_1 ... alpha_6
  • R
  • t
Parameters
pThe set of parameters.
filenameThe name of the file from which to read the variables and equations.
csaThe array with the read cuiksytems.
Returns
The number of cuiksystems actually created. Typically 64 or 0 if there is an error reading the file.

Definition at line 2905 of file cuiksystem.c.

References Define6RProblem(), DEG2RAD, Error(), NEW, and NEWZ.

Referenced by ReadProblemFromFile().

◆ Loops2Cuik()

void Loops2Cuik ( Tparameters p,
char *  filename 
)

Reads a file of loops and writes a file of equations (cuik file).

In this file we do not take into account offsets. Note however that they can be given explicitly as variables in the loop file.

Parameters
pThe parameters.
filenameThe name of the file.

Referenced by main().

◆ ReadLoopsFile()

unsigned int ReadLoopsFile ( Tparameters p,
char *  filename,
TCuikSystem **  csa 
)

Generate the cuik data (num. variables, num equations, evaluation on a reference box, etc). from a file with the loop equations.

Parameters
pA set of parameters.
filenameThe name of the file from which to read the variables and equations.
csaThe array of cuiksystems to define.
Returns
The number of sub-problems generated. O if the file can not be found.

Referenced by ReadProblemFromFile().

◆ ReadCuikFile()

unsigned int ReadCuikFile ( Tparameters p,
char *  filename,
TCuikSystem **  csa 
)

Generate the cuik data (num. variables, num equations, evaluation on a reference box, etc). from a file with the variables and equations.

Parameters
pA set of parameters.
filenameThe name of the file from which to read the variables and equations.
csaThe array of cuiksystems to define.
Returns
The number of sub-problems generated. O if the file can not be found.

Referenced by ReadProblemFromFile().

◆ ReadMAFFile()

unsigned int ReadMAFFile ( Tparameters p,
char *  filename,
TCuikSystem **  csa 
)

Generate the cuik data (num. variables, num equations, evaluation on a reference box, etc). from a file in MAF format.

Parameters
pA set of parameters.
filenameThe name of the file from which to read the variables and equations.
csaThe array of cuiksystems to define.
Returns
The number of sub-problems generated. O if the file can not be found/parsed.

Definition at line 2988 of file cuiksystem.c.

References TCuikSystem::b0, TCuikSystem::f0, FALSE, InitCuikBox(), TCuikSystem::nc, TCuikSystem::ne, NEW, TCuikSystem::nIn, TCuikSystem::nOut, TCuikSystem::nSimp, TCuikSystem::nv, TCuikSystem::nve, TCuikSystem::offset, TCuikSystem::S, TRUE, TCuikSystem::usedVars, TCuikSystem::varType, TCuikSystem::ve, TCuikSystem::vIn, and TCuikSystem::vOut.

Referenced by ReadProblemFromFile().

◆ SaveCuikSystemToMAF()

void SaveCuikSystemToMAF ( char *  filename,
unsigned int  ns,
TCuikSystem csa 
)

MAF files include several problems, each with a different offset. The advantatge of MAF files is that there is no need to parse them and they already include the evaluation of the functions in the corners of the boxes to considere.

This function stores a set of cuiksystems into a MAF file.

Parameters
filenameThe name of the output file.
nsThe number of systems to save.
csaThe array of cuiksystems.

Definition at line 3113 of file cuiksystem.c.

References TCuikSystem::b0, CreateFileName(), DeleteFileName(), Error(), TCuikSystem::f0, GetFileFullName(), TCuikBox::l, MAF_EXT, TCuikSystem::nc, TCuikSystem::ne, TCuikSystem::nIn, TCuikSystem::nOut, TCuikSystem::nSimp, TCuikSystem::nv, TCuikSystem::nve, TCuikSystem::offset, TCuikSystem::S, TCuikBox::u, TCuikSystem::varType, TCuikSystem::ve, TCuikSystem::vIn, and TCuikSystem::vOut.

Referenced by main().

◆ CopyCuikSystem()

void CopyCuikSystem ( TCuikSystem cs_dst,
TCuikSystem cs_src 
)

Creates an cuiksystem from another cuiksystem.

Parameters
cs_dstThe cuiksystem to create via copy.
cs_srcThe cuiksystem from where to copy.

Definition at line 3213 of file cuiksystem.c.

References TCuikSystem::b0, TCuikSystem::boxL, TCuikSystem::boxU, CopyCuikBox(), TCuikSystem::f, TCuikSystem::f0, TCuikSystem::J, TCuikSystem::lwork, TCuikSystem::maxEV, TCuikSystem::minEV, TCuikSystem::nc, TCuikSystem::ne, NEW, TCuikSystem::nv, TCuikSystem::nve, TCuikSystem::outG, TCuikSystem::perm, TCuikSystem::sing, TCuikSystem::ve, TCuikSystem::veq, and TCuikSystem::work.

◆ GetCSNumVariables()

unsigned int GetCSNumVariables ( TCuikSystem cs)

Returns the number of variables already in the cuiksystem.

Parameters
csThe cuiksystem to query.
Returns
The number of variables already in the cuiksystem.

Definition at line 3295 of file cuiksystem.c.

References TCuikSystem::nv.

◆ GetCSNumEquations()

unsigned int GetCSNumEquations ( TCuikSystem cs)

Returns the number of equations already in the cuiksystem.

Parameters
csThe cuiksystem to query.
Returns
The number of equations already in the cuiksystem.

Definition at line 3303 of file cuiksystem.c.

References TCuikSystem::ne.

◆ SolveCuikSystem()

void SolveCuikSystem ( unsigned int  s,
Tparameters p,
Tlist searchSpace,
FILE *  f_out,
Tlist solutions,
Tlist verifiedS,
TStatistics st,
TCuikSystem cs 
)

This is the entry function for the Cuik solver. It takes as input a cuiksystem and returns a set of boxes bounding the solution set. If the solutions are isolated (zero-dimensional) the output is a set of isolated boxes. If the solution is continuous the output is a set of boxes bounding the solution space. Be aware that isolating solution sets with high dimensionality can be expensive. To this end it is recommended to use the parallel version of cuik

Parameters
sNumber of sub-problem
pA set of parameters.
searchSpaceBoxes defining the search space. NULL if we have to use the box defined from the ranges of the input variables.
f_outFile where to store the solution boxes. If NULL the boxes are not stored in the file.
solutionsA list where to store the non-verified solutions, If NULL the solutions are not added to the list.
verifiedSA list where to store the verified solutions, This can be NULL we do not want to classify the solutions.
stStructure where to accumulate the statistics. Can be NULL.
csThe cuiksystem to solve.
See also
MPI_SolveCuikSystem

Definition at line 3315 of file cuiksystem.c.

References AddFirstElement(), AddLastElement(), TCuikSystem::b0, CheckSolution(), CLEAN_SIMPLEX, ComputeSplitDim(), CopyCuikBox(), CopyCuikBoxList(), CT_CLEAN, CT_EPSILON, CT_REDUCTION, CT_SAVE_ANGLES, CT_SIGMA, CT_SIMPLIFY, CT_VERIFY, CuikBox2AnglesWithOffset(), CuikBoxOffset(), CuikBoxSize(), CuikBoxVolume(), CUT_POINT, DeleteCuikBox(), DeleteCuikBoxList(), EMPTY, Error(), ErrorInSolution(), ExtractFirst(), GetParameter(), InitList(), InitStatistics(), TCuikBox::level, ListEmpty(), NEW, TCuikSystem::nv, TCuikSystem::offset, PrintCuikBox(), PropagateSolutions(), RED_SIMPLEX, RED_TRAPEZOID, ReduceBox(), REDUCED_WITH_SOLUTION, SplitCuikBox(), TCuikSystem::usedVars, TCuikSystem::varType, VERIFY_MIRANDA, VERIFY_NEWTON, VERIFY_NEWTON_REPLACE, and VerifyBox().

Referenced by main().

◆ PropagateSolutions()

void PropagateSolutions ( unsigned int  simplify,
double  epsilon,
Tlist solutions,
TCuikSystem cs 
)

Consideres each solution box (as identified by SolveCuikSystem) and bounds the ranges of the unsused variables from the used ones using PropagateRanges

Unused variables are those eliminated in the simplification process.

Parameters
simplifyNumber of removed variables in the simplification (2 or 3).s
epsilonNumerical accuracy.
solutionsThe solutions identified with the reduced set of variables.
csThe cuiksystem.

Definition at line 3594 of file cuiksystem.c.

References A2T, Advance(), TCuikSystem::b0, DeleteCuikBox(), DeleteCurrent(), EndOfList(), Error(), FALSE, First(), GetCurrent(), INF, InitIterator(), TCuikBox::l, TCuikSystem::nSimp, TCuikSystem::nv, TCuikSystem::offset, PropagateRanges(), TRUE, TCuikBox::u, TCuikSystem::usedVars, VAR_ROT, and TCuikSystem::varType.

Referenced by SolveCuikSystem().

◆ PropagateRanges()

boolean PropagateRanges ( double  epsilon,
TCuikBox b,
TCuikSystem cs 
)

Bound the ranges of the unsused variables from the used ones.

Unused variables are those eliminated in the simplification process.

Rigth now this function is only defined for loop equations involving 6 variables from where 2 of them are removed (put in terms of the remaning 4).

Parameters
epsilonNumerical accuracy.
bThe box.
csThe cuiksystem.
Returns
TRUE if the box is not empty.

Definition at line 3668 of file cuiksystem.c.

References FALSE, Intersection(), IntervalAdd(), IntervalCenter(), IntervalDivision(), IntervalProduct(), IntervalScale(), TCuikBox::l, LowerLimit(), NEW, NewInterval(), TCuikSystem::nIn, TCuikSystem::nOut, TCuikSystem::nv, TCuikSystem::offset, PrintCuikBox(), PrintInterval(), PrintMatrix(), RC2INDEX, TCuikSystem::S, TCuikBox::u, UpperLimit(), TCuikSystem::vIn, and TCuikSystem::vOut.

Referenced by PropagateSolutions().

◆ IntersectWithCuikSystem()

void IntersectWithCuikSystem ( Tparameters p,
Tlist listIn,
Tlist listOut,
TCuikSystem cs 
)

Check the boxes in a list and keep those which intersect with the ranges in a given sub-problem (the ranges given by the offsets defining the sub-problem). We can either discard a box or keep the part of the box which intersect with the sub-problem.

Parameters
pThe set of parameters.
listInInput list of boxes.
listOutOutput list of boxes.
csThe sub-problem.

Definition at line 3805 of file cuiksystem.c.

References A2T, AddLastElement(), Advance(), CopyCuikBox(), CT_OFFSET, CT_SAVE_ANGLES, EndOfList(), Error(), FALSE, First(), GetCurrent(), GetParameter(), INF, InitIterator(), InitList(), Intersection(), TCuikBox::l, LowerLimit(), M_PI, NEW, NewInterval(), TCuikSystem::nv, OA, TCuikSystem::offset, T2A, TCuikBox::u, UpperLimit(), VAR_ROT, and TCuikSystem::varType.

Referenced by main().

◆ ComputeSplitDim()

unsigned int ComputeSplitDim ( Tparameters p,
TCuikBox b,
TCuikSystem cs 
)

Determines the dimension for which it is more advisable to split a box. The criterion to determine the split dimension can be selected through the parameters.

Parameters
pA set of parameters.
bThe box to be split.
csThe cuiksystem.
Returns
The dimension along to which the box is to be bisected.

Definition at line 3893 of file cuiksystem.c.

References Error(), TCuikBox::l, NO_UINT, TCuikSystem::nv, randomMax(), TCuikBox::u, TCuikSystem::usedVars, and Warning().

Referenced by SolveCuikSystem().

◆ EvaluateCSEquations()

void EvaluateCSEquations ( double *  p,
double *  r,
TCuikSystem cs 
)

Evaluates the equation set on a point.

Parameters
pThe point.
rThe array with the evaluation of each equation. The space for this array should be allocated externally.
csThe cuiksystem to query.

Definition at line 3931 of file cuiksystem.c.

References EvaluateCSEquation(), and TCuikSystem::ne.

Referenced by ComputeJacobian(), ErrorInSolution(), and Newton().

◆ PrintCuikSystem()

void PrintCuikSystem ( Tparameters p,
FILE *  f,
TCuikSystem cs 
)

Writes the cuiksystem in a file that can be stdout.

Parameters
pA set of parameters.
fThe stream where to write the cuiksystem.
csThe cuiksystem.

◆ DeleteCuikSystem()