drasys.or.linear.blas
Interface BLAS1I

All Known Implementing Classes:
SmpBLAS1, BLAS1

public interface BLAS1I

Defines an array based BLAS1 for Java. 'BLAS1' operates on Java arrays and supports sub-vectors which allows it to work with both '0' and '1' based indexing. The arrays containing complex elements store each complex element in two adjacent array positions. The real component has the even index and the imaginary component has the next higher index. The 'beg*' and 'inc*' arguments to the complex methods specify the logical index of the complex element, these are multiplied by two internally to obtain the offset into the array.

See Also:
DenseVector, RowMajorMatrix, ColumnMajorMatrix, RowArrayMatrix, ColumnArrayMatrix, DenseVector, RowMajorMatrix,

References:

Linear Algebra and Its Applications
    Gilbert Strang / Hardcover / Published 1988
Matrix Computations (Johns Hopkins Studies in the Mathematical Sciences)
    Gene H. Golub, Charles F. Van Loan (Contributor) / Paperback / Published 1996
Numerical Recipes in C : The Art of Scientific Computing
    William H. Press, et al / Hardcover / Published 1993


Method Summary
 void caxpy(int n, ComplexI alpha, float[] x, int begx, int incx, float[] y, int begy, int incy)
          Constant times a vector plus a vector: y = y + alpha * x.
 void ccopy(int n, float[] x, int begx, int incx, float[] y, int begy, int incy)
          Copies vector x to vector y: y = x.
 Complex cdotc(int n, float[] x, int begx, int incx, float[] y, int begy, int incy, Complex results)
          Computes the dot product of two vectors: alpha = x (.) y.
 Complex cdotu(int n, float[] x, int begx, int incx, float[] y, int begy, int incy, Complex results)
          Computes the dot product of two vectors: alpha = x (.) y.
 void cscal(int n, ComplexI alpha, float[] x, int begx, int incx)
          Scale a vector by a constant: x = alpha * x.
 void csscal(int n, float alpha, float[] x, int begx, int incx)
          Scale a vector by a constant: x = alpha * x.
 void cswap(int n, float[] x, int begx, int incx, float[] y, int begy, int incy)
          Interchange two vectors: x <-> y.
 double dasum(int n, double[] x, int begx, int incx)
          Computes the sum of the absolute values.
 void daxpy(int n, double alpha, double[] x, int begx, int incx, double[] y, int begy, int incy)
          Constant times a vector plus a vector: y = y + alpha * x.
 void dcopy(int n, double[] x, int begx, int incx, double[] y, int begy, int incy)
          Copies vector x to vector y: y = x.
 double ddot(int n, double[] x, int begx, int incx, double[] y, int begy, int incy)
          Computes the dot product of two vectors: alpha = x (.) y.
 double dnrm2(int n, double[] x, int begx, int incx)
          Computes the euclidean norm of the vector: sqrt(sum(xi^2))
 void drot(int n, double[] x, int begx, int incx, double[] y, int begy, int incy, double cos, double sin)
          Applies a plane rotation: x = cos*x + sin*y & y = cos*y + sin*x
 void drotg(Real da, Real db, Real cos, Real sin)
          Generates the parmseters cos and sin for a plane rotation.
 void dscal(int n, double alpha, double[] x, int begx, int incx)
          Scale a vector by a constant: x = alpha * x.
 double dsdot(int n, float[] x, int begx, int incx, float[] y, int begy, int incy)
          Computes the sum of the absolute values.
 void dswap(int n, double[] x, int begx, int incx, double[] y, int begy, int incy)
          Interchange two vectors: x <-> y.
 double dzasum(int n, double[] x, int begx, int incx)
          Computes the sum of the absolute values.
 double dznrm2(int n, double[] x, int begx, int incx)
          Computes the euclidean norm of the vector: sqrt(sum(xi^2))
 int icamax(int n, float[] x, int begx, int incx)
          Finds the index of the element with the maximum absolute value.
 int idamax(int n, double[] x, int begx, int incx)
          Finds the index of the element with the maximum absolute value.
 int isamax(int n, float[] x, int begx, int incx)
          Finds the index of the element with the maximum absolute value.
 int izamax(int n, double[] x, int begx, int incx)
          Finds the index of the element with the maximum absolute value.
 float sasum(int n, float[] x, int begx, int incx)
          Computes the sum of the absolute values.
 void saxpy(int n, float alpha, float[] x, int begx, int incx, float[] y, int begy, int incy)
          Constant times a vector plus a vector: y = y + alpha * x.
 float scasum(int n, float[] x, int begx, int incx)
          Computes the sum of the absolute values.
 float scnrm2(int n, float[] x, int begx, int incx)
          Computes the euclidean norm of the vector: sqrt(sum(xi^2))
 void scopy(int n, float[] x, int begx, int incx, float[] y, int begy, int incy)
          Copies vector x to vector y: y = x.
 float sdot(int n, float[] x, int begx, int incx, float[] y, int begy, int incy)
          Computes the dot product of two vectors: alpha = x (.) y.
 float sdsdot(int n, float[] x, int begx, int incx, float[] y, int begy, int incy)
          Computes the dot product of two vectors: alpha = x (.) y.
 float snrm2(int n, float[] x, int begx, int incx)
          Computes the euclidean norm of the vector: sqrt(sum(xi^2))
 void srot(int n, float[] x, int begx, int incx, float[] y, int begy, int incy, float cos, float sin)
          Applies a plane rotation: x = cos*x + sin*y & y = cos*y + sin*x
 void srotg(Real da, Real db, Real cos, Real sin)
          Generates the parmseters cos and sin for a plane rotation.
 void sscal(int n, float alpha, float[] x, int begx, int incx)
          Scale a vector by a constant: x = alpha * x.
 void sswap(int n, float[] x, int begx, int incx, float[] y, int begy, int incy)
          Interchange two vectors: x <-> y.
 void zaxpy(int n, ComplexI alpha, double[] x, int begx, int incx, double[] y, int begy, int incy)
          Constant times a vector plus a vector: y = y + alpha * x.
 void zcopy(int n, double[] x, int begx, int incx, double[] y, int begy, int incy)
          Copies vector x to vector y: y = x.
 Complex zdotc(int n, double[] x, int begx, int incx, double[] y, int begy, int incy, Complex results)
          Computes the dot product of two vectors: alpha = x (.) y.
 Complex zdotu(int n, double[] x, int begx, int incx, double[] y, int begy, int incy, Complex results)
          Computes the dot product of two vectors: alpha = x (.) y.
 void zdscal(int n, double alpha, double[] x, int begx, int incx)
          Scale a vector by a constant: x = alpha * x.
 void zscal(int n, ComplexI alpha, double[] x, int begx, int incx)
          Scale a vector by a constant: x = alpha * x.
 void zswap(int n, double[] x, int begx, int incx, double[] y, int begy, int incy)
          Interchange two vectors: x <-> y.
 

Method Detail

dasum

public double dasum(int n,
                    double[] x,
                    int begx,
                    int incx)
             throws BlasException
Computes the sum of the absolute values.
Parameters:
n - number of vector element
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

daxpy

public void daxpy(int n,
                  double alpha,
                  double[] x,
                  int begx,
                  int incx,
                  double[] y,
                  int begy,
                  int incy)
           throws BlasException
Constant times a vector plus a vector: y = y + alpha * x.
Parameters:
n - number of vector elements
alpha - constant multiplier of 'x'.
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

dcopy

public void dcopy(int n,
                  double[] x,
                  int begx,
                  int incx,
                  double[] y,
                  int begy,
                  int incy)
           throws BlasException
Copies vector x to vector y: y = x.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

ddot

public double ddot(int n,
                   double[] x,
                   int begx,
                   int incx,
                   double[] y,
                   int begy,
                   int incy)
            throws BlasException
Computes the dot product of two vectors: alpha = x (.) y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

drot

public void drot(int n,
                 double[] x,
                 int begx,
                 int incx,
                 double[] y,
                 int begy,
                 int incy,
                 double cos,
                 double sin)
          throws BlasException
Applies a plane rotation: x = cos*x + sin*y & y = cos*y + sin*x
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements
alpha - constant
beta - constant

dscal

public void dscal(int n,
                  double alpha,
                  double[] x,
                  int begx,
                  int incx)
           throws BlasException
Scale a vector by a constant: x = alpha * x.
Parameters:
n - number of vector elements
alpha - scale factor
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

dswap

public void dswap(int n,
                  double[] x,
                  int begx,
                  int incx,
                  double[] y,
                  int begy,
                  int incy)
           throws BlasException
Interchange two vectors: x <-> y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

dnrm2

public double dnrm2(int n,
                    double[] x,
                    int begx,
                    int incx)
             throws BlasException
Computes the euclidean norm of the vector: sqrt(sum(xi^2))
Parameters:
n - number of vector elements
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

idamax

public int idamax(int n,
                  double[] x,
                  int begx,
                  int incx)
           throws BlasException
Finds the index of the element with the maximum absolute value.
Parameters:
n - number of vector elements
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

sasum

public float sasum(int n,
                   float[] x,
                   int begx,
                   int incx)
            throws BlasException
Computes the sum of the absolute values.
Parameters:
n - number of vector element
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

saxpy

public void saxpy(int n,
                  float alpha,
                  float[] x,
                  int begx,
                  int incx,
                  float[] y,
                  int begy,
                  int incy)
           throws BlasException
Constant times a vector plus a vector: y = y + alpha * x.
Parameters:
n - number of vector elements
alpha - constant multiplier of 'x'.
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

scopy

public void scopy(int n,
                  float[] x,
                  int begx,
                  int incx,
                  float[] y,
                  int begy,
                  int incy)
           throws BlasException
Copies vector x to vector y: y = x.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

sdot

public float sdot(int n,
                  float[] x,
                  int begx,
                  int incx,
                  float[] y,
                  int begy,
                  int incy)
           throws BlasException
Computes the dot product of two vectors: alpha = x (.) y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

srot

public void srot(int n,
                 float[] x,
                 int begx,
                 int incx,
                 float[] y,
                 int begy,
                 int incy,
                 float cos,
                 float sin)
          throws BlasException
Applies a plane rotation: x = cos*x + sin*y & y = cos*y + sin*x
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements
alpha - constant
beta - constant

sscal

public void sscal(int n,
                  float alpha,
                  float[] x,
                  int begx,
                  int incx)
           throws BlasException
Scale a vector by a constant: x = alpha * x.
Parameters:
n - number of vector elements
alpha - scale factor
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

sswap

public void sswap(int n,
                  float[] x,
                  int begx,
                  int incx,
                  float[] y,
                  int begy,
                  int incy)
           throws BlasException
Interchange two vectors: x <-> y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

snrm2

public float snrm2(int n,
                   float[] x,
                   int begx,
                   int incx)
            throws BlasException
Computes the euclidean norm of the vector: sqrt(sum(xi^2))
Parameters:
n - number of vector elements
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

isamax

public int isamax(int n,
                  float[] x,
                  int begx,
                  int incx)
           throws BlasException
Finds the index of the element with the maximum absolute value.
Parameters:
n - number of vector elements
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

dzasum

public double dzasum(int n,
                     double[] x,
                     int begx,
                     int incx)
              throws BlasException
Computes the sum of the absolute values.
Parameters:
n - number of vector element
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

zaxpy

public void zaxpy(int n,
                  ComplexI alpha,
                  double[] x,
                  int begx,
                  int incx,
                  double[] y,
                  int begy,
                  int incy)
           throws BlasException
Constant times a vector plus a vector: y = y + alpha * x.
Parameters:
n - number of vector elements
alpha - constant multiplier of 'x'.
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

zcopy

public void zcopy(int n,
                  double[] x,
                  int begx,
                  int incx,
                  double[] y,
                  int begy,
                  int incy)
           throws BlasException
Copies vector x to vector y: y = x.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

zdotu

public Complex zdotu(int n,
                     double[] x,
                     int begx,
                     int incx,
                     double[] y,
                     int begy,
                     int incy,
                     Complex results)
              throws BlasException
Computes the dot product of two vectors: alpha = x (.) y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

zdotc

public Complex zdotc(int n,
                     double[] x,
                     int begx,
                     int incx,
                     double[] y,
                     int begy,
                     int incy,
                     Complex results)
              throws BlasException
Computes the dot product of two vectors: alpha = x (.) y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

zscal

public void zscal(int n,
                  ComplexI alpha,
                  double[] x,
                  int begx,
                  int incx)
           throws BlasException
Scale a vector by a constant: x = alpha * x.
Parameters:
n - number of vector elements
alpha - scale factor
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

zswap

public void zswap(int n,
                  double[] x,
                  int begx,
                  int incx,
                  double[] y,
                  int begy,
                  int incy)
           throws BlasException
Interchange two vectors: x <-> y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

scasum

public float scasum(int n,
                    float[] x,
                    int begx,
                    int incx)
             throws BlasException
Computes the sum of the absolute values.
Parameters:
n - number of vector element
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

caxpy

public void caxpy(int n,
                  ComplexI alpha,
                  float[] x,
                  int begx,
                  int incx,
                  float[] y,
                  int begy,
                  int incy)
           throws BlasException
Constant times a vector plus a vector: y = y + alpha * x.
Parameters:
n - number of vector elements
alpha - constant multiplier of 'x'.
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

ccopy

public void ccopy(int n,
                  float[] x,
                  int begx,
                  int incx,
                  float[] y,
                  int begy,
                  int incy)
           throws BlasException
Copies vector x to vector y: y = x.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

cdotu

public Complex cdotu(int n,
                     float[] x,
                     int begx,
                     int incx,
                     float[] y,
                     int begy,
                     int incy,
                     Complex results)
              throws BlasException
Computes the dot product of two vectors: alpha = x (.) y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

cdotc

public Complex cdotc(int n,
                     float[] x,
                     int begx,
                     int incx,
                     float[] y,
                     int begy,
                     int incy,
                     Complex results)
              throws BlasException
Computes the dot product of two vectors: alpha = x (.) y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

cscal

public void cscal(int n,
                  ComplexI alpha,
                  float[] x,
                  int begx,
                  int incx)
           throws BlasException
Scale a vector by a constant: x = alpha * x.
Parameters:
n - number of vector elements
alpha - scale factor
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

cswap

public void cswap(int n,
                  float[] x,
                  int begx,
                  int incx,
                  float[] y,
                  int begy,
                  int incy)
           throws BlasException
Interchange two vectors: x <-> y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

dsdot

public double dsdot(int n,
                    float[] x,
                    int begx,
                    int incx,
                    float[] y,
                    int begy,
                    int incy)
             throws BlasException
Computes the sum of the absolute values.
Parameters:
n - number of vector element
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

sdsdot

public float sdsdot(int n,
                    float[] x,
                    int begx,
                    int incx,
                    float[] y,
                    int begy,
                    int incy)
             throws BlasException
Computes the dot product of two vectors: alpha = x (.) y.
Parameters:
n - number of vector elements
x - array containing the 'x' vector elements
begx - offset of the first 'x' vector element
incx - the distance between 'x' vector elements
y - array containing the 'y' vector elements
begy - offset of the first 'y' vector element
incy - the distance between 'y' vector elements

izamax

public int izamax(int n,
                  double[] x,
                  int begx,
                  int incx)
           throws BlasException
Finds the index of the element with the maximum absolute value.
Parameters:
n - number of vector elements
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

icamax

public int icamax(int n,
                  float[] x,
                  int begx,
                  int incx)
           throws BlasException
Finds the index of the element with the maximum absolute value.
Parameters:
n - number of vector elements
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

dznrm2

public double dznrm2(int n,
                     double[] x,
                     int begx,
                     int incx)
              throws BlasException
Computes the euclidean norm of the vector: sqrt(sum(xi^2))
Parameters:
n - number of vector elements
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

scnrm2

public float scnrm2(int n,
                    float[] x,
                    int begx,
                    int incx)
             throws BlasException
Computes the euclidean norm of the vector: sqrt(sum(xi^2))
Parameters:
n - number of vector elements
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

drotg

public void drotg(Real da,
                  Real db,
                  Real cos,
                  Real sin)
           throws BlasException
Generates the parmseters cos and sin for a plane rotation.
Parameters:
da -  
db -  
cos - cosine return value
sin - sine return value

srotg

public void srotg(Real da,
                  Real db,
                  Real cos,
                  Real sin)
           throws BlasException
Generates the parmseters cos and sin for a plane rotation.
Parameters:
da -  
db -  
cos - cosine return value
sin - sine return value

zdscal

public void zdscal(int n,
                   double alpha,
                   double[] x,
                   int begx,
                   int incx)
            throws BlasException
Scale a vector by a constant: x = alpha * x.
Parameters:
n - number of vector elements
alpha - scale factor
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements

csscal

public void csscal(int n,
                   float alpha,
                   float[] x,
                   int begx,
                   int incx)
            throws BlasException
Scale a vector by a constant: x = alpha * x.
Parameters:
n - number of vector elements
alpha - scale factor
x - array containing the vector elements
begx - offset of the first vector element
incx - the distance between vector elements


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com