|
|
cuiksystem.c File ReferenceImplementation of the functions operating on TCuikSystem. More... #include "cuiksystem.h" #include "error.h" #include "boolean.h" #include "defines.h" #include "box_list.h" #include "box_heap.h" #include "simplex.h" #include "random.h" #include "filename.h" #include "geom.h" #include <stdlib.h> #include <gsl/gsl_linalg.h> #include <math.h> #include <string.h> #include <sys/time.h> #include <signal.h> #include <mpi.h> #include <sys/resource.h> #include <time.h> #include <unistd.h> Go to the source code of this file.
Detailed DescriptionImplementation of the functions operating on TCuikSystem.
Definition in file cuiksystem.c. Function Documentation
Adds an equation to the cuiksystem taking into account the dummification level selected by the user when fixing the parameters. In the extreme dummification level, all quadratic and bilinear terms in the equations are replaced by a new (dummy) variable and the corresponding equation parabola or saddle equation is added to the system. In the other extreme (i.e., not to dummify anything) equations are added as given by the user to the system.
Definition at line 431 of file cuiksystem.c. References AddCt2Monomial(), AddEquation(), AddMonomial(), AddVariable(), AddVariable2Monomial(), CircleEquation(), CT_DUMMIFY, CT_EPSILON, DeleteEquation(), DeleteMonomial(), DeleteVariable(), DUMMY_EQ, DUMMY_VAR, EQU, TCuikSystem::equations, Error(), GetEquationCmp(), GetEquationType(), GetEquationValue(), GetEquationVariables(), GetMonomial(), GetMonomialCt(), GetMonomialVariables(), GetNumMonomials(), GetParameter(), GetVariable(), GetVariableID(), GetVariableInterval(), GetVariableN(), GetVariableName(), GetVariablePowerN(), InitEquation(), InitMonomial(), IntervalPow(), IntervalProduct(), LinearEquation(), NEW, NewVariable(), NO_UINT, NVariables(), ParabolaEquation(), SaddleEquation(), SetEquationCmp(), SetEquationType(), SetEquationValue(), SetVariableInterval(), SphereEquation(), TRUE, TCuikSystem::variables, and VariableSetSize(). Referenced by DummifyCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Dummify all equations in the cuiksystem according to the parameters given by the user.
Definition at line 691 of file cuiksystem.c. References CopyEquations(), CT_DUMMIFY, CT_EPSILON, DeleteEquations(), DummifyAndAddEquation(), TCuikSystem::equations, GetEquation(), GetParameter(), InitEquations(), and NEquations(). Referenced by SimplifyCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Evaluates the equation to minimize when the search mode is set to MINIMIZATION_SEARCH. In any other search mode the output is 0. Note that the input box is a box in the simplified system since, for efficiency, the equation to minimize is re-written into this system too.
Definition at line 2193 of file cuiksystem.c. References Error(), EvaluateEquation(), EvaluateEquationInt(), GetBoxInterval(), GetBoxIntervals(), GetEquationValue(), IntervalCenter(), IntervalOffset(), MINIMIZATION_SEARCH, NEW, and NVariables(). Referenced by CmpBoxesEquation(), PostProcessBox(), and SolveCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Reduces the ranges of a box considering one equation at a time. Linear equations are cropped directly and non-linear equations are linearized. Special treatement is implement for parabola, circle, sphere, and saddle equations since they appear frequently and the non-linear cropping is stronger than the one obtained via linearization.
Definition at line 712 of file cuiksystem.c. References CopyBox(), CropEquation(), CT_EPSILON, CT_RHO, CT_SMALL_SIGMA, DeleteBox(), EMPTY_BOX, TCuikSystem::equations, FALSE, GetBoxInterval(), GetBoxSize(), GetBoxVolume(), GetParameter(), IntervalSize(), TCuikSystem::nvariables, PrintBox(), REDUCED_BOX, TCuikSystem::systemVar, and TRUE. Referenced by ReduceBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Reduces the ranges of a box as much as possible applying first an equation-wise crop and then a simplex-based reduction. If the reduction is significative (i.e., the reduction ratio is above paramter RHO) and the box is not smaller than SMALL_SIGMA, the reduction process is iterated.
Definition at line 831 of file cuiksystem.c. References AddEquation2Simplex(), BoxInclusion(), CopyBox(), CT_EPSILON, CT_LR2TM_Q, CT_LR2TM_S, CT_RHO, CT_SAFE_SIMPLEX, CT_SIGMA, CT_SMALL_SIGMA, DeleteBox(), TCuikSystem::empty, EMPTY_BOX, TCuikSystem::equations, Error(), ERROR_IN_PROCESS, FALSE, GetBoxInterval(), GetBoxSize(), GetBoxVolume(), GetParameter(), IntervalSize(), NewBoxReduction(), TCuikSystem::notDummyVar, TCuikSystem::nvariables, PrintBox(), ReduceBoxEquationWise(), REDUCED_BOX, REDUCED_BOX_WITH_SOLUTION, ReduceRange(), ResetSimplex(), SimplexColEmpty(), SimplexCreate(), SimplexDelete(), SimplexNRows(), TCuikSystem::st, TCuikSystem::systemVar, TRUE, TCuikSystem::updated, TCuikSystem::variables, and TCuikSystem::varType. Referenced by MaxReduction(), MPI_TreatBox(), and SolveCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
After box reduction we have to decide what to do with the box. If it empty, we just discart it. If is small enough (smaller than SIGMA) we consider it as a solution. Finally, non-empty, non-small boxes are bisected and added to the list of boxes pending to be processed.
Definition at line 1058 of file cuiksystem.c. References AddBox2HeapOfBoxes(), AddLastElement(), BoxFromVariables(), ComputeSplitDimInt(), CopyBox(), CT_SIGMA, CUT_POINT, DeleteBox(), EMPTY_BOX, ERROR_IN_PROCESS, ErrorInSolution(), EvaluateEqMin(), GetBoxDiagonal(), GetBoxSize(), GetBoxVolume(), GetElapsedTime(), GetNSolutionBoxes(), GetParameter(), MINIMIZATION_SEARCH, NEW, NewEmptyBox(), NewRBError(), NewSolutionBox(), NewSplittedBox(), TCuikSystem::orig2sd, TCuikSystem::orig_systemVar, TCuikSystem::orig_variables, PrintBox(), PrintBoxSubset(), REDUCED_BOX_WITH_SOLUTION, TCuikSystem::searchMode, SplitBox(), TCuikSystem::st, TCuikSystem::systemVar, and UpdateOriginalFromSimple(). Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Remove the variables that do not appear in the equation set.
Definition at line 1228 of file cuiksystem.c. References CT_EPSILON, DUMMY_VAR, TCuikSystem::equations, GetParameter(), GetVariableTypeN(), NVariables(), RemoveEquationsWithVar(), RemoveVariable(), SYSTEM_VAR, UsedVarInEquations(), UsedVarInNonDummyEquations(), and TCuikSystem::variables. Referenced by SimplifyCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Variables with punctual range are constants that can be removed from the equations. If the variables was previously used to replace another variable in the cuiksystem then the replaced variable also becomes constant.
Definition at line 1254 of file cuiksystem.c. References AddCt2LinearConstraint(), CT_EPSILON, DeleteLinearConstraint(), TCuikSystem::equations, Error(), FALSE, GetBoxInterval(), GetParameter(), GetVariable(), GetVariableID(), GetVariableName(), GetVariableNames(), InitLinearConstraint(), IntervalSize(), LowerLimit(), NEW, NO_UINT, NVariables(), TCuikSystem::orig_variables, PrintEquations(), PrintVariables(), RemoveVariable(), ReplaceVariableInEquations(), TRUE, and TCuikSystem::variables. Referenced by SimplifyCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Detects equations of the form
From where a variable replacement can be defined
Note that if was used to replace another variable, , the elimination of has to be propagated to the linear constraint replacing . This is one of the steps executed in the cuiksystem simplification. The simplification is the process of defining a new set of equations and variables from those given by the user but eliminating variables with trivial values or variables that are linearly related with other variables. In this process, all variable indexes are referred to those in the original cuiksystem (since the simplified one is still in construction).
Definition at line 1339 of file cuiksystem.c. References AddCt2LinearConstraint(), AddLinearConstraints(), AddTerm2LinearConstraint(), CopyLinearConstraint(), CropLinearConstraint(), CT_EPSILON, CT_SIMPLIFICATION_LEVEL, DeleteLinearConstraint(), TCuikSystem::equations, Error(), FALSE, GetEquation(), GetLinearConstraintCoefficient(), GetLinearConstraintError(), GetLinearConstraintVariable(), GetNumTermsInLinearConstraint(), GetParameter(), GetVariable(), GetVariableID(), GetVariableName(), GetVariableNames(), IntervalCenter(), IntervalSize(), IsSimplificable(), IsSystemVariable(), LinearConstraintIncludes(), NEquations(), NEW, NO_UINT, NVariables(), TCuikSystem::orig_variables, PrintEquations(), PrintLinearConstraint(), PrintVariables(), RemoveTermFromLinearConstraint(), RemoveVariable(), ReplaceVariableInEquations(), ScaleLinearConstraint(), TRUE, TCuikSystem::variables, and ZERO. Referenced by SimplifyCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Generate a simplified version of a cuiksystem by eliminating variables with constant values from the equations and by replacing variables by other variables if there is a linear dependency between them. Simplifications can introduce numerical issues. For instance to replace a variable that appear in a equation like
we have to operate b/a and this can introduce perturbations in the system due to floating point rounding. We try to do our best to avoid problems (for instance we only apply the above simplification if a=1) but small perturbation are unavoidable in general and for particularly ill-conditioned problems they can lead to simplified systems with a different set of solutions than the original system. If you encounter such a problem it would be safer to operate directly with the original system and not with the simplified one. This can be done, setting the SIMPLIFICATION_LEVEL parameter to 0.
Definition at line 1501 of file cuiksystem.c. References AddCt2LinearConstraint(), AddTerm2LinearConstraint(), BoxFromVariables(), CopyEquations(), CopyVariables(), CSRemoveLCVars(), CSRemoveUnusedVars(), CSRemoveVarsWithCtRange(), CT_EPSILON, CT_SIMPLIFICATION_LEVEL, DeleteBox(), DeleteLinearConstraint(), DummifyCuikSystem(), TCuikSystem::equations, FALSE, GaussianElimination(), GetBoxInterval(), GetLinearConstraintCoefficient(), GetLinearConstraintError(), GetLinearConstraintVariable(), GetNumTermsInLinearConstraint(), GetParameter(), GetVariable(), GetVariableID(), GetVariableName(), GetVariableNames(), InitLinearConstraint(), InitMapping(), IntervalCenter(), MAX_TERMS_SIMP, NEW, NVariables(), TCuikSystem::orig2s, TCuikSystem::orig2sd, TCuikSystem::orig_equations, TCuikSystem::orig_variables, PrintEquations(), PrintVariables(), SetOriginalVarRelation(), SetVariableInterval(), TCuikSystem::simp_equations, TCuikSystem::simp_variables, SimpleFromOriginal(), TRUE, and TCuikSystem::variables. Referenced by UpdateCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Defines the Jacobian of the simplified cuiksystem but only for equality equations. This is an auxiliary function of UpdateCuikSystem. Defines an array with as many rows as equality equations in the simplified cuiksystem and as many columns as variables where each entry (i,j) is de derivative of equality 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 2461 of file cuiksystem.c. References DeriveEquation(), EQU, GetEquation(), GetEquationCmp(), TCuikSystem::J, NEW, TCuikSystem::simp_equations, TCuikSystem::simp_nee, and TCuikSystem::simp_nvariables. Referenced by UpdateCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Deletes the Jacobian generated by ComputeSimpCuikSystemJacobian. This is an auxiliary function of UnUpdateCuikSystem.
Definition at line 2481 of file cuiksystem.c. References DeleteEquation(), Error(), TCuikSystem::J, TCuikSystem::simp_nee, TCuikSystem::simp_nvariables, and TCuikSystem::updated. Referenced by UnUpdateCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
The cuiksystem stores some cached information about variables and equations. This information has to be re-computed everytime the cuiksystem is modified.
Definition at line 1756 of file cuiksystem.c. References ComputeSimpCuikSystemJacobian(), CT_EPSILON, DEPTH_FIRST_SEARCH, TCuikSystem::empty, TCuikSystem::eqMin, TCuikSystem::equations, Error(), GetNumMonomials(), GetParameter(), GetVariableNames(), GetVariableTypeN(), IsDummyVariable(), IsSystemVariable(), MINIMIZATION_SEARCH, NEqualityEquations(), TCuikSystem::nequations, NEquations(), NEW, TCuikSystem::notDummyVar, TCuikSystem::nvariables, 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::orig_varNames, ResetEquation(), RewriteEquation(), TCuikSystem::searchMode, TCuikSystem::simp_equations, TCuikSystem::simp_nee, TCuikSystem::simp_nequations, TCuikSystem::simp_nvariables, TCuikSystem::simp_variables, SimplifyCuikSystem(), TCuikSystem::systemVar, TRUE, TCuikSystem::updated, TCuikSystem::variables, and TCuikSystem::varType. Referenced by ComputeSplitDim(), ComputeSplitDimInt(), MaxReduction(), MPI_SolveCuikSystem(), MPI_TreatBox(), PrintCuikSystemWithSimplification(), ReGenerateOriginalBox(), SaveCuikSystemSimplification(), and SolveCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
The cuiksystem stores some cached information about variables and equations. This information has to be re-computed everytime the cuiksystem is modified.
Definition at line 1684 of file cuiksystem.c. References DeleteEquation(), DeleteEquations(), DeleteMapping(), DeleteSimpCuikSystemJacobian(), DeleteVariables(), TCuikSystem::eqMin, TCuikSystem::equations, FALSE, MINIMIZATION_SEARCH, TCuikSystem::nequations, TCuikSystem::notDummyVar, TCuikSystem::nvariables, TCuikSystem::orig2s, TCuikSystem::orig2sd, TCuikSystem::orig_nequations, TCuikSystem::orig_notDummyVar, TCuikSystem::orig_nvariables, TCuikSystem::orig_systemVar, TCuikSystem::orig_varNames, TCuikSystem::searchMode, TCuikSystem::simp_equations, TCuikSystem::simp_nee, TCuikSystem::simp_nequations, TCuikSystem::simp_nvariables, TCuikSystem::simp_variables, TCuikSystem::systemVar, TCuikSystem::updated, TCuikSystem::variables, and TCuikSystem::varType. Referenced by AddEquation2CS(), AddVariable2CS(), DeleteCuikSystem(), SampleCuikSystemInBox(), and SetCSVariableRange().
Here is the call graph for this function:
Here is the caller graph for this function:
Selects and optimal split dimension for a given box.
Definition at line 1861 of file cuiksystem.c. References CT_EPSILON, CT_SPLIT_TYPE, TCuikSystem::equations, Error(), GetBoxIntervals(), GetParameter(), INF, IntervalSize(), TCuikSystem::nequations, NEW, NO_UINT, TCuikSystem::nvariables, randomMax(), TCuikSystem::systemVar, UpdateCuikSystem(), UpdateSplitWeight(), and Warning(). Referenced by ComputeSplitDim(), and PostProcessBox().
Here is the call graph for this function:
Here is the caller graph for this function:
While solving a problem, every STATE_PERIOD processed boxes we store the solver state into a file. In this way if the process crashes, we can re-start the solver from the last saved state.
Definition at line 1976 of file cuiksystem.c. References Error(), GetElapsedTime(), NEW, SaveListOfBoxes(), SaveStatistics(), and TCuikSystem::st. Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Retrives the internal the cuik solver state information from a file previously saved by SaveCSState. This allows to init the solving process from a intermediate point (and not from scratch) after, for intance, a power failure.
Definition at line 2005 of file cuiksystem.c. References Error(), First(), GetBoxNIntervals(), GetCurrent(), GetTime(), InitIterator(), LoadListOfBoxes(), LoadStatistics(), TCuikSystem::nvariables, SetInitialTime(), and TCuikSystem::st. Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
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 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 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:
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:
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 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:
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:
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:
|