commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard <sebastien.bris...@m4x.org>
Subject Re: [Math] New method: "addToEntry" in "RealVector"
Date Thu, 18 Aug 2011 07:27:06 GMT
Hi,
isn't this already implemented as
map(UnivariateRealFunction function)
and
mapToSelf(UnivariateRealFunction function)
?
Also, you might want to check the discussion on JIRA MATH-613, and this thread
http://mail-archives.apache.org/mod_mbox/commons-dev/201107.mbox/%3C20110707083102.714AA140000A3@svoboda.polytechnique.org%3E

Best,
Sébastien

2011/8/18 Ted Dunning <ted.dunning@gmail.com>:
> Credit where it is due: this style of API was a major characteristic of Colt
> and Mahout inherited this style (to our benefit).
>
> On Wed, Aug 17, 2011 at 6:41 PM, Greg Sterijevski <gsterijevski@gmail.com>wrote:
>
>> Shocking as this may seem! ;-) I like Ted's suggestion. Very clean, an
>> appropriate use of OO and something for which the penalty is not great, but
>> the benefit humongous! +1 for functional/functor approach.
>>
>>
>>
>> On Wed, Aug 17, 2011 at 6:44 PM, Ted Dunning <ted.dunning@gmail.com>
>> wrote:
>>
>> > Are you going to add addAndScale and all the other gazillion common
>> > mutators
>> > as well?
>> >
>> > Or should there just be a functional style interface where you say
>> >
>> >   A.assign(Functions.plus(3.0))
>> >
>> > to add 3 to all elements of a matrix or vector?
>> >
>> > That would then allow
>> >
>> >   A.assign(Functions.ABS)
>> >
>> > or
>> >
>> >   A.assign(Functions.times(0.3))
>> >
>> > This allows one method to serve many, many purposes, including those that
>> > are not yet known.
>> >
>> > Similar logic leads to a family of assign methods and also some aggregate
>> > methods.  The resulting flexibility and parsimony is very nice.
>> >
>> > On Wed, Aug 17, 2011 at 3:14 PM, Gilles Sadowski <
>> > gilles@harfang.homelinux.org> wrote:
>> >
>> > > 1. Is it OK to add an "addToEntry" method to "RealVector"? [There is
>> one
>> > in
>> > >
>> >
>>
>

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


Mime
View raw message