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 7:12 PM by cuda


cuda wrote Mar 12, 2009 at 12:48 PM

-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 9:52 PM

jpulman wrote Mar 12, 2009 at 10: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 10:51 AM

wrote Mar 15, 2009 at 3:56 AM

wrote Mar 30, 2009 at 11:34 AM

wrote Mar 30, 2009 at 11:34 AM

wrote Apr 8, 2009 at 6:59 AM

cuda wrote May 6, 2009 at 3:12 PM

initial implementation has been added - Apply.cs

wrote May 6, 2009 at 3:12 PM

wrote Jul 28, 2009 at 7:12 PM

wrote Feb 14, 2013 at 3:00 AM

wrote May 16, 2013 at 8:16 AM