I am trying to understand how to handle BAD values, but can do with some
help. I want to know how to properly deal with this warning "WARNING:
routine does not handle bad values." Here is some sample code.
------
print (transpose($a) x $a);
.
.
.
sub mysub{
my ($pdla) = @_;
if (!$pdla->badflag()) { transpose($pdla) x $pdla;}
else { my $pdlb=pdl(0)->inplace->setvaltobad( 0 );}
}
print mysub($a) ? "result is undefined\n" : "a is, $a";
------
If $a has a bad value the first line will give the correct answer with
bad values where you expect them, but gives a warning: "WARNING: routine
does not handle bad values."
The sub will not give the warning but of course the answer is now
undefined.
1) How can I use the 'x' operator, with the correct propagation of the
bad values, but without the warning.
2) The line with "else { my $pdlb=pdl(0)->inplace->setvaltobad( 0 );}"
is fairly ugly, is there a shorter way to do the same?
Any help appreciated, I could not find the answer in the documentation
for PDL::Badbalues or in the PDL::Bad manpage. If avoidable I will stay
away from using the PP_def structures.
Regards Louis
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl