util.h File Reference

Introduction

Interfaces of the different auxiliary functions used in the ortonormalization and in the test.

Definition in file util.h.

Macros

#define MeanDstE   0
 Mean distance error. More...
 
#define MaxDstE   1
 Max distance error. More...
 
#define MinDstE   2
 Min distance error. More...
 
#define MeanOrtoE   3
 Mean orthonormality error. More...
 
#define MaxOrtoE   4
 Max orthonormality error. More...
 
#define MinOrtoE   5
 Min orthonormality error. More...
 
#define AverageT   6
 Average execution time. More...
 

Typedefs

typedef Array< real, Dynamic, 1 > noise
 Array with the different noise levels. More...
 

Functions

void RandomQuaternion (Vector4 &e)
 Generates a random quaternion. More...
 
void Quat2Mat (Matrix3 &R, Vector4 &e)
 Quaternion to rotation matrix. More...
 
void RandomMatrix (Matrix3 &M, real noiseLevel, bool gaussian, default_random_engine &e)
 Generates a random matrix. More...
 
void TestMethod (ONMethod *method, unsigned int nRep, Matrix3 *N, double *res)
 Test a particular orthonomalization matrix. More...
 
void PrintResults (unsigned int nMethods, string *methodLabel, unsigned int nResults, string *resultLabel, unsigned int noiseTicks, noise &noiseLevel, double ***results)
 Prints the results of the evaluation. More...
 
void SaveResults (unsigned int nMethods, string *methodLabel, unsigned int nResults, string *resultLabel, bool gaussian, unsigned int noiseTicks, noise &noiseLevel, double ***results)
 Saves the results of the evaluation. More...
 

Macro Definition Documentation

◆ MeanDstE

#define MeanDstE   0

Mean distance error goes to the first column of the result table.

Definition at line 22 of file util.h.

◆ MaxDstE

#define MaxDstE   1

Max distance error goes to the second column of the result table.

Definition at line 29 of file util.h.

◆ MinDstE

#define MinDstE   2

Min distance error goes to the third column of the result table.

Definition at line 36 of file util.h.

◆ MeanOrtoE

#define MeanOrtoE   3

Mean distance error goes to the fouth column of the result table.

Definition at line 43 of file util.h.

◆ MaxOrtoE

#define MaxOrtoE   4

Max distance error goes to the fith column of the result table.

Definition at line 50 of file util.h.

◆ MinOrtoE

#define MinOrtoE   5

Min distance error goes to teh sixth column of the result table.

Definition at line 57 of file util.h.

◆ AverageT

#define AverageT   6

Average execution time goes to the seventh column of the result table.

Definition at line 64 of file util.h.

Typedef Documentation

◆ noise

typedef Array<real,Dynamic,1> noise

Array with the different noise levels.

Definition at line 70 of file util.h.

Function Documentation

◆ RandomQuaternion()

void RandomQuaternion ( Vector4 e)

This function returns points with a uniform distribution on the surface of a 4-sphere following the algorithm described in:

  • Marsaglia, G. "Choosing a Point from the Surface of a Sphere." Ann. Math. Stat. 43, 645-646, 1972.
Parameters
eThe generated quaternion.

Definition at line 19 of file util.cpp.

Referenced by main().

◆ Quat2Mat()

void Quat2Mat ( Matrix3 R,
Vector4 e 
)

This function returns the rotation matrix corresponding to a set of Euler parameters.

Parameters
RThe output rotation matrix.
eThe quaternion.

Definition at line 41 of file util.cpp.

References real.

Referenced by ApproxMethod(), CayleyMethod(), and main().

◆ RandomMatrix()

void RandomMatrix ( Matrix3 M,
real  noiseLevel,
bool  gaussian,
default_random_engine &  e 
)

This function returns a 3x3 matrix whose entries are random numbers uniformly distributed in the interval [-errorbound, errorbound].

Parameters
MThe output noise matrix.
noiseLevelThe width of the noise.
gaussiantrue to use Gaussian distribution.
eThe random engine.

Definition at line 78 of file util.cpp.

Referenced by main().

◆ TestMethod()

void TestMethod ( ONMethod method,
unsigned int  nRep,
Matrix3 N,
double *  res 
)

Test a particular orthonomalization matrix method evaluating its efficiency and its accuracy.

Parameters
methodThe method to evaluate.
nRepThe number of randomly generated matrix to use in the evaluation.
NThe (nRep) noisy matrices.
resThe table of results (
See also
MeanDstE, MaxDstE, MinDstE, MeanOrtoE, MaxOrtoE MinOrtoE, AverageT).

Definition at line 102 of file util.cpp.

References AverageT, MaxDstE, MaxOrtoE, MeanDstE, MeanOrtoE, MinDstE, and MinOrtoE.

Referenced by main().

◆ PrintResults()

void PrintResults ( unsigned int  nMethods,
string *  methodLabel,
unsigned int  nResults,
string *  resultLabel,
unsigned int  noiseTicks,
noise noiseLevel,
double ***  results 
)

Prints the statistics collected when evaluating the methods.

Parameters
nMethodsThe number of methods tested.
methodLabelA label identifying each method.
nResultsNumber of statistics collected for each method.
resultLabelA label identifying each statistic.
noiseTicksThe number of ticks in the noise scale.
noiseLevelThe level of noise for each tick.
resultsThe table with all the results. This includes the statistics for each method and noise tick.

Definition at line 145 of file util.cpp.

Referenced by main().

◆ SaveResults()

void SaveResults ( unsigned int  nMethods,
string *  methodLabel,
unsigned int  nResults,
string *  resultLabel,
bool  gaussian,
unsigned int  noiseTicks,
noise noiseLevel,
double ***  results 
)

Saves the statistics collected when evaluating the methods to a file. The name of the file is generated using the methodLabel parameter (one separate file is generated for each method).

The files are stored in the 'results' folder with extension csv.

Parameters
nMethodsThe number of methods tested.
methodLabelA label identifying each method.
nResultsNumber of statistics collected for each method.
resultLabelA label identifying each statistic.
gaussiantrue if we used Gaussian distributions for the noise.
noiseTicksThe number of ticks in the noise scale.
noiseLevelThe level of noise for each tick.
resultsThe table with all the results. This includes the statistics for each method and noise tick.

Definition at line 186 of file util.cpp.

References AverageT.

Referenced by main().