12#ifndef REDISTANCING_SUSSMAN_HELPFUNCTIONS_HPP
13#define REDISTANCING_SUSSMAN_HELPFUNCTIONS_HPP
26 return (T(0) < val) - (val < T(0));
49 return (val / sqrt(val * val + epsilon * epsilon));
66 return (val1 <= val2 + tolerance && val1 >= val2 - tolerance);
78 std::ofstream out(textfile, std::ios_base::app);
92 std::ostringstream out;
94 out << std::fixed << myValue;
T smooth_S(T val, T epsilon)
Gets the smoothed sign of a variable.
int sgn(T val)
Gets the sign of a variable.
std::string to_string_with_precision(const T myValue, const size_t n=6)
Converts value into string maintaining a desired precision.
void append_value_to_textfile(std::string &textfile, T value)
Appends the value of a given variable of any type to a textfile as string.
bool isApproxEqual(T val1, T val2, T tolerance)
Checks, if two values are sufficiently close to each other within a given tolerance range,...