NeoPZ
Classes | Macros | Enumerations | Functions | Variables
pzreal.h File Reference

Contains the declaration of TPZFlopCounter class and TPZCounter struct. More...

#include <pz_config.h>
#include <limits>
#include <cmath>
#include <iostream>
#include <complex>
#include "fpo_exceptions.h"
Include dependency graph for pzreal.h:

Go to the source code of this file.

Classes

struct  is_complex_or_floating_point< T >
 
struct  is_complex_or_floating_point< std::complex< T > >
 
struct  is_arithmetic_pz< T >
 
struct  TPZCounter
 Implements a counter by operations. Common. More...
 
class  TPZFlopCounter
 This class implements floating point number associated with a counter of the operations performed with it by type.
(arithmetic, trigonometric, exponencial and logarithmic operations performed with it). Common. More...
 

Macros

#define _USE_MATH_DEFINES
 
#define MAX(a, b)
 Gets maxime value between a and b. More...
 
#define MIN(a, b)
 Gets minime value between a and b. More...
 

Enumerations

enum  MOptype {
  ESum, EProd, EDiv, ESqrt,
  EPow, ECos, ESin, EAcos,
  EAsin, EAtan, EExp, ELog
}
 Types of operations to be counted. More...
 

Functions

template<typename Enumeration >
std::underlying_type< Enumeration >::type as_integer (const Enumeration value)
 
std::ostream & operator<< (std::ostream &out, const TPZCounter &count)
 Re-implements << operator to show the counter (count) data. More...
 
float fabs (std::complex< float > __x)
 This is the type of floating point number PZ will use. More...
 
double fabs (std::complex< double > __x)
 
long double fabs (std::complex< long double > __x)
 
TPZFlopCounter sqrt (const TPZFlopCounter &orig)
 Returns the square root of the value and increments the counter of the square root. More...
 
TPZFlopCounter fabsFlop (const TPZFlopCounter &orig)
 Returns the absolute value and doesn't increments the counters. More...
 
REAL fabs (const TPZFlopCounter &orig)
 Returns the absolute value as REAL and doesn't increments the counters. More...
 
TPZFlopCounter pow (const TPZFlopCounter &orig, const TPZFlopCounter &xp)
 Returns the power and increments the counter of the power. More...
 
TPZFlopCounter acos (const TPZFlopCounter &orig)
 Returns the arc cosine in radians and increments the counter of the Arc Cosine. More...
 
TPZFlopCounter asin (const TPZFlopCounter &orig)
 Returns the arc sine in radians and increments the counter of the Arc Sine. More...
 
TPZFlopCounter cos (const TPZFlopCounter &orig)
 Returns the cosine in radians and increments the counter of the Cosine. More...
 
TPZFlopCounter sin (const TPZFlopCounter &orig)
 Returns the sine in radians and increments the counter of the sine. More...
 
TPZFlopCounter atan (const TPZFlopCounter &orig)
 Returns the arc tangent in radians and increments the counter of the Arc Tangent. More...
 
TPZFlopCounter atan2 (const TPZFlopCounter &val1, const TPZFlopCounter &val2)
 Returns the arc tangent in radians and increments the counter of the Arc Tangent.
ATAN2 returns the arc tangent of x(val1) and y(val2) coordinates as an angle expressed in radians. More...
 
TPZFlopCounter exp (const TPZFlopCounter &orig)
 Returns the exponencial and increments the counter of the Exponencial. More...
 
TPZFlopCounter log (const TPZFlopCounter &orig)
 Returns the natural logarithm and increment the counter of the logarithm. More...
 
TPZFlopCounter log10 (const TPZFlopCounter &orig)
 Returns the decimal logarithm and increment the counter of the logarithm. More...
 
TPZFlopCounter operator* (double val1, const TPZFlopCounter &val2)
 Performs $ val1 * val2$. Doesn't increments counters. More...
 
TPZFlopCounter operator/ (double val1, const TPZFlopCounter &val2)
 Performs $ val1 / val2$. Doesn't increments counters. More...
 
TPZFlopCounter operator+ (double val1, const TPZFlopCounter &val2)
 Performs $ val1 + val2$. Doesn't increments counters. More...
 
TPZFlopCounter operator+ (const TPZFlopCounter &val2, double val1)
 Performs $ val1 + val2$. Doesn't increments counters. More...
 
TPZFlopCounter operator- (double val1, const TPZFlopCounter &val2)
 Performs $ val1 - val2$. Doesn't increments counters. More...
 
std::ostream & operator<< (std::ostream &out, const TPZFlopCounter &val)
 Implements to write (output) only the floating point value. More...
 
std::istream & operator>> (std::istream &out, TPZFlopCounter &val)
 Implements to read (input) only the floating point value. More...
 
REAL ZeroTolerance ()
 Returns the tolerance to Zero value. Actually: $ 1e-10 $. More...
 
template<typename T , typename std::enable_if< is_arithmetic_pz< T >::value, int >::type * = nullptr>
void ZeroTolerance (T &tol)
 
bool IsZero (long double a)
 Returns if the value a is close Zero as the allowable tolerance. More...
 
bool IsZero (double a)
 
bool IsZero (float a)
 
bool IsZero (std::complex< long double > a)
 
bool IsZero (std::complex< double > a)
 
bool IsZero (std::complex< float > a)
 
bool IsZero (int a)
 
bool IsZero (int64_t a)
 
template<class T >
const T & Max (const T &a, const T &b)
 Returns the maximum value between a and b. More...
 
template<class T >
const T & Min (const T &a, const T &b)
 Returns the minimum value between a and b. More...
 
REAL erf (REAL arg)
 

Variables

int gPrintLevel
 Extern variable to control level of printting (priority print?) More...
 
const int gNumOp
 Number of type of the operations actually counted. More...
 

Detailed Description

Contains the declaration of TPZFlopCounter class and TPZCounter struct.

Definition in file pzreal.h.

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Definition at line 24 of file pzreal.h.

◆ MAX

#define MAX (   a,
 
)

◆ MIN

#define MIN (   a,
 
)

Function Documentation

◆ as_integer()

template<typename Enumeration >
std::underlying_type<Enumeration>::type as_integer ( const Enumeration  value)

◆ erf()

REAL erf ( REAL  arg)

Function erf (Error function) implemented in http://www.johndcook.com/cpp_erf.html

Definition at line 60 of file pzreal.cpp.

References exp, and fabs.

Referenced by TPZNormalRandom< TVar >::cdf(), and Min().