Gilles Sadowski schrieb:
>>> L1 norm: equals(a, b, tolerance) = sum(abs(a-b)) < tolerance
>>> L2 norm: equals(a, b, tolerance) = sqrt(sum((a-b)^2)) < tolerance
>>> L-infinity norm: equals(a, b, tolerance) = max(abs(a-b)) < tolerance
>>>
>>> All are useful.
>> I'll guess for 3D vector the L2-norm is the more useful as it is
>> invariant when physical orthonormal frames are changed.
>> I'll check in the variant you prefer.
> 
> [Cf. my other reply.]
> Should I still create an issue?

I'm currently not invovled in commons-math, but I've written substatntial amount
of numeric software.

My thought on this point is, that it is generally more feasible to implement a
bunch on distance methods like

  a.distance1(b)   ... L1-Norm
  a.distance(b)    ... L1-Norm (this is usually what the user wants as default)
  a.distanceInf(b) ... L∞-Norm

and have the user decide on what is equal in his particular situation.


There is a very good article on ieee754 equality under

  http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm

which contains an excessive discussion about various "equality" approaches.

IMHO it should be moreover considered to include the "AlomostEquals2sComplement"
method of this paper into commons-math if not done so far.

  Best regards,

   Wolfgang

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to