YAMP.Numerics.BlasL1.dAxpy C# (CSharp) Method

dAxpy() public static method

Computes y = a x + y, where x, y are vectors and a is a real scalar.
public static dAxpy ( double alpha, double xStore, int xOffset, int xStride, double yStore, int yOffset, int yStride, int count ) : void
alpha double Some arbitrary real scalar.
xStore double The vector x.
xOffset int The offset in the vector x.
xStride int The offset between two elements in x.
yStore double The vector y.
yOffset int The offset in the vector y.
yStride int The offset between two elements in y.
count int The number of elements to take.
return void
        public static void dAxpy(double alpha, double[] xStore, int xOffset, int xStride, double[] yStore, int yOffset, int yStride, int count)
        {
            int n = 0;
            int x = xOffset;
            int y = yOffset;

            while (n < count)
            {
                yStore[y] += alpha * xStore[x];
                n++;
                x += xStride;
                y += yStride;
            }
        }