org.jblas.la
Class SimpleBlas

java.lang.Object
  extended by org.jblas.la.SimpleBlas

public class SimpleBlas
extends java.lang.Object

This class provides a cleaner direct interface to the BLAS routines by extracting the parameters of the matrices from the matrices itself. For example, you can just pass the vector and do not have to pass the length, corresponding DoubleBuffer, offset and step size explicitly. Currently, all the general matrix routines are implemented.


Constructor Summary
SimpleBlas()
           
 
Method Summary
static double asum(ComplexDoubleMatrix x)
           
static float asum(ComplexFloatMatrix x)
           
static double asum(DoubleMatrix x)
          Compute || x ||_1 (1-norm, sum of absolute values)
static float asum(FloatMatrix x)
          Compute || x ||_1 (1-norm, sum of absolute values)
static ComplexDoubleMatrix axpy(ComplexDouble da, ComplexDoubleMatrix dx, ComplexDoubleMatrix dy)
           
static ComplexFloatMatrix axpy(ComplexFloat da, ComplexFloatMatrix dx, ComplexFloatMatrix dy)
           
static DoubleMatrix axpy(double da, DoubleMatrix dx, DoubleMatrix dy)
          Compute y <- alpha * x + y (elementwise addition)
static FloatMatrix axpy(float da, FloatMatrix dx, FloatMatrix dy)
          Compute y <- alpha * x + y (elementwise addition)
static ComplexDoubleMatrix copy(ComplexDoubleMatrix x, ComplexDoubleMatrix y)
           
static ComplexFloatMatrix copy(ComplexFloatMatrix x, ComplexFloatMatrix y)
           
static DoubleMatrix copy(DoubleMatrix x, DoubleMatrix y)
          Compute y <- x (copy a matrix)
static FloatMatrix copy(FloatMatrix x, FloatMatrix y)
          Compute y <- x (copy a matrix)
static double dot(DoubleMatrix x, DoubleMatrix y)
          Compute x^T * y (dot product)
static float dot(FloatMatrix x, FloatMatrix y)
          Compute x^T * y (dot product)
static ComplexDouble dotc(ComplexDoubleMatrix x, ComplexDoubleMatrix y)
          Compute x^T * y (dot product)
static ComplexFloat dotc(ComplexFloatMatrix x, ComplexFloatMatrix y)
          Compute x^T * y (dot product)
static ComplexDouble dotu(ComplexDoubleMatrix x, ComplexDoubleMatrix y)
          Compute x^T * y (dot product)
static ComplexFloat dotu(ComplexFloatMatrix x, ComplexFloatMatrix y)
          Compute x^T * y (dot product)
static int geev(char jobvl, char jobvr, DoubleMatrix A, DoubleMatrix WR, DoubleMatrix WI, DoubleMatrix VL, DoubleMatrix VR)
           
static int geev(char jobvl, char jobvr, FloatMatrix A, FloatMatrix WR, FloatMatrix WI, FloatMatrix VL, FloatMatrix VR)
           
static ComplexDoubleMatrix gemm(ComplexDouble alpha, ComplexDoubleMatrix a, ComplexDoubleMatrix b, ComplexDouble beta, ComplexDoubleMatrix c)
           
static ComplexFloatMatrix gemm(ComplexFloat alpha, ComplexFloatMatrix a, ComplexFloatMatrix b, ComplexFloat beta, ComplexFloatMatrix c)
           
static DoubleMatrix gemm(double alpha, DoubleMatrix a, DoubleMatrix b, double beta, DoubleMatrix c)
          Compute c <- a*b + beta * c (general matrix matrix multiplication)
static FloatMatrix gemm(float alpha, FloatMatrix a, FloatMatrix b, float beta, FloatMatrix c)
          Compute c <- a*b + beta * c (general matrix matrix multiplication)
static DoubleMatrix gemv(double alpha, DoubleMatrix a, DoubleMatrix x, double beta, DoubleMatrix y)
          Compute y <- alpha*op(a)*x + beta * y (general matrix vector multiplication)
static FloatMatrix gemv(float alpha, FloatMatrix a, FloatMatrix x, float beta, FloatMatrix y)
          Compute y <- alpha*op(a)*x + beta * y (general matrix vector multiplication)
static DoubleMatrix ger(double alpha, DoubleMatrix x, DoubleMatrix y, DoubleMatrix a)
          Compute A <- alpha * x * y^T + A (general rank-1 update)
static FloatMatrix ger(float alpha, FloatMatrix x, FloatMatrix y, FloatMatrix a)
          Compute A <- alpha * x * y^T + A (general rank-1 update)
static ComplexDoubleMatrix gerc(ComplexDouble alpha, ComplexDoubleMatrix x, ComplexDoubleMatrix y, ComplexDoubleMatrix a)
          Compute A <- alpha * x * y^H + A (general rank-1 update)
static ComplexFloatMatrix gerc(ComplexFloat alpha, ComplexFloatMatrix x, ComplexFloatMatrix y, ComplexFloatMatrix a)
          Compute A <- alpha * x * y^H + A (general rank-1 update)
static ComplexDoubleMatrix geru(ComplexDouble alpha, ComplexDoubleMatrix x, ComplexDoubleMatrix y, ComplexDoubleMatrix a)
          Compute A <- alpha * x * y^T + A (general rank-1 update)
static ComplexFloatMatrix geru(ComplexFloat alpha, ComplexFloatMatrix x, ComplexFloatMatrix y, ComplexFloatMatrix a)
          Compute A <- alpha * x * y^T + A (general rank-1 update)
static DoubleMatrix gesv(DoubleMatrix a, int[] ipiv, DoubleMatrix b)
          LAPACK
static FloatMatrix gesv(FloatMatrix a, int[] ipiv, FloatMatrix b)
          LAPACK
static int iamax(ComplexDoubleMatrix x)
           
static int iamax(ComplexFloatMatrix x)
           
static int iamax(DoubleMatrix x)
          Compute index of element with largest absolute value (index of absolute value maximum)
static int iamax(FloatMatrix x)
          Compute index of element with largest absolute value (index of absolute value maximum)
static double nrm2(ComplexDoubleMatrix x)
           
static float nrm2(ComplexFloatMatrix x)
           
static double nrm2(DoubleMatrix x)
          Compute || x ||_2 (2-norm)
static float nrm2(FloatMatrix x)
          Compute || x ||_2 (2-norm)
static void posv(char uplo, DoubleMatrix A, DoubleMatrix B)
           
static void posv(char uplo, FloatMatrix A, FloatMatrix B)
           
static ComplexDoubleMatrix scal(ComplexDouble alpha, ComplexDoubleMatrix x)
           
static ComplexFloatMatrix scal(ComplexFloat alpha, ComplexFloatMatrix x)
           
static DoubleMatrix scal(double alpha, DoubleMatrix x)
          Compute x <- alpha * x (scale a matrix)
static FloatMatrix scal(float alpha, FloatMatrix x)
          Compute x <- alpha * x (scale a matrix)
static DoubleMatrix swap(DoubleMatrix x, DoubleMatrix y)
          Compute x <-> y (swap two matrices)
static FloatMatrix swap(FloatMatrix x, FloatMatrix y)
          Compute x <-> y (swap two matrices)
static int syev(char jobz, char uplo, DoubleMatrix a, DoubleMatrix w)
           
static int syev(char jobz, char uplo, FloatMatrix a, FloatMatrix w)
           
static int syevd(char jobz, char uplo, DoubleMatrix A, DoubleMatrix w)
           
static int syevd(char jobz, char uplo, FloatMatrix A, FloatMatrix w)
           
static int syevr(char jobz, char range, char uplo, DoubleMatrix a, double vl, double vu, int il, int iu, double abstol, DoubleMatrix w, DoubleMatrix z, int[] isuppz)
           
static int syevr(char jobz, char range, char uplo, FloatMatrix a, float vl, float vu, int il, int iu, float abstol, FloatMatrix w, FloatMatrix z, int[] isuppz)
           
static int syevx(char jobz, char range, char uplo, DoubleMatrix a, double vl, double vu, int il, int iu, double abstol, DoubleMatrix w, DoubleMatrix z)
           
static int syevx(char jobz, char range, char uplo, FloatMatrix a, float vl, float vu, int il, int iu, float abstol, FloatMatrix w, FloatMatrix z)
           
static DoubleMatrix sysv(char uplo, DoubleMatrix a, int[] ipiv, DoubleMatrix b)
           
static FloatMatrix sysv(char uplo, FloatMatrix a, int[] ipiv, FloatMatrix b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleBlas

public SimpleBlas()
Method Detail

swap

public static DoubleMatrix swap(DoubleMatrix x,
                                DoubleMatrix y)
Compute x <-> y (swap two matrices)


scal

public static DoubleMatrix scal(double alpha,
                                DoubleMatrix x)
Compute x <- alpha * x (scale a matrix)


scal

public static ComplexDoubleMatrix scal(ComplexDouble alpha,
                                       ComplexDoubleMatrix x)

copy

public static DoubleMatrix copy(DoubleMatrix x,
                                DoubleMatrix y)
Compute y <- x (copy a matrix)


copy

public static ComplexDoubleMatrix copy(ComplexDoubleMatrix x,
                                       ComplexDoubleMatrix y)

axpy

public static DoubleMatrix axpy(double da,
                                DoubleMatrix dx,
                                DoubleMatrix dy)
Compute y <- alpha * x + y (elementwise addition)


axpy

public static ComplexDoubleMatrix axpy(ComplexDouble da,
                                       ComplexDoubleMatrix dx,
                                       ComplexDoubleMatrix dy)

dot

public static double dot(DoubleMatrix x,
                         DoubleMatrix y)
Compute x^T * y (dot product)


dotc

public static ComplexDouble dotc(ComplexDoubleMatrix x,
                                 ComplexDoubleMatrix y)
Compute x^T * y (dot product)


dotu

public static ComplexDouble dotu(ComplexDoubleMatrix x,
                                 ComplexDoubleMatrix y)
Compute x^T * y (dot product)


nrm2

public static double nrm2(DoubleMatrix x)
Compute || x ||_2 (2-norm)


nrm2

public static double nrm2(ComplexDoubleMatrix x)

asum

public static double asum(DoubleMatrix x)
Compute || x ||_1 (1-norm, sum of absolute values)


asum

public static double asum(ComplexDoubleMatrix x)

iamax

public static int iamax(DoubleMatrix x)
Compute index of element with largest absolute value (index of absolute value maximum)


iamax

public static int iamax(ComplexDoubleMatrix x)

gemv

public static DoubleMatrix gemv(double alpha,
                                DoubleMatrix a,
                                DoubleMatrix x,
                                double beta,
                                DoubleMatrix y)
Compute y <- alpha*op(a)*x + beta * y (general matrix vector multiplication)


ger

public static DoubleMatrix ger(double alpha,
                               DoubleMatrix x,
                               DoubleMatrix y,
                               DoubleMatrix a)
Compute A <- alpha * x * y^T + A (general rank-1 update)


geru

public static ComplexDoubleMatrix geru(ComplexDouble alpha,
                                       ComplexDoubleMatrix x,
                                       ComplexDoubleMatrix y,
                                       ComplexDoubleMatrix a)
Compute A <- alpha * x * y^T + A (general rank-1 update)


gerc

public static ComplexDoubleMatrix gerc(ComplexDouble alpha,
                                       ComplexDoubleMatrix x,
                                       ComplexDoubleMatrix y,
                                       ComplexDoubleMatrix a)
Compute A <- alpha * x * y^H + A (general rank-1 update)


gemm

public static DoubleMatrix gemm(double alpha,
                                DoubleMatrix a,
                                DoubleMatrix b,
                                double beta,
                                DoubleMatrix c)
Compute c <- a*b + beta * c (general matrix matrix multiplication)


gemm

public static ComplexDoubleMatrix gemm(ComplexDouble alpha,
                                       ComplexDoubleMatrix a,
                                       ComplexDoubleMatrix b,
                                       ComplexDouble beta,
                                       ComplexDoubleMatrix c)

gesv

public static DoubleMatrix gesv(DoubleMatrix a,
                                int[] ipiv,
                                DoubleMatrix b)
LAPACK


sysv

public static DoubleMatrix sysv(char uplo,
                                DoubleMatrix a,
                                int[] ipiv,
                                DoubleMatrix b)

syev

public static int syev(char jobz,
                       char uplo,
                       DoubleMatrix a,
                       DoubleMatrix w)

syevx

public static int syevx(char jobz,
                        char range,
                        char uplo,
                        DoubleMatrix a,
                        double vl,
                        double vu,
                        int il,
                        int iu,
                        double abstol,
                        DoubleMatrix w,
                        DoubleMatrix z)

syevd

public static int syevd(char jobz,
                        char uplo,
                        DoubleMatrix A,
                        DoubleMatrix w)

syevr

public static int syevr(char jobz,
                        char range,
                        char uplo,
                        DoubleMatrix a,
                        double vl,
                        double vu,
                        int il,
                        int iu,
                        double abstol,
                        DoubleMatrix w,
                        DoubleMatrix z,
                        int[] isuppz)

posv

public static void posv(char uplo,
                        DoubleMatrix A,
                        DoubleMatrix B)

geev

public static int geev(char jobvl,
                       char jobvr,
                       DoubleMatrix A,
                       DoubleMatrix WR,
                       DoubleMatrix WI,
                       DoubleMatrix VL,
                       DoubleMatrix VR)

swap

public static FloatMatrix swap(FloatMatrix x,
                               FloatMatrix y)
Compute x <-> y (swap two matrices)


scal

public static FloatMatrix scal(float alpha,
                               FloatMatrix x)
Compute x <- alpha * x (scale a matrix)


scal

public static ComplexFloatMatrix scal(ComplexFloat alpha,
                                      ComplexFloatMatrix x)

copy

public static FloatMatrix copy(FloatMatrix x,
                               FloatMatrix y)
Compute y <- x (copy a matrix)


copy

public static ComplexFloatMatrix copy(ComplexFloatMatrix x,
                                      ComplexFloatMatrix y)

axpy

public static FloatMatrix axpy(float da,
                               FloatMatrix dx,
                               FloatMatrix dy)
Compute y <- alpha * x + y (elementwise addition)


axpy

public static ComplexFloatMatrix axpy(ComplexFloat da,
                                      ComplexFloatMatrix dx,
                                      ComplexFloatMatrix dy)

dot

public static float dot(FloatMatrix x,
                        FloatMatrix y)
Compute x^T * y (dot product)


dotc

public static ComplexFloat dotc(ComplexFloatMatrix x,
                                ComplexFloatMatrix y)
Compute x^T * y (dot product)


dotu

public static ComplexFloat dotu(ComplexFloatMatrix x,
                                ComplexFloatMatrix y)
Compute x^T * y (dot product)


nrm2

public static float nrm2(FloatMatrix x)
Compute || x ||_2 (2-norm)


nrm2

public static float nrm2(ComplexFloatMatrix x)

asum

public static float asum(FloatMatrix x)
Compute || x ||_1 (1-norm, sum of absolute values)


asum

public static float asum(ComplexFloatMatrix x)

iamax

public static int iamax(FloatMatrix x)
Compute index of element with largest absolute value (index of absolute value maximum)


iamax

public static int iamax(ComplexFloatMatrix x)

gemv

public static FloatMatrix gemv(float alpha,
                               FloatMatrix a,
                               FloatMatrix x,
                               float beta,
                               FloatMatrix y)
Compute y <- alpha*op(a)*x + beta * y (general matrix vector multiplication)


ger

public static FloatMatrix ger(float alpha,
                              FloatMatrix x,
                              FloatMatrix y,
                              FloatMatrix a)
Compute A <- alpha * x * y^T + A (general rank-1 update)


geru

public static ComplexFloatMatrix geru(ComplexFloat alpha,
                                      ComplexFloatMatrix x,
                                      ComplexFloatMatrix y,
                                      ComplexFloatMatrix a)
Compute A <- alpha * x * y^T + A (general rank-1 update)


gerc

public static ComplexFloatMatrix gerc(ComplexFloat alpha,
                                      ComplexFloatMatrix x,
                                      ComplexFloatMatrix y,
                                      ComplexFloatMatrix a)
Compute A <- alpha * x * y^H + A (general rank-1 update)


gemm

public static FloatMatrix gemm(float alpha,
                               FloatMatrix a,
                               FloatMatrix b,
                               float beta,
                               FloatMatrix c)
Compute c <- a*b + beta * c (general matrix matrix multiplication)


gemm

public static ComplexFloatMatrix gemm(ComplexFloat alpha,
                                      ComplexFloatMatrix a,
                                      ComplexFloatMatrix b,
                                      ComplexFloat beta,
                                      ComplexFloatMatrix c)

gesv

public static FloatMatrix gesv(FloatMatrix a,
                               int[] ipiv,
                               FloatMatrix b)
LAPACK


sysv

public static FloatMatrix sysv(char uplo,
                               FloatMatrix a,
                               int[] ipiv,
                               FloatMatrix b)

syev

public static int syev(char jobz,
                       char uplo,
                       FloatMatrix a,
                       FloatMatrix w)

syevx

public static int syevx(char jobz,
                        char range,
                        char uplo,
                        FloatMatrix a,
                        float vl,
                        float vu,
                        int il,
                        int iu,
                        float abstol,
                        FloatMatrix w,
                        FloatMatrix z)

syevd

public static int syevd(char jobz,
                        char uplo,
                        FloatMatrix A,
                        FloatMatrix w)

syevr

public static int syevr(char jobz,
                        char range,
                        char uplo,
                        FloatMatrix a,
                        float vl,
                        float vu,
                        int il,
                        int iu,
                        float abstol,
                        FloatMatrix w,
                        FloatMatrix z,
                        int[] isuppz)

posv

public static void posv(char uplo,
                        FloatMatrix A,
                        FloatMatrix B)

geev

public static int geev(char jobvl,
                       char jobvr,
                       FloatMatrix A,
                       FloatMatrix WR,
                       FloatMatrix WI,
                       FloatMatrix VL,
                       FloatMatrix VR)


written by Mikio L. Braun and Johannes Schaback