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.714aa14000...@svoboda.polytechnique.org%3E
Best, Sébastien 2011/8/18 Ted Dunning <ted.dunn...@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 > <gsterijev...@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.dunn...@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 < >> > gil...@harfang.homelinux.org> wrote: >> > >> > > 1. Is it OK to add an "addToEntry" method to "RealVector"? [There is >> one >> > in >> > > >> > >> > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org