Changeset 151000 in git


Ignore:
Timestamp:
Jun 10, 2008, 4:35:41 PM (15 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
8011515489f6a2db930bf758ec82b4a8248d9397
Parents:
9cd0ce7b59c2eddfba7d22e2cd1fe036d85c1187
Message:
*motsak: some more NC ShortSpoly! in kutil...


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

Legend:

Unmodified
Added
Removed
  • kernel/gring.cc

    r9cd0ce r151000  
    77 *  Author:  levandov (Viktor Levandovsky)
    88 *  Created: 8/00 - 11/00
    9  *  Version: $Id: gring.cc,v 1.54 2008-06-10 10:17:31 motsak Exp $
     9 *  Version: $Id: gring.cc,v 1.55 2008-06-10 14:35:40 motsak Exp $
    1010 *******************************************************************/
    1111
     
    101101/*2
    102102* returns the LCM of the head terms of a and b
     103* without coefficient!!!
    103104*/
    104105poly p_Lcm(const poly a, const poly b, const long lCompM, const ring r)
    105106{
    106   poly m = p_ISet(1, r);
     107  poly m = // p_ISet(1, r);
     108          p_Init(r);
    107109
    108110  const int pVariables = r->N;
     
    121123
    122124#ifdef PDEBUG
    123   p_Test(m,r);
    124 #endif
     125//  p_Test(m,r);
     126#endif
     127
     128  n_New(&(p_GetCoeff(m, r)), r); 
    125129
    126130  return(m);
     
    140144 
    141145#ifdef PDEBUG
    142   p_Test(m,r);
     146//  p_Test(m,r);
    143147#endif
    144148  return(m);
     
    14701474  poly pL = p_Lcm(p1,p2,r);                               // pL = lcm( lm(p1), lm(p2) )
    14711475
    1472 //  p_Setm(pL,r);
    1473 
    1474 #ifdef PDEBUG
    1475   p_Test(pL,r);
     1476
     1477#ifdef PDEBUG
     1478//  p_Test(pL,r);
    14761479#endif
    14771480
     
    15321535#endif
    15331536 
    1534 
    1535 
    15361537  p_Delete(&pL,r);
    15371538
     
    17681769  {
    17691770#ifdef PDEBUG
    1770     Werror("nc_CreateShortSpoly: exponent mismatch!"); // !!!!
     1771    Werror("nc_CreateShortSpoly: wrong module components!"); // !!!!
    17711772#endif
    17721773    return(NULL);
    17731774  }
    17741775 
    1775   const poly m = p_Lcm(p1, p2, si_max(lCompP1, lCompP2), r);
    1776 
    1777   n_Delete(&p_GetCoeff(m, r), r);
    1778   pSetCoeff0(m, NULL);
    1779 
    1780 #ifdef PDEBUG
    1781   p_Test(m,r);
     1776  poly m = p_Lcm(p1, p2, si_max(lCompP1, lCompP2), r);
     1777
     1778//  n_Delete(&p_GetCoeff(m, r), r);
     1779//  pSetCoeff0(m, NULL);
     1780
     1781#ifdef PDEBUG
     1782//  p_Test(m,r);
    17821783#endif
    17831784 
  • kernel/gring.h

    r9cd0ce r151000  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: gring.h,v 1.21 2008-06-10 10:17:31 motsak Exp $ */
     6/* $Id: gring.h,v 1.22 2008-06-10 14:35:41 motsak Exp $ */
    77/*
    88* ABSTRACT additional defines etc for --with-plural
     
    111111
    112112
    113 // returns the LCM of the head terms of a and b with given component
     113// returns the LCM of the head terms of a and b with the given component
     114// NOTE: coeff will be created but remains undefined(zero?)
    114115poly p_Lcm(const poly a, const poly b, const long lCompM, const ring r);
    115116
    116117// returns the LCM of the head terms of a and b with component = max comp. of a & b
     118// NOTE: coeff will be created but remains undefined(zero?)
    117119poly p_Lcm(const poly a, const poly b, const ring r);
    118120
  • kernel/kutil.cc

    r9cd0ce r151000  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.91 2008-06-10 10:17:32 motsak Exp $ */
     4/* $Id: kutil.cc,v 1.92 2008-06-10 14:35:41 motsak Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    15521552        }
    15531553        else
    1554           Lp.p = nc_CreateSpoly(strat->S[i],p,currRing);
    1555 // nc_CreateShortSpoly(strat->S[i], p, strat->tailRing); // how to mark a short spoly?
    1556       }
    1557       else  Lp.p = nc_CreateSpoly(strat->S[i],p,currRing);
    1558 // nc_CreateShortSpoly(strat->S[i], p, strat->tailRing); // how to mark a short spoly?
     1554          Lp.p = // nc_CreateSpoly(strat->S[i],p,currRing);
     1555                 nc_CreateShortSpoly(strat->S[i], p, currRing);
     1556      }
     1557      else
     1558        Lp.p = // nc_CreateSpoly(strat->S[i],p,currRing);
     1559                nc_CreateShortSpoly(strat->S[i], p, currRing);
    15591560
    15601561     
     
    15731574    {
    15741575      assume(!rIsPluralRing(currRing));
    1575       Lp.p = ksCreateShortSpoly(strat->S[i],p, strat->tailRing);
     1576      Lp.p = ksCreateShortSpoly(strat->S[i], p, strat->tailRing);
    15761577#if MYTEST
    15771578      if (TEST_OPT_DEBUG)
     
    16091610    Lp.p2 = p;
    16101611
    1611     if ( !bIsPluralRing )
    1612       pNext(Lp.p) = strat->tail;
     1612//    if ( !bIsPluralRing ) // !!!!
     1613    assume(pNext(Lp.p)==NULL);
     1614    pNext(Lp.p) = strat->tail; // !!!
    16131615
    16141616    if (atR >= 0)
     
    16461648    //PrintS("prod-crit\n");
    16471649    #ifdef HAVE_PLURAL
    1648     if(!rIsPluralRing(currRing) || (rIsSCA(currRing) && strat->homog))
     1650    if((!rIsPluralRing(currRing)) || (rIsSCA(currRing) && strat->homog))
    16491651    #endif
    16501652    {
     
    17101712      Lp.i_r2 = -1;
    17111713    }
     1714    assume(pNext(Lp.p) == NULL);
    17121715    pNext(Lp.p) = strat->tail;
    17131716    strat->initEcartPair(&Lp,strat->S[i],p,strat->ecartS[i],ecart);
  • kernel/numbers.h

    r9cd0ce r151000  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: numbers.h,v 1.12 2008-03-19 17:44:10 Singular Exp $ */
     6/* $Id: numbers.h,v 1.13 2008-06-10 14:35:41 motsak Exp $ */
    77/*
    88* ABSTRACT: interface to coefficient aritmetics
     
    3535#define n_Power(a, b, res, r) (r)->cf->nPower(a,b,res)
    3636#define n_Size(n,r)           (r)->cf->nSize(n)
     37
     38#define n_New(n, r)           (r)->cf->nNew(n)
    3739
    3840/* variables */
  • kernel/sca.cc

    r9cd0ce r151000  
    77 *  Author:  motsak (Oleksandr Motsak)
    88 *  Created: 2006/12/18
    9  *  Version: $Id: sca.cc,v 1.16 2008-06-10 10:17:33 motsak Exp $
     9 *  Version: $Id: sca.cc,v 1.17 2008-06-10 14:35:41 motsak Exp $
    1010 *******************************************************************/
    1111
     
    734734  poly m1 = p_ISet(1, r);
    735735  p_ExpVectorDiff(m1, pL, p1, r);                  // m1 = pL / lm(p1)
     736
    736737  //p_SetComp(m1,0,r);
    737738  //p_Setm(m1,r);
     
    16571658
    16581659      strat->P.p = nc_CreateSpoly(strat->P.p1, strat->P.p2, currRing);
    1659 
    1660 /*     
    1661       strat->P.p = NULL;
    1662 
    1663 
    1664       poly m1 = NULL, m2 = NULL;
    1665 
    1666       // check that spoly creation is ok
    1667       while (strat->tailRing != currRing &&
    1668              !kCheckSpolyCreation(&(strat->P), strat, m1, m2))
    1669       {
    1670         assume(m1 == NULL && m2 == NULL);
    1671         // if not, change to a ring where exponents are at least
    1672         // large enough
    1673         kStratChangeTailRing(strat);
    1674       }
    1675 
    1676 #ifdef PDEBUG
    1677       Print("ksCreateSpoly!#?");
    1678 #endif
    1679 
    1680       // create the real one
    1681       ksCreateSpoly(&(strat->P), NULL, strat->use_buckets,
    1682                     strat->tailRing, m1, m2, strat->R); //?????????
    1683 */                   
    16841660    }//    else
    16851661
     1662
     1663    if(strat->P.IsNull()) continue;
     1664   
    16861665    if (strat->P.p1 == NULL)
    16871666    {
     
    16911670
    16921671      // for input polys, prepare reduction
    1693       strat->P.PrepareRed(strat->use_buckets);
     1672        strat->P.PrepareRed(strat->use_buckets);
    16941673    }
    16951674
Note: See TracChangeset for help on using the changeset viewer.