Deconvolution/1D: Difference between revisions
m
→{{header|Perl 6}}: fixed 'trim_system'
(→{{header|Haskell}}: Fixed a compilation error (GHC 8.02), removed redundant import, applied hlint, hindent) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: fixed 'trim_system') |
||
Line 808:
=={{header|Perl 6}}==
{{works with|Rakudo
Translation of Python, using a modified version of the Reduced Row Echelon Form subroutine <code>rref()</code> from [[Reduced row echelon form#Perl 6|here]].
Line 835 ⟶ 834:
my ($lead, $rows, $cols) = 0, +$m, +$m[0];
# Trim off over specified rows if they exist
▲# $m = trim_system($m);
▲# $rows = +$m;
▲# }
for ^$rows -> $r {
Line 873 ⟶ 870:
for ^$vars -> $lead {
for ^$m -> $row {
@t.push
}
}
while (+@t < $vars) and +$m { @t.push
return @t;
}
|