Changeset d5122e in git
- Timestamp:
- Oct 5, 2016, 5:36:44 PM (8 years ago)
- 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
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/surfacesignature.lib
r09cb63f rd5122e 334 334 { 335 335 number a,b; 336 int r;336 bigint r; 337 337 a = numerator(n); 338 338 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); 341 341 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); 345 345 return(n2); 346 346 } -
Singular/LIB/tropical.lib
r65d683 rd5122e 4727 4727 // which in a later version 4728 4728 // 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]; 4730 4730 setring PREGFANRING; 4731 4731 } … … 5450 5450 ///////////////////////////////////////////////////////////////////////// 5451 5451 5452 static proc choosegfanvector (string s,int findall,int anzahlvariablen)5453 "USAGE: choosegfanvector(s ); s string5452 static proc choosegfanvector (string s,int findall,int homogentest) 5453 "USAGE: choosegfanvector(s,fa,h); s string, fa,h int 5454 5454 RETURN: list, the jth entry is the jth integer vector contained in s 5455 5455 NOTE: the procedure is called from tropicalparametrise" … … 5467 5467 // the last entry in ww should correspond to the homogenisation variable 5468 5468 // (and can be omitted), unless the input to gfan was already homogeneous 5469 if ( anzahlvariablen==size(ww)-1)5469 if (homogentest==0) 5470 5470 { 5471 5471 ww=ww[1..size(ww)-1]; … … 5497 5497 { 5498 5498 execute("www=intvec("+w+");"); 5499 if ( anzahlvariablen==size(ww)-1)5499 if (homogentest==0) 5500 5500 { 5501 5501 ww[i]=intvec(www[1..size(www)-1]); … … 5667 5667 int numberdeletedvariables; // the number of deleted variables 5668 5668 int oldanzahlvariablen=anzahlvariablen; // anzahlvariablen for later reference 5669 int homogentest=0; 5669 5670 list liftings,partliftings; // the computed liftings (all resp. partly) 5670 5671 // consider each ring which has been returned when computing the zeros of the … … 5718 5719 // it suffices to homogenise an arbitrary system of generators 5719 5720 // II=groebner(II); 5721 homogentest=homog(II); 5720 5722 II=homog(II,maxideal(1)[nvars(PREGFANRING)+1]); 5721 5723 // if gfan version >= 0.3.0 is used and the characteristic … … 5785 5787 // which in a later version 5786 5788 // should be interpreded by Singular 5787 wneulist=choosegfanvector(read("/tmp/gfanoutput"),findall, anzahlvariablen);5789 wneulist=choosegfanvector(read("/tmp/gfanoutput"),findall,homogentest); 5788 5790 setring PREGFANRING; 5789 5791 } -
Singular/subexpr.cc
r09cb63f rd5122e 235 235 break; 236 236 } 237 case NUMBER_CMD:238 237 case BIGINT_CMD: 239 if (t==NUMBER_CMD)240 {241 number n=(number)d;242 nNormalize(n);243 d=n;244 }245 238 s=String(d); 246 239 if (s==NULL) return; … … 249 242 omFree((ADDRESS)s); 250 243 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 } 251 260 case LIST_CMD: 252 261 { … … 822 831 case NUMBER_CMD: 823 832 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))) 835 834 { 836 835 nfShowMipo(currRing->cf); … … 838 837 else 839 838 { 840 number n=nCopy((number)d); 841 nWrite(n); 842 nDelete(&n); 839 nWrite((number)d); 843 840 } 844 841 StringAppendS((char*) (typed ? ")" : "")); -
Tst/Short/ok_s.lst
r09cb63f rd5122e 5 5 bug_minpoly 6 6 bug_newstruct 7 bug_normalize 7 8 bug_qring2 8 9 bug_ring -
libpolys/coeffs/coeffs.h
r09cb63f rd5122e 585 585 /// write to the output buffer of the currently used reporter 586 586 //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)587 static FORCE_INLINE void n_WriteLong(number n, const coeffs r) 588 588 { STATISTIC(n_WriteLong); assume(r != NULL); assume(r->cfWriteLong!=NULL); r->cfWriteLong(n,r); } 589 589 590 590 /// write to the output buffer of the currently used reporter 591 591 /// 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)592 static FORCE_INLINE void n_WriteShort(number n, const coeffs r) 593 593 { STATISTIC(n_WriteShort); assume(r != NULL); assume(r->cfWriteShort!=NULL); r->cfWriteShort(n,r); } 594 594 595 static FORCE_INLINE void n_Write(number &n, const coeffs r, const BOOLEAN bShortOut = TRUE)595 static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut = TRUE) 596 596 { STATISTIC(n_Write); if (bShortOut) n_WriteShort(n, r); else n_WriteLong(n, r); } 597 597 -
libpolys/coeffs/longrat.cc
r09cb63f rd5122e 1705 1705 } 1706 1706 mpz_init_set(u->n,b->n); 1707 u->s = 0; 1707 1708 if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); } 1708 else u->s = 0;1709 1709 break; 1710 1710 } … … 1756 1756 return INT_TO_SR(1); 1757 1757 } 1758 u->s = 0; 1758 1759 if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); } 1759 else u->s = 0;1760 1760 break; 1761 1761 } … … 1777 1777 } 1778 1778 mpz_init_set(u->n,a->n); 1779 u->s = 0; 1779 1780 if (GCD_NORM_COND(a,u)) { nlNormalize_Gcd(u); } 1780 else u->s = 0;1781 1781 break; 1782 1782 } … … 1806 1806 } 1807 1807 mpz_init_set(u->n,b->n); 1808 u->s = 0; 1808 1809 if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); } 1809 else u->s = 0;1810 1810 break; 1811 1811 } … … 1875 1875 // result cannot be 0, if coeffs are normalized 1876 1876 mpz_init_set(u->n,b->n); 1877 u->s=0; 1877 1878 if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); } 1878 else { u ->s = 0; u=nlShort1(u); }1879 else { u=nlShort1(u); } 1879 1880 break; 1880 1881 } … … 1915 1916 mpz_clear(y); 1916 1917 mpz_mul(a->n,a->n,b->n); 1918 a->s=0; 1917 1919 if (GCD_NORM_COND(b,a)) { nlNormalize_Gcd(a); } 1918 else { a ->s = 0;a=nlShort1(a);}1920 else { a=nlShort1(a);} 1919 1921 break; 1920 1922 } … … 1926 1928 mpz_add(a->z,a->z,x); 1927 1929 mpz_clear(x); 1930 a->s=0; 1928 1931 if (GCD_NORM_COND(b,a)) { nlNormalize_Gcd(a); } 1929 else { a ->s = 0; a=nlShort1(a);}1932 else { a=nlShort1(a);} 1930 1933 break; 1931 1934 } … … 1946 1949 mpz_clear(x); 1947 1950 mpz_init_set(a->n,b->n); 1951 a->s=0; 1948 1952 if (GCD_NORM_COND(b,a)) { nlNormalize_Gcd(a); } 1949 else { a ->s = 0; a=nlShort1(a);}1953 else { a=nlShort1(a);} 1950 1954 break; 1951 1955 } … … 1996 2000 } 1997 2001 mpz_init_set(u->n,b->n); 2002 u->s=0; 1998 2003 if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); } 1999 else u->s = 0;2000 2004 break; 2001 2005 } … … 2043 2047 } 2044 2048 mpz_init_set(u->n,a->n); 2049 u->s=0; 2045 2050 if (GCD_NORM_COND(a,u)) { nlNormalize_Gcd(u); } 2046 else u->s = 0;2047 2051 break; 2048 2052 } … … 2099 2103 return INT_TO_SR(1); 2100 2104 } 2105 u->s=0; 2101 2106 if (GCD_NORM_COND(a,u)) { nlNormalize_Gcd(u); } 2102 else u->s = 0;2103 2107 break; 2104 2108 } … … 2123 2127 } 2124 2128 mpz_init_set(u->n,a->n); 2129 u->s=0; 2125 2130 if (GCD_NORM_COND(a,u)) { nlNormalize_Gcd(u); } 2126 else u->s = 0;2127 2131 break; 2128 2132 } … … 2155 2159 } 2156 2160 mpz_init_set(u->n,b->n); 2161 u->s=0; 2157 2162 if (GCD_NORM_COND(b,u)) { nlNormalize_Gcd(u); } 2158 else u->s = 0;2159 2163 break; 2160 2164 } -
libpolys/coeffs/longrat0.cc
r09cb63f rd5122e 127 127 else 128 128 { 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 }135 129 int l=mpz_sizeinbase(a->z,10); 136 130 if (a->s<2) l=si_max(l,(int)mpz_sizeinbase(a->n,10)); … … 149 143 } 150 144 145 #if 0 146 void 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 151 175 -
libpolys/reporter/reporter.cc
r09cb63f rd5122e 159 159 if (strlen(r)<1024) 160 160 { 161 // if the used buffer is a "smal block",161 // if the used buffer is a "small block", 162 162 // substitue the "large" initial block by a small one 163 163 char *s=omStrDup(r); omFree(r); r=s; -
omalloc/omBinPage.h
r09cb63f rd5122e 65 65 66 66 67 #if defined(OM_INLINE) || defined(OM_INTERNAL_DEBUG)67 #if !defined(OM_INLINE) || defined(OM_INTERNAL_DEBUG) 68 68 #define omIsBinPageAddr(addr) _omIsBinPageAddr(addr) 69 69 #else
Note: See TracChangeset
for help on using the changeset viewer.