ndarray-diagonal
Extract a view of the diagonal entries of an ndarray (no copying necessary!)
Example
var pack = var diagonal = var show = var M = var diag = console //diag is actually a view of the entries of M diag //Update the 3rd diagonal entryconsole
Output:
diag=
1.000 3.000 0.000
M=
1.000 2.000 4.000
0.000 3.000 5.000
2.000 1.000 1.00e+5
API
require('ndarray-diagonal')(M)
Construct a view of the diagonal entries of an ndarray
M
is an ndarray
Returns A view of the diagonal entries of M
Credits
(c) 2014 Mikola Lysenko. MIT License