Exemple #1
0
 /// <summary>
 /// Division outarray[i] / val
 /// </summary>
 public static void Div(Floatarray outarray, float val)
 {
     for (int i = 0; i < outarray.Length1d(); i++)
     {
         outarray.Put1d(i, outarray.At1d(i) / val);
     }
 }
Exemple #2
0
 /// <summary>
 /// Subtraction val - outarray[i]
 /// </summary>
 public static void Sub(float val, Floatarray outarray)
 {
     for (int i = 0; i < outarray.Length1d(); i++)
     {
         outarray.Put1d(i, val - outarray.At1d(i));
     }
 }
Exemple #3
0
        /// <summary>
        /// Normalize the Euclidean norm of the array.
        /// </summary>
        public static void Normalize2(Floatarray a)
        {
            double scale = 1.0 / Norm2(a);

            for (int i = 0; i < a.Length1d(); i++)
            {
                a.Put1d(i, (float)(a.At1d(i) * scale));
            }
        }