NeoPZ
pzreal.h
Go to the documentation of this file.
1 
5 /******************************************************************************
6  *
7  * Data definition: REAL
8  *
9  * Purpose: Define what type of data the package is being compiled
10  * for. The choices are the following:
11  *
12  * double real, double precision
13  * float real, single precision
14  *
15  *****************************************************************************/
16 
17 #ifndef REALH
18 #define REALH
19 
20 #include <pz_config.h>
21 #include <limits>
22 
23 #ifndef _USE_MATH_DEFINES
24 #define _USE_MATH_DEFINES
25 #include <cmath>
26 #endif // _USE_MATH_DEFINES
27 
28 #include <iostream>
29 #include <complex>
30 #include "fpo_exceptions.h"
31 
32 #ifdef _AUTODIFF
33 template <int Num, class T> class TFad;
34 #endif
35 
36 template <typename Enumeration>
37 typename std::underlying_type<Enumeration>::type as_integer(const Enumeration value) {
38  return static_cast<typename std::underlying_type<Enumeration>::type>(value);
39 }
40 
41 
42 /*structs used for help identifying fundamental types in template parameters.
43  For instance,
44 
45  template <class T,
46  typename std::enable_if<(is_arithmetic_pz::value), int>::type* = nullptr>
47  void Write(const TPZVec<T> &vec){
48  //stuff here
49  }
50 
51  This template would only match with T as char, int, long, float, double,
52  * std::complex<float> etc... (Not composite types).*/
53 
57 template<class T>
58 struct is_complex_or_floating_point : std::is_floating_point<T> { };
59 
60 
65 template<class T>
66 struct is_complex_or_floating_point<std::complex<T>> : std::integral_constant<bool,
67  std::is_integral<T>::value ||
68  std::is_floating_point<T>::value> { };
69 
74 template<class T>
75 struct is_arithmetic_pz : std::integral_constant<bool,
76  std::is_integral<T>::value ||
77  is_complex_or_floating_point<T>::value> { };
78 
80 #ifndef MAX
81 #define MAX( a, b ) ( (a) > (b) ? (a) : (b) )
82 #endif
83 
84 #ifndef MIN
85 #define MIN( a, b ) ( (a) < (b) ? (a) : (b) )
86 #endif
87 
88 #ifdef WIN32
89 #define __PRETTY_FUNCTION__ __FILE__
90 #endif
91 
92 
98 extern int gPrintLevel;
99 
106 
108 const int gNumOp = 12;
109 
111 struct TPZCounter {
114  uint64_t fCount[gNumOp];
115 
118  {
119  clear();
120  }
121 
122  inline TPZCounter operator-(const TPZCounter &other)
123  {
124  TPZCounter result;
125  for(int i=0; i<gNumOp; i++) result.fCount[i] = fCount[i]-other.fCount[i];
126  return result;
127  }
128 
129  inline TPZCounter& operator+=(const TPZCounter &other)
130  {
131  for(int i=0; i<gNumOp; i++) fCount[i] += other.fCount[i];
132  return *this;
133  }
134 
135  inline TPZCounter& operator-=(const TPZCounter &other)
136  {
137  for(int i=0; i<gNumOp; i++) fCount[i] -= other.fCount[i];
138  return *this;
139  }
140 
141  inline TPZCounter& copy(const TPZCounter &other)
142  {
143  for (int i=0; i<gNumOp; i++) fCount[i] = other.fCount[i];
144  return *this;
145  }
146 
147  inline TPZCounter& clear()
148  {
149  for(int i=0; i<gNumOp; i++) fCount[i] = 0 ;
150  return *this;
151  }
152 
153  void Print(std::ostream &out = std::cout) const;
154 
155 };
156 
158 std::ostream &operator<<(std::ostream &out,const TPZCounter &count);
159 
160 class TPZFlopCounter;
161 
163 #ifdef REALfloat
164 typedef float REAL;
165 #endif // REALfloat
166 #ifdef REALdouble
167 typedef double REAL; //This is the default configuration
168 #endif // REALdouble
169 #ifdef REALlongdouble
170 typedef long double REAL;
171 #endif // REALlongdouble
172 #ifdef REALpzfpcounter
173 typedef TPZFlopCounter REAL;
174 #endif // REALpzfpcounter
175 
177 #ifdef STATEfloat
178 typedef float STATE;
179 #endif // STATEfloat
180 #ifdef STATEdouble
181 typedef double STATE; //This is the default configuration
182 #endif // STATEdouble
183 #ifdef STATElongdouble
184 typedef long double STATE;
185 #endif // STATElongdouble
186 #ifdef STATEcomplexf
187 typedef std::complex<float> STATE;
188 #endif // STATEcomplexf
189 #ifdef STATEcomplexd
190 typedef std::complex<double> STATE;
191 #endif //STATEcomplexd
192 #ifdef STATEcomplexld
193 typedef std::complex<long double> STATE;
194 #endif //STATEcomplexld
195 
196 #ifdef VC
197 #include <io.h>
198 #ifndef NOMINMAX
199 #define NOMINMAX // Preventing the redefinition of min and max as macros
200 #endif // NOMINMAX
201 #include <Windows.h>
202 // sqrt function adapted to int numbers. required for VC
203 inline double
204 sqrt(int __x)
205 {
206  return sqrt ((double)__x);
207 }
208 // fabs function adapted to int numbers. required for VC
209 inline int
210 fabs(int __x)
211 {
212  return (int)fabs((double) __x);
213 }
214 inline double
215 sin(int __x)
216 {
217  return sin((double) __x);
218 }
219 inline double
220 cos(int __x)
221 {
222  return cos((double) __x);
223 }
224 inline double
225 atan(int __x)
226 {
227  return atan((double) __x);
228 }
229 #endif //VC
230 
231 // fabs function adapted to complex numbers.
232 inline float
233 fabs(std::complex <float> __x)
234 {
235  std::complex <float> ret = abs(__x);
236  return std::abs(ret.real());
237 }
238 inline double
239 fabs(std::complex <double> __x)
240 {
241  std::complex <double> ret = abs(__x);
242  return std::abs(ret.real());
243 }
244 inline long double
245 fabs(std::complex <long double> __x)
246 {
247  std::complex <long double> ret = abs(__x);
248  return std::abs(ret.real());
249 }
250 
251 
262 public:
264 #ifdef REALpzfpcounter
265  double fVal;
266 #else
267  REAL fVal;
268 #endif //REALpzfpcounter
269 
271 
272  inline TPZFlopCounter()
273  {
274  }
275  inline TPZFlopCounter(const double &val)
276  {
277  fVal = (REAL)val;
278  }
279 
280  inline REAL val() const
281  {
282  return fVal;
283  }
284 
285  operator REAL() const{
286  return fVal;
287  }
288 
289  bool operator<=(const REAL &val) const
290  {
291  return fVal <= val;
292  }
293 
294  bool operator<(const REAL &val) const
295  {
296  return fVal < val;
297  }
298  bool operator>(const REAL &val) const
299  {
300  return fVal > val;
301  }
302  bool operator>=(const REAL &val) const
303  {
304  return fVal >= val;
305  }
306  bool operator==(const REAL &val) const
307  {
308  return fVal == val;
309  }
311  inline TPZFlopCounter operator*(const TPZFlopCounter &oth) const
312  {
313  TPZFlopCounter result;
314  result.fVal = fVal*oth.fVal;
315  gCount.fCount[EProd]++;
316  return result;
317  }
319  inline TPZFlopCounter operator/(const TPZFlopCounter &oth) const
320  {
321  TPZFlopCounter result;
322  result.fVal = fVal/oth.fVal;
323  gCount.fCount[EDiv]++;
324  return result;
325  }
326 
328  inline TPZFlopCounter operator*(const REAL &oth) const
329  {
330  TPZFlopCounter result;
331  result.fVal = fVal*oth;
332  gCount.fCount[EProd]++;
333  return result;
334  }
336  inline TPZFlopCounter operator/(const double &oth) const
337  {
338  TPZFlopCounter result;
339  result.fVal = fVal/((REAL)oth);
340  gCount.fCount[EDiv]++;
341  return result;
342  }
343 
345  inline TPZFlopCounter operator+(const TPZFlopCounter &oth) const
346  {
347  TPZFlopCounter result;
348  result.fVal = fVal+oth.fVal;
349  gCount.fCount[ESum]++;
350  return result;
351  }
352 
354  inline TPZFlopCounter operator-(const TPZFlopCounter &oth) const
355  {
356  TPZFlopCounter result;
357  result.fVal = fVal-oth.fVal;
358  gCount.fCount[ESum]++;
359  return result;
360  }
363  {
364  fVal += oth.fVal;
365  gCount.fCount[ESum]++;
366  return *this;
367  }
370  {
371  fVal -= oth.fVal;
372  gCount.fCount[ESum]++;
373  return *this;
374  }
377  {
378  fVal *= oth.fVal;
379  gCount.fCount[EProd]++;
380  return *this;
381  }
384  {
385  fVal /= oth.fVal;
386  gCount.fCount[EDiv]++;
387  return *this;
388  }
390  inline TPZFlopCounter operator-() const
391  {
392  TPZFlopCounter result;
393  result.fVal = -fVal;
394  gCount.fCount[ESum]++;
395  return result;
396  }
398  inline TPZFlopCounter operator+() const
399  {
400  return *this;
401  }
403  inline bool operator<(const TPZFlopCounter &sec) const
404  {
405  return (fVal < sec.fVal);
406  }
408  inline bool operator>(const TPZFlopCounter &sec) const
409  {
410  return (fVal > sec.fVal);
411  }
413  inline bool operator<=(const TPZFlopCounter &sec) const
414  {
415  return (fVal <= sec.fVal);
416  }
418  inline bool operator>=(const TPZFlopCounter &sec) const
419  {
420  return (fVal >= sec.fVal);
421  }
423  inline bool operator==(const TPZFlopCounter &sec) const
424  {
425  return (fVal == sec.fVal);
426  }
428  inline bool operator!=(const TPZFlopCounter &sec) const
429  {
430  return (fVal != sec.fVal);
431  }
432 
434  friend TPZFlopCounter sqrt(const TPZFlopCounter &orig);
436  friend TPZFlopCounter pow(const TPZFlopCounter &orig,const TPZFlopCounter &xp);
438  friend TPZFlopCounter fabsFlop(const TPZFlopCounter &orig);
440  friend REAL fabs(const TPZFlopCounter &orig);
442  friend TPZFlopCounter acos(const TPZFlopCounter &orig);
444  friend TPZFlopCounter cos(const TPZFlopCounter &orig);
446  friend TPZFlopCounter asin(const TPZFlopCounter &orig);
448  friend TPZFlopCounter sin(const TPZFlopCounter &orig);
450  friend TPZFlopCounter atan(const TPZFlopCounter &orig);
455  friend TPZFlopCounter atan2(const TPZFlopCounter &val1,const TPZFlopCounter &val2);
457  friend TPZFlopCounter exp(const TPZFlopCounter &val);
459  friend TPZFlopCounter log(const TPZFlopCounter &val);
461  friend TPZFlopCounter log10(const TPZFlopCounter &val);
462 };
463 
465 inline TPZFlopCounter sqrt(const TPZFlopCounter &orig)
466 {
467  TPZFlopCounter result;
468  result.fVal = ::sqrt(orig.fVal);
470  return result;
471 }
472 
475 {
476  TPZFlopCounter result;
477  result.fVal = std::abs(orig.fVal);
478  return result;
479 }
481 inline REAL fabs(const TPZFlopCounter &orig)
482 {
483  return std::abs(orig.fVal);
484 }
485 
487 inline TPZFlopCounter pow(const TPZFlopCounter &orig,const TPZFlopCounter &xp)
488 {
489  TPZFlopCounter result;
490  result.fVal = ::pow(orig.fVal,xp.fVal);
492  return result;
493 }
494 
496 inline TPZFlopCounter acos(const TPZFlopCounter &orig)
497 {
498  TPZFlopCounter result;
499  result.fVal = ::acos(orig.fVal);
501  return result;
502 }
503 
505 inline TPZFlopCounter asin(const TPZFlopCounter &orig)
506 {
507  TPZFlopCounter result;
508  result.fVal = ::asin(orig.fVal);
510  return result;
511 }
512 
514 inline TPZFlopCounter cos(const TPZFlopCounter &orig)
515 {
516  TPZFlopCounter result;
517  result.fVal = ::cos(orig.fVal);
519  return result;
520 }
521 
523 inline TPZFlopCounter sin(const TPZFlopCounter &orig)
524 {
525  TPZFlopCounter result;
526  result.fVal = ::sin(orig.fVal);
528  return result;
529 }
530 
532 inline TPZFlopCounter atan(const TPZFlopCounter &orig)
533 {
534  TPZFlopCounter result;
535  result.fVal = ::atan(orig.fVal);
537  return result;
538 }
539 
544 inline TPZFlopCounter atan2(const TPZFlopCounter &val1,const TPZFlopCounter &val2)
545 {
546  TPZFlopCounter result;
547  result.fVal = ::atan2(val1.fVal,val2.fVal);
549  return result;
550 }
551 
553 inline TPZFlopCounter exp(const TPZFlopCounter &orig)
554 {
555  TPZFlopCounter result;
556  result.fVal = ::exp(orig.fVal);
558  return result;
559 }
560 
562 inline TPZFlopCounter log(const TPZFlopCounter &orig)
563 {
564  TPZFlopCounter result;
565  result.fVal = ::log(orig.fVal);
567  return result;
568 }
569 
572 {
573  TPZFlopCounter result;
574  result.fVal = ::log10(orig.fVal);
576  return result;
577 }
579 inline TPZFlopCounter operator*(double val1, const TPZFlopCounter &val2)
580 {
581  TPZFlopCounter result;
582  result = TPZFlopCounter(val1)*val2;
583  return result;
584 
585 }
587 inline TPZFlopCounter operator/(double val1, const TPZFlopCounter &val2)
588 {
589  TPZFlopCounter result;
590  result = TPZFlopCounter(val1)/val2;
591  return result;
592 
593 }
595 inline TPZFlopCounter operator+(double val1, const TPZFlopCounter &val2)
596 {
597  TPZFlopCounter result;
598  result = TPZFlopCounter(val1)+val2;
599  return result;
600 
601 }
603 inline TPZFlopCounter operator+(const TPZFlopCounter &val2, double val1 )
604 {
605  TPZFlopCounter result;
606  result = TPZFlopCounter(val1)+val2;
607  return result;
608 
609 }
611 inline TPZFlopCounter operator-(double val1, const TPZFlopCounter &val2)
612 {
613  TPZFlopCounter result;
614  result = TPZFlopCounter(val1)-val2;
615  return result;
616 
617 }
618 
620 inline std::ostream &operator<<(std::ostream &out, const TPZFlopCounter &val)
621 {
622  return out << val.fVal;
623 }
625 inline std::istream &operator>>(std::istream &out, /*const*/ TPZFlopCounter &val)
626 {
627  return out >> val.fVal;
628 }
629 
630 
631 
633 inline REAL ZeroTolerance() {
634  typedef std::numeric_limits< REAL > dbl;
635  return (REAL)pow(10,(-1 * (dbl::max_digits10- 5)));
636 }
637 
638 template<typename T,
639  typename std::enable_if< is_arithmetic_pz<T>::value, int>::type* = nullptr>
640 inline void ZeroTolerance(T &tol) {
641  typedef std::numeric_limits< T > dbl;
642  tol = (T)pow(10,(-1 * (dbl::max_digits10- 5)));
643 }
644 
645 template<typename T,
646  typename std::enable_if<std::is_same<T,TPZFlopCounter>::value>::type* = nullptr>
647 inline void ZeroTolerance(T &tol) {
648  typedef std::numeric_limits< REAL > dbl;
649  tol = (T)pow(10,(-1 * (dbl::max_digits10- 5)));
650 }
651 
652 #ifdef _AUTODIFF
653 template<int Num, typename T>
654 inline void ZeroTolerance(TFad<Num,T> &Tol) {
655  ZeroTolerance(Tol.val());
656 }
657 #endif
658 
659 #ifdef _AUTODIFF
660 
661 template<class T>
662 inline bool IsZero( T a ) {
663  return ( std::abs( a.val() ) < ZeroTolerance() );
664 }
665 #endif
666 
667 //template<>
668 inline bool IsZero( long double a ) {
669 #ifdef WIN32
670  return ( fabs( a ) < 1.e-12 );
671 #else
672  return ( std::fabs( a ) < 1.e-16 );
673 #endif
674 }
675 //template<>
676 inline bool IsZero( double a ) {
677 #ifdef WIN32
678  return ( fabs( a ) < 1.e-10 );
679 #else
680  return ( fabs( a ) < 1.e-12 );
681 #endif
682 }
683 //template<>
684 inline bool IsZero( float a ) {
685 #ifdef WIN32
686  return ( fabs( a ) < 1.e-6 );
687 #else
688  return ( fabs( a ) < 1.e-6 );
689 #endif
690 }
691 //template<>
692 inline bool IsZero( std::complex<long double> a ) {
693 #ifdef WIN32
694  return ( fabs( a ) < 1.e-12 );
695 #else
696  return ( fabs( a ) < 1.e-16 );
697 #endif
698 }
699 //template<>
700 inline bool IsZero( std::complex<double> a ) {
701 #ifdef WIN32
702  return ( fabs( a ) < 1.e-9 );
703 #else
704  return ( fabs( a ) < 1.e-12 );
705 #endif
706 }
707 //template<>
708 inline bool IsZero( std::complex<float> a ) {
709 #ifdef WIN32
710  return ( fabs( a ) < 1.e-5 );
711 #else
712  return ( fabs( a ) < 1.e-7 );
713 #endif
714 }
715 //template<>
716 inline bool IsZero( int a ) {
717  return ( a==0 );
718 }
719 inline bool IsZero( int64_t a ) {
720  return ( a==0L );
721 }
723 template <class T>
724 inline const T& Max( const T &a, const T &b ) {
725  return a > b ? a : b;
726 }
728 template <class T>
729 inline const T& Min( const T & a, const T &b ) {
730  return a < b ? a : b;
731 }
732 
736 // In the math library (cmath.h) don't exist some overloading for some functions
737 
738 // SPECIAL FUNCTIONS NON STANDARD IN WINDOWS SYSTEM
739 #if (!defined(__cplusplus) || __cplusplus < 201103L) && (!defined(_MSC_VER) || _MSC_VER < 1900)// If we aren't using C++11.
740 
744 REAL erf(REAL arg);
745 
746 #endif // not C++11
747 
748 #if defined(_MSC_VER) && _MSC_VER < 1900 // Microsoft Visual Studio < 2015
749 
750 #include <cfloat>
751 #define isnan(x) _isnan(x)
752 
753 #endif
754 
755 #endif
static TPZCounter gCount
Containts the counter vector by operation performed.
Definition: pzreal.h:270
Definition: pzreal.h:105
TPZFlopCounter operator+(double val1, const TPZFlopCounter &val2)
Performs . Doesn&#39;t increments counters.
Definition: pzreal.h:595
TPZCounter operator-(const TPZCounter &other)
Definition: pzreal.h:122
TPZFlopCounter exp(const TPZFlopCounter &orig)
Returns the exponencial and increments the counter of the Exponencial.
Definition: pzreal.h:553
TPZFlopCounter & operator*=(const TPZFlopCounter &oth)
Performs the product with oth value on own value and increments the counter of the products...
Definition: pzreal.h:376
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 ...
Definition: pzreal.h:544
TPZFlopCounter operator+(const TPZFlopCounter &oth) const
Returns the sum with oth value and increments the counter of the sums.
Definition: pzreal.h:345
TPZFlopCounter operator/(const double &oth) const
Returns the division between oth value and increments the counter of the divisions.
Definition: pzreal.h:336
Definition: pzreal.h:105
TPZFlopCounter asin(const TPZFlopCounter &orig)
Returns the arc sine in radians and increments the counter of the Arc Sine.
Definition: pzreal.h:505
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
Definition: pzreal.h:668
Definition: pzreal.h:105
bool operator<(const REAL &val) const
Definition: pzreal.h:294
bool operator<=(const REAL &val) const
Definition: pzreal.h:289
REAL val() const
Definition: pzreal.h:280
TPZFlopCounter sqrt(const TPZFlopCounter &orig)
Returns the square root of the value and increments the counter of the square root.
Definition: pzreal.h:465
float fabs(std::complex< float > __x)
This is the type of floating point number PZ will use.
Definition: pzreal.h:233
TPZFlopCounter operator*(const REAL &oth) const
Returns the product with the oth value and increments the counter of the products.
Definition: pzreal.h:328
TPZFlopCounter operator-(const TPZFlopCounter &oth) const
Returns the difference with oth value and increments the counter of the sums.
Definition: pzreal.h:354
bool operator<(const TPZFlopCounter &sec) const
Compares the values and doesn&#39;t increments the counters.
Definition: pzreal.h:403
Definition: pzreal.h:105
bool operator>=(const TPZFlopCounter &sec) const
Compares the values and doesn&#39;t increments the counters.
Definition: pzreal.h:418
bool operator>(const TPZFlopCounter &sec) const
Compares the values and doesn&#39;t increments the counters.
Definition: pzreal.h:408
std::underlying_type< Enumeration >::type as_integer(const Enumeration value)
Definition: pzreal.h:37
Definition: pzreal.h:105
TPZFlopCounter operator/(const TPZFlopCounter &oth) const
Returns the division between oth value and increments the counter of the divisions.
Definition: pzreal.h:319
TPZFlopCounter & operator-=(const TPZFlopCounter &oth)
Performs the diference with oth value on own value and increments the counter of the sums...
Definition: pzreal.h:369
TPZFlopCounter log10(const TPZFlopCounter &orig)
Returns the decimal logarithm and increment the counter of the logarithm.
Definition: pzreal.h:571
TinyFad< 8, T > abs(const TinyFad< 8, T > &in)
Definition: tinyfadeight.h:846
REAL val(STATE &number)
Returns value of the variable.
Definition: pzartdiff.h:23
bool operator>(const REAL &val) const
Definition: pzreal.h:298
std::istream & operator>>(std::istream &out, TPZFlopCounter &val)
Implements to read (input) only the floating point value.
Definition: pzreal.h:625
TPZFlopCounter(const double &val)
Definition: pzreal.h:275
Definition: pzreal.h:105
bool operator>=(const REAL &val) const
Definition: pzreal.h:302
TPZFlopCounter operator/(double val1, const TPZFlopCounter &val2)
Performs . Doesn&#39;t increments counters.
Definition: pzreal.h:587
Definition: pzreal.h:105
TPZFlopCounter operator-(double val1, const TPZFlopCounter &val2)
Performs . Doesn&#39;t increments counters.
Definition: pzreal.h:611
Definition: pzreal.h:105
const int gNumOp
Number of type of the operations actually counted.
Definition: pzreal.h:108
static const double tol
Definition: pzgeoprism.cpp:23
bool operator<=(const TPZFlopCounter &sec) const
Compares the values and doesn&#39;t increments the counters.
Definition: pzreal.h:413
const T & Max(const T &a, const T &b)
Returns the maximum value between a and b.
Definition: pzreal.h:724
TPZCounter & clear()
Definition: pzreal.h:147
TPZFlopCounter operator+() const
Returns the current floating point value and doesn&#39;t increments the counters.
Definition: pzreal.h:398
Definition: tfad.h:64
int gPrintLevel
Extern variable to control level of printting (priority print?)
TPZFlopCounter fabsFlop(const TPZFlopCounter &orig)
Returns the absolute value and doesn&#39;t increments the counters.
Definition: pzreal.h:474
TPZFlopCounter()
Definition: pzreal.h:272
std::numeric_limits< REAL > dbl
bool operator!=(const TPZFlopCounter &sec) const
Compares the values and doesn&#39;t increments the counters.
Definition: pzreal.h:428
TPZFlopCounter & operator+=(const TPZFlopCounter &oth)
Performs the sum with oth value on own value and increments the counter of the sums.
Definition: pzreal.h:362
TPZFlopCounter sin(const TPZFlopCounter &orig)
Returns the sine in radians and increments the counter of the sine.
Definition: pzreal.h:523
REAL fVal
Floating point value.
Definition: pzreal.h:267
bool operator==(const REAL &val) const
Definition: pzreal.h:306
Definition: pzreal.h:105
const T & Min(const T &a, const T &b)
Returns the minimum value between a and b.
Definition: pzreal.h:729
TPZFlopCounter atan(const TPZFlopCounter &orig)
Returns the arc tangent in radians and increments the counter of the Arc Tangent. ...
Definition: pzreal.h:532
TPZFlopCounter & operator/=(const TPZFlopCounter &oth)
Performs the division between oth value on own value and increments the counter of the divisions...
Definition: pzreal.h:383
TPZCounter & operator-=(const TPZCounter &other)
Definition: pzreal.h:135
TPZFlopCounter operator*(const TPZFlopCounter &oth) const
Returns the product with the oth value and increments the counter of the products.
Definition: pzreal.h:311
TPZFlopCounter acos(const TPZFlopCounter &orig)
Returns the arc cosine in radians and increments the counter of the Arc Cosine.
Definition: pzreal.h:496
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
Definition: pzreal.h:487
Implements a counter by operations. Common.
Definition: pzreal.h:111
std::ostream & operator<<(std::ostream &out, const TPZCounter &count)
Re-implements << operator to show the counter (count) data.
Definition: pzreal.cpp:40
TPZFlopCounter operator*(double val1, const TPZFlopCounter &val2)
Performs . Doesn&#39;t increments counters.
Definition: pzreal.h:579
TPZCounter()
Counter constructor.
Definition: pzreal.h:117
This class implements floating point number associated with a counter of the operations performed wit...
Definition: pzreal.h:261
REAL erf(REAL arg)
Definition: pzreal.cpp:60
bool operator==(const TPZFlopCounter &sec) const
Compares the values and doesn&#39;t increments the counters.
Definition: pzreal.h:423
TPZCounter & copy(const TPZCounter &other)
Definition: pzreal.h:141
Definition: pzreal.h:105
uint64_t fCount[gNumOp]
Definition: pzreal.h:114
Definition: pzreal.h:105
MOptype
Types of operations to be counted.
Definition: pzreal.h:105
REAL ZeroTolerance()
Returns the tolerance to Zero value. Actually: .
Definition: pzreal.h:633
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
Definition: pzreal.h:514
Defines functions to help with invalid arithmetic operations.
const T & val() const
Definition: tfad.h:89
TPZFlopCounter operator-() const
Returns value with signal changed of its floating point value and increments the counter of the sums...
Definition: pzreal.h:390
Definition: pzreal.h:105
TPZFlopCounter log(const TPZFlopCounter &orig)
Returns the natural logarithm and increment the counter of the logarithm.
Definition: pzreal.h:562
TPZCounter & operator+=(const TPZCounter &other)
Definition: pzreal.h:129