cuiksystem.h File Reference Detailed DescriptionDefinition of the TCuikSystem type and the associated functions.
Definition in file cuiksystem.h.
Macro Definition Documentation◆ ANGULAR_SPACE
If set, the box sizes/volumes are computed in angular space. Definition at line 21 of file cuiksystem.h. ◆ CONTRACTED
One of the possible outcomes when reducing a box along a range. Definition at line 30 of file cuiksystem.h. ◆ REDUCED
One of the possible outcomes when reducing a box along a range. Definition at line 37 of file cuiksystem.h. ◆ REDUCED_WITH_SOLUTION
One of the possible outcomes when reducing a box along a range. Definition at line 44 of file cuiksystem.h. ◆ EMPTY
One of the possible outcomes when reducing a box along a range. Definition at line 51 of file cuiksystem.h. ◆ NOT_REDUCED
One of the possible outcomes when reducing a box along a range. Definition at line 58 of file cuiksystem.h. ◆ DEPTH_FIRST_SEARCH
In this mode, boxes to be reduced are sorted so that boxes with a higher level (i.e., resulting from more bisections) are treated first. Definition at line 66 of file cuiksystem.h. ◆ BREADTH_FIRST_SEARCH
In this mode, boxes to be reduced are sorted so that boxes with a smaller level (i.e., resulting from less bisections) are treated first. Definition at line 74 of file cuiksystem.h. ◆ SEARCH_MODE
Select the search mode. Definition at line 81 of file cuiksystem.h. ◆ CUT_POINT
Point, relative to the size of the selected box side, where we split a box. Definition at line 104 of file cuiksystem.h. Function Documentation◆ InitStatistics()
Initializes the statistics.
Definition at line 70 of file cuiksystem.c. References TStatistics::maxLevel, TStatistics::nBisected, TStatistics::nBoxes, TStatistics::nEmpty, TStatistics::nReductions, TStatistics::nSols, and TStatistics::vSols. Referenced by SolveCuikSystem(). ◆ ResetStatistics()
Sets all the statistics to 0.
Definition at line 86 of file cuiksystem.c. References TStatistics::maxLevel, TStatistics::nBisected, TStatistics::nBoxes, TStatistics::nEmpty, TStatistics::nReductions, TStatistics::nSols, and TStatistics::vSols. Referenced by main(). ◆ AccumulateStatistics()
Definition at line 100 of file cuiksystem.c. References TStatistics::maxLevel, TStatistics::nBisected, TStatistics::nBoxes, TStatistics::nEmpty, TStatistics::nReductions, TStatistics::nSols, and TStatistics::vSols. Referenced by main(). ◆ PrintStatistics()
Prints the statistics.
Definition at line 115 of file cuiksystem.c. References TStatistics::maxLevel, TStatistics::nBisected, TStatistics::nBoxes, TStatistics::nEmpty, TStatistics::nReductions, TStatistics::nSols, REDUNDANT_6R, and TStatistics::vSols. Referenced by main(). ◆ DeleteStatistics()
Releases any memory used by the statistics.
Definition at line 131 of file cuiksystem.c. Referenced by main(). ◆ InitCuikBox()
Initializes a cuik box.
Definition at line 664 of file cuiksystem.c. References TCuikBox::d, TCuikBox::l, TCuikBox::level, NEW, and TCuikBox::u. Referenced by ReadMAFFile(). ◆ PrintCuikBox()
Prints the limits of a box.
Definition at line 1023 of file cuiksystem.c. References TCuikBox::d, TCuikBox::l, and TCuikBox::u. Referenced by CleanCuikBoxes(), PropagateRanges(), ReduceBox(), SaveCuikBoxList(), SolveCuikSystem(), SplitCuikBox(), and VerifyCuikBoxes(). ◆ DeleteCuikBox()
Releases memory.
Definition at line 1091 of file cuiksystem.c. References TCuikBox::l. Referenced by DeleteCuikBoxList(), DeleteCuikSystem(), PropagateSolutions(), and SolveCuikSystem(). ◆ ReadCuikBoxList()
Reads a cuikbox list from a file.
Definition at line 1099 of file cuiksystem.c. References AddLastElement(), InitList(), NEW, and ReadCuikBox(). Referenced by main(). ◆ SaveCuikBoxList()
Saves a cuikbox list to a file.
Definition at line 1134 of file cuiksystem.c. References Advance(), CuikBox2Angles(), CuikBox2AnglesWithOffset(), CuikBoxOffset(), EndOfList(), ErrorInSolution(), First(), GetCurrent(), InitIterator(), TCuikSystem::offset, PrintCuikBox(), TCuikSystem::usedVars, and TCuikSystem::varType. Referenced by main(). ◆ VerifyCuikBoxes()
Tries to verify the existence of a solution in the input boxes.
Definition at line 1204 of file cuiksystem.c. References Advance(), CT_VERIFY, CuikBox2AnglesWithOffset(), CuikBox2TangentWithOffset(), CuikBoxOffset(), CuikBoxUnOffset(), EndOfList(), Error(), ErrorInSolution(), First(), GetCuikBoxOffset(), GetCurrent(), GetParameter(), InitIterator(), NEW, TCuikSystem::nv, PrintCuikBox(), REDUCED_WITH_SOLUTION, VERIFY_NEWTON, VERIFY_NEWTON_REPLACE, and VerifyBox(). Referenced by main(). ◆ CleanCuikBoxes()
Uses the simplex procedure to clean a list of solutions obtained with the trapezoid reduction method.
Definition at line 1256 of file cuiksystem.c. References Advance(), CLEAN_SIMPLEX, CT_CLEAN, CT_EPSILON, CuikBox2AnglesWithOffset(), CuikBox2TangentWithOffset(), CuikBoxOffset(), CuikBoxUnOffset(), EMPTY, EndOfList(), Error(), ErrorInSolution(), First(), GetCuikBoxOffset(), GetCurrent(), GetParameter(), InitIterator(), PrintCuikBox(), and REDUCED_WITH_SOLUTION. Referenced by main(). ◆ ClusterCuikBoxes()Groups boxes that are in contact. NOTE: The boxes resulting from the clustering are not updated (the evaluation of the equations in the corners are not up to date).
Definition at line 1318 of file cuiksystem.c. References AddLastElement(), Advance(), CopyCuikBox(), CuikBoxesIntersect(), CuikBoxUnion(), EndOfList(), FALSE, First(), GetCurrent(), InitIterator(), InitList(), ListSize(), NEW, and TRUE. Referenced by main(). ◆ CuikBoxes2Angles()Converts boxes in angular space. Note that we convert the boxes "in place", without copying them. If you need the original boxes, better copy them before the conversion. Moreover, the operation does not take into account the offsets in the angles. We assume that the input box is already offeset in tangent space (CuikBoxOffset).
Definition at line 1414 of file cuiksystem.c. References Advance(), CuikBox2Angles(), EndOfList(), First(), GetCurrent(), and InitIterator(). ◆ CuikBoxListVolume()Adds the sum of the volumes of all the boxes in the list.
Definition at line 1174 of file cuiksystem.c. References Advance(), CuikBoxVolume(), EndOfList(), First(), GetCurrent(), and InitIterator(). Referenced by main(). ◆ DeleteCuikBoxList()
Deletes a cuikbox list from a file.
Definition at line 1192 of file cuiksystem.c. References DeleteCuikBox(), ExtractFirst(), and ListEmpty(). Referenced by main(), and SolveCuikSystem(). ◆ InitCuikSystem()
Creates an empty cuiksystem.
Definition at line 2554 of file cuiksystem.c. References TCuikSystem::b0, TCuikSystem::boxL, TCuikSystem::boxU, TCuikSystem::f, TCuikSystem::f0, TCuikSystem::J, TCuikSystem::lwork, TCuikSystem::maxEV, TCuikSystem::minEV, TCuikSystem::nc, TCuikSystem::ne, TCuikSystem::nv, TCuikSystem::nve, TCuikSystem::outG, TCuikSystem::perm, TCuikSystem::sing, TCuikSystem::ve, TCuikSystem::veq, and TCuikSystem::work. ◆ ReadProblemFromFile()
Creates one or more cuiksystems from the information on a file. The input file can be either a 6R description (following the convention by Manocha and Canny), a maf file (encoding a multi-affine system) or a cuik file (explicitly giving the variables and equations). In the later case, the maf file is generated on the fly.
Definition at line 2790 of file cuiksystem.c. References TCuikSystem::boxL, TCuikSystem::boxU, CreateFileName(), CUIK_EXT, DeleteFileName(), Error(), TCuikSystem::f, GetFileExtension(), GetFileFullName(), TCuikSystem::J, LOOPS_EXT, TCuikSystem::lwork, MAF_EXT, TCuikSystem::maxEV, TCuikSystem::minEV, TCuikSystem::nc, TCuikSystem::ne, NEW, TCuikSystem::nv, TCuikSystem::outG, TCuikSystem::perm, Read6RFile(), ReadCuikFile(), ReadLoopsFile(), ReadMAFFile(), TCuikSystem::sing, TCuikSystem::veq, and TCuikSystem::work. Referenced by main(). ◆ Read6RFile()
Creates one or more cuiksystems from the information on a 6R file defined uisng the Manocha convention:
Definition at line 2905 of file cuiksystem.c. References Define6RProblem(), DEG2RAD, Error(), NEW, and NEWZ. Referenced by ReadProblemFromFile(). ◆ Loops2Cuik()
Reads a file of loops and writes a file of equations (cuik file). In this file we do not take into account offsets. Note however that they can be given explicitly as variables in the loop file.
Referenced by main(). ◆ ReadLoopsFile()
Generate the cuik data (num. variables, num equations, evaluation on a reference box, etc). from a file with the loop equations.
Referenced by ReadProblemFromFile(). ◆ ReadCuikFile()
Generate the cuik data (num. variables, num equations, evaluation on a reference box, etc). from a file with the variables and equations.
Referenced by ReadProblemFromFile(). ◆ ReadMAFFile()
Generate the cuik data (num. variables, num equations, evaluation on a reference box, etc). from a file in MAF format.
Definition at line 2988 of file cuiksystem.c. References TCuikSystem::b0, TCuikSystem::f0, FALSE, InitCuikBox(), TCuikSystem::nc, TCuikSystem::ne, NEW, TCuikSystem::nIn, TCuikSystem::nOut, TCuikSystem::nSimp, TCuikSystem::nv, TCuikSystem::nve, TCuikSystem::offset, TCuikSystem::S, TRUE, TCuikSystem::usedVars, TCuikSystem::varType, TCuikSystem::ve, TCuikSystem::vIn, and TCuikSystem::vOut. Referenced by ReadProblemFromFile(). ◆ SaveCuikSystemToMAF()
MAF files include several problems, each with a different offset. The advantatge of MAF files is that there is no need to parse them and they already include the evaluation of the functions in the corners of the boxes to considere. This function stores a set of cuiksystems into a MAF file.
Definition at line 3113 of file cuiksystem.c. References TCuikSystem::b0, CreateFileName(), DeleteFileName(), Error(), TCuikSystem::f0, GetFileFullName(), TCuikBox::l, MAF_EXT, TCuikSystem::nc, TCuikSystem::ne, TCuikSystem::nIn, TCuikSystem::nOut, TCuikSystem::nSimp, TCuikSystem::nv, TCuikSystem::nve, TCuikSystem::offset, TCuikSystem::S, TCuikBox::u, TCuikSystem::varType, TCuikSystem::ve, TCuikSystem::vIn, and TCuikSystem::vOut. Referenced by main(). ◆ CopyCuikSystem()
Creates an cuiksystem from another cuiksystem.
Definition at line 3213 of file cuiksystem.c. References TCuikSystem::b0, TCuikSystem::boxL, TCuikSystem::boxU, CopyCuikBox(), TCuikSystem::f, TCuikSystem::f0, TCuikSystem::J, TCuikSystem::lwork, TCuikSystem::maxEV, TCuikSystem::minEV, TCuikSystem::nc, TCuikSystem::ne, NEW, TCuikSystem::nv, TCuikSystem::nve, TCuikSystem::outG, TCuikSystem::perm, TCuikSystem::sing, TCuikSystem::ve, TCuikSystem::veq, and TCuikSystem::work. ◆ GetCSNumVariables()
Returns the number of variables already in the cuiksystem.
Definition at line 3295 of file cuiksystem.c. References TCuikSystem::nv. ◆ GetCSNumEquations()
Returns the number of equations already in the cuiksystem.
Definition at line 3303 of file cuiksystem.c. References TCuikSystem::ne. ◆ SolveCuikSystem()
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 3315 of file cuiksystem.c. References AddFirstElement(), AddLastElement(), TCuikSystem::b0, CheckSolution(), CLEAN_SIMPLEX, ComputeSplitDim(), CopyCuikBox(), CopyCuikBoxList(), CT_CLEAN, CT_EPSILON, CT_REDUCTION, CT_SAVE_ANGLES, CT_SIGMA, CT_SIMPLIFY, CT_VERIFY, CuikBox2AnglesWithOffset(), CuikBoxOffset(), CuikBoxSize(), CuikBoxVolume(), CUT_POINT, DeleteCuikBox(), DeleteCuikBoxList(), EMPTY, Error(), ErrorInSolution(), ExtractFirst(), GetParameter(), InitList(), InitStatistics(), TCuikBox::level, ListEmpty(), NEW, TCuikSystem::nv, TCuikSystem::offset, PrintCuikBox(), PropagateSolutions(), RED_SIMPLEX, RED_TRAPEZOID, ReduceBox(), REDUCED_WITH_SOLUTION, SplitCuikBox(), TCuikSystem::usedVars, TCuikSystem::varType, VERIFY_MIRANDA, VERIFY_NEWTON, VERIFY_NEWTON_REPLACE, and VerifyBox(). Referenced by main(). ◆ PropagateSolutions()
Consideres each solution box (as identified by SolveCuikSystem) and bounds the ranges of the unsused variables from the used ones using PropagateRanges Unused variables are those eliminated in the simplification process.
Definition at line 3594 of file cuiksystem.c. References A2T, Advance(), TCuikSystem::b0, DeleteCuikBox(), DeleteCurrent(), EndOfList(), Error(), FALSE, First(), GetCurrent(), INF, InitIterator(), TCuikBox::l, TCuikSystem::nSimp, TCuikSystem::nv, TCuikSystem::offset, PropagateRanges(), TRUE, TCuikBox::u, TCuikSystem::usedVars, VAR_ROT, and TCuikSystem::varType. Referenced by SolveCuikSystem(). ◆ PropagateRanges()
Bound the ranges of the unsused variables from the used ones. Unused variables are those eliminated in the simplification process. Rigth now this function is only defined for loop equations involving 6 variables from where 2 of them are removed (put in terms of the remaning 4).
Definition at line 3668 of file cuiksystem.c. References FALSE, Intersection(), IntervalAdd(), IntervalCenter(), IntervalDivision(), IntervalProduct(), IntervalScale(), TCuikBox::l, LowerLimit(), NEW, NewInterval(), TCuikSystem::nIn, TCuikSystem::nOut, TCuikSystem::nv, TCuikSystem::offset, PrintCuikBox(), PrintInterval(), PrintMatrix(), RC2INDEX, TCuikSystem::S, TCuikBox::u, UpperLimit(), TCuikSystem::vIn, and TCuikSystem::vOut. Referenced by PropagateSolutions(). ◆ IntersectWithCuikSystem()
Check the boxes in a list and keep those which intersect with the ranges in a given sub-problem (the ranges given by the offsets defining the sub-problem). We can either discard a box or keep the part of the box which intersect with the sub-problem.
Definition at line 3805 of file cuiksystem.c. References A2T, AddLastElement(), Advance(), CopyCuikBox(), CT_OFFSET, CT_SAVE_ANGLES, EndOfList(), Error(), FALSE, First(), GetCurrent(), GetParameter(), INF, InitIterator(), InitList(), Intersection(), TCuikBox::l, LowerLimit(), M_PI, NEW, NewInterval(), TCuikSystem::nv, OA, TCuikSystem::offset, T2A, TCuikBox::u, UpperLimit(), VAR_ROT, and TCuikSystem::varType. Referenced by main(). ◆ ComputeSplitDim()
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 3893 of file cuiksystem.c. References Error(), TCuikBox::l, NO_UINT, TCuikSystem::nv, randomMax(), TCuikBox::u, TCuikSystem::usedVars, and Warning(). Referenced by SolveCuikSystem(). ◆ EvaluateCSEquations()
Evaluates the equation set on a point.
Definition at line 3931 of file cuiksystem.c. References EvaluateCSEquation(), and TCuikSystem::ne. Referenced by ComputeJacobian(), ErrorInSolution(), and Newton(). ◆ PrintCuikSystem()
Writes the cuiksystem in a file that can be stdout.
◆ DeleteCuikSystem()
Deletes a cuiksystem.
Definition at line 3965 of file cuiksystem.c. References TCuikSystem::b0, TCuikSystem::boxL, TCuikSystem::boxU, DeleteCuikBox(), TCuikSystem::f, TCuikSystem::f0, TCuikSystem::J, TCuikSystem::nc, TCuikSystem::ne, TCuikSystem::nIn, TCuikSystem::nOut, TCuikSystem::nSimp, TCuikSystem::nv, TCuikSystem::nve, TCuikSystem::offset, TCuikSystem::outG, TCuikSystem::perm, TCuikSystem::S, TCuikSystem::sing, TCuikSystem::usedVars, TCuikSystem::varType, TCuikSystem::ve, TCuikSystem::veq, TCuikSystem::vIn, TCuikSystem::vOut, and TCuikSystem::work. Referenced by main(). |
Follow us!