Level 1 BLAS-like Vector Operations APIs#

LACGV#

group lacgv

Functions

template<typename T>
void lacgv(integer *n, T *x, integer *incx)#

LACGV conjugates a complex vector.

Purpose:

 CLACGV conjugates a complex vector of length N.

Parameters:
  • N – [in]

    N is INTEGER

    The length of the vector X. N >= 0.

  • X – [inout]

    X is COMPLEX array, dimension (1+(N-1)*abs(INCX))

    On entry, the vector of length N to be conjugated. On exit, X is overwritten with conjg(X).

  • INCX – [in]

    INCX is INTEGER

    The spacing between successive elements of X.

LASRT#

group lasrt

Functions

template<typename T>
void lasrt(char *id, integer *n, T *d, integer *info)#

LASRT sorts numbers in increasing or decreasing order.

Purpose:

  Sort the numbers in D in increasing order (if ID = 'I') or
  in decreasing order (if ID = 'D').

  Use Quick Sort, reverting to Insertion sort on arrays of
  size <= 20. Dimension of STACK limits N to about 2**32.

Parameters:
  • ID – [in]

    ID is CHARACTER*1

    = ‘I’: sort D in increasing order;

    = ‘D’: sort D in decreasing order.

  • N – [in]

    N is INTEGER

    The length of the array D.

  • D – [inout]

    D is REAL array, dimension (N)

    On entry, the array to be sorted.

    On exit, D has been sorted into increasing order

    (D(1) <= … <= D(N)) or into decreasing order

    (D(1) >= … >= D(N)), depending on ID.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

LASSQ#

group lassq

Functions

template<typename T>
void lassq(integer *n, T *x, integer *incx, T *scale, T *sumsq)#

LASSQ updates a sum of squares represented in scaled form.

Purpose:

  LASSQ  returns the values  scl  and  smsq  such that

     ( scl**2)*smsq = x( 1)**2 +...+ x( n)**2 + ( scale**2)*sumsq,

  where  x( i) = X( 1 + ( i - 1)*INCX). The value of  sumsq  is
  assumed to be non-negative and  scl  returns the value

     scl = fla_max( scale, abs( x( i))).

  scale and sumsq must be supplied in SCALE and SUMSQ and
  scl and smsq are overwritten on SCALE and SUMSQ respectively.

  The routine makes only one pass through the vector x.

Parameters:
  • N – [in]

    N is INTEGER

    The number of elements to be used from the vector X.

  • X – [in]

    X is REAL array, dimension (1+(N-1)*INCX)

    The vector for which a scaled sum of squares is computed.

    x( i) = X( 1 + ( i - 1)*INCX), 1 <= i <= n.

  • INCX – [in]

    INCX is INTEGER

    The increment between successive values of the vector X. INCX > 0.

  • SCALE – [inout]

    SCALE is REAL

    On entry, the value scale in the equation above.

    On exit, SCALE is overwritten with scl , the scaling factor for the sum of squares.

  • SUMSQ – [inout]

    SUMSQ is REAL

    On entry, the value sumsq in the equation above.

    On exit, SUMSQ is overwritten with smsq , the basic sum of squares from which scl has been factored out.

template<typename T, typename Ta>
void lassq(integer *n, T *x, integer *incx, Ta *scale, Ta *sumsq)#

RSCL#

group rscl

Functions

template<typename T>
void rscl(integer *n, T *sa, T *sx, integer *incx)#

RSCL multiplies a vector by the reciprocal of a real scalar.

Purpose:

 RSCL multiplies an n-element real vector x by the real scalar 1/a.
 This is done without overflow or underflow as long as
 the final result x/a does not overflow or underflow.

Parameters:
  • N – [in]

    N is INTEGER

    The number of components of the vector x.

  • SA – [in]

    SA is REAL

    The scalar a which is used to divide each component of x. SA must be >= 0, or the subroutine will divide by zero.

  • SX – [inout]

    SX is REAL array, dimension (1+(N-1)*abs(INCX))

    The n-element vector x.

  • INCX – [in]

    INCX is INTEGER

    The increment between successive values of the vector SX.

    > 0: SX(1) = X(1) and SX(1+(i-1)*INCX) = x(i), 1< i<= n

template<typename T, typename Ta>
void rscl(integer *n, Ta *sa, T *sx, integer *incx)#