.\" 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 "Ops 3pm" .TH Ops 3pm "2023-04-15" "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::Ops \- Low\-level binary operations for compressed storage sparse PDLs .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use PDL; \& use PDL::CCS::Utils; \& \& ##\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& ## ... stuff happens .Ve .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "ccs_binop_align_block_mia" .IX Subsection "ccs_binop_align_block_mia" .Vb 4 \& Signature: ( \& indx ixa(Ndims,NnzA); indx ixb(Ndims,NnzB); indx istate(State); \& indx [o]nzai(NnzC); indx [o]nzbi(NnzC); indx [o]ostate(State); \& ) .Ve .PP Partially aligns a pair of lexicographically sorted index-vector lists \f(CW\*(C`$ixa()\*(C'\fR and \f(CW\*(C`$ixb()\*(C'\fR, e.g. for block-wise incremental computation of binary operations over sparse index-encoded PDLs, assuming missing indices correspond to annihilators. .PP On return, the vectors \f(CW$nzai\fR and \f(CW$nzbi\fR hold indices into \f(CW\*(C`NnzA\*(C'\fR and \f(CW\*(C`NnzB\*(C'\fR respectively, and are constructed such that: .PP .Vb 1 \& ($ixa(,$nzai\->slice("0:$nzci_max")) == $ixb(,$nzbi\->slice("0:$nzci_max")) .Ve .PP At most \f(CW\*(C`NnzC\*(C'\fR alignments are performed, and alignment ceases as soon as any of the PDLs \f(CW\*(C`$ixa()\*(C'\fR, \f(CW\*(C`$ixb()\*(C'\fR, \f(CW\*(C`$nzai()\*(C'\fR, or \f(CW\*(C`$nzbi()\*(C'\fR has been exhausted. .PP The parameters \f(CW\*(C`$istate()\*(C'\fR and \f(CW\*(C`$ostate()\*(C'\fR hold the state of the algorithm, for incremental block-wise computation at the perl level. Each state \s-1PDL\s0 is a 7\-element \s-1PDL\s0 containing the following values: .PP .Vb 9 \& INDEX LABEL DESCRIPTION \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& 0 nnzai minimum offset in NnzA of current $ixa() value \& 1 nnzai_nxt minimum offset in NnzA of next $ixa() value \& 2 nnzbi minimum offset in NnzB of current $ixb() value \& 3 nnzbi_nxt minimum offset in NnzB of next $ixb() value \& 4 nnzci minimum offset in NnzC of current ($ixa(),$ixb()) value pair \& 5 nnzci_nxt minimum offset in NnzC of next ($ixa(),$ixb()) value pair \& 6 cmpval 3\-way comparison value for current ($ixa(),$ixb()) value pair .Ve .PP For computation of the first block, $\fBistate()\fR can be safely set to \f(CW\*(C`zeroes(long,7)\*(C'\fR. .PP Repetitions may occur in input index PDLs \f(CW\*(C`$ixa()\*(C'\fR and \f(CW\*(C`$ixb()\*(C'\fR. If an index-match occurs on such a \*(L"run\*(R", \fIall pairs\fR of matching values are added to the output PDLs. .PP All alignments have been performed if: .PP .Vb 1 \& $ostate(0)==$NnzA && $ostate(1)==$NnzB .Ve .PP \&\fB\s-1WARNING:\s0\fR this alignment method ignores index-vectors which are not present in \fIboth\fR \f(CW\*(C`$ixa()\*(C'\fR and \f(CW\*(C`$ixb()\*(C'\fR, which is a Good Thing if your are feeding the aligned values into an operation for which missing values are annihilators: .PP .Vb 2 \& $missinga * $bval == ($missinga * $missingb) for each $bval \ein $b, and \& $aval * $missingb == ($missinga * $missingb) for each $aval \ein $a .Ve .PP This ought to be the case for all operations if missing values are \f(CW\*(C`BAD\*(C'\fR (see PDL::Bad), but might cause unexpected results if e.g. missing values are zero and the operation in question is addition. .PP ccs_binop_align_block_mia does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .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" No support for (pseudo)\-threading. .SH "AUTHOR" .IX Header "AUTHOR" Bryan Jurish .SS "Copyright Policy" .IX Subsection "Copyright Policy" All other parts 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)