|
|
box.c File ReferenceImplementation of the functions operating on Tbox. More... #include "box.h" #include "defines.h" #include "error.h" #include <string.h> #include <stdlib.h> #include <math.h> Go to the source code of this file.
Detailed DescriptionImplementation of the functions operating on Tbox. Definition in file box.c. Function DocumentationCreates a new box with the given parameters.
Definition at line 22 of file box.c. References Tbox::is, Tbox::level, Tbox::n, NEW, and NewInterval(). Referenced by BoxFromVariables(), ListOfBoxesBB(), main(), MPI_SolveCuikSystem(), MPI_TreatBox(), and ReadBox().
Here is the call graph for this function:
Here is the caller graph for this function:
In a multiprocessors system, the master and the slave processors exchange boxes and they do so by converting boxes into arrays of doubles. This function returns the number of doubles that takes a box when converted to into doubles. Typically, in the array of doubles we store some heading information plus the lower and upper limits for each one of the intervals in the box.
Definition at line 42 of file box.c. References Tbox::n. Referenced by MPI_SolveCuikSystem(), and MPI_TreatBox().
Here is the caller graph for this function:
Packs a box into an array of doubles and adds some heading information to the array.
Definition at line 47 of file box.c. References EMPTY_BOX, Error(), ERROR_IN_PROCESS, Tbox::is, Tbox::level, LowerLimit(), Tbox::n, REDUCED_BOX, REDUCED_BOX_WITH_SOLUTION, and UpperLimit(). Referenced by MPI_SolveCuikSystem(), and MPI_TreatBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Converts an array of doubles into a box. This is not a box constructor. The box is to be initialized before calling this function and if the box size and the buffer size do not match this function will trigger an error. The idea is to convert a box into a buffer, send it to slave processor, and then update the box with the information sent by the slave.
Definition at line 88 of file box.c. References EMPTY_BOX, Error(), ERROR_IN_PROCESS, Tbox::is, Tbox::level, Tbox::n, NewInterval(), REDUCED_BOX, and REDUCED_BOX_WITH_SOLUTION. Referenced by MPI_SolveCuikSystem(), and MPI_TreatBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Copies one box into another. This is a copy constructor and, therefore, the output box is initialized inside the CopyBox (i.e., there is no need to init the box beforehand).
Definition at line 126 of file box.c. References NEW. Referenced by ConcatListOfBoxes(), CopyListOfBoxes(), Heap2List(), InitHeapOfBoxes(), ListOfBoxesBB(), ListOfBoxesCluster(), PostProcessBox(), ReduceBox(), ReduceBoxEquationWise(), ReverseListOfBoxes(), and SampleCuikSystemInBox().
Here is the caller graph for this function:
This is a constructor that builds a box form a subset of intervals of a given box.
Definition at line 141 of file box.c. References CopyInterval(), and NEW.
Here is the call graph for this function:
Replaces a particular interval in a box by the given one.
Definition at line 175 of file box.c. References CopyInterval(), Error(), and Tbox::is. Referenced by BoxFromVariables(), and main().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns a pointer to the n interval of the box.
Definition at line 186 of file box.c. References Error(), and Tbox::is. Referenced by CSRemoveVarsWithCtRange(), ErrorInInequalities(), ErrorInSolution(), EvaluateEqMin(), main(), MoveWorld(), PointInSystemBox(), ReduceBox(), ReduceBoxEquationWise(), ReduceRange(), SampleCuikSystemInBox(), SimpleFromOriginal(), SimplexGetOptimalValue(), SimplifyCuikSystem(), and UpdateOriginalFromSimple().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns a pointer to the intervals defining the box. This allows fast access to the whole set of intervals of the box, i.e., we do not have to access them one at a time.
Definition at line 200 of file box.c. References Tbox::is. Referenced by AddEquation2Simplex(), ComputeSplitDimInt(), CoordInequalitiesHold(), CropEquation(), CropLinearConstraint(), EvaluateEqMin(), GetFirstOrderApproximationToEquation(), LinearizeCircleEquation(), LinearizeGeneralEquation(), LinearizeGeneralEquationInt(), LinearizeParabolaEquation(), LinearizeSaddleEquation(), LinearizeSphereEquation(), SetSimplexBounds(), UpdateOriginalFromSimple(), and UpdateSplitWeight().
Here is the caller graph for this function:
The intersection of two boxes is a box (possibly empty). This function computes the intersection of two given boxes, along a sub-set of its intervals.
Definition at line 209 of file box.c. References Error(), Intersection(), Tbox::is, Tbox::n, and TRUE. Referenced by ListOfBoxesCluster().
Here is the call graph for this function:
Here is the caller graph for this function:
The union of two boxes is a box. This function computes the union of two given boxes, along a sub-set of its intervals.
Definition at line 230 of file box.c. References Error(), Tbox::is, Tbox::n, and Union(). Referenced by ListOfBoxesBB(), and ListOfBoxesCluster().
Here is the call graph for this function:
Here is the caller graph for this function:
Checks if a point (defined by an array of n doubles) is included in a box.
Definition at line 248 of file box.c. References Error(), Tbox::is, IsInside(), Tbox::n, and TRUE.
Here is the call graph for this function:
Checks if a point (defined by an array of doubles) is included in a (sub-)box. The (sub-)box is selected using an array of flags.
Definition at line 270 of file box.c. References GetVectorElement(), Tbox::is, IsInside(), and TRUE.
Here is the call graph for this function:
Computes the distance from a point to the center of a (sub-)box. The (sub-)box is selected using an array of flags.
Definition at line 291 of file box.c. References GetVectorElement(), IntervalCenter(), Tbox::is, and Tbox::n.
Here is the call graph for this function:
Returns TRUE if the input box is (amost) punctual along the selected dimensions. A punctual interval is an interval whose size is below epsilon.
Definition at line 315 of file box.c. References IntervalSize(), Tbox::is, and TRUE.
Here is the call graph for this function:
Returns TRUE if the the first box is fully included in the second box.
Definition at line 335 of file box.c. References IntervalInclusion(), Tbox::is, and Tbox::n. Referenced by ReduceBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Determines the largest box side, among the sub-set of intervals selected via the array of booleans used.
Definition at line 356 of file box.c. References GetBoxMaxDim(), IntervalSize(), Tbox::is, and Tbox::n. Referenced by HeapOfBoxesMaxSize(), ListOfBoxesMaxSize(), MaxKinematicReduction(), MPI_SolveCuikSystem(), PostProcessBox(), ReduceBox(), ReduceBoxEquationWise(), and SolveCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Determines the largest box side, among the sub-set of variables included in the variable set vars.
Definition at line 365 of file box.c. References GetVariableN(), IntervalSize(), Tbox::is, and VariableSetSize(). Referenced by GetFirstOrderApproximationToEquation(), and LinearizeGeneralEquationInt().
Here is the call graph for this function:
Here is the caller graph for this function:
Determines the smallest box side, among the sub-set of variables included in the variable set vars.
Definition at line 383 of file box.c. References GetVariableN(), IntervalSize(), Tbox::is, and VariableSetSize(). Referenced by AddEquation2Simplex().
Here is the call graph for this function:
Here is the caller graph for this function:
Determines the diagonal of a sub-box of b determined using the array used.
Definition at line 404 of file box.c. References IntervalSize(), Tbox::is, and Tbox::n. Referenced by HeapOfBoxesMaxDiagonal(), ListOfBoxesMaxDiagonal(), and PostProcessBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the box level, i.e., the number of bisections form the first box used to cretate this box.
Definition at line 427 of file box.c. References Tbox::level. Referenced by MaxKinematicReduction(), MPI_SolveCuikSystem(), and SolveCuikSystem().
Here is the caller graph for this function:
Determines the distance between the cener of two (sub-)boxes determined using the array used.
Definition at line 436 of file box.c. References Error(), IntervalCenter(), Tbox::is, and Tbox::n.
Here is the call graph for this function:
Determines the volume of a box (i.e., the product of the box sides), fpr a sub-set of intervals selected via the array of booleans used.
Definition at line 463 of file box.c. References IntervalSize(), Tbox::is, and Tbox::n. Referenced by HeapOfBoxesVolume(), ListOfBoxesVolume(), MPI_SolveCuikSystem(), PostProcessBox(), ReduceBox(), ReduceBoxEquationWise(), and SolveCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the box dimensionality, i.e., the number of intervals defining the box.
Definition at line 481 of file box.c. References Tbox::n. Referenced by AnimateWorld(), CoordInequalitiesHold(), CropEquation(), CropLinearConstraint(), ErrorInInequalities(), ErrorInSolution(), GetFirstOrderApproximationToEquation(), LinearizeCircleEquation(), LinearizeGeneralEquation(), LinearizeParabolaEquation(), LinearizeSaddleEquation(), LinearizeSphereEquation(), LoadCSState(), main(), PointInSystemBox(), SetSimplexBounds(), and UpdateSplitWeight().
Here is the caller graph for this function:
Returns dimension of the (sub-)box along which the box has maximum size.
Definition at line 489 of file box.c. References IntervalSize(), Tbox::is, Tbox::n, and NO_UINT. Referenced by GetBoxSize(), and GetBoxSplitDim().
Here is the call graph for this function:
Here is the caller graph for this function:
Computes the box dimension for which it is better to split the box. Right now this function is an alias to GetBoxMaxDim.
Definition at line 519 of file box.c. References GetBoxMaxDim().
Here is the call graph for this function:
Splits a given box in two sub-boxes. This can be seen as a constructor method, that is, the two sub-boxes are created (or initilized) inside this function.
Definition at line 529 of file box.c. References Error(), INF, Tbox::is, Tbox::level, LowerLimit(), Tbox::n, NEW, NewInterval(), and UpperLimit(). Referenced by PostProcessBox(), and SplitGlobalBox().
Here is the call graph for this function:
Here is the caller graph for this function:
Scales a box for all its dimensions with the given scale factor.
Definition at line 584 of file box.c. References IntervalScale(), Tbox::is, and Tbox::n.
Here is the call graph for this function:
Returns TRUE if box b1 is to be explored first in depth first. This is to be used as a LessThan operator in a heap of boxes.
Definition at line 592 of file box.c. Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().
Here is the caller graph for this function:
Returns TRUE if box b1 is to be explored first in breadth first. This is to be used as a LessThan operator in a heap of boxes.
Definition at line 597 of file box.c. Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().
Here is the caller graph for this function:
Writes a box in file f, that can be stdout. The ouput is of the form {n [l1,u1]...[ln,un]} where n is the dimensionality of the box and [lx,ux] are the intervals defining the box.
Definition at line 605 of file box.c. References Tbox::is, Tbox::n, and PrintInterval(). Referenced by main(), MPI_SolveCuikSystem(), MPI_TreatBox(), PostProcessBox(), ReduceBox(), ReduceBoxEquationWise(), SampleCuikSystemInBox(), and SolveCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Writes a box in file f, that can be stdout. The ouput is of the form {n v1:[l1,u1]...vn:[ln,un]} where n is the dimensionality of the box vx is the name of the variable for dimension x and [lx,ux] is the corresponding interval. The variable names are only printed if vars is not NULL.
Definition at line 624 of file box.c. References Tbox::is, Tbox::n, and PrintInterval(). Referenced by main(), PostProcessBox(), PrintHeapOfBoxes(), and PrintListOfBoxes().
Here is the call graph for this function:
Here is the caller graph for this function:
Read a box from file f. The format of the boxes in the file is the same as that printed by PrintBox or PrintBoxSubset.
Definition at line 657 of file box.c. References Error(), InitBox(), NEW, and NewInterval(). Referenced by main(), and ReadListOfBoxes().
Here is the call graph for this function:
Here is the caller graph for this function:
Writes a box in file f in binary format.
Definition at line 719 of file box.c. References Tbox::is, Tbox::level, and Tbox::n. Referenced by SaveListOfBoxes().
Here is the caller graph for this function:
Reads a box from file f in binary format.
Definition at line 727 of file box.c. References Tbox::is, Tbox::level, Tbox::n, and NEW. Referenced by LoadListOfBoxes().
Here is the caller graph for this function:
Deletes a previously generated box (either via InitBox, ReadBox, CopyBox,...).
Definition at line 744 of file box.c. Referenced by ComputeSplitDim(), DeleteListOfBoxes(), InitHeapOfBoxes(), ListOfBoxesCluster(), main(), MaxReduction(), MPI_SolveCuikSystem(), MPI_TreatBox(), PostProcessBox(), ReduceBox(), ReduceBoxEquationWise(), SampleCuikSystem(), SampleCuikSystemInBox(), SimplifyCuikSystem(), and SolveCuikSystem().
Here is the caller graph for this function:
|