in reply to Re^4: first stumbling steps in PDL
in thread first stumbling steps in PDL
Now I have two different solutions to cope with a missing argument to tricpy. Both meet the target, as all these statements are valid and produce the same result:
Though I like the first solution more, it raises a documentation issue.tricpy($m, 0, $c); $c = $m->tricpy(0); $c = $m->tricpy
First:
pp_def( 'tricpy', Pars => 'A(m,n);[o] C(m,n)', OtherPars => 'int uplo', OtherParsDefaults => {uplo => 0}, ArgOrder => [qw(A uplo C)], Code => ' ... ', Doc => <<EOT =for ref Copy triangular part to another matrix. If uplo == 0 copy upper triang +ular part. =cut EOT
Second:
pp_def( 'tricpy', Pars => 'A(m,n);uplo();[o] C(m,n)', PMCode => 'sub PDL::tricpy { return PDL::_tricpy_int(@_) if @_ == 3; my ($A, $uplo) = @_; PDL::_tricpy_int($A, $uplo // 0, my $C = PDL->null); $C; }', Code => ' ... ', Doc => <<EOT =for ref Copy triangular part to another matrix. If uplo == 0 copy upper triang +ular part. =cut EOT );
The generated POD for the first version is misleading, as the signature doesn't conform to the actual argument order:
tricpy Signature: (A(m,n);[o] C(m,n); int uplo) Copy triangular part to another matrix. If uplo == 0 copy upper triangular part. tricpy 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 ndarra +ys.
Any suggestions?
Greetings,
-jo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: first stumbling steps in PDL
by etj (Priest) on Feb 06, 2024 at 17:58 UTC | |
by jo37 (Curate) on Feb 07, 2024 at 20:53 UTC | |
by etj (Priest) on Feb 08, 2024 at 02:07 UTC |