J.Pietschmann wrote:
Tzvika Barenholz wrote:

There are multiple (conflicting) definitions
for vector*vector in various contexts, the most common is
(a1, a2, ...)*(b1, b2, ...)=(a1*b1, a2*b2, ...)

...

I mean exactly the above indicated 'common one'. of course i could
relate to it as a multiplication of two matrices (the left a row the
right a column) but seems a bit ugly.


You'll get a 1x1 matrix in this case, i.e. you geft the scalar
product of two vectors: a1*b1+a2*b2+...

Do you think there is a point in adding a sort of static methods class
, VectorUtils or the like?


I never felt the need to do this. In Java 1.3 even with HotSpot,
there is still a noticable speed advantage if you unroll and
inline simple vector operations in inner loops instead of calling
a function.

I have not seen a compelling need to do this anywhere within [math] now, and I would also tend to shy away from the overhead of creating objects / calling functions for simple things like dot products; but I am not sure that is actually a valid concern (see below) and I would not be averse to adding either a set of static methods on double[] arrays or a RealVector class for various vector products, linear combinations, etc. if others have practical uses for this.

Does anybody have more recent data about Java performance for numerical comuptations?

I think what you really mean here is the function call / object instantiation overhead, right? The significance of this will obviously vary with the length of the vectors (longer = more actual comp to spread the overhead) and what you are doing. I remember being surprised by the results of some benchmarks that Mark and I ran last year when we were debating "monolithic" static methods vs. more modular code in the stat package. Might be interesting to run some benchmarks on dot products computed inline vs static double[] methods vs using objects.


Phil

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to