YAMP.Numerics.BlasL1.dNrm1 C# (CSharp) 메소드

dNrm1() 공개 정적인 메소드

Returns the sum_i |x_i| norm.
public static dNrm1 ( double store, int offset, int stride, int count ) : double
store double The source vector.
offset int The offset in the source.
stride int The offset between two elements.
count int The number of elements to consider.
리턴 double
        public static double dNrm1(double[] store, int offset, int stride, int count)
        {
            double m = 0.0;
            int n = 0;
            int i = offset;

            while (n < count)
            {
                m += Math.Abs(store[i]);
                n++;
                i += stride;
            }

            return m;
        }