A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
11
Task/Matrix-transposition/Perl/matrix-transposition-1.pl
Normal file
11
Task/Matrix-transposition/Perl/matrix-transposition-1.pl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
use Math::Matrix;
|
||||
|
||||
$m = Math::Matrix->new(
|
||||
[1, 1, 1, 1],
|
||||
[2, 4, 8, 16],
|
||||
[3, 9, 27, 81],
|
||||
[4, 16, 64, 256],
|
||||
[5, 25, 125, 625],
|
||||
);
|
||||
|
||||
$m->transpose->print;
|
||||
12
Task/Matrix-transposition/Perl/matrix-transposition-2.pl
Normal file
12
Task/Matrix-transposition/Perl/matrix-transposition-2.pl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
my @m = (
|
||||
[1, 1, 1, 1],
|
||||
[2, 4, 8, 16],
|
||||
[3, 9, 27, 81],
|
||||
[4, 16, 64, 256],
|
||||
[5, 25, 125, 625],
|
||||
);
|
||||
|
||||
my @transposed;
|
||||
foreach my $j (0..$#{$m[0]}) {
|
||||
push(@transposed, [map $_->[$j], @m]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue