Man pages sections > man4 > diag

diag - get diagonal part of a matrix

diag(4rheolef) rheolef-6.7 diag(4rheolef)

NAME

diag - get diagonal part of a matrix

DESCRIPTION

This function get the diagonal part of a matrix.
 
        csr<Float> a;
        dia<Float> d = diag(a);
 

TODO

Build a csr matrix from a diagonal one or from a vector:
 
        dia<Float> d;
        csr<Float> a = diag(d);
        vec<Float> u;
        csr<Float> b = diag(u);
 

IMPLEMENTATION

template<class T, class M>
dia<T,M> diag (const csr<T,M>& a)
 
rheolef-6.7 rheolef-6.7