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 > > >