defines.h File Reference

Detailed Description

Definitions of constants and macros used in several parts of the cuik library.

See Also
geom.h

Definition in file defines.h.

Macros

#define ZERO   1e-11
 Floating point operations giving a value below this constant (in absolute value) are considered 0. More...
 
#define RANDOMNESS   (_DEBUG<2)
 If 0 we avoid any randomness in the cuiksuite behavior. More...
 
#define INF   DBL_MAX
 Infinite. More...
 
#define M_PI   3.14159265358979323846
 Pi. More...
 
#define M_PI_2   1.57079632679489661923
 Pi/2. More...
 
#define M_2PI   (2.0*M_PI)
 2*Pi. More...
 
#define M_E   2.718281828459045
 e. More...
 
#define TOPOLOGY_R   1
 One of the possible topologies. More...
 
#define TOPOLOGY_S   2
 One of the possible topologies. More...
 
#define MAX_INCLUDES   100
 Maximum number of nested included files. More...
 
#define SWAP(a, b, c)   {c=a;a=b;b=c;}
 Swaps two values. More...
 
#define DEG2RAD   (M_PI/180.0)
 Constant to transform from degrees to radiants. More...
 
#define RAD2DEG   (180.0/M_PI)
 Constant to transform from radiants to degrees. More...
 
#define SGN(a)   (a>=0?1:-1)
 Returns the sign of a floating point. More...
 
#define ADJUST_REAL(a)   (fabs(a)<ZERO?0.0:(fabs(a-1.0)<ZERO?+1.0:(fabs(a+1.0)<ZERO?-1.0:a)))
 Adjust a real to 0,1,-1, if possible. More...
 
#define PI2PI(a)   {if ((a<-M_PI-ZERO)||(a>M_PI+ZERO)) {a=fmod(a,M_2PI); while(a>M_PI) a-=M_2PI; while (a<-M_PI) a+=M_2PI;}}
 Forces an angle go be in [-pi,pi]. More...
 
#define ROUNDUP   fesetround(FE_UPWARD)
 Sets the floating point operations in rounding up mode. More...
 
#define ROUNDDOWN   fesetround(FE_DOWNWARD)
 Sets the floating point operations in rounding down mode. More...
 
#define ROUNDNEAR   fesetround(FE_TONEAREST)
 Sets the floating point operations in round near mode. More...
 
#define INF_CUT(a)   ((a<=-INF?-INF:(a>=INF)?INF:a))
 Sets a number, without going beyond +/-inf. More...
 
#define IS_INF(a)   ((a==-INF)||(a==INF))
 Identifies +/-inf. More...
 
#define IS_NOT_INF(a)   ((a!=-INF)&&(a!=INF))
 Identifies not +/-inf. More...
 
#define INF_SCALE(s, a)   (IS_INF(a)?(s<0?-a:a):(s*a))
 Scales a number, possibly inf or -inf. More...
 
#define INF_EXP(a)   ((a==-INF)?0:((a==INF)?INF:exp(a)))
 Exponentional of a number, possibly inf or -inf. More...
 
#define INF_PROD(a, b, d)   (IS_NOT_INF(a)&&IS_NOT_INF(b)?(a*b):(IS_INF(a)&&IS_INF(b)?(a==b?a:(d?-INF:INF)):(IS_INF(a)?(b>ZERO?a:(b<-ZERO?-a:0.0)):(a>ZERO?b:(a<-ZERO?-b:0.0)))))
 Product of two numbers, possibly inf or -inf. More...
 
#define INF_ADD(a, b, d)   (IS_NOT_INF(a)&&IS_NOT_INF(b)?(a+b):(IS_INF(a)&&IS_INF(b)?(a==b?a:(d?-INF:INF)):(IS_INF(a)?a:b)))
 Adds two numbers, possibly inf or -inf. More...
 
#define INF_SUBS(a, b, d)   (IS_NOT_INF(a)&&IS_NOT_INF(b)?(a-b):(IS_INF(a)&&IS_INF(b)?(a==b?(d?-INF:INF):a):(IS_INF(a)?a:-b)))
 Substract two numbers, possibly inf or -inf. More...
 
#define INF_POW(a, p)   (IS_NOT_INF(a)?pow(a,(double)p):((a==-INF)?(((p%2)==0)?INF:-INF):INF))
 Power of a number, possibly +/-inf. More...
 
#define INF_SQRT(a)   ((a==INF)?INF:(a<0.0?0.0:sqrt(a)));
 Sqrt of a number, possibly +/-inf. More...
 
#define INF_PRINT(f, a)   (a==INF?fprintf(f,"inf"):(a==-INF?fprintf(f,"-inf"):fprintf(f,"%.12g",a)))
 Prints a number (possibly +/-inf) to a file. More...
 
#define ANGLE_ACCURACY   1e-4
 Accuracy for the rounding to +/-PI, +/-PI/2. More...
 
#define ROUND2SYMBOL(a)   (fabs((a)+M_PI)<ANGLE_ACCURACY?-M_PI:(fabs((a)-M_PI)<ANGLE_ACCURACY?M_PI:(fabs((a)+M_PI_2)<ANGLE_ACCURACY?-M_PI_2:(fabs((a)-M_PI_2)<ANGLE_ACCURACY?M_PI_2:a))))
 Round to +/-PI, +/-PI/2. More...
 
#define SYMBOL_PRINT(f, a)   (fabs((a)+M_PI)<ANGLE_ACCURACY?fprintf(f,"-PI"):(fabs((a)-M_PI)<ANGLE_ACCURACY?fprintf(f,"PI"):(fabs((a)+M_PI_2)<ANGLE_ACCURACY?fprintf(f,"-PI/2"):(fabs((a)-M_PI_2)<ANGLE_ACCURACY?fprintf(f,"PI/2"):INF_PRINT(f,a)))))
 Prints a number (possibly +/-PI, +/-PI/2, or +/-inf) to a file. More...
 
#define NEW(_var, _n, _type)
 Allocates memory space. More...
 
#define NEWZ(_var, _n, _type)
 Allocates and cleans memory space. More...
 
#define MEM_EXPAND(_var, _n, _type)
 Expands a previously allocated memory space. More...
 
#define MEM_DUP(_var, _n, _type)   {(_n)*=2;MEM_EXPAND(_var,_n,_type);}
 Duplicates a previously allocated memory space. More...
 
#define PRINT_VARIABLE_NAME(f, name)   if (name[0]=='_') fprintf(f,"%s",&(name[1])); else fprintf(f,"%s",name)
 Prints a variable name into a file. More...
 
#define NO_UINT   ((unsigned int)(-1))
 Used to denote an identifier that has not been initialized. More...
 
#define MOV_AVG_UP   0.1
 Weight of new data when computing moving averages. More...
 
#define MOV_AVG_DOWN   0.1
 Weight of new data when computing moving averages. More...
 

Macro Definition Documentation

#define ZERO   1e-11

Floating point operations giving a value below this constant (in absolute value) are considered 0.

We use 1e-11 because trigonometric operations (sin/cos/...) give an error typically around 1e-12. Moreover, we print doubles with 12 decimals and, thus the last one typically varies when performing operations. Note that 1e-11 is far below the typical precission used inside the simplex algorithms (1e-6).

No to be confused with parameter EPSILON. ZERO is used as a general threshold to round towards 0 and Epsilon is used only when passing parameters to the simplex. For a super-numerically-stable simplex EPSILON and ZERO would be the same.

Definition at line 37 of file defines.h.

Referenced by AddCt2Monomial(), AddScaledMonomial(), ApplyLinkRotFLinks(), ApplyLinkRotLinks(), ApplyLinkRotQLinks(), BoxSphereClipping(), CmpLinearConstraints(), CropEquation(), CropLinearConstraint(), CSRemoveLCVars(), CtScaleEquation(), EmptyEquation(), EvaluateLinearConstraintInt(), EvaluateMonomialInt(), EvaluateVarSet(), FixVariableInMonomial(), FixVariableInVarSet(), GetFirstOrderApproximationToEquation(), GetJointDOFValues(), GetVariableTopology(), HTransformIsIdentity(), HTransformIsTranslation(), IntersectChartsInt(), Line2Points(), MonomialProduct(), NewInPatchJoint(), NewPrismaticJoint(), NewRevoluteJoint(), NewSphericalJoint(), NewUniversalJoint(), NormalizeEquation(), Plane3Points(), PrintAngle(), PrintLinearConstraint(), PrintMonomial(), PrintMonomials(), PrintReal(), PurgeEquation(), RectangleCircleClipping(), ReplaceVariableInEquation(), ReplaceVariableInMonomial(), SetMonomialCt(), SimplexAddNewConstraint(), and SimplifyLinearConstraint().

#define RANDOMNESS   (_DEBUG<2)

If set to 0 we avoid any randomness in the cuiksuite behavior. This is basically used for debug. In norma mode, the applications in the cuiksuite rely on some randomness (to select the variable to split a box, to select the split point,...). This is usefull to improve the performance in degenerate situations and it does not hinder the convergence in the usual cases. For debug purposes, though, this randomness can be quite annoying and can be deactivated here.

Right now we only use random behavior when in optimized mode.

Todo:
Remove this in the final version. This is for debug only

Definition at line 55 of file defines.h.

Referenced by BuildAtlasFromPoint().

#define INF   DBL_MAX

Infinite.

Definition at line 70 of file defines.h.

Referenced by AddEquation2Simplex(), AddNodeToRRT(), AddStepToRRTstar(), AtlasAStar(), AtlasBiRRTstar(), AtlasBiRRTstarCloseIteration(), AtlasGBF(), AtlasRRT(), AtlasRRTstar(), AtlasRRTValidateSample(), AtlasTRRT(), BiRRTstar(), BiRRTstarCloseIteration(), BoundedLinearConstraint(), cBiRRT(), ccRRT(), ccTRRT(), Chart2Manifold(), ChartVolume(), CleanInfEquation(), ComputeSplitDimInt(), CropEquation(), CropLinearConstraint(), DistanceOnChart(), DistancePointToBox(), DistancePointToBoxTopology(), EquationFromLinearConstraint(), FindRightNullVector(), GenerateJointRangeEquations(), GeodesicDistance(), GetEquationBounds(), GetFirstOrderApproximationToEquation(), GetPolytopeInteriorPoint(), GetRRTNN(), GetRRTNNInBranch(), GetRRTNNInNeighbourChart(), GetSCpSystem(), InitJoint(), IntervalDivision(), IntervalSecant2Tangent(), IntervalSize(), IntervalTangent(), IsSimplificable(), LinearizeGeneralEquationInt(), main(), MinimizeOnAtlas(), NewFreeJoint(), NewVariable(), PlotChart(), PlotChartAsPolygon(), PrintAtlasRRTStatistics(), PrintParameters(), PrintRRTStatistics(), ReduceRange(), RegenerateSolution(), ReWireAtlasRRTstar(), ReWireRRTstar(), RRTstar(), RRTValidateSample(), SaveChartCenters(), SaveRRTCosts(), SegmentCircleIntersection(), SegmentSphereIntersection(), SetSimplexBounds(), SimplexCreate(), SimplexExpandBounds(), SimplexGetColBounds(), SimplexGetOptimalValue(), SimplexGetRowBounds(), SimplexSetColBounds(), SimplexSetRowBounds(), Steps2PathinRRT(), UpdateBiRRTSteps(), WireAtlasRRTstar(), WireRRTstar(), and WorldDOF2Sol().

#define M_PI_2   1.57079632679489661923
#define M_E   2.718281828459045

Base of the natural log.

Definition at line 109 of file defines.h.

#define TOPOLOGY_S   2

The range of the variables is defined over a circle.

IMPORTANT: Only variables with range equal (or larger) than 2*pi are actually considered to have TOPOLOGY_S. Variables defined with TOPOLOGY_S but with small ranges are actually treated as varaibles with TOPOLOGY_R.

If a variable x has TOPOLOGY_S it means that we can replace this variable by x+k*2*pi (k any integer) and the system of equations remains the same. If a variable is defined with TOPOLOGY_S but it does not fulfills the above condition an error is likely to occur.

Definition at line 139 of file defines.h.

Referenced by ArrayPi2Pi(), Chart2Manifold(), DifferenceVectorTopology(), DistanceTopology(), DistanceTopologyMin(), GenerateJointEquations(), GetJointRangeTopology(), GetVariableTopology(), main(), PrintVariable(), SetAtlasTopology(), SetRRTTopology(), SetVariableTopology(), SquaredDistanceTopology(), SquaredDistanceTopologyMin(), and WorldDOF2Sol().

#define MAX_INCLUDES   100

A maximum of recursively included files to avoid infinite loops.

Definition at line 148 of file defines.h.

#define SWAP (   a,
  b,
 
)    {c=a;a=b;b=c;}

Swaps two values using an intermediate storage.

Parameters
aFirst value to swap.
bSecond value to swap.
cIntermediate storage for the swap.

Definition at line 161 of file defines.h.

Referenced by AddVariableInt().

#define DEG2RAD   (M_PI/180.0)

Constant to transform from degrees to radiants.

Definition at line 169 of file defines.h.

Referenced by main().

#define RAD2DEG   (180.0/M_PI)

Constant to transform from radiants to degrees.

Definition at line 175 of file defines.h.

#define SGN (   a)    (a>=0?1:-1)

Returns the sign of a floating point: -1 for negative and 1 for possitive or zero.

Parameters
aThe number to operate.

Definition at line 185 of file defines.h.

Referenced by PolytopeBoundaryPointFromExternalCornerInt().

#define ADJUST_REAL (   a)    (fabs(a)<ZERO?0.0:(fabs(a-1.0)<ZERO?+1.0:(fabs(a+1.0)<ZERO?-1.0:a)))

Adjust a real to 0,1,-1, if possible.

Parameters
aThe number to adjust.

Definition at line 195 of file defines.h.

Referenced by NewInPatchJoint(), NewPrismaticJoint(), NewRevoluteJoint(), NewSphericalJoint(), NewSphPrsSphJoint(), NewSphSphJoint(), and NewUniversalJoint().

#define PI2PI (   a)    {if ((a<-M_PI-ZERO)||(a>M_PI+ZERO)) {a=fmod(a,M_2PI); while(a>M_PI) a-=M_2PI; while (a<-M_PI) a+=M_2PI;}}

Forces an angle go be in [-pi,pi]. This is intended to be used with a variable as a parameter (using an expression would be ineficient).

Definition at line 205 of file defines.h.

Referenced by ArrayPi2Pi(), Chart2Manifold(), correctAngle(), DifferenceVectorTopology(), DistanceTopology(), DistanceTopologyMin(), OutOfBoxTopology(), PointInBoxTopology(), SquaredDistancePointToBoxTopology(), SquaredDistanceToBoxDimensionTopology(), SquaredDistanceTopology(), SquaredDistanceTopologyMin(), and WorldDOF2Sol().

#define INF_CUT (   a)    ((a<=-INF?-INF:(a>=INF)?INF:a))
#define IS_INF (   a)    ((a==-INF)||(a==INF))

TRUE if the number is either inf or -inf.

Parameters
aThe number to check.

Definition at line 246 of file defines.h.

Referenced by EnlargeInterval(), IntervalCenter(), IntervalSize(), and PointInInterval().

#define IS_NOT_INF (   a)    ((a!=-INF)&&(a!=INF))

TRUE if the number is not inf or -inf.

Parameters
aThe number to check.

Definition at line 255 of file defines.h.

Referenced by EnlargeInterval().

#define INF_SCALE (   s,
 
)    (IS_INF(a)?(s<0?-a:a):(s*a))

Scales a number, possibly inf or -inf.

See Also
INF_PROD if 's' can be inf also.
Parameters
sThe scale factor (this is not +/-inf).
aThe number to scale.

Definition at line 267 of file defines.h.

Referenced by IntervalScale().

#define INF_EXP (   a)    ((a==-INF)?0:((a==INF)?INF:exp(a)))

Exponentional of a number, possibly inf or -inf.

Parameters
aThe number to operate.

Definition at line 276 of file defines.h.

Referenced by IntervalExp().

#define INF_PROD (   a,
  b,
 
)    (IS_NOT_INF(a)&&IS_NOT_INF(b)?(a*b):(IS_INF(a)&&IS_INF(b)?(a==b?a:(d?-INF:INF)):(IS_INF(a)?(b>ZERO?a:(b<-ZERO?-a:0.0)):(a>ZERO?b:(a<-ZERO?-b:0.0)))))

Product of two numbers, possibly inf or -inf.

When rounding down, INF*(-INF) is set to -INF, otherwise to INF.

Parameters
aThe first number to operate.
bThe second number to operate.
dTRUE if rounding down.

Definition at line 289 of file defines.h.

Referenced by IntervalProduct().

#define INF_ADD (   a,
  b,
 
)    (IS_NOT_INF(a)&&IS_NOT_INF(b)?(a+b):(IS_INF(a)&&IS_INF(b)?(a==b?a:(d?-INF:INF)):(IS_INF(a)?a:b)))

Adds two numbers, possibly inf or -inf.

When rounding down, INF+(-INF) is set to -INF, otherwise to INF.

Parameters
aThe first number to operate.
bThe second number to operate.
dTRUE if rounding down.

Definition at line 302 of file defines.h.

Referenced by IntervalAdd(), and IntervalOffset().

#define INF_SUBS (   a,
  b,
 
)    (IS_NOT_INF(a)&&IS_NOT_INF(b)?(a-b):(IS_INF(a)&&IS_INF(b)?(a==b?(d?-INF:INF):a):(IS_INF(a)?a:-b)))

Substract two numbers, possibly inf or -inf.

When rounding down, INF-INF is set to -INF, otherwise to INF.

Parameters
aThe first number to operate.
bThe second number to operate.
dTRUE if rounding down.

Definition at line 315 of file defines.h.

Referenced by IntervalSubstract().

#define INF_POW (   a,
 
)    (IS_NOT_INF(a)?pow(a,(double)p):((a==-INF)?(((p%2)==0)?INF:-INF):INF))

Power of a number, possibly +/-inf.

Parameters
aThe number to operate.
pThe power (integer possitive).

Definition at line 325 of file defines.h.

Referenced by IntervalPow().

#define INF_SQRT (   a)    ((a==INF)?INF:(a<0.0?0.0:sqrt(a)));

Sqrt of a number, possibly +/-inf.

Parameters
aThe number to operate.

Definition at line 334 of file defines.h.

Referenced by IntervalSqrt().

#define INF_PRINT (   f,
 
)    (a==INF?fprintf(f,"inf"):(a==-INF?fprintf(f,"-inf"):fprintf(f,"%.12g",a)))

Prints a number (possibly +/-inf) to a file.

Parameters
fThe file.
aThe number.

Definition at line 344 of file defines.h.

Referenced by PrintInterval().

#define ANGLE_ACCURACY   1e-4

Accuracy used when rounding values to +/-PI and +/-PI/2

Definition at line 352 of file defines.h.

Referenced by OutOfBoxTopology(), PointInBoxTopology(), SquaredDistancePointToBoxTopology(), and SquaredDistanceToBoxDimensionTopology().

#define ROUND2SYMBOL (   a)    (fabs((a)+M_PI)<ANGLE_ACCURACY?-M_PI:(fabs((a)-M_PI)<ANGLE_ACCURACY?M_PI:(fabs((a)+M_PI_2)<ANGLE_ACCURACY?-M_PI_2:(fabs((a)-M_PI_2)<ANGLE_ACCURACY?M_PI_2:a))))

When reading values from equation files, we round them to +/-PI or to +/-PI/2 to gain accuracy. The rounding is only applied for variables that are known to be angles.

Parameters
aThe angular value to round.

Definition at line 362 of file defines.h.

#define SYMBOL_PRINT (   f,
 
)    (fabs((a)+M_PI)<ANGLE_ACCURACY?fprintf(f,"-PI"):(fabs((a)-M_PI)<ANGLE_ACCURACY?fprintf(f,"PI"):(fabs((a)+M_PI_2)<ANGLE_ACCURACY?fprintf(f,"-PI/2"):(fabs((a)-M_PI_2)<ANGLE_ACCURACY?fprintf(f,"PI/2"):INF_PRINT(f,a)))))

Prints a number (possibly +/-PI, +/-PI/2, or +/-inf) to a file. Numbers close (up to 1e-4 to +/-PI or +/-PI/2 are printed symbolically). This increases accuracy when reading these values.

This type of printing is only used for variables that are known to be angles.

Parameters
fThe file.
aThe angular value to print.

Definition at line 376 of file defines.h.

Referenced by PrintSymbolInterval().

#define NEW (   _var,
  _n,
  _type 
)
Value:
{(_var)=(_type *)malloc(sizeof(_type)*(_n)); \
if (!(_var)) Error("Memory allocation error");}
void Error(const char *s)
General error function.
Definition: error.c:80

Allocates memory space for _n elements of type _type and assigns the pointer to _var. If the memory can not be allocated, triggers an error.

Definition at line 385 of file defines.h.

Referenced by AddBody2Link(), AddBorderConstraint(), AddBranchToAtlasRRT(), AddBranchToRRT(), AddChart2Atlas(), AddChart2AtlasRRT(), AddChart2Btree(), AddConstant(), AddCtTrans2TransSeq(), AddDispTrans2TransSeq(), AddEquation2Simplex(), AddEquationInt(), AddJacobianEquationsInt(), AddJoint2Mechanism(), AddLink2Mechanism(), AddLink2World(), AddMatrixEquation(), AddNodeToRRT(), AddObstacle2World(), AddPatchTrans2TransSeq(), AddSample2AtlasRRT(), AddSample2Samples(), AddScaledMonomial(), AddShape2Environment(), AddSimplifiedJacobianEquations(), AddStepToBranch(), AddStepToRRTstar(), AddTrans2TransSeq(), AddTrustedChart2Atlas(), AddVariable(), AddVarTrans2TransSeq(), AdjustBioWorldGeometry(), AllocateHessianEvaluation(), AllocateJacobianEvaluation(), ApplyLinkRotFLinks(), ApplyLinkRotLinks(), ApplyLinkRotQLinks(), AtlasAStar(), AtlasBiRRTstar(), AtlasGBF(), AtlasRRT(), AtlasRRTstar(), AtlasTRRT(), BioWordConformationFromAtomPositions(), BiRRTstar(), Branches2Links(), BuildAtlasFromPoint(), CacheRotVarsFLinks(), CacheRotVarsLinks(), CacheRotVarsQLinks(), CacheScalarEQUInfo(), cBiRRT(), ccRRT(), ccTRRT(), Chart2Manifold(), ChartErrorFromParameters(), ChartVolume(), ClassifyPointInChart(), CompareTangentSpaces(), ComputeJacobianKernelBasis(), ComputeSplitDimInt(), ConcatSamples(), ConnectSamples(), ConnectSamplesChart(), CopyBox(), CopyBoxSubset(), CopyChart(), CopyConstants(), CopyCuikSystem(), CopyEquation(), CopyEquationInfo(), CopyEquations(), CopyJacobian(), CopyLinearConstraint(), CopyLink(), CopyMapping(), CopyMEquation(), CopyPolyhedron(), CopyPolytope(), CopySPolytope(), CopyTrans(), CopyTransSeq(), CopyVariable(), CopyVariables(), CopyVarSet(), CopyVector(), CreateFileName(), CropEquation(), CSRemoveLCVars(), CSRemoveVarsWithCtRange(), CuikNewtonInBox(), CutPolytopeWithFace(), CutSPolytopeWithFace(), DealWithCP(), DefineChartsAtBifurcation(), DefinePolytope(), DefineSPolytope(), DeriveEquation(), DeriveMEquation(), DeriveTransSeq(), DeriveVarSet(), DetectBifurcation(), DetectLinksAndJoints(), DetectLinksAndJointsFromResidues(), DetectLinksAndJointsFromRigidsAndHinges(), DetermineSPolytopeNeighbour(), DistanceOnChart(), DummifyAndAddEquation(), Error2Chart(), ErrorDueToVariable(), ErrorInCSEquations(), ErrorInInequalities(), ErrorInSimpCSEquations(), ErrorInSimpInequalitiesOnPoint(), ErrorInSolution(), EvaluateEqMin(), EvaluateHessian(), EvaluateJacobian(), EvaluateJacobianInVector(), EvaluateJacobianSubSetInVector(), EvaluateJacobianXVectors(), EvaluateTransposedJacobianInVector(), EvaluateTransposedJacobianSubSetInVector(), ExtendAtlasFromPoint(), ExtendAtlasTowardPoint(), FindPointInOtherBranch(), FindRightNullVector(), FindSingularPoint(), ForceChartCut(), GenerateCylinderOFF(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), GenerateJointRangeSingularityEquations(), GenerateJointSolution(), GenerateKinTree(), GenerateLinkRotFLinks(), GenerateLinkRotLinks(), GenerateLinkRotQLinks(), GenerateSphereOFF(), GenerateWorldSingularityEquations(), GenerateWorldTWSEquations(), GeodesicDistance(), GetChartDegree(), GetChartNeighboursFromVertices(), GetCSSystemVars(), GetFirstOrderApproximationToEquation(), GetJointName(), GetJointTransSeq(), GetLinkTransformsFromDOF(), GetLinkTransformsFromSolution(), GetLinkTransformsFromSolutionPoint(), GetMoleculeBasicInfo(), GetPolytopeEdges(), GetPolytopeNeighboursFromVertices(), GetPolytopeVertices(), GetRRTNNInBall(), GetSCpSystem(), GetSolutionPointFromLinkTransforms(), GetVariablesTopology(), GetWorldDOFLabel(), GetWorldSimpVariableMask(), GradientSmooth(), IncrementalSampleCuikSystemInBox(), InequalitiesHoldOnPoint(), InitAtlas(), InitAtlasFromPoint(), InitAtlasRRT(), InitAverages(), InitBioWorld(), InitBox(), InitBoxFromPoint(), InitBTree(), InitCD(), InitChartInt(), InitConstants(), InitCSWDFromFile(), InitCtTrans(), InitEquation(), InitEquations(), InitHessian(), InitJacobian(), InitLinearConstraint(), InitLink(), InitMapping(), InitMEquation(), InitPatchTrans(), InitPlot3d(), InitPolyhedronFromFile(), InitPolyhedronFromTriangles(), InitPQPCD(), InitRRT(), InitSampleFromBox(), InitSamples(), InitSolidCD(), InitTransSeq(), InitTVTrans(), InitVariables(), InitVarSet(), InitVcollideCD(), InitVector(), InitWorldCD(), InitWorldFromMolecule(), InitWorldKinCS(), IntersectChartsInt(), LinearizeBilinealMonomialEquation(), LinearizeCircleEquation(), LinearizeGeneralEquation(), LinearizeParabolaEquation(), LinearizeSaddleEquation(), LinearizeSphereEquation(), ListOfBoxesCluster(), LoadAtlas(), LoadAtlasRRT(), LoadAtlasRRTSampleInfo(), LoadBifurcations(), LoadBox(), LoadChart(), LoadLinearConstraint(), LoadMapping(), LoadPolytope(), LoadRRT(), LoadSamples(), LoadSPolytope(), main(), Manifold2Chart(), MergeBoxes(), MinCosinusBetweenSubSpaces(), MinimizeOnAtlas(), MoveWorld(), MPI_SolveCuikSystem(), MPI_TreatBox(), NewBox(), NewChartFromPoint(), NewSegments(), NewTemptativeSample(), NewtonInWorld(), NewVariable(), on_cuikmove_save(), PathInChart(), PlotAtlasRRT(), PlotChart(), PlotChartAsPolygon(), PlotQrand(), PlotRRT(), PlotSamples(), PointFromVariables(), PointInBoxTopology(), PointOnChart(), PolytopeBoundaryPointsFromExternalCorners(), PolytopeVolume(), PopulateWithSamples(), PostProcessBox(), PrintCuikSystem(), PrintCuikSystemWithSimplification(), PrintLink(), PrintMapping(), PrintPolyhedron(), PrintWorldAxes(), PrivAddElement(), ProductEquations(), RandomPointInAtlasTree(), RandomSmooth(), ReadBox(), ReadGeneralMesh(), ReadOFF(), ReadOneSample(), ReadResidueList(), ReadRigidsAndHinges(), ReadSegments(), ReadSTL(), ReadTwoSamples(), ReconstructAtlasPath(), RefineSingularPoint(), RegenerateJointBox(), RegenerateJointSolution(), RegenerateSolutionPoint(), RegenerateWorldOriginalPoint(), RegenerateWorldSolutionPoint(), ReverseConcatSamples(), RRTstar(), SampleCuikSystemInBox(), SaveChartCenters(), SaveCSState(), SearchInBtree(), SetEquationInfo(), SetTransVars(), SetVectorElement(), SHTransformCopy(), SHTransformFromEqVectors(), SHTransformInit(), SHTransformTranspose(), SimpInequalitiesHoldOnPoint(), SimplexAddNewConstraintRaw(), SimplexColEmpty(), SimplexCreate(), SimplexGetColConstraint(), SimplexGetOptimalValue(), SimplexGetOptimizationFunction(), SimplexGetRowConstraint(), SimplexSetOptimizationFunction(), SimplifyCuikSystem(), SmoothPathInAtlasRRT(), SmoothSamples(), SplitBox(), SPolytope2Polytope(), SPolytopeVolume(), TriangulateAtlas(), UpdateCuikSystem(), UpdateSplitWeight(), WireAtlasRRTstar(), WireRRTstar(), WorldAtomJacobian(), WorldDOF2Sol(), WorldInitDOFInfo(), and WorldSample2DOF().

#define NEWZ (   _var,
  _n,
  _type 
)
Value:
{(_var)=(_type *)calloc(_n,sizeof(_type)); \
if (!(_var)) Error("Memory allocation error");}
void Error(const char *s)
General error function.
Definition: error.c:80

Allocates memory space for _n elements of type _type and assigns the pointer to _var and initializes the space to zero. If the memory can not be allocated, triggers an error.

Definition at line 394 of file defines.h.

#define MEM_EXPAND (   _var,
  _n,
  _type 
)
Value:
{(_var)=(_type *)realloc((void *)(_var),sizeof(_type)*(_n)); \
if (!(_var)) Error("Memory reallocation error");}
void Error(const char *s)
General error function.
Definition: error.c:80

Expands a previously reserved memory space so that it can accomodate _n elements of type _type assigns the pointer to _var. The previously allocated space is pointed by _var. If the memory can not be expanded, triggers an error.

Definition at line 404 of file defines.h.

Referenced by AddChart2AtlasRRT(), AddEdgeToRRT(), AddLink2World(), AddObstacle2World(), AddTerm2LinearConstraint(), AddVariableInt(), AtlasAStar(), AtlasGBF(), CutPolytopeWithFace(), CutSPolytopeWithFace(), DeriveMEquation(), InitWorldFromMolecule(), MergeBoxes(), ReadRigidsAndHinges(), and SetVectorElement().

#define PRINT_VARIABLE_NAME (   f,
  name 
)    if (name[0]=='_') fprintf(f,"%s",&(name[1])); else fprintf(f,"%s",name)

Automatically generated variables have a name that starts with a '_'. This is done to avoid the generation of a variable with the same name of a variable defined by the user (the syntax does not allow for variables starting with a '_').
When printing the name of the variable into a file we remove the starting '_' to allow the input parser to read the output file. If this results in a duplicated variable the parser will detect it.

Definition at line 427 of file defines.h.

Referenced by main(), PrintBoxSubset(), PrintMapping(), PrintTransSeq(), PrintVariable(), and PrintVarSet().

#define NO_UINT   ((unsigned int)(-1))

Used to denote an identifier that has not been initialized.

Definition at line 435 of file defines.h.

Referenced by AddBorderConstraint(), AddBox2HeapOfBoxes(), AddBranchToAtlasRRT(), AddChart2Atlas(), AddChart2AtlasRRT(), AddList2Heap(), AddScaledMonomial(), AddStepToAtlasRRTstar(), AddStepToRRTstar(), AddTrustedChart2Atlas(), AddVariable2CS(), AdjustBioWorldGeometry(), ApplyLinkRotFLinks(), ApplyLinkRotLinks(), ApplyLinkRotQLinks(), ApplyLinkRotVar(), AtlasAStar(), AtlasBiRRTstar(), AtlasGBF(), AtlasRRT(), AtlasRRTSample(), AtlasRRTstar(), AtlasRRTstarCloseIteration(), AtlasRRTValidateSample(), AtlasTRRT(), Atoms2Transforms(), BioWordGetAtomPositionsFromConformation(), BiRRTstar(), Branches2Links(), BuildAtlasFromPoint(), ccRRT(), ccTRRT(), CDCallBackInfo(), CheckCollisionPQP(), CheckCollisionSolid(), CheckCollisionVcollide(), CloseCharts(), ComputeSplitDim(), ComputeSplitDimInt(), CostToRoot(), CoupledWith(), CSRemoveLCVars(), CSRemoveVarsWithCtRange(), CutPolytopeWithFace(), CutSPolytopeWithFace(), DefineChartsAtBifurcation(), DefinePolytope(), DeleteAverages(), DeletePolytope(), DetectLinksAndJoints(), DetectLinksAndJointsFromResidues(), DetectLinksAndJointsFromRigidsAndHinges(), DetermineChartNeighbour(), DetermineChartNeighbours(), DetermineSPolytopeNeighbour(), DummifyAndAddEquation(), ExtendAtlasFromPoint(), ExtractMinElement(), FindMonomial(), GaussianElimination(), GenerateCrossProductEquations(), GenerateDotProductEquation(), GenerateJointEquations(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), GenerateJointRangeSingularityEquations(), GenerateJointSolution(), GenerateLinkRotFLinks(), GenerateLinkRotLinks(), GenerateLinkRotQLinks(), GenerateWorldSingularityEquations(), GenerateWorldTWSEquations(), GetAtomResidue(), GetBoxMaxDim(), GetChartDegree(), GetConstantWithName(), GetFirstNeighbour(), GetHeapPosition(), GetJointTransSeq(), GetLinearConstraintVariable(), GetLinkBodyStatus(), GetLinkID(), GetLinkPoseSimpVars(), GetMechanismLinkID(), GetMoleculeBasicInfo(), GetNextNeighbour(), GetObstacleID(), GetObstacleShapeStatus(), GetParameterID(), GetPlaceinSet(), GetRRTNN(), GetRRTNNInBranch(), GetRRTNNInChart(), GetRRTNNInNeighbourChart(), GetRRTNodeTree(), GetRRTParent(), GetVariableID(), GetVariableWithName(), GetVarIDInOriginal(), IncrementalSampleCuikSystemInBox(), InitAtlasRRT(), InitAverages(), InitChartInt(), InitCtTrans(), InitJoint(), InitLink(), InitMapping(), InitPolyhedronFromFile(), InitPolyhedronFromTriangles(), InitPQPCD(), InitRRT(), InitSolidCD(), InitTVTrans(), InitVarTrans(), InitVcollideCD(), InitWorld(), InitWorldFromMolecule(), IsInSimple(), IsSimplificable(), IsSystemVarInSimpCS(), LoadPolytope(), main(), MaxVectorElement(), MinVectorElement(), MoveLinkFromTransform(), MovePolyhedron(), NewBox(), NewCylinder(), NewLine(), NewSegments(), NewSphere(), NewSuccesfulExperiment(), OutOfBoxTopology(), PlotAtlas(), PlotJoint(), PlotLink(), PolytopeBoundaryPointFromExternalCorner(), PolytopeBoundaryPointFromExternalCornerInt(), PolytopeNeighbourID(), PolytopeNumNeighbours(), PopulateWithSamples(), PostProcessNewCharts(), PrintAverages(), ReconstructAtlasPath(), ReconstructAtlasRRTPath(), RecursiveReWireRRTstar(), ReplaceVariableInEquation(), ReWireAtlasRRTstar(), RewriteEquation2Orig(), RRTPathLength(), RRTPathSteps(), RRTstar(), RRTstarCloseIteration(), SampleCuikSystemInBox(), SaveChartCenters(), SetRotVars(), SetRRTParent(), SetTransVars(), ShiftVariablesInTransSeq(), SimpleFromOriginal(), SimplePointFromOriginal(), SmoothPathInAtlasRRT(), SPolytopeNeighbourID(), Steps2PathinAtlasRRT(), StepsToRoot(), StoreCollisionInfoInt(), TriangulateAtlas(), UpdateBiRRTSteps(), UpdateCostAndTree(), UpdateTree(), VarIncluded(), WireAtlasRRTstar(), WorldDOF2Sol(), and WorldInitDOFInfo().

#define MOV_AVG_UP   0.1

Weight used for the new data when computing moving averages. In particular this constant gives the weight when increasing the average.

This is typically used to self-tune parameters.

This value must be between 0 and 1. If 0 the new data is not taken into account. If 1 only the new data is used (forgetting the previous one). A standard value for this parameter is in the range [0.01, 0.1].

Definition at line 451 of file defines.h.

Referenced by AdjustDynamicDomain(), AtlasRRT(), main(), and SPolytopeIncreaseSamplingRadius().

#define MOV_AVG_DOWN   0.1

Weight used for the new data when computing moving averages. In particular this constant gives the weight when decreasing the average.

This is typically used to self-tune parameters.

This value must be between 0 and 1. If 0 the new data is not taken into account. If 1 only the new data is used (forgetting the previous one). A standard value for this parameter is in the range [0.01, 0.1].

Definition at line 467 of file defines.h.

Referenced by AdjustDynamicDomain(), AtlasRRT(), main(), and SPolytopeDecreaseSamplingRadius().