Changeset eca225 in git


Ignore:
Timestamp:
May 6, 2011, 2:06:50 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '3720ae8bfcff4a4649ee98a15552089151d2d59b')
Children:
a934fc81ed0805bcf6e3c2c3cd59b3b0c6fa8146
Parents:
e25a9942ffbe09b3e9cd1348617f1c1886c896bd
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-05-06 14:06:50+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:36+01:00
Message:
factory to number: Z/p
Location:
libpolys/coeffs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    re25a99 reca225  
    1414#include <coeffs/si_gmp.h>
    1515
     16#ifdef HAVE_FACTORY
     17#include <factory/factory.h>
     18#endif
     19
    1620enum n_coeffType
    1721{
     
    2428  n_Ext,  // used for all extensions (of Zp, of Q AND OF EXTENSIONS THEREOF)
    2529  n_long_C,
    26   // only used if HAVE_RINGS is defined
     30  // only used if HAVE_RINGS is defined:
    2731  n_Z,
    2832  n_Zn,
     
    145149   char *  (*cfName)(number n, const coeffs r);
    146150
    147    /// Inline: a := b
     151   /// Inplace: a *= b
    148152   void    (*cfInpMult)(number &a, number b, const coeffs r);
    149153   /// maps the bigint i (from dummy) into the coeffs dst
    150154   number  (*cfInit_bigint)(number i, const coeffs dummy, const coeffs dst);
     155
     156#ifdef HAVE_FACTORY
     157   number (*convFactoryNSingN)( const CanonicalForm n, const coeffs r);
     158   CanonicalForm (*convSingNFactoryN)( number n, const coeffs r );
     159#endif
     160
    151161
    152162#ifdef LDEBUG
  • libpolys/coeffs/modulop.cc

    re25a99 reca225  
    321321  return (n==n_Zp) && (r->ch==(int)(long)parameter);
    322322}
     323#ifdef HAVE_FACTORY
     324CanonicalForm npConvSingNFactoryN( number n, const coeffs r )
     325{
     326  CanonicalForm term(npInt( n,r ));
     327  return term;
     328}
     329
     330number npConvFactoryNSingN( const CanonicalForm n, const coeffs r)
     331{
     332  if (n.isImm())
     333  {
     334    return n_Init(n.intval(),r);
     335  }
     336  else
     337  {
     338    assume(0);
     339  }
     340}
     341#endif
     342
    323343
    324344BOOLEAN npInitChar(coeffs r, void* p)
     
    396416  r->cfDBTest=npDBTest;
    397417#endif
     418
     419#ifdef HAVE_FACTORY
     420  r->convSingNFactoryN=npConvSingNFactoryN;
     421  r->convFactoryNSingN=npConvFactoryNSingN;
     422#endif
    398423 
    399424  // the variables:
  • libpolys/coeffs/numbers.cc

    re25a99 reca225  
    119119number  ndExtGcd (number a, number b, number *s, number *t, const coeffs r) { return n_Init(1,r); }
    120120#endif
     121
     122#ifdef HAVE_FACTORY
     123CanonicalForm npConvSingNFactoryN( number n, const coeffs r )
     124{
     125  CanonicalForm term(0);
     126  Werror("no conversion to factory");
     127  return term;
     128}
     129
     130number npConvFactoryNSingN( const CanonicalForm n, const coeffs r)
     131{
     132  Werror("no conversion from factory");
     133  return NULL;
     134}
     135#endif
     136
    121137
    122138static n_coeffType nLastCoeffs=n_Z2m;
     
    161177    n->cfExtGcd = ndExtGcd;
    162178    //n->cfGetUnit = (nMapFunc)NULL;
     179#endif
     180
     181#ifdef fACTORY
     182    n->convSingNFactoryN=ndConvSingNFactoryN;
     183    n->convFactoryNSingN=ndConvFactoryNSingN;
    163184#endif
    164185   
Note: See TracChangeset for help on using the changeset viewer.