JuliaLang/julia — pull request #4547 by cfbaptista (2013-10-17 03:02:12+00:00)
Title: Extension of spdiagm for the specification of multiple diagonals

On request by Viral B. Shah I open this pull request to extend `spdiagm`.

`Tridiagonal` allows you to specify three diagonals. `spdiagm` previously allowed you to specify one diagonal. Now with this extension an arbitrary number of diagonals can be specified.

All the specified diagonals must be packed into a tuple and is passed as the first argument. The second argument is a vector containing the corresponding offsets w.r.t. the main diagonal. The last two arguments define the shape of the matrix to be created.