Index: olena/ChangeLog
from Astrid Wang <astrid(a)lrde.epita.fr>
* oln/core/point2d.hxx: Fix member function minus().
* oln/core/abstract/dpoint.hh: Add member function norm2().
Index: olena/oln/core/abstract/dpoint.hh
--- olena/oln/core/abstract/dpoint.hh Thu, 07 Aug 2003 02:08:21 +0200 david
(oln/d/28_dpoint.hh 1.16 640)
+++ olena/oln/core/abstract/dpoint.hh Mon, 19 Jan 2004 17:49:12 +0100 astrid
(oln/d/28_dpoint.hh 1.16 640)
@@ -30,6 +30,7 @@
# include <mlc/type.hh>
# include <oln/core/coord.hh>
+# include <ntg/real/builtin_float.hh>
namespace oln {
@@ -135,6 +136,16 @@
return true;
}
+ ntg::float_d
+ norm2(void) const
+ {
+ double norm = 0;
+
+ for (unsigned i = 0; i < dim; ++i)
+ norm += nth(i) * nth(i);
+ return sqrt(norm);
+ }
+
static std::string
name()
{
Index: olena/oln/core/point2d.hxx
--- olena/oln/core/point2d.hxx Mon, 28 Jul 2003 14:14:03 +0200 david (oln/c/29_point2d.hx
1.5 640)
+++ olena/oln/core/point2d.hxx Mon, 19 Jan 2004 16:44:56 +0100 astrid (oln/c/29_point2d.hx
1.5 640)
@@ -114,7 +114,7 @@
inline point2d
point2d::minus() const
{
- point2d p(row(), col());
+ point2d p(-row(), -col());
return p;
}
--
astrid