Example #1
0
 /// <summary>
 /// Element-wise addition.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="result">will be set to the resulting array</param>
 public static void Add <T>(T[] x, T[] y, T[] result)
 {
     VectorOp <T> .Add(x, y, result);
 }
Example #2
0
 /// <summary>
 /// Calculates the inner (dot) product of the elements in the given arrays
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <returns></returns>
 public static T Dot <T>(T[] x, T[] y)
 {
     return(VectorOp <T> .Dot(x, y));
 }
Example #3
0
 /// <summary>
 /// Calculates the sum of the elements in the array
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="x"></param>
 /// <returns>the sum of the elements in the array</returns>
 public static T Sum <T>(T[] x)
 {
     return(VectorOp <T> .Sum(x));
 }
Example #4
0
 /// <summary>
 /// Divides each element in the array by the scalar
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="x"></param>
 /// <param name="scalar"></param>
 /// <param name="result">will be set to the resulting array</param>
 public static void Divide <T>(T[] x, T scalar, T[] result)
 {
     VectorOp <T> .Divide(x, scalar, result);
 }