Changeset 438670 in git


Ignore:
Timestamp:
Oct 4, 2016, 8:44:36 AM (8 years ago)
Author:
Yue <ren@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '4fa496c5b814dbde0a905c54f0796301d03f6dc9')
Children:
b81873bc058f1639f534663b5704b3a1c4f663ce
Parents:
78c0d45cf6f53471cfd659c03cc7f926e4fbd8ea
git-author:
Yue <ren@mathematik.uni-kl.de>2016-10-04 08:44:36+02:00
git-committer:
Yue <ren@mathematik.uni-kl.de>2016-10-04 13:10:39+02:00
Message:
chg: added wrappers for tropical functions in gfanlib.so to tropical.lib
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/tropical.lib

    r78c0d45 r438670  
    88@*               Hannah Markwig,  email: hannah@uni-math.gwdg.de
    99@*               Thomas Markwig,  email: keilen@mathematik.uni-kl.de
     10@*               Yue Ren,         email: ren@mathematik.uni-kl.de
     11
    1012
    1113WARNING:
     
    85638565}
    85648566
     8567/////////////////////////////////////////////////////////////////////////
     8568//
     8569//  Functions from binary libraries
     8570//
     8571/////////////////////////////////////////////////////////////////////////
     8572
     8573
     8574proc groebnerCone()
     8575"USAGE:      groebnerCone(I,w); I ideal or poly, w intvec or bigintmat
     8576ASSUME:      I a reduced standard basis and w contained in the maximal Groebner cone
     8577RETURN:      cone, the Groebner cone of I with respect to w
     8578EXAMPLE:     example groebnerCone;  shows an example"
     8579{
     8580
     8581}
     8582example
     8583{
     8584   "EXAMPLE:"; echo=2;
     8585   LIB "poly.lib";
     8586   ring r = 0,(x,y,z),dp;
     8587   ideal I = cyclic(3);
     8588   option(redSB);
     8589   ideal stdI = std(I);
     8590   // w lies in the interior of a maximal Groebner cone
     8591   intvec w = 3,2,1;
     8592   cone CwI = groebnerCone(stdI,w);
     8593   print(rays(CwI));
     8594   // v lies on a facet of a maximal Groebner cone
     8595   intvec v = 2,1,0;
     8596   cone CvI = groebnerCone(stdI,v);
     8597   print(rays(CvI));
     8598   // v lies on a ray of a maximal Groebner cone
     8599   intvec u = 1,1,1;
     8600   cone CuI = groebnerCone(stdI,u);
     8601   print(rays(CuI));
     8602}
     8603
     8604
     8605proc maximalGroebnerCone()
     8606"USAGE:      maximalGroebnerCone(I); I ideal or poly
     8607ASSUME:      I a reduced standard basis
     8608RETURN:      cone, the maximal Groebner cone of I with respect to the current ordering
     8609EXAMPLE:     example maximalGroebnerCone;  shows an example"
     8610{
     8611
     8612}
     8613example
     8614{
     8615   "EXAMPLE:"; echo=2;
     8616   LIB "poly.lib";
     8617   ring r = 0,(x,y,z),dp;
     8618   ideal I = cyclic(3);
     8619   option(redSB);
     8620   ideal stdI = std(I);
     8621   cone CI = maximalGroebnerCone(stdI);
     8622   print(rays(CI));
     8623
     8624   ring s = 0,(x,y,z,u),dp;
     8625   ideal Ih = homog(cyclic(3),u);
     8626   ideal stdI = std(Ih);
     8627   cone CIh = maximalGroebnerCone(stdI);
     8628   print(rays(CIh));
     8629   print(generatorsOfLinealitySpace(CIh));
     8630
     8631   ring rw = 0,(x,y,z),(a(1,0,1),lp);
     8632   ideal I = cyclic(3);
     8633   ideal stdI = std(I);
     8634   CI = maximalGroebnerCone(stdI);
     8635   print(rays(CI));
     8636}
     8637
     8638
     8639proc homogeneitySpace()
     8640"USAGE:      homogeneitySpace(I); I ideal or poly
     8641ASSUME:      I a reduced standard basis
     8642RETURN:      cone, the set of all weight vectors with respect to whom I is weighted homogeneous
     8643EXAMPLE:     example homogeneitySpace;  shows an example"
     8644{
     8645
     8646}
     8647example
     8648{
     8649   "EXAMPLE:"; echo=2;
     8650   LIB "poly.lib";
     8651   ring r = 0,(x,y,z),dp;
     8652   ideal I = cyclic(3);
     8653   option(redSB);
     8654   ideal stdI = std(I);
     8655   cone C0I = homogeneitySpace(stdI);
     8656   print(generatorsOfLinealitySpace(C0I));
     8657
     8658   ring s = 0,(x,y,z,u),dp;
     8659   ideal Ih = homog(cyclic(3),u);
     8660   ideal stdI = std(Ih);
     8661   cone C0Ih = homogeneitySpace(stdI);
     8662   print(generatorsOfLinealitySpace(C0Ih));
     8663}
     8664
     8665
     8666proc initial()
     8667"USAGE:      initial(f,w); f poly, w intvec or bigintmat
     8668             initial(I,w); I ideal, w intvec or bigintmat
     8669ASSUME:      I reduced Groebner basis,
     8670             w in the maximal Groebner cone of I with respect to the current ordering
     8671RETURN:      poly or ideal, the initial form of f or the initial ideal of I with respect to w
     8672EXAMPLE:     example initial;  shows an example"
     8673{
     8674
     8675}
     8676example
     8677{
     8678   "EXAMPLE:"; echo=2;
     8679   LIB "poly.lib";
     8680   ring r = 0,(x,y,z),dp;
     8681   ideal I = cyclic(3);
     8682   intvec w = 1,1,1;
     8683   option(redSB);
     8684   ideal stdI = std(I);
     8685   stdI;
     8686   ideal inI = initial(stdI,w);
     8687   inI;
     8688}
     8689
     8690
     8691proc tropicalVariety()
     8692"USAGE:      tropicalVariety(f[,p]); f poly, p optional number
     8693             tropicalVariety(I[,p]); I ideal, p optional number
     8694ASSUME:      I homogeneous, p prime number
     8695RETURN:      fan, the tropical variety of f resp. I with respect to the trivial valuation or the p-adic valuation
     8696NOTE:        set printlevel=1 for output during traversal
     8697EXAMPLE:     example tropicalVariety;  shows an example"
     8698{
     8699
     8700}
     8701example
     8702{
     8703   "EXAMPLE:"; echo=2;
     8704   ring r = 0,(x,y,z,w),dp;
     8705   ideal I = x-2y+3z,3y-4z+5w;
     8706   tropicalVariety(I);
     8707   tropicalVariety(I,number(2));
     8708   tropicalVariety(I,number(3));
     8709   tropicalVariety(I,number(5));
     8710   tropicalVariety(I,number(7));
     8711}
     8712
     8713
     8714proc groebnerFan()
     8715"USAGE:      groebnerFan(f); f poly
     8716             groebnerFan(I); I ideal
     8717ASSUME:      I homogeneous
     8718RETURN:      fan, the Groebner fan of f resp. I
     8719NOTE:        set printlevel=1 for output during traversal
     8720EXAMPLE:     example groebnerFan;  shows an example"
     8721{
     8722
     8723}
     8724example
     8725{
     8726   "EXAMPLE:"; echo=2;
     8727   ring r = 0,(x,y,z,w),dp;
     8728   ideal I = x-2y+3z,3y-4z+5w;
     8729   groebnerFan(I);
     8730}
     8731
     8732
     8733proc groebnerComplex()
     8734"USAGE:      groebnerComplex(f,p); f poly, p number
     8735             groebnerComplex(I,p); I ideal, p number
     8736ASSUME:      I homogeneous, p prime number
     8737RETURN:      fan, the Groebner complex of f resp. I with respect to the p-adic valuation
     8738NOTE:        set printlevel=1 for output during traversal
     8739EXAMPLE:     example groebnerComplex;  shows an example"
     8740{
     8741
     8742}
     8743example
     8744{
     8745   "EXAMPLE:"; echo=2;
     8746   ring r = 0,(x,y,z,w),dp;
     8747   ideal I = x-2y+3z,3y-4z+5w;
     8748   groebnerComplex(I,number(2));
     8749   groebnerComplex(I,number(3));
     8750   groebnerComplex(I,number(5));
     8751   groebnerComplex(I,number(7));
     8752}
  • Singular/dyn_modules/gfanlib/tropical.cc

    r78c0d45 r438670  
    441441void tropical_setup(SModulFunctions* p)
    442442{
    443   p->iiAddCproc("","groebnerCone",FALSE,groebnerCone);
    444   p->iiAddCproc("","maximalGroebnerCone",FALSE,maximalGroebnerCone);
    445   p->iiAddCproc("","homogeneitySpace",FALSE,homogeneitySpace);
    446   p->iiAddCproc("","lowerHomogeneitySpace",FALSE,lowerHomogeneitySpace);
    447   p->iiAddCproc("","initial",FALSE,initial);
    448   p->iiAddCproc("","tropicalVariety",FALSE,tropicalVariety);
    449   p->iiAddCproc("","groebnerFan",FALSE,groebnerFan);
    450   p->iiAddCproc("","groebnerComplex",FALSE,groebnerComplex);
     443  p->iiAddCproc("tropical.lib","groebnerCone",FALSE,groebnerCone);
     444  p->iiAddCproc("tropical.lib","maximalGroebnerCone",FALSE,maximalGroebnerCone);
     445  p->iiAddCproc("tropical.lib","homogeneitySpace",FALSE,homogeneitySpace);
     446  // p->iiAddCproc("","lowerHomogeneitySpace",FALSE,lowerHomogeneitySpace);
     447  p->iiAddCproc("tropical.lib","initial",FALSE,initial);
     448  p->iiAddCproc("tropical.lib","tropicalVariety",FALSE,tropicalVariety);
     449  p->iiAddCproc("tropical.lib","groebnerFan",FALSE,groebnerFan);
     450  p->iiAddCproc("tropical.lib","groebnerComplex",FALSE,groebnerComplex);
    451451  // p->iiAddCproc("","ppreduceInitially",FALSE,ppreduceInitially);
    452452  // p->iiAddCproc("","ttreduceInitially",FALSE,ttreduceInitially);
Note: See TracChangeset for help on using the changeset viewer.