tnt_math_utils.h Source File
Main Page Namespace List Compound List File List Namespace Members Compound Members File Members
Copyright By PowCoder代写 加微信 powcoder
tnt_math_utils.h
Go to the documentation of this file.00001 #ifndef MATH_UTILS_H
00002 #define MATH_UTILS_H
00004 #include
00005 /* needed for sqrt() below */
00009 namespace TNT
00017 template
00018 Real hypot(const Real &a, const Real &b)
00021 if (a== 0)
00022 return abs(b);
00023 else
00024 {
00025 Real c = b/a;
00026 return abs(a) * sqrt(1 + c*c);
00027 }
00033 template
00034 Scalar min(const Scalar &a, const Scalar &b)
00036 return a < b ? a : b;
00042 template
00043 Scalar max(const Scalar &a, const Scalar &b)
00045 return a > b ? a : b;
00051 template
00052 Real abs(const Real &a)
00054 return (a > 0 ? a : -a);
00062 #endif
00063 /* MATH_UTILS_H */
Generated at Thu Jun 26 17:26:14 2003 for Template Numerical Toolkit (TNT) by
1.2.5 written by Dimitri van Heesch,
© 1997-2001
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com