3.2 Level 1 BLAS

The level 1 functions implement vector operations.

scal( alpha, x)
Scales a vector by a constant:

\begin{displaymath}
x := \alpha x.
\end{displaymath}

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

\begin{displaymath}
\Vert x\Vert _2.
\end{displaymath}

asum( x)
L-1 norm of a vector: returns

\begin{displaymath}
\Vert x\Vert _1 \quad \mbox{($x$\ real)}, \qquad
\Vert\Re x\Vert _1 + \Vert\Im x\Vert _1 \quad \mbox{($x$\ complex)}.
\end{displaymath}

iamax( x)
Returns

\begin{displaymath}
\mathop{\rm argmax}_{k=0,\ldots,n-1} \vert x_k\vert \quad \...
...e x_k\vert + \vert\Im x_k\vert \quad
\mbox{($x$\ complex)}.
\end{displaymath}

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

swap( x, y)
Interchanges two vectors:

\begin{displaymath}
x \leftrightarrow y.
\end{displaymath}

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

copy( x, y)
Copies a vector to another vector:

\begin{displaymath}
y := x.
\end{displaymath}

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:

\begin{displaymath}
y := \alpha x + y.
\end{displaymath}

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

\begin{displaymath}
x^Hy.
\end{displaymath}

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

dotu( x, y)
Returns

\begin{displaymath}
x^Ty.
\end{displaymath}

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