36 lines
667 B
Diff
36 lines
667 B
Diff
--- lib/JAMA/tnt_math_utils.h 2006-05-10 20:58:50.000000000 +0300
|
|
+++ lib/JAMA/tnt_math_utils.h 2007-07-27 16:20:01.000000000 +0300
|
|
@@ -19,6 +19,16 @@
|
|
|
|
namespace TNT
|
|
{
|
|
+
|
|
+/**
|
|
+· @returns the absolute value of a real (no-complex) scalar.
|
|
+*/
|
|
+template <class Real>
|
|
+Real abs(const Real &a)
|
|
+{
|
|
+ return (a > 0 ? a : -a);
|
|
+}
|
|
+
|
|
/**
|
|
@returns hypotenuse of real (non-complex) scalars a and b by
|
|
avoiding underflow/overflow
|
|
@@ -56,15 +66,6 @@
|
|
}
|
|
*/
|
|
|
|
-/**
|
|
- @returns the absolute value of a real (no-complex) scalar.
|
|
-*/
|
|
-template <class Real>
|
|
-Real abs(const Real &a)
|
|
-{
|
|
- return (a > 0 ? a : -a);
|
|
-}
|
|
-
|
|
}
|
|
#endif
|
|
/* MATH_UTILS_H */
|