Michael R. Davis > Array-Transpose > Array::Transpose

Download:
Array-Transpose-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.05   Source  

NAME ^

Array::Transpose - Transposes a 2-Dimensional Array

SYNOPSIS ^

  use Array::Transpose;
  @array=transpose(\@array);

  use Array::Transpose qw{};
  @array=Array::Transpose::transpose(\@array);

Example:

  use Array::Transpose;
  use Data::Dumper;
  my $array=transpose([
                        [ 0  ..  4 ],
                        ["a" .. "e"],
                      ]);
  print Data::Dumper->Dump([$array]);

Returns

  $VAR1 = [
            [ 0, 'a' ],
            [ 1, 'b' ],
            [ 2, 'c' ],
            [ 3, 'd' ],
            [ 4, 'e' ]
          ];

DESCRIPTION ^

This package exports one function named transpose.

In linear algebra, the transpose of a matrix A is another matrix A' created by any one of the following equivalent actions:

USAGE ^

  use Array::Transpose;
  @array=transpose(\@array);

METHODS ^

transpose

Returns a transposed 2-Dimensional Array given a 2-Dimensional Array

  my $out=transpose($in);  #$in=[[],[],[],...];
  my @out=transpose(\@in); #@in=([],[],[],...);

BUGS ^

Please log on RT and send an email to the author.

SUPPORT ^

DavisNetworks.com supports all Perl applications including this package.

AUTHOR ^

  Michael R. Davis
  CPAN ID: MRDVT
  STOP, LLC
  domain=>stopllc,tld=>com,account=>mdavis
  http://www.stopllc.com/

COPYRIGHT ^

This program is free software licensed under the...

  The BSD License

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO ^

Math::MatrixReal method transpose, Array::Transpose::Ragged

syntax highlighting: