Index: olena/ChangeLog
from Astrid Wang <astrid(a)lrde.epita.fr>
* oln/core/abstract/dpoint.hh: Fix headers. Add member function
sqr_norm2().
Index: olena/oln/core/abstract/dpoint.hh
--- olena/oln/core/abstract/dpoint.hh Mon, 19 Jan 2004 18:35:23 +0100 astrid
(oln/d/28_dpoint.hh 1.17 640)
+++ olena/oln/core/abstract/dpoint.hh Fri, 23 Jan 2004 15:51:36 +0100 astrid
(oln/d/28_dpoint.hh 1.17 640)
@@ -30,7 +30,8 @@
# include <mlc/type.hh>
# include <oln/core/coord.hh>
-# include <ntg/real/builtin_float.hh>
+# include <ntg/float.hh>
+# include <cmath>
namespace oln {
@@ -146,6 +147,16 @@
return sqrt(norm);
}
+ ntg::float_d
+ sqr_norm2(void) const
+ {
+ double norm = 0;
+
+ for (unsigned i = 0; i < dim; ++i)
+ norm += nth(i) * nth(i);
+ return norm;
+ }
+
static std::string
name()
{
--
astrid