Harald Schilly wrote: > On Jun 19, 12:50 pm, Pierre <[email protected]> wrote: >> i know numpy does it, so is it there for sage matrices also ? > > i don't think so, how is the numpy syntax? I think this should be an > enhancement to Sage's "sage.matrix.constructor.diagonal_matrix" > function, introducing an "offset" parameter.
+1. That would make it more consistent with matlab too: diag (diagonal, offset). The same syntax works for numpy. I think William's solution is the easiest for now, unless you just want to write the short function to do it. If someone wants to modify diagonal_matrix, and wants a little more ambitious project, they might work on #5110, which is basically pointing to a rewrite of diagonal_matrix at #3704 that languished and was never applied. Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
