Strassen's algorithm: Difference between revisions

m
→‎{{header|Raku}}: I should have RTFM
(→‎{{header|Raku}}: minor updates + some comments)
m (→‎{{header|Raku}}: I should have RTFM)
Line 484:
 
=={{header|Raku}}==
Special thanks go to the module author, [https://github.com/frithnanth Fernando Santagata], on showing how to deal with a pass-by-value case.
{{trans|Julia}}
<lang perl6># 20210126 Raku programming solution
Line 508 ⟶ 509:
sub infix:<⊕>(\x,\y) { # custom addition
my Math::Libgsl::Matrix \z .= new: x.size1, x.size2;
z.copy(x).add(y)
for ^x.size1 { z.set-row: $_, x.get-row($_) «+» y.get-row($_) }
z
}
sub infix:<⊖>(\x,\y) { # custom subtraction
my Math::Libgsl::Matrix \z .= new: x.size1, x.size2;
z.copy(x).sub(y)
for ^x.size1 { z.set-row: $_, x.get-row($_) «-» y.get-row($_) }
z
}
351

edits