Skip to content

Commit

Permalink
shortcut reduces indent
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Feb 19, 2024
1 parent 8eb2848 commit ed947b8
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Basic/Primitive/primitive.pd
Original file line number Diff line number Diff line change
Expand Up @@ -1006,16 +1006,14 @@ pp_def('wtstat',
complex long double statsum = 0;
PDL_IF_BAD(int flag = 0;,)
loop(n) %{
PDL_IF_BAD(if ($ISGOOD(wt()) && $ISGOOD(a()) && $ISGOOD(avg())),) {
complex long double tmp;
PDL_Indx i;
wtsum += $wt();
tmp=1;
for(i=0; i<$COMP(deg); i++)
tmp *= $a();
statsum += $wt() * (tmp - $avg());
PDL_IF_BAD(flag = 1;,)
}
PDL_IF_BAD(if (!($ISGOOD(wt()) && $ISGOOD(a()) && $ISGOOD(avg()))) continue;,)
PDL_Indx i;
wtsum += $wt();
complex long double tmp=1;
for(i=0; i<$COMP(deg); i++)
tmp *= $a();
statsum += $wt() * (tmp - $avg());
PDL_IF_BAD(flag = 1;,)
%}
PDL_IF_BAD(if (!flag) { $SETBAD(b()); $PDLSTATESETBAD(b); }
else,) { $b() = statsum / wtsum; }',
Expand Down

0 comments on commit ed947b8

Please sign in to comment.