PDL::Ufunc 2.4.3
Sponsored Links
PDL::Ufunc 2.4.3 Ranking & Summary
File size:
2.1 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
854
Date added:
2007-06-27
Publisher:
Tuomas J. Lukka
PDL::Ufunc 2.4.3 description
PDL::Ufunc Perl module contains primitive ufunc operations for pdl.
This module provides some primitive and useful functions defined using PDL::PP based on functionality of what are sometimes called ufuncs (for example NumPY and Mathematica talk about these). It collects all the functions generally used to reduce or accumulate along a dimension. These all do their job across the first dimension but by using the slicing functions you can do it on any dimension.
The PDL::Reduce module provides an alternative interface to many of the functions in this module.
SYNOPSIS
use PDL::Ufunc;
Project via $name to N-1 dimensions
This function reduces the dimensionality of a piddle by one by taking the $name along the 1st dimension.
By using xchg etc. it is possible to use any dimension.
$a = $op($b);
$spectrum = $op $image->xchg(0,1)
$extras
EOD
} # sub: projectdocs()
sub cumuprojectdocs { my $name = shift; my $op = shift; my $extras = shift; return <<EOD;
Cumulative $name
This function calculates the cumulative $name along the 1st dimension.
By using xchg etc. it is possible to use any dimension.
The sum is started so that the first element in the cumulative $name is the first element of the parameter.
$a = $op($b);
$spectrum = $op $image->xchg(0,1)
$extras
EOD
} # sub: cumuprojectdocs()
# its a bit unclear what to do with the comparison operators, # since the return value could be bad because all elements are bad, # which needs checking for since the bad value could evaluate to # true or false (eg if the user has set it to 0) # # by setting CopyBadStatusCode to , we stop the output piddle # from automatically being set bad if any of the input piddles are bad. # - we can set the flag within BadCode if necessary # # This may NOT be sensible. Only time, and comments, will tell... #
my %over = ( sumover => { name => sum, op => +=, init => 0, }, prodover => { name => product, op => *=, init => 1, }, );
foreach my $func ( keys %over ) {
# creates $func and cumu$func functions
# and d$func and dcumu$func functions, which
# perform the calculations in double precision
my $name = $over{$func}{name};
my $op = $over{$func}{op};
my $init = $over{$func}{init};
pp_def(
$func,
HandleBad => 1,
Pars => a(n); int+ [o]b();,
Code =>
$GENERIC(b) tmp = . $init . ;
loop(n) %{ tmp . $op . $a(); %}
$b() = tmp;,
BadCode =>
$GENERIC(b) tmp = . $init . ;
int flag = 0;
loop(n) %{
if ( $ISGOOD(a()) ) { tmp . $op . $a(); flag = 1; }
%}
if ( flag ) { $b() = tmp; }
else { $SETBAD(b()); },
Doc => projectdocs( $name, $func, ),
);
# as above, but in double precision
pp_def(
"d$func",
HandleBad => 1,
Pars => a(n); double [o]b();,
Code =>
double tmp = . $init . ;
loop(n) %{ tmp . $op . $a(); %}
$b() = tmp;,
BadCode =>
double tmp = . $init . ;
int flag = 0;
loop(n) %{
if ( $ISGOOD(a()) ) { tmp . $op . $a(); flag = 1; }
%}
if ( flag ) { $b() = tmp; }
else { $SETBAD(b()); },
Doc => projectdocs( $name, "d$func",
"Unlike L<$func|/$func>, the calculations are performed in doublen" .
"precision." ),
);
my $cfunc = "cumu${func}";
pp_def(
$cfunc,
HandleBad => 1,
Pars => a(n); int+ [o]b(n);,
Code =>
$GENERIC(b) tmp = . $init . ;
loop(n) %{
tmp . $op . $a();
$b() = tmp;
%},
BadCode =>
$GENERIC(b) tmp = . $init . ;
loop(n) %{
if ( $ISBAD(a()) ) { $SETBAD(b()); }
else {
tmp . $op . $a();
$b() = tmp;
}
%},
Doc => cumuprojectdocs( $name, $cfunc, ),
);
# as above but in double precision
pp_def(
"d$cfunc",
HandleBad => 1,
Pars => a(n); double [o]b(n);,
Code =>
double tmp = . $init . ;
loop(n) %{
tmp . $op . $a();
$b() = tmp;
%},
BadCode =>
double tmp = . $init . ;
loop(n) %{
if ( $ISBAD(a()) ) { $SETBAD(b()); }
else {
tmp . $op . $a();
$b() = tmp;
}
%},
Doc => cumuprojectdocs( $name, $cfunc,
"Unlike L
, the calculations are performed in doublen" .
"precision." ),
);
This module provides some primitive and useful functions defined using PDL::PP based on functionality of what are sometimes called ufuncs (for example NumPY and Mathematica talk about these). It collects all the functions generally used to reduce or accumulate along a dimension. These all do their job across the first dimension but by using the slicing functions you can do it on any dimension.
The PDL::Reduce module provides an alternative interface to many of the functions in this module.
SYNOPSIS
use PDL::Ufunc;
Project via $name to N-1 dimensions
This function reduces the dimensionality of a piddle by one by taking the $name along the 1st dimension.
By using xchg etc. it is possible to use any dimension.
$a = $op($b);
$spectrum = $op $image->xchg(0,1)
$extras
EOD
} # sub: projectdocs()
sub cumuprojectdocs { my $name = shift; my $op = shift; my $extras = shift; return <<EOD;
Cumulative $name
This function calculates the cumulative $name along the 1st dimension.
By using xchg etc. it is possible to use any dimension.
The sum is started so that the first element in the cumulative $name is the first element of the parameter.
$a = $op($b);
$spectrum = $op $image->xchg(0,1)
$extras
EOD
} # sub: cumuprojectdocs()
# its a bit unclear what to do with the comparison operators, # since the return value could be bad because all elements are bad, # which needs checking for since the bad value could evaluate to # true or false (eg if the user has set it to 0) # # by setting CopyBadStatusCode to , we stop the output piddle # from automatically being set bad if any of the input piddles are bad. # - we can set the flag within BadCode if necessary # # This may NOT be sensible. Only time, and comments, will tell... #
my %over = ( sumover => { name => sum, op => +=, init => 0, }, prodover => { name => product, op => *=, init => 1, }, );
foreach my $func ( keys %over ) {
# creates $func and cumu$func functions
# and d$func and dcumu$func functions, which
# perform the calculations in double precision
my $name = $over{$func}{name};
my $op = $over{$func}{op};
my $init = $over{$func}{init};
pp_def(
$func,
HandleBad => 1,
Pars => a(n); int+ [o]b();,
Code =>
$GENERIC(b) tmp = . $init . ;
loop(n) %{ tmp . $op . $a(); %}
$b() = tmp;,
BadCode =>
$GENERIC(b) tmp = . $init . ;
int flag = 0;
loop(n) %{
if ( $ISGOOD(a()) ) { tmp . $op . $a(); flag = 1; }
%}
if ( flag ) { $b() = tmp; }
else { $SETBAD(b()); },
Doc => projectdocs( $name, $func, ),
);
# as above, but in double precision
pp_def(
"d$func",
HandleBad => 1,
Pars => a(n); double [o]b();,
Code =>
double tmp = . $init . ;
loop(n) %{ tmp . $op . $a(); %}
$b() = tmp;,
BadCode =>
double tmp = . $init . ;
int flag = 0;
loop(n) %{
if ( $ISGOOD(a()) ) { tmp . $op . $a(); flag = 1; }
%}
if ( flag ) { $b() = tmp; }
else { $SETBAD(b()); },
Doc => projectdocs( $name, "d$func",
"Unlike L<$func|/$func>, the calculations are performed in doublen" .
"precision." ),
);
my $cfunc = "cumu${func}";
pp_def(
$cfunc,
HandleBad => 1,
Pars => a(n); int+ [o]b(n);,
Code =>
$GENERIC(b) tmp = . $init . ;
loop(n) %{
tmp . $op . $a();
$b() = tmp;
%},
BadCode =>
$GENERIC(b) tmp = . $init . ;
loop(n) %{
if ( $ISBAD(a()) ) { $SETBAD(b()); }
else {
tmp . $op . $a();
$b() = tmp;
}
%},
Doc => cumuprojectdocs( $name, $cfunc, ),
);
# as above but in double precision
pp_def(
"d$cfunc",
HandleBad => 1,
Pars => a(n); double [o]b(n);,
Code =>
double tmp = . $init . ;
loop(n) %{
tmp . $op . $a();
$b() = tmp;
%},
BadCode =>
double tmp = . $init . ;
loop(n) %{
if ( $ISBAD(a()) ) { $SETBAD(b()); }
else {
tmp . $op . $a();
$b() = tmp;
}
%},
Doc => cumuprojectdocs( $name, $cfunc,
"Unlike L
"precision." ),
);
PDL::Ufunc 2.4.3 Screenshot
PDL::Ufunc 2.4.3 Keywords
PDL
BadCode
SETBAD
GENERIC
HandleBad
Ufunc 2.4.3
Perl module
TMP
b
op
n
FUNC
INIT
PDL::Ufunc
PDLUfunc
PDL::Ufunc 2.4.3
Bookmark PDL::Ufunc 2.4.3
PDL::Ufunc 2.4.3 Copyright
WareSeeker periodically updates pricing and software information of PDL::Ufunc 2.4.3 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of PDL::Ufunc 2.4.3 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
PDL::FAQ is a Perl module for frequently asked questions about PDL. Free Download
PDL::FFTW is a PDL interface to the Fastest Fourier Transform in the West v2.x. Free Download
PDL::NiceSlice Perl module contains a nicer slicing syntax for PDL. Free Download
PDL::Ops Perl module contains fundamental mathematical operators. Free Download
PDL::Slices is a Perl module used for indexing, slicing, and dicing. Free Download
PDL::Slatec is a PDL interface to the slatec numerical programming library. Free Download
PDL::API is a Perl module for making piddles from Perl and C/XS code. Free Download
PDL::Bad - PDL does not process bad values. Free Download
Latest Software
Popular Software
Favourite Software