LU decomposition: Difference between revisions

m
Fixed a small error in the pivotize code: initially would keep a zero on the main diagonal in favor of a negative number (I am not very familiar with D syntax but I believe this was done correctly)
m (Fixed a small error in the pivotize code: initially would keep a zero on the main diagonal in favor of a negative number)
m (Fixed a small error in the pivotize code: initially would keep a zero on the main diagonal in favor of a negative number (I am not very familiar with D syntax but I believe this was done correctly))
Line 684:
{{trans|Common Lisp}}
<lang d>import std.stdio, std.algorithm, std.typecons, std.numeric,
std.array, std.conv, std.string, std.range, std.math;
 
bool isRectangular(T)(in T[][] m) pure nothrow {
Line 724:
foreach (immutable i; 0 .. n) {
// immutable row = iota(i, n).reduce!(max!(j => m[j][i]));
T maxm = abs(m[i][i]);
size_t row = i;
foreach (immutable j; i .. n)
if (abs(m[j][i]) > maxm) {
maxm = m[j][i];
row = j;
Anonymous user