File Coverage

blib/lib/PDL/CCS/Ops.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             #
2             # GENERATED WITH PDL::PP from ccsops.pd! Don't modify!
3             #
4             package PDL::CCS::Ops;
5              
6             our @EXPORT_OK = qw(ccs_binop_align_block_mia );
7             our %EXPORT_TAGS = (Func=>\@EXPORT_OK);
8              
9 2     2   12 use PDL::Core;
  2         4  
  2         16  
10 2     2   720 use PDL::Exporter;
  2         10  
  2         12  
11 2     2   86 use DynaLoader;
  2         10  
  2         444  
12              
13              
14             our $VERSION = '1.24.1';
15             our @ISA = ( 'PDL::Exporter','DynaLoader' );
16             push @PDL::Core::PP, __PACKAGE__;
17             bootstrap PDL::CCS::Ops $VERSION;
18              
19              
20              
21              
22              
23              
24              
25              
26             #line 13 "ccsops.pd"
27              
28             #use PDL::CCS::Version;
29             use strict;
30              
31             =pod
32              
33             =head1 NAME
34              
35             PDL::CCS::Ops - Low-level binary operations for compressed storage sparse PDLs
36              
37             =head1 SYNOPSIS
38              
39             use PDL;
40             use PDL::CCS::Utils;
41              
42             ##---------------------------------------------------------------------
43             ## ... stuff happens
44              
45             =cut
46             #line 47 "Ops.pm"
47              
48              
49             =head1 FUNCTIONS
50              
51             =cut
52              
53              
54              
55              
56              
57             #line 51 "ccsops.pd"
58              
59             *ccs_indx = \&PDL::indx; ##-- typecasting for CCS indices (deprecated)
60             #line 61 "Ops.pm"
61              
62              
63             =head2 ccs_binop_align_block_mia
64              
65             =for sig
66              
67             Signature: (
68             indx ixa(Ndims,NnzA); indx ixb(Ndims,NnzB); indx istate(State);
69             indx [o]nzai(NnzC); indx [o]nzbi(NnzC); indx [o]ostate(State);
70             )
71             Types: (sbyte byte short ushort long ulong indx ulonglong longlong
72             float double ldouble)
73              
74             =for usage
75              
76             ($nzai, $nzbi, $ostate) = ccs_binop_align_block_mia($ixa, $ixb, $istate);
77             ccs_binop_align_block_mia($ixa, $ixb, $istate, $nzai, $nzbi, $ostate); # all arguments given
78             ($nzai, $nzbi, $ostate) = $ixa->ccs_binop_align_block_mia($ixb, $istate); # method call
79             $ixa->ccs_binop_align_block_mia($ixb, $istate, $nzai, $nzbi, $ostate);
80              
81             Partially aligns a pair of lexicographically sorted index-vector lists C<$ixa()> and C<$ixb()>,
82             e.g. for block-wise incremental computation of binary operations over sparse index-encoded PDLs,
83             assuming missing indices correspond to annihilators.
84              
85             On return, the vectors C<$nzai> and C<$nzbi> hold indices into C and C
86             respectively, and are constructed such that:
87              
88             ($ixa(,$nzai->slice("0:$nzci_max")) == $ixb(,$nzbi->slice("0:$nzci_max"))
89              
90             At most C alignments are performed, and alignment ceases
91             as soon as any of the PDLs C<$ixa()>, C<$ixb()>, C<$nzai()>, or C<$nzbi()>
92             has been exhausted.
93              
94             The parameters C<$istate()> and C<$ostate()> hold the state of the algorithm,
95             for incremental block-wise computation at the perl level. Each state PDL
96             is a 7-element PDL containing the following values:
97              
98             INDEX LABEL DESCRIPTION
99             -----------------------------------------------------------------------
100             0 nnzai minimum offset in NnzA of current $ixa() value
101             1 nnzai_nxt minimum offset in NnzA of next $ixa() value
102             2 nnzbi minimum offset in NnzB of current $ixb() value
103             3 nnzbi_nxt minimum offset in NnzB of next $ixb() value
104             4 nnzci minimum offset in NnzC of current ($ixa(),$ixb()) value pair
105             5 nnzci_nxt minimum offset in NnzC of next ($ixa(),$ixb()) value pair
106             6 cmpval 3-way comparison value for current ($ixa(),$ixb()) value pair
107              
108             For computation of the first block, $istate() can be safely set to C.
109              
110             Repetitions may occur in input index PDLs C<$ixa()> and C<$ixb()>.
111             If an index-match occurs on such a "run", I of matching values are
112             added to the output PDLs.
113              
114             All alignments have been performed if:
115              
116             $ostate(0)==$NnzA && $ostate(1)==$NnzB
117              
118             B this alignment method ignores index-vectors which are not present
119             in I C<$ixa()> and C<$ixb()>, which is a Good Thing if your are feeding
120             the aligned values into an operation for which missing values are annihilators:
121              
122             $missinga * $bval == ($missinga * $missingb) for each $bval \in $b, and
123             $aval * $missingb == ($missinga * $missingb) for each $aval \in $a
124              
125             This ought to be the case for all operations if missing values are C (see L),
126             but might cause unexpected results if e.g. missing values are zero and the operation
127             in question is addition.
128              
129             =pod
130              
131             Broadcasts over its inputs.
132              
133             =for bad
134              
135             C does not process bad values.
136             It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
137              
138             =cut
139              
140              
141              
142              
143             *ccs_binop_align_block_mia = \&PDL::ccs_binop_align_block_mia;
144              
145              
146              
147              
148              
149             #line 220 "ccsops.pd"
150              
151             ##---------------------------------------------------------------------
152             =pod
153              
154             =head1 ACKNOWLEDGEMENTS
155              
156             Perl by Larry Wall.
157              
158             PDL by Karl Glazebrook, Tuomas J. Lukka, Christian Soeller, and others.
159              
160             =cut
161              
162             ##----------------------------------------------------------------------
163             =pod
164              
165             =head1 KNOWN BUGS
166              
167             No support for (pseudo)-threading.
168              
169             =cut
170              
171             ##---------------------------------------------------------------------
172             =pod
173              
174             =head1 AUTHOR
175              
176             Bryan Jurish Emoocow@cpan.orgE
177              
178             =head2 Copyright Policy
179              
180             All other parts Copyright (C) 2007-2024, Bryan Jurish. All rights reserved.
181              
182             This package is free software, and entirely without warranty.
183             You may redistribute it and/or modify it under the same terms
184             as Perl itself.
185              
186             =head1 SEE ALSO
187              
188             perl(1), PDL(3perl)
189              
190             =cut
191             #line 192 "Ops.pm"
192              
193             # Exit with OK status
194              
195             1;