Changeset 671977 in git


Ignore:
Timestamp:
Feb 13, 2009, 10:46:49 AM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
9f7c98afd95242eaf9f63019cd36b483465f8c85
Parents:
f9ffa1187e21ddea0986a5d4614216f62c066d70
Message:
*hannes/king: Simons std with 4 args: std(G,p,hv,rw),
    G standard basis of a homogeneous ideal,
    p a homogeneous polynomial,
    hv == hilb(std(G+p),1,rw)
    --> Output: Standard basis of G+p


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

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    rf9ffa1 r671977  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.493 2009-01-17 10:19:17 Singular Exp $ */
     4/* $Id: iparith.cc,v 1.494 2009-02-13 09:46:49 Singular Exp $ */
    55
    66/*
     
    387387#endif /* OLD_RES */
    388388  { "status",      0, STATUS_CMD,         CMD_M},
    389   { "std",         0, STD_CMD ,           CMD_123},
     389  { "std",         0, STD_CMD ,           CMD_M},
    390390  { "string",      0, STRING_CMD ,        ROOT_DECL_LIST},
    391391  { "subst",       0, SUBST_CMD ,         CMD_M},
     
    30683068    i0=(ideal)v->CopyD();
    30693069  }
    3070   int ii0=idElem(i0);
     3070  int ii0=idElem(i0); /* size of i0 */
    30713071  i1=idSimpleAdd(i1,i0);
    30723072  memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
     
    30913091  BITSET save_test=test;
    30923092  test|=Sy_bit(OPT_SB_1);
     3093  /* IDELEMS(il)-ii0 appears to be the position of the first element of il that
     3094     does not belong to the input ideal */
    30933095  result=kStd(i1,currQuotient,hom,&w,NULL,0,IDELEMS(i1)-ii0);
    30943096  test=save_test;
     
    69516953  return b;
    69526954}
     6955static BOOLEAN jjSTD_HILB_WP(leftv res, leftv INPUT)
     6956{ ideal result;
     6957  leftv u = INPUT;    /* an ideal, weighted homogeneous and standard */
     6958  leftv v = u->next;  /* one additional polynomial or ideal */
     6959  leftv h = v->next;  /* Hilbert vector */
     6960  leftv w = h->next;  /* weight vector */
     6961  assumeStdFlag(u);
     6962  ideal i1=(ideal)(u->Data());
     6963  ideal i0;
     6964  intvec *vw=(intvec *)w->Data(); // weights of vars
     6965  /* merging std_hilb_w and std_1 */
     6966  if (vw->length()!=currRing->N)
     6967  {
     6968    Werror("%d weights for %d variables",vw->length(),currRing->N);
     6969    return TRUE;
     6970  }
     6971  int r=v->Typ();
     6972  if ((r==POLY_CMD) ||(r==VECTOR_CMD))
     6973  {
     6974    i0=idInit(1,i1->rank);
     6975    i0->m[0]=(poly)v->Data();
     6976  }
     6977  else /* IDEAL */
     6978  {
     6979    i0=(ideal)v->Data();
     6980  }
     6981  int ii0=idElem(i0);
     6982  i1 = idSimpleAdd(i1,i0);
     6983  memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
     6984  idDelete(&i0);
     6985  intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
     6986  tHomog hom=testHomog;
     6987  /* u_id from jjSTD_W is now i1 as in jjSTD_1 */
     6988  if (ww!=NULL)
     6989  {
     6990    if (!idTestHomModule(i1,currQuotient,ww))
     6991    {
     6992      WarnS("wrong weights");
     6993      ww=NULL;
     6994    }
     6995    else
     6996    {
     6997      ww=ivCopy(ww);
     6998      hom=isHomog;
     6999    }
     7000  }
     7001  BITSET save_test=test;
     7002  test|=Sy_bit(OPT_SB_1);
     7003  result=kStd(i1,
     7004              currQuotient,
     7005              hom,
     7006              &ww,                  // module weights
     7007              (intvec *)h->Data(),  // hilbert series
     7008              0,                    // syzComp, whatever it is...
     7009              IDELEMS(i1)-ii0,      // new ideal
     7010              vw);                  // weights of vars
     7011  test=save_test;
     7012  idDelete(&i1);
     7013  idSkipZeroes(result);
     7014  res->data = (char *)result;
     7015  if (!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
     7016  if (ww!=NULL) atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
     7017  return FALSE;
     7018}
     7019
    69537020
    69547021/*=================== operations with many arg.: table =================*/
     
    70007067,{loSimplex,   SIMPLEX_CMD,     LIST_CMD,            6       NO_PLURAL}
    70017068,{nuUResSolve, URSOLVE_CMD,     LIST_CMD,            4       NO_PLURAL}
     7069,{jjCALL1ARG,  STD_CMD,         IDEAL_CMD,           1       ALLOW_PLURAL}
     7070,{jjCALL2ARG,  STD_CMD,         IDEAL_CMD,           2       ALLOW_PLURAL}
     7071,{jjCALL3ARG,  STD_CMD,         IDEAL_CMD,           3       NO_PLURAL}
     7072,{jjSTD_HILB_WP, STD_CMD,       IDEAL_CMD,           4       NO_PLURAL}
    70027073,{NULL,        0,               0,                   0       NO_PLURAL}
    70037074};
Note: See TracChangeset for help on using the changeset viewer.