Skip to content

Commit

Permalink
Made flag for negative powers in SymbolNormalize
Browse files Browse the repository at this point in the history
  • Loading branch information
vermaseren committed Jun 30, 2015
1 parent b4f3dd2 commit 90761d6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sources/normal.c
Original file line number Diff line number Diff line change
Expand Up @@ -5101,6 +5101,7 @@ Nexti:;
/*
Veto negative powers
*/
if ( AT.LeaveNegative == 0 ) {
b = buffer; bb = b + b[1]; b += 3;
while ( b < bb ) {
if ( *b < 0 ) {
Expand All @@ -5111,6 +5112,7 @@ Nexti:;
}
b += 2;
}
}
/*
Now we use the fact that the new term will not be longer than the old one
Actually it should be shorter when there is more than one subterm!
Expand Down
2 changes: 2 additions & 0 deletions sources/ratio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2982,7 +2982,9 @@ NormArg:;
/*
We can use MultiplyWithTerm.
*/
AT.LeaveNegative = 1;
numerator = MultiplyWithTerm(BHEAD arg1+ARGHEAD,rmininv,0);
AT.LeaveNegative = 0;
r[-1] = rcopy;
r = numerator; while ( *r ) r += *r;
AT.WorkPointer = r+1;
Expand Down
1 change: 1 addition & 0 deletions sources/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,7 @@ WORD IniVars()
AT.inprimelist = -1;
AT.sizeprimelist = 0;
AT.primelist = 0;
AT.LeaveNegative = 0;
AT.TrimPower = 0;
AN.SplitScratch = 0;
AN.SplitScratchSize = AN.InScratch = 0;
Expand Down
2 changes: 1 addition & 1 deletion sources/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,7 @@ struct T_const {
int ListSymbolsSize;
int NumListSymbols;
int numpoly;
int ListPolySize;
int LeaveNegative;
int TrimPower; /* Indicates trimming in polyratfun expansion */
WORD small_power_maxx; /* size of the cache for small powers */
WORD small_power_maxn; /* size of the cache for small powers */
Expand Down

0 comments on commit 90761d6

Please sign in to comment.