bad.pd (PDL-2.074) | : | bad.pd (PDL-2.075) | ||
---|---|---|---|---|
skipping to change at line 836 | skipping to change at line 836 | |||
Inplace => 1, | Inplace => 1, | |||
CopyBadStatusCode => q{ | CopyBadStatusCode => q{ | |||
/* note: not quite the normal check since set b bad within Code */ | /* note: not quite the normal check since set b bad within Code */ | |||
/* we propagate the bad flag even if a was originally bad since */ | /* we propagate the bad flag even if a was originally bad since */ | |||
/* there is no easy way to pass this information around */ | /* there is no easy way to pass this information around */ | |||
if ( a == b && $ISPDLSTATEBAD(b) ) | if ( a == b && $ISPDLSTATEBAD(b) ) | |||
PDL->propagate_badflag( b, 1 ); /* propagate badflag if inplace */ | PDL->propagate_badflag( b, 1 ); /* propagate badflag if inplace */ | |||
}, | }, | |||
Code => q[ | Code => q[ | |||
int flag = 0; | int flag = 0; | |||
threadloop %{ | broadcastloop %{ | |||
if ( PDL_ISNAN_$PPSYM()($a()) ) { | if ( PDL_ISNAN_$PPSYM()($a()) ) { | |||
$SETBAD(b()); | $SETBAD(b()); | |||
flag = 1; | flag = 1; | |||
} | } | |||
else { | else { | |||
$b() = $a(); | $b() = $a(); | |||
} | } | |||
%} | %} | |||
if ( flag ) $PDLSTATESETBAD(b); | if ( flag ) $PDLSTATESETBAD(b); | |||
], | ], | |||
skipping to change at line 890 | skipping to change at line 890 | |||
Inplace => 1, | Inplace => 1, | |||
CopyBadStatusCode => q{ | CopyBadStatusCode => q{ | |||
/* note: not quite the normal check since set b bad within Code */ | /* note: not quite the normal check since set b bad within Code */ | |||
/* we propagate the bad flag even if a was originally bad since */ | /* we propagate the bad flag even if a was originally bad since */ | |||
/* there is no easy way to pass this information around */ | /* there is no easy way to pass this information around */ | |||
if ( a == b && $ISPDLSTATEBAD(b) ) | if ( a == b && $ISPDLSTATEBAD(b) ) | |||
PDL->propagate_badflag( b, 1 ); /* propagate badflag if inplace */ | PDL->propagate_badflag( b, 1 ); /* propagate badflag if inplace */ | |||
}, | }, | |||
Code => q[ | Code => q[ | |||
int flag = 0; | int flag = 0; | |||
threadloop %{ | broadcastloop %{ | |||
if ( !PDL_ISFINITE_$PPSYM()($a()) && !PDL_ISNAN_$PPSYM()($a()) ) { | if ( !PDL_ISFINITE_$PPSYM()($a()) && !PDL_ISNAN_$PPSYM()($a()) ) { | |||
$SETBAD(b()); | $SETBAD(b()); | |||
flag = 1; | flag = 1; | |||
} | } | |||
else { | else { | |||
$b() = $a(); | $b() = $a(); | |||
} | } | |||
%} | %} | |||
if ( flag ) $PDLSTATESETBAD(b); | if ( flag ) $PDLSTATESETBAD(b); | |||
], | ], | |||
skipping to change at line 944 | skipping to change at line 944 | |||
Inplace => 1, | Inplace => 1, | |||
CopyBadStatusCode => q{ | CopyBadStatusCode => q{ | |||
/* note: not quite the normal check since set b bad within Code */ | /* note: not quite the normal check since set b bad within Code */ | |||
/* we propagate the bad flag even if a was originally bad since */ | /* we propagate the bad flag even if a was originally bad since */ | |||
/* there is no easy way to pass this information around */ | /* there is no easy way to pass this information around */ | |||
if ( a == b && $ISPDLSTATEBAD(b) ) | if ( a == b && $ISPDLSTATEBAD(b) ) | |||
PDL->propagate_badflag( b, 1 ); /* propagate badflag if inplace */ | PDL->propagate_badflag( b, 1 ); /* propagate badflag if inplace */ | |||
}, | }, | |||
Code => q[ | Code => q[ | |||
int flag = 0; | int flag = 0; | |||
threadloop %{ | broadcastloop %{ | |||
if ( !PDL_ISFINITE_$PPSYM()($a()) ) { | if ( !PDL_ISFINITE_$PPSYM()($a()) ) { | |||
$SETBAD(b()); | $SETBAD(b()); | |||
flag = 1; | flag = 1; | |||
} | } | |||
else { | else { | |||
$b() = $a(); | $b() = $a(); | |||
} | } | |||
%} | %} | |||
if ( flag ) $PDLSTATESETBAD(b); | if ( flag ) $PDLSTATESETBAD(b); | |||
], | ], | |||
skipping to change at line 1041 | skipping to change at line 1041 | |||
values are copied with no replacement. | values are copied with no replacement. | |||
=cut | =cut | |||
HandleBad => 1, | HandleBad => 1, | |||
Inplace => 1, | Inplace => 1, | |||
Code => '$b() = $a();', | Code => '$b() = $a();', | |||
BadCode => q{ | BadCode => q{ | |||
$GENERIC(b) replace = ($GENERIC(b)) $COMP(newval); | $GENERIC(b) replace = ($GENERIC(b)) $COMP(newval); | |||
$GENERIC(b) a_val; | $GENERIC(b) a_val; | |||
threadloop %{ | broadcastloop %{ | |||
a_val = $a(); | a_val = $a(); | |||
if ( $ISBADVAR(a_val,a) ) { | if ( $ISBADVAR(a_val,a) ) { | |||
$b() = replace; | $b() = replace; | |||
} else { | } else { | |||
$b() = a_val; | $b() = a_val; | |||
} | } | |||
%} | %} | |||
}, | }, | |||
CopyBadStatusCode => q{ | CopyBadStatusCode => q{ | |||
/* propagate badflag if inplace AND its changed */ | /* propagate badflag if inplace AND its changed */ | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added |