PDL::Slices

PDL::Slices is a Perl module used for indexing, slicing, and dicing.
Download

PDL::Slices Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tuomas J. Lukka
  • Publisher web site:
  • http://search.cpan.org/~lukka/WeakRef-0.01/WeakRef.pm

PDL::Slices Tags


PDL::Slices Description

PDL::Slices is a Perl module used for indexing, slicing, and dicing. PDL::Slices is a Perl module used for indexing, slicing, and dicing.SYNOPSIS use PDL; $a = ones(3,3); $b = $a->slice('-1:0,(1)'); $c = $a->dummy(2);This package provides many of the powerful PerlDL core index manipulation routines. These routines mostly allow two-way data flow, so you can modify your data in the most convenient representation. For example, you can make a 1000x1000 unit matrix with $a = zeroes(1000,1000); $a->diagonal(0,1) ++;which is quite efficient. See PDL::Indexing and PDL::Tips for more examples.Slicing is so central to the PDL language that a special compile-time syntax has been introduced to handle it compactly; see PDL::NiceSlice for details.PDL indexing and slicing functions usually include two-way data flow, so that you can separate the actions of reshaping your data structures and modifying the data themselves. Two special methods, copy and sever, help you control the data flow connection between related variables. $b = $a->slice("1:3"); # Slice maintains a link between $a and $b. $b += 5; # $a is changed!If you want to force a physical copy and no data flow, you can copy or sever the slice expression: $b = $a->slice("1:3")->copy; $b += 5; # $a is not changed. $b = $a->slice("1:3")->sever; $b += 5; # $a is not changed.The difference between sever and copy is that sever acts on (and returns) its argument, while copy produces a disconnected copy. If you say $b = $a->slice("1:3"); $c = $b->sever;then the variables $b and $c point to the same object but with ->copy they would not.Requirements:· Perl Requirements: · Perl


PDL::Slices Related Software