cuiksystem.h File Reference Detailed DescriptionDefinition of the TCuikSystem type and the associated functions.
Definition in file cuiksystem.h.
Macro Definition Documentation
Boxes to be reduced can be sorted according to a given equation. If this is set to 1 we evaluate this equation in the center of each box If set to 1 we evaluate the equation interval-wise and take the center of the resulting interval.
Definition at line 38 of file cuiksystem.h.
Set to one to avoid Newton to scape from boxes.
Definition at line 46 of file cuiksystem.h.
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 54 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 63 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 76 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 88 of file cuiksystem.h. Referenced by PostProcessBox().
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 100 of file cuiksystem.h. Referenced by MPI_SolveCuikSystem().
Returned by CuikNewtonInBox when the Newton iteration was repeated for more than CT_MAX_NEWTON_ITERATIONS times without reaching a stationary point. Definition at line 111 of file cuiksystem.h. Referenced by AddBranchToRRT(), ConnectSamples(), CuikNewtonInBox(), CuikNewtonSimp(), GeodesicDistance(), and main().
Returned by CuikNewtonInBox when the Newton iteration converged to a point inside the given box. Note that if the Newton converges in the current box it also converges in the initial box however the more restrictive condition (convergence in local box) is returned. Definition at line 124 of file cuiksystem.h. Referenced by CuikNewton(), CuikNewtonInBox(), CuikNewtonSimp(), IncrementalSampleCuikSystemInBox(), main(), and PostProcessBox().
Returned by CuikNewtonInBox when the Newton iteration converged to a point outside the given box, but inside the initial box. Note that if the Newton converges in the current box it also converges in the initial box however the more restrictive condition (convergence in local box) is returned. Definition at line 138 of file cuiksystem.h. Referenced by CuikNewton(), CuikNewtonInBox(), CuikNewtonSimp(), IncrementalSampleCuikSystemInBox(), main(), and PostProcessBox().
Returned by CuikNewtonInBox when the Newton iteration converged but to a point that is outside the initial box. Note that this is only returned if the process converged but outside the global box. Definition at line 150 of file cuiksystem.h. Referenced by CuikNewtonInBox(), and main().
The union of all possible convergence cases for Newton iteration. Provide to facilitate the test whether or not a call actually converged (to anywhere) Definition at line 158 of file cuiksystem.h. Function Documentation
Creates an empty cuiksystem.
Definition at line 2155 of file cuiksystem.c. References TCuikSystem::consistent, TCuikSystem::constants, DEPTH_FIRST_SEARCH, TCuikSystem::empty, FALSE, InitConstants(), InitEquation(), InitEquations(), InitVariables(), TCuikSystem::nequations, TCuikSystem::notDummyVar, TCuikSystem::nvariables, TCuikSystem::orig2s, TCuikSystem::orig2sd, TCuikSystem::orig_eqMin, TCuikSystem::orig_equations, TCuikSystem::orig_nequations, TCuikSystem::orig_notDummyVar, TCuikSystem::orig_nvariables, TCuikSystem::orig_systemVar, TCuikSystem::orig_variables, TCuikSystem::scalar, TCuikSystem::searchMode, TCuikSystem::simp_empty, TCuikSystem::simp_tp, TCuikSystem::systemVar, TRUE, TCuikSystem::updated, and TCuikSystem::varType. Referenced by AdjustBioWorldGeometry(), CuikSystemMerge(), InitWorldCS(), and main().
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 InitCSWDFromFile(), and main().
Adds information (constants/variables/equations) to a cuiksystem from another file. This is typically used to build a cuiksystem from a set of files where each file assumes we already loaded the previous ones (when adding contact equations to a cuiksystem or eigengrasp equations or singularity equations or....). This function is exacty the same as InitCuikSystemFromFile but the system is not initialized from scratch but assumed pre-initialized.
Referenced by main().
Checks the consistency of the cuiksystem. If the system is inconsistent an error is trigered. Note that if new equations/variables are added to the cuiksystem its consistancy might no longer hold.
Definition at line 2194 of file cuiksystem.c. References Error(), and UpdateCuikSystem(). Referenced by main().
Creates an cuiksystem from another cuiksystem.
Definition at line 2204 of file cuiksystem.c. References TCuikSystem::consistent, TCuikSystem::constants, CopyConstants(), CopyEquation(), CopyEquations(), CopyJacobian(), CopyMapping(), CopyStatistics(), CopyVariables(), TCuikSystem::empty, TCuikSystem::eqMin, TCuikSystem::equations, GetVariableNames(), TCuikSystem::J, MINIMIZATION_SEARCH, TCuikSystem::nequations, NEW, TCuikSystem::notDummyVar, TCuikSystem::nvariables, TCuikSystem::orig2s, 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, TCuikSystem::scalar, TCuikSystem::searchMode, TCuikSystem::simp_empty, TCuikSystem::simp_equations, TCuikSystem::simp_nee, TCuikSystem::simp_nequations, TCuikSystem::simp_nvariables, TCuikSystem::simp_tp, TCuikSystem::simp_variables, TCuikSystem::st, TCuikSystem::systemVar, TCuikSystem::updated, TCuikSystem::variables, and TCuikSystem::varType. Referenced by AddJacobianEquations(), AddSimplifiedJacobianEquations(), GenerateWorldSingularityEquations(), and GetSCpSystem().
Defines a new cuiksystem by union of two given cuiksystems. CAUTION!
Definition at line 2320 of file cuiksystem.c. References AccumulateEquations(), AddVariable2CS(), TCuikSystem::consistent, TCuikSystem::constants, CopyEquation(), CopyEquations(), CopyVariables(), TCuikSystem::empty, FALSE, GetVariable(), InitCuikSystem(), MergeConstants(), MergeEquations(), 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::scalar, ScalarEquations(), TCuikSystem::searchMode, TCuikSystem::simp_empty, TCuikSystem::systemVar, TRUE, TCuikSystem::updated, and TCuikSystem::varType.
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 2413 of file cuiksystem.c. References EvaluateEqMin(). Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().
Defines the criterion to be used sorting the boxes to be treated when searching for a solution. Possible critera are
Definition at line 2418 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().
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 2438 of file cuiksystem.c. References AccumulateEquations(), AddCt2Monomial(), AddMonomial(), AddVariable2Monomial(), DeleteEquation(), DeleteMonomial(), EQU, InitEquation(), InitMonomial(), MINIMIZATION_SEARCH, NFUN, TCuikSystem::orig_eqMin, ResetMonomial(), TCuikSystem::searchMode, SetCSSearchMode(), and SetEquationCmp(). Referenced by GenerateJointRangeEquations().
Adds a new variable to the system.
Definition at line 2511 of file cuiksystem.c. References AddVariable(), GetVariableID(), GetVariableName(), NO_UINT, TCuikSystem::orig_variables, UnUpdateCuikSystem(), and TCuikSystem::updated. Referenced by AddJacobianEquationsInt(), AdjustBioWorldGeometry(), CuikSystemMerge(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointRangeEquations(), GenerateJointRangeSingularityEquations(), GenerateLinkRotFLinks(), GenerateLinkRotLinks(), GenerateLinkRotQLinks(), GenerateWorldSingularityEquations(), and GetSCpSystem().
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 2481 of file cuiksystem.c. References AddEquation(), TCuikSystem::orig_equations, UnUpdateCuikSystem(), and TCuikSystem::updated. Referenced by AddJacobianEquationsInt(), AdjustBioWorldGeometry(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointRangeEquations(), GenerateJointRangeSingularityEquations(), GenerateLinkRotFLinks(), GenerateLinkRotLinks(), GenerateLinkRotQLinks(), GenerateWorldSingularityEquations(), and GetSCpSystem().
Adds a new matrix equation to the system. The equation must use the variables already added to the system. No check is performed to determine if the matrix equation is repeated.
Definition at line 2490 of file cuiksystem.c. References AddMatrixEquation(), Error(), FALSE, TCuikSystem::orig_equations, TCuikSystem::scalar, SimplifiedMEquation(), UnUpdateCuikSystem(), and TCuikSystem::updated. Referenced by GenerateEquationsFromBranch().
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 2529 of file cuiksystem.c. References CopyVariables(), and TCuikSystem::orig_variables. Referenced by GenerateWorldEquations().
Initializes an array of pointers to variable names. This is used to print boxes.
Definition at line 2534 of file cuiksystem.c. References GetVariableNames(), and TCuikSystem::orig_variables. Referenced by AdjustBioWorldGeometry(), and GetWorldVarNames().
Returns the number of variables already in the cuiksystem.
Definition at line 2544 of file cuiksystem.c. References NVariables(), and TCuikSystem::orig_variables. Referenced by DealWithCP(), GenerateWorldTWSEquations(), GetLinkTransformsFromSolutionPoint(), GetSCpSystem(), GetWorldNumVariables(), GetWorldSimpVariableMask(), IncrementalSampleCuikSystemInBox(), main(), MoveWorld(), PrintWorldAxes(), RegenerateWorldOriginalPoint(), RegenerateWorldSolutionPoint(), SampleCuikSystemInBox(), WorldDOF2Sol(), and WorldSample2DOF().
Returns the number of system variables in the cuiksystem. System variables are system+secondary (see GetCSSystemVars).
Definition at line 2549 of file cuiksystem.c. References GetNumSecondaryVariables(), GetNumSystemVariables(), and TCuikSystem::orig_variables. Referenced by GetSolutionPointFromLinkTransforms(), GetWorldNumSystemVariables(), and MoveWorld().
Returns the number of non-dummy (i.e., the sum of system, secondary and cartesian variables) variables already in the cuiksystem.
Definition at line 2558 of file cuiksystem.c. References GetNumDummyVariables(), NVariables(), and TCuikSystem::orig_variables. Referenced by AnimateWorld().
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 2566 of file cuiksystem.c. References CopyVariable(), GetVariable(), and TCuikSystem::orig_variables.
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 2574 of file cuiksystem.c. References GetVariable(), TCuikSystem::orig_variables, SetVariableInterval(), UnUpdateCuikSystem(), and TCuikSystem::updated. Referenced by GetSCpSystem(), and SampleCuikSystemInBox().
Returns the numerical identifier of a variable given its name.
Definition at line 2586 of file cuiksystem.c. References GetVariableID(), and TCuikSystem::orig_variables. Referenced by AdjustBioWorldGeometry(), ApplyLinkRotFLinks(), ApplyLinkRotLinks(), ApplyLinkRotQLinks(), CacheRotVarsFLinks(), CacheRotVarsLinks(), CacheRotVarsQLinks(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), GenerateJointRangeSingularityEquations(), GenerateJointSolution(), GenerateLinkRotFLinks(), GenerateLinkRotLinks(), GenerateLinkRotQLinks(), GenerateWorldTWSEquations(), GetJointTransSeq(), main(), RegenerateJointBox(), RegenerateJointSolution(), SetTransVars(), and WorldDOF2Sol().
Gets the name of a particular variable. The returned pointer should not be manipulated.
Definition at line 2591 of file cuiksystem.c. References TCuikSystem::orig_variables, and VariableName(). Referenced by GetLinkPoseSimpVars().
Identifies system variables that survive in the simplified system.
Definition at line 2596 of file cuiksystem.c. References Error(), GetVariableID(), IsSecondaryVariable(), IsSystemVariable(), NO_UINT, TCuikSystem::simp_variables, and UpdateCuikSystem(). Referenced by GetLinkPoseSimpVars().
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 and secondary variables. In coherence with the definition of the orig_systemVar field of TCuikSystem, here we identify system and secondary varibles. Internally, though, we differentiate between them (secondary varibles are not used when splitting boxes).
Definition at line 2614 of file cuiksystem.c. References IsSecondaryVariable(), IsSystemVariable(), NEW, NVariables(), and TCuikSystem::orig_variables. Referenced by AdjustBioWorldGeometry(), GenerateWorldEquations(), GetSCpSystem(), GetWorldSystemVars(), IncrementalSampleCuikSystemInBox(), main(), NewtonInWorld(), and SampleCuikSystemInBox().
Determines the topology of a given variable (of the original variable set).
Definition at line 2627 of file cuiksystem.c. References GetVariable(), GetVariableTopology(), and TCuikSystem::orig_variables. Referenced by GetWorldVarTopology().
Returns a copy of the system equations. This is a Tequations copy constructor.
Definition at line 2635 of file cuiksystem.c. References CopyEquations(), and TCuikSystem::orig_equations.
Returns the number of equations already in the cuiksystem.
Definition at line 2664 of file cuiksystem.c. References NEquations(), and TCuikSystem::orig_equations. Referenced by GetSCpSystem(), IncrementalSampleCuikSystemInBox(), and SampleCuikSystemInBox().
Returns a copy of one of the equations of the cuiksystem. This can be seen as a Tequation copy constructor.
Definition at line 2643 of file cuiksystem.c. References CopyEquation(), Error(), GetEquation(), TCuikSystem::orig_equations, and TCuikSystem::scalar.
Returns TRUE if the cuiksystem is fully polynomial. We check if the original cuiksystem is polynomial since if this system is polynomial, so are the rest of systems (simplified, simplified+dummified).
Definition at line 2651 of file cuiksystem.c. References TCuikSystem::orig_equations, and PolynomialEquations(). Referenced by IsWorldPolynomial().
Returns TRUE if the cuiksystem is fully scalar.
Definition at line 2656 of file cuiksystem.c. References TCuikSystem::scalar.
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.
Definition at line 2669 of file cuiksystem.c. References InitJacobian(), TCuikSystem::orig_equations, and TCuikSystem::orig_variables. Referenced by AddJacobianEquations(), GetSCpSystem(), GetSimpCSJacobian(), and GetWorldJacobian().
Creates an array with the topology information for the variables in the simplified system. The topology gives information on the type of range for each variable (either real or spherical). This is relevant when searching for nearest neighbours (in the case of spherical topology pi is close to -pi but not in the case of real topology).
Definition at line 2674 of file cuiksystem.c. References Error(), GetVariablesTopology(), TCuikSystem::simp_variables, and UpdateCuikSystem(). Referenced by GetWorldSimpTopology().
The same as GetCSJacobian but for the simplified system.
Definition at line 2683 of file cuiksystem.c. References Error(), GetCSJacobian(), InitJacobian(), TCuikSystem::scalar, TCuikSystem::simp_equations, TCuikSystem::simp_variables, and UpdateCuikSystem(). Referenced by GetWorldSimpJacobian().
Adds linear a linear combination of the Jacobian to the system. Generates a new variable for each equation in the system and creates a linear combination of the Jacobian rows using the new variables. Those new variables are normalized to avoid getting redudant solutions. Only the Jacobian columns corresponding to the selectedVars is used. This functions is used when looking for singularities.
Definition at line 2758 of file cuiksystem.c. References AddJacobianEquationsInt(), CopyCuikSystem(), DeleteCuikSystem(), DeleteJacobian(), Error(), GetCSJacobian(), GetJacobianSize(), UnUpdateCuikSystem(), and UpdateCuikSystem(). Referenced by main().
This is the same as AddJacobianEquations but the we use the Jacobian of the simplified system instead of that of the original system. Note that the selectedVars refer to the original system and they can be missing from the original system. We try to translate variables from original to simple. Origianl variables assigned to constants are unselected and variables assigned to other variables are replaced accordingly.
Definition at line 2788 of file cuiksystem.c. References AddJacobianEquationsInt(), CopyCuikSystem(), DeleteCuikSystem(), DeleteJacobian(), DeleteLinearConstraint(), Error(), FALSE, GetJacobianEquation(), GetLinearConstraintVariable(), GetNumTermsInLinearConstraint(), GetOriginalVarRelation(), GetVariableNames(), InitJacobian(), NEW, TCuikSystem::orig2s, TCuikSystem::orig_nvariables, TCuikSystem::orig_variables, TCuikSystem::orig_varNames, PrintEquation(), RewriteEquation2Orig(), TCuikSystem::scalar, TCuikSystem::simp_equations, TCuikSystem::simp_nee, TCuikSystem::simp_nvariables, TCuikSystem::simp_variables, TRUE, UnUpdateCuikSystem(), UpdateCuikSystem(), and VariableName(). Referenced by GenerateWorldTWSEquations().
Reduces a box using the constraints included in the cuiksystem and using the algorithms described in our papers.
Definition at line 2908 of file cuiksystem.c. References DeleteBox(), DUMMY_VAR, EMPTY_BOX, Error(), GetBoxSize(), TCuikSystem::orig2sd, ReduceBox(), TCuikSystem::scalar, SimpleFromOriginal(), TCuikSystem::systemVar, UpdateCuikSystem(), and UpdateOriginalFromSimple(). Referenced by IncrementalSampleCuikSystemInBox(), MaxWorldReduction(), and SampleCuikSystemInBox().
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 2941 of file cuiksystem.c. References DeleteBox(), Error(), GenerateInitialBox(), SampleCuikSystemInBox(), and TCuikSystem::scalar.
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 2960 of file cuiksystem.c. References AddLastElement(), Advance(), ChangeParameter(), ComputeSplitDim(), CopyBox(), CreateFileName(), CT_EPSILON, CT_N_SOLUTIONS, 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(), LINKS_EXT, MaxReduction(), NEW, NewInterval(), NO_UINT, NVariables(), TCuikSystem::orig_equations, TCuikSystem::orig_variables, PrintBox(), randomInInterval(), TCuikSystem::scalar, SetCSVariableRange(), SetVariableInterval(), SOL_EXT, SolveCuikSystem(), SYSTEM_VAR, TRUE, UnUpdateCuikSystem(), TCuikSystem::updated, and UsedVarInEquations(). Referenced by SampleCuikSystem().
This function is very similar to SampleCuikSystem but degrees of freedom are progressively fixed instead of fixed all simultaneously.
Definition at line 3218 of file cuiksystem.c. References DeleteBox(), Error(), GenerateInitialBox(), IncrementalSampleCuikSystemInBox(), and TCuikSystem::scalar. Referenced by main().
This function is very similar to SampleCuikSystemInBox but degrees of freedom are progressively fixed instead of fixed all simultaneously.
Definition at line 3238 of file cuiksystem.c. References AddLastElement(), Advance(), BoxFromVariables(), ChangeParameter(), CONVERGED_IN_BOX, CONVERGED_IN_GLOBAL, CopyBox(), CreateFileName(), CT_EPSILON, CT_MAX_NEWTON_ITERATIONS, CT_N_SOLUTIONS, CT_SMALL_SIGMA, CuikNewtonInBox(), DeleteBox(), DeleteFileName(), DeleteListOfBoxes(), DUMMY_VAR, EMPTY_BOX, EndOfList(), Error(), ErrorInSolution(), FALSE, First(), GetBoxInterval(), GetBoxSumSide(), GetCSNumEquations(), GetCSNumVariables(), GetCSSystemVars(), GetCurrent(), GetFileFullName(), GetParameter(), InitIterator(), InitListOfBoxes(), IntervalCenter(), IntervalSize(), IsInSimple(), IsSystemVariable(), LINKS_EXT, MaxReduction(), NEW, NewInterval(), NO_UINT, NVariables(), TCuikSystem::orig2sd, TCuikSystem::orig_notDummyVar, TCuikSystem::orig_variables, TCuikSystem::orig_varNames, PrintBox(), PrintBoxSubset(), randomInInterval(), randomMax(), TCuikSystem::scalar, SetBoxInterval(), SOL_EXT, SolveCuikSystem(), TRUE, UnUpdateCuikSystem(), UpdateCuikSystem(), and VariablesFromBox(). Referenced by IncrementalSampleCuikSystem().
This is simplified a version of CuikNewtonInBox since
This used when defining a RRT: we sample points in ambient space (of the simplified system) and we want to converge to the manifold (if possible). If you want to understand what is done in CuikNewtonInBox it is better to start by this function.
Definition at line 3571 of file cuiksystem.c. References ArrayPi2Pi(), CONVERGED_IN_BOX, CONVERGED_IN_GLOBAL, CT_EPSILON, CT_MAX_NEWTON_ITERATIONS, DeleteNewton(), DIVERGED, Error(), ErrorInSimpCSEquations(), EvaluateEqualityEquations(), EvaluateJacobianInVector(), FALSE, GetNewtonMatrixBuffer(), GetNewtonRHBuffer(), GetParameter(), InitNewton(), TCuikSystem::J, NewtonStep(), TCuikSystem::simp_equations, TCuikSystem::simp_nee, TCuikSystem::simp_nequations, TCuikSystem::simp_nvariables, TCuikSystem::simp_tp, TRUE, and UpdateCuikSystem(). Referenced by WorldSimpCuikNewton().
Find a solution of a cuiksystem set of equations using the Newton-Rhapson method. The initial point is sampled form the given box. Note that parameter box is used both for input and for output. As an input it defienes the box from where to drawn the initial point for the Newton method. As an output it is a small box around the last point of the Newton iteration (the solution if the process converged).
Definition at line 3667 of file cuiksystem.c. References ArrayPi2Pi(), BoxFromVariables(), CONVERGED_IN_BOX, CONVERGED_IN_GLOBAL, CONVERGED_OUTSIDE_GLOBAL, CopyBox(), CT_EPSILON, CT_MAX_NEWTON_ITERATIONS, DeleteBox(), DeleteNewton(), DIVERGED, Error(), ErrorInInequalities(), EvaluateEqualityEquations(), EvaluateJacobianInVector(), FALSE, GenerateInitialBox(), GetBoxInterval(), GetBoxNIntervals(), GetNewtonMatrixBuffer(), GetNewtonRHBuffer(), GetNumDummyVariables(), GetParameter(), InitBoxFromPoint(), InitNewton(), IntervalCenter(), IntervalSize(), TCuikSystem::J, NEW, NewInterval(), NewtonSetMatrix(), NewtonSetRH(), NewtonStep(), Norm(), TCuikSystem::orig2s, TCuikSystem::orig_notDummyVar, TCuikSystem::orig_nvariables, TCuikSystem::orig_systemVar, TCuikSystem::orig_variables, PointInBox(), randomInInterval(), RegenerateSolution(), SetBoxInterval(), SetBoxSubset(), TCuikSystem::simp_equations, TCuikSystem::simp_nee, TCuikSystem::simp_nequations, TCuikSystem::simp_nvariables, TCuikSystem::simp_tp, SimpleFromOriginal(), UpdateCuikSystem(), and UpdateOriginalFromSimple(). Referenced by CuikNewton(), IncrementalSampleCuikSystemInBox(), main(), and PostProcessBox().
Find a solution of a cuiksystem set of equations using the Newton-Rhapson method. This function is only a wrapper of CuikNewtonInBox using the initial box (i.e., the one defined form the variable ranges) to sample the initial point.
Definition at line 3905 of file cuiksystem.c. References CONVERGED_IN_BOX, CONVERGED_IN_GLOBAL, CuikNewtonInBox(), DeleteBox(), and GenerateInitialBox(). Referenced by main(), and NewtonInWorld().
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 3926 of file cuiksystem.c. References AddBox2HeapOfBoxes(), AddList2Heap(), BoxFromVariables(), BREADTH_FIRST_SEARCH, CmpBoxBreadthFirst(), CmpBoxDepthFirst(), CmpBoxesEquation(), CT_N_SOLUTIONS, CT_STATE_PERIOD, DeleteBox(), DeleteHeap(), DeleteListOfBoxes(), DEPTH_FIRST_SEARCH, DUMMY_VAR, Error(), EvaluateEqMin(), ExtractMinElement(), FALSE, GetBoxLevel(), GetBoxSize(), GetBoxVolume(), GetNSolutionBoxes(), GetParameter(), Heap2List(), HeapEmpty(), HeapOfBoxesVolume(), InitBox(), InitHeapOfBoxes(), InitStatistics(), LoadCSState(), MINIMIZATION_SEARCH, NewBoxProcessed(), NewMaxLevel(), TCuikSystem::orig2sd, PostProcessBox(), PrintBox(), PrintStatistics(), ReduceBox(), REDUCED_BOX_WITH_SOLUTION, SaveCSState(), TCuikSystem::scalar, TCuikSystem::searchMode, TCuikSystem::simp_empty, TCuikSystem::simp_nvariables, SimpleFromOriginal(), TCuikSystem::st, TCuikSystem::systemVar, UpdateCuikSystem(), and TCuikSystem::variables. Referenced by DealWithCP(), IncrementalSampleCuikSystemInBox(), main(), and SampleCuikSystemInBox().
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 4103 of file cuiksystem.c. References AddBox2HeapOfBoxes(), AddFirstElement(), AddList2Heap(), AddNBoxReductions(), Box2Buffer(), BoxFromVariables(), BREADTH_FIRST_SEARCH, Buffer2Box(), CmpBoxBreadthFirst(), CmpBoxDepthFirst(), CmpBoxesEquation(), CT_N_SOLUTIONS, CT_STATE_PERIOD, DeleteBox(), DeleteHeap(), DeleteListOfBoxes(), DeleteStatistics(), DEPTH_FIRST_SEARCH, Error(), ERROR_IN_PROCESS, ExtractMinElement(), FALSE, GetBoxBufferSize(), GetBoxLevel(), GetBoxSize(), GetBoxVolume(), GetNSolutionBoxes(), GetParameter(), Heap2List(), HeapEmpty(), HeapOfBoxesVolume(), HeapSize(), InitBox(), InitHeapOfBoxes(), InitStatistics(), LoadCSState(), MINIMIZATION_SEARCH, MPI_TREAT_BOX_TIMEOUT, NEW, NewBoxProcessed(), NewLostBox(), NewMaxLevel(), TCuikSystem::nvariables, TCuikSystem::orig2sd, PostProcessBox(), PrintBox(), PrintStatistics(), REDUCED_BOX, SaveCSState(), TCuikSystem::scalar, TCuikSystem::searchMode, SimpleFromOriginal(), TCuikSystem::st, TCuikSystem::systemVar, TRUE, UpdateCuikSystem(), and TCuikSystem::variables. Referenced by main().
This is the function executed by the child processors when solving a problem in a multi-processor environment.
Definition at line 4490 of file cuiksystem.c. References Box2Buffer(), Buffer2Box(), DeleteBox(), DUMMY_VAR, Error(), FALSE, GetBoxBufferSize(), GetNBoxReductions(), InitBox(), NEW, TCuikSystem::nvariables, PrintBox(), ReduceBox(), ResetNBoxReductions(), TCuikSystem::scalar, TCuikSystem::st, TRUE, and UpdateCuikSystem(). Referenced by main().
Determines the search space for the solutions of a cuiksystem in the form of a box defined from the variable ranges.
Definition at line 4583 of file cuiksystem.c. References BoxFromVariables(), and TCuikSystem::orig_variables. Referenced by CuikNewton(), CuikNewtonInBox(), GetWorldInitialBox(), IncrementalSampleCuikSystem(), SampleCuikSystem(), and SampleCuikSystemInBox().
The same as GenerateInitialBox but for the simplified system.
Definition at line 4588 of file cuiksystem.c. References BoxFromVariables(), Error(), TCuikSystem::simp_variables, and UpdateCuikSystem(). Referenced by GetWorldSimpInitialBox().
Generates values for all variables in the box (including dummies and cartesian ones) from the values of the system variables. In general, solutions only include system variables and for many operations the cartesian/dummy ones are also needed (for plotting, for refining a solution,...). This functions reverses the removal of the non-system variables in a box. Observe that the box must be given in the original system and with values only for the system variables. This is different of what happens with RegenerateOriginalBox where the input box has values for all variables in the simplified system.
Definition at line 4596 of file cuiksystem.c. References CARTESIAN_VAR, CropEquation(), CT_EPSILON, CT_RHO, DeleteBox(), DUMMY_VAR, EMPTY_BOX, FALSE, GetParameter(), INF, InitBox(), IsCartesianVariable(), IsCoordEquation(), IsDummyEquation(), IsDummyVariable(), NewInterval(), TCuikSystem::orig_equations, TCuikSystem::orig_nvariables, TCuikSystem::orig_variables, SetBoxInterval(), TRUE, and UpdateCuikSystem(). Referenced by CuikNewtonInBox(), and RegenerateSolutionPoint().
Defines a solution point including the dummy and cartesian variables from an array with only values for the system variables. This function is based on RegenerateSolution.
Definition at line 4660 of file cuiksystem.c. References DeleteBox(), Error(), GetBoxInterval(), InitBoxFromPoint(), IntervalCenter(), NEW, TCuikSystem::orig_nvariables, TCuikSystem::orig_systemVar, RegenerateSolution(), and UpdateCuikSystem().
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 4701 of file cuiksystem.c. References BoxFromVariables(), Error(), TCuikSystem::orig2sd, TCuikSystem::orig_variables, UpdateCuikSystem(), and UpdateOriginalFromSimple(). Referenced by main().
Defines a point in the original system from a point in the simplified system. It is like RegenerateOriginalBox but on points and not on boxes and taking points from the simplified system and not the simplified+dummified. This is basically used from cuikatlas that operates on the simplified system.
Definition at line 4712 of file cuiksystem.c. References Error(), TCuikSystem::orig2s, TCuikSystem::orig_nvariables, TCuikSystem::orig_variables, PointFromVariables(), UpdateCuikSystem(), and UpdateOriginalPointFromSimple(). Referenced by GetLinkTransformsFromSolutionPoint(), and RegenerateWorldOriginalPoint().
Generates a simplified point from an original one. This is the inverse mapping of RegenerateOriginalPoint.
Definition at line 4725 of file cuiksystem.c. References Error(), TCuikSystem::orig2s, TCuikSystem::simp_nvariables, SimplePointFromOriginal(), and UpdateCuikSystem(). Referenced by WorldGenerateSimplifiedPoint().
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 4742 of file cuiksystem.c. References ComputeSplitDimInt(), DeleteBox(), Error(), GetVarIDInOriginal(), NO_UINT, TCuikSystem::orig2sd, TCuikSystem::scalar, SimpleFromOriginal(), and UpdateCuikSystem(). Referenced by SampleCuikSystemInBox().
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 4766 of file cuiksystem.c. References Error(), GetBoxInterval(), GetBoxNIntervals(), GetVectorElement(), IsDummyVariable(), IsInside(), NVariables(), TCuikSystem::orig_variables, and TRUE.
Evaluates the equation set on a point. Only equalities are evaluated and thus only space for as many ouputs as equalities is needed in r.
Definition at line 4793 of file cuiksystem.c. References EvaluateEqualityEquations(), FALSE, and TCuikSystem::orig_equations. Referenced by WorldEvaluateEquations().
The same as EvaluateCSEquations but on the simplified system. The direct access to the simplified equations is needed to obtain an efficient cuikatlas (and associated utilities). If defined on the original systems they will include too many (trivial) equations and fixed variables. Note that in this case the input point p must be defined on the simplified space.
Definition at line 4798 of file cuiksystem.c. References Error(), EvaluateEqualityEquations(), FALSE, TCuikSystem::simp_equations, and UpdateCuikSystem(). Referenced by WorldEvaluateSimpEquations().
The same as EvaluateSimpCSEquations but on a subset of equations. This is used to evaluate the independent subset of equations during the atlas construction.
Definition at line 4806 of file cuiksystem.c. References Error(), EvaluateSubSetEqualityEquations(), TCuikSystem::simp_equations, and UpdateCuikSystem(). Referenced by WorldEvaluateSubSetSimpEquations().
Evaluates the equations on a point and returns the norm of the error. Recall that solution points should have zero error. This is similar to ErrorInSolution but works on points and not on boxes and takes into account all equations and not only system ones.
Definition at line 4826 of file cuiksystem.c. References EvaluateEqualityEquations(), FALSE, NEqualityEquations(), NEW, Norm(), and TCuikSystem::orig_equations. Referenced by main(), and WorldErrorInEquations().
The same as ErrorInCSEquations but in the simplified set of equations. The direct access to the simplified equations is needed to obtain an efficient cuikatlas (and associated utilities). If defined on the original systems they will include too many (trivial) equations and fixed variables. Note that in this case the input point p must be defined on the simplified space.
Definition at line 4845 of file cuiksystem.c. References Error(), EvaluateEqualityEquations(), FALSE, NEqualityEquations(), NEW, Norm(), TCuikSystem::simp_equations, and UpdateCuikSystem(). Referenced by CuikNewtonSimp(), and WorldErrorInSimpEquations().
This interface is provided to use it form T-RRT. The same interface is used for other cost function.
Definition at line 4867 of file cuiksystem.c. References EvaluateWholeEquation(). Referenced by EvaluateWorldCost().
Returns the matrix resulting from evaluationg the Jacobian of the system in a given point. The Jacobian is defined on the original cuiksystem (without simplification nor dummyfications).
Definition at line 4814 of file cuiksystem.c. References AllocateJacobianEvaluation(), DeleteJacobian(), EvaluateJacobian(), InitJacobian(), TCuikSystem::orig_equations, and TCuikSystem::orig_variables. Referenced by EvaluateWorldJacobian().
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 4885 of file cuiksystem.c. References Error(), EvaluateEqualityEquations(), GetBoxInterval(), GetBoxNIntervals(), IntervalCenter(), NEqualityEquations(), NEW, Norm(), NVariables(), TCuikSystem::orig_equations, TCuikSystem::orig_variables, and TRUE. Referenced by IncrementalSampleCuikSystemInBox(), main(), and PostProcessBox().
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 4924 of file cuiksystem.c. References Error(), EvaluateInequalityEquations(), GetBoxInterval(), GetBoxNIntervals(), IntervalCenter(), MaxVector(), NEW, NInequalityEquations(), NVariables(), TCuikSystem::orig_equations, TCuikSystem::orig_nvariables, and TCuikSystem::orig_variables. Referenced by CuikNewtonInBox().
Checks if all inqualities hold for a given point. For many processes (i.e., continuation, etc) only the equalities are taken into account. Thus, we need a function to check if the inequalities hold.
Definition at line 4953 of file cuiksystem.c. References EvaluateInequalityEquations(), MaxVector(), NEW, NInequalityEquations(), TCuikSystem::orig_equations, and TRUE. Referenced by WorldInequalitiesHold().
Checks if all inqualities hold for a given point for the simplified system.
Definition at line 4973 of file cuiksystem.c. References Error(), EvaluateInequalityEquations(), MaxVector(), NEW, NInequalityEquations(), TCuikSystem::simp_equations, TRUE, and UpdateCuikSystem(). Referenced by WorldSimpInequalitiesHold().
Determines the maximum error in the inequalities in the simplified system.
Definition at line 4996 of file cuiksystem.c. References Error(), EvaluateInequalityEquations(), MaxVector(), NEW, NInequalityEquations(), TCuikSystem::simp_equations, and UpdateCuikSystem(). Referenced by WorldErrorInSimpInequalities().
Writes the cuiksystem in a file that can be stdout.
Definition at line 5022 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 AdjustBioWorldGeometry(), main(), and PrintWorldCS().
Writes the simplified cuiksystem in a file that can be stdout. If the DEBUG mode is above 1 it first print the original system and then the simplified one (in the same file)
Definition at line 5047 of file cuiksystem.c. References CT_SIMPLIFICATION_LEVEL, TCuikSystem::eqMin, TCuikSystem::equations, GetNumSecondaryVariables(), GetNumSystemVariables(), GetParameter(), GetVariableNames(), MINIMIZATION_SEARCH, NEW, NVariables(), TCuikSystem::orig2sd, TCuikSystem::orig_eqMin, TCuikSystem::orig_equations, TCuikSystem::orig_nvariables, TCuikSystem::orig_variables, PrintEquations(), PrintMapping(), PrintMonomials(), PrintVariables(), TCuikSystem::searchMode, TCuikSystem::simp_nvariables, TCuikSystem::simp_variables, UpdateCuikSystem(), and TCuikSystem::variables. Referenced by DealWithCP(), and main().
Saves the simplification information associated with a cuiksystem.
Definition at line 5102 of file cuiksystem.c. References TCuikSystem::orig2sd, SaveMapping(), and UpdateCuikSystem().
Deletes a cuiksystem.
Definition at line 5113 of file cuiksystem.c. References TCuikSystem::constants, DeleteConstants(), DeleteEquation(), DeleteEquations(), DeleteStatistics(), DeleteVariables(), TCuikSystem::empty, TCuikSystem::orig_eqMin, TCuikSystem::orig_equations, TCuikSystem::orig_variables, TCuikSystem::simp_empty, TCuikSystem::st, TRUE, and UnUpdateCuikSystem(). Referenced by AddJacobianEquations(), AddSimplifiedJacobianEquations(), AdjustBioWorldGeometry(), DealWithCP(), DeleteWorldCS(), and main(). |
Follow us!