How to extract the upper triangular matrix w or w/o diagonal in Chapel -
the best stories start matrix a
.
var a: [{1..4,1..4}] real = ( (4, -30, 60, -35), (-30, 300, -675, 420), (60, -675, 1620, -1050), (-35, 420, -1050, 700) );
i recall somewhere can upper triangle, can't find in chapel docs can set in/exclude diagonal?
using linearalgebra
library:
use linearalgebra; var a: [{1..4,1..4}] real = ( (4, -30, 60, -35), (-30, 300, -675, 420), (60, -675, 1620, -1050), (-35, 420, -1050, 700) ); var uppertriangle = triu(a); // confirm worked writeln(istriu(uppertriangle));
Comments
Post a Comment