Changeset a5bbb5 in git


Ignore:
Timestamp:
Jan 9, 2017, 2:02:30 PM (6 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '5bec8f88c9ee2573d328cf7c3aff2bcb301d2395')
Children:
b8b76ef3092b3162aa763b4c5b7705ceab2203fa
Parents:
a418d9fffbccc54b2388850e64bfc084cd0e61dcd29e550951bb89f260d4afb0da084c6a1a83e101
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2017-01-09 14:02:30+01:00
git-committer:
GitHub <noreply@github.com>2017-01-09 14:02:30+01:00
Message:
Merge pull request #810 from YueRen/tropicallib

chg: kghostview -> xdg-open + line breaks after commata in tex file
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/standard.lib

    rd29e550 ra5bbb5  
    11///////////////////////////////////////////////////////////////////////////
    2 version="version standard.lib 4.0.0.0 Jun_2013 "; // $Id$
     2version="version standard.lib 4.1.0.0 Dec_2016 "; // $Id$
    33category="Miscellaneous";
    44info="
     
    882882  kill i_par;
    883883// check for integer etc coefficients
    884   if (charstr(basering)[1]=="i") // either integer or integer,q
     884  if (attrib(basering,"ring_cf")==1) // either integer or integer,q
    885885  {
    886886    if (find(option(),"prot"))  { "calling std for ideals in ring with ring coefficients"; }
  • Singular/LIB/tropical.lib

    ra418d9 ra5bbb5  
    1414- tropicalLifting will only work with LINUX and if in addition gfan is installed.
    1515@*- drawTropicalCurve and drawTropicalNewtonSubdivision will only display the
    16 @*  tropical curve with LINUX and if in addition latex and kghostview
     16@*  tropical curve with LINUX and if in addition latex and xdg-open
    1717@*  are installed.
    1818@*- For tropicalLifting in the definition of the basering the parameter t
     
    16781678               /tmp/tropicalcurveNUMBER.ps, where NUMBER is a random four
    16791679               digit integer;
    1680                moreover it displays the tropical curve via kghostview;
     1680               moreover it displays the tropical curve via xdg-open;
    16811681               if you wish to remove all these files from /tmp,
    16821682               call the procedure cleanTmp
     
    16851685               if #[1] is the string 'max', then it is computed w.r.t. maximum
    16861686@*           - if the last optional argument is 'onlytexfile' then only the
    1687                latex file is produced; this option should be used if kghostview
     1687               latex file is produced; this option should be used if xdg-utils
    16881688               is not installed on your system
    16891689@*           - note that lattice points in the Newton subdivision which are
     
    17781778\\setlength{\\textwidth}{170mm}
    17791779
     1780\\makeatletter
     1781\\def\\old@comma{,}
     1782\\catcode`\\,=13
     1783\\def,{%
     1784  \\ifmmode%
     1785    \\old@comma\\discretionary{}{}{}%
     1786  \\else%
     1787    \\old@comma%
     1788  \\fi%
     1789\}
     1790\\makeatother
     1791
    17801792\\begin{document}
    17811793   \\parindent0cm
     
    18141826    int rdnum=random(1000,9999);
    18151827    write(":w /tmp/tropicalcurve"+string(rdnum)+".tex",TEXBILD);
    1816     system("sh","cd /tmp; latex /tmp/tropicalcurve"+string(rdnum)+".tex; dvips /tmp/tropicalcurve"+string(rdnum)+".dvi -o; command rm tropicalcurve"+string(rdnum)+".log;  command rm tropicalcurve"+string(rdnum)+".aux;  command rm tropicalcurve"+string(rdnum)+".ps?;  command rm tropicalcurve"+string(rdnum)+".dvi; kghostview tropicalcurve"+string(rdnum)+".ps &");
     1828    system("sh","cd /tmp; latex /tmp/tropicalcurve"+string(rdnum)+".tex; dvips /tmp/tropicalcurve"+string(rdnum)+".dvi -o; command rm tropicalcurve"+string(rdnum)+".log;  command rm tropicalcurve"+string(rdnum)+".aux;  command rm tropicalcurve"+string(rdnum)+".ps?;  command rm tropicalcurve"+string(rdnum)+".dvi; xdg-open tropicalcurve"+string(rdnum)+".ps &");
    18171829  }
    18181830  else
     
    18281840   poly f=t*(x3+y3+1)+1/t*(x2+y2+x+y+x2y+xy2)+1/t2*xy;
    18291841// the command drawTropicalCurve(f) computes the graph of the tropical curve
    1830 // given by f and displays a post script image, provided you have kghostview
     1842// given by f and displays a post script image, provided you have xdg-open
    18311843   drawTropicalCurve(f);
    18321844// we can instead apply the procedure to a tropical polynomial and use "maximum"
     
    18521864            and /tmp/newtonsubdivisionNUMBER.ps, where NUMBER is a random
    18531865            four digit integer;
    1854             moreover it desplays the tropical curve defined by f via kghostview;
     1866            moreover it desplays the tropical curve defined by f via xdg-open;
    18551867            if you wish to remove all these files from /tmp, call the procedure
    18561868            cleanTmp;
     
    19121924  int rdnum=random(1000,9999);
    19131925  write(":w /tmp/newtonsubdivision"+string(rdnum)+".tex",TEXBILD);
    1914   system("sh","cd /tmp; latex /tmp/newtonsubdivision"+string(rdnum)+".tex; dvips /tmp/newtonsubdivision"+string(rdnum)+".dvi -o; command rm newtonsubdivision"+string(rdnum)+".log;  command rm newtonsubdivision"+string(rdnum)+".aux;  command rm newtonsubdivision"+string(rdnum)+".ps?;  command rm newtonsubdivision"+string(rdnum)+".dvi; kghostview newtonsubdivision"+string(rdnum)+".ps &");
     1926  system("sh","cd /tmp; latex /tmp/newtonsubdivision"+string(rdnum)+".tex; dvips /tmp/newtonsubdivision"+string(rdnum)+".dvi -o; command rm newtonsubdivision"+string(rdnum)+".log;  command rm newtonsubdivision"+string(rdnum)+".aux;  command rm newtonsubdivision"+string(rdnum)+".ps?;  command rm newtonsubdivision"+string(rdnum)+".dvi; xdg-open newtonsubdivision"+string(rdnum)+".ps &");
    19151927//  return(TEXBILD);
    19161928}
     
    19221934   poly f=t*(x3+y3+1)+1/t*(x2+y2+x+y+x2y+xy2)+1/t2*xy;
    19231935// the command drawTropicalCurve(f) computes the graph of the tropical curve
    1924 // given by f and displays a post script image, provided you have kghostview
     1936// given by f and displays a post script image, provided you have xdg-open
    19251937   drawNewtonSubdivision(f);
    19261938// we can instead apply the procedure to a tropical polynomial
     
    24792491// conic[8] contains the latex code to draw the tropical conic and
    24802492//          its tropicalised tangents; it can written in a file, processed and
    2481 //          displayed via kghostview
     2493//          displayed via xdg-open
    24822494   write(":w /tmp/conic.tex",conic[8]);
    24832495   system("sh","cd /tmp; latex /tmp/conic.tex; dvips /tmp/conic.dvi -o;
    2484             kghostview conic.ps &");
     2496            xdg-open conic.ps &");
    24852497// with an optional argument the same information for the dual conic is computed
    24862498//         and saved in conic[9]
     
    81918203               /tmp/tropicalcurveNUMBER.ps, where NUMBER is a random four
    81928204               digit integer;
    8193                moreover it displays the tropical curve via kghostview;
     8205               moreover it displays the tropical curve via xdg-open;
    81948206               if you wish to remove all these files from /tmp,
    81958207               call the procedure cleanTmp
     
    81988210               if #[1] is the string 'max', then it is computed w.r.t. maximum
    81998211@*           - if the last optional argument is 'onlytexfile' then only the
    8200                latex file is produced; this option should be used if kghostview
     8212               latex file is produced; this option should be used if xdg-open
    82018213               is not installed on your system
    82028214@*           - note that lattice points in the Newton subdivision which are
     
    84308442    int rdnum=random(1000,9999);
    84318443    write(":w /tmp/tropicalcurve"+string(rdnum)+".tex",TEXBILD);
    8432     system("sh","cd /tmp; latex /tmp/tropicalcurve"+string(rdnum)+".tex; dvips /tmp/tropicalcurve"+string(rdnum)+".dvi -o; command rm tropicalcurve"+string(rdnum)+".log;  command rm tropicalcurve"+string(rdnum)+".aux;  command rm tropicalcurve"+string(rdnum)+".ps?;  command rm tropicalcurve"+string(rdnum)+".dvi; kghostview tropicalcurve"+string(rdnum)+".ps &");
     8444    system("sh","cd /tmp; latex /tmp/tropicalcurve"+string(rdnum)+".tex; dvips /tmp/tropicalcurve"+string(rdnum)+".dvi -o; command rm tropicalcurve"+string(rdnum)+".log;  command rm tropicalcurve"+string(rdnum)+".aux;  command rm tropicalcurve"+string(rdnum)+".ps?;  command rm tropicalcurve"+string(rdnum)+".dvi; xdg-open tropicalcurve"+string(rdnum)+".ps &");
    84338445  }
    84348446  else
     
    84458457   poly f=x+y+1;
    84468458// the command drawTropicalCurve(f) computes the graph of the tropical curve
    8447 // given by f and displays a post script image, provided you have kghostview
     8459// given by f and displays a post script image, provided you have xdg-open
    84488460// we can instead apply the procedure to a tropical polynomial and use "maximum"
    84498461   poly g=t3*(x7+y7+1)+1/t3*(x4+y4+x2+y2+x3y+xy3)+1/t21*x2y2;
  • Singular/extra.cc

    rd29e550 ra5bbb5  
    6161#include <polys/matpol.h>
    6262
    63 // #include <kernel/longalg.h>
    64 #include <polys/prCopy.h>
    6563#include <polys/weight.h>
    6664
  • Singular/iparith.cc

    rd29e550 ra5bbb5  
    2424#include <misc/prime.h>
    2525
    26 #include <polys/prCopy.h>
    2726#include <polys/matpol.h>
    2827#include <polys/monomials/maps.h>
     
    18711870  if (rField_is_Ring(currRing))
    18721871  {
    1873     //ring origR = currRing;
    1874     //ring tempR = rCopy(origR);
    1875     //coeffs new_cf=nInitChar(n_Q,NULL);
    1876     //nKillChar(tempR->cf);
    1877     //tempR->cf=new_cf;
    1878     //rComplete(tempR);
    18791872    ideal vid = (ideal)v->Data();
    18801873    int i = idPosConstant(vid);
     
    18841877      return FALSE;
    18851878    }
    1886     //rChangeCurrRing(tempR);
    1887     //ideal vv = idrCopyR(vid, origR, currRing);
    18881879    ideal vv = id_Copy(vid, currRing);
    1889     //ideal ww = idrCopyR((ideal)w->Data(), origR, currRing);
    18901880    ideal ww = id_Copy((ideal)w->Data(), currRing);
    18911881    /* drop degree zero generator from vv (if any) */
     
    18951885    res->data = (char *)d;
    18961886    idDelete(&vv); idDelete(&ww);
    1897     //rChangeCurrRing(origR);
    1898     //rDelete(tempR);
    18991887    return FALSE;
    19001888  }
     
    23092297  if (rField_is_Ring_Z(currRing))
    23102298  {
    2311     ring origR = currRing;
    2312     ring tempR = rCopy(origR);
    2313     coeffs new_cf=nInitChar(n_Q,NULL);
    2314     nKillChar(tempR->cf);
    2315     tempR->cf=new_cf;
    2316     rComplete(tempR);
    2317     ideal uid = (ideal)u->Data();
    2318     rChangeCurrRing(tempR);
    2319     ideal uu = idrCopyR(uid, origR, currRing);
    2320     sleftv uuAsLeftv; memset(&uuAsLeftv, 0, sizeof(uuAsLeftv));
    2321     uuAsLeftv.rtyp = IDEAL_CMD;
    2322     uuAsLeftv.data = uu; uuAsLeftv.next = NULL;
    2323     if (hasFlag(u, FLAG_STD)) setFlag(&uuAsLeftv,FLAG_STD);
    2324     assumeStdFlag(&uuAsLeftv);
    23252299    PrintS("// NOTE: computation of Hilbert series etc. is being\n");
    23262300    PrintS("//       performed for generic fibre, that is, over Q\n");
    2327     intvec *module_w=(intvec*)atGet(&uuAsLeftv,"isHomog",INTVEC_CMD);
    2328     intvec *iv=hFirstSeries(uu,module_w,currRing->qideal);
    2329     int returnWithTrue = 1;
    2330     switch((int)(long)v->Data())
    2331     {
    2332       case 1:
    2333         res->data=(void *)iv;
    2334         returnWithTrue = 0;
    2335       case 2:
    2336         res->data=(void *)hSecondSeries(iv);
    2337         delete iv;
    2338         returnWithTrue = 0;
    2339     }
    2340     if (returnWithTrue)
    2341     {
    2342       WerrorS(feNotImplemented);
    2343       delete iv;
    2344     }
    2345     idDelete(&uu);
    2346     rChangeCurrRing(origR);
    2347     rDelete(tempR);
    2348     if (returnWithTrue) return TRUE; else return FALSE;
    23492301  }
    23502302#endif
     
    37683720{
    37693721  SPrintStart();
     3722#ifdef HAVE_RINGS
    37703723  if (rField_is_Ring_Z(currRing))
    37713724  {
    3772     ring origR = currRing;
    3773     ring tempR = rCopy(origR);
    3774     coeffs new_cf=nInitChar(n_Q,NULL);
    3775     nKillChar(tempR->cf);
    3776     tempR->cf=new_cf;
    3777     rComplete(tempR);
    3778     ideal vid = (ideal)v->Data();
    3779     rChangeCurrRing(tempR);
    3780     ideal vv = idrCopyR(vid, origR, currRing);
    3781     sleftv vvAsLeftv; memset(&vvAsLeftv, 0, sizeof(vvAsLeftv));
    3782     vvAsLeftv.rtyp = IDEAL_CMD;
    3783     vvAsLeftv.data = vv; vvAsLeftv.next = NULL;
    3784     if (hasFlag(v, FLAG_STD)) setFlag(&vvAsLeftv,FLAG_STD);
    3785     assumeStdFlag(&vvAsLeftv);
    37863725    PrintS("// NOTE: computation of degree is being performed for\n");
    37873726    PrintS("//       generic fibre, that is, over Q\n");
    3788     intvec *module_w=(intvec*)atGet(&vvAsLeftv,"isHomog",INTVEC_CMD);
    3789     scDegree(vv,module_w,currRing->qideal);
    3790     idDelete(&vv);
    3791     rChangeCurrRing(origR);
    3792     rDelete(tempR);
    3793   }
     3727  }
     3728#endif
    37943729  assumeStdFlag(v);
    37953730  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
     
    39183853     Warn("dim(%s) may be wrong because the mixed monomial ordering",v->Name());
    39193854  }
     3855#ifdef HAVE_RINGS
    39203856  if (rField_is_Ring(currRing))
    39213857  {
     
    39823918    return FALSE;
    39833919  }
     3920#endif
    39843921  res->data = (char *)(long)scDimInt((ideal)(v->Data()),currRing->qideal);
    39853922  return FALSE;
     
    41464083static BOOLEAN jjHILBERT(leftv, leftv v)
    41474084{
     4085#ifdef HAVE_RINGS
    41484086  if (rField_is_Ring_Z(currRing))
    41494087  {
    4150     ring origR = currRing;
    4151     ring tempR = rCopy(origR);
    4152     coeffs new_cf=nInitChar(n_Q,NULL);
    4153     nKillChar(tempR->cf);
    4154     tempR->cf=new_cf;
    4155     rComplete(tempR);
    4156     ideal vid = (ideal)v->Data();
    4157     rChangeCurrRing(tempR);
    4158     ideal vv = idrCopyR(vid, origR, currRing);
    4159     sleftv vvAsLeftv; memset(&vvAsLeftv, 0, sizeof(vvAsLeftv));
    4160     vvAsLeftv.rtyp = IDEAL_CMD;
    4161     vvAsLeftv.data = vv; vvAsLeftv.next = NULL;
    4162     if (hasFlag(v, FLAG_STD)) setFlag(&vvAsLeftv,FLAG_STD);
    4163     assumeStdFlag(&vvAsLeftv);
    41644088    PrintS("// NOTE: computation of Hilbert series etc. is being\n");
    41654089    PrintS("//       performed for generic fibre, that is, over Q\n");
    4166     intvec *module_w=(intvec*)atGet(&vvAsLeftv,"isHomog",INTVEC_CMD);
    4167     //scHilbertPoly(vv,currRing->qideal);
    4168     hLookSeries(vv,module_w,currRing->qideal);
    4169     idDelete(&vv);
    4170     rChangeCurrRing(origR);
    4171     rDelete(tempR);
    4172     return FALSE;
    4173   }
     4090  }
     4091#endif
    41744092  assumeStdFlag(v);
    41754093  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
     
    41804098static BOOLEAN jjHILBERT_IV(leftv res, leftv v)
    41814099{
     4100#ifdef HAVE_RINGS
    41824101  if (rField_is_Ring_Z(currRing))
    41834102  {
     
    41854104    PrintS("//       performed for generic fibre, that is, over Q\n");
    41864105  }
     4106#endif
    41874107  res->data=(void *)hSecondSeries((intvec *)v->Data());
    41884108  return FALSE;
     
    42934213{
    42944214  ideal result=kInterRed((ideal)(v->Data()), currRing->qideal);
     4215#ifdef HAVE_RINGS
    42954216  if(rField_is_Ring(currRing))
    4296     Warn("interred: this command is experimental over the integers");
     4217    WarnS("interred: this command is experimental over the integers");
     4218#endif
    42974219  if (TEST_OPT_PROT) { PrintLn(); mflush(); }
    42984220  res->data = result;
     
    57825704    return TRUE;
    57835705  }
     5706#ifdef HAVE_RINGS
    57845707  if (rField_is_Ring_Z(currRing))
    57855708  {
    5786     ring origR = currRing;
    5787     ring tempR = rCopy(origR);
    5788     coeffs new_cf=nInitChar(n_Q,NULL);
    5789     nKillChar(tempR->cf);
    5790     tempR->cf=new_cf;
    5791     rComplete(tempR);
    5792     ideal uid = (ideal)u->Data();
    5793     rChangeCurrRing(tempR);
    5794     ideal uu = idrCopyR(uid, origR, currRing);
    5795     sleftv uuAsLeftv; memset(&uuAsLeftv, 0, sizeof(uuAsLeftv));
    5796     uuAsLeftv.rtyp = IDEAL_CMD;
    5797     uuAsLeftv.data = uu; uuAsLeftv.next = NULL;
    5798     if (hasFlag(u, FLAG_STD)) setFlag(&uuAsLeftv,FLAG_STD);
    5799     assumeStdFlag(&uuAsLeftv);
    58005709    PrintS("// NOTE: computation of Hilbert series etc. is being\n");
    58015710    PrintS("//       performed for generic fibre, that is, over Q\n");
    5802     intvec *module_w=(intvec*)atGet(&uuAsLeftv,"isHomog",INTVEC_CMD);
    5803     intvec *iv=hFirstSeries(uu,module_w,currRing->qideal,wdegree);
    5804     int returnWithTrue = 1;
    5805     switch((int)(long)v->Data())
    5806     {
    5807       case 1:
    5808         res->data=(void *)iv;
    5809         returnWithTrue = 0;
    5810       case 2:
    5811         res->data=(void *)hSecondSeries(iv);
    5812         delete iv;
    5813         returnWithTrue = 0;
    5814     }
    5815     if (returnWithTrue)
    5816     {
    5817       WerrorS(feNotImplemented);
    5818       delete iv;
    5819     }
    5820     idDelete(&uu);
    5821     rChangeCurrRing(origR);
    5822     rDelete(tempR);
    5823     if (returnWithTrue) return TRUE; else return FALSE;
    5824   }
     5711  }
     5712#endif
    58255713  assumeStdFlag(u);
    58265714  intvec *module_w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
     
    58365724      return FALSE;
    58375725  }
     5726  delete iv;
    58385727  WerrorS(feNotImplemented);
    5839   delete iv;
    58405728  return TRUE;
    58415729}
     
    59235811                               (matrix)v->CopyD());
    59245812  return FALSE;
    5925 }
    5926 static BOOLEAN currRingIsOverIntegralDomain ()
    5927 {
    5928   /* true for fields and Z, false otherwise */
    5929   if (rField_is_Ring_PtoM(currRing)) return FALSE;
    5930   if (rField_is_Ring_2toM(currRing)) return FALSE;
    5931   if (rField_is_Ring_ModN(currRing)) return FALSE;
    5932   return TRUE;
    59335813}
    59345814static BOOLEAN jjMINOR_M(leftv res, leftv v)
     
    60945974  }
    60955975  if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") == 0)
    6096       && (!currRingIsOverIntegralDomain()))
     5976      && (!rField_is_Domain(currRing)))
    60975977  {
    60985978    Werror("Bareiss algorithm not defined over coefficient rings %s",
     
    91619041  }
    91629042  #endif
     9043#ifdef HAVE_RINGS
    91639044  if (rField_is_Ring(currRing))
    91649045  {
     
    91819062    }
    91829063  }
     9064#endif
    91839065  return FALSE;
    91849066}
  • factory/configure.ac

    rd29e550 ra5bbb5  
    1313# - initialisation.
    1414#
    15 AC_INIT([factory], [4.0.3])
     15AC_INIT([factory], [4.1.0])
    1616AC_CONFIG_SRCDIR(canonicalform.cc)
    1717AC_CONFIG_MACRO_DIR([../m4])
Note: See TracChangeset for help on using the changeset viewer.