Changeset fca87a in git
- Timestamp:
- Apr 30, 2009, 7:00:27 PM (14 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 0661d420fbd0c4909468e67e60c2b21895686e9d
- Parents:
- 86f23e885c1e8d5a7cd1318b09da181f353e0393
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/digitech.cc
r86f23e rfca87a 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: digitech.cc,v 1. 5 2007-01-11 10:57:51Singular Exp $ */4 /* $Id: digitech.cc,v 1.6 2009-04-30 17:00:27 Singular Exp $ */ 5 5 #include "mod2.h" 6 6 #include "ring.h" … … 11 11 static ideal zero_ideal; 12 12 #if 1 13 void bit_reduce(poly & f,ring r){ 13 void bit_reduce(poly & f,ring r) 14 { 14 15 poly p=f; 15 16 kBucket_pt erg_bucket= kBucketCreate(r); 16 17 kBucketInit(erg_bucket,NULL,0 /*pLength(P.p)*/); 17 while(p){ 18 while(p) 19 { 18 20 poly next=pNext(p); 19 21 pNext(p)=NULL; … … 21 23 int i; 22 24 int max=rVar(r); 23 for(i=1;i<=max;i++){ 25 for(i=1;i<=max;i++) 26 { 24 27 unsigned long exp=p_GetExp(p,i,r); 25 28 if(exp!=0) 26 27 29 p_SetExp(p,i,1,r); 30 28 31 } 29 32 p_Setm(p,r); … … 43 46 44 47 45 void do_bit_reduce(poly f, kBucket_pt bucket){ 48 void do_bit_reduce(poly f, kBucket_pt bucket) 49 { 46 50 ring r=bucket->bucket_ring; 47 51 int p=rChar(r); … … 56 60 //return; 57 61 //} 58 62 59 63 BOOLEAN changed=FALSE; 60 64 poly next=pNext(f); 61 65 pNext(f)=NULL; 62 66 int i; 63 for(i=1;i<=max;i++){ 67 for(i=1;i<=max;i++) 68 { 64 69 unsigned long exp; 65 70 while((exp=p_GetExp(f,i,r))>=p){ 66 p_SetExp(f,i,exp-p+1,r); 67 changed=TRUE; 68 } 69 } 70 71 if (changed) { 72 p_Setm(f,r); 73 71 p_SetExp(f,i,exp-p+1,r); 72 changed=TRUE; 73 } 74 } 75 76 if (changed) 77 { 78 p_Setm(f,r); 79 74 80 int pseudo_len=0; 75 81 kBucket_Add_q(bucket,f,&pseudo_len); 76 82 //do_bit_reduce(next,bucket); 77 } else { 83 } 84 else 85 { 78 86 //do_bit_reduce(next,bucket); 79 87 int pseudo_len=0; 80 88 kBucket_Add_q(bucket,f,&pseudo_len); 81 89 82 90 } 83 91 f=next; 84 92 } 85 93 } 86 poly do_bitreduce(poly f, ring r){ 94 poly do_bitreduce(poly f, ring r) 95 { 87 96 poly erg=NULL; 88 97 poly *append_to=&erg; … … 91 100 kBucket_pt bucket= kBucketCreate(r); 92 101 kBucketInit(bucket,NULL,0 /*pLength(P.p)*/); 93 while(f!=NULL){ 102 while(f!=NULL) 103 { 94 104 BOOLEAN changed=FALSE; 95 105 poly next=pNext(f); … … 97 107 assume(pNext(f)==NULL); 98 108 int i; 99 for(i=1;i<=max;i++){ 100 unsigned long exp; 101 while((exp=p_GetExp(f,i,r))>=p){ 102 p_SetExp(f,i,exp-p+1,r); 103 changed=TRUE; 104 } 105 } 106 if (changed) { 109 for(i=1;i<=max;i++) 110 { 111 unsigned long exp; 112 while((exp=p_GetExp(f,i,r))>=p) 113 { 114 p_SetExp(f,i,exp-p+1,r); 115 changed=TRUE; 116 } 117 } 118 if (changed) 119 { 107 120 p_Setm(f,r); 108 121 int pseudo_len=0; 109 122 kBucket_Add_q(bucket,f,&pseudo_len); 110 } else { 123 } 124 else 125 { 111 126 (*append_to)=f; 112 127 append_to=&(pNext(f)); … … 122 137 return erg; 123 138 } 124 void bit_reduce2(poly & f,ring r){ 139 void bit_reduce2(poly & f,ring r) 140 { 125 141 if (f==NULL) return; 126 142 if (pNext(f)==NULL){ … … 131 147 assume(pNext(f)==NULL); 132 148 int i; 133 for(i=1;i<=max;i++){ 134 unsigned long exp; 135 while((exp=p_GetExp(f,i,r))>=p){ 136 p_SetExp(f,i,exp-p+1,r); 137 changed=TRUE; 149 for(i=1;i<=max;i++) 150 { 151 unsigned long exp; 152 while((exp=p_GetExp(f,i,r))>=p) 153 { 154 p_SetExp(f,i,exp-p+1,r); 155 changed=TRUE; 138 156 } 139 157 } … … 149 167 // kBucketDestroy(&bucket); 150 168 f=do_bitreduce(f,r); 151 152 } 153 void bit_reduce1(poly & f,ring r){ 169 170 } 171 void bit_reduce1(poly & f,ring r) 172 { 154 173 if (f==NULL) return; 155 174 156 157 if (pNext(f)==NULL){ 175 176 if (pNext(f)==NULL) 177 { 158 178 int p=rChar(r); 159 179 int max=rVar(r); … … 162 182 assume(pNext(f)==NULL); 163 183 int i; 164 for(i=1;i<=max;i++){ 165 unsigned long exp; 166 while((exp=p_GetExp(f,i,r))>=p){ 167 p_SetExp(f,i,exp-p+1,r); 168 changed=TRUE; 184 for(i=1;i<=max;i++) 185 { 186 unsigned long exp; 187 while((exp=p_GetExp(f,i,r))>=p) 188 { 189 p_SetExp(f,i,exp-p+1,r); 190 changed=TRUE; 169 191 } 170 192 } … … 179 201 kBucketClear(bucket,&f, &len); 180 202 kBucketDestroy(&bucket); 181 203 182 204 } 183 205 // void bit_reduce_arg(poly & f,ring r){ … … 188 210 #endif 189 211 190 poly uni_subst_bits(poly outer_uni, poly inner_multi, ring r){ 212 poly uni_subst_bits(poly outer_uni, poly inner_multi, ring r) 213 { 191 214 zero_ideal=idInit(0,1); 192 215 //assumes outer_uni is univariate and ordering global 193 216 int d_max=p_GetExp(outer_uni,1,r); 194 poly* potences=(poly*) om alloc((d_max+1)*sizeof(poly));217 poly* potences=(poly*) omAlloc((d_max+1)*sizeof(poly)); 195 218 potences[0]=p_ISet(1,r); 196 219 int i; 197 for(i=1;i<=d_max;i++){ 220 for(i=1;i<=d_max;i++) 221 { 198 222 potences[i]=pp_Mult_qq(potences[i-1],inner_multi,r); 199 223 bit_reduce(potences[i],r); … … 205 229 206 230 207 while(p){ 231 while(p) 232 { 208 233 int d=p_GetExp(p,1,r); 209 234 assume(potences[d]!=NULL); //mustn't always hold, but for most input … … 218 243 219 244 //free potences 220 for(i=0;i<=d_max;i++){ 245 for(i=0;i<=d_max;i++) 246 { 221 247 p_Delete(&potences[i],r); 222 248 } -
kernel/fast_mult.cc
r86f23e rfca87a 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: fast_mult.cc,v 1.2 1 2007-01-11 10:37:51Singular Exp $ */4 /* $Id: fast_mult.cc,v 1.22 2009-04-30 16:57:20 Singular Exp $ */ 5 5 #include "mod2.h" 6 6 #include "ring.h" … … 12 12 static const int pass_option=1; 13 13 static int mults=0; 14 int Mults(){ 14 int Mults() 15 { 15 16 return mults; 16 17 } 17 static void degsplit(poly p,int n,poly &p1,poly&p2, int vn, ring r){ 18 static void degsplit(poly p,int n,poly &p1,poly&p2, int vn, ring r) 19 { 18 20 poly erg1_i, erg2_i; 19 21 erg1_i=NULL; 20 22 erg2_i=NULL; 21 while(p){ 22 if(p_GetExp(p,vn,r)>=n){ 23 if (p1==NULL){ 24 p1=p; 25 } else{ 26 pNext(erg1_i)=p; 23 while(p) 24 { 25 if(p_GetExp(p,vn,r)>=n) 26 { 27 if (p1==NULL) 28 { 29 p1=p; 30 } 31 else 32 { 33 pNext(erg1_i)=p; 27 34 } 28 35 erg1_i=p; 29 } else{ 30 if (p2==NULL){ 31 p2=p; 32 } else{ 33 pNext(erg2_i)=p; 36 } 37 else 38 { 39 if (p2==NULL) 40 { 41 p2=p; 42 } 43 else 44 { 45 pNext(erg2_i)=p; 34 46 } 35 47 erg2_i=p; … … 37 49 p=pNext(p); 38 50 } 39 if(erg2_i){ 51 if(erg2_i) 52 { 40 53 pNext(erg2_i)=NULL; 41 54 } 42 if (erg1_i){ 55 if (erg1_i) 56 { 43 57 pNext(erg1_i)=NULL; 44 58 } 45 46 } 47 static void div_by_x_power_n(poly p, int n, int vn, ring r){ 48 while(p){ 59 60 } 61 static void div_by_x_power_n(poly p, int n, int vn, ring r) 62 { 63 while(p) 64 { 49 65 assume(p_GetExp(p,vn,r)>=n); 50 66 int e=p_GetExp(p,vn,r); … … 54 70 } 55 71 56 static poly do_unifastmult(poly f,int df,poly g,int dg, int vn, fastmultrec rec, ring r){ 72 static poly do_unifastmult(poly f,int df,poly g,int dg, int vn, fastmultrec rec, ring r) 73 { 57 74 int n=1; 58 75 if ((f==NULL)||(g==NULL)) return NULL; 59 76 //int df=pGetExp(f,vn);//pFDeg(f); 60 77 // int dg=pGetExp(g,vn);//pFDeg(g); 61 78 62 79 int dm; 63 if(df>dg){ 80 if(df>dg) 81 { 64 82 dm=df; 65 }else{ 83 } 84 else 85 { 66 86 dm=dg; 67 87 } … … 70 90 n*=2; 71 91 } 72 if(n==1){ 92 if(n==1) 93 { 73 94 return(pp_Mult_qq(f,g,r)); 74 95 } 75 96 76 97 int pot=n/2; 77 98 assume(pot*2==n); … … 88 109 degsplit(p_Copy(g,r),pot,g1,g0,vn,r); 89 110 div_by_x_power_n(g1,pot,vn,r); 90 111 91 112 //p00, p11 92 113 poly p00=rec(f0,g0,r);//unifastmult(f0,g0); … … 101 122 erg=p_Add_q(erg,p_Copy(p00,r),r); 102 123 103 104 105 106 107 if((f1!=NULL) &&(f0!=NULL) &&(g0!=NULL) && (g1!=NULL)){ 124 125 126 127 128 if((f1!=NULL) &&(f0!=NULL) &&(g0!=NULL) && (g1!=NULL)) 129 { 108 130 //if(true){ 109 131 //eat up f0,f1,g0,g1 … … 114 136 p_Delete(&s2,r); 115 137 116 138 117 139 //eat up pbig 118 140 poly sum=pbig; 119 141 p_SetExp(factor,vn,pot,r); 120 142 121 143 //eat up p00 122 144 sum=p_Add_q(sum,p_Neg(p00,r),r); 123 145 124 146 //eat up p11 125 147 sum=p_Add_q(sum,p_Neg(p11,r),r); 126 148 127 149 128 150 sum=p_Mult_mm(sum,factor,r); 129 151 … … 131 153 //eat up sum 132 154 erg=p_Add_q(sum,erg,r); 133 } else { 134 //eat up f0,f1,g0,g1 155 } 156 else 157 { 158 //eat up f0,f1,g0,g1 135 159 poly s1=rec(f0,g1,r); 136 160 poly s2=rec(g0,f1,r); … … 145 169 erg=p_Add_q(erg,h,r); 146 170 } 147 148 171 172 149 173 p_Delete(&factor,r); 150 151 174 175 152 176 153 177 return(erg); … … 155 179 156 180 // poly do_unifastmult_buckets(poly f,poly g){ 157 158 181 182 159 183 160 184 … … 163 187 // int df=pGetExp(f,1);//pFDeg(f); 164 188 // int dg=pGetExp(g,1);//pFDeg(g); 165 189 166 190 // int dm; 167 191 // if(df>dg){ … … 195 219 // degsplit(pCopy(g),pot,g1,g0); 196 220 // div_by_x_power_n(g1,pot); 197 221 198 222 // //p00 199 223 // //p11 200 224 // poly p00=unifastmult(f0,g0); 201 225 // poly p11=unifastmult(f1,g1); 202 226 203 227 204 228 205 229 206 230 // //eat up f0,f1,g0,g1 207 // poly pbig=unifastmult(pAdd(f0,f1),pAdd(g0,g1)); 231 // poly pbig=unifastmult(pAdd(f0,f1),pAdd(g0,g1)); 208 232 // poly factor=pOne();//pCopy(erg_mult); 209 233 // pSetExp(factor,1,n); … … 224 248 // kBucket_Add_q(erg_bucket,pMult_mm(pNeg(p11),factor),&pseudo_len); 225 249 226 250 227 251 // pseudo_len=0; 228 252 229 253 230 254 // pDelete(&factor); 231 255 … … 238 262 // } 239 263 240 static inline int max(int a, int b){ 264 static inline int max(int a, int b) 265 { 241 266 return (a>b)? a:b; 242 267 } 243 static inline int min(int a, int b){ 268 static inline int min(int a, int b) 269 { 244 270 return (a>b)? b:a; 245 271 } 246 poly unifastmult(poly f,poly g, ring r){ 272 poly unifastmult(poly f,poly g, ring r) 273 { 247 274 int vn=1; 248 275 if((f==NULL)||(g==NULL)) return NULL; … … 261 288 } 262 289 263 poly multifastmult(poly f, poly g, ring r){ 290 poly multifastmult(poly f, poly g, ring r) 291 { 264 292 mults++; 265 293 if((f==NULL)||(g==NULL)) return NULL; … … 273 301 int can_dg=0; 274 302 int can_crit=0; 275 for(i=1;i<=rVar(r);i++){ 303 for(i=1;i<=rVar(r);i++) 304 { 276 305 poly p; 277 306 int df=0; … … 279 308 //max min max Strategie 280 309 p=f; 281 while(p){ 310 while(p) 311 { 282 312 df=max(df,p_GetExp(p,i,r)); 283 313 p=pNext(p); 284 314 } 285 if(df>can_crit){ 315 if(df>can_crit) 316 { 286 317 p=g; 287 while(p){ 288 dg=max(dg,p_GetExp(p,i,r)); 289 p=pNext(p); 318 while(p) 319 { 320 dg=max(dg,p_GetExp(p,i,r)); 321 p=pNext(p); 290 322 } 291 323 int crit=min(df,dg); 292 if (crit>can_crit){ 293 can_crit=crit; 294 can_i=i; 295 can_df=df; 296 can_dg=dg; 324 if (crit>can_crit) 325 { 326 can_crit=crit; 327 can_i=i; 328 can_df=df; 329 can_dg=dg; 297 330 } 298 331 } … … 307 340 } 308 341 } 309 poly pFastPower(poly f, int n, ring r){ 342 poly pFastPower(poly f, int n, ring r) 343 { 310 344 if (n==1) return f; 311 345 if (n==0) return p_ISet(1,r); … … 313 347 int i_max=1; 314 348 int pot_max=0; 315 while(i_max*2<=n){ 349 while(i_max*2<=n) 350 { 316 351 i_max*=2; 317 352 pot_max++; 318 353 } 319 354 int field_size=pot_max+1; 320 int* int_pot_array=(int*) om alloc(field_size*sizeof(int));321 poly* pot_array=(poly*) om alloc(field_size*sizeof(poly));355 int* int_pot_array=(int*) omAlloc(field_size*sizeof(int)); 356 poly* pot_array=(poly*) omAlloc(field_size*sizeof(poly)); 322 357 int i; 323 358 int pot=1; 324 359 //initializing int_pot 325 for(i=0;i<field_size;i++){ 360 for(i=0;i<field_size;i++) 361 { 326 362 int_pot_array[i]=pot; 327 363 pot*=2; … … 329 365 //calculating pot_array 330 366 pot_array[0]=f; //do not delete it 331 for(i=1;i<field_size;i++){ 367 for(i=1;i<field_size;i++) 368 { 332 369 poly p=pot_array[i-1]; 333 370 if(rVar(r)==1) … … 336 373 pot_array[i]=pp_Mult_qq(p,p,r); 337 374 } 338 375 339 376 340 377 … … 349 386 // assume(work_n<2*int_pot_array[i]); 350 387 // if(int_pot_array[i]<=work_n){ 351 // 352 // 353 // 354 // 388 // work_n-=int_pot_array[i]; 389 // poly prod=multifastmult(erg,pot_array[i],r); 390 // pDelete(&erg); 391 // erg=prod; 355 392 // } 356 393 357 394 // if(i!=0) pDelete(&pot_array[i]); 358 395 // } 359 360 361 for(i=field_size-1;i>=0;i--){ 396 397 398 for(i=field_size-1;i>=0;i--) 399 { 362 400 363 401 assume(work_n<2*int_pot_array[i]); 364 if(int_pot_array[i]<=work_n){ 365 work_n-=int_pot_array[i]; 366 int_pot_array[i]=1; 402 if(int_pot_array[i]<=work_n) 403 { 404 work_n-=int_pot_array[i]; 405 int_pot_array[i]=1; 367 406 } 368 407 else int_pot_array[i]=0; 369 370 } 371 for(i=0;i<field_size;i++){ 372 if(int_pot_array[i]==1){ 408 409 } 410 for(i=0;i<field_size;i++) 411 { 412 if(int_pot_array[i]==1) 413 { 373 414 poly prod; 374 415 if(rVar(r)==1) 375 416 prod=multifastmult(erg,pot_array[i],r); 376 417 else 377 418 prod=pp_Mult_qq(erg,pot_array[i],r); 378 419 pDelete(&erg); 379 420 erg=prod; … … 443 484 } 444 485 static void buildTermAndAdd(int n,number* facult,poly* f_terms,int* exp,int f_len,kBucket_pt erg_bucket,ring r, number coef, poly & zw, poly tmp, poly** term_pot){ 445 486 446 487 int i; 447 488 // poly term=p_Init(r); … … 454 495 // n_Delete(&trash,r); 455 496 // } 456 497 457 498 // } 458 499 // number coef=n_IntDiv(facult[n],denom,r); //right function here? … … 466 507 ///poly term=p_Copy(f_terms[i],r); 467 508 poly term=term_pot[i][exp[i]]; 468 469 470 471 509 //tmp; 510 //p_ExpVectorCopy(term,f_terms[i],r); 511 //p_SetCoeff(term, n_Copy(p_GetCoeff(f_terms[i],r),r),r); 512 472 513 //term->next=NULL; 473 514 474 515 //p_MonPowerMB(term, exp[i],r); 475 516 p_MonMultMB(erg,term,r); 476 517 //p_Delete(&term,r); 477 518 } 478 519 479 520 } 480 521 int pseudo_len=1; … … 487 528 static void MC_iterate(poly f, int n, ring r, int f_len,number* facult, int* exp,poly* f_terms,kBucket_pt erg_bucket,int pos,int sum, number coef, poly & zw, poly tmp, poly** term_pot){ 488 529 int i; 489 490 if (pos<f_len-1){ 530 531 if (pos<f_len-1) 532 { 491 533 poly zw_l=NULL; 492 534 number new_coef; 493 for(i=0;i<=n-sum;i++){ 535 for(i=0;i<=n-sum;i++) 536 { 494 537 exp[pos]=i; 495 if(i==0){ 496 new_coef=n_Copy(coef,r); 497 } 498 else { 499 number old=new_coef; 500 number old_rest=n_Init(n-sum-(i-1),r); 501 new_coef=n_Mult(new_coef,old_rest,r); 502 n_Delete(&old_rest,r); 503 n_Delete(&old,r); 504 number i_number=n_Init(i,r); 505 old=new_coef; 506 new_coef=n_IntDiv(new_coef,i_number,r); 507 n_Delete(&old,r); 508 n_Delete(&i_number,r); 509 } 510 //new_coef is 538 if(i==0) 539 { 540 new_coef=n_Copy(coef,r); 541 } 542 else 543 { 544 number old=new_coef; 545 number old_rest=n_Init(n-sum-(i-1),r); 546 new_coef=n_Mult(new_coef,old_rest,r); 547 n_Delete(&old_rest,r); 548 n_Delete(&old,r); 549 number i_number=n_Init(i,r); 550 old=new_coef; 551 new_coef=n_IntDiv(new_coef,i_number,r); 552 n_Delete(&old,r); 553 n_Delete(&i_number,r); 554 } 555 //new_coef is 511 556 //(n ) 512 557 //(exp[0]..exp[pos] 0 0 0 rest) 513 558 poly zw_real=NULL; 514 559 MC_iterate(f, n, r, f_len,facult, exp,f_terms,erg_bucket,pos+1,sum+i,new_coef,zw_real,tmp,term_pot); 515 if (pos==f_len-2){ 516 //get first small polys 517 518 zw_real->next=zw_l; 519 zw_l=zw_real; 560 if (pos==f_len-2) 561 { 562 //get first small polys 563 564 zw_real->next=zw_l; 565 zw_l=zw_real; 520 566 } 521 567 //n_Delete(& new_coef,r); 522 568 } 523 569 n_Delete(&new_coef,r); 524 if (pos==f_len-2){ 570 if (pos==f_len-2) 571 { 525 572 int len=n-sum+1; 526 573 kBucket_Add_q(erg_bucket,zw_l,&len); … … 528 575 return; 529 576 } 530 if(pos==f_len-1){ 577 if(pos==f_len-1) 578 { 531 579 i=n-sum; 532 580 exp[pos]=i; … … 537 585 assume(pos<=f_len-1); 538 586 } 539 poly pFastPowerMC(poly f, int n, ring r){ 587 poly pFastPowerMC(poly f, int n, ring r) 588 { 540 589 //only char=0 541 590 542 591 if(rChar(r)!=0) 543 592 Werror("Char not 0, pFastPowerMC not implemented for this case"); … … 547 596 Werror("not implemented for so small lenght of f, recursion fails"); 548 597 // number null_number=n_Init(0,r); 549 number* facult=(number*) om alloc((n+1)*sizeof(number));598 number* facult=(number*) omAlloc((n+1)*sizeof(number)); 550 599 facult[0]=n_Init(1,r); 551 600 int i; 552 for(i=1;i<=n;i++){ 601 for(i=1;i<=n;i++) 602 { 553 603 number this_n=n_Init(i,r); 554 604 facult[i]=n_Mult(this_n,facult[i-1],r); … … 561 611 kBucketInit(erg_bucket,NULL,0); 562 612 const int f_len=pLength(f); 563 int* exp=(int*)om alloc(f_len*sizeof(int));613 int* exp=(int*)omAlloc(f_len*sizeof(int)); 564 614 //poly f_terms[f_len]; 565 poly* f_terms=(poly*)om alloc(f_len*sizeof(poly));566 poly** term_potences=(poly**) om alloc(f_len*sizeof(poly*));567 615 poly* f_terms=(poly*)omAlloc(f_len*sizeof(poly)); 616 poly** term_potences=(poly**) omAlloc(f_len*sizeof(poly*)); 617 568 618 poly f_iter=f; 569 for(i=0;i<f_len;i++){ 619 for(i=0;i<f_len;i++) 620 { 570 621 f_terms[i]=f_iter; 571 622 f_iter=pNext(f_iter); 572 623 } 573 for(i=0;i<f_len;i++){ 574 term_potences[i]=(poly*)omalloc((n+1)*sizeof(poly)); 624 for(i=0;i<f_len;i++) 625 { 626 term_potences[i]=(poly*)omAlloc((n+1)*sizeof(poly)); 575 627 term_potences[i][0]=p_ISet(1,r); 576 628 int j; … … 589 641 590 642 591 643 592 644 //free res 593 645 594 646 //free facult 595 for(i=0;i<=n;i++){ 647 for(i=0;i<=n;i++) 648 { 596 649 n_Delete(&facult[i],r); 597 650 } 598 651 int i2; 599 for (i=0;i<f_len;i++){ 600 for(i2=0;i2<=n;i2++){ 652 for (i=0;i<f_len;i++) 653 { 654 for(i2=0;i2<=n;i2++) 655 { 601 656 p_Delete(&term_potences[i][i2],r); 602 657 } 603 658 omfree(term_potences[i]); 604 659 605 660 } 606 661 omfree(term_potences);
Note: See TracChangeset
for help on using the changeset viewer.