Changeset 99cfcba in git
- Timestamp:
- Apr 8, 1998, 12:01:58 PM (25 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- e3cab3223ca48edb3c313973c3907bd9a256f319
- Parents:
- 33e52153b30e64770ad38770e23349caf3d128fb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/hdegree.cc
r33e521 r99cfcba 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: hdegree.cc,v 1.1 1 1998-04-07 18:13:57 SingularExp $ */4 /* $Id: hdegree.cc,v 1.12 1998-04-08 10:01:58 pohl Exp $ */ 5 5 /* 6 6 * ABSTRACT - dimension, multiplicity, HC, kbase … … 73 73 Exponent_t mc; 74 74 hexist = hInit(S, Q, &hNexist); 75 if ( hNexist==0)75 if (!hNexist) 76 76 return pVariables; 77 77 hwork = (scfmon)Alloc(hNexist * sizeof(scmon)); … … 79 79 hpure = (scmon)Alloc((1 + (pVariables * pVariables)) * sizeof(Exponent_t)); 80 80 mc = hisModule; 81 if ( mc==0)81 if (!mc) 82 82 { 83 83 hrad = hexist; … … 90 90 loop 91 91 { 92 if (mc !=0)92 if (mc) 93 93 hComp(hexist, hNexist, mc, hrad, &hNrad); 94 if (hNrad !=0)94 if (hNrad) 95 95 { 96 96 hNvar = pVariables; 97 97 hRadical(hrad, &hNrad, hNvar); 98 98 hSupp(hrad, hNrad, hvar, &hNvar); 99 if (hNvar !=0)99 if (hNvar) 100 100 { 101 101 memset(hpure, 0, (pVariables + 1) * sizeof(Exponent_t)); … … 119 119 Free((ADDRESS)hwork, hNexist * sizeof(scmon)); 120 120 hDelete(hexist, hNexist); 121 if (hisModule !=0)121 if (hisModule) 122 122 Free((ADDRESS)hrad, hNexist * sizeof(scmon)); 123 123 return pVariables - hCo; … … 139 139 { 140 140 hCo = dn; 141 for (iv=pVariables; iv >0; iv--)142 { 143 if (pure[iv] !=0)141 for (iv=pVariables; iv; iv--) 142 { 143 if (pure[iv]) 144 144 hInd[iv] = 0; 145 145 else 146 146 hInd[iv] = 1; 147 147 } 148 if (Nrad !=0)148 if (Nrad) 149 149 { 150 150 pn = *rad; … … 153 153 { 154 154 x = var[iv]; 155 if (pn[x] !=0)155 if (pn[x]) 156 156 { 157 157 hInd[x] = 0; … … 169 169 while(pure[var[iv]]) iv--; 170 170 hStepR(rad, Nrad, var, iv, &rad0); 171 if (rad0 !=0)171 if (rad0) 172 172 { 173 173 iv--; … … 195 195 { 196 196 hCo = Npure + 1; 197 for (x=pVariables; x >0; x--)198 { 199 if (pure[x] !=0)197 for (x=pVariables; x; x--) 198 { 199 if (pure[x]) 200 200 hInd[x] = 0; 201 201 else … … 265 265 Free((ADDRESS)hwork, hNexist * sizeof(scmon)); 266 266 hDelete(hexist, hNexist); 267 if (hisModule !=0)267 if (hisModule) 268 268 Free((ADDRESS)hrad, hNexist * sizeof(scmon)); 269 269 return Set; … … 303 303 for (iv=pVariables; iv!=0 ; iv--) 304 304 { 305 if (pure[iv] !=0)305 if (pure[iv]) 306 306 (*Set)[iv-1] = 0; 307 307 else … … 331 331 { 332 332 x = var[iv]; 333 if (pn[x] !=0)333 if (pn[x]) 334 334 { 335 335 pure[x] = 1; … … 350 350 loop 351 351 { 352 if( pure[var[iv]]==0)352 if(!pure[var[iv]]) 353 353 { 354 354 if(hNotZero(rad, Nrad, var, iv)) … … 360 360 } 361 361 iv--; 362 if ( iv==0)362 if (!iv) 363 363 return; 364 364 } 365 365 } 366 while(pure[var[iv]] !=0) iv--;366 while(pure[var[iv]]) iv--; 367 367 hStepR(rad, Nrad, var, iv, &rad0); 368 368 iv--; … … 486 486 for (iv=pVariables; iv; iv--) 487 487 { 488 if (pure[iv] !=0)488 if (pure[iv]) 489 489 (*Set)[iv-1] = 0; 490 490 else … … 506 506 if (dn > hCo) 507 507 { 508 if ( Nrad==0)508 if (!Nrad) 509 509 hCheckIndep(pure); 510 510 else 511 511 { 512 512 pn = *rad; 513 for (iv = Nvar; iv >0; iv--)513 for (iv = Nvar; iv; iv--) 514 514 { 515 515 x = var[iv]; 516 if (pn[x] !=0)516 if (pn[x]) 517 517 { 518 518 pure[x] = 1; … … 526 526 } 527 527 iv = Nvar; 528 while(pure[var[iv]] !=0) iv--;528 while(pure[var[iv]]) iv--; 529 529 hStepR(rad, Nrad, var, iv, &rad0); 530 530 iv--; … … 574 574 hRadical(hrad, &hNrad, hNvar); 575 575 hSupp(hrad, hNrad, hvar, &hNvar); 576 if (hNvar !=0)576 if (hNvar) 577 577 { 578 578 hCo = hNvar; … … 582 582 hDimSolve(hpure, hNpure, hrad, hNrad, hvar, hNvar); 583 583 } 584 if ( (hCo!=0)&& (hCo < pVariables))584 if (hCo && (hCo < pVariables)) 585 585 { 586 586 hIndMult(hpure, hNpure, hrad, hNrad, hvar, hNvar); … … 649 649 scmon pn; 650 650 scfmon sn; 651 if ( iv==0)651 if (!iv) 652 652 return pure[var[1]]; 653 else if ( Nstc==0)653 else if (!Nstc) 654 654 { 655 655 sum = 1; 656 for (i = Nvar; i >0; i--)656 for (i = Nvar; i; i--) 657 657 sum *= pure[var[i]]; 658 658 return sum; … … 695 695 for (i = 1; i <= pVariables; i++) 696 696 { 697 if (pure[i] !=0)697 if (pure[i]) 698 698 { 699 699 i0++; … … 723 723 if (dn == hCo) 724 724 { 725 if ( Nrad==0)725 if (!Nrad) 726 726 hProject(pure, hsel); 727 727 else 728 728 { 729 729 pn = *rad; 730 for (iv = Nvar; iv >0; iv--)730 for (iv = Nvar; iv; iv--) 731 731 { 732 732 x = var[iv]; 733 if (pn[x] !=0)733 if (pn[x]) 734 734 { 735 735 pure[x] = 1; … … 750 750 loop 751 751 { 752 if( pure[var[iv]]==0)752 if(!pure[var[iv]]) 753 753 { 754 754 if(hNotZero(rad, Nrad, var, iv)) … … 760 760 } 761 761 iv--; 762 if ( iv==0)762 if (!iv) 763 763 return; 764 764 } … … 793 793 Exponent_t mc; 794 794 hexist = hInit(S, Q, &hNexist); 795 if ( hNexist==0)795 if (!hNexist) 796 796 { 797 797 hCo = 0; … … 806 806 mc = hisModule; 807 807 hrad = (scfmon)Alloc(hNexist * sizeof(scmon)); 808 if ( mc==0)808 if (!mc) 809 809 { 810 810 memcpy(hrad, hexist, hNexist * sizeof(scmon)); … … 820 820 loop 821 821 { 822 if (mc !=0)822 if (mc) 823 823 { 824 824 hComp(hexist, hNexist, mc, hrad, &hNrad); … … 826 826 memcpy(hstc, hrad, hNrad * sizeof(scmon)); 827 827 } 828 if (hNrad !=0)828 if (hNrad) 829 829 { 830 830 hNvar = pVariables; 831 831 hRadical(hrad, &hNrad, hNvar); 832 832 hSupp(hrad, hNrad, hvar, &hNvar); 833 if (hNvar !=0)833 if (hNvar) 834 834 { 835 835 hCo = hNvar; … … 850 850 hMu = 0; 851 851 } 852 if ( (hNvar!=0)&& (hCo == di))853 { 854 if ( (di!=0)&& (di < pVariables))852 if (hNvar && (hCo == di)) 853 { 854 if (di && (di < pVariables)) 855 855 hDimMult(hpure, hNpure, hrad, hNrad, hvar, hNvar); 856 else if ( di==0)856 else if (!di) 857 857 hMu++; 858 858 else … … 1376 1376 if (di != 0) 1377 1377 { 1378 Werror("KBase not finite");1379 return idInit(1, 1);1378 //Werror("KBase not finite"); 1379 return idInit(1,s->rank); 1380 1380 } 1381 1381 }
Note: See TracChangeset
for help on using the changeset viewer.