package org.nd4j.linalg.api.blas;

import org.junit.Test;
import org.nd4j.linalg.BaseNd4jTest;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.factory.Nd4j;

/**
 * @author Adam Gibson
 */
public class Level1Test extends BaseNd4jTest {

    @Test
    public void testDot() {
        INDArray vec1 = Nd4j.create(new float[]{1, 2, 3, 4});
        INDArray vec2 = Nd4j.create(new float[]{1, 2, 3, 4});
        assertEquals(30, Nd4j.getBlasWrapper().dot(vec1, vec2), 1e-1);

        INDArray matrix = Nd4j.linspace(1, 4, 4).reshape(2, 2);
        INDArray row = matrix.getRow(1);
        double dot = Nd4j.getBlasWrapper().dot(row, row);
        assertEquals(20,dot, 1e-1);

    }

    @Override
    public char ordering() {
        return 'f';
    }
}

@@ -691,16 +691,294 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testAxpy() %7B%0A        INDArray matrix = Nd4j.linspace(1,4,4).reshape(2,2);%0A        INDArray row = matrix.getRow(1);%0A        Nd4j.getBlasWrapper().level1().axpy(row.length(),1.0,row,row);%0A        assertEquals(Nd4j.create(new double%5B%5D%7B4,8%7D),row);%0A%0A    %7D%0A%0A
     @Ove

add simple axpy test