Changeset a934fc8 in git


Ignore:
Timestamp:
May 6, 2011, 3:52:31 PM (12 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
ad35b5aa4162741cdf8ed43431d40b098724e388
Parents:
eca225734b56a5d965350b362be8ec9a6c986759
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-05-06 15:52:31+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:36+01:00
Message:
factory -> number: Q
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/clapconv.cc

    reca225 ra934fc8  
    3636
    3737static number convFactoryNSingAN( const CanonicalForm &f, const ring r);
    38 
    39 CanonicalForm convSingNFactoryN( number n, const ring r )
    40 {
    41   CanonicalForm term;
    42   /* does only work for Zp, Q */
    43   if ((r==NULL) || rField_is_Q(r))
    44   {
    45     if ( SR_HDL(n) & SR_INT )
    46     {
    47       term = SR_TO_INT(n);
    48     }
    49     else
    50     {
    51       if ( n->s == 3 )
    52       {
    53         lint dummy;
    54         mpz_init_set( &dummy,n->z );
    55         term = make_cf( dummy );
    56       }
    57       else
    58       {
    59         // assume s==0 or s==1
    60         lint num, den;
    61         On(SW_RATIONAL);
    62         mpz_init_set( &num, n->z );
    63         mpz_init_set( &den, n->n );
    64         term = make_cf( num, den, ( n->s != 1 ));
    65       }
    66     }
    67   }
    68   else /*if ( (r!=NULL) && rField_is_Zp(r) ) */
    69   {
    70     term = npInt( n,r );
    71   }
    72   return term;
    73 }
    74 
    75 number convFactoryNSingN( const CanonicalForm & n, const ring r)
    76 {
    77   if (n.isImm())
    78   {
    79     if (r==NULL) return nlInit(n.intval(),NULL);
    80     else         return n_Init(n.intval(),r);
    81   }
    82   else
    83   {
    84     number z=ALLOC_RNUMBER();
    85 #if defined(LDEBUG)
    86     z->debug=123456;
    87 #endif
    88     gmp_numerator( n, z->z );
    89     if ( n.den().isOne() )
    90       z->s = 3;
    91     else
    92     {
    93       gmp_denominator( n, z->n );
    94       z->s = 0;
    95     }
    96     nlNormalize(z);
    97     return z;
    98   }
    99 }
    100 
    101 //number convFactoryNSingN( const CanonicalForm & n)
    102 //{
    103 //  return convFactoryNSingN(n,currRing);
    104 //}
    105 
    10638
    10739poly convFactoryPSingP ( const CanonicalForm & f, const ring r )
  • kernel/clapconv.h

    reca225 ra934fc8  
    3535poly convFactoryPSingTrP ( const CanonicalForm & f, const ring r=currRing );
    3636
    37 CanonicalForm convSingNFactoryN( number n, const ring r );
    38 number convFactoryNSingN( const CanonicalForm & n, const ring r);
    39 
    40 
    4137// CanonicalForm convSingIFactoryI( int i);a <- by constructor of CanonicalForm
    4238int convFactoryISingI( const CanonicalForm & f);
  • libpolys/coeffs/longrat.cc

    reca225 ra934fc8  
    267267#endif
    268268
     269#ifdef HAVE_FACTORY
     270CanonicalForm nlConvSingNFactoryN( number n, const coeffs r )
     271{
     272  CanonicalForm term;
     273  if ( SR_HDL(n) & SR_INT )
     274  {
     275    term = SR_TO_INT(n);
     276  }
     277  else
     278  {
     279    if ( n->s == 3 )
     280    {
     281      MP_INT dummy;
     282      mpz_init_set( &dummy,n->z );
     283      term = make_cf( dummy );
     284    }
     285    else
     286    {
     287      // assume s==0 or s==1
     288      MP_INT num, den;
     289      On(SW_RATIONAL);
     290      mpz_init_set( &num, n->z );
     291      mpz_init_set( &den, n->n );
     292      term = make_cf( num, den, ( n->s != 1 ));
     293    }
     294  }
     295  return term;
     296}
     297
     298number nlConvFactoryNSingN( const CanonicalForm n, const coeffs r)
     299{
     300  if (n.isImm())
     301  {
     302    return nlInit(n.intval(),r);
     303  }
     304  else
     305  {
     306    number z=(number)omAllocBin(rnumber_bin);
     307#if defined(LDEBUG)
     308    z->debug=123456;
     309#endif
     310    gmp_numerator( n, z->z );
     311    if ( n.den().isOne() )
     312      z->s = 3;
     313    else
     314    {
     315      gmp_denominator( n, z->n );
     316      z->s = 0;
     317    }
     318    nlNormalize(z,r);
     319    return z;
     320  }
     321}
     322#endif
    269323number nlRInit (long i);
    270324
  • libpolys/coeffs/modulop.cc

    reca225 ra934fc8  
    332332  if (n.isImm())
    333333  {
    334     return n_Init(n.intval(),r);
     334    return npInit(n.intval(),r);
    335335  }
    336336  else
  • libpolys/polys/clapsing.cc

    reca225 ra934fc8  
    4545  if((pNext(f)==NULL) && (pNext(g)==NULL))
    4646  {
    47     poly p=pOne();
     47    poly p=p_One(r);
    4848    for(int i=rVar(r);i>0;i--)
    4949      p_SetExp(p,i,si_min(p_GetExp(f,i,r),p_GetExp(g,i,r)),r);
     
    5757  if (rField_is_Q(r) || (rField_is_Zp(r)))
    5858  {
    59     setCharacteristic( n_GetChar(r) );
     59    setCharacteristic( n_GetChar(r->cf) );
    6060    CanonicalForm F( convSingPFactoryP( f,r ) ), G( convSingPFactoryP( g, r ) );
    6161    res=convFactoryPSingP( gcd( F, G ) , r);
Note: See TracChangeset for help on using the changeset viewer.