-
Thomas Witkowski authoredThomas Witkowski authored
NormEps.h 865 B
#ifndef NORMEPS_H
#define NORMEPS_H
#include "FixVec.h"
#include "Global.h"
// #include "MemoryManager.h"
#include "Parameters.h"
using namespace AMDiS;
class NormEps
{
public:
MEMORY_MANAGED(NormEps);
/**
* Calculates regularized norm of WorldVector x.
*/
static double calcNormEps(const WorldVector<double> &x);
/**
* Calculates square of regularized norm of WorldVector x.
*/
static double calcNormEps2(const WorldVector<double> &x);
/**
* Set regularization epsilon eps.
*/
static inline void setEps() {
FUNCNAME("NormEps::setEps()");
eps = 0.0;
GET_PARAMETER(0, "NormEps->epsilon for norm regularization", "%f", &eps);
TEST_EXIT(eps > 1.e-15)
("illegal eps for norm regularization !\n");
};
protected:
/**
* Epsilon for regularization.
*/
static double eps;
};
#endif // NORMEPS_H