Changeset 761e453 in git
 Timestamp:
 Apr 27, 2018, 11:38:34 AM (5 years ago)
 Branches:
 (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
 Children:
 f1182f8cdb0e421624b6bd4cb12a67c87b44ec12
 Parents:
 945000cb5ab9a7e19901cbd2d68659fde7c7b939
 Location:
 libpolys/polys
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

libpolys/polys/sbuckets.cc
r945000 r761e453 398 398 return pn; 399 399 } 400 401 void sBucketCanonicalize(sBucket_pt bucket) 402 { 403 poly pr = NULL; 404 int lr = 0; 405 int i = 0; 406 407 while (bucket>buckets[i].p == NULL) 408 { 409 assume( bucket>buckets[i].length == 0 ); 410 i++; 411 if (i > bucket>max_bucket) goto done; 412 } 413 414 pr = bucket>buckets[i].p; 415 lr = bucket>buckets[i].length; 416 417 assume( pr != NULL && (lr > 0) ); 418 419 bucket>buckets[i].p = NULL; 420 bucket>buckets[i].length = 0; 421 i++; 422 423 while (i <= bucket>max_bucket) 424 { 425 if (bucket>buckets[i].p != NULL) 426 { 427 assume( bucket>buckets[i].length == pLength(bucket>buckets[i].p) ); 428 429 pr = p_Add_q(pr, bucket>buckets[i].p, lr, bucket>buckets[i].length, 430 bucket>bucket_ring); 431 432 bucket>buckets[i].p = NULL; 433 bucket>buckets[i].length = 0; 434 } 435 436 assume( bucket>buckets[i].p == NULL ); 437 assume( bucket>buckets[i].length == 0 ); 438 i++; 439 } 440 441 done: 442 if (pr!=NULL) 443 { 444 i = SI_LOG2(lr); 445 bucket>buckets[i].p = pr; 446 bucket>buckets[i].length = lr; 447 bucket>max_bucket = i; 448 } 449 } 450 451 char* sBucketString(sBucket_pt bucket) 452 { 453 sBucketCanonicalize(bucket); 454 StringSetS("bucket: "); 455 StringAppendS(p_String(bucket>buckets[bucket>max_bucket].p,bucket>bucket_ring)); 456 return StringEndS(); 457 } 458 459 void sBucketPrint(sBucket_pt bucket) 460 { 461 sBucketCanonicalize(bucket); 462 PrintS("bucket: "); 463 p_Write(bucket>buckets[bucket>max_bucket].p,bucket>bucket_ring); 464 } 
libpolys/polys/sbuckets.h
r945000 r761e453 100 100 101 101 102 void sBucketCanonicalize(sBucket_pt bucket); 103 char* sBucketString(sBucket_pt bucket); 104 void sBucketPrint(sBucket_pt bucket); 102 105 #endif // P_BUCKET_SORT
Note: See TracChangeset
for help on using the changeset viewer.