Changeset 722db6 in git


Ignore:
Timestamp:
Dec 2, 2010, 5:07:36 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
ffe4fd8760d02e6be0620d213646ceeb9a2c4e18
Parents:
66bff8383ec423ff4d78015828b80285a4d2888a
Message:
code cleanup: kBucketTakeOutComp, pDecrOrdTakeOutComp

git-svn-id: file:///usr/local/Singular/svn/trunk@13702 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/kbuckets.cc

    r66bff8 r722db6  
    10141014// But better declare it extern than including polys.h
    10151015extern void pTakeOutComp(poly *p, long comp, poly *q, int *lq);
    1016 void pDecrOrdTakeOutComp(poly *p, long comp, long order,
    1017                          poly *q, int *lq);
    10181016
    10191017void kBucketTakeOutComp(kBucket_pt bucket,
     
    10501048
    10511049  kbTest(bucket);
    1052 }
    1053 
    1054 void kBucketDecrOrdTakeOutComp(kBucket_pt bucket,
    1055                                long comp, long order,
    1056                                poly *r_p, int *l)
    1057 {
    1058   poly p = NULL, q;
    1059   int i, lp = 0, lq;
    1060 
    1061 #ifndef HAVE_PSEUDO_BUCKETS
    1062   kBucketMergeLm(bucket);
    1063   for (i=1; i<=bucket->buckets_used; i++)
    1064   {
    1065     if (bucket->buckets[i] != NULL)
    1066     {
    1067       MULTIPLY_BUCKET(bucket,i);
    1068       pDecrOrdTakeOutComp(&(bucket->buckets[i]), comp, order, &q, &lq);
    1069       if (q != NULL)
    1070       {
    1071         bucket->buckets_length[i] -= lq;
    1072         p = p_Add_q(p, q, lp, lq, bucket->bucket_ring);
    1073       }
    1074     }
    1075   }
    1076   kBucketAdjustBucketsUsed(bucket);
    1077 #else
    1078   pDecrOrdTakeOutComp(&(bucket->p), comp, order, &p, &lp);
    1079   (bucket->l) -= lp;
    1080 #endif
    1081 
    1082   *r_p = p;
    1083   *l = lp;
    10841050}
    10851051
  • kernel/kbuckets.h

    r66bff8 r722db6  
    100100                        poly *p, int *l);
    101101
    102 // Here we only extract such monoms which have component == comp and
    103 // degree == order
    104 // ASSUME: monomial ordering is Order compatible, i.e., if m1, m2 Monoms then
    105 //         m1 >= m2 ==> pGetOrder(m1) >= pGetOrder(m2)
    106 void kBucketDecrOrdTakeOutComp(kBucket_pt bucket,
    107                                long comp, long order,
    108                                poly *p, int *l);
    109 
    110102//////////////////////////////////////////////////////////////////////////
    111103///
  • kernel/polys.cc

    r66bff8 r722db6  
    465465  pTest(*r_p);
    466466  pTest(*r_q);
    467 }
    468 
    469 void pDecrOrdTakeOutComp(poly *r_p, long comp, long order,
    470                          poly *r_q, int *lq)
    471 {
    472   spolyrec pp, qq;
    473   poly p, q, p_prev;
    474   int l = 0;
    475 
    476   pNext(&pp) = *r_p;
    477   p = *r_p;
    478   p_prev = &pp;
    479   q = &qq;
    480 
    481 #ifdef HAVE_ASSUME
    482   if (p != NULL)
    483   {
    484     while (pNext(p) != NULL)
    485     {
    486       assume(pGetOrder(p) >= pGetOrder(pNext(p)));
    487       pIter(p);
    488     }
    489   }
    490   p = *r_p;
    491 #endif
    492 
    493   while (p != NULL && pGetOrder(p) > order) pIter(p);
    494 
    495   while(p != NULL && pGetOrder(p) == order)
    496   {
    497     while (pGetComp(p) == comp)
    498     {
    499       pNext(q) = p;
    500       pIter(q);
    501       pIter(p);
    502       pSetComp(p, 0);
    503       pSetmComp(p);
    504       l++;
    505       if (p == NULL || pGetOrder(p) != order)
    506       {
    507         pNext(p_prev) = p;
    508         goto Finish;
    509       }
    510     }
    511     pNext(p_prev) = p;
    512     p_prev = p;
    513     pIter(p);
    514   }
    515 
    516   Finish:
    517   pNext(q) = NULL;
    518   *r_p = pNext(&pp);
    519   *r_q = pNext(&qq);
    520   *lq = l;
    521467}
    522468
Note: See TracChangeset for help on using the changeset viewer.