"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Basic/Core/Core.pm" between
PDL-2.075.tar.gz and PDL-2.076.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

Core.pm  (PDL-2.075):Core.pm  (PDL-2.076)
skipping to change at line 109 skipping to change at line 109
type conversion, broadcasting etc. type conversion, broadcasting etc.
=head1 SYNOPSIS =head1 SYNOPSIS
use PDL::Core; # Normal routines use PDL::Core; # Normal routines
use PDL::Core ':Internal'; # Hairy routines use PDL::Core ':Internal'; # Hairy routines
=head1 VECTORIZATION/BROADCASTING: METHOD AND NOMENCLATURE =head1 VECTORIZATION/BROADCASTING: METHOD AND NOMENCLATURE
PDL provides vectorized operations via a built-in engine. PDL provides vectorized operations via a built-in engine.
Vectorization in PDL is called "broadcasting" (formerly, up to 2.075, "threading "). Vectorization in PDL is called "broadcasting" (formerly, up to 2.074, "threading ").
The broadcasting engine implements simple rules for each operation. The broadcasting engine implements simple rules for each operation.
Each PDL object has a "shape" that is a generalized N-dimensional Each PDL object has a "shape" that is a generalized N-dimensional
rectangle defined by a "dim list" of sizes in an arbitrary rectangle defined by a "dim list" of sizes in an arbitrary
set of dimensions. A PDL with shape 2x3 has 6 elements and is set of dimensions. A PDL with shape 2x3 has 6 elements and is
said to be two-dimensional, or may be referred to as a 2x3-PDL. said to be two-dimensional, or may be referred to as a 2x3-PDL.
The dimensions are indexed numerically starting at 0, so a The dimensions are indexed numerically starting at 0, so a
2x3-PDL has a dimension 0 (or "dim 0") with size 2 and a 1 dimension 2x3-PDL has a dimension 0 (or "dim 0") with size 2 and a 1 dimension
(or "dim 1") with size 3. (or "dim 1") with size 3.
skipping to change at line 2650 skipping to change at line 2650
$y = convert $x, ushort; $y = convert $x, ushort;
=cut =cut
sub PDL::convert { sub PDL::convert {
# we don't allow inplace conversion at the moment # we don't allow inplace conversion at the moment
# (not sure what needs to be changed) # (not sure what needs to be changed)
barf 'Usage: $y = convert($x, $newtype)'."\n" if @_ != 2; barf 'Usage: $y = convert($x, $newtype)'."\n" if @_ != 2;
my ($pdl,$type)= @_; my ($pdl,$type)= @_;
$pdl = topdl($pdl); # Allow normal numbers $pdl = topdl($pdl); # Allow normal numbers
barf "Tried to convert(null)" if $pdl->isnull;
$type = $type->enum if ref($type) eq 'PDL::Type'; $type = $type->enum if ref($type) eq 'PDL::Type';
barf 'Usage: $y = convert($x, $newtype)'."\n" unless Scalar::Util::looks_like_ number($type); barf 'Usage: $y = convert($x, $newtype)'."\n" unless Scalar::Util::looks_like_ number($type);
return $pdl if $pdl->get_datatype == $type; return $pdl if $pdl->get_datatype == $type;
$pdl->_convert_int($type)->sever; $pdl->_convert_int($type)->sever;
} }
=head2 Datatype_conversions =head2 Datatype_conversions
=for ref =for ref
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)