Menu

#308 propagate badflag with .=

feature_request
closed-fixed
nobody
core (120)
4
2022-04-14
2012-07-12
Tim
No

Badflag is not being propagated to result when using .=. PDL::Ops::assgn has had this functionality removed due to complications in the Core (cf. Doug Burke).

use PDL;

print 'Bad status = ', $PDL::Bad::Status, "\n"; # 'Bad status = 1'
print 'Using badval = ', double->badvalue, "\n"; # Using badval = -1.79769313486232e+308

$a = sequence(double,10);
$b = zeroes(double,10,2);
my $mask = $a >= 6;
$b->slice(':,(1)') .= $a->setbadif($mask);
print $b, "\n", 'badflag = ', $b->badflag();

#OUTPUT
#*******************************************************************************************************************************************************
#[
# [ 0 0 0 0 0 0 0 0 0 0]
# [ 0 1 2 3 4 5 -1.7976931e+308 -1.7976931e+308 -1.7976931e+308 -1.7976931e+308]
#]
#
# badflag = 0

Further details are in the mailing list. http://mailman.jach.hawaii.edu/pipermail//pdl-porters/2012-July/004891.html

Thanks.

- Tim

Discussion

  • Doug Burke

    Doug Burke - 2012-07-12

    As the comments in the code suggest, I am no longer 100% sure why this restriction holds (or if it still does). I support the idea of trying to remove the restriction on a branch and seeing what tests break, after adding in some tests of the new behavior.

     
  • Chris Marshall

    Chris Marshall - 2015-02-22
    • Priority: 5 --> 4
     
  • Chris Marshall

    Chris Marshall - 2015-02-22

    Lower priority. Not planned for PDL-2.008

     
  • Chris Marshall

    Chris Marshall - 2015-10-03

    What is the status of this fix and is it ready for inclusion in PDL-2.014?

     
  • mohawk

    mohawk - 2018-04-09

    This matter will now be tracked at https://github.com/PDLPorters/pdl/issues/29

     
  • mohawk

    mohawk - 2022-04-14
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB