PDL::CCS::Ufunc - Ufuncs for compressed storage sparse PDLs
use PDL; use PDL::CCS::Ufunc; ##--------------------------------------------------------------------- ## ... stuff happens
Signature: ( int ixIn(Ndims,NnzIn); nzvalsIn(NnzIn); missing(); int N(); int [o]ixOut(Ndims,NnzOut); [o]nzvalsOut(NnzOut); int [o]nOut(); )
Accumulated product over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
If $N() is specified and greater than zero, then the quantity:
$missing ** ($N - (rlevec($ixIn))[0])
is multiplied into $nzvalsOut: this is probably What You Want if you are computing the product over a virtual dimension in a sparse index-encoded PDL (see PDL::CCS::Nd for a wrapper class).
Returned PDLs are implicitly sliced such that NnzOut==$nOut().
In scalar context, returns only $nzvalsOut().
ccs_accum_prod does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Signature: ( int ixIn(Ndims,NnzIn); nzvalsIn(NnzIn); missing(); int N(); int [o]ixOut(Ndims,NnzOut); double [o]nzvalsOut(NnzOut); int [o]nOut(); )
Accumulated double-precision product over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
ccs_accum_dprod does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated sum over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
$missing * ($N - (rlevec($ixIn))[0])
is added to $nzvalsOut: this is probably What You Want if you are summing over a virtual dimension in a sparse index-encoded PDL (see PDL::CCS::Nd for a wrapper class).
ccs_accum_sum does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated double-precision sum over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
ccs_accum_dsum does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated logical "or" over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
If $N() is specified and greater than zero, $missing() is logically (or)ed into each result value at each output index with a run length of less than $N() in $ixIn(). This is probably What You Want.
ccs_accum_or does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated logical "and" over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
If $N() is specified and greater than zero, $missing() is logically (and)ed into each result value at each output index with a run length of less than $N() in $ixIn(). This is probably What You Want.
ccs_accum_and does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated bitwise "or" over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
If $N() is specified and greater than zero, $missing() is bitwise (or)ed into each result value at each output index with a run length of less than $N() in $ixIn(). This is probably What You Want.
ccs_accum_bor does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated bitwise "and" over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
If $N() is specified and greater than zero, $missing() is bitwise (and)ed into each result value at each output index with a run length of less than $N() in $ixIn(). This is probably What You Want.
ccs_accum_band does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated maximum over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
If $N() is specified and greater than zero, and if $missing() is greater than any listed value for a vector key with a run-length of less than $N(), then $missing() is used as the output value for that key. This is probably What You Want.
ccs_accum_maximum does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated minimum over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
If $N() is specified and greater than zero, and if $missing() is less than any listed value for a vector key with a run-length of less than $N(), then $missing() is used as the output value for that key. This is probably What You Want.
ccs_accum_minimum does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Signature: ( int ixIn(Ndims,NnzIn); nzvalsIn(NnzIn); missing(); int N(); int [o]ixOut(Ndims,NnzOut); int [o]nzvalsOut(NnzOut); int [o]nOut(); )
Accumulated maximum_nz_ind over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
Output indices index $nzvalsIn, -1 indicates that the missing value is maximal.
ccs_accum_maximum_nz_ind does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated minimum_nz_ind over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
Output indices index $nzvalsIn, -1 indicates that the missing value is minimal.
ccs_accum_minimum_nz_ind does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Signature: ( int ixIn(Ndims,NnzIn); nzvalsIn(NnzIn); missing(); int N(); int [o]ixOut(Ndims,NnzOut); int+ [o]nzvalsOut(NnzOut); int [o]nOut(); )
Accumulated number of bad values over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
Should handle missing values appropriately.
ccs_accum_nbad does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated number of good values over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
ccs_accum_ngood does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Accumulated number of non-zero values over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
ccs_accum_nnz does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
Signature: ( int ixIn(Ndims,NnzIn); nzvalsIn(NnzIn); missing(); int N(); int [o]ixOut(Ndims,NnzOut); float+ [o]nzvalsOut(NnzOut); int [o]nOut(); )
Accumulated average over values $nzvalsIn() associated with vector-valued keys $ixIn(). On return, $ixOut() holds the unique non-"missing" values of $ixIn(), $nzvalsOut() holds the associated values, and $nOut() stores the number of unique non-missing values computed.
$missing * ($N - (rlevec($ixIn))[0]) / $N
is added to $nzvalsOut: this is probably What You Want if you are averaging over a virtual dimension in a sparse index-encoded PDL (see PDL::CCS::Nd for a wrapper class).
ccs_accum_average does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
maximum_ind, minimum_ind: not quite compatible...
daverage, medover, oddmedover, pctover, ...
cumusumover, cumuprodover, ...
zcover, intover, minmaximum
Perl by Larry Wall.
PDL by Karl Glazebrook, Tuomas J. Lukka, Christian Soeller, and others.
Probably many.
Bryan Jurish <moocow@cpan.org>
Copyright (C) 2007-2013, Bryan Jurish. All rights reserved.
This package is free software, and entirely without warranty. You may redistribute it and/or modify it under the same terms as Perl itself.
perl(1), PDL(3perl)
To install PDL::CCS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PDL::CCS
CPAN shell
perl -MCPAN -e shell install PDL::CCS
For more information on module installation, please visit the detailed CPAN module installation guide.