CARLsim  6.1.0
CARLsim: a GPU-accelerated SNN simulator
Util.h File Reference
#include <string>
Include dependency graph for Util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool equals (float x, float y, float epsilon=0.000001)
 
bool equals (double x, double y, double epsilon=0.000001)
 
double stringToDouble (const string &str)
 
float stringToFloat (const string &str)
 

Function Documentation

◆ equals() [1/2]

bool equals ( const float  x,
const float  y,
float  epsilon 
)

Consder to floats equal if they are within epsilon of each other.

Definition at line 42 of file Util.cpp.

◆ equals() [2/2]

bool equals ( const double  x,
const double  y,
double  epsilon 
)

Consder to floats equal if they are within epsilon of each other.

Definition at line 47 of file Util.cpp.

◆ stringToDouble()

double stringToDouble ( const string &  str)

Take a string representing a decimal point number and convert it to a double.

Throws std::invalid_argument if the string does not hold a decimal point number.

Definition at line 30 of file Util.cpp.

Here is the caller graph for this function:

◆ stringToFloat()

float stringToFloat ( const string &  str)

Take a string representing a decimal point number and convert it to a float.

Throws std::invalid_argument if the string does not hold a decimal point number.

Definition at line 14 of file Util.cpp.