PDL::CCS::Ufunc - Ufuncs for compressed storage sparse PDLs
use PDL; use PDL::CCS::Ufunc; ##--------------------------------------------------------------------- ## ... stuff happens
Signature: ( indx ixIn(Ndims,NnzIn); nzvalsIn(NnzIn); missing(); indx N(); indx [o]ixOut(Ndims,NnzOut); [o]nzvalsOut(NnzOut); indx [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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
Signature: ( indx ixIn(Ndims,NnzIn); nzvalsIn(NnzIn); missing(); indx N(); indx [o]ixOut(Ndims,NnzOut); double [o]nzvalsOut(NnzOut); indx [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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
Signature: ( indx ixIn(Ndims,NnzIn); nzvalsIn(NnzIn); missing(); indx N(); indx [o]ixOut(Ndims,NnzOut); indx [o]nzvalsOut(NnzOut); indx [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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
Signature: ( indx ixIn(Ndims,NnzIn); nzvalsIn(NnzIn); missing(); indx N(); indx [o]ixOut(Ndims,NnzOut); int+ [o]nzvalsOut(NnzOut); indx [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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
Signature: ( indx ixIn(Ndims,NnzIn); nzvalsIn(NnzIn); missing(); indx N(); indx [o]ixOut(Ndims,NnzOut); float+ [o]nzvalsOut(NnzOut); indx [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 processes bad values. The state of the bad-value flag of the output piddles is unknown.
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.