Changeset 54fc4e in git for libpolys/coeffs/rintegers.cc


Ignore:
Timestamp:
Oct 26, 2013, 5:03:16 PM (11 years ago)
Author:
Yue Ren <ren@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ea3c090b559b31abca294f2172ec7d3304bd4ab7
Parents:
2a2ba4fcd246395ea2e5d241d8945e66d030c103
git-author:
Yue Ren <ren@mathematik.uni-kl.de>2013-10-26 17:03:16+02:00
git-committer:
Yue Ren <ren@mathematik.uni-kl.de>2014-07-22 12:24:18+02:00
Message:
new: division and gcd of integer polynomials via factory

added conversion functions between integer polynomials in Singular and Factory
extended the singclap_gcd and singclap_pdivide functions to cover the case where
ground ring is integer
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/rintegers.cc

    r2a2ba4 r54fc4e  
    2323#include <coeffs/rmodulon.h>
    2424#include "si_gmp.h"
     25
     26#ifdef HAVE_FACTORY
     27#include <factory/factory.h>
     28#endif
    2529
    2630/// Our Type!
     
    368372  return s;
    369373}
     374
     375
     376#ifdef HAVE_FACTORY
     377CanonicalForm nrzConvSingNFactoryN(number n, BOOLEAN setChar, const coeffs /*r*/)
     378{
     379  if (setChar) setCharacteristic( 0 );
     380
     381  CanonicalForm term;
     382  mpz_t num;
     383  mpz_init_set(num, *((mpz_t*)n));
     384  term = make_cf(num);
     385  return term;
     386}
     387
     388number nrzConvFactoryNSingN(const CanonicalForm n, const coeffs r)
     389{
     390  if (n.isImm())
     391    return nrzInit(n.intval(),r);
     392  else
     393  {
     394    int_number m = (int_number) omAllocBin(gmp_nrz_bin);
     395    gmp_numerator(n,m);
     396    return (number) m;
     397  }
     398}
     399#endif // HAVE_FACTORY
    370400
    371401const char * nrzRead (const char *s, number *a, const coeffs)
     
    447477  r->cfSetMap = nrzSetMap;
    448478  r->cfCoeffWrite = nrzCoeffWrite;
    449   r->cfQuot1 = nrzQuot1;
     479  r->cfQuot1 = nrzQuot1; 
     480#ifdef HAVE_FACTORY
     481  r->convSingNFactoryN=nrzConvSingNFactoryN;
     482  r->convFactoryNSingN=nrzConvFactoryNSingN;
     483#endif
    450484  // debug stuff
    451485
Note: See TracChangeset for help on using the changeset viewer.