rsvs3D  0.0.0
Codes for the c++ implementation of the 3D RSVS
rsvs3d Namespace Reference

Namespace for general purpose tools of the RSVS project. More...

Classes

class  VelocityFunction
 
class  SnakeVelocityCalculator
 A base class which needs to be inherited from to implement a new velocity calculation. More...
 
class  rsvs_exception
 Exception for signaling rsvs errors. More...
 

Typedefs

typedef std::function< void(snake &)> simplevelocity
 

Functions

template<class E = rsvs_exception>
void error (const char *message="", const char *caller="", const char *file="", int line=0, bool throwError=true)
 Custom error function. More...
 
template<typename T >
int sign (T val)
 Returns the sign of a type comparable to 0. More...
 
int TimeStamp (const char *str, int start_s)
 
double SignedLogScale (double in)
 Returns a signed logscale useful for plotting data. More...
 
double Clock2ms (int clockCycles)
 

Detailed Description

Namespace for general purpose tools of the RSVS project.

Function Documentation

◆ error()

template<class E = rsvs_exception>
void rsvs3d::error ( const char *  message = "",
const char *  caller = "",
const char *  file = "",
int  line = 0,
bool  throwError = true 
)

Custom error function.

Displays the name of the caller function and throw an exception type object with the message specified. can be turned off by setting the last parameter to false.

Parameters
[in]messageError message
[in]callerCaller function
[in]fileThe file in which the caller is.
[in]lineThe line at which the caller is.
[in]throwErrorshould the error be thrown (True) or a warning (False)?
Template Parameters
EException type to throw

Convenience macros are also provided to use this function without typing all the file, line and caller function macro names:

Definition at line 203 of file warning.hpp.

◆ sign()

template<typename T >
int rsvs3d::sign ( val)

Returns the sign of a type comparable to 0.

Parameters
[in]valThe value in.
Template Parameters
TAny type comparable and with a 0 type.
Returns
-1 for negative, 0 for 0, 1 for positive.

Definition at line 215 of file warning.hpp.

◆ SignedLogScale()

double rsvs3d::SignedLogScale ( double  in)

Returns a signed logscale useful for plotting data.

This mathematical function is geared towards plotting of data with wildly varying orders of magnitude and has the following properties:

  • Order preserving
  • 0 preserving
  • logarithmic for R not including [-DBL_EPSILON, DBL_EPSILON]
  • 1/log10 in that range
Parameters
[in]inA double to scale.
Returns
Scaled value of the double.

Definition at line 40 of file warning.cpp.