Matrix.diag

get diagonal matrix, diagonal elements fills cyclically

only: if( (W==H && isStatic) || isDynamicOne )

struct Matrix(size_t H, size_t W, E)
pure static
static if((W == H && isStatic) || isDynamicOne)
diag
(
X...
)
(
in X vals
)
if (
X.length > 0 &&
is(typeof(E(0)))
&&
is(typeof(flatData!E(vals)))
)

Meta