commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles <gil...@harfang.homelinux.org>
Subject Re: [Math] MATH-928 Alternative approach to matrix implementations
Date Mon, 26 Aug 2013 14:52:41 GMT
On Mon, 26 Aug 2013 10:04:01 -0400, Konstantin Berlin wrote:
> I think I like this approach a lot more.
>
> One thing that is left out, and we discussed a lot, is the need to
> support vector operations. This can also be done as an additional
> interface. This is critical since it forms the basic building block
> upon which all higher level matrix operations rely on. I think if we
> do it right, it would allow users to implement a GPU version as well.
>
> From usability point of view, the matrix class is kind of useless
> without vector oeprations, since no important higher level operation,
> other than multiplying, can be done with without copying it over to a
> double array.
>
> So maybe first we make a class
>
> public interface RealVector extends RealMatrix
>
> //code to implement a simple Nx1 matrix

It is quite impossible to follow you. You refer to an issue that
purports to be a starting for replacing the code currently in package
"linear" but then your use names ("RealVector", "RealMatrix") that
are defined there, and not the those from the proposal ("BasicMatrix").

> Now in order not to reinvent the wheel, we will model the operations
> based on the BLAS library. We can have two versions, one for the
> immutable classes and another for mutable.

I think that everyone agreed that we could improve the design
(this is issue MATH-765).
But nobody seems to have really explored alternatives.
So, we rely on you to provide justification/reference about a
new design. Taking inspiration from a well-known library is
probably safe. A view on vector operations is fine of course;
but I'd need more detailed code excerpts to be able to modify
and expand what is in MATH-928.


Gilles

>
> Then the vector operations can be expressed as in a immutable class
>
> something like
>
> //perform output = a*x+b*v, where x is row of current object
> RealVector rowOperation(int row, double a, double b, RealVector v)
>
> //perform output = a*x+b*v, where x is column of current object
> RealVector columnOperation(int column, double a, double b, RealVector 
> v)
>
>
> for mutable it can be basically same interface except no object is 
> returned
>
> //perform output = a*x+b*v, where x is row of current object, and 
> puts
> it in row rowResult of this matrix
> void rowOperationInPlace(int row, double a, double b, RealVector v,
> int rowResult)
>
> //perform output = a*x+b*v, where x is column of current object, and
> puts it in column columnResult of this matrix
> void columnOperationInPlace(int column, double a, double b, 
> RealVector
> v, int columnResult)
>
> What do you think?
>


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


Mime
View raw message