statistics.c File Reference

Detailed Description

Implementation of the functions operating on Tstatistics.

See Also
Tstatistics, statistics.h.

Definition in file statistics.c.

Functions

void InitStatistics (unsigned int np, double v, Tstatistics *t)
 Constructor. More...
 
void CopyStatistics (Tstatistics *t_dst, Tstatistics *t_src)
 Copy constructor. More...
 
double GetTime (Tstatistics *t)
 Curent time. More...
 
double GetElapsedTime (Tstatistics *t)
 Elapsed time. More...
 
double GetInitialTime (Tstatistics *t)
 Initial time. More...
 
void SetInitialTime (double tm, Tstatistics *t)
 Sets a new initial time. More...
 
void NewMaxLevel (unsigned int m, Tstatistics *t)
 Sets a new maximum level. More...
 
void NewBoxProcessed (Tstatistics *t)
 Increases the number of processed boxes. More...
 
void NewSolutionBox (boolean validated, double vs, double d, Tstatistics *t)
 Increases the number of solution boxes. More...
 
void NewEmptyBox (Tstatistics *t)
 Increases the number of empty boxes. More...
 
void NewSplittedBox (Tstatistics *t)
 Increases the number of splitted boxes. More...
 
void NewRBError (Tstatistics *t)
 Increases the number of errors when reducing a boxe. More...
 
void NewLostBox (Tstatistics *t)
 Increases the number of lost boxes. More...
 
void NewBoxReduction (Tstatistics *t)
 Increases the number of reduced boxes. More...
 
unsigned int GetNBoxReductions (Tstatistics *t)
 Gets the number of reduced boxes. More...
 
unsigned int GetNSolutionBoxes (Tstatistics *t)
 Gets the number of solution boxes. More...
 
void ResetNBoxReductions (Tstatistics *t)
 Resets the number of reduced boxes. More...
 
void AddNBoxReductions (unsigned int nr, Tstatistics *t)
 Increases the number of reduced boxes. More...
 
void PrintStatistics (FILE *f, Tstatistics *t)
 Prints the statistics to a file. More...
 
void SaveStatistics (FILE *f, Tstatistics *t)
 Saves the statistics to a file in binary format. More...
 
void LoadStatistics (FILE *f, Tstatistics *t)
 Loads the statistics from a file in binary format. More...
 
void DeleteStatistics (Tstatistics *t)
 Destructor. More...
 

Function Documentation

void CopyStatistics ( Tstatistics t_dst,
Tstatistics t_src 
)
double GetTime ( Tstatistics t)

Returns the current time. The wayt to get the time is different for single-processor or for multiple-processor environments.

Parameters
tThe statistics.
Returns
The current time.

Definition at line 74 of file statistics.c.

References Tstatistics::np.

Referenced by GetElapsedTime(), InitStatistics(), and LoadCSState().

double GetElapsedTime ( Tstatistics t)

Returns the time since the statistics where initialized.

Parameters
tThe statistics to query.
Returns
The elapsed time.

Definition at line 92 of file statistics.c.

References GetTime(), and Tstatistics::t_init.

Referenced by AtlasAStar(), AtlasBiRRTstar(), AtlasGBF(), AtlasRRT(), AtlasRRTstar(), AtlasTRRT(), BiRRTstar(), cBiRRT(), ccRRT(), ccTRRT(), GradientSmooth(), main(), PostProcessBox(), PrintStatistics(), RandomSmooth(), RRTstar(), SaveCSState(), ShortcutSmooth(), and SmoothSamples().

double GetInitialTime ( Tstatistics t)

Returns the time at which the statistics where initialized.

Parameters
tThe statistics to query.
Returns
The initialization time.

Definition at line 100 of file statistics.c.

References Tstatistics::t_init.

void SetInitialTime ( double  tm,
Tstatistics t 
)

Sets a new initial time. This is used when re-starting a process after a crash.

Parameters
tmThe new initial time.
tThe statistics to query.

Definition at line 109 of file statistics.c.

References Tstatistics::t_init.

Referenced by LoadCSState().

void NewMaxLevel ( unsigned int  m,
Tstatistics t 
)

Sets a new max level. If the given level is below the stored one nothing is done.

Parameters
mThe new maximum level.
tThe statistics to udpate.

Definition at line 117 of file statistics.c.

References Tstatistics::n_max_level.

Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().

void NewBoxProcessed ( Tstatistics t)

Increases the number of processed boxes.

Parameters
tThe statistics to update.

Definition at line 126 of file statistics.c.

References Tstatistics::n_processed_boxes.

Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().

void NewSolutionBox ( boolean  validated,
double  v,
double  d,
Tstatistics t 
)

Increases the number of solution boxes.

Parameters
validatedTRUE if the solution is validated to include a solution point.
vVolume of the solution box.
dDiagonal of the solution box.
tThe statistics to update.

Definition at line 134 of file statistics.c.

References Tstatistics::n_solution_boxes, Tstatistics::n_validated_solution_boxes, Tstatistics::s_diagonal, and Tstatistics::s_volume.

Referenced by PostProcessBox().

void NewEmptyBox ( Tstatistics t)

Increases the number of empty boxes.

Parameters
tThe statistics to update.

Definition at line 147 of file statistics.c.

References Tstatistics::n_empty_boxes.

Referenced by PostProcessBox().

void NewSplittedBox ( Tstatistics t)

Increases the number of splitted boxes.

Parameters
tThe statistics to update.

Definition at line 156 of file statistics.c.

References Tstatistics::n_splitted_boxes.

Referenced by PostProcessBox().

void NewRBError ( Tstatistics t)

Increases the number of errors when reducing a boxe.

Parameters
tThe statistics to update.

Definition at line 165 of file statistics.c.

References Tstatistics::n_errors.

Referenced by PostProcessBox().

void NewLostBox ( Tstatistics t)

Increases the number of lost boxes.

Parameters
tThe statistics to update.

Definition at line 173 of file statistics.c.

References Tstatistics::n_lost_boxes.

Referenced by MPI_SolveCuikSystem().

void NewBoxReduction ( Tstatistics t)

Increases the number of reduced boxes.

Parameters
tThe statistics to update.

Definition at line 181 of file statistics.c.

References Tstatistics::n_box_reductions.

Referenced by ReduceBox().

unsigned int GetNBoxReductions ( Tstatistics t)

Gets the number of reduced boxes.

Parameters
tThe statistics to query.
Returns
The number of reduced boxes up to the moment.

Definition at line 186 of file statistics.c.

References Tstatistics::n_box_reductions.

Referenced by MPI_TreatBox().

unsigned int GetNSolutionBoxes ( Tstatistics t)

Gets the number of solution boxes.

Parameters
tThe statistics to query.
Returns
The number of solution boxes up to the moment.

Definition at line 191 of file statistics.c.

References Tstatistics::n_solution_boxes.

Referenced by MPI_SolveCuikSystem(), PostProcessBox(), and SolveCuikSystem().

void ResetNBoxReductions ( Tstatistics t)

Resets the number of reduced boxes.

Parameters
tThe statistics to update.

Definition at line 196 of file statistics.c.

References Tstatistics::n_box_reductions.

Referenced by MPI_TreatBox().

void AddNBoxReductions ( unsigned int  nr,
Tstatistics t 
)

Increases the number of reduced boxes.

Parameters
nrNumber of reduced boxes to add to the current statistis.
tThe statistics to update.

Definition at line 201 of file statistics.c.

References Tstatistics::n_box_reductions.

Referenced by MPI_SolveCuikSystem().

void PrintStatistics ( FILE *  f,
Tstatistics t 
)

Write the statistics sets to a stream that can be stdout. The moment at which the statistics are written is taken as the moment at which the solving process is done.

Parameters
fThe stream
tThe statistics to print.

Definition at line 209 of file statistics.c.

References GetElapsedTime(), Tstatistics::n_box_reductions, Tstatistics::n_empty_boxes, Tstatistics::n_errors, Tstatistics::n_lost_boxes, Tstatistics::n_max_level, Tstatistics::n_processed_boxes, Tstatistics::n_solution_boxes, Tstatistics::n_splitted_boxes, Tstatistics::n_validated_solution_boxes, Tstatistics::np, Tstatistics::s_diagonal, Tstatistics::s_volume, and Tstatistics::volume.

Referenced by MPI_SolveCuikSystem(), and SolveCuikSystem().

void SaveStatistics ( FILE *  f,
Tstatistics t 
)

Saves the statistics to a file in binary format. Used to save the internal state of the solver.

Parameters
fThe file
tThe statistics to print.

Definition at line 260 of file statistics.c.

Referenced by SaveCSState().

void LoadStatistics ( FILE *  f,
Tstatistics t 
)

Loads the statistics from a file in binary format. Used to retrive the internal state of the solver from a .state file.

Parameters
fThe file
tThe statistics to print.

Definition at line 266 of file statistics.c.

Referenced by LoadCSState().

void DeleteStatistics ( Tstatistics t)

Deletes the statistics structure and frees the allocated memory.

Parameters
tThe statistics to delete.

Definition at line 274 of file statistics.c.

Referenced by AtlasAStar(), AtlasBiRRTstar(), AtlasGBF(), AtlasRRT(), AtlasRRTstar(), AtlasTRRT(), BiRRTstar(), cBiRRT(), ccRRT(), ccTRRT(), DeleteCuikSystem(), main(), MPI_SolveCuikSystem(), RRTstar(), and SmoothSamples().