3.2 Level 1 BLAS

The level 1 functions implement vector operations.

scal(alpha, x)

Scales a vector by a constant:

x := αx.

If x is a real matrix, the scalar argument alpha must be a Python integer or float. If x is complex, alpha can be an integer, float, or complex.

nrm2(x)

Euclidean norm of a vector: returns

∥x∥2.

asum(x)

1-Norm of a vector: returns

∥x∥1  (x real),    ∥ℜx ∥1 + ∥ℑx∥1  (x complex).

iamax(x)

Returns

 argmax  |xk|  (x real),    argmax  |ℜxk |+ |ℑxk|  (x complex).
k=0,...,n- 1                k=0,...,n- 1

If more than one coefficient achieves the maximum, the index of the first k is returned.

swap(x, y)

Interchanges two vectors:

x ↔ y.

x and y are matrices of the same type (’d’ or ’z’).

copy(x, y)

Copies a vector to another vector:

y := x.

x and y are matrices of the same type (’d’ or ’z’).

axpy(x, y[,alpha=1.0])

Constant times a vector plus a vector:

y := αx + y.

x and y are matrices of the same type (’d’ or ’z’). If x is real, the scalar argument alpha must be a Python integer or float. If x is complex, alpha can be an integer, float, or complex.

dot(x, y)

Returns

xHy.

x and y are matrices of the same type (’d’ or ’z’).

dotu(x, y)

Returns

xT y.

x and y are matrices of the same type (’d’ or ’z’).