Exemplo n.º 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);
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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);
 }