.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 2024-03-07 "perl v5.38.2" "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$ixa()\fR and \f(CW$ixb()\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$ixa()\fR, \f(CW$ixb()\fR, \f(CW$nzai()\fR, or \f(CW$nzbi()\fR has been exhausted. .PP The parameters \f(CW$istate()\fR and \f(CW$ostate()\fR hold the state of the algorithm, for incremental block-wise computation at the perl level. Each state PDL is a 7\-element PDL 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$ixa()\fR and \f(CW$ixb()\fR. If an index-match occurs on such a "run", \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 \&\fBWARNING:\fR this alignment method ignores index-vectors which are not present in \fIboth\fR \f(CW$ixa()\fR and \f(CW$ixb()\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 PDL 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), \fBPDL\fR\|(3perl)