Changeset ec2602 in git


Ignore:
Timestamp:
Nov 24, 2011, 5:20:29 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f831299ca8780b0484e5c97ab9ebc7b3a4b85e0a
Parents:
d3bf01540e1d6181e4e04912c9334dac07c29b47a43cca5ec664cb599240d68933581729ed0c9d9a
Message:
Merge pull request #20 from mmklee/factory_without_ntl

error messages for factorization without NTL
NOTE: factoryError = WerrorS (set via Singular main) and thus error messages are printed with "WerrorS", which also _supposed_ to set an error status in the Interpreter... which does NOT seem to happen!
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    ra43cca rec2602  
    1111doc/
    1212MOD
     13libsingular-config
    1314factory/readcf.cc
    1415factory/ylwrap
     
    8788omalloc/omExternalConfig.h
    8889omalloc/omlimits.h
     90omalloc/omConfig.h.in
    8991doc/NTL
    9092factory/factory.h
  • Singular/extra.cc

    ra43cca rec2602  
    984984  Werror("Sorry: not yet re-factored: see libpolys/polys/clapsing.cc");
    985985  return FALSE;
    986 #else   
    987         if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
     986#else
     987        if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
    988988        {
    989989          res->rtyp=STRING_CMD;
     
    993993        else
    994994          WerrorS("ideal expected");
    995 #endif 
     995#endif
    996996      }
    997997      else
     
    24092409          p_DebugPrint((poly)h->Data(), currRing);
    24102410#  else
    2411           Warn("Sorry: not available for release build!");
     2411          Warn("Sorry: not available for release build!");
    24122412#  endif
    24132413          return FALSE;
     
    24202420          rDebugPrint((ring)h->Data());
    24212421#  else
    2422           Warn("Sorry: not available for release build!");
     2422          Warn("Sorry: not available for release build!");
    24232423#  endif
    24242424          return FALSE;
     
    37663766        extern int fanID;
    37673767        res->rtyp=fanID;
    3768         res->data=(void*)(grfan(I,heuristic,FALSE));
     3768        res->data=(void*)(grfan(I,heuristic,FALSE));
    37693769      #endif
    37703770      return FALSE;
     
    37893789  else
    37903790#endif
    3791     if (strcmp(sys_cmd,"denom_list")==0)
    3792       {
    3793         res->rtyp=LIST_CMD;
    3794         extern lists get_denom_list();
    3795         res->data=(lists)get_denom_list();
    3796         return FALSE;
    3797       }
     3791  if (strcmp(sys_cmd,"denom_list")==0)
     3792  {
     3793    res->rtyp=LIST_CMD;
     3794    extern lists get_denom_list();
     3795    res->data=(lists)get_denom_list();
     3796    return FALSE;
     3797  }
     3798  else
    37983799/*==================== Error =================*/
    37993800      Werror( "(extended) system(\"%s\",...) %s", sys_cmd, feNotImplemented );
  • Singular/walk.cc

    ra43cca rec2602  
    3131
    3232//#define TIME_TEST // print the used time of each subroutine
    33 //#define ENDWALKS //print the size of the last omega-homogenoues Gröbner basis
     33//#define ENDWALKS //print the size of the last omega-homogenoues Grï¿œbner basis
    3434
    3535/* includes */
     
    18151815  int i, nv = currRing->N;
    18161816
    1817   r->cf->ch  = rChar (currRing);
     1817  r->cf  = currRing->cf;
    18181818  r->N   = currRing->N;
    18191819  int nb = rBlocks(currRing) + 1;//31.10.01 (+1)
     
    18861886  int i, nv = currRing->N;
    18871887
    1888   r->cf->ch  = rChar (currRing);
     1888  r->cf  = currRing->cf;
    18891889  r->N   = currRing->N;
    18901890  int nb = rBlocks(currRing) + 1;//31.10.01 (+1)
     
    20352035
    20362036
    2037   r->cf->ch  = rChar (currRing);
     2037  r->cf  = currRing->cf;
    20382038  r->N   = currRing->N;
    20392039  int nb = rBlocks(currRing) + 1;//31.10.01 (+1)
     
    32723272
    32733273/* The main procedur Mfwalk calls the recursive Subroutine
    3274    rec_fractal_call to compute the wanted Gröbner basis.
    3275    At the main procedur we compute the reduced Gröbner basis w.r.t. a "fast"
     3274   rec_fractal_call to compute the wanted Grï¿œbner basis.
     3275   At the main procedur we compute the reduced Grï¿œbner basis w.r.t. a "fast"
    32763276   order, e.g. "dp" and a sequence of weight vectors which are row vectors
    32773277   of a matrix. This matrix defines the given monomial order, e.g. "lp"
     
    35613561
    35623562/* 08.09.02 */
    3563 /******** THE NEW GRÖBNER WALK ALGORITHM **********/
    3564 /* Gröbnerwalk with a recursive "second" alternative GW, REC_GB_Mwalk
     3563/******** THE NEW GRï¿œBNER WALK ALGORITHM **********/
     3564/* Grï¿œbnerwalk with a recursive "second" alternative GW, REC_GB_Mwalk
    35653565   that only computes the last reduced GB */
    35663566ideal Mwalk(ideal Go, intvec* curr_weight, intvec* target_weight)
     
    36203620      tim = clock();
    36213621      /*
    3622         Print("\n// **** Gröbnerwalk took %d steps and ", nwalk);
     3622        Print("\n// **** Grï¿œbnerwalk took %d steps and ", nwalk);
    36233623        PrintS("\n// **** call the rec. Pert. Walk to compute a red GB of:");
    36243624        idElements(Gomega, "G_omega");
     
    51305130
    51315131
    5132 /* compute the reduced Gröbner basis of an ideal <Go> w.r.t. lp */
     5132/* compute the reduced Grï¿œbner basis of an ideal <Go> w.r.t. lp */
    51335133static ideal Mpwalk_MAltwalk1(ideal Go, intvec* curr_weight, int tp_deg)
    51345134{
  • factory/cf_factor.cc

    rd3bf015 rec2602  
    3131#include "facFactorize.h"
    3232#include "singext.h"
     33#include "cf_util.h"
    3334
    3435#include "int_int.h"
     
    563564      #else
    564565      ASSERT( f.isUnivariate(), "multivariate factorization not implemented" );
     566      factoryError ("multivariate factorization not implemented");
     567      return CFFList (CFFactor (f, 1));
    565568      #endif
    566569    }
     
    615618        //printf("fac.:\n");out_cff(F);
    616619      }
    617       else
     620      #else
     621      {
     622        //Use Factory without NTL
     623        //F = ZFactorizeUnivariate( fz, issqrfree );
     624        factoryError ("univariate factorization over Z not implemented");
     625        return CFFList (CFFactor (f, 1));
     626      }
    618627      #endif
    619       {
    620         //Use Factory without NTL
    621         F = ZFactorizeUnivariate( fz, issqrfree );
    622       }
    623     }
    624     else
    625     {
     628    }
     629    else
     630    {
     631      #ifdef HAVE_NTL
    626632      F = ZFactorizeMultivariate( fz, issqrfree );
     633      #else
     634      factoryError ("multivariate factorization not implemented");
     635      return CFFList (CFFactor (f, 1));
     636      #endif
    627637    }
    628638
     
    796806    #else
    797807    ASSERT( f.isUnivariate(), "multivariate factorization not implemented" );
     808    factoryError ("multivariate factorization not implemented");
     809    return CFFList (CFFactor (f, 1));
    798810    #endif
    799811
     
    809821#else
    810822    ASSERT( f.isUnivariate(), "multivariate factorization not implemented" );
     823    factoryError ("multivariate factorization not implemented");
     824    return CFFList (CFFactor (f, 1));
    811825#endif
    812826  }
  • kernel/fegetopt.h

    ra43cca rec2602  
    8888  int val;
    8989  /* Stuff added for Singular  */
    90   const char*   arg_name;// name of argument, for display in help
    91   const char*   help;    // (short) help string
    92   feOptType     type;    // type of argument, if has_arg > 0
    93   void*         value;   // (default) value of option
    94   int           set;     // only relevant for strings: 0 if not set, 1 if set
     90  const char*   arg_name;/* name of argument, for display in help */
     91  const char*   help;    /* (short) help string */
     92  feOptType     type;    /* type of argument, if has_arg > 0 */
     93  void*         value;   /* (default) value of option */
     94  int           set;     /* only relevant for strings: 0 if not set, 1 if set */
    9595};
    9696
  • libpolys/polys/ext_fields/algext.cc

    ra43cca rec2602  
    113113  if (a == NULL) return TRUE;
    114114  p_Test((poly)a, naRing);
    115   assume(p_Totaldegree((poly)a, naRing) <= p_Totaldegree(naMinpoly, naRing));
     115  if(p_Totaldegree((poly)a, naRing) >= p_Totaldegree(naMinpoly, naRing))
     116  {
     117    Print("deg >= deg(minpoly) in %s:%d\n",f,l);
     118    return FALSE;
     119  }
    116120  return TRUE;
    117121}
     
    486490  poly aAsPoly;
    487491  const char * result = p_Read(s, aAsPoly, naRing);
     492  definiteReduce(aAsPoly, naMinpoly, cf);
    488493  *a = (number)aAsPoly;
    489494  return result;
  • libpolys/polys/ext_fields/transext.cc

    ra43cca rec2602  
    138138  assume(NUM(t) != NULL);   /**< t != 0 ==> numerator(t) != 0 */
    139139  p_Test(NUM(t), ntRing);
    140   if (!DENIS1(t)) p_Test(DEN(t), ntRing);
     140  if (!DENIS1(t))
     141  {
     142    p_Test(DEN(t), ntRing);
     143    if(p_IsConstant(DEN(t),ntRing) && (n_IsOne(pGetCoeff(DEN(t)),ntRing->cf)))
     144    {
     145      Print("?/1 in %s:%d\n",f,l);
     146       return FALSE;
     147    }
     148  }
    141149  return TRUE;
    142150}
     
    561569  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
    562570  NUM(result) = g;
    563   DEN(result) = f;
     571  if (!p_IsConstant(f,ntRing) || !n_IsOne(pGetCoeff(f),ntRing->cf))
     572    DEN(result) = f;
    564573  COM(result) = COM(fa) + COM(fb) + MULT_COMPLEXITY;
    565574  heuristicGcdCancellation((number)result, cf);
Note: See TracChangeset for help on using the changeset viewer.