next up previous contents index
Next: Interface print Up: Module linearalgebra_module Previous: Interface sign   Contents   Index

Interface diag


\begin{boxedminipage}{\textwidth}
\begin{verbatim}matrix = diag(vect)
vect = diag(matrix)\end{verbatim}
\end{boxedminipage}

Construct a diagonal matrix from a vector, or extract the diagonal elements of a matrix and return them as a vector.

vect -- intent(in), dimension(:), real(dp) or complex(dp)

matrix -- intent(in), dimension(:,:), real(dp) or complex(dp)

Return values:

m1 -- real(dp), dimension(size(vect),size(vect))
m2 -- complex(dp), dimension(size(vect),size(vect))
v3 -- real(dp), dimension(size(matrix,1))
v4 -- complex(dp), dimension(size(matrix,1))
print interface

gabor 2009-06-30