Hi Ole.

Maybe I don't understand the point of the question but I'm
not sure that collecting here answers to implementation-level
questions is going to lead us anywhere.

There is a issue on the bug-tracking system that started to
collect many of the various problems (specific and general)
of data containers ("RealVector", "RealMatrix", etc.) of the
"o.a.c.m.linear" package.

Perhaps it should more useful, for future reference, to list
everything in one place.

On Fri, 8 Jan 2016 18:41:27 -0600, Ole Ersoy wrote:
public double getLInfNorm() {
        double norm = 0;
        Iterator<Entry> it = iterator();
        while (it.hasNext()) {
            final Entry e = it.next();
            norm = FastMath.max(norm, FastMath.abs(e.getValue()));
        }
        return norm;
    }

The main problem with the above is that it assumes that the elements
of a "RealVector" are Cartesian coordinates.
There is no provision that it must be the case, and assuming it is
then in contradiction with other methods like "append".

At first (and second and third) sight, I think that these container
classes should be abandoned and replaced by specific ones.
For example:
* Single "matrix" abstract type or interface for computations in
  the "linear" package (rather than "vector" and "matrix" types)
* Perhaps a "DoubleArray" (for such things as "append", etc.).
  And by the way, there already exists "ResizableDoubleArray" which
  could be a start.
* Geometrical vectors (that can perhaps support various coordinate
  systems)
* ...

Regards,
Gilles

Cheers,
Ole


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

Reply via email to