.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Ufunc 3pm" .TH Ufunc 3pm "2022-12-02" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PDL::CCS::Ufunc \- Ufuncs for compressed storage sparse PDLs .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use PDL; \& use PDL::CCS::Ufunc; \& \& ##\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& ## ... stuff happens .Ve .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "ccs_accum_prod" .IX Subsection "ccs_accum_prod" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated product over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, then the quantity: .PP .Vb 1 \& $missing ** ($N \- (rlevec($ixIn))[0]) .Ve .PP is multiplied into \f(CW$nzvalsOut:\fR this is probably What You Want if you are computing the product over a virtual dimension in a sparse index-encoded \s-1PDL\s0 (see PDL::CCS::Nd for a wrapper class). .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_prod processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_dprod" .IX Subsection "ccs_accum_dprod" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& double [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated double-precision product over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, then the quantity: .PP .Vb 1 \& $missing ** ($N \- (rlevec($ixIn))[0]) .Ve .PP is multiplied into \f(CW$nzvalsOut:\fR this is probably What You Want if you are computing the product over a virtual dimension in a sparse index-encoded \s-1PDL\s0 (see PDL::CCS::Nd for a wrapper class). .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_dprod processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_sum" .IX Subsection "ccs_accum_sum" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated sum over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, then the quantity: .PP .Vb 1 \& $missing * ($N \- (rlevec($ixIn))[0]) .Ve .PP is added to \f(CW$nzvalsOut:\fR this is probably What You Want if you are summing over a virtual dimension in a sparse index-encoded \s-1PDL\s0 (see PDL::CCS::Nd for a wrapper class). .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_sum processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_dsum" .IX Subsection "ccs_accum_dsum" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& double [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated double-precision sum over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, then the quantity: .PP .Vb 1 \& $missing * ($N \- (rlevec($ixIn))[0]) .Ve .PP is added to \f(CW$nzvalsOut:\fR this is probably What You Want if you are summing over a virtual dimension in a sparse index-encoded \s-1PDL\s0 (see PDL::CCS::Nd for a wrapper class). .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_dsum processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_or" .IX Subsection "ccs_accum_or" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated logical \*(L"or\*(R" over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, $\fBmissing()\fR is logically (or)ed into each result value at each output index with a run length of less than $N() in $\fBixIn()\fR. This is probably What You Want. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_or processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_and" .IX Subsection "ccs_accum_and" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated logical \*(L"and\*(R" over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, $\fBmissing()\fR is logically (and)ed into each result value at each output index with a run length of less than $N() in $\fBixIn()\fR. This is probably What You Want. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_and processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_bor" .IX Subsection "ccs_accum_bor" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated bitwise \*(L"or\*(R" over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, $\fBmissing()\fR is bitwise (or)ed into each result value at each output index with a run length of less than $N() in $\fBixIn()\fR. This is probably What You Want. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_bor processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_band" .IX Subsection "ccs_accum_band" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated bitwise \*(L"and\*(R" over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, $\fBmissing()\fR is bitwise (and)ed into each result value at each output index with a run length of less than $N() in $\fBixIn()\fR. This is probably What You Want. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_band processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_maximum" .IX Subsection "ccs_accum_maximum" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated maximum over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, and if $\fBmissing()\fR is greater than any listed value for a vector key with a run-length of less than $N(), then $\fBmissing()\fR is used as the output value for that key. This is probably What You Want. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_maximum processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_minimum" .IX Subsection "ccs_accum_minimum" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated minimum over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, and if $\fBmissing()\fR is less than any listed value for a vector key with a run-length of less than $N(), then $\fBmissing()\fR is used as the output value for that key. This is probably What You Want. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_minimum processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_maximum_nz_ind" .IX Subsection "ccs_accum_maximum_nz_ind" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& indx [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated maximum_nz_ind over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP Output indices index \f(CW$nzvalsIn\fR, \-1 indicates that the missing value is maximal. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_maximum_nz_ind processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_minimum_nz_ind" .IX Subsection "ccs_accum_minimum_nz_ind" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& indx [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated minimum_nz_ind over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP Output indices index \f(CW$nzvalsIn\fR, \-1 indicates that the missing value is minimal. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_minimum_nz_ind processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_nbad" .IX Subsection "ccs_accum_nbad" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& int+ [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated number of bad values over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP Should handle missing values appropriately. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_nbad processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_ngood" .IX Subsection "ccs_accum_ngood" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& indx [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated number of good values over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP Should handle missing values appropriately. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_ngood processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_nnz" .IX Subsection "ccs_accum_nnz" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& indx [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated number of non-zero values over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP Should handle missing values appropriately. .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_nnz processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SS "ccs_accum_average" .IX Subsection "ccs_accum_average" .Vb 9 \& Signature: ( \& indx ixIn(Ndims,NnzIn); \& nzvalsIn(NnzIn); \& missing(); \& indx N(); \& indx [o]ixOut(Ndims,NnzOut); \& float+ [o]nzvalsOut(NnzOut); \& indx [o]nOut(); \& ) .Ve .PP Accumulated average over values $\fBnzvalsIn()\fR associated with vector-valued keys $\fBixIn()\fR. On return, $\fBixOut()\fR holds the unique non\-\*(L"missing\*(R" values of $\fBixIn()\fR, $\fBnzvalsOut()\fR holds the associated values, and $\fBnOut()\fR stores the number of unique non-missing values computed. .PP If $N() is specified and greater than zero, then the quantity: .PP .Vb 1 \& $missing * ($N \- (rlevec($ixIn))[0]) / $N .Ve .PP is added to \f(CW$nzvalsOut:\fR this is probably What You Want if you are averaging over a virtual dimension in a sparse index-encoded \s-1PDL\s0 (see PDL::CCS::Nd for a wrapper class). .PP Returned PDLs are implicitly sliced such that NnzOut==$\fBnOut()\fR. .PP In scalar context, returns only $\fBnzvalsOut()\fR. .PP ccs_accum_average processes bad values. The state of the bad-value flag of the output ndarrays is unknown. .SH "TODO / NOT YET IMPLEMENTED" .IX Header "TODO / NOT YET IMPLEMENTED" .IP "extrema indices" 4 .IX Item "extrema indices" maximum_ind, minimum_ind: not quite compatible... .IP "statistical aggregates" 4 .IX Item "statistical aggregates" daverage, medover, oddmedover, pctover, ... .IP "cumulative functions" 4 .IX Item "cumulative functions" cumusumover, cumuprodover, ... .IP "other stuff" 4 .IX Item "other stuff" zcover, intover, minmaximum .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Perl by Larry Wall. .PP \&\s-1PDL\s0 by Karl Glazebrook, Tuomas J. Lukka, Christian Soeller, and others. .SH "KNOWN BUGS" .IX Header "KNOWN BUGS" Probably many. .SH "AUTHOR" .IX Header "AUTHOR" Bryan Jurish .SS "Copyright Policy" .IX Subsection "Copyright Policy" Copyright (C) 2007\-2022, Bryan Jurish. All rights reserved. .PP This package is free software, and entirely without warranty. You may redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBperl\fR\|(1), \s-1\fBPDL\s0\fR\|(3perl)