#308 propagate badflag with .=

feature_request
open
nobody
core (120)
4
2015-10-03
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?

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks