Changeset d5122e in git


Ignore:
Timestamp:
Oct 5, 2016, 5:36:44 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
Children:
4aaf5920e25e841ccd0432b72d165b4d869a69bcd5cda0dfd81e6ccd6676b5a7762d696d084d9dad
Parents:
65d6837cb0e0c17ca95e439bb49e5ed0e7fc2e9309cb63f3434835f3538f07adbf3c476e26186d46
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2016-10-05 17:36:44+02:00
git-committer:
GitHub <noreply@github.com>2016-10-05 17:36:44+02:00
Message:
Merge pull request #797 from markwig/spielwiese

choosegfanvector: Fehler beim Erkennen der Homogenitaet korrigiert
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/surfacesignature.lib

    r09cb63f rd5122e  
    334334{
    335335   number a,b;
    336    int r;
     336   bigint r;
    337337   a = numerator(n);
    338338   b = denominator(n);
    339    int z = int(number(a));
    340    int y = int(number(b));
     339   bigint z = bigint(a);
     340   bigint y = bigint(b);
    341341   r = z mod y;
    342    int q = (z-r) div y;
    343    number n1 = q;
    344    number n2 = n-n1;
     342   bigint q = (z-r) div y;
     343   number n1 = number(q);
     344   number n2 = number(n-n1);
    345345   return(n2);
    346346}
  • Singular/LIB/tropical.lib

    r65d683 rd5122e  
    47274727        // which in a later version
    47284728        // should be interpreded by Singular
    4729         intvec wneu=choosegfanvector(read("/tmp/gfanoutput"),0,anzahlvariablen)[1];
     4729        intvec wneu=choosegfanvector(read("/tmp/gfanoutput"),0,homogentest)[1];
    47304730        setring PREGFANRING;
    47314731      }
     
    54505450/////////////////////////////////////////////////////////////////////////
    54515451
    5452 static proc choosegfanvector (string s,int findall,int anzahlvariablen)
    5453 "USAGE:   choosegfanvector(s); s string
     5452static proc choosegfanvector (string s,int findall,int homogentest)
     5453"USAGE:   choosegfanvector(s,fa,h); s string, fa,h int
    54545454RETURN:   list, the jth entry is the jth integer vector contained in s
    54555455NOTE:     the procedure is called from tropicalparametrise"
     
    54675467    // the last entry in ww should correspond to the homogenisation variable
    54685468    // (and can be omitted), unless the input to gfan was already homogeneous
    5469     if (anzahlvariablen==size(ww)-1)
     5469    if (homogentest==0)
    54705470    {
    54715471      ww=ww[1..size(ww)-1];
     
    54975497      {
    54985498        execute("www=intvec("+w+");");
    5499         if (anzahlvariablen==size(ww)-1)
     5499        if (homogentest==0)
    55005500        {
    55015501          ww[i]=intvec(www[1..size(www)-1]);
     
    56675667  int numberdeletedvariables;  // the number of deleted variables
    56685668  int oldanzahlvariablen=anzahlvariablen; // anzahlvariablen for later reference
     5669  int homogentest=0;
    56695670  list liftings,partliftings;  // the computed liftings (all resp. partly)
    56705671  // consider each ring which has been returned when computing the zeros of the
     
    57185719          // it suffices to homogenise an arbitrary system of generators
    57195720          // II=groebner(II);
     5721          homogentest=homog(II);
    57205722          II=homog(II,maxideal(1)[nvars(PREGFANRING)+1]);
    57215723          // if gfan version >= 0.3.0 is used and the characteristic
     
    57855787            // which in a later version
    57865788            // should be interpreded by Singular
    5787             wneulist=choosegfanvector(read("/tmp/gfanoutput"),findall,anzahlvariablen);
     5789            wneulist=choosegfanvector(read("/tmp/gfanoutput"),findall,homogentest);
    57885790            setring PREGFANRING;
    57895791          }
  • Singular/subexpr.cc

    r09cb63f rd5122e  
    235235          break;
    236236          }
    237         case NUMBER_CMD:
    238237        case BIGINT_CMD:
    239           if (t==NUMBER_CMD)
    240           {
    241             number n=(number)d;
    242             nNormalize(n);
    243             d=n;
    244           }
    245238          s=String(d);
    246239          if (s==NULL) return;
     
    249242          omFree((ADDRESS)s);
    250243          break;
     244        case NUMBER_CMD:
     245          {
     246            number n=(number)d;
     247            nNormalize(n);
     248            if ((number)d !=n)
     249            {
     250              d=n;
     251              if (rtyp==IDHDL) IDNUMBER(((idhdl)data))=n;
     252              else if(rtyp==NUMBER_CMD) data=(void*)n;
     253            }
     254            s=String(d);
     255            if (s==NULL) return;
     256            PrintS(s);
     257            omFree((ADDRESS)s);
     258            break;
     259          }
    251260        case LIST_CMD:
    252261        {
     
    822831        case NUMBER_CMD:
    823832          StringSetS((char*) (typed ? "number(" : ""));
    824           if ((rtyp==IDHDL)&&(IDTYP((idhdl)data)==NUMBER_CMD))
    825           {
    826             nWrite(IDNUMBER((idhdl)data));
    827           }
    828           else if (rtyp==NUMBER_CMD)
    829           {
    830             number n=(number)data;
    831             nWrite(n);
    832             data=(char *)n;
    833           }
    834           else if((rtyp==VMINPOLY)&&(rField_is_GF(currRing)))
     833          if((rtyp==VMINPOLY)&&(rField_is_GF(currRing)))
    835834          {
    836835            nfShowMipo(currRing->cf);
     
    838837          else
    839838          {
    840             number n=nCopy((number)d);
    841             nWrite(n);
    842             nDelete(&n);
     839            nWrite((number)d);
    843840          }
    844841          StringAppendS((char*) (typed ? ")" : ""));
  • Tst/Short/ok_s.lst

    r09cb63f rd5122e  
    55bug_minpoly
    66bug_newstruct
     7bug_normalize
    78bug_qring2
    89bug_ring
  • libpolys/coeffs/coeffs.h

    r09cb63f rd5122e  
    585585/// write to the output buffer of the currently used reporter
    586586//CF: the "&" should be removed, as one wants to write constants as well
    587 static FORCE_INLINE void   n_WriteLong(number& n,  const coeffs r)
     587static FORCE_INLINE void   n_WriteLong(number n,  const coeffs r)
    588588{ STATISTIC(n_WriteLong); assume(r != NULL); assume(r->cfWriteLong!=NULL); r->cfWriteLong(n,r); }
    589589
    590590/// write to the output buffer of the currently used reporter
    591591/// in a shortest possible way, e.g. in K(a): a2 instead of a^2
    592 static FORCE_INLINE void   n_WriteShort(number& n,  const coeffs r)
     592static FORCE_INLINE void   n_WriteShort(number n,  const coeffs r)
    593593{ STATISTIC(n_WriteShort); assume(r != NULL); assume(r->cfWriteShort!=NULL); r->cfWriteShort(n,r); }
    594594
    595 static FORCE_INLINE void   n_Write(number& n,  const coeffs r, const BOOLEAN bShortOut = TRUE)
     595static FORCE_INLINE void   n_Write(number n,  const coeffs r, const BOOLEAN bShortOut = TRUE)
    596596{ STATISTIC(n_Write); if (bShortOut) n_WriteShort(n, r); else n_WriteLong(n, r); }
    597597
  • libpolys/coeffs/longrat.cc

    r09cb63f rd5122e  
    17051705        }
    17061706        mpz_init_set(u->n,b->n);
     1707        u->s = 0;
    17071708        if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); }
    1708         else u->s = 0;
    17091709        break;
    17101710      }
     
    17561756               return INT_TO_SR(1);
    17571757            }
     1758            u->s = 0;
    17581759            if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); }
    1759             else u->s = 0;
    17601760            break;
    17611761          }
     
    17771777            }
    17781778            mpz_init_set(u->n,a->n);
     1779            u->s = 0;
    17791780            if (GCD_NORM_COND(a,u)) { nlNormalize_Gcd(u); }
    1780             else u->s = 0;
    17811781            break;
    17821782          }
     
    18061806            }
    18071807            mpz_init_set(u->n,b->n);
     1808            u->s = 0;
    18081809            if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); }
    1809             else u->s = 0;
    18101810            break;
    18111811          }
     
    18751875        // result cannot be 0, if coeffs are normalized
    18761876        mpz_init_set(u->n,b->n);
     1877        u->s=0;
    18771878        if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); }
    1878         else { u->s = 0; u=nlShort1(u); }
     1879        else { u=nlShort1(u); }
    18791880        break;
    18801881      }
     
    19151916            mpz_clear(y);
    19161917            mpz_mul(a->n,a->n,b->n);
     1918            a->s=0;
    19171919            if (GCD_NORM_COND(b,a)) { nlNormalize_Gcd(a); }
    1918             else { a->s = 0;a=nlShort1(a);}
     1920            else { a=nlShort1(a);}
    19191921            break;
    19201922          }
     
    19261928            mpz_add(a->z,a->z,x);
    19271929            mpz_clear(x);
     1930            a->s=0;
    19281931            if (GCD_NORM_COND(b,a)) { nlNormalize_Gcd(a); }
    1929             else { a->s = 0; a=nlShort1(a);}
     1932            else { a=nlShort1(a);}
    19301933            break;
    19311934          }
     
    19461949            mpz_clear(x);
    19471950            mpz_init_set(a->n,b->n);
     1951            a->s=0;
    19481952            if (GCD_NORM_COND(b,a)) { nlNormalize_Gcd(a); }
    1949             else { a->s = 0; a=nlShort1(a);}
     1953            else { a=nlShort1(a);}
    19501954            break;
    19511955          }
     
    19962000        }
    19972001        mpz_init_set(u->n,b->n);
     2002        u->s=0;
    19982003        if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); }
    1999         else u->s = 0;
    20002004        break;
    20012005      }
     
    20432047        }
    20442048        mpz_init_set(u->n,a->n);
     2049        u->s=0;
    20452050        if (GCD_NORM_COND(a,u)) { nlNormalize_Gcd(u); }
    2046         else u->s = 0;
    20472051        break;
    20482052      }
     
    20992103              return INT_TO_SR(1);
    21002104            }
     2105            u->s=0;
    21012106            if (GCD_NORM_COND(a,u)) { nlNormalize_Gcd(u); }
    2102             else u->s = 0;
    21032107            break;
    21042108          }
     
    21232127            }
    21242128            mpz_init_set(u->n,a->n);
     2129            u->s=0;
    21252130            if (GCD_NORM_COND(a,u)) { nlNormalize_Gcd(u); }
    2126             else u->s = 0;
    21272131            break;
    21282132          }
     
    21552159            }
    21562160            mpz_init_set(u->n,b->n);
     2161            u->s=0;
    21572162            if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); }
    2158             else u->s = 0;
    21592163            break;
    21602164          }
  • libpolys/coeffs/longrat0.cc

    r09cb63f rd5122e  
    127127  else
    128128  {
    129     if (a->s==0)
    130     {
    131       nlNormalize(a,r); // FIXME? TODO? // extern void     nlNormalize(number &x, const coeffs r);
    132       nlWrite(a,r);
    133       return;
    134     }
    135129    int l=mpz_sizeinbase(a->z,10);
    136130    if (a->s<2) l=si_max(l,(int)mpz_sizeinbase(a->n,10));
     
    149143}
    150144
     145#if 0
     146void nlDebugWrite (number a)
     147{
     148  char *s,*z;
     149  if (SR_HDL(a) & SR_INT)
     150  {
     151    Print("%ld",SR_TO_INT(a));
     152  }
     153  else if (a==NULL)
     154  {
     155    PrintS("o");
     156  }
     157  else
     158  {
     159    int l=mpz_sizeinbase(a->z,10);
     160    if (a->s<2) l=si_max(l,(int)mpz_sizeinbase(a->n,10));
     161    l+=2;
     162    s=(char*)omAlloc(l);
     163    z=mpz_get_str(s,10,a->z);
     164    PrintS(z);
     165    if (a->s!=3)
     166    {
     167      PrintS("/");
     168      z=mpz_get_str(s,10,a->n);
     169      PrintS(z);
     170    }
     171    omFreeSize((void *)s,l);
     172  }
     173}
     174#endif
    151175
  • libpolys/reporter/reporter.cc

    r09cb63f rd5122e  
    159159  if (strlen(r)<1024)
    160160  {
    161     // if the used buffer is a "smal block",
     161    // if the used buffer is a "small block",
    162162    // substitue the "large" initial block by a small one
    163163    char *s=omStrDup(r); omFree(r); r=s;
  • omalloc/omBinPage.h

    r09cb63f rd5122e  
    6565
    6666
    67 #if defined(OM_INLINE) || defined(OM_INTERNAL_DEBUG)
     67#if !defined(OM_INLINE) || defined(OM_INTERNAL_DEBUG)
    6868#define omIsBinPageAddr(addr) _omIsBinPageAddr(addr)
    6969#else
Note: See TracChangeset for help on using the changeset viewer.