Changeset dabe365 in git


Ignore:
Timestamp:
Aug 7, 2008, 8:08:37 PM (16 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '3a4bc649f1d0185cc9f8b122bd75f21f75ac9c9a')
Children:
5d97859f88aa52d68bbca5a456cd859d9492231a
Parents:
35ee9b7a58e79afeef7aebc85bd49c899533d499
Message:
*levandov: shiftbba prepared for release


git-svn-id: file:///usr/local/Singular/svn/trunk@10968 2c84dea3-7e68-4137-9b89-c4e89433aadc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/freegb.lib

    r35ee9b7 rdabe365  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: freegb.lib,v 1.9 2008-05-12 14:55:16 levandov Exp $";
     2version="$Id: freegb.lib,v 1.10 2008-08-07 18:08:37 levandov Exp $";
    33category="Noncommutative";
    44info="
    5 LIBRARY: freegb.lib  Twosided Noncommutative Groebner bases in Free Algebras
     5LIBRARY: freegb.lib   Twosided Noncommutative Groebner bases in Free Algebras
    66AUTHOR: Viktor Levandovskyy,     levandov@math.rwth-aachen.de
    77
    88PROCEDURES:
     9freegbRing(int d);    creates a ring with d blocks of shifted original variables
    910freegbasis(list L, int n);   compute two-sided Groebner basis of ideal, encoded via L, up to degree n
    10 
    11 freegbRing(int d);    creates a ring with d blocks of shifted original variables
    1211
    1312CONVERSION ROUTINES:
     
    2928LIB "qhmoduli.lib"; // for Max
    3029
    31 proc vct2mono(vector v)
    32 {
    33   // produces a monomial in new vars
    34   // need a ring with new vars!!
    35 }
     30
     31// obsolete?
    3632
    3733proc lshift(module M, int s, string varing, def lpring)
     
    8278proc skip0(vector v)
    8379{
    84   // skips zeros in vector
     80  // skips zeros in a vector, producing another vector
    8581  int sv = nrows(v);
    8682  int sw = size(v);
     
    377373
    378374proc mono2word(poly p, int d)
    379 {
    380  
     375{
    381376}
    382377
     
    893888  A;
    894889}
    895 
    896890
    897891proc ex_shift()
     
    16841678proc sent2lplace(string s)
    16851679{
     1680  // SENTence of words TO LetterPLACE
    16861681  list L =   stringpoly2lplace(s);
    16871682  int i; int ss = size(L);
     
    19371932}
    19381933
    1939 proc Liebr(poly a, poly b)
    1940 {
    1941   // alias ppLiebr
     1934proc Liebr(poly a, poly b, list #)
     1935{
     1936  // alias ppLiebr;
     1937  //if int N is given compute [a,[...[a,b]]]] left normed bracket
    19421938  poly q;
     1939  int N=1;
     1940  if (size(#)>0)
     1941  {
     1942    if (typeof(#[1])=="int")
     1943    {
     1944      N = int(#[1]);
     1945    }
     1946  }
     1947  if (N<=0) { return(q); }
    19431948  while (b!=0)
    19441949  {
     
    19461951    b = b - lead(b);
    19471952  }
     1953  int i;
     1954  if (N >1)
     1955  {
     1956    for(i=1; i<=N; i++)
     1957    {
     1958      q = Liebr(a,q);
     1959    }
     1960  }
    19481961  return(q);
    19491962}
     
    19511964{
    19521965  "EXAMPLE:"; echo = 2;
    1953   ring r = 0,(x(1),x(2),x(3),y(1),y(2),y(3)),dp;
     1966  ring r = 0,(x(1),y(1),x(2),y(2),x(3),y(3),x(4),y(4)),dp;
    19541967  poly a = x(1)*y(2); poly b = y(1);
    1955   int uptodeg=3; int lV=2;
     1968  int uptodeg=4; int lV=2;
    19561969  export uptodeg; export lV;
    19571970  Liebr(a,b);
     1971  Liebr(x(1),y(1),2);
    19581972}
    19591973
     
    21692183  def R = freegbRing(uptodeg);
    21702184  setring R;
    2171   ideal I = Serre(A);
     2185  ideal I = Serre(A,1);
    21722186  lp2lstr(I,r);
    21732187  setring r;
     
    22182232proc file2lplace(string fname)
    22192233{
     2234  // format: from the usual string to letterplace
    22202235  string s = read(fname);
    22212236  // assume: file is a comma-sep list of polys
    22222237  // the vars are declared before
    2223   // ends with ";"
     2238  // the file ends with ";"
    22242239  string t; int i;
    22252240  ideal I;
     
    22862301  lst2str(LN,1); // agree!
    22872302}
     2303
     2304static proc doc_example
     2305{
     2306  LIB "freegb.lib";
     2307  ring r = 0,(x,y,z),dp;
     2308  int d =4; // degree bound
     2309  def R = freegbRing(d);
     2310  setring R;
     2311  ideal I = x(1)*y(2) + y(1)*z(2), x(1)*x(2) + x(1)*y(2) - y(1)*x(2) - y(1)*y(2);
     2312  option(redSB);option(redTail);
     2313  ideal J = system("freegb",I,d,nvars(r));
     2314  J;
     2315  // visualization:
     2316  lp2lstr(J,r); // export an object called LN to the ring r
     2317  setring r;  // change to the ring r
     2318  lst2str(LN,1); // output the strings
     2319}
     2320
     2321
     2322
     2323// TODO:
     2324// multiply two letterplace polynomials, lpMult
     2325// reduction/ Normalform? needs kernel stuff
     2326
  • Singular/extra.cc

    r35ee9b7 rdabe365  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.280 2008-07-28 09:55:02 Singular Exp $ */
     4/* $Id: extra.cc,v 1.281 2008-08-07 18:08:36 levandov Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    26532653        lVblock=(int)((long)(h->Data()));
    26542654        res->data = freegb(I,uptodeg,lVblock);
     2655        if (res->data == NULL)
     2656        {
     2657          /* that is there were input errors */
     2658          res->data = I;
     2659        }
    26552660        res->rtyp = IDEAL_CMD;
    26562661      }
     
    27132718        res->rtyp = INT_CMD;
    27142719        res->data = (void*)pLastVblock(p, lV);
     2720      }
     2721      else return TRUE;
     2722      return FALSE;
     2723    }
     2724    else
     2725/*==================== shrink-test for freeGB  =================*/
     2726    if (strcmp(sys_cmd, "shrinktest") == 0)
     2727    {
     2728      poly p;
     2729      int lV;
     2730      if ((h!=NULL) && (h->Typ()==POLY_CMD))
     2731      {
     2732        p=(poly)h->CopyD();
     2733        h=h->next;
     2734      }
     2735      else return TRUE;
     2736      if ((h!=NULL) && (h->Typ()==INT_CMD))
     2737      {
     2738        lV=(int)((long)(h->Data()));
     2739        res->rtyp = POLY_CMD;
     2740        //      res->data = p_mShrink(p, lV, currRing);
     2741        //      kStrategy strat=new skStrategy;
     2742        //      strat->tailRing = currRing;
     2743        res->data = p_Shrink(p, lV, currRing);
    27152744      }
    27162745      else return TRUE;
  • kernel/kstd2.cc

    r35ee9b7 rdabe365  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.73 2008-07-26 08:22:35 Singular Exp $ */
     4/* $Id: kstd2.cc,v 1.74 2008-08-07 18:08:37 levandov Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    17431743  /* uptodeg and lVblock are correct - test them! */
    17441744
     1745  /* check whether the ideal is in V */
     1746  if (! ideal_isInV(I,lVblock) )
     1747  {
     1748    PrintS("ERROR: The input ideal contains incorrectly encoded elements! ");
     1749    return(NULL);
     1750  }
     1751
    17451752  //  kStrategy strat = new skStrategy;
    17461753  /* ideal bbaShift(ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat, int uptodeg, int lV) */
  • kernel/shiftgb.cc

    r35ee9b7 rdabe365  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: shiftgb.cc,v 1.9 2008-07-26 14:28:03 motsak Exp $ */
     4/* $Id: shiftgb.cc,v 1.10 2008-08-07 18:08:37 levandov Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for shift GB and free GB
     
    380380{
    381381  /* investigate only the leading monomial of p in currRing */
     382  if ( pIsConstant(p) ) return(1);
    382383  if (lV <= 0) return(0);
    383384  /* returns 1 iff p is in V */
     
    428429}
    429430
     431int poly_isInV(poly p, int lV)
     432{
     433  /* tests whether the whole polynomial p in in V */
     434  poly q = p;
     435  while (q!=NULL)
     436  {
     437    if ( !isInV(q,lV) )
     438    {
     439      return(0);
     440    }
     441    q = pNext(q);
     442  }
     443  return(1);
     444}
     445
     446int ideal_isInV(ideal I, int lV)
     447{
     448  /* tests whether each polynomial of an ideal I lies in in V */
     449  int i;
     450  int s    = IDELEMS(I)-1;
     451  for(i = 0; i <= s; i++)
     452  {
     453    if ( !poly_isInV(I->m[i],lV) )
     454    {
     455      return(0);
     456    }
     457  }
     458  return(1);
     459}
     460
     461
    430462int itoInsert(poly p, int uptodeg, int lV, const ring r)
    431463{
  • kernel/shiftgb.h

    r35ee9b7 rdabe365  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: shiftgb.h,v 1.5 2008-07-08 13:02:21 Singular Exp $ */
     6/* $Id: shiftgb.h,v 1.6 2008-08-07 18:08:37 levandov Exp $ */
    77/*
    88* ABSTRACT: kernel: utils for kStd
     
    3838
    3939int isInV(poly p, int lV);
     40int poly_isInV(poly p, int lV);
     41int ideal_isInV(ideal I, int lV);
    4042
    4143int itoInsert(poly p, int uptodeg, int lV, const ring r);
Note: See TracChangeset for help on using the changeset viewer.