Esempio n. 1
0
 /// <summary>
 /// Implements the map function from functional programming. This 'maps' the
 /// function lambda onto the vector cv and returns the result.
 /// </summary>
 /// <param name="cv">A ColumnVector object.</param>
 /// <param name="lambda">A function that takes a double and returns a double.</param>
 /// <returns>A vector with the function lambda mapped onto cv.</returns>
 public static ColumnVector Map(this ColumnVector cv, Func <double, double> lambda)
 {
     // Note: the Select method refers to Enumerable.Select in the Linq
     // namespace.
     return(new ColumnVector(cv.Select(lambda).ToList()));
 }