BLAS { public static void scal(double a, double[] x) { F2J_BLAS.dscal(x.length, a, x, 1); }  static double asum(int n, double[] x, int offset); static double asum(DenseVector x); static double asum(SparseVector x); static void axpy(double a, double[] x, double[] y); static void axpy(double a, DenseVector x, DenseVector y); static void axpy(double a, SparseVector x, DenseVector y); static void axpy(double a, Vector x, DenseVector y); static void axpy(double a, DenseMatrix x, DenseMatrix y); static void axpy(int n, double a, double[] x, int xOffset, double[] y, int yOffset); static double dot(double[] x, double[] y); static double dot(DenseVector x, DenseVector y); static void scal(double a, double[] x); static void scal(double a, double[] x, int xOffset, int length); static void scal(double a, DenseVector x); static void scal(double a, SparseVector x); static void scal(double a, DenseMatrix x); static void gemm(double alpha, DenseMatrix matA, boolean transA, DenseMatrix matB, boolean transB,
                            double beta, DenseMatrix matC); static void gemv(double alpha, DenseMatrix matA, boolean transA,
                            Vector x, double beta, DenseVector y); static void gemv(double alpha, DenseMatrix matA, boolean transA,
                            DenseVector x, double beta, DenseVector y); static void gemv(double alpha, DenseMatrix matA, boolean transA,
                            SparseVector x, double beta, DenseVector y);  }
@Test public void testScal() throws Exception { DenseVector v1 = dv1.clone(); BLAS.scal(0.5, v1); Assert.assertArrayEquals(v1.getData(), new double[]{0.5, 1.0}, TOL); SparseVector v2 = spv1.clone(); BLAS.scal(0.5, v2); Assert.assertArrayEquals(v2.getIndices(), spv1.getIndices()); Assert.assertArrayEquals(v2.getValues(), new double[]{0.5, 1.0}, TOL); }