128
128
}
129
129
130
130
my $bitwise = delete $extra{Bitwise};
131
+ my $export = delete $extra{Export};
131
132
pp_def($name,
132
133
Pars => 'a(); b(); [o]c();',
133
134
OtherPars => 'int $swap',
136
137
NoBadifNaN => 1,
137
138
Inplace => [ 'a' ],
138
139
Overload => [$op, $mutator, $bitwise],
140
+ NoExport => !$export,
139
141
Code => pp_line_numbers(__LINE__, <<EOF),
140
142
PDL_IF_BAD(char anybad = 0;,)
141
143
broadcastloop %{
@@ -184,6 +186,8 @@ ENDCODE
184
186
$codestr = '$c() = ($GENERIC(c))'.$func.'($a(),$b());';
185
187
}
186
188
delete $extra{unsigned}; #remove the key so it doesn't get added in pp_def.
189
+ my $export = delete $extra{Export};
190
+ my $noinfix = delete $extra{NoInfix};
187
191
188
192
pp_def($name,
189
193
HandleBad => 1,
@@ -192,7 +196,8 @@ ENDCODE
192
196
OtherPars => 'int $swap',
193
197
OtherParsDefaults => { swap => 0 },
194
198
Inplace => [ 'a' ],
195
- Overload => [$funcov, $mutator],
199
+ Overload => [$funcov, $mutator, undef, $noinfix],
200
+ NoExport => !$export,
196
201
Code => pp_line_numbers(__LINE__, <<EOF),
197
202
PDL_IF_BAD(char anybad = 0;,)
198
203
broadcastloop %{
@@ -232,6 +237,7 @@ sub ufunc {
232
237
(map 'types('.$_->ppsym.') %{$b() = c'.$func.$_->floatsuffix.'($a());%}', @Ctypes),
233
238
;
234
239
}
240
+ my $export = delete $extra{Export};
235
241
# do not have to worry about propagation of the badflag when
236
242
# inplace since only input ndarray is a, hence its badflag
237
243
# won't change
@@ -242,6 +248,7 @@ sub ufunc {
242
248
NoBadifNaN => 1,
243
249
Inplace => 1,
244
250
!$overload ? () : (Overload => $funcov),
251
+ NoExport => !$export,
245
252
Code => pp_line_numbers(__LINE__, <<EOF),
246
253
PDL_IF_BAD(if ( \$ISBAD(a()) ) \$SETBAD(b()); else {,)
247
254
$codestr
@@ -309,7 +316,7 @@ ufunc('bitnot','~',1,'unary bitwise negation',GenericTypes => $T);
309
316
310
317
# some standard binary functions
311
318
bifunc('power',['pow','op**'],1,'raise ndarray C<$a> to the power C<$b>',GenericTypes => [@$C, @$F]);
312
- bifunc('atan2','atan2',0,'elementwise C<atan2> of two ndarrays',GenericTypes => $F);
319
+ bifunc('atan2','atan2',0,'elementwise C<atan2> of two ndarrays',GenericTypes => $F, NoInfix => 1 );
313
320
bifunc('modulo',['MOD','op%'],1,'elementwise C<modulo> operation',unsigned=>1);
314
321
bifunc('spaceship',['SPACE','op<=>'],0,'elementwise "<=>" operation');
315
322
@@ -340,6 +347,7 @@ pp_def ( '_rabs',
340
347
HandleBad => 1,
341
348
NoBadifNaN => 1,
342
349
Inplace => 1,
350
+ NoExport => 1,
343
351
Code => pp_line_numbers(__LINE__-1, qq{
344
352
PDL_IF_BAD(if ( \$ISBAD(a()) ) \$SETBAD(b()); else,)
345
353
$rabs_code
@@ -348,13 +356,14 @@ PDL_IF_BAD(if ( \$ISBAD(a()) ) \$SETBAD(b()); else,)
348
356
PMFunc=>'',
349
357
);
350
358
351
- pp_export_nothing();
359
+ # the following pp_def'ed functions will be exported
352
360
353
361
# make log10() work on scalars (returning scalars)
354
362
# as well as ndarrays
355
363
ufunc('log10','log10',0,'the base 10 logarithm', GenericTypes => $A,
356
364
Exception => '$a() <= 0',
357
365
NoTgmath => 1, # glibc for at least GCC 8.3.0 won't tgmath log10 though 7.1.0 did
366
+ Export => 1,
358
367
PMCode => <<'EOF',
359
368
sub PDL::log10 {
360
369
my ($x, $y) = @_;
@@ -390,12 +399,14 @@ PDL_IF_BAD(if (anybad) $PDLSTATESETBAD(b);,)
390
399
sub cfunc {
391
400
my ($name, $func, $make_real, $force_complex, $doc, $backcode, %extra) = @_;
392
401
my $codestr = pp_line_numbers(__LINE__-1,"\$b() = $func(\$complexv());");
402
+ my $export = delete $extra{Export};
393
403
pp_def($name,
394
404
GenericTypes=>$C,
395
405
Pars => ($force_complex ? '!real ' : '').'complexv(); '.($make_real ? 'real' : '').' [o]b()',
396
406
HandleBad => 1,
397
407
NoBadifNaN => 1,
398
408
(($make_real || $force_complex) ? () : (Inplace => 1)),
409
+ NoExport => !$export,
399
410
Code => pp_line_numbers(__LINE__-1, qq{
400
411
PDL_IF_BAD(if ( \$ISBAD(complexv()) ) \$SETBAD(b()); else,)
401
412
$codestr
@@ -414,8 +425,8 @@ PDL_IF_BAD(if ( \$ISBAD(complexv()) ) \$SETBAD(b()); else,)
414
425
);
415
426
}
416
427
417
- cfunc('carg', 'carg', 1, 1, 'Returns the polar angle of a complex number.', undef);
418
- cfunc('conj', 'conj', 0, 0, 'complex conjugate.', undef);
428
+ cfunc('carg', 'carg', 1, 1, 'Returns the polar angle of a complex number.', undef, Export => 1 );
429
+ cfunc('conj', 'conj', 0, 0, 'complex conjugate.', undef, Export => 1 );
419
430
420
431
pp_def('czip',
421
432
Pars => '!complex r(); !complex i(); complex [o]c()',
0 commit comments