Changeset c6eecb in git for factory/cf_factor.cc


Ignore:
Timestamp:
Apr 26, 2007, 10:22:48 AM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
8251cc1c81aab678de3aec185a8de7969e825393
Parents:
cb637fad8051814719a0ea36ed4b65a20f1114cc
Message:
*hannes: avoid NTL char. switches


git-svn-id: file:///usr/local/Singular/svn/trunk@10002 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_factor.cc

    rcb637f rc6eecb  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_factor.cc,v 1.31 2007-04-25 11:13:34 Singular Exp $ */
     2/* $Id: cf_factor.cc,v 1.32 2007-04-26 08:22:48 Singular Exp $ */
    33
    44//{{{ docu
     
    8080}
    8181
    82 #if 0
     82#if 1
     83#ifndef NOSTREAMIO
    8384void out_cf(char *s1,const CanonicalForm &f,char *s2)
    8485{
     
    161162}
    162163#endif
     164#endif
    163165
    164166bool isPurePoly(const CanonicalForm & f)
     
    347349      {
    348350        // set remainder
    349         #ifdef NTL_ZZ
    350         ZZ r;
    351         r=getCharacteristic();
    352         ZZ_pContext ccc(r);
    353         #else
    354         zz_pContext ccc(getCharacteristic());
    355         #endif
    356         ccc.restore();
    357         #ifdef NTL_ZZ
    358         ZZ_p::init(r);
    359         #else
    360         zz_p::init(getCharacteristic());
    361         #endif
     351        if (fac_NTL_char!=getCharacteristic())
     352        {
     353          fac_NTL_char=getCharacteristic();
     354          #ifdef NTL_ZZ
     355          ZZ r;
     356          r=getCharacteristic();
     357          ZZ_pContext ccc(r);
     358          #else
     359          zz_pContext ccc(getCharacteristic());
     360          #endif
     361          ccc.restore();
     362          #ifdef NTL_ZZ
     363          ZZ_p::init(r);
     364          #else
     365          zz_p::init(getCharacteristic());
     366          #endif
     367        }
    362368        // convert to NTL
    363369        #ifdef NTL_ZZ
     
    390396      {
    391397        // Specialcase characteristic==2
    392         ZZ r;r=2;
    393         ZZ_p::init(r);
    394 
    395         // remainder is 2 --> nothing to set
    396 
     398        if (fac_NTL_char!=2)
     399        {
     400          fac_NTL_char=2;
     401          zz_p::init(2);
     402        }
    397403        // convert to NTL using the faster conversion routine for characteristic 2
    398404        GF2X f1=convertFacCF2NTLGF2X(f);
     
    531537      // First all cases with characteristic !=2
    532538      // set remainder
    533       #ifdef NTL_ZZ
    534       ZZ r;
    535       r=getCharacteristic();
    536       ZZ_pContext ccc(r);
    537       ccc.restore();
    538       #else
    539       zz_pContext ccc(getCharacteristic());
    540       ccc.restore();
    541       #endif
     539      if (fac_NTL_char!=getCharacteristic())
     540      {
     541        fac_NTL_char=getCharacteristic();
     542        #ifdef NTL_ZZ
     543        ZZ r;
     544        r=getCharacteristic();
     545        ZZ_pContext ccc(r);
     546        #else
     547        zz_pContext ccc(getCharacteristic());
     548        #endif
     549        ccc.restore();
     550        #ifdef NTL_ZZ
     551        ZZ_p::init(r);
     552        #else
     553        zz_p::init(getCharacteristic());
     554        #endif
     555      }
    542556
    543557      // set minimal polynomial in NTL
Note: See TracChangeset for help on using the changeset viewer.