You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Sébastien Brisard <se...@m4x.org> on 2011/11/23 08:27:12 UTC

[math] Matrices and Vectors again

Hello,
I would like to revive a discussion which took place a few months ago,
about the design of the matrix and vector classes. As far as I remember,
what came out was that these classes would benefit from a more functional
approach, à la Mahout. Additionally, I think Ted suggested that we
introduce Views of a given matrix. I know we should be careful not to be
too quick, but I think we should give it a go. During our discussions, it
came out that RealVector and RealMatrix had useful embryos of functional
features
  - RealVector.map(UnivariateRealFunction f)
  - RealMatrix.walkXxx(visitor)
these features are somewhat similar, except for the fact that
RealVector.map never sees the index of the current cell.
A first step might be to unify these two interfaces
  - Implement visitors for RealVector,
  - possibly add a map(UnivariateRealFunction f) to Matrix.
As a second (big step), we could try and clean up the interfaces for
Vectors and Matrices, defining as many Visitors as possible, instead of
cluttering the corresponding interfaces (keeping, of course, performance
issues in mind).

What do you think? Should we give it a go? At this point, people already
suggested that this should be done in a branch?

Best regards for now,
Sébastien

Re: [math] Matrices and Vectors again

Posted by Sébastien Brisard <se...@m4x.org>.
> I would very much like to have a simplified API.
>
> I also would vevery very much like to see 3.0 released, so if we are
> gonna doing some API change here, we should really go forward and do it
> fast. I'll start another thread about this.
>
> Luc
>
you're right, Luc, sorry for that. I'll answer your post.
Best wishes,
Sébastien

PS: It doesn't mean we cannot *think* about it... However, previous
discussions on this topic are scattered among various threads/JIRA tickets,
so it's hard to follow. It would be nice to set up a common place (WIKI ?)
where everyone's thoughts could be gathered, and organized towards a new
design. Just a thought, though.

Re: [math] Matrices and Vectors again

Posted by Phil Steitz <ph...@gmail.com>.
On 11/23/11 2:05 AM, Luc Maisonobe wrote:
> Le 23/11/2011 09:16, Mikkel Meyer Andersen a écrit :
>> I also think it is a good idea, but with the addition of thinking
>> parallelisation into the framework (e.g. in the map functionality).
>> Whether it should be done in a branch or not, I don't know, but I guess
>> the people who do know will reply on that :-).
> I would very much like to have a simplified API.

+1
>
> I also would vevery very much like to see 3.0 released, so if we are
> gonna doing some API change here, we should really go forward and do it
> fast. I'll start another thread about this.

+1

Phil
>
> Luc
>
>> Cheers, Mikkel.
>>
>> 2011/11/23 Ted Dunning <te...@gmail.com>:
>>> I still think it is a good idea.
>>>
>>> Sent from my iPhone
>>>
>>> On Nov 22, 2011, at 23:27, Sébastien Brisard <se...@m4x.org> wrote:
>>>
>>>> Hello,
>>>> I would like to revive a discussion which took place a few months ago,
>>>> about the design of the matrix and vector classes. As far as I remember,
>>>> what came out was that these classes would benefit from a more functional
>>>> approach, à la Mahout. Additionally, I think Ted suggested that we
>>>> introduce Views of a given matrix. I know we should be careful not to be
>>>> too quick, but I think we should give it a go. During our discussions, it
>>>> came out that RealVector and RealMatrix had useful embryos of functional
>>>> features
>>>>  - RealVector.map(UnivariateRealFunction f)
>>>>  - RealMatrix.walkXxx(visitor)
>>>> these features are somewhat similar, except for the fact that
>>>> RealVector.map never sees the index of the current cell.
>>>> A first step might be to unify these two interfaces
>>>>  - Implement visitors for RealVector,
>>>>  - possibly add a map(UnivariateRealFunction f) to Matrix.
>>>> As a second (big step), we could try and clean up the interfaces for
>>>> Vectors and Matrices, defining as many Visitors as possible, instead of
>>>> cluttering the corresponding interfaces (keeping, of course, performance
>>>> issues in mind).
>>>>
>>>> What do you think? Should we give it a go? At this point, people already
>>>> suggested that this should be done in a branch?
>>>>
>>>> Best regards for now,
>>>> Sébastien
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


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


Re: [math] Matrices and Vectors again

Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
Hi.

> > I also think it is a good idea, but with the addition of thinking
> > parallelisation into the framework (e.g. in the map functionality).
> > Whether it should be done in a branch or not, I don't know, but I guess
> > the people who do know will reply on that :-).
> 
> I would very much like to have a simplified API.

+1

> I also would vevery very much like to see 3.0 released,

+1

> so if we are
> gonna doing some API change here, we should really go forward and do it
> fast. [...]

+1

Is there some actual proposal for the simple API?

Maybe we could start from a basic structure, that contains the minimum
number of features (TBD); something that would not hurt implementations
like the efficient 3-dimensional matrices talked about some time ago.

Then maybe that more featureful matrix classes could specify additional
functionalities through the implementations of "interface"s, like
"IsVisitable".
Then we could retrofit the currently exisiting matrix classes by just adding
the appropriate "implements" clauses.


Gilles

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


Re: [math] Matrices and Vectors again

Posted by Luc Maisonobe <Lu...@free.fr>.
Le 23/11/2011 09:16, Mikkel Meyer Andersen a écrit :
> I also think it is a good idea, but with the addition of thinking
> parallelisation into the framework (e.g. in the map functionality).
> Whether it should be done in a branch or not, I don't know, but I guess
> the people who do know will reply on that :-).

I would very much like to have a simplified API.

I also would vevery very much like to see 3.0 released, so if we are
gonna doing some API change here, we should really go forward and do it
fast. I'll start another thread about this.

Luc

> 
> Cheers, Mikkel.
> 
> 2011/11/23 Ted Dunning <te...@gmail.com>:
>> I still think it is a good idea.
>>
>> Sent from my iPhone
>>
>> On Nov 22, 2011, at 23:27, Sébastien Brisard <se...@m4x.org> wrote:
>>
>>> Hello,
>>> I would like to revive a discussion which took place a few months ago,
>>> about the design of the matrix and vector classes. As far as I remember,
>>> what came out was that these classes would benefit from a more functional
>>> approach, à la Mahout. Additionally, I think Ted suggested that we
>>> introduce Views of a given matrix. I know we should be careful not to be
>>> too quick, but I think we should give it a go. During our discussions, it
>>> came out that RealVector and RealMatrix had useful embryos of functional
>>> features
>>>  - RealVector.map(UnivariateRealFunction f)
>>>  - RealMatrix.walkXxx(visitor)
>>> these features are somewhat similar, except for the fact that
>>> RealVector.map never sees the index of the current cell.
>>> A first step might be to unify these two interfaces
>>>  - Implement visitors for RealVector,
>>>  - possibly add a map(UnivariateRealFunction f) to Matrix.
>>> As a second (big step), we could try and clean up the interfaces for
>>> Vectors and Matrices, defining as many Visitors as possible, instead of
>>> cluttering the corresponding interfaces (keeping, of course, performance
>>> issues in mind).
>>>
>>> What do you think? Should we give it a go? At this point, people already
>>> suggested that this should be done in a branch?
>>>
>>> Best regards for now,
>>> Sébastien
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


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


Re: [math] Matrices and Vectors again

Posted by Mikkel Meyer Andersen <mi...@mikl.dk>.
I also think it is a good idea, but with the addition of thinking
parallelisation into the framework (e.g. in the map functionality).
Whether it should be done in a branch or not, I don't know, but I guess
the people who do know will reply on that :-).

Cheers, Mikkel.

2011/11/23 Ted Dunning <te...@gmail.com>:
> I still think it is a good idea.
>
> Sent from my iPhone
>
> On Nov 22, 2011, at 23:27, Sébastien Brisard <se...@m4x.org> wrote:
>
>> Hello,
>> I would like to revive a discussion which took place a few months ago,
>> about the design of the matrix and vector classes. As far as I remember,
>> what came out was that these classes would benefit from a more functional
>> approach, à la Mahout. Additionally, I think Ted suggested that we
>> introduce Views of a given matrix. I know we should be careful not to be
>> too quick, but I think we should give it a go. During our discussions, it
>> came out that RealVector and RealMatrix had useful embryos of functional
>> features
>>  - RealVector.map(UnivariateRealFunction f)
>>  - RealMatrix.walkXxx(visitor)
>> these features are somewhat similar, except for the fact that
>> RealVector.map never sees the index of the current cell.
>> A first step might be to unify these two interfaces
>>  - Implement visitors for RealVector,
>>  - possibly add a map(UnivariateRealFunction f) to Matrix.
>> As a second (big step), we could try and clean up the interfaces for
>> Vectors and Matrices, defining as many Visitors as possible, instead of
>> cluttering the corresponding interfaces (keeping, of course, performance
>> issues in mind).
>>
>> What do you think? Should we give it a go? At this point, people already
>> suggested that this should be done in a branch?
>>
>> Best regards for now,
>> Sébastien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

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


Re: [math] Matrices and Vectors again

Posted by Ted Dunning <te...@gmail.com>.
I still think it is a good idea. 

Sent from my iPhone

On Nov 22, 2011, at 23:27, Sébastien Brisard <se...@m4x.org> wrote:

> Hello,
> I would like to revive a discussion which took place a few months ago,
> about the design of the matrix and vector classes. As far as I remember,
> what came out was that these classes would benefit from a more functional
> approach, à la Mahout. Additionally, I think Ted suggested that we
> introduce Views of a given matrix. I know we should be careful not to be
> too quick, but I think we should give it a go. During our discussions, it
> came out that RealVector and RealMatrix had useful embryos of functional
> features
>  - RealVector.map(UnivariateRealFunction f)
>  - RealMatrix.walkXxx(visitor)
> these features are somewhat similar, except for the fact that
> RealVector.map never sees the index of the current cell.
> A first step might be to unify these two interfaces
>  - Implement visitors for RealVector,
>  - possibly add a map(UnivariateRealFunction f) to Matrix.
> As a second (big step), we could try and clean up the interfaces for
> Vectors and Matrices, defining as many Visitors as possible, instead of
> cluttering the corresponding interfaces (keeping, of course, performance
> issues in mind).
> 
> What do you think? Should we give it a go? At this point, people already
> suggested that this should be done in a branch?
> 
> Best regards for now,
> Sébastien

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