parameters.c File Reference

Detailed Description

Implementation of functions to deal with Tparameters.

See Also
Tparameters, parameters.h.

Definition in file parameters.c.

Functions

boolean ReadParameters (char *file, Tparameters *p)
 Reads a parameter set from a file. More...
 
void InitParameters (Tparameters *p)
 Constructor. More...
 
void InitParametersFromFile (char *file, Tparameters *p)
 Constructor from a file. More...
 
double GetParameter (unsigned int n, Tparameters *p)
 Gets the value for a particular parameter. More...
 
unsigned int GetParameterID (char *name, Tparameters *p)
 Returns the parameter identifier given the paramete name. More...
 
boolean ParameterSet (unsigned int n, Tparameters *p)
 Checks if a parameter is already defined. More...
 
void SetParameter (unsigned int n, char *name, double v, Tparameters *p)
 Sets the name and value for a particular parameter. More...
 
void ChangeParameter (unsigned int n, double v, Tparameters *p)
 Sets the value for a particular parameter. More...
 
void PrintParameters (FILE *f, Tparameters *p)
 Prints a parameter set. More...
 
void DeleteParameters (Tparameters *p)
 Destructor. More...
 

Function Documentation

boolean ReadParameters ( char *  file,
Tparameters p 
)

Reads a parameter set from a file.

Parameters
fileThe name of the file.
pThe parameter set to update.
Returns
TRUE if the the file with the parameter exists.

Referenced by InitParametersFromFile().

void InitParameters ( Tparameters p)

Defines an empty set of parameters.

Parameters
pThe set to be initialized.

Definition at line 36 of file parameters.c.

References NPARAMETERS.

Referenced by InitParametersFromFile().

void InitParametersFromFile ( char *  file,
Tparameters p 
)

Defines an set of parameters from a file. It first read the default set of parameters and then the given set of parameters.

Parameters
fileName of the file with the set of parameters particular for the problem at hand.
pSet of parameters to define.
See Also
ReadParameters, defines.h

Definition at line 51 of file parameters.c.

References CreateFileName(), DEFAULT_PARAMS, DeleteFileName(), Error(), GetFileFullName(), InitParameters(), NPARAMETERS, PARAM_EXT, ReadParameters(), and Warning().

Referenced by main().

double GetParameter ( unsigned int  n,
Tparameters p 
)

Gets the value for a particular parameter.

Parameters
nNumber of parameter.
pSet of parameters.
Returns
The value of the parameter. If there is no parameter with the given number this functions triggers an error.

Definition at line 93 of file parameters.c.

References Error(), and NPARAMETERS.

Referenced by AddBranchToAtlasRRT(), AddNodeToRRT(), AddStepToAtlasRRTstar(), AddStepToRRTstar(), AddTrustedChart2Atlas(), ApplyLinkRot(), ApplyLinkRotVar(), AtlasAStar(), AtlasBiRRTstar(), AtlasGBF(), AtlasRRT(), AtlasRRTstar(), AtlasTRRT(), BiRRTstar(), BuildAtlasFromPoint(), cBiRRT(), ccRRT(), ccTRRT(), Chart2Manifold(), ClassifyPointInChart(), ComputeSplitDimInt(), ConnectSamples(), ConnectSamplesChart(), CSRemoveLCVars(), CSRemoveUnusedVars(), CSRemoveVarsWithCtRange(), CuikNewtonInBox(), CuikNewtonSimp(), DealWithCP(), DetermineChartNeighbours(), DistanceOnChart(), DummifyAndAddEquation(), ExtendAtlasFromPoint(), ExtendAtlasTowardPoint(), FindSingularPoint(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), GenerateJointRangeSingularityEquations(), GenerateJointSolution(), GenerateLinkRot(), GenerateLinkSolution(), GenerateTransEquationsFromBranch(), GenerateWorldEquations(), GenerateWorldSingularityEquations(), GeodesicDistance(), GetChartDegree(), GetJointTransSeq(), GetLinkPoseSimpVars(), GetLinkTransformsFromSolution(), GetLinkTransformsFromSolutionPoint(), GetSCpSystem(), GetSolutionPointFromLinkTransforms(), GetTransform2Link(), GradientSmooth(), IncrementalSampleCuikSystemInBox(), InitAtlasFromPoint(), InitAtlasRRT(), InitChartInt(), InitRRT(), InitWorldCD(), InitWorldFromMolecule(), InitWorldKinCS(), main(), MinimizeOnAtlas(), MoveWorld(), MPI_SolveCuikSystem(), NewChartFromPoint(), NewTemptativeSample(), Newton2ManifoldPlane(), PathInChart(), PlotChart(), PlotChartAsPolygon(), PlotRRT(), PlotSamples(), PointOnChart(), Polytope2SPolytope(), PopulateWithSamples(), PostProcessBox(), PrintAtlasStatistics(), PrintCuikSystemWithSimplification(), PrintWorldAxes(), RandomSmooth(), ReadOneSample(), ReadTwoSamples(), RecursiveReWireRRTstar(), ReduceBox(), ReduceBoxEquationWise(), RefineSingularPoint(), RegenerateJointBox(), RegenerateJointSolution(), RegenerateLinkBox(), RegenerateLinkSolution(), RegenerateMechanismBox(), RegenerateSolution(), RegenerateWorldOriginalPoint(), ReWireAtlasRRTstar(), ReWireRRTstar(), RRTstar(), SampleCuikSystemInBox(), SetRotVars(), ShortcutSmooth(), SimplifyCuikSystem(), SmoothSamples(), SolveCuikSystem(), SPolytope2Polytope(), Steps2PathinAtlasRRT(), Steps2PathinRRT(), TransitionTestRRT(), TriangulateAtlas(), UpdateCuikSystem(), WireAtlasRRTstar(), WireRRTstar(), WorldAtomJacobian(), WorldDOF2Sol(), and WorldSample2DOF().

unsigned int GetParameterID ( char *  name,
Tparameters p 
)

Determines the parameter identifier for a given parameter name.

Parameters
nameThe paremeter name.
pThe set of parameteres.
Returns
The paremeter identifier or NO_UINT if there is not a parameter with the given name.

Definition at line 110 of file parameters.c.

References FALSE, NO_UINT, and NPARAMETERS.

boolean ParameterSet ( unsigned int  n,
Tparameters p 
)

Determines is a parameter is already defined. The default initialization (the one from the default set of parameters) is not taken into account. Only explicit initializations from the users are considered.

Only parameters alrady defined can be used in the definition of other parameters.

Parameters
nThe identifier of the parameter.
pThe parameter set.
Returns
TRUE if the parameter is already defined.

Definition at line 131 of file parameters.c.

void SetParameter ( unsigned int  n,
char *  name,
double  v,
Tparameters p 
)

Sets the name and value for a particular parameter.

Parameters
nNumber of parameter.
nameThe name for the parameter. This is a string that is used when printing the parameter.
vThe value.
pSet of parameters.

Definition at line 139 of file parameters.c.

References ChangeParameter(), Error(), NPARAMETERS, and Warning().

void ChangeParameter ( unsigned int  n,
double  v,
Tparameters p 
)

Sets the value for a particular parameter.

Parameters
nNumber of parameter.
vThe new value for the parameter.
pSet of parameters.

Definition at line 164 of file parameters.c.

References Error(), and NPARAMETERS.

Referenced by DealWithCP(), IncrementalSampleCuikSystemInBox(), InitAtlasFromPoint(), main(), MinimizeOnAtlas(), SampleCuikSystemInBox(), and SetParameter().

void PrintParameters ( FILE *  f,
Tparameters p 
)

Writes a parameter set to a stream, that can be stdout.

In principle the output of this function can be used as a parameter file (i.e., it can be parsed correctly with InitParametersFromFile).

Parameters
fThe stream
pSet of parameters to print.

Definition at line 181 of file parameters.c.

References AMBIENT_SAMPLING, C_FCL, CT_CD_ENGINE, CT_CUT_X, CT_CUT_Y, CT_CUT_Z, CT_REPRESENTATION, CT_SAMPLING, CT_SPLIT_TYPE, Error(), FCL, INF, KDTREE_SAMPLING, NOCD, NPARAMETERS, PQP, REP_FLINKS, REP_JOINTS, REP_LINKS, REP_QLINKS, RIGIDCLL, SOLID, TANGENT_SAMPLING, and VCOLLIDE.

Referenced by main().

void DeleteParameters ( Tparameters p)

Deletes a set of parameters and frees the allocated memory.

Parameters
pSet of parameters to be deleted.

Definition at line 295 of file parameters.c.

Referenced by main().