Feature Suggestion: Apply


Hi Team,A feature which is quite useful in matrix programming is the Apply method on a Matrix, which allows component-wise application of a scalar function.As an example, it is often the case that a user wants to apply a Log( 1 + x ), or Sqrt( x ), transform to a Matrix in order to adjust for kurtosis in the values.I was thinking that they could be implemented via delegates (which I think are the C# equivalent of function pointers), to allow for maximum flexibility.  What do you think?Keep up the good work guys,Kindest regards,Julian
Closed Jul 28, 2009 at 6:12 PM by cuda


cuda wrote Mar 12, 2009 at 11:48 AM

-Use the name Map as suggested by Patrick to be consistent with F#.
-We should also add support for vectors.
-We should look at provide predefined delegates for the native version - Intel's vector math functions.

wrote Mar 12, 2009 at 8:52 PM

jpulman wrote Mar 12, 2009 at 9:03 PM

using intel's vector function sounds like a great idea - functions like Abs( matrix ) and Abs( vector ) can be very useful.
For example the condition Sum( Abs( Vector ) ) can be a very quick way of determining if a vector is all zeroes or not.

Other Map-style commands that I see run a lot are functions which replace all NaNs in a matrix with zeroes (similarly for vectors) - to prepare for matrix arithmetic. This operation in particular I've seen heavily used within loops, so optimizing the speed of this operation can be pivotal in speeding up applications and simulations.

wrote Mar 13, 2009 at 9:51 AM

wrote Mar 15, 2009 at 2:56 AM

wrote Mar 30, 2009 at 10:34 AM

wrote Mar 30, 2009 at 10:34 AM

wrote Apr 8, 2009 at 5:59 AM

cuda wrote May 6, 2009 at 2:12 PM

initial implementation has been added - Apply.cs

wrote May 6, 2009 at 2:12 PM

wrote Jul 28, 2009 at 6:12 PM

wrote Feb 14, 2013 at 2:00 AM

wrote May 16, 2013 at 7:16 AM