Changeset db20ef in git


Ignore:
Timestamp:
Feb 11, 2019, 7:15:29 PM (5 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c7fb9ff6da4316321f6a0c0453fa9136c1a675a9
Parents:
b4bd838b3690c680bc49a7beaa4e08a024be4f7377624bdb8f875aa938e9fda67d8720405651c08d
Message:
Merge branch 'spielwiese' of github.com:levandov/Sources into spielwiese
Files:
26 edited
2 moved

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpadim.lib

    rb4bd83 rdb20ef  
    1515
    1616KEYWORDS: finitely presented algebra; Letterplace Groebner basis; K-basis; K-dimension; Hilbert series
    17 
    18 PROCEDURES:
    19 lpKDimCheck(G);            checks whether the K-dimension of A/<G> is finite
    20 lpKDim(G[,d,n]);           computes the K-dimension of A/<G>
    21 lpMonomialBasis(d, donly, J); computes a list of monomials not contained in J
    22 lpHilbert(G[,d,n]);        computes the truncated Hilbert series of A/<G>
    23 lpSickleDim(G[,d,n]);      computes the mistletoes and the K-dimension of A/<G>
    2417
    2518NOTE:
     
    7366[Stu] G. Studzinski: Dimension computations in non-commutative,
    7467associative algebras, Diploma thesis, RWTH Aachen, 2010.
     68
     69PROCEDURES:
     70lpKDimCheck(G);            checks whether the K-dimension of A/<G> is finite
     71lpKDim(G[,d,n]);           computes the K-dimension of A/<G>
     72lpMonomialBasis(d, donly, J); computes a list of monomials not contained in J
     73lpHilbert(G[,d,n]);        computes the truncated Hilbert series of A/<G>
     74lpSickleDim(G[,d,n]);      computes the mistletoes and the K-dimension of A/<G>
    7575
    7676SEE ALSO: freegb_lib, fpaprops_lib, ncHilb_lib
  • Singular/LIB/fpalgebras.lib

    rb4bd83 rdb20ef  
    7878RETURN:  ideal
    7979ASSUME: basering has a letterplace ring structure and
    80 @*          A is a generalized Cartan matrix with integer entries
     80        A is a generalized Cartan matrix with integer entries
    8181PURPOSE: compute the ideal of Serre's relations associated to A
    8282EXAMPLE: example serreRelations; shows examples
     
    145145RETURN:  ring (and ideal)
    146146PURPOSE: compute the inhomogeneous Serre's relations associated to A in given
    147 @*       variable names
     147         variable names
    148148ASSUME: three ideals in the input are of the same sizes and contain merely
    149 @* variables which are interpreted as follows: N resp. P stand for negative
    150 @* resp. positive roots, C stand for Cartan elements. d is the degree bound for
    151 @* letterplace ring, which will be returned.
    152 @* The matrix A is a generalized Cartan matrix with integer entries
    153 @* The result is the ideal called 'fsRel' in the returned ring.
     149  variables which are interpreted as follows: N resp. P stand for negative
     150  resp. positive roots, C stand for Cartan elements. d is the degree bound for
     151  letterplace ring, which will be returned.
     152  The matrix A is a generalized Cartan matrix with integer entries
     153  The result is the ideal called 'fsRel' in the returned ring.
    154154EXAMPLE: example fullSerreRelations; shows examples
    155155"
     
    363363RETURN:  ring (and exports ideal)
    364364PURPOSE: compute the ideal of Adem relations for i<2j in characteristic 0
    365 @*  the ideal is exported under the name AdemRel in the output ring
     365    the ideal is exported under the name AdemRel in the output ring
    366366EXAMPLE: example ademRelations; shows examples
    367367"
  • Singular/LIB/fpaprops.lib

    rb4bd83 rdb20ef  
    5555"USAGE: lpNoetherian(G); G an ideal in a Letterplace ring
    5656RETURN: int
    57 @*      0 not Noetherian
    58 @*      1 left Noetherian
    59 @*      2 right Noetherian
    60 @*      3 Noetherian
    61 @*      4 weak Noetherian
     57      0 not Noetherian
     58      1 left Noetherian
     59      2 right Noetherian
     60      3 Noetherian
     61      4 weak Noetherian
    6262PURPOSE: Check whether the monomial algebra A/<LM(G)> is (left/right) noetherian
    6363ASSUME: - basering is a Letterplace ring
    64 @*      - G is a Groebner basis
     64      - G is a Groebner basis
    6565THEORY: lpNoetherian works with the monomial algebra A/<LM(G)>.
    6666If it gives an affirmative answer for one of the properties, then it
     
    644644start. The parameter visited, cyclic and path should be 0.
    645645RETURN: int
    646 @*:     Maximal number of distinct cycles
     646     Maximal number of distinct cycles
    647647PURPOSE: Calculate the maximal number of distinct cycles in a single path starting at v
    648648ASSUME: Basering is a Letterplace ring
     
    730730proc lpUfGraph(ideal G, list #)
    731731"USAGE: lpUfGraph(G); G a set of monomials in a letterplace ring.
    732 @*      lpUfGraph(G,1); G a set of monomials in a letterplace ring.
    733732RETURN: intmat or list
    734733NOTE: lpUfGraph(G); returns intmat. lpUfGraph(G,1); returns list L with L[1] an intmat and L[2] an ideal.
     
    882881RETURN: int
    883882PURPOSE: Determines the Gelfand Kirillov dimension of A/<G>
    884 @*       -1 means positive infinite
     883       -1 means positive infinite
    885884ASSUME: - basering is a Letterplace ring
    886 @*      - G is a Groebner basis
     885      - G is a Groebner basis
    887886"
    888887{
  • Singular/LIB/freegb.lib

    rb4bd83 rdb20ef  
    2323
    2424PROCEDURES:
    25 freeAlgebra(r, d);               creates a Letterplace ring out of given data
    2625isFreeAlgebra(r);                check whether r is a letterplace ring (free algebra)
    2726lpDegBound(R);                   returns the degree bound of a letterplace ring
    2827lpVarBlockSize(R);               returns the size of the letterplace blocks
    29 
    30 letplaceGBasis(I);               (deprecated, use twostd) two-sided Groebner basis of a letterplace ideal I
    31 
     28letplaceGBasis(I);               (deprecated) two-sided Groebner basis of a letterplace ideal I
    3229lpDivision(f,I);                 two-sided division with remainder
    3330lpGBPres2Poly(L,I);              reconstructs a polynomial from the output of lpDivision
    34 
    3531lieBracket(a,b[, N]);            Lie bracket ab-ba of two letterplace polynomials
    3632isOrderingShiftInvariant(i);     tests shift-invariance of the monomial ordering
    3733isVar(p);                        check whether p is a power of a single variable
    38 
    39 lpLmDivides(ideal I, poly p);    tests whether there exists q in I, such that LM(q)|LM(p)
    40 lpVarAt(poly p, int pos);        returns the variable (as a poly) at position pos of the poly p
    41 
    42 makeLetterplaceRing(d);          (deprecated, use freeAlgebra) creates a Letterplace ring out of given data
     34makeLetterplaceRing(d);          (deprecated) creates a Letterplace ring out of given data
    4335setLetterplaceAttributes(R,d,b); (for testing purposes) supplies ring R with the letterplace structure
    4436
     
    6254
    6355LIB "qhmoduli.lib"; // for Max
    64 LIB "bfun.lib"; // for inForm
    65 LIB "fpadim.lib"; // for intvec conversion
    6656LIB "fpalgebras.lib"; // for compatibility
    6757
     
    8474  example isVar;
    8575
    86   example lpLmDivides;
    87   example lpVarAt;
    88 
    8976  example ivL2lpI;
    9077  example iv2lp;
     
    10087RETURN: ring with special attributes set
    10188PURPOSE: sets attributes for a letterplace ring:
    102 @*      'isLetterplaceRing' = true, 'uptodeg' = d, 'lV' = b, where
    103 @*      'uptodeg' stands for the degree bound,
    104 @*      'lV' for the number of variables in the block 0.
     89  'isLetterplaceRing' = true, 'uptodeg' = d, 'lV' = b, where
     90  'uptodeg' stands for the degree bound,
     91  'lV' for the number of variables in the block 0.
    10592NOTE: Activate the resulting ring by using @code{setring}
    10693"
     
    340327RETURN:  int
    341328PURPOSE: check, whether leading monomial of p is a power of a single variable
    342 @* from the basering. Returns the exponent or 0 if p is multivariate.
     329  from the basering. Returns the exponent or 0 if p is multivariate.
    343330EXAMPLE: example isVar; shows examples
    344331"
     
    380367}
    381368
    382 proc lpLmDivides(ideal I, poly p)
    383 "USAGE: lpLmDivides(I); I an ideal
    384 RETURN: boolean
    385 ASSUME: basering is a Letterplace ring
    386 PURPOSE: tests if there is a polynomial q in I with LM(q)|LM(p)
    387 EXAMPLE: example lpLmDivides; shows examples
    388 "
    389 {
    390   ERROR(" freegb.so not loaded");
    391 }
    392 example
    393 {
    394   "EXAMPLE:"; echo = 2;
    395   ring r = 0,(x,y),dp;
    396   def R = freeAlgebra(r, 5);
    397   setring R;
    398   poly p = x*y*y;
    399   lpLmDivides(y*y, p);
    400   lpLmDivides(y*x, p);
    401   lpLmDivides(ideal(y*y, y*x), p);
    402 }
    403 
    404 proc lpVarAt(poly p, int pos)
    405 "USAGE: lpVarAt(p, pos); p a poly, pos an int
    406 RETURN: poly
    407 ASSUME: basering is a Letterplace ring
    408 PURPOSE: returns the variable (as a poly) at position pos of the poly p
    409 EXAMPLE: example lpVarAt; shows examples
    410 "
    411 {
    412   ERROR(" freegb.so not loaded");
    413 }
    414 example
    415 {
    416   "EXAMPLE:"; echo = 2;
    417   ring r = 0,(x,y),dp;
    418   def R = freeAlgebra(r, 5);
    419   setring R;
    420   poly p = y*y*x;
    421   lpVarAt(p, 3);
    422 }
    423 
    424369proc letplaceGBasis(def I)
    425370"USAGE: letplaceGBasis(I);  I an ideal/module
    426371RETURN: ideal/module
    427 ASSUME: basering is a Letterplace ring, input consists of Letterplace
    428 @*      polynomials
    429 PURPOSE: compute the two-sided Groebner basis of I via Letterplace
    430 @*       algorithm (legacy routine)
     372ASSUME: basering is a Letterplace ring, input consists of Letterplace polynomials
     373PURPOSE: compute the two-sided Groebner basis of I via Letterplace algorithm (legacy routine)
    431374NOTE: the degree bound for this computation is read off the letterplace
    432 @*    structure of basering
     375      structure of basering
    433376EXAMPLE: example letplaceGBasis; shows examples
    434377"
     
    469412PURPOSE:compute the Lie bracket [a,b] = ab - ba between letterplace polynomials
    470413NOTE: if N>1 is specified, then the left normed bracket [a,[...[a,b]]]] is
    471 @*    computed.
     414computed.
    472415EXAMPLE: example lieBracket; shows examples
    473416"
     
    566509RETURN:  ring
    567510ASSUME: L has a special form. Namely, it is a list of modules, where
    568 
    569511 - each generator of every module stands for a monomial times coefficient in
    570 @* free algebra,
    571 
     512   free algebra,
    572513 - in such a vector generator, the 1st entry is a nonzero coefficient from the
    573 @* ground field
    574 
     514   ground field
    575515 - and each next entry hosts a variable from the basering.
    576516PURPOSE: compute the two-sided Groebner basis of an ideal, encoded by L
    577 @* in the free associative algebra, up to degree d
     517  in the free associative algebra, up to degree d
    578518NOTE: Apply @code{lst2str} to the output in order to obtain a better readable
    579 @*    presentation
     519   presentation
    580520EXAMPLE: example freeGBasis; shows examples
    581521"
     
    1054994  def R = freeAlgebra(r, 7);
    1055995  isFreeAlgebra(R);
    1056 }
    1057 
    1058 proc freeAlgebra(def r, int d)
    1059 "USAGE:  freeAlgebra(r, d); r a ring, d an integer
    1060 RETURN:  ring
    1061 PURPOSE: creates a letterplace ring with the ordering of r
    1062 EXAMPLE: example freeAlgebra; shows examples
    1063 "
    1064 {
    1065   ERROR(" freegb.so not loaded");
    1066 }
    1067 example
    1068 {
    1069   "EXAMPLE:"; echo = 2;
    1070   ring r = 0,(x,y,z),dp;
    1071   def R = freeAlgebra(r, 7);
    1072   R;
    1073   ring r2 = 0,(x,y,z),lp;
    1074   def R2 = freeAlgebra(r2, 7);
    1075   R2;
    1076996}
    1077997
     
    32313151RETURN: int
    32323152NOTE: Tests whether the ordering of the current ring is shift invariant, which is the case, when LM(p) > LM(p') for all p and p' where p' is p shifted by any number of places.
    3233 @*      If withHoles != 0 even Letterplace polynomials with holes (eg. x(1)*y(4)) are considered.
     3153
     3154If withHoles != 0 even Letterplace polynomials with holes (eg. x(1)*y(4)) are considered.
    32343155ASSUME: - basering is a Letterplace ring.
    32353156"
     
    38863807static proc mod_init()
    38873808{
    3888   LIB"freegb.so";
    3889 }
     3809  LIB"freealgebra.so";
     3810}
  • Singular/LIB/nctools.lib

    rb4bd83 rdb20ef  
    13961396
    13971397///////////////////////////////////////////////////////////////////////////////
    1398 proc rightStd(def I)
     1398proc rightStd(def I)// just an alias for compatibility
    13991399"USAGE:  rightStd(I); I an ideal/ module
    14001400PURPOSE: compute a right Groebner basis of I
     
    14031403"
    14041404{
    1405   def A = basering;
    1406   def Aopp = opposite(A);
    1407   setring Aopp;
    1408   def Iopp = oppose(A,I);
    1409   def Jopp = groebner(Iopp);
    1410   setring A;
    1411   def J = oppose(Aopp,Jopp);
    1412   return(J);
     1405  return(rightstd(I));
    14131406}
    14141407example
     
    17711764RETURN:  ring
    17721765PURPOSE: create a copy of a given ring equipped with the
    1773 @* elimination ordering for module components @code{(c,<)}
     1766  elimination ordering for module components @code{(c,<)}
    17741767NOTE: usually the list argument contains a ring to work with
    17751768EXAMPLE: example makeModElimRing; shows an example
  • Singular/checklibs.c

    rb4bd83 rdb20ef  
    77#define LINE_LEN 200
    88#define RECOMMENDED_LEN 100
    9 VAR FILE *f;
    10 VAR int trailing_spaces=0;
    11 VAR int tabs=0;
    12 VAR int verylong_lines=0;
    13 VAR int lines=0;
    14 VAR unsigned char buf[LINE_LEN];
    15 VAR int proc_cnt=0;
    16 VAR unsigned char *proc[NUM_PROC];
    17 VAR unsigned char have_doc[NUM_PROC];
    18 VAR unsigned char have_example[NUM_PROC];
    19 VAR unsigned char proc_found[NUM_PROC];
    20 VAR int non_ascii=0;
    21 VAR int non_ascii_line=0;
    22 VAR int star_nl=0;
    23 VAR int footer=0;
    24 VAR int header=0;
    25 VAR int crlf=0;
    26 VAR int proc_help_lines=0;
    27 VAR int proc_help_texinfo=0;
     9FILE *f;
     10int trailing_spaces=0;
     11int tabs=0;
     12int verylong_lines=0;
     13int lines=0;
     14unsigned char buf[LINE_LEN];
     15int proc_cnt=0;
     16unsigned char *proc[NUM_PROC];
     17unsigned char have_doc[NUM_PROC];
     18unsigned char have_example[NUM_PROC];
     19unsigned char proc_found[NUM_PROC];
     20int non_ascii=0;
     21int non_ascii_line=0;
     22int star_nl=0;
     23int footer=0;
     24int header=0;
     25int crlf=0;
     26int proc_help_lines=0;
     27int proc_help_texinfo=0;
    2828
    2929void get_next()
  • Singular/dyn_modules/Makefile.am

    rb4bd83 rdb20ef  
    11ACLOCAL_AMFLAGS = -I ../m4
    22
    3 SUBDIRS=staticdemo bigintm subsets syzextra pyobject customstd gfanlib python gitfan polymake singmathic Order interval cohomo freegb
     3SUBDIRS=staticdemo bigintm subsets syzextra pyobject customstd gfanlib python gitfan polymake singmathic Order interval cohomo freealgebra
  • Singular/dyn_modules/freealgebra/Makefile.am

    rb4bd83 rdb20ef  
    11ACLOCAL_AMFLAGS = -I ../../m4
    22
    3 if SI_BUILTIN_FREEGB
    4   noinst_LTLIBRARIES=freegb.la
     3if SI_BUILTIN_FREEALGEBRA
     4  noinst_LTLIBRARIES=freealgebra.la
    55  P_PROCS_MODULE_LDFLAGS = -module
    66  P_PROCS_CPPFLAGS_COMMON = -DSTATIC_VERSION
    77else
    8   module_LTLIBRARIES=freegb.la
     8  module_LTLIBRARIES=freealgebra.la
    99  moduledir = $(libexecdir)/singular/MOD
    1010  P_PROCS_CPPFLAGS_COMMON = -DDYNAMIC_VERSION
     
    1818
    1919
    20 freegb_la_CPPFLAGS  = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON}
    21 freegb_la_LDFLAGS   = ${AM_LDFLAGS} ${P_PROCS_MODULE_LDFLAGS} $(SINGULAR_LDFLAGS)
    22 SOURCES = freegb.cc
    23 freegb_la_SOURCES   = $(SOURCES)
     20freealgebra_la_CPPFLAGS  = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON}
     21freealgebra_la_LDFLAGS   = ${AM_LDFLAGS} ${P_PROCS_MODULE_LDFLAGS} $(SINGULAR_LDFLAGS)
     22SOURCES = freealgebra.cc
     23freealgebra_la_SOURCES   = $(SOURCES)
    2424
  • Singular/dyn_modules/freealgebra/freealgebra.cc

    rb4bd83 rdb20ef  
    22
    33#ifdef HAVE_SHIFTBBA
    4 static BOOLEAN freegb(leftv res, leftv args)
     4static BOOLEAN freeAlgebra(leftv res, leftv args)
    55{
    66  const short t1[]={2,RING_CMD,INT_CMD};
     
    8080}
    8181
    82 /*==================== divide-test for freeGB  =================*/
    8382static BOOLEAN lpLmDivides(leftv res, leftv h)
    8483{
     
    112111}
    113112
    114 /*==================== get var for freeGB  ====================*/
    115113static BOOLEAN lpVarAt(leftv res, leftv h)
    116114{
     
    130128//------------------------------------------------------------------------
    131129// initialisation of the module
    132 extern "C" int SI_MOD_INIT(freegb)(SModulFunctions* p)
     130extern "C" int SI_MOD_INIT(freealgebra)(SModulFunctions* p)
    133131{
    134132#ifdef HAVE_SHIFTBBA
    135   p->iiAddCproc("freegb.so","freeAlgebra",FALSE,freegb);
    136   p->iiAddCproc("freegb.so","lpLmDivides",FALSE,lpLmDivides);
    137   p->iiAddCproc("freegb.so","lpVarAt",FALSE,lpVarAt);
    138   p->iiAddCproc("freegb.so","stest",TRUE,stest);
    139   p->iiAddCproc("freegb.so","btest",TRUE,btest);
     133  p->iiAddCproc("freealgebra.so","freeAlgebra",FALSE,freeAlgebra);
     134  p->iiAddCproc("freealgebra.so","lpLmDivides",FALSE,lpLmDivides);
     135  p->iiAddCproc("freealgebra.so","lpVarAt",FALSE,lpVarAt);
     136  p->iiAddCproc("freealgebra.so","stest",TRUE,stest);
     137  p->iiAddCproc("freealgebra.so","btest",TRUE,btest);
    140138#endif
    141139  return (MAX_TOK);
  • Singular/iparith.cc

    rb4bd83 rdb20ef  
    51165116}
    51175117#endif
    5118 
     5118#ifdef HAVE_SHIFTBBA // do not place above jjSTD in this file because we need to reference it
     5119static BOOLEAN jjRIGHTSTD(leftv res, leftv v)
     5120{
     5121  if (rIsLPRing(currRing))
     5122  {
     5123    if (rField_is_numeric(currRing))
     5124      WarnS("groebner base computations with inexact coefficients can not be trusted due to rounding errors");
     5125    ideal result;
     5126    ideal v_id=(ideal)v->Data();
     5127    /* intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD); */
     5128    /* tHomog hom=testHomog; */
     5129    /* if (w!=NULL) */
     5130    /* { */
     5131    /*   if (!idTestHomModule(v_id,currRing->qideal,w)) */
     5132    /*   { */
     5133    /*     WarnS("wrong weights"); */
     5134    /*     w=NULL; */
     5135    /*   } */
     5136    /*   else */
     5137    /*   { */
     5138    /*     hom=isHomog; */
     5139    /*     w=ivCopy(w); */
     5140    /*   } */
     5141    /* } */
     5142    /* result=kStd(v_id,currRing->qideal,hom,&w); */
     5143    result = rightgb(v_id, currRing->qideal);
     5144    idSkipZeroes(result);
     5145    res->data = (char *)result;
     5146    if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
     5147    /* if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD); */
     5148    return FALSE;
     5149  }
     5150  else if (rIsPluralRing(currRing))
     5151  {
     5152    ideal I=(ideal)v->Data();
     5153
     5154    ring A = currRing;
     5155    ring Aopp = rOpposite(A);
     5156    currRing = Aopp;
     5157    ideal Iopp = idOppose(A, I, Aopp);
     5158    ideal Jopp = kStd(Iopp,currRing->qideal,testHomog,NULL);
     5159    currRing = A;
     5160    ideal J = idOppose(Aopp, Jopp, A);
     5161
     5162    id_Delete(&Iopp, Aopp);
     5163    id_Delete(&Jopp, Aopp);
     5164    rDelete(Aopp);
     5165
     5166    idSkipZeroes(J);
     5167    res->data = (char *)J;
     5168    if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
     5169    return FALSE;
     5170  }
     5171  else
     5172  {
     5173    return jjSTD(res, v);
     5174  }
     5175}
     5176#endif
    51195177static BOOLEAN jjTYPEOF(leftv res, leftv v)
    51205178{
  • Singular/table.h

    rb4bd83 rdb20ef  
    245245,{D(jjDUMMY),      RESOLUTION_CMD,  RESOLUTION_CMD, RESOLUTION_CMD, ALLOW_PLURAL |ALLOW_RING}
    246246,{D(jjRESTART),    RESTART_CMD,     NONE,           INT_CMD,        ALLOW_NC |ALLOW_RING}
     247#ifdef HAVE_SHIFTBBA
     248,{D(jjRIGHTSTD),   RIGHTSTD_CMD,    IDEAL_CMD,      IDEAL_CMD     , ALLOW_NC |NO_RING}
     249#endif
    247250,{D(jjRINGLIST),   RINGLIST_CMD,    LIST_CMD,       RING_CMD      , ALLOW_NC |ALLOW_RING}
    248251,{D(jjRINGLIST_C), RING_LIST_CMD,   LIST_CMD,       CRING_CMD     , ALLOW_NC |ALLOW_RING}
     
    11681171  { "return",      0, RETURN ,            RETURN},
    11691172  { "RETURN",      0, END_GRAMMAR ,       RETURN},
     1173#ifdef HAVE_SHIFTBBA
     1174  { "rightstd",    0, RIGHTSTD_CMD ,      CMD_1},
     1175#endif /* HAVE_PLURAL */
    11701176  { "ring",        0, RING_CMD ,          RING_CMD},
    11711177  { "ringlist",    0, RINGLIST_CMD ,      CMD_1},
  • Singular/tok.h

    rb4bd83 rdb20ef  
    169169  RESTART_CMD,
    170170  RESULTANT_CMD,
     171  RIGHTSTD_CMD,
    171172  RINGLIST_CMD,
    172173  RING_LIST_CMD,
  • configure.ac

    rb4bd83 rdb20ef  
    249249AC_CONFIG_FILES([Singular/dyn_modules/staticdemo/Makefile])
    250250AC_CONFIG_FILES([Singular/dyn_modules/subsets/Makefile])
    251 AC_CONFIG_FILES([Singular/dyn_modules/freegb/Makefile])
     251AC_CONFIG_FILES([Singular/dyn_modules/freealgebra/Makefile])
    252252AC_CONFIG_FILES([Singular/dyn_modules/gitfan/Makefile])
    253253AC_CONFIG_FILES([Singular/dyn_modules/interval/Makefile])
  • kernel/GBEngine/kstd1.cc

    rb4bd83 rdb20ef  
    20932093
    20942094#ifdef HAVE_SHIFTBBA
    2095   if(rIsLPRing(currRing)) return freegb(F);
     2095  if(rIsLPRing(currRing)) return freegb(F, Q);
    20962096#endif
    20972097
  • kernel/GBEngine/kstd1.h

    rb4bd83 rdb20ef  
    4141ideal kStdShift(ideal F, ideal Q, tHomog h,intvec ** mw, intvec *hilb=NULL,
    4242    int syzComp=0, int newIdeal=0, intvec *vw=NULL, BOOLEAN rightGB=FALSE);
     43
     44ideal freegb(ideal F, ideal Q);
     45ideal rightgb(ideal F, ideal Q);
    4346
    4447/* the following global data are defined in kutil.cc */
  • kernel/GBEngine/kstd2.cc

    rb4bd83 rdb20ef  
    44594459
    44604460
    4461 ideal freegb(ideal F)
     4461ideal freegb(ideal F, ideal Q)
    44624462{
    44634463  assume(rIsLPRing(currRing));
    44644464  assume(idIsInV(F));
    4465   ideal RS = kStdShift(F, NULL, testHomog, NULL);
     4465  ideal RS = kStdShift(F, Q, testHomog, NULL);
    44664466  idSkipZeroes(RS); // is this even necessary?
    44674467  assume(idIsInV(RS));
  • kernel/GBEngine/kutil.h

    rb4bd83 rdb20ef  
    861861int redFirstShift (LObject* h,kStrategy strat); // ok
    862862
    863 ideal freegb(ideal F);
    864 ideal rightgb(ideal F, ideal Q);
    865 
    866863ideal bbaShift(ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat);
    867864// test syz strategy: // will be removed soon
  • kernel/ideals.h

    rb4bd83 rdb20ef  
    140140ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL, GbVariant a=GbDefault);
    141141
    142 ideal   idLift (ideal mod, ideal sumod,ideal * rest=NULL,
     142ideal   idLift (ideal mod, ideal submod,ideal * rest=NULL,
    143143             BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
    144144             matrix *unit=NULL, GbVariant a=GbDefault);
  • kernel/polys.cc

    rb4bd83 rdb20ef  
    77#include "kernel/ideals.h"
    88#include "polys/clapsing.h"
     9#include "polys/clapconv.h"
    910
    1011/// Widely used global variable which specifies the current polynomial ring for Singular interpreter and legacy implementatins.
     
    5051    if(p_GetComp(p,r)==0)
    5152    {
    52       if ((r->cf->convSingNFactoryN!=ndConvSingNFactoryN)
     53      if((rFieldType(r)==n_transExt)
     54      &&(convSingTrP(p,r))
     55      &&(convSingTrP(q,r)))
     56      {
     57        poly res=singclap_pdivide(p, q, r);
     58        p_Delete(&p,r);
     59        p_Delete(&q,r);
     60        return res;
     61      }
     62      else if ((r->cf->convSingNFactoryN!=ndConvSingNFactoryN)
    5363      &&(!rField_is_Ring(r)))
    5464      {
     
    7181        SI_RESTORE_OPT1(save_opt);
    7282        if (r!=save_ring) rChangeCurrRing(save_ring);
    73         if (idIs0(R))
    74         {
    75           matrix T = id_Module2formatedMatrix(m,1,1,r);
    76           p=MATELEM(T,1,1); MATELEM(T,1,1)=NULL;
    77           id_Delete((ideal *)&T,r);
    78         }
    79         else p=NULL;
     83        matrix T = id_Module2formatedMatrix(m,1,1,r);
     84        p=MATELEM(T,1,1); MATELEM(T,1,1)=NULL;
     85        id_Delete((ideal *)&T,r);
    8086        id_Delete((ideal *)&U,r);
    8187        id_Delete(&R,r);
     
    109115        if (I->m[i]!=NULL)
    110116        {
    111           if ((r->cf->convSingNFactoryN!=ndConvSingNFactoryN)
     117          if((rFieldType(r)==n_transExt)
     118          &&(convSingTrP(I->m[i],r))
     119          &&(convSingTrP(q,r)))
     120          {
     121            h=singclap_pdivide(I->m[i],q,r);
     122          }
     123          else if ((r->cf->convSingNFactoryN!=ndConvSingNFactoryN)
    112124          &&(!rField_is_Ring(r)))
    113125            h=singclap_pdivide(I->m[i],q,r);
     
    164176    return p_DivideM(p,q,r);
    165177  }
    166   return FALSE;
     178  return NULL;
     179}
     180
     181poly p_DivRem(poly p, poly q, poly &rest, const ring r)
     182{
     183  assume(q!=NULL);
     184  rest=NULL;
     185  if (q==NULL)
     186  {
     187    WerrorS("div. by 0");
     188    return NULL;
     189  }
     190  if (p==NULL)
     191  {
     192    p_Delete(&q,r);
     193    return NULL;
     194  }
     195  if (rIsLPRing(r))
     196  {
     197    WerrorS("not implemented for letterplace rings");
     198    return NULL;
     199  }
     200  if(p_GetComp(p,r)==0)
     201  {
     202    if((rFieldType(r)==n_transExt)
     203    &&(convSingTrP(p,r))
     204    &&(convSingTrP(q,r)))
     205    {
     206      poly res=singclap_pdivide(p, q, r);
     207      rest=singclap_pmod(p,q,r);
     208      p_Delete(&p,r);
     209      p_Delete(&q,r);
     210      return res;
     211    }
     212    else if ((r->cf->convSingNFactoryN!=ndConvSingNFactoryN)
     213    &&(!rField_is_Ring(r)))
     214    {
     215      poly res=singclap_pdivide(p, q, r);
     216      rest=singclap_pmod(p,q,r);
     217      p_Delete(&p,r);
     218      p_Delete(&q,r);
     219      return res;
     220    }
     221    else
     222    {
     223      ideal vi=idInit(1,1); vi->m[0]=q;
     224      ideal ui=idInit(1,1); ui->m[0]=p;
     225      ideal R; matrix U;
     226      ring save_ring=currRing;
     227      if (r!=currRing) rChangeCurrRing(r);
     228      int save_opt;
     229      SI_SAVE_OPT1(save_opt);
     230      si_opt_1 &= ~(Sy_bit(OPT_PROT));
     231      ideal m = idLift(vi,ui,&R, FALSE,TRUE,TRUE,&U);
     232      SI_RESTORE_OPT1(save_opt);
     233      if (r!=save_ring) rChangeCurrRing(save_ring);
     234      matrix T = id_Module2formatedMatrix(m,1,1,r);
     235      p=MATELEM(T,1,1); MATELEM(T,1,1)=NULL;
     236      id_Delete((ideal *)&T,r);
     237      T = id_Module2formatedMatrix(R,1,1,r);
     238      rest=MATELEM(T,1,1); MATELEM(T,1,1)=NULL;
     239      id_Delete((ideal *)&T,r);
     240      id_Delete((ideal *)&U,r);
     241      id_Delete(&R,r);
     242      //vi->m[0]=NULL; ui->m[0]=NULL;
     243      id_Delete(&vi,r);
     244      id_Delete(&ui,r);
     245      return p;
     246    }
     247  }
     248  return NULL;
    167249}
    168250
  • kernel/polys.h

    rb4bd83 rdb20ef  
    160160#endif
    161161
    162 /// polynomial division, ignoring the rest
     162/// polynomial division a/b, ignoring the rest
    163163/// via singclap_pdivide resp. idLift
    164164/// destroyes a,b
    165165poly p_Divide(poly a, poly b, const ring r);
     166poly p_DivRem(poly a, poly b, poly &rest, const ring r); /*julia*/
    166167
    167168/// polynomial gcd
  • libpolys/polys/clapconv.cc

    rb4bd83 rdb20ef  
    290290  while ( p!=NULL )
    291291  {
    292     n_Normalize(p_GetCoeff(p, r), r->cf);
     292    //n_Normalize(p_GetCoeff(p, r), r->cf);
    293293
    294294    // test if denominator is constant
    295     if (!p_IsConstantPoly(DEN ((fraction)p_GetCoeff (p,r)),r->cf->extRing) && !errorreported)
     295    if (!errorreported && !p_IsConstantPoly(DEN ((fraction)p_GetCoeff (p,r)),r->cf->extRing))
    296296      WerrorS("conversion error: denominator!= 1");
    297297
     
    316316  }
    317317  return result;
     318}
     319
     320BOOLEAN convSingTrP(poly p, const ring r )
     321{
     322  while ( p!=NULL )
     323  {
     324    n_Normalize(p_GetCoeff(p, r), r->cf);
     325
     326    // test if denominator is constant
     327    if (!p_IsConstantPoly(DEN ((fraction)p_GetCoeff (p,r)),r->cf->extRing))
     328      return FALSE;
     329    pIter(p);
     330  }
     331  return TRUE;
    318332}
    319333
  • libpolys/polys/clapconv.h

    rb4bd83 rdb20ef  
    3030
    3131CanonicalForm convSingTrPFactoryP ( poly p, const ring r );
     32BOOLEAN convSingTrP(poly p, const ring r );
    3233poly convFactoryPSingTrP ( const CanonicalForm & f, const ring r );
    3334
  • libpolys/polys/clapsing.cc

    rb4bd83 rdb20ef  
    8484    else
    8585    {
     86      convSingTrP(f,r);
     87      convSingTrP(g,r);
    8688      CanonicalForm F( convSingTrPFactoryP( f,r ) ), G( convSingTrPFactoryP( g,r ) );
    8789      res= convFactoryPSingTrP( gcd( F, G ),r );
  • libpolys/polys/monomials/ring.cc

    rb4bd83 rdb20ef  
    51305130  int lb = rBlocks(r) - 2;
    51315131  return (r->order[lb] == ringorder_c || r->order[lb] == ringorder_C);
    5132 }
    5133 
    5134 n_coeffType rFieldType(ring r)
    5135 {
    5136   return (r->cf->type);
    5137   if (rField_is_Zp(r))     return n_Zp;
    5138   if (rField_is_Q(r))      return n_Q;
    5139   if (rField_is_R(r))      return n_R;
    5140   if (rField_is_GF(r))     return n_GF;
    5141   if (rField_is_long_R(r)) return n_long_R;
    5142   if (rField_is_Zp_a(r))   return getCoeffType(r->cf);
    5143   if (rField_is_Q_a(r))    return getCoeffType(r->cf);
    5144   if (rField_is_long_C(r)) return n_long_C;
    5145   if (rField_is_Z(r))         return n_Z;
    5146   if (rField_is_Zn(r))        return n_Zn;
    5147   if (rField_is_Ring_PtoM(r)) return n_Znm;
    5148   if (rField_is_Ring_2toM(r)) return  n_Z2m;
    5149 
    5150   return n_unknown;
    51515132}
    51525133
  • libpolys/polys/monomials/ring.h

    rb4bd83 rdb20ef  
    548548{ assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_simple_Alloc(r->cf); }
    549549
    550 n_coeffType rFieldType(const ring r);
     550/// the type of the coefficient filed of r (n_Zp, n_Q, etc)
     551static inline n_coeffType rFieldType(const ring r) { return (r->cf->type); }
    551552
    552553/// this needs to be called whenever a new ring is created: new fields
  • m4/options.m4

    rb4bd83 rdb20ef  
    321321  bi_staticdemo=false
    322322  bi_subsets=false
    323   bi_freegb=false
     323  bi_freealgebra=false
    324324  bi_syzextra=false
    325325  bi_pyobject=false
     
    357357       staticdemo ) bi_staticdemo=true;;
    358358       subsets ) bi_subsets=true;;
    359        freegb ) bi_freegb=true;;
     359       freealgebra ) bi_freealgebra=true;;
    360360       syzextra ) bi_syzextra=true ;;
    361361       pyobject ) bi_pyobject=true ;;
     
    396396 AM_CONDITIONAL([SI_BUILTIN_STATICDEMO], [test x$bi_staticdemo = xtrue])
    397397 AM_CONDITIONAL([SI_BUILTIN_SUBSETS], [test x$bi_subsets = xtrue])
    398  AM_CONDITIONAL([SI_BUILTIN_FREEGB], [test x$bi_freegb = xtrue])
     398 AM_CONDITIONAL([SI_BUILTIN_FREEALGEBRA], [test x$bi_freealgebra = xtrue])
    399399 AM_CONDITIONAL([SI_BUILTIN_SYZEXTRA], [test x$bi_syzextra = xtrue])
    400400 AM_CONDITIONAL([SI_BUILTIN_PYOBJECT], [test x$bi_pyobject = xtrue])
Note: See TracChangeset for help on using the changeset viewer.