Changeset 7b00dbc in git


Ignore:
Timestamp:
Feb 25, 2014, 11:49:26 AM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
eeb5b0cee52862b60f2f9f5250185bd15e1f6103
Parents:
4cda398594e14a9c3953996550f1d55f247252fc6776cf84c738527c16538ce2c9d45fdaf0e39c11
Message:
Merge pull request #513 from surface-smoothers/fix.radEHV_0_.bug

fix bug in radEHV for zero ideal
Files:
3 added
65 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/ehv.lib

    r4cda39 r7b00dbc  
    538538      ERROR("// Not implemented for this ordering, please change to global ordering.");
    539539    }
    540 
     540  if (size(I) == 0)  { return( ideal(0) ); }
    541541  //Compute the equidimensional radical J of I.
    542542  ideal J = equiRadEHV(I,#);
  • Singular/LIB/normal.lib

    r6776cf r7b00dbc  
    925925   L = insert(L,0,1);
    926926   L[3] = delt;
     927   setring(P);
    927928   return(L);
    928929}
  • Singular/LIB/realclassify.lib

    r6776cf r7b00dbc  
    606606    h = f-jet(f, 2)-corank_part(f);
    607607  }
    608   poly g = cleardenom(f-jet(f, 2));
     608  poly g = f-jet(f, 2);
     609  poly lead_g = leadcoef(g);
     610  if(lead_g > 0)
     611  {
     612    g = g/lead_g;
     613  }
     614  if(lead_g < 0)
     615  {
     616    g = -g/lead_g;
     617  }
    609618
    610619  return(list(c, lambda, k, g));
  • Singular/extra.cc

    r6776cf r7b00dbc  
    1414#include <misc/auxiliary.h>
    1515
    16 #define SI_DONT_HAVE_GLOBAL_VARS
    1716#include <factory/factory.h>
    1817
     
    7776#include <kernel/shiftgb.h>
    7877#include <kernel/linearAlgebra.h>
     78
     79#include <kernel/hutil.h>
    7980
    8081// for tests of t-rep-GB
     
    31533154      else
    31543155  #endif
     3156  /*==================== Roune Hilb  =================*/
     3157       if (strcmp(sys_cmd, "hilbroune") == 0)
     3158       {
     3159         ideal I;
     3160         if ((h!=NULL) && (h->Typ()==IDEAL_CMD))
     3161         {
     3162           I=(ideal)h->CopyD();
     3163           slicehilb(I);
     3164         }
     3165         else return TRUE;
     3166         return FALSE;
     3167       }
    31553168  /*==================== minor =================*/
    31563169      if (strcmp(sys_cmd, "minor")==0)
  • Singular/feOpt.cc

    r6776cf r7b00dbc  
    1414#include <stdlib.h>
    1515
    16 #define SI_DONT_HAVE_GLOBAL_VARS
    1716#include <factory/factory.h>
    1817
  • Singular/interpolation.cc

    r6776cf r7b00dbc  
    88#include <kernel/mod2.h>
    99#include <misc/options.h>
    10 #define SI_DONT_HAVE_GLOBAL_VARS
    11 #  include <factory/factory.h>
     10#include <factory/factory.h>
    1211
    1312#include <misc/intvec.h>
  • Singular/iparith.cc

    r6776cf r7b00dbc  
    24952495{
    24962496  res->data=(char *)idSect((ideal)u->Data(),(ideal)v->Data());
    2497   setFlag(res,FLAG_STD);
    24982497  return FALSE;
    24992498}
  • Singular/ipassign.cc

    r6776cf r7b00dbc  
    248248  }
    249249
    250   assume( currRing->cf->extRing->qideal == NULL );
    251 
    252250  AlgExtInfo A;
    253251
    254252  A.r = rCopy(currRing->cf->extRing); // Copy  ground field!
     253  // if minpoly was already set:
     254  if( currRing->cf->extRing->qideal != NULL ) id_Delete(&(A.r->qideal),A.r);
    255255  ideal q = idInit(1,1);
     256  if ((p==NULL) ||(DEN((fraction)(p)) != NULL) ||(NUM((fraction)p)==NULL))
     257  {
     258    Werror("Could not construct the alg. extension: minpoly==0");
     259    // cleanup A: TODO
     260    rDelete( A.r );
     261    return TRUE;
     262  }
    256263
    257264  assume( DEN((fraction)(p)) == NULL ); // minpoly must be a fraction with poly numerator...!!
  • Singular/ipshell.cc

    r6776cf r7b00dbc  
    1515#include <misc/mylimits.h>
    1616
    17 #define SI_DONT_HAVE_GLOBAL_VARS
    1817#include <factory/factory.h>
    1918
     
    21992198    lists v=(lists)L->m[1].Data();
    22002199    R->N = v->nr+1;
     2200    if (R->N<=0)
     2201    {
     2202      WerrorS("no ring variables");
     2203      goto rCompose_err;
     2204    }
    22012205    R->names   = (char **)omAlloc0(R->N * sizeof(char_ptr));
    22022206    int i;
  • Singular/janet.cc

    r6776cf r7b00dbc  
    793793}
    794794
     795#if 0
    795796static void go_right(NodeM *current,poly_function disp)
    796797{
     
    803804}
    804805
    805 #if 0
    806806void ForEach(TreeM *t,poly_function disp)
    807807{
  • Singular/libparse.cc

    r6776cf r7b00dbc  
    10621062#ifdef STANDALONE_PARSER
    10631063#include <Singular/utils.h>
    1064 
    1065 // int initializeGMP(){ return 1; } // NEEDED FOR MAIN APP. LINKING!!!
    1066 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???
    10671064
    10681065  #define HAVE_LIBPARSER
  • Singular/libparse.ll

    r6776cf r7b00dbc  
    1010#ifdef STANDALONE_PARSER
    1111  #include <Singular/utils.h>
    12 
    13 //   int initializeGMP(){ return 1; } // NEEDED FOR MAIN APP. LINKING!!!
    14   int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???
    1512
    1613  #define HAVE_LIBPARSER
  • Singular/misc_ip.cc

    r6776cf r7b00dbc  
    2020#include <Singular/si_signals.h>
    2121
    22 #define SI_DONT_HAVE_GLOBAL_VARS
    2322#include <factory/factory.h>
    2423
     
    402401#undef HAVE_DYN_RL
    403402#endif
    404 
    405 #define SI_DONT_HAVE_GLOBAL_VARS
    406403
    407404//#ifdef HAVE_LIBPARSER
     
    12671264  errorreported = 0;
    12681265}
    1269 
    1270 /*
    1271 #ifdef LIBSINGULAR
    1272 // the init routines of factory need mmInit
    1273 int mmInit( void )
    1274 {
    1275   return 1;
    1276 }
    1277 #endif
    1278 */
  • Singular/mmalloc.h

    r6776cf r7b00dbc  
    1010#include <stdlib.h>
    1111
    12 int mmInit(void);
    1312#undef reallocSize
    1413#undef freeSize
  • Singular/subexpr.cc

    r6776cf r7b00dbc  
    954954        return INT_CMD;
    955955      case VMINPOLY:
     956        data=NULL;
    956957        return NUMBER_CMD;
    957958      case VNOETHER:
     959        data=NULL;
    958960        return POLY_CMD;
    959961      //case COMMAND:
  • Singular/test.cc

    r6776cf r7b00dbc  
    5252
    5353#include <polys/clapsing.h>
    54 
    55 
    56 // int initializeGMP(){ return 1; } // NEEDED FOR MAIN APP. LINKING!!!
    57 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???
    5854
    5955
  • Singular/tesths.cc

    r6776cf r7b00dbc  
    1717#include <misc/options.h>
    1818
    19 #define SI_DONT_HAVE_GLOBAL_VARS
    2019#include <factory/factory.h>
    2120
     
    5352extern int siInit(char *);
    5453
    55 // int initializeGMP(){ return 1; }
    56 
    5754int mmInit( void )
    5855{
     
    7370    char** argv)   /* parameter array */
    7471{
    75   //mmInit();
     72  mmInit();
    7673  // Don't worry: ifdef OM_NDEBUG, then all these calls are undef'ed
    7774  omInitRet_2_Info(argv[0]);
  • Singular/walk.cc

    r6776cf r7b00dbc  
    437437#endif
    438438
     439#ifdef CHECK_IDEAL_MWALK
    439440static void idString(ideal L, const char* st)
    440441{
     
    448449  Print(" %s;", pString(L->m[nL-1]));
    449450}
    450 
    451 //unused
    452 //#if 0
     451#endif
     452
     453#if defined(CHECK_IDEAL_MWALK) || defined(ENDWALKS)
    453454static void headidString(ideal L, char* st)
    454455{
     
    462463  Print(" %s;", pString(pHead(L->m[nL-1])));
    463464}
    464 //#endif
    465 
    466 //unused
    467 //#if 0
     465#endif
     466
     467#if defined(CHECK_IDEAL_MWALK) || defined(ENDWALKS)
    468468static void idElements(ideal L, char* st)
    469469{
     
    503503  omFree(K);
    504504}
    505 //#endif
     505#endif
    506506
    507507
     
    46114611  clock_t tim;
    46124612  nstep=0;
    4613   int i,k,nwalk,endwalks = 0;
     4613  int i,nwalk,endwalks = 0;
    46144614  int nV = currRing->N;
    46154615
     
    46964696    else
    46974697    {
    4698     NORMAL_GW:
    46994698#ifndef  BUCHBERGER_ALG
    47004699      if(isNolVector(curr_weight) == 0)
     
    47784777    }
    47794778
    4780   NEXT_VECTOR:
     4779  //NEXT_VECTOR:
    47814780    to = clock();
    47824781    //intvec* next_weight = MkInterRedNextWeight(curr_weight,target_weight,G);
     
    67906789  clock_t tinput = clock();
    67916790#endif
    6792   int nsteppert=0, i, k, nV = currRing->N, nwalk=0, npert_tmp=0;
     6791  int nsteppert=0, i, nV = currRing->N, nwalk=0, npert_tmp=0;
    67936792  int *npert=(int*)omAlloc(2*nV*sizeof(int));
    67946793  ideal Gomega, M,F,  G1, Gomega1, Gomega2, M1, F1;
  • Tst/Short.lst

    r4cda39 r7b00dbc  
    5555Short/bug_54.tst
    5656Short/bug_55.tst
     57Short/bug_554.tst
    5758Short/bug_532_s.tst
    5859Short/bug_538_s.tst
  • dyn_modules/bigintm/Makefile.am

    r6776cf r7b00dbc  
    44
    55if ENABLE_P_PROCS_DYNAMIC
    6 #  noinst_LTLIBRARIES=bigintm.la
    7   check_LTLIBRARIES=bigintm.la
     6  noinst_LTLIBRARIES=bigintm.la
     7#  check_LTLIBRARIES=bigintm.la
    88 
    99endif
  • dyn_modules/callpolymake/Makefile.am

    r6776cf r7b00dbc  
    1010
    1111# forcefully enable exceptions for polymake
    12 POLYMAKE_CFLAGS = -fexceptions -frtti
    13 
    1412AM_LDFLAGS      = ${PM_LDFLAGS}
    1513# -release ${PACKAGE_VERSION}
     
    2422-I${top_srcdir}/libpolys -I${top_builddir}/libpolys  \
    2523-I${top_builddir}/factory/include $(GMP_CFLAGS) $(PM_INC) $(PM_CFLAGS) \
    26 $(POLYMAKE_CFLAGS) $(FACTORY_CFLAGS)
     24$(POLYMAKE_CXXFLAGS) $(FACTORY_CFLAGS)
    2725
    2826P_PROCS_CPPFLAGS_COMMON = -DDYNAMIC_VERSION
    2927
    30 polymake_la_CPPFLAGS = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON} ${POLYMAKE_CFLAGS}
    31 polymake_la_CXXFLAGS = ${POLYMAKE_CFLAGS}
    32 polymake_la_CFLAGS = ${POLYMAKE_CFLAGS}
     28polymake_la_CPPFLAGS = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON} ${POLYMAKE_CXXFLAGS}
     29polymake_la_CXXFLAGS = ${POLYMAKE_CXXFLAGS}
     30polymake_la_CFLAGS = ${POLYMAKE_CXXFLAGS}
    3331
    3432if ENABLE_P_PROCS_DYNAMIC
  • factory/canonicalform.cc

    r6776cf r7b00dbc  
    2323CanonicalForm readCF( ISTREAM& );
    2424#endif /* NOSTREAMIO */
    25 
    26 //{{{ initialization
    27 int initializeCharacteristic();
    28 
    29 #ifdef SINGULAR
    30 extern int mmInit(void);
    31 #endif
    32 
    33 int
    34 initCanonicalForm( void )
    35 {
    36     static bool initialized = false;
    37     if ( ! initialized ) {
    38 #if defined (SINGULAR)
    39         (void)mmInit();
    40 #endif
    41 
    42         (void)initializeCharacteristic();
    43         initialized = true;
    44     }
    45     return 1;
    46 }
    47 //}}}
    4825
    4926//{{{ constructors, destructors, selectors
  • factory/canonicalform.h

    r6776cf r7b00dbc  
    5656}
    5757
    58 
    59 int initCanonicalForm( void );
    60 #ifndef SI_DONT_HAVE_GLOBAL_VARS
    61 static int cf_is_initialized_now = initCanonicalForm();
    62 #endif
    6358
    6459//{{{ class CanonicalForm
  • factory/cf_char.cc

    r6776cf r7b00dbc  
    1616static int theCharacteristic = 0;
    1717static int theDegree = 1;
    18 
    19 int initializeCharacteristic ()
    20 {
    21     theCharacteristic = 0;
    22     theDegree = 1;
    23     return 1;
    24 }
    2518
    2619void setCharacteristic( int c )
     
    6558}
    6659
    67 int getExp()
    68 {
    69   return InternalPrimePower::getk();
    70 }
    71 
    72 
    7360int getGFDegree()
    7461{
  • factory/cf_factor.cc

    r6776cf r7b00dbc  
    4141#endif
    4242
    43 int getExp(); /* cf_char.cc */
    44 
    4543//static bool isUnivariateBaseDomain( const CanonicalForm & f )
    4644//{
  • factory/cf_factory.cc

    r6776cf r7b00dbc  
    276276    else  if ( symmetric ) {
    277277        mpz_init( dummy );
     278        InternalPrimePower::initialize();
    278279        if ( mpz_cmp( InternalPrimePower::primepowhalf, InternalPrimePower::MPI( value ) ) < 0 )
    279280            mpz_sub( dummy, InternalPrimePower::MPI( value ), InternalPrimePower::primepow );
  • factory/int_pp.cc

    r6776cf r7b00dbc  
    1717int InternalPrimePower::prime;
    1818int InternalPrimePower::exp;
    19 int InternalPrimePower::initialized = InternalPrimePower::initialize();
     19bool InternalPrimePower::initialized = false;
    2020
    2121
     
    2727InternalPrimePower::InternalPrimePower( const int i )
    2828{
     29    initialize();
    2930    mpz_init_set_si( thempi, i );
    3031    if ( mpz_cmp_si( thempi, 0 ) < 0 ) {
     
    4142InternalPrimePower::InternalPrimePower( const char * str, const int base )
    4243{
     44    initialize();
    4345    mpz_init_set_str( thempi, str, base );
    4446    if ( mpz_cmp_si( thempi, 0 ) < 0 ) {
     
    7678}
    7779
    78 int InternalPrimePower::initialize()
    79 {
     80void InternalPrimePower::initialize()
     81{
     82    if (initialized) return;
    8083    mpz_init_set_si( primepow, 3 );
    8184    mpz_init_set_si( primepowhalf, 1 );
    8285    prime = 3;
    8386    exp = 1;
    84     return 1;
     87    initialized = true;
    8588}
    8689
     
    8992{
    9093    ASSERT( p > 1 && k > 0, "illegal prime power" );
     94    initialize();
    9195    if ( p != prime || k != exp ) {
    9296        mpz_set_si( primepow, p );
     
    96100        exp = k;
    97101    }
    98 }
    99 
    100 int
    101 InternalPrimePower::getp()
    102 {
    103     return prime;
    104 }
    105 
    106 int
    107 InternalPrimePower::getk()
    108 {
    109     return exp;
    110102}
    111103
  • factory/int_pp.h

    r6776cf r7b00dbc  
    2727private:
    2828    mpz_t thempi;
    29     static int initialized;
     29    static bool initialized;
    3030    static int prime;
    3131    static int exp;
    3232    static mpz_t primepow;
    3333    static mpz_t primepowhalf;
    34     static int initialize();
     34    static void initialize();
    3535    static mpz_ptr MPI( const InternalCF * const c );
    3636public:
     
    5656
    5757    static void setPrimePower( int p, int k );
    58     static int getp();
    59     static int getk();
    6058
    6159    bool is_imm() const;
  • factory/test.cc

    r6776cf r7b00dbc  
    22#include <resources/feFopen.h>
    33#include "cf_assert.h"
    4 
    5 int mmInit(void) {
    6 #ifdef SINGULAR
    7 // this is a hack to make linker baheave on Mac OS X 10.6.8 / 64 bit
    8 // since otherwise both debug and release DYNAMIC tests failed there with:
    9 /*
    10 dyld: lazy symbol binding failed: Symbol not found: __Z7feFopenPKcS0_
    11 Referenced from: ...BUILDDIR/factory/.libs/libfactory_g-3.1.3.dylib
    12 Expected in: flat namespace
    13    
    14 dyld: Symbol not found: __Z7feFopenPKcS0_
    15 Referenced from: ...BUILDDIR/factory/.libs/libfactory_g-3.1.3.dylib
    16 Expected in: flat namespace
    17 */
    18 const int f = (int)(long)(void*)feFopen;
    19 return (f ^ f) + 1;
    20 #else
    21 return 1;
    22 #endif
    23 }
    244
    255int test2 (int p)
  • kernel/GMPrat.cc

    r6776cf r7b00dbc  
    3131
    3232// ----------------------------------------------------------------------------
    33 //  Miscellaneous
    34 // ----------------------------------------------------------------------------
    35 
    36 Rational Rational::save;    // dummy variable
    37 
    38 // ----------------------------------------------------------------------------
    3933//  disconnect a rational from its reference
    4034// ----------------------------------------------------------------------------
    4135
    42 void    Rational::disconnect( )
     36void    Rational::disconnect()
    4337{
    4438    if( p->n>1)
    4539    {
     40        rep *old_p = p;
    4641        p->n--;
    4742        p = new rep;
    48     }
    49     else
    50     {
    51         mpq_clear(p->rat);
    52     }
    53     mpq_init(p->rat);
     43        mpq_init(p->rat);
     44        mpq_set(p->rat, old_p->rat);
     45    }
    5446}
    5547
     
    116108Rational& Rational::operator=(int a)
    117109{
    118   disconnect();
     110  if( p->n>1)
     111  {
     112    p->n--;
     113    p = new rep;
     114    mpq_init(p->rat);
     115  }
    119116  mpq_set_si(p->rat,(long) a,1);
    120117  return *this;
     
    223220Rational::operator+=(const Rational &a)
    224221{
    225   mpq_set(save.p->rat,p->rat);
    226   disconnect();
    227   mpq_add(p->rat,save.p->rat,a.p->rat);
     222  disconnect();
     223  mpq_add(p->rat,p->rat,a.p->rat);
    228224  return *this;
    229225}
     
    232228Rational::operator-=(const Rational &a)
    233229{
    234   mpq_set(save.p->rat,p->rat);
    235   disconnect();
    236   mpq_sub(p->rat,save.p->rat,a.p->rat);
     230  disconnect();
     231  mpq_sub(p->rat,p->rat,a.p->rat);
    237232  return *this;
    238233}
     
    241236Rational::operator*=(const Rational &a)
    242237{
    243   mpq_set(save.p->rat,p->rat);
    244   disconnect();
    245   mpq_mul(p->rat,save.p->rat,a.p->rat);
     238  disconnect();
     239  mpq_mul(p->rat,p->rat,a.p->rat);
    246240  return *this;
    247241}
     
    250244Rational::operator/=(const Rational &a)
    251245{
    252   mpq_set(save.p->rat,p->rat);
    253   disconnect();
    254   mpq_div(p->rat,save.p->rat,a.p->rat);
     246  disconnect();
     247  mpq_div(p->rat,p->rat,a.p->rat);
    255248  return *this;
    256249}
     
    263256Rational::operator++()
    264257{
    265   mpq_set(save.p->rat,p->rat);
    266   *this=1;
    267   mpq_add(p->rat,p->rat,save.p->rat);
     258  disconnect();
     259  mpz_add(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat));
    268260  return *this;
    269261}
     
    274266  Rational erg(*this);
    275267
    276   mpq_set(save.p->rat,p->rat);
    277   *this=1;
    278   mpq_add(p->rat,p->rat,save.p->rat);
     268  disconnect();
     269  mpz_add(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat));
    279270  return erg;
    280271}
     
    283274Rational::operator--()
    284275{
    285   mpq_set(save.p->rat,p->rat);
    286   *this=1;
    287   mpq_sub(p->rat,save.p->rat,p->rat);
     276  disconnect();
     277  mpz_sub(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat));
    288278  return *this;
    289279}
     
    294284  Rational erg(*this);
    295285
    296   mpq_set(save.p->rat,p->rat);
    297   *this=1;
    298   mpq_sub(p->rat,save.p->rat,p->rat);
     286  disconnect();
     287  mpz_sub(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat));
    299288  return erg;
    300289}
  • kernel/GMPrat.h

    r6776cf r7b00dbc  
    2222
    2323    rep             *p;
    24     static Rational save;
    2524
    2625    void disconnect();
  • kernel/fglmcomb.cc

    r6776cf r7b00dbc  
    1313#include <kernel/mod2.h>
    1414
    15 #define SI_DONT_HAVE_GLOBAL_VARS
    1615#include <factory/factory.h>
    1716#include <misc/options.h>
  • kernel/hilb.cc

    r6776cf r7b00dbc  
    1717#include <kernel/hutil.h>
    1818#include <kernel/stairc.h>
     19//ADICHANGES:
     20#include <kernel/ideals.h>
     21#include <kernel/kstd1.h>
     22#include<gmp.h>
     23#include<vector>
     24
    1925
    2026static int  **Qpol;
    2127static int  *Q0, *Ql;
    2228static int  hLength;
     29   
    2330
    2431static int hMinModulweight(intvec *modulweight)
     
    213220  }
    214221}
    215 
     222// ---------------------------------- ADICHANGES ---------------------------------------------
     223//!!!!!!!!!!!!!!!!!!!!! Just for Monomial Ideals !!!!!!!!!!!!!!!!!!!!!!!!!!!!
     224
     225//returns the degree of the monomial
     226static int DegMon(poly p)
     227{
     228    #if 1
     229    int i,deg;
     230    deg = 0;
     231    for(i=1;i<=currRing->N;i++)
     232    {
     233        deg = deg + p_GetExp(p, i, currRing);
     234    }
     235    return(deg);
     236    #else
     237    return(p_Deg(p, currRing));
     238    #endif
     239}
     240
     241//Tests if the ideal is sorted by degree
     242static bool idDegSortTest(ideal I)
     243{
     244    if((I == NULL)||(idIs0(I)))
     245    {
     246        return(TRUE);
     247    }
     248    for(int i = 0; i<IDELEMS(I)-1; i++)
     249    {
     250        if(DegMon(I->m[i])>DegMon(I->m[i+1]))
     251        {
     252            idPrint(I);
     253            Werror("Ideal is not deg sorted!!");
     254            return(FALSE);
     255        }
     256    }
     257    return(TRUE);
     258}
     259
     260//adds the new polynomial at the coresponding position
     261//and simplifies the ideal
     262static ideal SortByDeg_p(ideal I, poly p)
     263{
     264    int i,j;
     265    if((I == NULL) || (idIs0(I)))
     266    {
     267        ideal res = idInit(1,1);
     268        res->m[0] = p;
     269        return(res);
     270    }
     271    idSkipZeroes(I);
     272    #if 1
     273    for(i = 0; (i<IDELEMS(I)) && (DegMon(I->m[i])<=DegMon(p)); i++)
     274    {
     275        if(p_DivisibleBy( I->m[i],p, currRing))
     276        {
     277            return(I);
     278        }
     279    }
     280    for(i = IDELEMS(I)-1; (i>=0) && (DegMon(I->m[i])>=DegMon(p)); i--)
     281    {
     282        if(p_DivisibleBy(p,I->m[i], currRing))
     283        {
     284            I->m[i] = NULL;
     285        }
     286    }
     287    if(idIs0(I))
     288    {
     289        idSkipZeroes(I);
     290        I->m[0] = p;
     291        return(I);
     292    }
     293    #endif
     294    idSkipZeroes(I);
     295    //First I take the case when all generators have the same degree
     296    if(DegMon(I->m[0]) == DegMon(I->m[IDELEMS(I)-1]))
     297    {
     298        if(DegMon(p)<DegMon(I->m[0]))
     299        {
     300            idInsertPoly(I,p);
     301            idSkipZeroes(I);
     302            for(i=IDELEMS(I)-1;i>=1; i--)
     303            {
     304                I->m[i] = I->m[i-1];
     305            }
     306            I->m[0] = p;
     307            return(I);
     308        }
     309        if(DegMon(p)>=DegMon(I->m[IDELEMS(I)-1]))
     310        {
     311            idInsertPoly(I,p);
     312            idSkipZeroes(I);
     313            return(I);
     314        }
     315    }
     316    if(DegMon(p)<=DegMon(I->m[0]))
     317    {
     318        idInsertPoly(I,p);
     319        idSkipZeroes(I);
     320        for(i=IDELEMS(I)-1;i>=1; i--)
     321        {
     322            I->m[i] = I->m[i-1];
     323        }
     324        I->m[0] = p;
     325        return(I);
     326    }
     327    if(DegMon(p)>=DegMon(I->m[IDELEMS(I)-1]))
     328    {
     329        idInsertPoly(I,p);
     330        idSkipZeroes(I);
     331        return(I);
     332    }
     333    for(i = IDELEMS(I)-2; ;)
     334    {
     335        if(DegMon(p)==DegMon(I->m[i]))
     336        {
     337            idInsertPoly(I,p);
     338            idSkipZeroes(I);
     339            for(j = IDELEMS(I)-1; j>=i+1;j--)
     340            {
     341                I->m[j] = I->m[j-1];
     342            }
     343            I->m[i] = p;
     344            return(I);
     345        }
     346        if(DegMon(p)>DegMon(I->m[i]))
     347        {
     348            idInsertPoly(I,p);
     349            idSkipZeroes(I);
     350            for(j = IDELEMS(I)-1; j>=i+2;j--)
     351            {
     352                I->m[j] = I->m[j-1];
     353            }
     354            I->m[i+1] = p;
     355            return(I);
     356        }
     357        i--;
     358    }
     359}
     360
     361//it sorts the ideal by the degrees
     362static ideal SortByDeg(ideal I)
     363{
     364    if(idIs0(I))
     365    {
     366        return(I);
     367    }
     368    idSkipZeroes(I);
     369    int i;
     370    ideal res;
     371    idSkipZeroes(I);
     372    res = idInit(1,1);
     373    res->m[0] = poly(0);
     374    for(i = 0; i<=IDELEMS(I)-1;i++)
     375    {
     376        res = SortByDeg_p(res, I->m[i]);
     377    }
     378    idSkipZeroes(res);
     379    //idDegSortTest(res);
     380    return(res);
     381}
     382
     383//idQuot(I,p) for I monomial ideal, p a ideal with a single monomial.
     384ideal idQuotMon(ideal Iorig, ideal p)
     385{
     386    if(idIs0(Iorig))
     387    {
     388        ideal res = idInit(1,1);
     389        res->m[0] = poly(0);
     390        return(res);
     391    }
     392    if(idIs0(p))
     393    {
     394        ideal res = idInit(1,1);
     395        res->m[0] = pOne();
     396        return(res);
     397    }
     398    ideal I = idCopy(Iorig);
     399    ideal res = idInit(IDELEMS(I),1);
     400    int i,j;
     401    int dummy;
     402    for(i = 0; i<IDELEMS(I); i++)
     403    {
     404        res->m[i] = p_Copy(I->m[i], currRing);
     405        for(j = 1; (j<=currRing->N) ; j++)
     406        {
     407            dummy = p_GetExp(p->m[0], j, currRing);
     408            if(dummy > 0)
     409            {
     410                if(p_GetExp(I->m[i], j, currRing) < dummy)
     411                {
     412                    p_SetExp(res->m[i], j, 0, currRing);
     413                }
     414                else
     415                {
     416                    p_SetExp(res->m[i], j, p_GetExp(I->m[i], j, currRing) - dummy, currRing);
     417                }
     418            }
     419        }
     420        p_Setm(res->m[i], currRing);
     421        if(DegMon(res->m[i]) == DegMon(I->m[i]))
     422        {
     423            res->m[i] = NULL;
     424        }
     425        else
     426        {
     427            I->m[i] = NULL;
     428        }
     429    }
     430    idSkipZeroes(res);
     431    idSkipZeroes(I);
     432    if(!idIs0(res))
     433    {
     434    for(i = 0; i<=IDELEMS(res)-1; i++)
     435    {
     436        I = SortByDeg_p(I,res->m[i]);
     437    }
     438    }
     439    //idDegSortTest(I);
     440    return(I);
     441}
     442
     443//id_Add for monomials
     444static ideal idAddMon(ideal I, ideal p)
     445{
     446    #if 1
     447    I = SortByDeg_p(I,p->m[0]);
     448    #else
     449    I = id_Add(I,p,currRing);
     450    #endif
     451    //idSkipZeroes(I);
     452    return(I);
     453}
     454
     455//searches for a variable that is not yet used (assumes that the ideal is sqrfree)
     456static poly ChoosePVar (ideal I)
     457{
     458    bool flag=TRUE;
     459    int i,j;
     460    poly res;
     461    for(i=1;i<=currRing->N;i++)
     462    {
     463        flag=TRUE;
     464        for(j=IDELEMS(I)-1;(j>=0)&&(flag);j--)
     465        {
     466            if(p_GetExp(I->m[j], i, currRing)>0)
     467            {
     468                flag=FALSE;
     469            }
     470        }
     471       
     472        if(flag == TRUE)
     473        {
     474            res = p_ISet(1, currRing);
     475            p_SetExp(res, i, 1, currRing);
     476            p_Setm(res,currRing);
     477            return(res);
     478        }
     479        else
     480        {
     481            p_Delete(&res, currRing);
     482        }
     483    }
     484    return(NULL); //i.e. it is the maximal ideal
     485}
     486
     487//choice XL: last entry divided by x (xy10z15 -> y9z14)
     488static poly ChoosePXL(ideal I)
     489{
     490    int i,j,dummy=0;
     491    poly m;
     492    for(i = IDELEMS(I)-1; (i>=0) && (dummy == 0); i--)
     493    {
     494        for(j = 1; (j<=currRing->N) && (dummy == 0); j++)
     495        {
     496            if(p_GetExp(I->m[i],j, currRing)>1)
     497            {
     498                dummy = 1;
     499            }
     500        }
     501    }
     502    m = p_Copy(I->m[i+1],currRing);
     503    for(j = 1; j<=currRing->N; j++)
     504    {
     505        dummy = p_GetExp(m,j,currRing);
     506        if(dummy >= 1)
     507        {
     508            p_SetExp(m, j, dummy-1, currRing);
     509        }
     510    }
     511    if(!p_IsOne(m, currRing))
     512    {
     513        p_Setm(m, currRing);
     514        return(m);
     515    }
     516    m = ChoosePVar(I);
     517    return(m);
     518}
     519
     520//choice XF: first entry divided by x (xy10z15 -> y9z14)
     521static poly ChoosePXF(ideal I)
     522{
     523    int i,j,dummy=0;
     524    poly m;
     525    for(i =0 ; (i<=IDELEMS(I)-1) && (dummy == 0); i++)
     526    {
     527        for(j = 1; (j<=currRing->N) && (dummy == 0); j++)
     528        {
     529            if(p_GetExp(I->m[i],j, currRing)>1)
     530            {
     531                dummy = 1;
     532            }
     533        }
     534    }
     535    m = p_Copy(I->m[i-1],currRing);
     536    for(j = 1; j<=currRing->N; j++)
     537    {
     538        dummy = p_GetExp(m,j,currRing);
     539        if(dummy >= 1)
     540        {
     541            p_SetExp(m, j, dummy-1, currRing);
     542        }
     543    }
     544    if(!p_IsOne(m, currRing))
     545    {
     546        p_Setm(m, currRing);
     547        return(m);
     548    }
     549    m = ChoosePVar(I);
     550    return(m);
     551}
     552
     553//choice OL: last entry the first power (xy10z15 -> xy9z15)
     554static poly ChoosePOL(ideal I)
     555{
     556    int i,j,dummy;
     557    poly m;
     558    for(i = IDELEMS(I)-1;i>=0;i--)
     559    {
     560        m = p_Copy(I->m[i],currRing);
     561        for(j=1;j<=currRing->N;j++)
     562        {
     563            dummy = p_GetExp(m,j,currRing);
     564            if(dummy > 0)
     565            {
     566                p_SetExp(m,j,dummy-1,currRing);
     567                p_Setm(m,currRing);
     568            }       
     569        }
     570        if(!p_IsOne(m, currRing))
     571        {
     572            return(m);
     573        }
     574        else
     575        {
     576            p_Delete(&m,currRing);
     577        }
     578    }
     579    m = ChoosePVar(I);
     580    return(m);
     581}
     582
     583//choice OF: first entry the first power (xy10z15 -> xy9z15)
     584static poly ChoosePOF(ideal I)
     585{
     586    int i,j,dummy;
     587    poly m;
     588    for(i = 0 ;i<=IDELEMS(I)-1;i++)
     589    {
     590        m = p_Copy(I->m[i],currRing);
     591        for(j=1;j<=currRing->N;j++)
     592        {
     593            dummy = p_GetExp(m,j,currRing);
     594            if(dummy > 0)
     595            {
     596                p_SetExp(m,j,dummy-1,currRing);
     597                p_Setm(m,currRing);
     598            }       
     599        }
     600        if(!p_IsOne(m, currRing))
     601        {
     602            return(m);
     603        }
     604        else
     605        {
     606            p_Delete(&m,currRing);
     607        }
     608    }
     609    m = ChoosePVar(I);
     610    return(m);
     611}
     612
     613//choice VL: last entry the first variable with power (xy10z15 -> y)
     614static poly ChoosePVL(ideal I)
     615{
     616    int i,j,dummy;
     617    bool flag = TRUE;
     618    poly m = p_ISet(1,currRing);
     619    for(i = IDELEMS(I)-1;(i>=0) && (flag);i--)
     620    {
     621        flag = TRUE;
     622        for(j=1;(j<=currRing->N) && (flag);j++)
     623        {
     624            dummy = p_GetExp(I->m[i],j,currRing);
     625            if(dummy >= 2)
     626            {
     627                p_SetExp(m,j,1,currRing);
     628                p_Setm(m,currRing);
     629                flag = FALSE;
     630            }       
     631        }
     632        if(!p_IsOne(m, currRing))
     633        {
     634            return(m);
     635        }
     636    }
     637    m = ChoosePVar(I);
     638    return(m);
     639}
     640
     641//choice VF: first entry the first variable with power (xy10z15 -> y)
     642static poly ChoosePVF(ideal I)
     643{
     644    int i,j,dummy;
     645    bool flag = TRUE;
     646    poly m = p_ISet(1,currRing);
     647    for(i = 0;(i<=IDELEMS(I)-1) && (flag);i++)
     648    {
     649        flag = TRUE;
     650        for(j=1;(j<=currRing->N) && (flag);j++)
     651        {
     652            dummy = p_GetExp(I->m[i],j,currRing);
     653            if(dummy >= 2)
     654            {
     655                p_SetExp(m,j,1,currRing);
     656                p_Setm(m,currRing);
     657                flag = FALSE;
     658            }       
     659        }
     660        if(!p_IsOne(m, currRing))
     661        {
     662            return(m);
     663        }
     664    }
     665    m = ChoosePVar(I);
     666    return(m);
     667}
     668
     669//choice JL: last entry just variable with power (xy10z15 -> y10)
     670static poly ChoosePJL(ideal I)
     671{
     672    int i,j,dummy;
     673    bool flag = TRUE;
     674    poly m = p_ISet(1,currRing);
     675    for(i = IDELEMS(I)-1;(i>=0) && (flag);i--)
     676    {
     677        flag = TRUE;
     678        for(j=1;(j<=currRing->N) && (flag);j++)
     679        {
     680            dummy = p_GetExp(I->m[i],j,currRing);
     681            if(dummy >= 2)
     682            {
     683                p_SetExp(m,j,dummy-1,currRing);
     684                p_Setm(m,currRing);
     685                flag = FALSE;
     686            }       
     687        }
     688        if(!p_IsOne(m, currRing))
     689        {
     690            return(m);
     691        }
     692    }
     693    m = ChoosePVar(I);
     694    return(m);
     695}
     696
     697//choice JF: last entry just variable with power -1 (xy10z15 -> y9)
     698static poly ChoosePJF(ideal I)
     699{
     700    int i,j,dummy;
     701    bool flag = TRUE;
     702    poly m = p_ISet(1,currRing);
     703    for(i = 0;(i<=IDELEMS(I)-1) && (flag);i++)
     704    {
     705        flag = TRUE;
     706        for(j=1;(j<=currRing->N) && (flag);j++)
     707        {
     708            dummy = p_GetExp(I->m[i],j,currRing);
     709            if(dummy >= 2)
     710            {
     711                p_SetExp(m,j,dummy-1,currRing);
     712                p_Setm(m,currRing);
     713                flag = FALSE;
     714            }       
     715        }
     716        if(!p_IsOne(m, currRing))
     717        {
     718            return(m);
     719        }
     720    }
     721    m = ChoosePVar(I);
     722    return(m);
     723}
     724
     725//chooses 1 \neq p \not\in S. This choice should be made optimal
     726static poly ChooseP(ideal I)
     727{
     728    poly m;
     729    //  TEST TO SEE WHICH ONE IS BETTER
     730    //m = ChoosePXL(I);
     731    //m = ChoosePXF(I);
     732    //m = ChoosePOL(I);
     733    //m = ChoosePOF(I);
     734    //m = ChoosePVL(I);
     735    //m = ChoosePVF(I);
     736    m = ChoosePJL(I);
     737    //m = ChoosePJF(I);
     738    return(m);
     739}
     740
     741//searches for a monomial of degree d>=2 and divides it by a variable (result monomial of deg d-1)
     742static poly SearchP(ideal I)
     743{
     744    int i,j,exp;
     745    poly res;
     746    if(DegMon(I->m[IDELEMS(I)-1])<=1)
     747    {
     748        res = ChoosePVar(I);
     749        return(res);
     750    }
     751    i = IDELEMS(I)-1;
     752    res = p_Copy(I->m[i], currRing);
     753    for(j=1;j<=currRing->N;j++)
     754    {
     755        exp = p_GetExp(I->m[i], j, currRing);
     756        if(exp > 0)
     757        {
     758            p_SetExp(res, j, exp - 1, currRing);
     759            p_Setm(res,currRing);
     760            return(res);
     761        }
     762    }
     763}
     764
     765//test if the ideal is of the form (x1, ..., xr)
     766static bool JustVar(ideal I)
     767{
     768    #if 0
     769    int i,j;
     770    bool foundone;
     771    for(i=0;i<=IDELEMS(I)-1;i++)
     772    {
     773        foundone = FALSE;
     774        for(j = 1;j<=currRing->N;j++)
     775        {
     776            if(p_GetExp(I->m[i], j, currRing)>0)
     777            {
     778                if(foundone == TRUE)
     779                {
     780                    return(FALSE);
     781                }
     782                foundone = TRUE;
     783            }
     784        }       
     785    }
     786    return(TRUE);
     787    #else
     788    if(DegMon(I->m[IDELEMS(I)-1])>1)
     789    {
     790        return(FALSE);
     791    }
     792    return(TRUE);
     793    #endif
     794}
     795
     796//computes the Euler Characteristic of the ideal
     797static void eulerchar (ideal I, int variables, mpz_ptr ec)
     798{
     799  loop
     800  {
     801    mpz_t dummy;
     802    if(JustVar(I) == TRUE)
     803    {
     804        if(IDELEMS(I) == variables)
     805        {
     806            mpz_init(dummy);
     807            if((variables % 2) == 0)
     808                {mpz_set_si(dummy, 1);}
     809            else
     810                {mpz_set_si(dummy, -1);}
     811            mpz_add(ec, ec, dummy);
     812        }
     813        //mpz_clear(dummy);
     814        return;       
     815    }
     816    ideal p = idInit(1,1);
     817    p->m[0] = SearchP(I);
     818    //idPrint(I);
     819    //idPrint(p);
     820    //printf("\nNow get in idQuotMon\n");
     821    ideal Ip = idQuotMon(I,p);
     822    //idPrint(Ip);
     823    //Ip = SortByDeg(Ip);
     824    int i,howmanyvarinp = 0;
     825    for(i = 1;i<=currRing->N;i++)
     826    {
     827        if(p_GetExp(p->m[0],i,currRing)>0)
     828        {
     829            howmanyvarinp++;
     830        }
     831    }   
     832    eulerchar(Ip, variables-howmanyvarinp, ec);
     833    id_Delete(&Ip, currRing);
     834    I = idAddMon(I,p);
     835  }
     836}
     837
     838//tests if an ideal is Square Free, if no, returns the variable which appears at powers >1
     839static poly SqFree (ideal I)
     840{
     841    int i,j;
     842    bool flag=TRUE;
     843    poly notsqrfree = NULL;
     844    if(DegMon(I->m[IDELEMS(I)-1])<=1)
     845    {
     846        return(notsqrfree);
     847    }
     848    for(i=IDELEMS(I)-1;(i>=0)&&(flag);i--)
     849    {
     850        for(j=1;(j<=currRing->N)&&(flag);j++)
     851        {
     852            if(p_GetExp(I->m[i],j,currRing)>1)
     853            {
     854                flag=FALSE;
     855                notsqrfree = p_ISet(1,currRing);
     856                p_SetExp(notsqrfree,j,1,currRing);
     857            }
     858        }
     859    }
     860    if(notsqrfree != NULL)
     861    {
     862        p_Setm(notsqrfree,currRing);
     863    }
     864    return(notsqrfree);
     865}
     866
     867//checks if a polynomial is in I
     868static bool IsIn(poly p, ideal I)
     869{
     870    //assumes that I is ordered by degree
     871    if(idIs0(I))
     872    {
     873        if(p==poly(0))
     874        {
     875            return(TRUE);
     876        }
     877        else
     878        {
     879            return(FALSE);
     880        }
     881    }
     882    if(p==poly(0))
     883    {
     884        return(FALSE);
     885    }
     886    int i,j;
     887    bool flag;
     888    for(i = 0;i<IDELEMS(I);i++)
     889    {
     890        flag = TRUE;
     891        for(j = 1;(j<=currRing->N) &&(flag);j++)
     892        {
     893            if(p_GetExp(p, j, currRing)<p_GetExp(I->m[i], j, currRing))
     894            {
     895                flag = FALSE;
     896            }
     897        }
     898        if(flag)
     899        {
     900            return(TRUE);
     901        }
     902    }
     903    return(FALSE);
     904}
     905
     906//computes the lcm of min I, I monomial ideal
     907static poly LCMmon(ideal I)
     908{
     909    if(idIs0(I))
     910    {
     911        return(NULL);
     912    }
     913    poly m;
     914    int dummy,i,j;
     915    m = p_ISet(1,currRing);
     916    for(i=1;i<=currRing->N;i++)
     917    {
     918        dummy=0;
     919        for(j=IDELEMS(I)-1;j>=0;j--)
     920        {
     921            if(p_GetExp(I->m[j],i,currRing) > dummy)
     922            {
     923                dummy = p_GetExp(I->m[j],i,currRing);
     924            }
     925        }
     926        p_SetExp(m,i,dummy,currRing);
     927    }
     928    p_Setm(m,currRing);
     929    return(m);
     930}
     931
     932//the Roune Slice Algorithm
     933void rouneslice(ideal I, ideal S, poly q, poly x, int &prune, int &moreprune, int &steps, int &NNN, mpz_ptr &hilbertcoef, int* &hilbpower)
     934{
     935  loop
     936  {
     937    (steps)++;
     938    int i,j;
     939    int dummy;
     940    poly m;
     941    ideal p, koszsimp;
     942    //----------- PRUNING OF S ---------------
     943    //S SHOULD IN THIS POINT BE ORDERED BY DEGREE
     944    for(i=IDELEMS(S)-1;i>=0;i--)
     945    {
     946        if(IsIn(S->m[i],I))
     947        {
     948            S->m[i]=NULL;
     949            prune++;
     950        }
     951    }
     952    idSkipZeroes(S);
     953    //----------------------------------------
     954    for(i=IDELEMS(I)-1;i>=0;i--)
     955    {
     956        m = p_Copy(I->m[i],currRing);
     957        for(j=1;j<=currRing->N;j++)
     958        {
     959            dummy = p_GetExp(m,j,currRing);
     960            if(dummy > 0)
     961            {
     962                p_SetExp(m,j,dummy-1,currRing);
     963            }       
     964        }
     965        p_Setm(m, currRing);
     966        if(IsIn(m,S))
     967        {
     968            I->m[i]=NULL;
     969            //printf("\n Deleted, since pi(m) is in S\n");pWrite(m);
     970        }
     971    }
     972    idSkipZeroes(I);
     973    //----------- MORE PRUNING OF S ------------
     974    m = LCMmon(I);
     975    if(m != NULL)
     976    {
     977        for(i=0;i<IDELEMS(S);i++)
     978        {     
     979            if(!(p_DivisibleBy(S->m[i], m, currRing))) 
     980            {
     981                S->m[i] = NULL;
     982                j++;
     983                moreprune++;
     984            }
     985            else
     986            {
     987                if(pLmEqual(S->m[i],m))
     988                {
     989                    S->m[i] = NULL;
     990                    moreprune++;
     991                }
     992            }
     993        }
     994    idSkipZeroes(S);
     995    }
     996    /*printf("\n---------------------------\n");
     997    printf("\n      I\n");idPrint(I);
     998    printf("\n      S\n");idPrint(S);
     999    printf("\n      q\n");pWrite(q);
     1000    getchar();*/
     1001   
     1002    if(idIs0(I))
     1003    {
     1004        id_Delete(&I, currRing);
     1005        id_Delete(&S, currRing);
     1006        p_Delete(&m, currRing);
     1007        break;
     1008    }
     1009    m = LCMmon(I);
     1010    if(!p_DivisibleBy(x,m, currRing))
     1011    {
     1012        //printf("\nx does not divide lcm(I)");
     1013        //printf("\nEmpty set");pWrite(q);
     1014        id_Delete(&I, currRing);
     1015        id_Delete(&S, currRing);
     1016        p_Delete(&m, currRing);
     1017        break;
     1018    }
     1019    m = SqFree(I);
     1020    if(m==NULL)
     1021    {
     1022        //printf("\n      Corner: ");
     1023        //pWrite(q);
     1024        //printf("\n      With the facets of the dual simplex:\n");
     1025        //idPrint(I);
     1026        mpz_t ec;
     1027        mpz_init(ec);
     1028        mpz_ptr ec_ptr = ec;
     1029        eulerchar(I, currRing->N, ec_ptr);
     1030        bool flag = FALSE;
     1031        if(NNN==0)
     1032            {
     1033                hilbertcoef = (mpz_ptr)omAlloc((NNN+1)*sizeof(mpz_t));
     1034                hilbpower = (int*)omAlloc((NNN+1)*sizeof(int));
     1035                mpz_init( &hilbertcoef[NNN]);
     1036                mpz_set(  &hilbertcoef[NNN], ec);
     1037                mpz_clear(ec);
     1038                hilbpower[NNN] = DegMon(q);
     1039                NNN++;
     1040            }
     1041        else
     1042        {
     1043            //I look if the power appears already
     1044            for(i = 0;(i<NNN)&&(flag == FALSE)&&(DegMon(q)>=hilbpower[i]);i++)
     1045            {
     1046                if((hilbpower[i]) == (DegMon(q)))
     1047                {
     1048                    flag = TRUE;
     1049                    mpz_add(&hilbertcoef[i],&hilbertcoef[i],ec_ptr);
     1050                }
     1051            }
     1052            if(flag == FALSE)
     1053            {
     1054                hilbertcoef = (mpz_ptr)omRealloc(hilbertcoef, (NNN+1)*sizeof(mpz_t));
     1055                hilbpower = (int*)omRealloc(hilbpower, (NNN+1)*sizeof(int));
     1056                mpz_init(&hilbertcoef[NNN]);
     1057                for(j = NNN; j>i; j--)
     1058                {
     1059                    mpz_set(&hilbertcoef[j],&hilbertcoef[j-1]);
     1060                    hilbpower[j] = hilbpower[j-1];
     1061                }
     1062                mpz_set(  &hilbertcoef[i], ec);
     1063                mpz_clear(ec);
     1064                hilbpower[i] = DegMon(q);
     1065                NNN++;
     1066            }
     1067        }
     1068        break;
     1069    }
     1070    m = ChooseP(I);
     1071    p = idInit(1,1);
     1072    p->m[0] = m;
     1073    ideal Ip = idQuotMon(I,p);
     1074    ideal Sp = idQuotMon(S,p);
     1075    poly pq = pp_Mult_mm(q,m,currRing);
     1076    rouneslice(Ip, Sp, pq, x, prune, moreprune, steps, NNN, hilbertcoef,hilbpower);
     1077    //id_Delete(&Ip, currRing);
     1078    //id_Delete(&Sp, currRing);
     1079    S = idAddMon(S,p);
     1080    p->m[0]=NULL;
     1081    id_Delete(&p, currRing); // p->m[0] was also in S
     1082    p_Delete(&pq,currRing);
     1083  }
     1084}
     1085
     1086//it computes the first hilbert series by means of Roune Slice Algorithm
     1087void slicehilb(ideal I)
     1088{
     1089    //printf("Adi changes are here: \n");
     1090    int i, NNN = 0;
     1091    int steps = 0, prune = 0, moreprune = 0;
     1092    mpz_ptr hilbertcoef;
     1093    int *hilbpower;
     1094    ideal S = idInit(1,1);
     1095    poly q = p_ISet(1,currRing);
     1096    ideal X = idInit(1,1);
     1097    X->m[0]=p_One(currRing);
     1098    for(i=1;i<=currRing->N;i++)
     1099    {
     1100            p_SetExp(X->m[0],i,1,currRing);   
     1101    }
     1102    p_Setm(X->m[0],currRing);
     1103    I = id_Mult(I,X,currRing);
     1104    I = SortByDeg(I);
     1105    //printf("\n-------------RouneSlice--------------\n");
     1106    rouneslice(I,S,q,X->m[0],prune, moreprune, steps, NNN, hilbertcoef, hilbpower);
     1107    //printf("\nIn total Prune got rid of %i elements\n",prune);
     1108    //printf("\nIn total More Prune got rid of %i elements\n",moreprune);
     1109    //printf("\nSteps of rouneslice: %i\n\n", steps);
     1110    mpz_t coefhilb;
     1111    mpz_t dummy;
     1112    mpz_init(coefhilb);
     1113    mpz_init(dummy);
     1114    printf("\n//  %8d t^0",1);
     1115    for(i = 0; i<NNN; i++)
     1116    {
     1117        if(mpz_sgn(&hilbertcoef[i])!=0)
     1118        {
     1119            gmp_printf("\n//  %8Zd t^%d",&hilbertcoef[i],hilbpower[i]);
     1120        }
     1121    }
     1122    omFreeSize(hilbertcoef, (NNN)*sizeof(mpz_t));
     1123    omFreeSize(hilbpower, (NNN)*sizeof(int));
     1124    //printf("\n-------------------------------------\n");
     1125}
     1126
     1127// -------------------------------- END OF CHANGES -------------------------------------------
    2161128static intvec * hSeries(ideal S, intvec *modulweight,
    2171129                int /*notstc*/, intvec *wdegree, ideal Q, ring tailRing)
     
    4721384}
    4731385
     1386
     1387
  • kernel/hutil.h

    r6776cf r7b00dbc  
    7474void hDegreeSeries(intvec *s1, intvec *s2, int *co, int *mu);
    7575
     76void slicehilb(ideal I);
    7677#endif
  • kernel/khstd.cc

    r6776cf r7b00dbc  
    155155#if ADIDEBUG
    156156PrintS("\nOriginal\n");
    157 int   j, l, k;
     157int   i, j, l, k;
    158158  if (hilb == NULL)
    159159    return;
  • kernel/kstdfac.cc

    r6776cf r7b00dbc  
    641641        }
    642642
     643        n->P.pLength=0;
    643644        n->P.p=fac->m[i];
    644645        n->initEcart(&n->P);
  • kernel/kutil.cc

    r6776cf r7b00dbc  
    396396      if (p_GetExp(p,i,r) > p_GetExp(h,i,r)) return ; // does not divide
    397397      #ifdef HAVE_RINGS
    398       ///should check also if the lc is a zero divisor, if it divides all the others
     398      // Note: As long as qring j forbidden if j contains integer (i.e. ground rings are
     399      //       domains), no zerodivisor test needed  CAUTION
    399400      if (rField_is_Ring(currRing) && currRing->OrdSgn == -1)
    400401              if(n_DivBy(p_GetCoeff(h,r->cf),lc,r->cf) == 0)
     
    725726  }
    726727
    727   if (i >= 0 && T->pLength != 0
    728   && ! rIsSyzIndexRing(currRing) && T->pLength != pLength(p))
     728  if ((i >= 0) && (T->pLength != 0)
     729  && (! rIsSyzIndexRing(currRing)) && (T->pLength != pLength(p)))
    729730  {
    730731    int l=T->pLength;
     
    55105511  {
    55115512    L->length = 0;
     5513    L->pLength = 0;
    55125514  }
    55135515
  • kernel/misc.cc

    r6776cf r7b00dbc  
    1111#include <kernel/mod2.h>
    1212
    13 #define SI_DONT_HAVE_GLOBAL_VARS
    14 #  include <factory/factory.h>
     13#include <factory/factory.h>
    1514/* libfac version strings */
    1615
  • kernel/syz0.cc

    r6776cf r7b00dbc  
    772772}
    773773
     774#if 0
    774775static void syMergeSortResolventFB(resolvente res,int length, int initial=1)
    775776{
     
    826827  }
    827828}
     829#endif
    828830
    829831BOOLEAN syTestOrder(ideal M)
  • kernel/test.cc

    r6776cf r7b00dbc  
    5050#include <polys/clapsing.h>
    5151
    52 
    53 // The following are needed due to FACTORY (e.g. initCanonicalForm)
    54 // int initializeGMP(){ return 1; }
    55 int mmInit(void) {return 1; }
    5652
    5753// // TODO: DUE to the use of HALT in npolygon.cc :(((
  • libpolys/coeffs/OPAE.cc

    r6776cf r7b00dbc  
    2828// DEFINITION DER FUNKTIONEN
    2929
    30 number  nAEAdd(number a, number b,const coeffs r)
     30number  nAEAdd(number a, number b, const coeffs)
    3131{
    3232    int_poly* f=reinterpret_cast<int_poly*> (a);
     
    3838}
    3939
    40 number  nAEMult(number a, number b,const coeffs r)
     40number  nAEMult(number a, number b, const coeffs)
    4141{
    4242    int_poly* f=reinterpret_cast<int_poly*> (a);
     
    4848}
    4949
    50 number  nAESub(number a, number b,const coeffs r)
     50number  nAESub(number a, number b, const coeffs)
    5151{
    5252    int_poly* f=reinterpret_cast<int_poly*> (a);
     
    5959
    6060
    61 number  nAEDiv(number a, number b,const coeffs r)
     61number  nAEDiv(number a, number b, const coeffs)
    6262{
    6363    int_poly* f=reinterpret_cast<int_poly*> (a);
     
    7070
    7171
    72 number  nAEIntDiv(number a, number b,const coeffs r)
     72number  nAEIntDiv(number a, number b, const coeffs)
    7373{
    7474
     
    8181}
    8282
    83 number  nAEIntMod(number a, number b,const coeffs r)
     83number  nAEIntMod(number a, number, const coeffs)
    8484{
    8585    return a;
    8686}
    8787
    88 number  nAEExactDiv(number a, number b,const coeffs r)
     88number  nAEExactDiv(number a, number b, const coeffs)
    8989{
    9090    int_poly* f=reinterpret_cast<int_poly*> (a);
     
    9898
    9999
    100 number nAEInit(long i, const coeffs r)
     100number nAEInit(long i, const coeffs)
    101101{
    102102    mpz_t m;
    103     mpz_init_set_ui(m,i);
     103    mpz_init_set_ui(m, i);
    104104    int_poly* res=new int_poly;
    105105    res->poly_set(m);
     
    108108}
    109109
    110 number nAEInitMPZ(mpz_t m, const coeffs r)
     110number nAEInitMPZ(mpz_t m, const coeffs)
    111111{
    112112    int_poly* res=new int_poly;
     
    117117
    118118
    119 int nAESize (number a,const coeffs r)
     119int nAESize (number a, const coeffs)
    120120{
    121121    int_poly* f=reinterpret_cast<int_poly*> (a);
     
    123123}
    124124
    125 int nAEInt(number &a,const coeffs r)
     125int nAEInt(number &, const coeffs)
    126126{
    127127    return 1;
     
    129129
    130130
    131 number nAEMPZ(number a,const coeffs r)
     131number nAEMPZ(number a, const coeffs)
    132132{
    133133    return a;
     
    135135
    136136
    137 number nAENeg(number c, const coeffs r)
     137number nAENeg(number c, const coeffs)
    138138{
    139139    int_poly* f=reinterpret_cast<int_poly*> (c);
     
    144144}
    145145
    146 number nAECopy(number c, const coeffs r)
     146number nAECopy(number c, const coeffs)
    147147{
    148148    return (number) c;
    149149}
    150150
    151 number nAERePart(number c, const coeffs r)
     151number nAERePart(number c, const coeffs)
    152152{
    153153    return (number) c;
    154154}
    155155
    156 number nAEImPart(number c, const coeffs r)
     156number nAEImPart(number c, const coeffs)
    157157{
    158158    return (number) c;
    159159}
    160160
    161 void    nAEWriteLong   (number &a, const coeffs r)
     161void    nAEWriteLong   (number &a, const coeffs)
    162162{
    163163    int_poly* f=reinterpret_cast <int_poly*>(a);
     
    166166}
    167167
    168 void    nAEWriteShort  (number &a, const coeffs r)
     168void    nAEWriteShort  (number &a, const coeffs)
    169169{
    170170    int_poly* f=reinterpret_cast <int_poly*>(a);
     
    174174
    175175
    176 const char *  nAERead  (const char *s, number *a,const coeffs r)
     176const char *  nAERead  (const char *, number *, const coeffs)
    177177{
    178178    char* c=new char;
     
    181181}
    182182
    183 number nAENormalize    (number a,number b,const coeffs r) // ?
     183number nAENormalize    (number a, number, const coeffs) // ?
    184184{
    185185        return a;
    186186}
    187187
    188 BOOLEAN nAEGreater     (number a, number b,const coeffs r)
     188BOOLEAN nAEGreater     (number a, number b, const coeffs)
    189189{
    190190        int_poly* f=reinterpret_cast<int_poly*> (a);
     
    194194}
    195195
    196 BOOLEAN nAEEqual     (number a, number b,const coeffs r)
     196BOOLEAN nAEEqual     (number a, number b, const coeffs)
    197197{
    198198        int_poly* f=reinterpret_cast<int_poly*> (a);
     
    202202}
    203203
    204 BOOLEAN nAEIsZero      (number a,const coeffs r)
     204BOOLEAN nAEIsZero      (number a, const coeffs)
    205205{
    206206        int_poly* f=reinterpret_cast<int_poly*> (a);
     
    209209}
    210210
    211 BOOLEAN nAEIsOne      (number a,const coeffs r)
     211BOOLEAN nAEIsOne      (number a, const coeffs)
    212212{
    213213        int_poly* f=reinterpret_cast<int_poly*> (a);
     
    216216}
    217217
    218 BOOLEAN nAEIsMOne      (number a,const coeffs r)
     218BOOLEAN nAEIsMOne      (number a, const coeffs)
    219219{
    220220        int_poly* f=reinterpret_cast<int_poly*> (a);
     
    225225BOOLEAN nAEGreaterZero     (number a, const coeffs r)
    226226{
    227         if (nAEIsZero(a,r) == FALSE) { return TRUE; }
     227        if (nAEIsZero(a, r) == FALSE) { return TRUE; }
    228228        else { return FALSE; }
    229229}
    230230
    231 void    nAEPower       (number a, int i, number * result,const coeffs r)
     231void    nAEPower       (number, int, number *, const coeffs)
    232232{
    233233        return;
    234234}
    235235
    236 number nAEGetDenom      (number &a, const coeffs r)
     236number nAEGetDenom      (number &, const coeffs)
    237237{
    238238        return (number) 1;
    239239}
    240240
    241 number nAEGetNumerator      (number &a, const coeffs r)
     241number nAEGetNumerator      (number &a, const coeffs)
    242242{
    243243        return a;
    244244}
    245245
    246 number nAEGcd           (number a,number b,const coeffs r)
     246number nAEGcd           (number a, number b, const coeffs)
    247247{
    248248        int_poly* f=reinterpret_cast<int_poly*> (a);
     
    253253}
    254254
    255 number nAELcm          (number a,number b,const coeffs r)
     255number nAELcm          (number a, number b, const coeffs)
    256256{
    257257        int_poly* f=reinterpret_cast<int_poly*> (a);
     
    265265}
    266266
    267 void    nAEDelete       (number *a, const coeffs r)
     267void    nAEDelete       (number *, const coeffs)
    268268{
    269269        return;
     
    271271
    272272/*
    273 number    nAESetMap        (number a, const coeffs r)
     273number    nAESetMap        (number a, const coeffs)
    274274{
    275275        return a;
    276276}
    277277*/
    278 char*    nAEName       (number a, const coeffs r)
     278char*    nAEName       (number, const coeffs)
    279279{       char *c=new char;
    280280        *c='c';
     
    282282}
    283283
    284 void    nAEInpMult       (number &a, number b,const coeffs r)
     284void    nAEInpMult       (number &, number, const coeffs)
    285285{
    286286        return ;
    287287}
    288288
    289 void    nAECoeffWrite   (const coeffs r, BOOLEAN details)
     289void    nAECoeffWrite   (const coeffs, BOOLEAN)
    290290{
    291291        return;
    292292}
    293293
    294 BOOLEAN nAEClearContent  (number a,const coeffs r)
     294BOOLEAN nAEClearContent  (number, const coeffs)
    295295{
    296296        return FALSE;
    297297}
    298298
    299 BOOLEAN nAEClearDenominators  (number a,const coeffs r)
     299BOOLEAN nAEClearDenominators  (number, const coeffs)
    300300{
    301301        return FALSE;
     
    307307
    308308
    309 BOOLEAN n_AEInitChar(coeffs r,void * p) // vlt noch void* p hin
    310 {
    311 
     309BOOLEAN n_AEInitChar(coeffs r, void *)
     310{
    312311    r->ch = 0;
    313312    r->cfKillChar=NULL;
  • libpolys/coeffs/OPAE.h

    r6776cf r7b00dbc  
    99
    1010BOOLEAN n_AEInitChar(coeffs , void *);
    11 BOOLEAN nAECoeffIsEqual     (number a, number b,const coeffs r);
     11BOOLEAN nAECoeffIsEqual     (number a, number b, const coeffs r);
    1212number  nAEMult        (number a, number b, const coeffs r);
    13 number  nAESub         (number a, number b,const coeffs r);
    14 number  nAEAdd         (number a, number b,const coeffs r);
    15 number  nAEDiv         (number a, number b,const coeffs r);
     13number  nAESub         (number a, number b, const coeffs r);
     14number  nAEAdd         (number a, number b, const coeffs r);
     15number  nAEDiv         (number a, number b, const coeffs r);
    1616number  nAEIntDiv      (number a, number b, const coeffs r); //Hir wollte wir was gucken
    1717number  nAEIntMod      (number a, number b, const coeffs r);// Hir wollte wir was gucken
    18 number  nAEExactDiv    (number a, number b,const coeffs r);
     18number  nAEExactDiv    (number a, number b, const coeffs r);
    1919number  nAEInit        (long i, const coeffs r);
    2020number  nAEInitMPZ     (mpz_t m, const coeffs r); //nachgucken/fragen
    2121int     nAESize        (number a, const coeffs r);///
    22 int     nAEInt         (number &a,const coeffs r);
    23 number  nAEMPZ         (number a,const coeffs r); //nachgucken/fragen
    24 number  nAENeg         (number c,const coeffs r);
    25 number  nAECopy        (number a, number b,const coeffs r); // nachgicken
    26 number  nAERePart      (number a, number b,const coeffs r); // nachgicken
    27 number  nAEImPart      (number a, number b,const coeffs r); // nachgicken
     22int     nAEInt         (number &a, const coeffs r);
     23number  nAEMPZ         (number a, const coeffs r); //nachgucken/fragen
     24number  nAENeg         (number c, const coeffs r);
     25number  nAECopy        (number a, number b, const coeffs r); // nachgicken
     26number  nAERePart      (number a, number b, const coeffs r); // nachgicken
     27number  nAEImPart      (number a, number b, const coeffs r); // nachgicken
    2828
    2929void    nAEWriteLong   (number &a, const coeffs r);//
     
    3131
    3232
    33 const char *  nAERead  (const char *s, number *a,const coeffs r);
    34 number nAENormalize    (number a,number b,const coeffs r);//
    35 BOOLEAN nAEGreater     (number a, number b,const coeffs r);//
    36 BOOLEAN nAEEqual       (number a, number b,const coeffs r);
    37 BOOLEAN nAEIsZero      (number a,const coeffs r);
    38 BOOLEAN nAEIsOne       (number a,const coeffs r);
    39 BOOLEAN nAEIsMOne      (number a,const coeffs r);
    40 BOOLEAN nAEGreaterZero (number a, number b,const coeffs r);
    41 void    nAEPower       (number a, int i, number * result,const coeffs r);
     33const char *  nAERead  (const char *s, number *a, const coeffs r);
     34number nAENormalize    (number a, number b, const coeffs r);//
     35BOOLEAN nAEGreater     (number a, number b, const coeffs r);//
     36BOOLEAN nAEEqual       (number a, number b, const coeffs r);
     37BOOLEAN nAEIsZero      (number a, const coeffs r);
     38BOOLEAN nAEIsOne       (number a, const coeffs r);
     39BOOLEAN nAEIsMOne      (number a, const coeffs r);
     40BOOLEAN nAEGreaterZero (number a, number b, const coeffs r);
     41void    nAEPower       (number a, int i, number * result, const coeffs r);
    4242number nAEGetDenom     (number &a, const coeffs r);//
    4343number nAEGetNumerator (number &a, const coeffs r);//
    44 number nAEGcd          (number a,number b,const coeffs r);
    45 number nAELcm          (number a,number b,const coeffs r);
     44number nAEGcd          (number a, number b, const coeffs r);
     45number nAELcm          (number a, number b, const coeffs r);
    4646
    4747void    nAEDelete       (number *a, const coeffs r);//
     
    5151void    nAECoeffWrite   (const coeffs r, BOOLEAN details);//
    5252
    53 BOOLEAN nAEClearContent  (number a,const coeffs r);//
    54 BOOLEAN nAEClearDenominators  (number a,const coeffs r);//
     53BOOLEAN nAEClearContent  (number a, const coeffs r);//
     54BOOLEAN nAEClearDenominators  (number a, const coeffs r);//
    5555
    5656
  • libpolys/coeffs/OPAEQ.cc

    r6776cf r7b00dbc  
    2929// DEFINITION DER FUNKTIONEN
    3030
    31 number  nAEQAdd(number a, number b,const coeffs r)
     31number  nAEQAdd(number a, number b, const coeffs)
    3232{
    3333    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    3939}
    4040
    41 number  nAEQMult(number a, number b,const coeffs r)
     41number  nAEQMult(number a, number b, const coeffs)
    4242{
    4343    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    4949}
    5050
    51 number  nAEQSub(number a, number b,const coeffs r)
     51number  nAEQSub(number a, number b, const coeffs)
    5252{
    5353    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    6060
    6161
    62 number  nAEQDiv(number a, number b,const coeffs r)
     62number  nAEQDiv(number a, number b, const coeffs)
    6363{
    6464    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    7272
    7373
    74 number  nAEQIntDiv(number a, number b,const coeffs r)
     74number  nAEQIntDiv(number a, number b, const coeffs)
    7575{
    7676
     
    8383}
    8484
    85 number  nAEQIntMod(number a, number b,const coeffs r)
     85number  nAEQIntMod(number a, number, const coeffs)
    8686{
    8787    return a;
    8888}
    8989
    90 number  nAEQExactDiv(number a, number b,const coeffs r)
     90number  nAEQExactDiv(number a, number b, const coeffs)
    9191{
    9292    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    101101
    102102
    103 number nAEQInit(long i, const coeffs r)
     103number nAEQInit(long i, const coeffs)
    104104{
    105105    number res = (number) i;
     
    107107}
    108108
    109 number nAEQInitMPZ(mpz_t m, const coeffs r)
     109number nAEQInitMPZ(mpz_t m, const coeffs)
    110110{
    111111    number res= (number) m;
     
    113113}
    114114
    115 int nAEQSize (number a,const coeffs r)
     115int nAEQSize (number a, const coeffs)
    116116{
    117117    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    119119}
    120120
    121 int nAEQInt(number &a,const coeffs r)
     121int nAEQInt(number &, const coeffs)
    122122{
    123123    return 1;
     
    125125
    126126
    127 number nAEQMPZ(number a,const coeffs r)
     127number nAEQMPZ(number a, const coeffs)
    128128{
    129129    return a;
     
    131131
    132132
    133 number nAEQNeg(number c, const coeffs r)
     133number nAEQNeg(number c, const coeffs)
    134134{
    135135    Q_poly* f=reinterpret_cast<Q_poly*> (c);
     
    140140}
    141141
    142 number nAEQCopy(number c, const coeffs r)
     142number nAEQCopy(number c, const coeffs)
    143143{
    144144    return (number) c;
    145145}
    146146
    147 number nAEQRePart(number c, const coeffs r)
     147number nAEQRePart(number c, const coeffs)
    148148{
    149149    return (number) c;
    150150}
    151151
    152 number nAEQImPart(number c, const coeffs r)
     152number nAEQImPart(number c, const coeffs)
    153153{
    154154    return (number) c;
    155155}
    156156
    157 void    nAEQWriteLong   (number &a, const coeffs r)
     157void    nAEQWriteLong   (number &, const coeffs)
    158158{
    159159    return;
    160160}
    161161
    162 void    nAEQWriteShort  (number &a, const coeffs r)
     162void    nAEQWriteShort  (number &, const coeffs)
    163163{
    164164    return ;
     
    166166
    167167
    168 const char *  nAEQRead  (const char *s, number *a,const coeffs r)
     168const char *  nAEQRead  (const char *, number *, const coeffs)
    169169{
    170170    return "";
    171171}
    172172
    173 number nAEQNormalize    (number a,number b,const coeffs r) // ?
     173number nAEQNormalize    (number a, number , const coeffs) // ?
    174174{
    175175    return a;
    176176}
    177177
    178 BOOLEAN nAEQGreater     (number a, number b,const coeffs r)
     178BOOLEAN nAEQGreater     (number a, number b, const coeffs)
    179179{
    180180    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    184184}
    185185
    186 BOOLEAN nAEQEqual     (number a, number b,const coeffs r)
     186BOOLEAN nAEQEqual     (number a, number b, const coeffs)
    187187{
    188188    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    192192}
    193193
    194 BOOLEAN nAEQIsZero      (number a,const coeffs r)
     194BOOLEAN nAEQIsZero      (number a, const coeffs)
    195195{
    196196    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    199199}
    200200
    201 BOOLEAN nAEQIsOne      (number a,const coeffs r)
     201BOOLEAN nAEQIsOne      (number a, const coeffs)
    202202{
    203203    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    206206}
    207207
    208 BOOLEAN nAEQIsMOne      (number a,const coeffs r)
     208BOOLEAN nAEQIsMOne      (number a, const coeffs)
    209209{
    210210    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    215215BOOLEAN nAEQGreaterZero     (number a, const coeffs r)
    216216{
    217     if (nAEQIsZero(a,r) == FALSE) { return TRUE; }
     217    if (nAEQIsZero(a, r) == FALSE) { return TRUE; }
    218218    else { return FALSE; }
    219219}
    220220
    221 void    nAEQPower       (number a, int i, number * result,const coeffs r)
     221void    nAEQPower       (number, int, number *, const coeffs)
    222222{
    223223    return;
    224224}
    225225
    226 number nAEQGetDenom      (number &a, const coeffs r)
     226number nAEQGetDenom      (number &, const coeffs)
    227227{
    228228    return (number) 1;
    229229}
    230230
    231 number nAEQGetNumerator      (number &a, const coeffs r)
     231number nAEQGetNumerator      (number &a, const coeffs)
    232232{
    233233    return a;
    234234}
    235235
    236 number nAEQGcd           (number a,number b,const coeffs r)
     236number nAEQGcd           (number a, number b, const coeffs)
    237237{
    238238    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    243243}
    244244
    245 number nAEQLcm          (number a,number b,const coeffs r)
     245number nAEQLcm          (number a, number b, const coeffs)
    246246{
    247247    Q_poly* f=reinterpret_cast<Q_poly*> (a);
     
    256256}
    257257
    258 void    nAEQDelete       (number *a, const coeffs r)
     258void    nAEQDelete       (number *, const coeffs)
    259259{
    260260    return;
     
    262262
    263263/*
    264 number    nAEQSetMap        (number a, const coeffs r)
     264number    nAEQSetMap        (number a, const coeffs)
    265265{
    266266        return a;
    267267}
    268268*/
    269 char*    nAEQName       (number a, const coeffs r)
     269char*    nAEQName       (number, const coeffs)
    270270{
    271271    char* c=new char;
     
    275275}
    276276
    277 void    nAEQInpMult       (number &a, number b,const coeffs r)
     277void    nAEQInpMult       (number &, number, const coeffs)
    278278{
    279279    return ;
    280280}
    281281
    282 void    nAEQCoeffWrite   (const coeffs r, BOOLEAN details)
     282void    nAEQCoeffWrite   (const coeffs, BOOLEAN)
    283283{
    284284    return;
    285285}
    286286
    287 BOOLEAN nAEQClearContent  (number a,const coeffs r)
     287BOOLEAN nAEQClearContent  (number, const coeffs)
    288288{
    289289    return FALSE;
    290290}
    291291
    292 BOOLEAN nAEQClearDenominators  (number a,const coeffs r)
     292BOOLEAN nAEQClearDenominators  (number, const coeffs)
    293293{
    294294    return FALSE;
     
    300300
    301301
    302 BOOLEAN n_QAEInitChar(coeffs r,void *p) // vlt noch void* p hin
    303 {
    304 
    305 
    306 
     302BOOLEAN n_QAEInitChar(coeffs r, void *)
     303{
    307304    r->ch=0;
    308305    r->cfKillChar=NULL;
  • libpolys/coeffs/OPAEQ.h

    r6776cf r7b00dbc  
    99
    1010BOOLEAN n_QAEInitChar(coeffs , void *);
    11 BOOLEAN nAEQCoeffIsEqual     (number a, number b,const coeffs r);
     11BOOLEAN nAEQCoeffIsEqual     (number a, number b, const coeffs r);
    1212number  nAEQMult        (number a, number b, const coeffs r);
    13 number  nAEQSub         (number a, number b,const coeffs r);
    14 number  nAEQAdd         (number a, number b,const coeffs r);
    15 number  nAEQDiv         (number a, number b,const coeffs r);
     13number  nAEQSub         (number a, number b, const coeffs r);
     14number  nAEQAdd         (number a, number b, const coeffs r);
     15number  nAEQDiv         (number a, number b, const coeffs r);
    1616number  nAEQIntDiv      (number a, number b, const coeffs r); //Hir wollte wir was gucken
    1717number  nAEQIntMod      (number a, number b, const coeffs r);// Hir wollte wir was gucken
    18 number  nAEQExactDiv    (number a, number b,const coeffs r);
     18number  nAEQExactDiv    (number a, number b, const coeffs r);
    1919number  nAEQInit        (long i, const coeffs r);
    2020number  nAEQInitMPZ     (mpz_t m, const coeffs r); //nachgucken/fragen
    2121int     nAEQSize        (number a, const coeffs r);///
    22 int     nAEQInt         (number &a,const coeffs r);
    23 number  nAEQMPZ         (number a,const coeffs r); //nachgucken/fragen
    24 number  nAEQNeg         (number c,const coeffs r);
    25 number  nAEQCopy        (number a, number b,const coeffs r); // nachgicken
    26 number  nAEQRePart      (number a, number b,const coeffs r); // nachgicken
    27 number  nAEQImPart      (number a, number b,const coeffs r); // nachgicken
     22int     nAEQInt         (number &a, const coeffs r);
     23number  nAEQMPZ         (number a, const coeffs r); //nachgucken/fragen
     24number  nAEQNeg         (number c, const coeffs r);
     25number  nAEQCopy        (number a, number b, const coeffs r); // nachgicken
     26number  nAEQRePart      (number a, number b, const coeffs r); // nachgicken
     27number  nAEQImPart      (number a, number b, const coeffs r); // nachgicken
    2828
    2929void    nAEQWriteLong   (number &a, const coeffs r);//
     
    3131
    3232
    33 const char *  nAEQRead  (const char *s, number *a,const coeffs r);
    34 number nAEQNormalize    (number a,number b,const coeffs r);//
    35 BOOLEAN nAEQGreater     (number a, number b,const coeffs r);//
    36 BOOLEAN nAEQEqual       (number a, number b,const coeffs r);
    37 BOOLEAN nAEQIsZero      (number a,const coeffs r);
    38 BOOLEAN nAEQIsOne       (number a,const coeffs r);
    39 BOOLEAN nAEQIsMOne      (number a,const coeffs r);
    40 BOOLEAN nAEQGreaterZero (number a, number b,const coeffs r);
    41 void    nAEQPower       (number a, int i, number * result,const coeffs r);
     33const char *  nAEQRead  (const char *s, number *a, const coeffs r);
     34number nAEQNormalize    (number a, number b, const coeffs r);//
     35BOOLEAN nAEQGreater     (number a, number b, const coeffs r);//
     36BOOLEAN nAEQEqual       (number a, number b, const coeffs r);
     37BOOLEAN nAEQIsZero      (number a, const coeffs r);
     38BOOLEAN nAEQIsOne       (number a, const coeffs r);
     39BOOLEAN nAEQIsMOne      (number a, const coeffs r);
     40BOOLEAN nAEQGreaterZero (number a, number b, const coeffs r);
     41void    nAEQPower       (number a, int i, number * result, const coeffs r);
    4242number nAEQGetDenom     (number &a, const coeffs r);//
    4343number nAEQGetNumerator (number &a, const coeffs r);//
    44 number nAEQGcd          (number a,number b,const coeffs r);
    45 number nAEQLcm          (number a,number b,const coeffs r);
     44number nAEQGcd          (number a, number b, const coeffs r);
     45number nAEQLcm          (number a, number b, const coeffs r);
    4646
    4747void    nAEQDelete       (number *a, const coeffs r);//
     
    5151void    nAEQCoeffWrite   (const coeffs r, BOOLEAN details);//
    5252
    53 BOOLEAN nAEQClearContent  (number a,const coeffs r);//
    54 BOOLEAN nAEQClearDenominators  (number a,const coeffs r);//
     53BOOLEAN nAEQClearContent  (number a, const coeffs r);//
     54BOOLEAN nAEQClearDenominators  (number a, const coeffs r);//
    5555
    5656
  • libpolys/coeffs/OPAEp.cc

    r6776cf r7b00dbc  
    2929// DEFINITION DER FUNKTIONEN
    3030
    31 number  nAEpAdd(number a, number b,const coeffs r)
     31number  nAEpAdd(number a, number b, const coeffs)
    3232{
    3333    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    3939}
    4040
    41 number  nAEpMult(number a, number b,const coeffs r)
     41number  nAEpMult(number a, number b, const coeffs)
    4242{
    4343    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    4949}
    5050
    51 number  nAEpSub(number a, number b,const coeffs r)
     51number  nAEpSub(number a, number b, const coeffs)
    5252{
    5353    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    6060
    6161
    62 number  nAEpDiv(number a, number b,const coeffs r)
     62number  nAEpDiv(number a, number b, const coeffs)
    6363{
    6464    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    7272
    7373
    74 number  nAEpIntDiv(number a, number b,const coeffs r)
     74number  nAEpIntDiv(number a, number b, const coeffs)
    7575{
    7676
     
    8383}
    8484
    85 number  nAEpIntMod(number a, number b,const coeffs r)
     85number  nAEpIntMod(number a, number, const coeffs)
    8686{
    8787    return a;
    8888}
    8989
    90 number  nAEpExactDiv(number a, number b,const coeffs r)
     90number  nAEpExactDiv(number a, number b, const coeffs)
    9191{
    9292    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    101101
    102102
    103 number nAEpInit(long i, const coeffs r)
     103number nAEpInit(long i, const coeffs)
    104104{
    105105    int j=7;
    106106    mpz_t m;
    107     mpz_init_set_ui(m,i);
     107    mpz_init_set_ui(m, i);
    108108    p_poly* res=new p_poly;
    109     res->p_poly_set(m,j);
     109    res->p_poly_set(m, j);
    110110    number res1=reinterpret_cast<number>(res);
    111111    return  res1;
    112112}
    113113
    114 number nAEpInitMPZ(mpz_t m, const coeffs r)
     114number nAEpInitMPZ(mpz_t m, const coeffs)
    115115{
    116116    int j=7;
    117117    p_poly* res=new p_poly;
    118     res->p_poly_set(m,j);
     118    res->p_poly_set(m, j);
    119119    number res1=reinterpret_cast<number>(res);
    120120    return  res1;
     
    122122}
    123123
    124 int nAEpSize (number a,const coeffs r)
     124int nAEpSize (number a, const coeffs)
    125125{
    126126    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    128128}
    129129
    130 int nAEpInt(number &a,const coeffs r)
     130int nAEpInt(number &, const coeffs)
    131131{
    132132    return 1;
     
    134134
    135135
    136 number nAEpMPZ(number a,const coeffs r)
     136number nAEpMPZ(number a, const coeffs)
    137137{
    138138    return a;
     
    140140
    141141
    142 number nAEpNeg(number c, const coeffs r)
     142number nAEpNeg(number c, const coeffs)
    143143{
    144144    p_poly* f=reinterpret_cast<p_poly*> (c);
     
    149149}
    150150
    151 number nAEpCopy(number c, const coeffs r)
     151number nAEpCopy(number c, const coeffs)
    152152{
    153153    return c;
    154154}
    155155
    156 number nAEpRePart(number c, const coeffs r)
     156number nAEpRePart(number c, const coeffs)
    157157{
    158158    return c;
    159159}
    160160
    161 number nAEpImPart(number c, const coeffs r)
     161number nAEpImPart(number c, const coeffs)
    162162{
    163163    return  c;
    164164}
    165165
    166 void    nAEpWriteLong   (number &a, const coeffs r)
     166void    nAEpWriteLong   (number &a, const coeffs)
    167167{
    168168    p_poly* f=reinterpret_cast <p_poly*>(a);
     
    172172}
    173173
    174 void    nAEpWriteShort  (number &a, const coeffs r)
     174void    nAEpWriteShort  (number &a, const coeffs)
    175175{
    176176    p_poly* f=reinterpret_cast <p_poly*>(a);
     
    180180
    181181
    182 const char *  nAEpRead  (const char *s, number *a,const coeffs r)
     182const char *  nAEpRead  (const char *, number *a, const coeffs)
    183183{
    184184    p_poly& f=reinterpret_cast <p_poly&>(a);
     
    191191}
    192192
    193 number nAEpNormalize    (number a,number b,const coeffs r) // ?
     193number nAEpNormalize    (number a, number, const coeffs) // ?
    194194{
    195195    return a;
    196196}
    197197
    198 BOOLEAN nAEpGreater     (number a, number b,const coeffs r)
     198BOOLEAN nAEpGreater     (number a, number b, const coeffs)
    199199{
    200200    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    204204}
    205205
    206 BOOLEAN nAEpEqual     (number a, number b,const coeffs r)
     206BOOLEAN nAEpEqual     (number a, number b, const coeffs)
    207207{
    208208    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    212212}
    213213
    214 BOOLEAN nAEpIsZero      (number a,const coeffs r)
     214BOOLEAN nAEpIsZero      (number a, const coeffs)
    215215{
    216216    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    219219}
    220220
    221 BOOLEAN nAEpIsOne      (number a,const coeffs r)
     221BOOLEAN nAEpIsOne      (number a, const coeffs)
    222222{
    223223    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    226226}
    227227
    228 BOOLEAN nAEpIsMOne      (number a,const coeffs r)
    229 {
    230     number b=nAEpNeg(a,r);
     228BOOLEAN nAEpIsMOne      (number a, const coeffs r)
     229{
     230    number b=nAEpNeg(a, r);
    231231    p_poly* f=reinterpret_cast<p_poly*> (b);
    232232    if (f->is_one() == 1) {return FALSE;}
     
    236236BOOLEAN nAEpGreaterZero     (number a, const coeffs r)
    237237{
    238     if (nAEpIsZero(a,r) == FALSE) { return TRUE; }
     238    if (nAEpIsZero(a, r) == FALSE) { return TRUE; }
    239239    else { return FALSE; }
    240240}
    241241
    242 void    nAEpPower       (number a, int i, number * result,const coeffs r)
     242void    nAEpPower       (number, int, number *, const coeffs)
    243243{
    244244    return;
    245245}
    246246
    247 number nAEpGetDenom      (number &a, const coeffs r)
     247number nAEpGetDenom      (number &, const coeffs)
    248248{
    249249    return (number) 1;
    250250}
    251251
    252 number nAEpGetNumerator      (number &a, const coeffs r)
     252number nAEpGetNumerator      (number &a, const coeffs)
    253253{
    254254    return a;
    255255}
    256256
    257 number nAEpGcd           (number a,number b,const coeffs r)
     257number nAEpGcd           (number a, number b, const coeffs)
    258258{
    259259    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    264264}
    265265
    266 number nAEpLcm          (number a,number b,const coeffs r)
     266number nAEpLcm          (number a, number b, const coeffs)
    267267{
    268268    p_poly* f=reinterpret_cast<p_poly*> (a);
     
    277277}
    278278
    279 void    nAEpDelete       (number *a, const coeffs r)
     279void    nAEpDelete       (number *, const coeffs)
    280280{
    281281    return;
     
    283283
    284284/*
    285 number    nAEpSetMap        (number a, const coeffs r)
     285number    nAEpSetMap        (number a, const coeffs)
    286286{
    287287        return a;
    288288}
    289289*/
    290 char*    nAEpName       (number a, const coeffs r)
     290char*    nAEpName       (number, const coeffs)
    291291{
    292292    char* c=new char;
    293293    *c='c';
    294294
    295     return c;;
    296 }
    297 
    298 void    nAEpInpMult       (number &a, number b,const coeffs r)
    299 {
    300     p_poly* f=reinterpret_cast<p_poly*> (a);
    301     p_poly* g=reinterpret_cast<p_poly*> (g);
     295    return c;
     296}
     297
     298void    nAEpInpMult       (number &a, number b, const coeffs)
     299{
     300    p_poly* f=reinterpret_cast<p_poly*> (a);
     301    p_poly* g=reinterpret_cast<p_poly*> (b);
    302302    f->p_poly_mult_n_to(*g);
    303303    a=(number) f;
     
    305305}
    306306
    307 void    nAEpCoeffWrite   (const coeffs r, BOOLEAN details)
     307void    nAEpCoeffWrite   (const coeffs, BOOLEAN)
    308308{
    309309    return;
    310310}
    311311
    312 BOOLEAN nAEpClearContent  (number a,const coeffs r)
     312BOOLEAN nAEpClearContent  (number, const coeffs)
    313313{
    314314    return FALSE;
    315315}
    316316
    317 BOOLEAN nAEpClearDenominators  (number a,const coeffs r)
     317BOOLEAN nAEpClearDenominators  (number, const coeffs)
    318318{
    319319    return FALSE;
     
    325325
    326326
    327 BOOLEAN n_pAEInitChar(coeffs r,void *p) // vlt noch void* p hin
     327BOOLEAN n_pAEInitChar(coeffs r, void *p)
    328328{
    329329    //Charakteristik abgreifen!
  • libpolys/coeffs/OPAEp.h

    r6776cf r7b00dbc  
    99
    1010BOOLEAN n_pAEInitChar(coeffs , void *);
    11 BOOLEAN nAEpCoeffIsEqual     (number a, number b,const coeffs r);
     11BOOLEAN nAEpCoeffIsEqual     (number a, number b, const coeffs r);
    1212number  nAEpMult        (number a, number b, const coeffs r);
    13 number  nAEpSub         (number a, number b,const coeffs r);
    14 number  nAEpAdd         (number a, number b,const coeffs r);
    15 number  nAEpDiv         (number a, number b,const coeffs r);
     13number  nAEpSub         (number a, number b, const coeffs r);
     14number  nAEpAdd         (number a, number b, const coeffs r);
     15number  nAEpDiv         (number a, number b, const coeffs r);
    1616number  nAEpIntDiv      (number a, number b, const coeffs r); //Hir wollte wir was gucken
    1717number  nAEpIntMod      (number a, number b, const coeffs r);// Hir wollte wir was gucken
    18 number  nAEpExactDiv    (number a, number b,const coeffs r);
     18number  nAEpExactDiv    (number a, number b, const coeffs r);
    1919number  nAEpInit        (long i, const coeffs r);
    2020number  nAEpInitMPZ     (mpz_t m, const coeffs r); //nachgucken/fragen
    2121int     nAEpSize        (number a, const coeffs r);///
    22 int     nAEpInt         (number &a,const coeffs r);
    23 number  nAEpMPZ         (number a,const coeffs r); //nachgucken/fragen
    24 number  nAEpNeg         (number c,const coeffs r);
    25 number  nAEpCopy        (number a, number b,const coeffs r); // nachgicken
    26 number  nAEpRePart      (number a, number b,const coeffs r); // nachgicken
    27 number  nAEpImPart      (number a, number b,const coeffs r); // nachgicken
     22int     nAEpInt         (number &a, const coeffs r);
     23number  nAEpMPZ         (number a, const coeffs r); //nachgucken/fragen
     24number  nAEpNeg         (number c, const coeffs r);
     25number  nAEpCopy        (number a, number b, const coeffs r); // nachgicken
     26number  nAEpRePart      (number a, number b, const coeffs r); // nachgicken
     27number  nAEpImPart      (number a, number b, const coeffs r); // nachgicken
    2828
    2929void    nAEpWriteLong   (number &a, const coeffs r);//
     
    3131
    3232
    33 const char *  nAEpRead  (const char *s, number *a,const coeffs r);
    34 number nAEpNormalize    (number a,number b,const coeffs r);//
    35 BOOLEAN nAEpGreater     (number a, number b,const coeffs r);//
    36 BOOLEAN nAEpEqual       (number a, number b,const coeffs r);
    37 BOOLEAN nAEpIsZero      (number a,const coeffs r);
    38 BOOLEAN nAEpIsOne       (number a,const coeffs r);
    39 BOOLEAN nAEpIsMOne      (number a,const coeffs r);
    40 BOOLEAN nAEpGreaterZero (number a, number b,const coeffs r);
    41 void    nAEpPower       (number a, int i, number * result,const coeffs r);
     33const char *  nAEpRead  (const char *s, number *a, const coeffs r);
     34number nAEpNormalize    (number a, number b, const coeffs r);//
     35BOOLEAN nAEpGreater     (number a, number b, const coeffs r);//
     36BOOLEAN nAEpEqual       (number a, number b, const coeffs r);
     37BOOLEAN nAEpIsZero      (number a, const coeffs r);
     38BOOLEAN nAEpIsOne       (number a, const coeffs r);
     39BOOLEAN nAEpIsMOne      (number a, const coeffs r);
     40BOOLEAN nAEpGreaterZero (number a, number b, const coeffs r);
     41void    nAEpPower       (number a, int i, number * result, const coeffs r);
    4242number nAEpGetDenom     (number &a, const coeffs r);//
    4343number nAEpGetNumerator (number &a, const coeffs r);//
    44 number nAEpGcd          (number a,number b,const coeffs r);
    45 number nAEpLcm          (number a,number b,const coeffs r);
     44number nAEpGcd          (number a, number b, const coeffs r);
     45number nAEpLcm          (number a, number b, const coeffs r);
    4646
    4747void    nAEpDelete       (number *a, const coeffs r);//
     
    5151void    nAEpCoeffWrite   (const coeffs r, BOOLEAN details);//
    5252
    53 BOOLEAN nAEpClearContent  (number a,const coeffs r);//
    54 BOOLEAN nAEpClearDenominators  (number a,const coeffs r);//
     53BOOLEAN nAEpClearContent  (number a, const coeffs r);//
     54BOOLEAN nAEpClearDenominators  (number a, const coeffs r);//
    5555
    5656
  • libpolys/coeffs/bigintmat.cc

    r6776cf r7b00dbc  
    2020#include <string.h>
    2121
     22#if 0
    2223// Ungetestet
    2324static void bimRowContent(bigintmat *bimat, int rowpos, int colpos);
    2425static void bimReduce(bigintmat *bimat, int rpiv, int colpos,
    2526                      int ready, int all);
    26 
     27#endif
    2728
    2829
     
    688689}
    689690
     691#if 0
    690692// Ungetestet
    691693// (According to C. Fieker) Seems to have a lot of memory leaks (pure adaptation of the
     
    772774  }
    773775}
     776#endif
    774777
    775778// columnwise concatination of two bigintmats
  • libpolys/coeffs/longrat.cc

    r6776cf r7b00dbc  
    28272827}
    28282828
    2829 static char* nlCoeffString(const coeffs r)
     2829static char* nlCoeffString(const coeffs)
    28302830{
    28312831  return omStrDup("0");
  • libpolys/coeffs/modulop.cc

    r6776cf r7b00dbc  
    343343    }
    344344    while (((*s) >= '0') && ((*s) <= '9'));
    345     if (ii >= r->ch) ii = ii % r->ch;
     345    if (ii >= (unsigned long)r->ch) ii = ii % r->ch;
    346346    *i=(int)ii;
    347347  }
  • libpolys/coeffs/rintegers.cc

    r6776cf r7b00dbc  
    383383}
    384384
    385 static char* nrzCoeffString(const coeffs r)
     385static char* nrzCoeffString(const coeffs)
    386386{
    387387  return omStrDup("integer");
  • libpolys/coeffs/test.cc

    r6776cf r7b00dbc  
    2424#include <coeffs/rintegers.h>
    2525
    26 
    27 // int initializeGMP(void){ return 1; }
    28 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???
    2926
    3027#include <iostream>
  • libpolys/polys/clapconv.cc

    r6776cf r7b00dbc  
    1313#include <misc/auxiliary.h>
    1414
    15 #define SI_DONT_HAVE_GLOBAL_VARS
    1615#include <factory/factory.h>
    1716
     
    3534static void convRecTrP ( const CanonicalForm & f, int * exp, poly & result, int offs, const ring r );
    3635
    37 static void convRecGFGF ( const CanonicalForm & f, int * exp, poly & result );
     36//static void convRecGFGF ( const CanonicalForm & f, int * exp, poly & result );
    3837
    3938static number convFactoryNSingAN( const CanonicalForm &f, const ring r);
  • libpolys/polys/clapsing.cc

    r6776cf r7b00dbc  
    1414
    1515#include <misc/auxiliary.h>
    16 
    17 #define SI_DONT_HAVE_GLOBAL_VARS
    1816
    1917#include <misc/auxiliary.h>
     
    14661464  On(SW_SYMMETRIC_FF);
    14671465  CFList L;
    1468   poly p;
    14691466  if (rField_is_Q(r) || rField_is_Zp(r))
    14701467  {
  • libpolys/polys/ext_fields/algext.cc

    r6776cf r7b00dbc  
    653653  poly aAsPoly;
    654654  const char * result = p_Read(s, aAsPoly, naRing);
    655   definiteReduce(aAsPoly, naMinpoly, cf);
     655  if (aAsPoly!=NULL) definiteReduce(aAsPoly, naMinpoly, cf);
    656656  *a = (number)aAsPoly;
    657657  return result;
  • libpolys/polys/kbuckets.cc

    r6776cf r7b00dbc  
    11621162  return rn;
    11631163}
    1164 static BOOLEAN nIsPseudoUnit(number n, ring r)
    1165 {
    1166   if (rField_is_Zp(r))
    1167     return TRUE;
    1168 
    1169   if (rParameter(r)==NULL)
    1170   {
    1171     return (n_Size(n,r->cf)==1);
    1172   }
    1173   //if (r->parameter!=NULL)
    1174   return (n_IsOne(n,r->cf) || n_IsMOne(n,r->cf));
    1175 }
    11761164
    11771165#ifndef USE_COEF_BUCKETS
    11781166void kBucketSimpleContent(kBucket_pt) {}
    11791167#else
     1168static BOOLEAN nIsPseudoUnit(number n, ring r)
     1169{
     1170  if (rField_is_Zp(r))
     1171    return TRUE;
     1172
     1173  if (rParameter(r)==NULL)
     1174  {
     1175    return (n_Size(n,r->cf)==1);
     1176  }
     1177  //if (r->parameter!=NULL)
     1178  return (n_IsOne(n,r->cf) || n_IsMOne(n,r->cf));
     1179}
     1180
    11801181void kBucketSimpleContent(kBucket_pt bucket)
    11811182{
  • libpolys/polys/linalg_from_matpol.cc

    r6776cf r7b00dbc  
    77
    88static void mp_PartClean(matrix, int, int, const ring);
    9 static void mp_FinalClean(matrix, const ring);
    109static int mp_PrepareRow (matrix, int, int, const ring);
    1110static int mp_PreparePiv (matrix, int, int, const ring);
     
    231230
    232231
     232static poly minuscopy (poly p, const ring R)
     233{
     234  poly w;
     235  number  e;
     236  e = n_Init(-1, R);
     237  w = p_Copy(p, R);
     238  p_Mult_nn(w, e, R);
     239  n_Delete(&e, R);
     240  return w;
     241}
     242
    233243
    234244/*2
  • libpolys/polys/matpol.cc

    r6776cf r7b00dbc  
    610610}
    611611
    612 static poly minuscopy (poly p, const ring R)
    613 {
    614   poly w;
    615   number  e;
    616   e = n_Init(-1, R);
    617   w = p_Copy(p, R);
    618   p_Mult_nn(w, e, R);
    619   n_Delete(&e, R);
    620   return w;
    621 }
    622 
    623612/*2
    624613* insert a monomial into a list, avoid duplicates
     
    727716    for (j=lc-1;j>=0;j--) if(q1[j]) p_Delete(&q1[j], R);
    728717  }
    729 }
    730 
    731 static void mp_FinalClean(matrix a, const ring)
    732 {
    733   omFreeSize((ADDRESS)a->m,a->nrows*a->ncols*sizeof(poly));
    734   omFreeBin((ADDRESS)a, sip_sideal_bin);
    735718}
    736719
     
    13681351}
    13691352
    1370 static inline BOOLEAN smSmaller(poly a, poly b)
    1371 {
    1372   loop
    1373   {
    1374     pIter(b);
    1375     if (b == NULL) return TRUE;
    1376     pIter(a);
    1377     if (a == NULL) return FALSE;
    1378   }
    1379 }
    1380 
    1381 static BOOLEAN sm_IsNegQuot(poly a, const poly b, const poly c, const ring R)
    1382 {
    1383   if (p_LmDivisibleByNoComp(c, b, R))
    1384   {
    1385     p_ExpVectorDiff(a, b, c, R);
    1386     // Hmm: here used to be a pSetm(a): but it is unnecessary,
    1387     // if b and c are correct
    1388     return FALSE;
    1389   }
    1390   else
    1391   {
    1392     int i;
    1393     for (i=rVar(R); i>0; i--)
    1394     {
    1395       if(p_GetExp(c,i,R) > p_GetExp(b,i,R))
    1396         p_SetExp(a,i,p_GetExp(c,i,R)-p_GetExp(b,i,R),R);
    1397       else
    1398         p_SetExp(a,i,0,R);
    1399     }
    1400     // here we actually might need a pSetm, if a is to be used in
    1401     // comparisons
    1402     return TRUE;
    1403   }
    1404 }
    1405 
    14061353static void mp_ElimBar(matrix a0, matrix re, poly div, int lr, int lc, const ring R)
    14071354{
  • libpolys/polys/monomials/p_polys.cc

    r6776cf r7b00dbc  
    28142814  assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf;
    28152815
    2816   poly start=ph;
    2817 
    2818   number d, h;
     2816  number h;
    28192817  poly p;
    28202818
  • libpolys/polys/simpleideals.cc

    r6776cf r7b00dbc  
    3434static int idpowerpoint;
    3535/*index of the actual monomial in idpower*/
    36 static poly * givenideal;
    37 /*the ideal from which a power is computed*/
    3836
    3937/*2
     
    997995}
    998996
    999 /*2
    1000 *computes recursively all generators of a certain degree
    1001 *of the ideal "givenideal"
    1002 *elms is the number elements in the given ideal
    1003 *actelm is the actual element to handle
    1004 *deg is the degree of the power to compute
    1005 *gendeg is the actual degree of the generator in consideration
    1006 */
    1007 static void makepotence(int elms,int actelm,int deg,int gendeg, const ring r)
    1008 {
    1009   poly p;
    1010   int i=0;
    1011 
    1012   if ((idpowerpoint == 0) && (actelm ==1))
    1013   {
    1014     idpower[idpowerpoint] = p_One(r);
    1015     gendeg = 0;
    1016   }
    1017   while (i<=deg)
    1018   {
    1019     if (deg == gendeg)
    1020     {
    1021       idpowerpoint++;
    1022       return;
    1023     }
    1024     if (actelm == elms)
    1025     {
    1026       p=p_Power(p_Copy(givenideal[actelm-1],r),deg-gendeg,r);
    1027       idpower[idpowerpoint]=p_Mult_q(idpower[idpowerpoint],p,r);
    1028       idpowerpoint++;
    1029       return;
    1030     }
    1031     else
    1032     {
    1033       p = p_Copy(idpower[idpowerpoint],r);
    1034       makepotence(elms,actelm+1,deg,gendeg,r);
    1035       idpower[idpowerpoint] = p;
    1036     }
    1037     gendeg++;
    1038     idpower[idpowerpoint]=p_Mult_q(idpower[idpowerpoint],p_Copy(givenideal[actelm-1],r),r);
    1039     i++;
    1040   }
    1041 }
    1042 
    1043 /*2
    1044 *returns the deg-th power of the ideal gid
    1045 */
    1046 //ideal idPower(ideal gid,int deg)
    1047 //{
    1048 //  int i;
    1049 //  ideal id;
    1050 //
    1051 //  if (deg < 1) deg = 1;
    1052 //  i = binom(IDELEMS(gid)+deg-1,deg);
    1053 //  id=idInit(i,1);
    1054 //  idpower = id->m;
    1055 //  givenideal = gid->m;
    1056 //  idpowerpoint = 0;
    1057 //  makepotence(IDELEMS(gid),1,deg,0);
    1058 //  idpower = NULL;
    1059 //  givenideal = NULL;
    1060 //  idpowerpoint = 0;
    1061 //  return id;
    1062 //}
    1063997static void id_NextPotence(ideal given, ideal result,
    1064998  int begin, int end, int deg, int restdeg, poly ap, const ring r)
  • libpolys/reporter/dError.cc

    r6776cf r7b00dbc  
    5050int dReportError(const char* fmt, ...)
    5151{
     52#if 0
    5253#ifdef HAVE_EXECINFO_H
    5354#define SIZE 50
    5455  void *buffer[SIZE+1]; int ret;
     56#endif
    5557#endif
    5658
  • libpolys/reporter/reporter.cc

    r6776cf r7b00dbc  
    354354#ifdef HAVE_VSNPRINTF
    355355    l = vsnprintf(s, ls+511, fmt, ap);
    356     if ((l==-1)||(s[l]!='\0')||(l!=strlen(s)))
     356    if ((l==-1)||(s[l]!='\0')||(l!=(int)strlen(s)))
    357357    {
    358358      printf("Print problem: l=%d, fmt=>>%s<<\n",l,fmt);
  • libpolys/tests/common.h

    r6776cf r7b00dbc  
    3131
    3232#include <polys/nc/gb_hack.h>
    33 
    34 // int initializeGMP(){ return 1; } // due to Factory...
    35 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???
    3633
    3734// #pragma GCC diagnostic ignored "-Wwrite-strings"
  • standalone.test/test.cc

    r6776cf r7b00dbc  
    77#include <reporter/reporter.h>
    88#include <resources/feResource.h>
    9 
    10 // int initializeGMP(){ return 1; }
    11 int mmInit(void) {return 1; }
    129
    1310#include <polys/monomials/ring.h>
  • standalone.test/tt.cc

    r6776cf r7b00dbc  
    33#include <Singular/libsingular.h>
    44#include <unistd.h>
    5 
    6 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???
    75
    86
Note: See TracChangeset for help on using the changeset viewer.