Changeset 3fc398 in git
- Timestamp:
- Sep 27, 2011, 5:09:53 PM (12 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- e75eabc61db8b91ae3f58093334be6ae2f694691
- Parents:
- 30a68478d0ec6f1ae5fc55c6907b025bedae4404
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/rootsur.lib
r30a684 r3fc398 179 179 lastsign = sign(l[1]); 180 180 181 for (int i = 1; i <= size(l); i = i + 1) { 182 if (sign(l[i]) != lastsign && sign(l[i]) != 0) { 181 for (int i = 1; i <= size(l); i++) 182 { 183 if (sign(l[i]) != lastsign && sign(l[i]) != 0) 184 { 183 185 numberofchanges++; 184 186 lastsign = sign(l[i]); … … 437 439 maximum = 0; 438 440 439 for (i = 1; i <= size(monic); i = i + 1) { 441 for (i = 1; i <= size(monic); i++) 442 { 440 443 maximum = max(abs(leadcoef(p[i])),maximum); 441 444 } … … 624 627 int result; 625 628 626 if (isparam(P) || isparam(a) || isparam(b)) { 627 ERROR("This procedure cannot operate with parametric arguments"); 628 } 629 if (isparam(P) || isparam(a) || isparam(b)) 630 { ERROR("This procedure cannot operate with parametric arguments"); } 631 if (!attrib(basering,"global")) 632 { ERROR("This procedure requires a global ordering"); } 629 633 630 634 variable = isuni(P); 631 635 632 if (variable == 0) { 633 ERROR ("P must be a univariate polynomial"); 634 } 635 636 if (a >= b) { 637 ERROR("a must be lower than b"); 638 } 636 if (variable == 0) { ERROR ("P must be a univariate polynomial"); } 637 638 if (a >= b) { ERROR("a must be lower than b"); } 639 639 640 640 if (subst(P,variable,a) == 0 || subst(P,variable,b) == 0) { … … 646 646 bound = maxabs(P); 647 647 648 if (a < -bound) { 649 a = -bound; 650 } 651 652 if (b > bound) { 653 b = bound; 654 } 648 if (a < -bound) { a = -bound; } 649 650 if (b > bound) { b = bound; } 655 651 656 652 // if (a == -bound && b == bound) { … … 786 782 EXAMPLE: example nrroots; shows an example" 787 783 { 788 if (isparam(p)) { 789 ERROR("This procedure cannot operate with parametric arguments"); 790 } 784 if (isparam(p)) 785 { ERROR("This procedure cannot operate with parametric arguments"); } 791 786 792 787 number a = maxabs(p); … … 916 911 result = 0; 917 912 918 while (i + dir >= 0 && i + dir <= size(l) + 1 && !result) { 919 if (l[i] == element) { 920 result = i; 921 } 913 while (i + dir >= 0 && i + dir <= size(l) + 1 && !result) 914 { 915 if (l[i] == element) { result = i; } 922 916 i = i + dir; 923 917 } … … 934 928 result = 0; 935 929 936 while (i + dir >= 0 && i + dir <= size(l) + 1 && !result) { 937 if (l[i] != element) { 938 result = i; 939 } 930 while (i + dir >= 0 && i + dir <= size(l) + 1 && !result) 931 { 932 if (l[i] != element) { result = i; } 940 933 i = i + dir; 941 934 }
Note: See TracChangeset
for help on using the changeset viewer.