|
|
cuiksystem.h File ReferenceDefinition of the TCuikSystem type and the associated functions. More... #include "equations.h" #include "boolean.h" #include "variables.h" #include "interval.h" #include "variable_set.h" #include <stdlib.h> #include "linear_constraint.h" #include "box.h" #include "equation.h" #include <glpk.h> #include <Clp/Clp_C_Interface.h> #include <lp_solve/lp_lib.h> #include <stdio.h> #include <time.h> #include <sys/times.h> #include "list.h" #include "box_list.h" #include "vector.h" #include "csmapping.h" Go to the source code of this file.
Detailed DescriptionDefinition of the TCuikSystem type and the associated functions.
Definition in file cuiksystem.h. Define Documentation
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 32 of file cuiksystem.h. Referenced by InitCuikSystem(), MPI_SolveCuikSystem(), SetCSSearchMode(), SolveCuikSystem(), and UpdateCuikSystem().
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 41 of file cuiksystem.h. Referenced by MPI_SolveCuikSystem(), SetCSSearchMode(), and SolveCuikSystem().
In this mode, boxes to be reduced are sorted so that we tread first boxes whose value with repect to a given equation are minimal (among all boxes pending to be treated). In the current implementation the center of the box is used to evaluate the criterion to be minimized. Definition at line 54 of file cuiksystem.h. Referenced by AddTerm2SearchCriterion(), CopyCuikSystem(), EvaluateEqMin(), MPI_SolveCuikSystem(), PostProcessBox(), PrintCuikSystem(), PrintCuikSystemWithSimplification(), SetCSSearchMode(), SolveCuikSystem(), UnUpdateCuikSystem(), and UpdateCuikSystem().
Point, relative to the size of the selected box side, where we split a box. Definition at line 66 of file cuiksystem.h. Referenced by PostProcessBox(), and SplitGlobalBox().
Maximum time (in seconds) we give a child-process to reduce a box. Only used when cuik is executed in a multi-processor environment. Definition at line 75 of file cuiksystem.h. Referenced by MPI_SolveCuikSystem(). Function Documentation
Creates an empty cuiksystem.
Definition at line 2038 of file cuiksystem.c. References DEPTH_FIRST_SEARCH, TCuikSystem::empty, FALSE, InitEquation(), InitEquations(), InitVariables(), TCuikSystem::nequations, TCuikSystem::notDummyVar, TCuikSystem::nvariables, TCuikSystem::orig2sd, TCuikSystem::orig_eqMin, TCuikSystem::orig_equations, TCuikSystem::orig_nequations, TCuikSystem::orig_notDummyVar, TCuikSystem::orig_nvariables, TCuikSystem::orig_systemVar, TCuikSystem::orig_variables, TCuikSystem::searchMode, TCuikSystem::systemVar, TRUE, TCuikSystem::updated, and TCuikSystem::varType. Referenced by CuikSystemMerge(), and InitWorldCS().
Here is the call graph for this function:
Here is the caller graph for this function:
Creates an cuiksystem from the information on a file. Right now we do not have a manual of the syntax of the ".cuik" files so check the examples in the CuikSuite examples directory or in the benchmarks section of our web page
Referenced by main().
Here is the caller graph for this function:
Creates an cuiksystem from another cuiksystem.
Definition at line 2072 of file cuiksystem.c. References CopyEquation(), CopyEquations(), CopyMapping(), CopyStatistics(), CopyVariables(), TCuikSystem::empty, TCuikSystem::eqMin, TCuikSystem::equations, MINIMIZATION_SEARCH, TCuikSystem::nequations, NEW, TCuikSystem::notDummyVar, TCuikSystem::nvariables, TCuikSystem::orig2sd, TCuikSystem::orig_eqMin, TCuikSystem::orig_equations, TCuikSystem::orig_nequations, TCuikSystem::orig_notDummyVar, TCuikSystem::orig_nvariables, TCuikSystem::orig_systemVar, TCuikSystem::orig_variables, TCuikSystem::searchMode, TCuikSystem::st, TCuikSystem::systemVar, TCuikSystem::updated, TCuikSystem::variables, and TCuikSystem::varType.
Here is the call graph for this function:
Defines a new cuiksystem by union of two given cuiksystems. CAUTION!
Definition at line 2149 of file cuiksystem.c. References AccumulateEquations(), AddEquation2CS(), AddVariable2CS(), CopyEquation(), CopyEquations(), CopyVariables(), TCuikSystem::empty, FALSE, GetEquation(), GetVariable(), InitCuikSystem(), NEquations(), TCuikSystem::nequations, TCuikSystem::notDummyVar, NVariables(), TCuikSystem::nvariables, TCuikSystem::orig2sd, TCuikSystem::orig_eqMin, TCuikSystem::orig_equations, TCuikSystem::orig_nequations, TCuikSystem::orig_notDummyVar, TCuikSystem::orig_nvariables, TCuikSystem::orig_systemVar, TCuikSystem::orig_variables, TCuikSystem::searchMode, TCuikSystem::systemVar, TCuikSystem::updated, and TCuikSystem::varType.
Here is the call graph for this function:
Determines which box to explore first in minimization mode. In this mode boxes are sorted according to an objective function given by an equation in the problem file. The equation is evaluated at the center of the box and the box with a minimum value is processed first.
Definition at line 2237 of file cuiksystem.c. References EvaluateEqMin(). Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Defines the criterion to be used sorting the boxes to be treated when searching for a solution. Possible critera are
Definition at line 2242 of file cuiksystem.c. References BREADTH_FIRST_SEARCH, CopyEquation(), DeleteEquation(), DEPTH_FIRST_SEARCH, Error(), MINIMIZATION_SEARCH, TCuikSystem::orig_eqMin, and TCuikSystem::searchMode. Referenced by AddTerm2SearchCriterion().
Here is the call graph for this function:
Here is the caller graph for this function:
Adds the to the equation guiding the search. This function automatically calls SetCSSearchMode to set the search mode to MINIMIZATION_SEARCH it is is not so.
Definition at line 2262 of file cuiksystem.c. References AccumulateEquations(), AddCt2Monomial(), AddMonomial(), AddVariable2Monomial(), DeleteEquation(), DeleteMonomial(), EQU, InitEquation(), InitMonomial(), MINIMIZATION_SEARCH, TCuikSystem::orig_eqMin, ResetMonomial(), TCuikSystem::searchMode, SetCSSearchMode(), and SetEquationCmp(). Referenced by GenerateJointRangeEquations().
Here is the call graph for this function:
Here is the caller graph for this function:
Adds a new variable to the system.
Definition at line 2319 of file cuiksystem.c. References AddVariable(), GetVariableID(), GetVariableName(), NO_UINT, TCuikSystem::orig_variables, UnUpdateCuikSystem(), and TCuikSystem::updated. Referenced by CuikSystemMerge(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointRangeEquations(), and GenerateLinkRot().
Here is the call graph for this function:
Here is the caller graph for this function:
Adds a new equation to the system. The equation must use the variables already added to the system. Repeated equations are not added to the system.
Definition at line 2305 of file cuiksystem.c. References AddEquation(), TCuikSystem::orig_equations, UnUpdateCuikSystem(), and TCuikSystem::updated. Referenced by CuikSystemMerge(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointRangeEquations(), and GenerateLinkRot().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns a copy of the variables stored in the cuiksystem. This can be seen as a Tvariables copy constructor, thus the output variables does not need to be initialized beforehand.
Definition at line 2337 of file cuiksystem.c. References CopyVariables(), and TCuikSystem::orig_variables.
Here is the call graph for this function:
Returns the number of variables already in the cuiksystem.
Definition at line 2345 of file cuiksystem.c. References NVariables(), and TCuikSystem::orig_variables. Referenced by MoveWorld(), and SampleCuikSystemInBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the number of non-dummy (i.e., the sum of system, secondary and cartesian variables) variables already in the cuiksystem.
Definition at line 2353 of file cuiksystem.c. References GetNumDummyVariables(), NVariables(), and TCuikSystem::orig_variables. Referenced by AnimateWorld().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns a copy of one of the variables of the cuiksystem. This can be seen as a Tvariable copy constructor, thus the output variable does not need to be initialized beforehand.
Definition at line 2361 of file cuiksystem.c. References CopyVariable(), GetVariable(), and TCuikSystem::orig_variables.
Here is the call graph for this function:
Returns a copy of the range of one of the variables of the cuiksystem. This can be seen as a Tinterval constructor, thus the output interval does not need to be initialized beforehand.
Definition at line 2369 of file cuiksystem.c. References GetVariable(), TCuikSystem::orig_variables, SetVariableInterval(), UnUpdateCuikSystem(), and TCuikSystem::updated. Referenced by SampleCuikSystemInBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the numerical identifier of a variable given its name.
Definition at line 2381 of file cuiksystem.c. References GetVariableID(), and TCuikSystem::orig_variables. Referenced by ApplyLinkRot(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), GenerateLinkRot(), GetTransform2Link(), and RegenerateJointSolution().
Here is the call graph for this function:
Here is the caller graph for this function:
Creates an array of booleans with the size of the number of variables in the cuiksystem and set to TRUE the entries corresponding to system variables.
Definition at line 2391 of file cuiksystem.c. References IsSecondaryVariable(), IsSystemVariable(), NEW, NVariables(), and TCuikSystem::orig_variables. Referenced by GenerateWorldEquationSystems(), GetWorldSystemVars(), main(), and SampleCuikSystemInBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns a copy of the system equations. This is a Tequations copy constructor.
Definition at line 2407 of file cuiksystem.c. References CopyEquations(), and TCuikSystem::orig_equations.
Here is the call graph for this function:
Returns the number of equations already in the cuiksystem.
Definition at line 2423 of file cuiksystem.c. References NEquations(), and TCuikSystem::orig_equations. Referenced by SampleCuikSystemInBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns a copy of one of the equations of the cuiksystem. This can be seen as a Tequation copy constructor.
Definition at line 2415 of file cuiksystem.c. References CopyEquation(), GetEquation(), and TCuikSystem::orig_equations.
Here is the call graph for this function:
Defines the Jacobian of a CuikSystem considering each equation as a function. Defines an array with as many rows as equations and as many columns as variables where each entry (i,j) is de derivative of equation i (considered as a function) with repect to variable j. Note that the space for the derivatives is reserved insided this function and should be freed using DeleteCuikSystemJacobian.
Definition at line 2428 of file cuiksystem.c. References DeriveEquation(), GetEquation(), NEquations(), NEW, NVariables(), TCuikSystem::orig_equations, and TCuikSystem::orig_variables.
Here is the call graph for this function:
Deletes the Jacobian generated by GetCuikSystemJacobian.
Definition at line 2444 of file cuiksystem.c. References DeleteEquation(), NEquations(), NVariables(), TCuikSystem::orig_equations, and TCuikSystem::orig_variables.
Here is the call graph for this function:
Reduces a box using the constraints included in the cuiksystem and using the algorithms described in our papers.
Definition at line 2514 of file cuiksystem.c. References DeleteBox(), DUMMY_VAR, EMPTY_BOX, TCuikSystem::orig2sd, ReduceBox(), SimpleFromOriginal(), UpdateCuikSystem(), and UpdateOriginalFromSimple(). Referenced by MaxKinematicReduction(), and SampleCuikSystemInBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Determine points for which all the equations in the cuiksystem hold. Actually it determines tiny boxes (boxes with size below EPSILON) and the center of the box is taken as the solution point. Since, in general, EPSILON is very small (1e-6) the error of the given solutions is also tiny (order of 1e-12).
Definition at line 2538 of file cuiksystem.c. References DeleteBox(), GenerateInitialBox(), and SampleCuikSystemInBox().
Here is the call graph for this function:
This like function SampleCuikSystem but the samples are generated only in the given box. Morover, this function can store the (tiny) solution boxes in a list of boxes.
Definition at line 2554 of file cuiksystem.c. References AddLastElement(), Advance(), ChangeParameter(), ComputeSplitDim(), CopyBox(), CreateFileName(), CT_EPSILON, CT_SMALL_SIGMA, CT_SPLIT_TYPE, DeleteBox(), DeleteFileName(), DeleteListOfBoxes(), DUMMY_VAR, EMPTY_BOX, EndOfList(), Error(), FALSE, First(), GenerateInitialBox(), GetBoxInterval(), GetCSNumEquations(), GetCSNumVariables(), GetCSSystemVars(), GetCurrent(), GetFileFullName(), GetParameter(), GetVariable(), GetVariableTypeN(), InitIterator(), InitListOfBoxes(), IntervalCenter(), MaxReduction(), NEW, NewInterval(), NO_UINT, NVariables(), TCuikSystem::orig_equations, TCuikSystem::orig_variables, PrintBox(), randomInInterval(), SAMPLE_EXT, SetCSVariableRange(), SetVariableInterval(), SOL_EXT, SolveCuikSystem(), SYSTEM_VAR, TRUE, UnUpdateCuikSystem(), TCuikSystem::updated, and UsedVarInEquations(). Referenced by SampleCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
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
Definition at line 2809 of file cuiksystem.c. References AddBox2HeapOfBoxes(), AddList2Heap(), BoxFromVariables(), BREADTH_FIRST_SEARCH, CmpBoxBreadthFirst(), CmpBoxDepthFirst(), CmpBoxesEquation(), CT_STATE_PERIOD, DeleteBox(), DeleteHeap(), DeleteListOfBoxes(), DEPTH_FIRST_SEARCH, DUMMY_VAR, EvaluateEqMin(), ExtractMinElement(), FALSE, GetBoxLevel(), GetBoxSize(), GetBoxVolume(), GetNSolutionBoxes(), GetParameter(), Heap2List(), HeapEmpty(), HeapOfBoxesVolume(), InitHeapOfBoxes(), InitStatistics(), LoadCSState(), MINIMIZATION_SEARCH, NewBoxProcessed(), NewMaxLevel(), PostProcessBox(), PrintBox(), PrintStatistics(), ReduceBox(), SaveCSState(), TCuikSystem::searchMode, TCuikSystem::st, TCuikSystem::systemVar, UpdateCuikSystem(), and TCuikSystem::variables. Referenced by main(), and SampleCuikSystemInBox().
Here is the call graph for this function:
Here is the caller graph for this function:
This is the parallel version of SolveCuikSystem. Actually this function is the main scheduler, i.e., the one in charge of managing the boxes to be processes to send them to the child processors. to collec the result, and to deal with them accordingly (bisect, consider solutions, discard if they are empty,...).
Definition at line 2966 of file cuiksystem.c. References AddBox2HeapOfBoxes(), AddFirstElement(), AddList2Heap(), AddNBoxReductions(), Box2Buffer(), BoxFromVariables(), BREADTH_FIRST_SEARCH, Buffer2Box(), CmpBoxBreadthFirst(), CmpBoxDepthFirst(), CmpBoxesEquation(), CT_STATE_PERIOD, DeleteBox(), DeleteHeap(), DeleteListOfBoxes(), DeleteStatistics(), DEPTH_FIRST_SEARCH, Error(), ERROR_IN_PROCESS, ExtractMinElement(), FALSE, GetBoxBufferSize(), GetBoxLevel(), GetBoxSize(), GetBoxVolume(), GetParameter(), Heap2List(), HeapEmpty(), HeapOfBoxesVolume(), HeapSize(), InitBox(), InitHeapOfBoxes(), InitStatistics(), LoadCSState(), MINIMIZATION_SEARCH, MPI_TREAT_BOX_TIMEOUT, NEW, NewBoxProcessed(), NewLostBox(), NewMaxLevel(), TCuikSystem::nvariables, PostProcessBox(), PrintBox(), PrintStatistics(), REDUCED_BOX, SaveCSState(), TCuikSystem::searchMode, TCuikSystem::st, TCuikSystem::systemVar, TRUE, UpdateCuikSystem(), and TCuikSystem::variables. Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
This is the function executed by the child processors when solving a problem in a multi-processor environment.
Definition at line 3325 of file cuiksystem.c. References Box2Buffer(), Buffer2Box(), DeleteBox(), DUMMY_VAR, FALSE, GetBoxBufferSize(), GetNBoxReductions(), InitBox(), NEW, TCuikSystem::nvariables, PrintBox(), ReduceBox(), ResetNBoxReductions(), TCuikSystem::st, TRUE, and UpdateCuikSystem(). Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
Determines the search space for the solutions of a cuiksystem in the form of a box defined from the variable ranges.
Definition at line 3417 of file cuiksystem.c. References BoxFromVariables(), and TCuikSystem::orig_variables. Referenced by GetGlobalInitialBox(), SampleCuikSystem(), and SampleCuikSystemInBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Generates a box in the original cuiksystem from a box of the simplified one. You can generate a simplified cuiksystem using cuiksimplify and then solve it. To obtain the solution boxes in the un-simplified (or original) system using the cuikunsimplify application that basically relies on this function.
Definition at line 3422 of file cuiksystem.c. References BoxFromVariables(), Error(), TCuikSystem::orig2sd, TCuikSystem::orig_variables, UpdateCuikSystem(), and UpdateOriginalFromSimple(). Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
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.
Definition at line 3440 of file cuiksystem.c. References ComputeSplitDimInt(), DeleteBox(), GetVarIDInOriginal(), NO_UINT, TCuikSystem::orig2sd, SimpleFromOriginal(), and UpdateCuikSystem(). Referenced by SampleCuikSystemInBox(), and SplitGlobalBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Determines if a given point is fully included in the system sub-box (i.e., the sub-box fot the system variables). The point is typically one obtained via sampling.
Definition at line 3461 of file cuiksystem.c. References Error(), GetBoxInterval(), GetBoxNIntervals(), GetVectorElement(), IsDummyVariable(), IsInside(), NVariables(), TCuikSystem::orig_variables, and TRUE.
Here is the call graph for this function:
Computes the error for the solution represented by a box. The error is computed taking the central point of the box and replacing the values in the equation set. Only system equality equations are taken into account in the error.
Definition at line 3494 of file cuiksystem.c. References EQU, Error(), EvaluateEquation(), GetBoxInterval(), GetBoxNIntervals(), GetEquation(), GetEquationCmp(), GetEquationType(), GetEquationValue(), IntervalCenter(), NEquations(), NEW, NVariables(), TCuikSystem::orig_equations, TCuikSystem::orig_nvariables, TCuikSystem::orig_variables, and SYSTEM_EQ. Referenced by PostProcessBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Computes the error for the solution represented by a box as far as inequalities is concerned. The error is computed taking the central point of the box and replacing the values in the equation set. This can be seen as a complement of ErrorInSolution when inequalities are also to be taken into account.
Definition at line 3534 of file cuiksystem.c. References Error(), EvaluateEquation(), GEQ, GetBoxInterval(), GetBoxNIntervals(), GetEquation(), GetEquationCmp(), GetEquationValue(), IntervalCenter(), LEQ, NEquations(), NEW, NVariables(), TCuikSystem::orig_equations, TCuikSystem::orig_nvariables, and TCuikSystem::orig_variables.
Here is the call graph for this function:
Coordenalization inequalities are used for collision detection. This function tests if all coordenalization inqualities hold for the given variable ranges. If so, the box is collision free. This is a very simple test that, in most of the cases, fails. It is only effective when we select a fix separating plane (maybe sampling in the space of valid parameters for the separating planes). It is also effective when the mechanisms is only composed by spheres and the collision detection is based on computing the distance between the sphere centers. Intuitively, since the sphere radii is constant, this is like having a fix separating plane.
Definition at line 3585 of file cuiksystem.c. References COORD_EQ, Error(), EvaluateEquationInt(), GEQ, GetBoxIntervals(), GetBoxNIntervals(), GetEquation(), GetEquationCmp(), GetEquationType(), GetEquationValue(), LEQ, LowerLimit(), NEquations(), NVariables(), TCuikSystem::orig_equations, TCuikSystem::orig_variables, TRUE, and UpperLimit().
Here is the call graph for this function:
Writes the cuiksystem in a file that can be stdout.
Definition at line 3631 of file cuiksystem.c. References GetVariableNames(), MINIMIZATION_SEARCH, NEW, NVariables(), TCuikSystem::orig_eqMin, TCuikSystem::orig_equations, TCuikSystem::orig_variables, PrintEquations(), PrintMonomials(), PrintVariables(), and TCuikSystem::searchMode. Referenced by PrintWorldCS().
Here is the call graph for this function:
Here is the caller graph for this function:
Writes the cuiksystem in a file that can be stdout. This function is like PrintCuikSystem but it prints both the original set of equations and the simplified one, plus the mapping between them.
Definition at line 3656 of file cuiksystem.c. References CT_SIMPLIFICATION_LEVEL, TCuikSystem::eqMin, TCuikSystem::equations, GetParameter(), GetVariableNames(), MINIMIZATION_SEARCH, NEW, NVariables(), TCuikSystem::orig2sd, TCuikSystem::orig_eqMin, TCuikSystem::orig_equations, TCuikSystem::orig_variables, PrintEquations(), PrintMapping(), PrintMonomials(), PrintVariables(), TCuikSystem::searchMode, UpdateCuikSystem(), and TCuikSystem::variables. Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
Saves the simplification information associated with a cuiksystem.
Definition at line 3703 of file cuiksystem.c. References TCuikSystem::orig2sd, SaveMapping(), and UpdateCuikSystem().
Here is the call graph for this function:
Deletes a cuiksystem.
Definition at line 3714 of file cuiksystem.c. References DeleteEquations(), DeleteStatistics(), DeleteVariables(), TCuikSystem::empty, TCuikSystem::orig_equations, TCuikSystem::orig_variables, TCuikSystem::st, TRUE, and UnUpdateCuikSystem(). Referenced by DeleteWorldCS(), and main().
Here is the call graph for this function:
Here is the caller graph for this function:
|