Changeset 2f436b in git
- Timestamp:
- Dec 31, 2000, 4:14:47 PM (22 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
- Children:
- e609098c45a74ac91c002ffa7ece5eebe7f8c002
- Parents:
- 33ec1145a109507ad3e3cf4a69a847b703358e93
- Location:
- Singular
- Files:
-
- 2 added
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/general.lib
r33ec11 r2f436b 2 2 //anne, added deleteSublist and watchdog 12.12.2000 3 3 /////////////////////////////////////////////////////////////////////////////// 4 version="$Id: general.lib,v 1.3 3 2000-12-30 03:00:57 greuelExp $";4 version="$Id: general.lib,v 1.34 2000-12-31 15:14:46 obachman Exp $"; 5 5 category="General purpose"; 6 6 info=" … … 271 271 EXAMPLE: example factorial; shows an example 272 272 " 273 { int str,l,p;273 { int l,p; 274 274 //---------------------------- initialization ------------------------------- 275 275 if ( size(#) == 0 ) 276 { str = 1;276 { 277 277 ring bin = 0,x,dp; 278 278 number r=1; … … 284 284 { 285 285 if ( p == char(basering) ) 286 { number r=1; 286 { 287 // do it clever ! 288 if (n < 1) {return (0);} 289 if (! defined(sv_factorials)) 290 { 291 ideal sv_factorials; 292 sv_factorials[1] = 1; 293 export(sv_factorials); 294 } 295 if (n > size(sv_factorials)) 296 { 297 int i = size(sv_factorials); 298 sv_factorials[n] = 0; 299 number fi = number(sv_factorials[i]); 300 for (i++;i<=n;i++) 301 { 302 fi = fi * i; 303 sv_factorials[i] = fi; 304 } 305 return (fi); 306 } 307 else 308 { 309 return (number(sv_factorials[n])); 310 } 287 311 } 288 312 else 289 { str = 1;313 { 290 314 ring bin = p,x,dp; 291 315 number r=1; … … 293 317 } 294 318 else 295 { str = 1;319 { 296 320 ring bin = p,x,dp; 297 321 number r=1; … … 303 327 r=r*l; 304 328 } 305 if ( str==1 ) { return(string(r)); } 306 else { return(r); } 329 return(string(r)); 307 330 } 308 331 example … … 313 336 p; 314 337 } 338 339 315 340 /////////////////////////////////////////////////////////////////////////////// 316 341 -
Singular/LIB/poly.lib
r33ec11 r2f436b 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: poly.lib,v 1.3 0 2000-12-31 01:55:11 greuelExp $";2 version="$Id: poly.lib,v 1.31 2000-12-31 15:14:47 obachman Exp $"; 3 3 category="General purpose"; 4 4 info=" … … 752 752 { 753 753 poly p = cleardenom(n+var(1)); 754 return ( coeffs(p,var(1))[1,1]);754 return (number(coeffs(p,var(1))[1,1])); 755 755 } 756 756 example … … 771 771 { 772 772 poly p = cleardenom(n+var(1)); 773 return ( coeffs(p,var(1))[2,1]);773 return (number(coeffs(p,var(1))[2,1])); 774 774 } 775 775 example -
Singular/LIB/tst.lib
r33ec11 r2f436b 1 // $Id: tst.lib,v 1.3 0 2000-12-22 15:05:57 greuelExp $1 // $Id: tst.lib,v 1.31 2000-12-31 15:14:47 obachman Exp $ 2 2 //(obachman, last modified 6/30/98) 3 3 ///////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: tst.lib,v 1.3 0 2000-12-22 15:05:57 greuelExp $";5 version="$Id: tst.lib,v 1.31 2000-12-31 15:14:47 obachman Exp $"; 6 6 category="Utilities"; 7 7 info=" … … 14 14 tst_init() writes some identification data to GetTstStatusFile() 15 15 tst_status([any]) writes status info to to GetTstStatusFile() 16 tst_InitTimer() initialize tst-Timer 17 tst_StopTimer() stop Tst-Timer 18 tst_GetTimer get value of Tst-Timer 19 tst_ReportTimer report value of Tst-Timer 16 20 tst_groebnerTest(ideal i) 17 21 tests groebner command … … 186 190 187 191 proc tst_status (list #) 188 "USAGE: tst_status([any]) 189 RETURN: none; writes to stdout the current memory usage and used time 190 since last call to tst_status(), if no argument is given, or, 191 since start-up of Singular, if an argument is given. 192 "USAGE: tst_status([prefix [, start_up]]) 193 prefix -- string 194 start_up -- int 195 RETURN: none 196 PURPOSE: writes to tst-output the current memory usage and used CPU time. 197 If no integer argument is given, the elapsed CPU time since 198 the last call to tst_status() is reported. 199 If an integer argument is given, the elapsed CPU time since the 200 start-up of Singular is reported. 201 If prefix is given, output reported start with prefix. 192 202 NOTE: Should be used regularly within tst files to enable automatic 193 203 tracking of memory and time performance. 194 204 EXAMPLE: example tst_status; shows example 205 SEE ALSO: tst_init 195 206 " 196 207 { 208 int start_up; 209 210 if (size(#) > 0) 211 { 212 if (typeof(#[1]) == "string") 213 { 214 string prefix = #[1]; 215 if (size(#) > 1) 216 { 217 start_up = 1; 218 } 219 } 220 else 221 { 222 start_up = 1; 223 } 224 } 197 225 if (! defined(tst_no_status)) 198 226 { … … 207 235 } 208 236 209 tst_status_out(tst_status_counter, "tst_memory_0", memory(0)); 210 tst_status_out(tst_status_counter, "tst_memory_1", memory(1)); 211 tst_status_out(tst_status_counter, "tst_memory_2", memory(2)); 212 if (size(#) > 0) 213 { 214 tst_status_out(tst_status_counter, "tst_timer_1", timer); 237 if (!defined(prefix)) 238 { 239 def prefix = tst_status_counter; 240 } 241 tst_status_out(prefix, "tst_memory_0", memory(0)); 242 tst_status_out(prefix, "tst_memory_1", memory(1)); 243 tst_status_out(prefix, "tst_memory_2", memory(2)); 244 if (start_up > 0) 245 { 246 tst_status_out(prefix, "tst_timer_1", timer); 215 247 } 216 248 else 217 249 { 218 tst_status_out( tst_status_counter, "tst_timer", timer - Get_tst_timer());250 tst_status_out(prefix, "tst_timer", timer - Get_tst_timer()); 219 251 Set_tst_timer(timer); 220 252 } … … 232 264 233 265 234 proc tst_init() 235 "USAGE: tst_init() 236 RETURN: none; writes some identification data to stdout; 237 should be called as first routine in a tst file 266 proc tst_init(list #) 267 "USAGE: tst_init([file]) 268 file -- string 269 RETURN: none 270 PURPOSE: initializes further calls to tst routines: 271 If no arguments are given, and if tst_status_file is not defined, 272 then tst-output is written to stdout, else tst-output is written 273 to file. 238 274 EXAMPLE: example tst_init; shows example 239 275 " … … 241 277 if (! defined(tst_no_status)) 242 278 { 243 write(":w " + GetTstStatusFile(), "Status Output of " + GetTstStatusFile()); 279 string outfile = ""; 280 281 if (size(#) > 0) 282 { 283 if (typeof(#[1]) == string) 284 { 285 outfile = #[1]; 286 } 287 } 288 if (!defined(tst_status_file)) 289 { 290 string tst_status_file = outfile; 291 export tst_status_file; 292 } 293 if (GetTstStatusFile() != "") 294 { 295 write(":w " + GetTstStatusFile(), "Status Output of " + GetTstStatusFile()); 296 } 244 297 tst_status_out("init", "USER :" + system("getenv", "USER")); 245 298 tst_status_out("init", "HOSTNAME:" + tst_system("hostname", 1)); … … 255 308 "EXAMPLE"; echo = 2; 256 309 tst_init(); 310 } 311 312 proc tst_InitTimer(list #) 313 "USAGE: tst_InitTime([ticks_per_second]) 314 ticks_per_second -- int 315 RETURN: none 316 PURPOSE: initializes tst timer for subsequent calls to tst_StopTimer or 317 tst_ReportTimer. 318 If the ticks_per_second argument is given, then the timer resolution 319 is set to this value. Otherwise, the default timer resolution is used. 320 SEE ALSO: tst_StopTimer, tst_GetTimer, tst_ReportTimer 321 " 322 { 323 if (!defined(tst_Timer)) 324 { 325 int tst_Timer; 326 export tst_Timer; 327 } 328 if (size(#) > 0) 329 { 330 if (typeof(#[1]) == "int") 331 { 332 if (#[1] > 0) 333 { 334 system("--ticks-per-sec", #[1]); 335 } 336 else 337 { 338 ERROR("need integer argument > 0"); 339 } 340 } 341 else 342 { 343 ERROR("need integer argument"); 344 } 345 } 346 tst_Timer = timer; 347 } 348 349 proc tst_StopTimer() 350 "USAGE: tst_StopTimer() 351 RETURN: int, timer ticks of elapsed CPU time since last call to tst_InitTimer 352 PUPOSE: stops the timer initialized by previous call to tst_InitTimer 353 SEE ALSO: tst_InitTimer, tst_GetTimer, tst_ReportTimer 354 " 355 { 356 tst_Timer = timer - tst_Timer; 357 return (tst_Timer); 358 } 359 360 proc tst_GetTimer() 361 "USAGE: tst_GetTimer() 362 RETURN: int, timer ticks of elapsed CPU time since last call to tst_Init 363 NOTE: does NOT stop the time initialized by previous call to tst_InitTimer 364 SEE ALSO: tst_InitTimer, tst_GetTimer, tst_ReportTimer 365 " 366 { 367 int tt = timer - tst_Timer; 368 return (tt); 369 } 370 371 proc tst_ReportTimer(list #) 372 "USAGE: tst_ReportTimer([prefix]) 373 RETURN: none 374 PUPOSE: stops the timer initialized by previous call to tst_InitTimer; 375 reports time to tst-output; 376 if prefix is given, timer output is prefixed by it. 377 SEE ALSO: tst_InitTimer, tst_GetTimer, tst_StopTimer, tst_OutTimer, tst_init 378 " 379 { 380 tst_Timer = timer - tst_Timer; 381 tst_OutTimer(tst_Timer, #); 382 } 383 384 proc tst_OutTimer(int tt, list #) 385 "USAGE: tst_OutTimer(ticks [, prefix]) 386 RETURN: none 387 PURPOSE: reports value of tt to tst-output; 388 if prefix is given, timer output is prefixed by it. 389 SEE ALSO: tst_InitTimer, tst_GetTimer, tst_StopTimer, tst_ReportTimer, tst_init 390 " 391 { 392 string prefix = "OutTimer"; 393 394 if (size(#) > 0) 395 { 396 prefix = string(#[1]); 397 } 398 tst_status_out(prefix, "tst-Timer", tt); 257 399 } 258 400 -
Singular/Makefile.in
r33ec11 r2f436b 105 105 GMPrat.cc multicnt.cc npolygon.cc semic.cc spectrum.cc splist.cc \ 106 106 libparse.cc mod_raw.cc \ 107 pcv.cc kbuckets.cc \107 pcv.cc kbuckets.cc sbuckets.cc\ 108 108 mpr_inout.cc mpr_base.cc mpr_numeric.cc \ 109 109 prCopy.cc p_Mult_q.cc \ … … 114 114 MPSR_SOURCES = mpsr_Put.cc mpsr_PutPoly.cc mpsr_GetPoly.cc mpsr_sl.cc\ 115 115 mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \ 116 116 117 117 118 # stuff for dbm … … 146 147 p_Minus_mm_Mult_qq__Template.cc p_Add_q__Template.cc \ 147 148 p_Neg__Template.cc pp_Mult_Coeff_mm_DivSelect__Template.cc \ 149 pp_Mult_Coeff_mm_DivSelectMult__Template.cc \ 148 150 p_Merge_q__Template.cc pp_Mult_mm_Noether__Template.cc\ 149 151 p_kBucketSetLm__Template.cc \ … … 165 167 ndbm.h dbm_sl.h polys-impl.h libparse.h \ 166 168 GMPrat.h multicnt.h npolygon.h semic.h spectrum.h splist.h multicnt.h \ 167 pcv.h mod_raw.h kbuckets.h \169 pcv.h mod_raw.h kbuckets.h sbuckets.h\ 168 170 mpr_global.h mpr_inout.h mpr_base.h mpr_numeric.h \ 169 171 feOpt.h fegetopt.h distrib.h walk.h \ … … 173 175 omSingularConfig.h pShallowCopyDelete.h \ 174 176 p_Procs_Dynamic.h p_Procs_Impl.h p_Procs_Set.h \ 175 p_Procs.h p_Procs_Static.h 176 177 DISTFILES=${SOURCES} ${HEADERS} Makefile.in configure.in configure \ 177 p_Procs.h p_Procs_Static.h p_Mult_q.h 178 179 DISTFILES=${SOURCES} ${HEADERS} ${ESOURCES} \ 180 Makefile.in configure.in configure \ 178 181 mod2.h.in grammar.h testgh install-sh mkinstalldirs \ 179 182 check_aso.pl prCopy.pl … … 495 498 mcopy -o Singular-${SINGULAR_VERSION}-src.tar.gz a: 496 499 497 TAGS: ${SOURCES} ${ HEADERS}498 etags ${SOURCES} ${ HEADERS}500 TAGS: ${SOURCES} ${ESOURCES} ${HEADERS} 501 etags ${SOURCES} ${ESOURCES} ${HEADERS} 499 502 500 503 tags: … … 601 604 602 605 p_Procs_Lib_%.dl_og : p_Procs_Lib.cc p_Procs_Dynamic.og 603 ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS } ${SFLAGS} -Dp_Procs_$* -c $< -o $@606 ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFSG} ${SFLAGS} -Dp_Procs_$* -c $< -o $@ 604 607 605 608 %.dl_og: %.cc … … 843 846 844 847 %_d.c : %.c 845 $(CCG) $(CFLAGSG) ${CPPFLAGS} -E -P $< | $(PERL) -p -e 's/;/;\n/g' | $(PERL) -p -e 's/\{/\n\{/g' | $(PERL) -p -e 's/\}/\n\}/g' > $@848 $(CCG) $(CFLAGSG) ${CPPFLAGS} ${DEFS}-E -P $< | $(PERL) -p -e 's/;/;\n/g' | $(PERL) -p -e 's/\{/\n\{/g' | $(PERL) -p -e 's/\}/\n\}/g' > $@ 846 849 847 850 %_d.cc : %.cc 848 $(CCG) $(CXXFLAGS) ${CPPFLAGS} -E -P $< | $(PERL) -p -e 's/;/;\n/g' | $(PERL) -p -e 's/\{/\n\{/g' | $(PERL) -p -e 's/\}/\n\}/g' > $@851 $(CCG) $(CXXFLAGS) ${CPPFLAGS} ${DEFS} -E -P $< | $(PERL) -p -e 's/;/;\n/g' | $(PERL) -p -e 's/\{/\n\{/g' | $(PERL) -p -e 's/\}/\n\}/g' > $@ 849 852 850 853 .PRECIOUS: %_d.cc %_d.c -
Singular/configure
r33ec11 r2f436b 600 600 SINGULAR_MAJOR_VERSION=${SINGULAR_MAJOR_VERSION:-1} 601 601 SINGULAR_MINOR_VERSION=${SINGULAR_MINOR_VERSION:-3} 602 SINGULAR_SUB_VERSION=${SINGULAR_SUB_VERSION:-1 2}602 SINGULAR_SUB_VERSION=${SINGULAR_SUB_VERSION:-13} 603 603 SINGULAR_VERSION="${SINGULAR_VERSION:-$SINGULAR_MAJOR_VERSION${VERSION_SEP}$SINGULAR_MINOR_VERSION${VERSION_SEP}$SINGULAR_SUB_VERSION}" 604 VERSION_DATE=${VERSION_DATE:-" December 2000"}604 VERSION_DATE=${VERSION_DATE:-"January 2001"} 605 605 606 606 … … 1796 1796 fi 1797 1797 ;; 1798 IRIX-6) 1799 LD_DYN_FLAGS="-lc" 1800 ac_lib_dl=yes 1801 ;; 1798 1802 esac 1799 1803 … … 1805 1809 # heder file checks 1806 1810 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 1807 echo "configure:18 08: checking for ANSI C header files" >&51811 echo "configure:1812: checking for ANSI C header files" >&5 1808 1812 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then 1809 1813 echo $ac_n "(cached) $ac_c" 1>&6 1810 1814 else 1811 1815 cat > conftest.$ac_ext <<EOF 1812 #line 181 3"configure"1816 #line 1817 "configure" 1813 1817 #include "confdefs.h" 1814 1818 #include <stdlib.h> … … 1818 1822 EOF 1819 1823 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1820 { (eval echo configure:182 1: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1824 { (eval echo configure:1825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1821 1825 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1822 1826 if test -z "$ac_err"; then … … 1835 1839 # SunOS 4.x string.h does not declare mem*, contrary to ANSI. 1836 1840 cat > conftest.$ac_ext <<EOF 1837 #line 18 38"configure"1841 #line 1842 "configure" 1838 1842 #include "confdefs.h" 1839 1843 #include <string.h> … … 1853 1857 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. 1854 1858 cat > conftest.$ac_ext <<EOF 1855 #line 18 56"configure"1859 #line 1860 "configure" 1856 1860 #include "confdefs.h" 1857 1861 #include <stdlib.h> … … 1874 1878 else 1875 1879 cat > conftest.$ac_ext <<EOF 1876 #line 18 77"configure"1880 #line 1881 "configure" 1877 1881 #include "confdefs.h" 1878 1882 #include <ctype.h> … … 1885 1889 1886 1890 EOF 1887 if { (eval echo configure:18 88: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null1891 if { (eval echo configure:1892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 1888 1892 then 1889 1893 : … … 1912 1916 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 1913 1917 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 1914 echo "configure:191 5: checking for $ac_hdr" >&51918 echo "configure:1919: checking for $ac_hdr" >&5 1915 1919 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 1916 1920 echo $ac_n "(cached) $ac_c" 1>&6 1917 1921 else 1918 1922 cat > conftest.$ac_ext <<EOF 1919 #line 192 0"configure"1923 #line 1924 "configure" 1920 1924 #include "confdefs.h" 1921 1925 #include <$ac_hdr> 1922 1926 EOF 1923 1927 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1924 { (eval echo configure:192 5: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1928 { (eval echo configure:1929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1925 1929 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1926 1930 if test -z "$ac_err"; then … … 1954 1958 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 1955 1959 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 1956 echo "configure:19 57: checking for $ac_hdr" >&51960 echo "configure:1961: checking for $ac_hdr" >&5 1957 1961 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 1958 1962 echo $ac_n "(cached) $ac_c" 1>&6 1959 1963 else 1960 1964 cat > conftest.$ac_ext <<EOF 1961 #line 196 2"configure"1965 #line 1966 "configure" 1962 1966 #include "confdefs.h" 1963 1967 #include <$ac_hdr> 1964 1968 EOF 1965 1969 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1966 { (eval echo configure:19 67: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1970 { (eval echo configure:1971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1967 1971 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1968 1972 if test -z "$ac_err"; then … … 1993 1997 # typedefs, structures 1994 1998 echo $ac_n "checking for working const""... $ac_c" 1>&6 1995 echo "configure: 1996: checking for working const" >&51999 echo "configure:2000: checking for working const" >&5 1996 2000 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then 1997 2001 echo $ac_n "(cached) $ac_c" 1>&6 1998 2002 else 1999 2003 cat > conftest.$ac_ext <<EOF 2000 #line 200 1"configure"2004 #line 2005 "configure" 2001 2005 #include "confdefs.h" 2002 2006 … … 2047 2051 ; return 0; } 2048 2052 EOF 2049 if { (eval echo configure:205 0: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then2053 if { (eval echo configure:2054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 2050 2054 rm -rf conftest* 2051 2055 ac_cv_c_const=yes … … 2068 2072 2069 2073 echo $ac_n "checking for inline""... $ac_c" 1>&6 2070 echo "configure:207 1: checking for inline" >&52074 echo "configure:2075: checking for inline" >&5 2071 2075 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then 2072 2076 echo $ac_n "(cached) $ac_c" 1>&6 … … 2075 2079 for ac_kw in inline __inline__ __inline; do 2076 2080 cat > conftest.$ac_ext <<EOF 2077 #line 20 78"configure"2081 #line 2082 "configure" 2078 2082 #include "confdefs.h" 2079 2083 … … 2082 2086 ; return 0; } 2083 2087 EOF 2084 if { (eval echo configure:208 5: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then2088 if { (eval echo configure:2089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 2085 2089 rm -rf conftest* 2086 2090 ac_cv_c_inline=$ac_kw; break … … 2108 2112 2109 2113 echo $ac_n "checking for size_t""... $ac_c" 1>&6 2110 echo "configure:211 1: checking for size_t" >&52114 echo "configure:2115: checking for size_t" >&5 2111 2115 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then 2112 2116 echo $ac_n "(cached) $ac_c" 1>&6 2113 2117 else 2114 2118 cat > conftest.$ac_ext <<EOF 2115 #line 21 16"configure"2119 #line 2120 "configure" 2116 2120 #include "confdefs.h" 2117 2121 #include <sys/types.h> … … 2141 2145 2142 2146 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 2143 echo "configure:214 4: checking whether time.h and sys/time.h may both be included" >&52147 echo "configure:2148: checking whether time.h and sys/time.h may both be included" >&5 2144 2148 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then 2145 2149 echo $ac_n "(cached) $ac_c" 1>&6 2146 2150 else 2147 2151 cat > conftest.$ac_ext <<EOF 2148 #line 21 49"configure"2152 #line 2153 "configure" 2149 2153 #include "confdefs.h" 2150 2154 #include <sys/types.h> … … 2155 2159 ; return 0; } 2156 2160 EOF 2157 if { (eval echo configure:21 58: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then2161 if { (eval echo configure:2162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 2158 2162 rm -rf conftest* 2159 2163 ac_cv_header_time=yes … … 2176 2180 2177 2181 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 2178 echo "configure:21 79: checking whether struct tm is in sys/time.h or time.h" >&52182 echo "configure:2183: checking whether struct tm is in sys/time.h or time.h" >&5 2179 2183 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then 2180 2184 echo $ac_n "(cached) $ac_c" 1>&6 2181 2185 else 2182 2186 cat > conftest.$ac_ext <<EOF 2183 #line 218 4"configure"2187 #line 2188 "configure" 2184 2188 #include "confdefs.h" 2185 2189 #include <sys/types.h> … … 2189 2193 ; return 0; } 2190 2194 EOF 2191 if { (eval echo configure:219 2: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then2195 if { (eval echo configure:2196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 2192 2196 rm -rf conftest* 2193 2197 ac_cv_struct_tm=time.h … … 2214 2218 # for constant arguments. Useless! 2215 2219 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 2216 echo "configure:22 17: checking for working alloca.h" >&52220 echo "configure:2221: checking for working alloca.h" >&5 2217 2221 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then 2218 2222 echo $ac_n "(cached) $ac_c" 1>&6 2219 2223 else 2220 2224 cat > conftest.$ac_ext <<EOF 2221 #line 222 2"configure"2225 #line 2226 "configure" 2222 2226 #include "confdefs.h" 2223 2227 #include <alloca.h> … … 2226 2230 ; return 0; } 2227 2231 EOF 2228 if { (eval echo configure:22 29: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2232 if { (eval echo configure:2233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2229 2233 rm -rf conftest* 2230 2234 ac_cv_header_alloca_h=yes … … 2247 2251 2248 2252 echo $ac_n "checking for alloca""... $ac_c" 1>&6 2249 echo "configure:225 0: checking for alloca" >&52253 echo "configure:2254: checking for alloca" >&5 2250 2254 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then 2251 2255 echo $ac_n "(cached) $ac_c" 1>&6 2252 2256 else 2253 2257 cat > conftest.$ac_ext <<EOF 2254 #line 225 5"configure"2258 #line 2259 "configure" 2255 2259 #include "confdefs.h" 2256 2260 … … 2280 2284 ; return 0; } 2281 2285 EOF 2282 if { (eval echo configure:228 3: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2286 if { (eval echo configure:2287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2283 2287 rm -rf conftest* 2284 2288 ac_cv_func_alloca_works=yes … … 2312 2316 2313 2317 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 2314 echo "configure:231 5: checking whether alloca needs Cray hooks" >&52318 echo "configure:2319: checking whether alloca needs Cray hooks" >&5 2315 2319 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then 2316 2320 echo $ac_n "(cached) $ac_c" 1>&6 2317 2321 else 2318 2322 cat > conftest.$ac_ext <<EOF 2319 #line 232 0"configure"2323 #line 2324 "configure" 2320 2324 #include "confdefs.h" 2321 2325 #if defined(CRAY) && ! defined(CRAY2) … … 2342 2346 for ac_func in _getb67 GETB67 getb67; do 2343 2347 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 2344 echo "configure:234 5: checking for $ac_func" >&52348 echo "configure:2349: checking for $ac_func" >&5 2345 2349 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 2346 2350 echo $ac_n "(cached) $ac_c" 1>&6 2347 2351 else 2348 2352 cat > conftest.$ac_ext <<EOF 2349 #line 235 0"configure"2353 #line 2354 "configure" 2350 2354 #include "confdefs.h" 2351 2355 /* System header to define __stub macros and hopefully few prototypes, … … 2370 2374 ; return 0; } 2371 2375 EOF 2372 if { (eval echo configure:237 3: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2376 if { (eval echo configure:2377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2373 2377 rm -rf conftest* 2374 2378 eval "ac_cv_func_$ac_func=yes" … … 2397 2401 2398 2402 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 2399 echo "configure:240 0: checking stack direction for C alloca" >&52403 echo "configure:2404: checking stack direction for C alloca" >&5 2400 2404 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then 2401 2405 echo $ac_n "(cached) $ac_c" 1>&6 … … 2405 2409 else 2406 2410 cat > conftest.$ac_ext <<EOF 2407 #line 24 08"configure"2411 #line 2412 "configure" 2408 2412 #include "confdefs.h" 2409 2413 find_stack_direction () … … 2424 2428 } 2425 2429 EOF 2426 if { (eval echo configure:24 27: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null2430 if { (eval echo configure:2431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 2427 2431 then 2428 2432 ac_cv_c_stack_direction=1 … … 2447 2451 if test $ac_cv_prog_gcc = yes; then 2448 2452 echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 2449 echo "configure:245 0: checking whether ${CC-cc} needs -traditional" >&52453 echo "configure:2454: checking whether ${CC-cc} needs -traditional" >&5 2450 2454 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then 2451 2455 echo $ac_n "(cached) $ac_c" 1>&6 … … 2453 2457 ac_pattern="Autoconf.*'x'" 2454 2458 cat > conftest.$ac_ext <<EOF 2455 #line 24 56"configure"2459 #line 2460 "configure" 2456 2460 #include "confdefs.h" 2457 2461 #include <sgtty.h> … … 2471 2475 if test $ac_cv_prog_gcc_traditional = no; then 2472 2476 cat > conftest.$ac_ext <<EOF 2473 #line 247 4"configure"2477 #line 2478 "configure" 2474 2478 #include "confdefs.h" 2475 2479 #include <termio.h> … … 2496 2500 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 2497 2501 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 2498 echo "configure:2 499: checking for $ac_hdr" >&52502 echo "configure:2503: checking for $ac_hdr" >&5 2499 2503 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 2500 2504 echo $ac_n "(cached) $ac_c" 1>&6 2501 2505 else 2502 2506 cat > conftest.$ac_ext <<EOF 2503 #line 250 4"configure"2507 #line 2508 "configure" 2504 2508 #include "confdefs.h" 2505 2509 #include <$ac_hdr> 2506 2510 EOF 2507 2511 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 2508 { (eval echo configure:25 09: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }2512 { (eval echo configure:2513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 2509 2513 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 2510 2514 if test -z "$ac_err"; then … … 2535 2539 do 2536 2540 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 2537 echo "configure:25 38: checking for $ac_func" >&52541 echo "configure:2542: checking for $ac_func" >&5 2538 2542 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 2539 2543 echo $ac_n "(cached) $ac_c" 1>&6 2540 2544 else 2541 2545 cat > conftest.$ac_ext <<EOF 2542 #line 254 3"configure"2546 #line 2547 "configure" 2543 2547 #include "confdefs.h" 2544 2548 /* System header to define __stub macros and hopefully few prototypes, … … 2563 2567 ; return 0; } 2564 2568 EOF 2565 if { (eval echo configure:25 66: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2569 if { (eval echo configure:2570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2566 2570 rm -rf conftest* 2567 2571 eval "ac_cv_func_$ac_func=yes" … … 2588 2592 2589 2593 echo $ac_n "checking for working mmap""... $ac_c" 1>&6 2590 echo "configure:259 1: checking for working mmap" >&52594 echo "configure:2595: checking for working mmap" >&5 2591 2595 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then 2592 2596 echo $ac_n "(cached) $ac_c" 1>&6 … … 2596 2600 else 2597 2601 cat > conftest.$ac_ext <<EOF 2598 #line 2 599"configure"2602 #line 2603 "configure" 2599 2603 #include "confdefs.h" 2600 2604 … … 2736 2740 2737 2741 EOF 2738 if { (eval echo configure:27 39: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null2742 if { (eval echo configure:2743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 2739 2743 then 2740 2744 ac_cv_func_mmap_fixed_mapped=yes … … 2759 2763 2760 2764 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 2761 echo "configure:276 2: checking return type of signal handlers" >&52765 echo "configure:2766: checking return type of signal handlers" >&5 2762 2766 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then 2763 2767 echo $ac_n "(cached) $ac_c" 1>&6 2764 2768 else 2765 2769 cat > conftest.$ac_ext <<EOF 2766 #line 27 67"configure"2770 #line 2771 "configure" 2767 2771 #include "confdefs.h" 2768 2772 #include <sys/types.h> … … 2781 2785 ; return 0; } 2782 2786 EOF 2783 if { (eval echo configure:278 4: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then2787 if { (eval echo configure:2788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 2784 2788 rm -rf conftest* 2785 2789 ac_cv_type_signal=void … … 2800 2804 2801 2805 echo $ac_n "checking for vprintf""... $ac_c" 1>&6 2802 echo "configure:280 3: checking for vprintf" >&52806 echo "configure:2807: checking for vprintf" >&5 2803 2807 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then 2804 2808 echo $ac_n "(cached) $ac_c" 1>&6 2805 2809 else 2806 2810 cat > conftest.$ac_ext <<EOF 2807 #line 28 08"configure"2811 #line 2812 "configure" 2808 2812 #include "confdefs.h" 2809 2813 /* System header to define __stub macros and hopefully few prototypes, … … 2828 2832 ; return 0; } 2829 2833 EOF 2830 if { (eval echo configure:283 1: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2834 if { (eval echo configure:2835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2831 2835 rm -rf conftest* 2832 2836 eval "ac_cv_func_vprintf=yes" … … 2852 2856 if test "$ac_cv_func_vprintf" != yes; then 2853 2857 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 2854 echo "configure:285 5: checking for _doprnt" >&52858 echo "configure:2859: checking for _doprnt" >&5 2855 2859 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then 2856 2860 echo $ac_n "(cached) $ac_c" 1>&6 2857 2861 else 2858 2862 cat > conftest.$ac_ext <<EOF 2859 #line 286 0"configure"2863 #line 2864 "configure" 2860 2864 #include "confdefs.h" 2861 2865 /* System header to define __stub macros and hopefully few prototypes, … … 2880 2884 ; return 0; } 2881 2885 EOF 2882 if { (eval echo configure:288 3: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2886 if { (eval echo configure:2887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2883 2887 rm -rf conftest* 2884 2888 eval "ac_cv_func__doprnt=yes" … … 2906 2910 2907 2911 echo $ac_n "checking for library containing setenv""... $ac_c" 1>&6 2908 echo "configure:29 09: checking for library containing setenv" >&52912 echo "configure:2913: checking for library containing setenv" >&5 2909 2913 if eval "test \"`echo '$''{'ac_cv_search_setenv'+set}'`\" = set"; then 2910 2914 echo $ac_n "(cached) $ac_c" 1>&6 … … 2913 2917 ac_cv_search_setenv="no" 2914 2918 cat > conftest.$ac_ext <<EOF 2915 #line 29 16"configure"2919 #line 2920 "configure" 2916 2920 #include "confdefs.h" 2917 2921 /* Override any gcc2 internal prototype to avoid an error. */ … … 2924 2928 ; return 0; } 2925 2929 EOF 2926 if { (eval echo configure:29 27: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2930 if { (eval echo configure:2931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2927 2931 rm -rf conftest* 2928 2932 ac_cv_search_setenv="none required" … … 2935 2939 LIBS="-l$i $ac_func_search_save_LIBS" 2936 2940 cat > conftest.$ac_ext <<EOF 2937 #line 29 38"configure"2941 #line 2942 "configure" 2938 2942 #include "confdefs.h" 2939 2943 /* Override any gcc2 internal prototype to avoid an error. */ … … 2946 2950 ; return 0; } 2947 2951 EOF 2948 if { (eval echo configure:29 49: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2952 if { (eval echo configure:2953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2949 2953 rm -rf conftest* 2950 2954 ac_cv_search_setenv="-l$i" … … 2969 2973 do 2970 2974 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 2971 echo "configure:297 2: checking for $ac_func" >&52975 echo "configure:2976: checking for $ac_func" >&5 2972 2976 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 2973 2977 echo $ac_n "(cached) $ac_c" 1>&6 2974 2978 else 2975 2979 cat > conftest.$ac_ext <<EOF 2976 #line 29 77"configure"2980 #line 2981 "configure" 2977 2981 #include "confdefs.h" 2978 2982 /* System header to define __stub macros and hopefully few prototypes, … … 2997 3001 ; return 0; } 2998 3002 EOF 2999 if { (eval echo configure:300 0: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then3003 if { (eval echo configure:3004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 3000 3004 rm -rf conftest* 3001 3005 eval "ac_cv_func_$ac_func=yes" … … 3026 3030 # arithmetic shifts 3027 3031 echo $ac_n "checking whether your machine has correct arithmetic shifts""... $ac_c" 1>&6 3028 echo "configure:30 29: checking whether your machine has correct arithmetic shifts" >&53032 echo "configure:3033: checking whether your machine has correct arithmetic shifts" >&5 3029 3033 if eval "test \"`echo '$''{'ac_cv_shift'+set}'`\" = set"; then 3030 3034 echo $ac_n "(cached) $ac_c" 1>&6 … … 3039 3043 else 3040 3044 cat > conftest.$ac_ext <<EOF 3041 #line 304 2"configure"3045 #line 3046 "configure" 3042 3046 #include "confdefs.h" 3043 3047 int main() { if (-2 >> 1 == -1) exit(0); else exit(1); } 3044 3048 EOF 3045 if { (eval echo configure:30 46: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3049 if { (eval echo configure:3050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 3046 3050 then 3047 3051 ac_cv_shift=yes … … 3068 3072 # check for a peculiar constructor initialization 3069 3073 echo $ac_n "checking whether explicit C++ constructor calls are allowed""... $ac_c" 1>&6 3070 echo "configure:307 1: checking whether explicit C++ constructor calls are allowed" >&53074 echo "configure:3075: checking whether explicit C++ constructor calls are allowed" >&5 3071 3075 3072 3076 ac_ext=C … … 3081 3085 else 3082 3086 cat > conftest.$ac_ext <<EOF 3083 #line 308 4"configure"3087 #line 3088 "configure" 3084 3088 #include "confdefs.h" 3085 3089 … … 3099 3103 ; return 0; } 3100 3104 EOF 3101 if { (eval echo configure:310 2: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then3105 if { (eval echo configure:3106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 3102 3106 rm -rf conftest* 3103 3107 ac_cv_explicit_const=yes … … 3128 3132 # sprintf returns number of printed chars 3129 3133 echo $ac_n "checking whether vsprintf returns number of printed chars""... $ac_c" 1>&6 3130 echo "configure:313 1: checking whether vsprintf returns number of printed chars" >&53134 echo "configure:3135: checking whether vsprintf returns number of printed chars" >&5 3131 3135 if eval "test \"`echo '$''{'ac_cv_returns_n_of_chars'+set}'`\" = set"; then 3132 3136 echo $ac_n "(cached) $ac_c" 1>&6 … … 3136 3140 else 3137 3141 cat > conftest.$ac_ext <<EOF 3138 #line 31 39"configure"3142 #line 3143 "configure" 3139 3143 #include "confdefs.h" 3140 3144 #include <stdio.h> 3141 3145 main() { char *str=(char*)malloc(20); if (((int) sprintf(str,"123456789")) == 9) exit(0); else exit(1); } 3142 3146 EOF 3143 if { (eval echo configure:314 4: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3147 if { (eval echo configure:3148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 3144 3148 then 3145 3149 ac_cv_returns_n_of_chars=yes … … 3167 3171 # determine ALIGN_8 3168 3172 echo $ac_n "checking size of char""... $ac_c" 1>&6 3169 echo "configure:317 0: checking size of char" >&53173 echo "configure:3174: checking size of char" >&5 3170 3174 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then 3171 3175 echo $ac_n "(cached) $ac_c" 1>&6 … … 3175 3179 else 3176 3180 cat > conftest.$ac_ext <<EOF 3177 #line 31 78"configure"3181 #line 3182 "configure" 3178 3182 #include "confdefs.h" 3179 3183 #include <stdio.h> … … 3186 3190 } 3187 3191 EOF 3188 if { (eval echo configure:31 89: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3192 if { (eval echo configure:3193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 3189 3193 then 3190 3194 ac_cv_sizeof_char=`cat conftestval` … … 3206 3210 3207 3211 echo $ac_n "checking size of short""... $ac_c" 1>&6 3208 echo "configure:32 09: checking size of short" >&53212 echo "configure:3213: checking size of short" >&5 3209 3213 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then 3210 3214 echo $ac_n "(cached) $ac_c" 1>&6 … … 3214 3218 else 3215 3219 cat > conftest.$ac_ext <<EOF 3216 #line 32 17"configure"3220 #line 3221 "configure" 3217 3221 #include "confdefs.h" 3218 3222 #include <stdio.h> … … 3225 3229 } 3226 3230 EOF 3227 if { (eval echo configure:32 28: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3231 if { (eval echo configure:3232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 3228 3232 then 3229 3233 ac_cv_sizeof_short=`cat conftestval` … … 3245 3249 3246 3250 echo $ac_n "checking size of int""... $ac_c" 1>&6 3247 echo "configure:32 48: checking size of int" >&53251 echo "configure:3252: checking size of int" >&5 3248 3252 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then 3249 3253 echo $ac_n "(cached) $ac_c" 1>&6 … … 3253 3257 else 3254 3258 cat > conftest.$ac_ext <<EOF 3255 #line 32 56"configure"3259 #line 3260 "configure" 3256 3260 #include "confdefs.h" 3257 3261 #include <stdio.h> … … 3264 3268 } 3265 3269 EOF 3266 if { (eval echo configure:32 67: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3270 if { (eval echo configure:3271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 3267 3271 then 3268 3272 ac_cv_sizeof_int=`cat conftestval` … … 3284 3288 3285 3289 echo $ac_n "checking size of long""... $ac_c" 1>&6 3286 echo "configure:32 87: checking size of long" >&53290 echo "configure:3291: checking size of long" >&5 3287 3291 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then 3288 3292 echo $ac_n "(cached) $ac_c" 1>&6 … … 3292 3296 else 3293 3297 cat > conftest.$ac_ext <<EOF 3294 #line 329 5"configure"3298 #line 3299 "configure" 3295 3299 #include "confdefs.h" 3296 3300 #include <stdio.h> … … 3303 3307 } 3304 3308 EOF 3305 if { (eval echo configure:33 06: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3309 if { (eval echo configure:3310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 3306 3310 then 3307 3311 ac_cv_sizeof_long=`cat conftestval` … … 3323 3327 3324 3328 echo $ac_n "checking size of void*""... $ac_c" 1>&6 3325 echo "configure:33 26: checking size of void*" >&53329 echo "configure:3330: checking size of void*" >&5 3326 3330 if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then 3327 3331 echo $ac_n "(cached) $ac_c" 1>&6 … … 3331 3335 else 3332 3336 cat > conftest.$ac_ext <<EOF 3333 #line 333 4"configure"3337 #line 3338 "configure" 3334 3338 #include "confdefs.h" 3335 3339 #include <stdio.h> … … 3342 3346 } 3343 3347 EOF 3344 if { (eval echo configure:334 5: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3348 if { (eval echo configure:3349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 3345 3349 then 3346 3350 ac_cv_sizeof_voidp=`cat conftestval` … … 3362 3366 3363 3367 echo $ac_n "checking size of double""... $ac_c" 1>&6 3364 echo "configure:336 5: checking size of double" >&53368 echo "configure:3369: checking size of double" >&5 3365 3369 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then 3366 3370 echo $ac_n "(cached) $ac_c" 1>&6 … … 3370 3374 else 3371 3375 cat > conftest.$ac_ext <<EOF 3372 #line 337 3"configure"3376 #line 3377 "configure" 3373 3377 #include "confdefs.h" 3374 3378 #include <stdio.h> … … 3381 3385 } 3382 3386 EOF 3383 if { (eval echo configure:338 4: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3387 if { (eval echo configure:3388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 3384 3388 then 3385 3389 ac_cv_sizeof_double=`cat conftestval` … … 3401 3405 3402 3406 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 3403 echo "configure:340 4: checking whether byte ordering is bigendian" >&53407 echo "configure:3408: checking whether byte ordering is bigendian" >&5 3404 3408 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then 3405 3409 echo $ac_n "(cached) $ac_c" 1>&6 … … 3408 3412 # See if sys/param.h defines the BYTE_ORDER macro. 3409 3413 cat > conftest.$ac_ext <<EOF 3410 #line 341 1"configure"3414 #line 3415 "configure" 3411 3415 #include "confdefs.h" 3412 3416 #include <sys/types.h> … … 3419 3423 ; return 0; } 3420 3424 EOF 3421 if { (eval echo configure:342 2: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then3425 if { (eval echo configure:3426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 3422 3426 rm -rf conftest* 3423 3427 # It does; now see whether it defined to BIG_ENDIAN or not. 3424 3428 cat > conftest.$ac_ext <<EOF 3425 #line 34 26"configure"3429 #line 3430 "configure" 3426 3430 #include "confdefs.h" 3427 3431 #include <sys/types.h> … … 3434 3438 ; return 0; } 3435 3439 EOF 3436 if { (eval echo configure:34 37: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then3440 if { (eval echo configure:3441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 3437 3441 rm -rf conftest* 3438 3442 ac_cv_c_bigendian=yes … … 3454 3458 else 3455 3459 cat > conftest.$ac_ext <<EOF 3456 #line 34 57"configure"3460 #line 3461 "configure" 3457 3461 #include "confdefs.h" 3458 3462 main () { … … 3467 3471 } 3468 3472 EOF 3469 if { (eval echo configure:347 0: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3473 if { (eval echo configure:3474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 3470 3474 then 3471 3475 ac_cv_c_bigendian=no … … 3585 3589 3586 3590 echo $ac_n "checking whether to use dynamic linking""... $ac_c" 1>&6 3587 echo "configure:35 88: checking whether to use dynamic linking" >&53591 echo "configure:3592: checking whether to use dynamic linking" >&5 3588 3592 if test "$with_dl" != no && test "$ac_lib_dl" = yes; then 3589 3593 cat >> confdefs.h <<\EOF … … 3598 3602 3599 3603 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 3600 echo "configure:360 1: checking for tgetent in -lncurses" >&53604 echo "configure:3605: checking for tgetent in -lncurses" >&5 3601 3605 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` 3602 3606 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 3606 3610 LIBS="-lncurses $LIBS" 3607 3611 cat > conftest.$ac_ext <<EOF 3608 #line 36 09"configure"3612 #line 3613 "configure" 3609 3613 #include "confdefs.h" 3610 3614 /* Override any gcc2 internal prototype to avoid an error. */ … … 3617 3621 ; return 0; } 3618 3622 EOF 3619 if { (eval echo configure:362 0: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then3623 if { (eval echo configure:3624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 3620 3624 rm -rf conftest* 3621 3625 eval "ac_cv_lib_$ac_lib_var=yes" … … 3644 3648 \ 3645 3649 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 3646 echo "configure:36 47: checking for tgetent in -lcurses" >&53650 echo "configure:3651: checking for tgetent in -lcurses" >&5 3647 3651 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` 3648 3652 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 3652 3656 LIBS="-lcurses $LIBS" 3653 3657 cat > conftest.$ac_ext <<EOF 3654 #line 365 5"configure"3658 #line 3659 "configure" 3655 3659 #include "confdefs.h" 3656 3660 /* Override any gcc2 internal prototype to avoid an error. */ … … 3663 3667 ; return 0; } 3664 3668 EOF 3665 if { (eval echo configure:36 66: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then3669 if { (eval echo configure:3670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 3666 3670 rm -rf conftest* 3667 3671 eval "ac_cv_lib_$ac_lib_var=yes" … … 3690 3694 \ 3691 3695 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 3692 echo "configure:369 3: checking for tgetent in -ltermcap" >&53696 echo "configure:3697: checking for tgetent in -ltermcap" >&5 3693 3697 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` 3694 3698 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 3698 3702 LIBS="-ltermcap $LIBS" 3699 3703 cat > conftest.$ac_ext <<EOF 3700 #line 370 1"configure"3704 #line 3705 "configure" 3701 3705 #include "confdefs.h" 3702 3706 /* Override any gcc2 internal prototype to avoid an error. */ … … 3709 3713 ; return 0; } 3710 3714 EOF 3711 if { (eval echo configure:371 2: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then3715 if { (eval echo configure:3716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 3712 3716 rm -rf conftest* 3713 3717 eval "ac_cv_lib_$ac_lib_var=yes" … … 3758 3762 3759 3763 echo $ac_n "checking for rl_abort in -lreadline""... $ac_c" 1>&6 3760 echo "configure:376 1: checking for rl_abort in -lreadline" >&53764 echo "configure:3765: checking for rl_abort in -lreadline" >&5 3761 3765 ac_lib_var=`echo readline'_'rl_abort | sed 'y%./+-%__p_%'` 3762 3766 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 3766 3770 LIBS="-lreadline $LIBS" 3767 3771 cat > conftest.$ac_ext <<EOF 3768 #line 37 69"configure"3772 #line 3773 "configure" 3769 3773 #include "confdefs.h" 3770 3774 /* Override any gcc2 internal prototype to avoid an error. */ … … 3780 3784 ; return 0; } 3781 3785 EOF 3782 if { (eval echo configure:378 3: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then3786 if { (eval echo configure:3787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 3783 3787 rm -rf conftest* 3784 3788 eval "ac_cv_lib_$ac_lib_var=yes" … … 3808 3812 3809 3813 echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 3810 echo "configure:381 1: checking how to run the C++ preprocessor" >&53814 echo "configure:3815: checking how to run the C++ preprocessor" >&5 3811 3815 if test -z "$CXXCPP"; then 3812 3816 if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then … … 3821 3825 CXXCPP="${CXX-g++} -E" 3822 3826 cat > conftest.$ac_ext <<EOF 3823 #line 382 4"configure"3827 #line 3828 "configure" 3824 3828 #include "confdefs.h" 3825 3829 #include <stdlib.h> 3826 3830 EOF 3827 3831 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 3828 { (eval echo configure:38 29: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }3832 { (eval echo configure:3833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 3829 3833 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 3830 3834 if test -z "$ac_err"; then … … 3854 3858 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 3855 3859 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 3856 echo "configure:38 57: checking for $ac_hdr" >&53860 echo "configure:3861: checking for $ac_hdr" >&5 3857 3861 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 3858 3862 echo $ac_n "(cached) $ac_c" 1>&6 3859 3863 else 3860 3864 cat > conftest.$ac_ext <<EOF 3861 #line 386 2"configure"3865 #line 3866 "configure" 3862 3866 #include "confdefs.h" 3863 3867 #include <$ac_hdr> 3864 3868 EOF 3865 3869 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 3866 { (eval echo configure:38 67: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }3870 { (eval echo configure:3871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 3867 3871 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 3868 3872 if test -z "$ac_err"; then … … 3893 3897 test "$ac_cv_header_readline_readline_h" = yes; then 3894 3898 echo $ac_n "checking whether readline.h is ok""... $ac_c" 1>&6 3895 echo "configure:3 896: checking whether readline.h is ok" >&53899 echo "configure:3900: checking whether readline.h is ok" >&5 3896 3900 if eval "test \"`echo '$''{'ac_cv_header_readline_readline_h_ok'+set}'`\" = set"; then 3897 3901 echo $ac_n "(cached) $ac_c" 1>&6 3898 3902 else 3899 3903 cat > conftest.$ac_ext <<EOF 3900 #line 390 1"configure"3904 #line 3905 "configure" 3901 3905 #include "confdefs.h" 3902 3906 #include<unistd.h> … … 3923 3927 ; return 0; } 3924 3928 EOF 3925 if { (eval echo configure:39 26: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then3929 if { (eval echo configure:3930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 3926 3930 rm -rf conftest* 3927 3931 ac_cv_header_readline_readline_h_ok="yes" … … 3939 3943 #not ok -- try once more with explicitly declaring everything 3940 3944 echo $ac_n "checking whether or not we nevertheless can use readline""... $ac_c" 1>&6 3941 echo "configure:394 2: checking whether or not we nevertheless can use readline" >&53945 echo "configure:3946: checking whether or not we nevertheless can use readline" >&5 3942 3946 if eval "test \"`echo '$''{'ac_cv_have_readline'+set}'`\" = set"; then 3943 3947 echo $ac_n "(cached) $ac_c" 1>&6 3944 3948 else 3945 3949 cat > conftest.$ac_ext <<EOF 3946 #line 39 47"configure"3950 #line 3951 "configure" 3947 3951 #include "confdefs.h" 3948 3952 #include <stdio.h> … … 3978 3982 ; return 0; } 3979 3983 EOF 3980 if { (eval echo configure:398 1: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then3984 if { (eval echo configure:3985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 3981 3985 rm -rf conftest* 3982 3986 ac_cv_have_readline="yes" … … 4017 4021 4018 4022 echo $ac_n "checking which readline to use""... $ac_c" 1>&6 4019 echo "configure:402 0: checking which readline to use" >&54023 echo "configure:4024: checking which readline to use" >&5 4020 4024 if test "$ac_cv_with_readline" = dynamic; then 4021 4025 echo "$ac_t""dynamic" 1>&6 … … 4035 4039 # gmp, smallgmp, MP, MPT, factory, libfac 4036 4040 echo $ac_n "checking for main in -lgmp""... $ac_c" 1>&6 4037 echo "configure:40 38: checking for main in -lgmp" >&54041 echo "configure:4042: checking for main in -lgmp" >&5 4038 4042 ac_lib_var=`echo gmp'_'main | sed 'y%./+-%__p_%'` 4039 4043 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 4043 4047 LIBS="-lgmp $LIBS" 4044 4048 cat > conftest.$ac_ext <<EOF 4045 #line 40 46"configure"4049 #line 4050 "configure" 4046 4050 #include "confdefs.h" 4047 4051 … … 4050 4054 ; return 0; } 4051 4055 EOF 4052 if { (eval echo configure:405 3: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then4056 if { (eval echo configure:4057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 4053 4057 rm -rf conftest* 4054 4058 eval "ac_cv_lib_$ac_lib_var=yes" … … 4081 4085 fi 4082 4086 echo $ac_n "checking for main in -lsmallgmp""... $ac_c" 1>&6 4083 echo "configure:408 4: checking for main in -lsmallgmp" >&54087 echo "configure:4088: checking for main in -lsmallgmp" >&5 4084 4088 ac_lib_var=`echo smallgmp'_'main | sed 'y%./+-%__p_%'` 4085 4089 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 4089 4093 LIBS="-lsmallgmp $LIBS" 4090 4094 cat > conftest.$ac_ext <<EOF 4091 #line 409 2"configure"4095 #line 4096 "configure" 4092 4096 #include "confdefs.h" 4093 4097 … … 4096 4100 ; return 0; } 4097 4101 EOF 4098 if { (eval echo configure:4 099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then4102 if { (eval echo configure:4103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 4099 4103 rm -rf conftest* 4100 4104 eval "ac_cv_lib_$ac_lib_var=yes" … … 4125 4129 SAVE_LIBS=$LIBS 4126 4130 echo $ac_n "checking for IMP_PutGmpInt in -lMP""... $ac_c" 1>&6 4127 echo "configure:41 28: checking for IMP_PutGmpInt in -lMP" >&54131 echo "configure:4132: checking for IMP_PutGmpInt in -lMP" >&5 4128 4132 ac_lib_var=`echo MP'_'IMP_PutGmpInt | sed 'y%./+-%__p_%'` 4129 4133 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 4133 4137 LIBS="-lMP $MP_LIBS $LIBS" 4134 4138 cat > conftest.$ac_ext <<EOF 4135 #line 41 36"configure"4139 #line 4140 "configure" 4136 4140 #include "confdefs.h" 4137 4141 /* Override any gcc2 internal prototype to avoid an error. */ … … 4144 4148 ; return 0; } 4145 4149 EOF 4146 if { (eval echo configure:41 47: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then4150 if { (eval echo configure:4151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 4147 4151 rm -rf conftest* 4148 4152 eval "ac_cv_lib_$ac_lib_var=yes" … … 4172 4176 4173 4177 echo $ac_n "checking for MPT_GetTree in -lMPT""... $ac_c" 1>&6 4174 echo "configure:417 5: checking for MPT_GetTree in -lMPT" >&54178 echo "configure:4179: checking for MPT_GetTree in -lMPT" >&5 4175 4179 ac_lib_var=`echo MPT'_'MPT_GetTree | sed 'y%./+-%__p_%'` 4176 4180 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 4180 4184 LIBS="-lMPT $MP_LIBS $LIBS" 4181 4185 cat > conftest.$ac_ext <<EOF 4182 #line 418 3"configure"4186 #line 4187 "configure" 4183 4187 #include "confdefs.h" 4184 4188 /* Override any gcc2 internal prototype to avoid an error. */ … … 4191 4195 ; return 0; } 4192 4196 EOF 4193 if { (eval echo configure:419 4: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then4197 if { (eval echo configure:4198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 4194 4198 rm -rf conftest* 4195 4199 eval "ac_cv_lib_$ac_lib_var=yes" … … 4220 4224 LIBS=$SAVE_LIBS 4221 4225 echo $ac_n "checking for atof in -lsingcf""... $ac_c" 1>&6 4222 echo "configure:422 3: checking for atof in -lsingcf" >&54226 echo "configure:4227: checking for atof in -lsingcf" >&5 4223 4227 ac_lib_var=`echo singcf'_'atof | sed 'y%./+-%__p_%'` 4224 4228 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 4228 4232 LIBS="-lsingcf $LIBS" 4229 4233 cat > conftest.$ac_ext <<EOF 4230 #line 423 1"configure"4234 #line 4235 "configure" 4231 4235 #include "confdefs.h" 4232 4236 /* Override any gcc2 internal prototype to avoid an error. */ … … 4239 4243 ; return 0; } 4240 4244 EOF 4241 if { (eval echo configure:424 2: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then4245 if { (eval echo configure:4246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 4242 4246 rm -rf conftest* 4243 4247 eval "ac_cv_lib_$ac_lib_var=yes" … … 4267 4271 4268 4272 echo $ac_n "checking for atof in -lsingfac""... $ac_c" 1>&6 4269 echo "configure:427 0: checking for atof in -lsingfac" >&54273 echo "configure:4274: checking for atof in -lsingfac" >&5 4270 4274 ac_lib_var=`echo singfac'_'atof | sed 'y%./+-%__p_%'` 4271 4275 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 4275 4279 LIBS="-lsingfac $LIBS" 4276 4280 cat > conftest.$ac_ext <<EOF 4277 #line 42 78"configure"4281 #line 4282 "configure" 4278 4282 #include "confdefs.h" 4279 4283 /* Override any gcc2 internal prototype to avoid an error. */ … … 4286 4290 ; return 0; } 4287 4291 EOF 4288 if { (eval echo configure:42 89: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then4292 if { (eval echo configure:4293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 4289 4293 rm -rf conftest* 4290 4294 eval "ac_cv_lib_$ac_lib_var=yes" … … 4314 4318 4315 4319 echo $ac_n "checking for omTestAddr in -lomalloc""... $ac_c" 1>&6 4316 echo "configure:43 17: checking for omTestAddr in -lomalloc" >&54320 echo "configure:4321: checking for omTestAddr in -lomalloc" >&5 4317 4321 ac_lib_var=`echo omalloc'_'omTestAddr | sed 'y%./+-%__p_%'` 4318 4322 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 4322 4326 LIBS="-lomalloc $LIBS" 4323 4327 cat > conftest.$ac_ext <<EOF 4324 #line 432 5"configure"4328 #line 4329 "configure" 4325 4329 #include "confdefs.h" 4326 4330 /* Override any gcc2 internal prototype to avoid an error. */ … … 4333 4337 ; return 0; } 4334 4338 EOF 4335 if { (eval echo configure:43 36: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then4339 if { (eval echo configure:4340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 4336 4340 rm -rf conftest* 4337 4341 eval "ac_cv_lib_$ac_lib_var=yes" … … 4361 4365 4362 4366 echo $ac_n "checking for main in -lomalloc_ndebug""... $ac_c" 1>&6 4363 echo "configure:436 4: checking for main in -lomalloc_ndebug" >&54367 echo "configure:4368: checking for main in -lomalloc_ndebug" >&5 4364 4368 ac_lib_var=`echo omalloc_ndebug'_'main | sed 'y%./+-%__p_%'` 4365 4369 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 4369 4373 LIBS="-lomalloc_ndebug $LIBS" 4370 4374 cat > conftest.$ac_ext <<EOF 4371 #line 437 2"configure"4375 #line 4376 "configure" 4372 4376 #include "confdefs.h" 4373 4377 … … 4376 4380 ; return 0; } 4377 4381 EOF 4378 if { (eval echo configure:43 79: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then4382 if { (eval echo configure:4383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 4379 4383 rm -rf conftest* 4380 4384 eval "ac_cv_lib_$ac_lib_var=yes" … … 4408 4412 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 4409 4413 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 4410 echo "configure:441 1: checking for $ac_hdr" >&54414 echo "configure:4415: checking for $ac_hdr" >&5 4411 4415 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 4412 4416 echo $ac_n "(cached) $ac_c" 1>&6 4413 4417 else 4414 4418 cat > conftest.$ac_ext <<EOF 4415 #line 44 16"configure"4419 #line 4420 "configure" 4416 4420 #include "confdefs.h" 4417 4421 #include <$ac_hdr> 4418 4422 EOF 4419 4423 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 4420 { (eval echo configure:442 1: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }4424 { (eval echo configure:4425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 4421 4425 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 4422 4426 if test -z "$ac_err"; then … … 4487 4491 4488 4492 echo $ac_n "checking which apint package to use""... $ac_c" 1>&6 4489 echo "configure:449 0: checking which apint package to use" >&54493 echo "configure:4494: checking which apint package to use" >&5 4490 4494 if test "${with_apint}" != gmp && test "${with_apint}" != smallgmp; then 4491 4495 if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then … … 4529 4533 # 4530 4534 echo $ac_n "checking whether to have MP""... $ac_c" 1>&6 4531 echo "configure:453 2: checking whether to have MP" >&54535 echo "configure:4536: checking whether to have MP" >&5 4532 4536 if test "${with_MP}" != yes && test "${with_MP}" != no; then 4533 4537 if (test "${will_have_gmp}" = yes) && \ … … 4564 4568 4565 4569 echo $ac_n "checking whether to have factory""... $ac_c" 1>&6 4566 echo "configure:45 67: checking whether to have factory" >&54570 echo "configure:4571: checking whether to have factory" >&5 4567 4571 if test "${with_factory}" != yes && test "${with_factory}" != no; then 4568 4572 if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then … … 4595 4599 4596 4600 echo $ac_n "checking whether to have libfac""... $ac_c" 1>&6 4597 echo "configure:4 598: checking whether to have libfac" >&54601 echo "configure:4602: checking whether to have libfac" >&5 4598 4602 if test "${with_libfac}" != yes && test "${with_libfac}" != no; then 4599 4603 if (test "${will_have_factory}" = yes) && \ … … 4629 4633 4630 4634 echo $ac_n "checking whether to have dbm links""... $ac_c" 1>&6 4631 echo "configure:463 2: checking whether to have dbm links" >&54635 echo "configure:4636: checking whether to have dbm links" >&5 4632 4636 if test "$with_dbm" != no; then 4633 4637 cat >> confdefs.h <<\EOF … … 4641 4645 4642 4646 echo $ac_n "checking whether to have namespaces""... $ac_c" 1>&6 4643 echo "configure:464 4: checking whether to have namespaces" >&54647 echo "configure:4648: checking whether to have namespaces" >&5 4644 4648 if test "$with_namespaces" != yes; then 4645 4649 echo "$ac_t""no" 1>&6 … … 4653 4657 4654 4658 echo $ac_n "checking whether to have dynamic modules""... $ac_c" 1>&6 4655 echo "configure:46 56: checking whether to have dynamic modules" >&54659 echo "configure:4660: checking whether to have dynamic modules" >&5 4656 4660 if test "$with_dynamic_modules" != yes || test "$ac_have_dl" != yes; then 4657 4661 echo "$ac_t""no" 1>&6 … … 4665 4669 4666 4670 echo $ac_n "checking whether to have dynamic kernel""... $ac_c" 1>&6 4667 echo "configure:46 68: checking whether to have dynamic kernel" >&54671 echo "configure:4672: checking whether to have dynamic kernel" >&5 4668 4672 if test "$with_dynamic_kernel" != no && test "$ac_lib_dl" = yes; then 4669 4673 DL_KERNEL=1 … … 4673 4677 4674 4678 echo $ac_n "checking whether to have Plural""... $ac_c" 1>&6 4675 echo "configure:46 76: checking whether to have Plural" >&54679 echo "configure:4680: checking whether to have Plural" >&5 4676 4680 if test "$with_plural" != yes; then 4677 4681 echo "$ac_t""no" 1>&6 -
Singular/configure.in
r33ec11 r2f436b 48 48 SINGULAR_MAJOR_VERSION=${SINGULAR_MAJOR_VERSION:-1} 49 49 SINGULAR_MINOR_VERSION=${SINGULAR_MINOR_VERSION:-3} 50 SINGULAR_SUB_VERSION=${SINGULAR_SUB_VERSION:-1 2}50 SINGULAR_SUB_VERSION=${SINGULAR_SUB_VERSION:-13} 51 51 SINGULAR_VERSION="${SINGULAR_VERSION:-$SINGULAR_MAJOR_VERSION${VERSION_SEP}$SINGULAR_MINOR_VERSION${VERSION_SEP}$SINGULAR_SUB_VERSION}" 52 VERSION_DATE=${VERSION_DATE:-" December 2000"}52 VERSION_DATE=${VERSION_DATE:-"January 2001"} 53 53 54 54 dnl pass them on into the Makefiles -
Singular/dError.c
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 9/00 9 * Version: $Id: dError.c,v 1. 5 2000-11-06 15:20:37obachman Exp $9 * Version: $Id: dError.c,v 1.6 2000-12-31 15:14:29 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef DERROR_C … … 33 33 fprintf(stderr, "\n// ***dErrror: "); 34 34 vfprintf(stderr, fmt, ap); 35 #if !defined(OM_NDEBUG) && defined(HAVE_CONFIG_H) 35 36 fprintf(stderr, " occured at: \n"); 36 #ifdef HAVE_CONFIG_H37 37 omPrintCurrentBackTraceMax(stderr, 8); 38 38 #endif -
Singular/dError.h
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 9/00 9 * Version: $Id: dError.h,v 1. 4 2000-12-07 15:03:55obachman Exp $9 * Version: $Id: dError.h,v 1.5 2000-12-31 15:14:29 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef DERROR_H … … 18 18 extern int dReportError(const char* fmt, ...); 19 19 #define dReportBug(s) \ 20 dReportError("Bug reported %s\n occured at %s,%l\n", s, __FILE__, __LINE__)20 dReportError("Bug reported: %s\n occured at %s,%d\n", s, __FILE__, __LINE__) 21 21 #endif 22 22 -
Singular/ideals.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.11 8 2000-12-14 16:38:48obachman Exp $ */4 /* $Id: ideals.cc,v 1.119 2000-12-31 15:14:30 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 2592 2592 } 2593 2593 2594 // #define NEW_STUFF 2595 #ifndef NEW_STUFF 2594 2596 // converts mat to module, destroys mat 2595 2597 ideal idMatrix2Module(matrix mat) … … 2622 2624 return result; 2623 2625 } 2626 #else 2627 2628 #include "sbuckets.h" 2629 2630 // converts mat to module, destroys mat 2631 ideal idMatrix2Module(matrix mat) 2632 { 2633 ideal result = idInit(MATCOLS(mat),MATROWS(mat)); 2634 int i,j, l; 2635 poly h; 2636 poly p; 2637 sBucket_pt bucket = sBucketInit(currRing); 2638 2639 for(j=0;j<MATCOLS(mat);j++) /* j is also index in result->m */ 2640 { 2641 for (i=1;i<=MATROWS(mat);i++) 2642 { 2643 h = MATELEM(mat,i,j+1); 2644 if (h!=NULL) 2645 { 2646 MATELEM(mat,i,j+1)=NULL; 2647 p_SetCompP(h,i, currRing, &l); 2648 sBucket_Merge_p(bucket, h, l); 2649 } 2650 } 2651 sBucketClearMerge(bucket, &(result->m[j]), &l); 2652 } 2653 2654 // obachman: need to clean this up 2655 idDelete((ideal*) &mat); 2656 return result; 2657 } 2658 #endif 2624 2659 2625 2660 /*2 … … 2667 2702 } 2668 2703 } 2669 // obachman 10/99: added the following line, otherwise memory lack!2704 // obachman 10/99: added the following line, otherwise memory leack! 2670 2705 idDelete(&mod); 2671 2706 return result; -
Singular/iparith.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.24 4 2000-12-19 18:31:39obachman Exp $ */4 /* $Id: iparith.cc,v 1.245 2000-12-31 15:14:30 obachman Exp $ */ 5 5 6 6 /* … … 1744 1744 return FALSE; 1745 1745 } 1746 static BOOLEAN jjGCD_N(leftv res, leftv u, leftv v) 1747 { 1748 res->rtyp=NUMBER_CMD; 1749 res->data=(char *)nGcd((number) u->Data(), (number) v->Data()); 1750 return FALSE; 1751 } 1746 1752 static BOOLEAN jjHILBERT2(leftv res, leftv u, leftv v) 1747 1753 { … … 2353 2359 ,{jjWRONG2, GCD_CMD, POLY_CMD, POLY_CMD, POLY_CMD PROFILER} 2354 2360 #endif 2361 ,{jjGCD_N, GCD_CMD, NUMBER_CMD, NUMBER_CMD, NUMBER_CMD PROFILER} 2355 2362 ,{jjHILBERT2, HILBERT_CMD, INTVEC_CMD, IDEAL_CMD, INT_CMD PROFILER} 2356 2363 ,{jjHILBERT2, HILBERT_CMD, INTVEC_CMD, MODUL_CMD, INT_CMD PROFILER} -
Singular/kInline.cc
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: kInline.cc,v 1.2 2 2000-12-21 16:37:49obachman Exp $9 * Version: $Id: kInline.cc,v 1.23 2000-12-31 15:14:32 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef KINLINE_CC … … 269 269 } 270 270 271 KINLINE poly sTObject::Next() 272 { 273 assume(p != NULL || t_p != NULL); 274 if (t_p != NULL) return pNext(t_p); 275 return pNext(p); 276 } 271 277 272 278 // Iterations … … 620 626 new_tailRing->PolyBin,p_shallow_copy_delete, 621 627 FALSE); 628 last = NULL; 622 629 } 623 630 … … 691 698 692 699 if (last == NULL || pLength == 0) 693 last = pLast( (t_p != NULL ? t_p : p), pLength);700 last = pLast(GetLmTailRing(), pLength); 694 701 #ifdef HAVE_ASSUME 695 702 long fdeg; -
Singular/kbuckets.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kbuckets.cc,v 1.2 2 2000-11-28 11:50:51obachman Exp $ */4 /* $Id: kbuckets.cc,v 1.23 2000-12-31 15:14:32 obachman Exp $ */ 5 5 6 6 #include "mod2.h" … … 137 137 } 138 138 139 140 139 ///////////////////////////////////////////////////////////////////////////// 141 140 // Convertion from/to Bpolys … … 270 269 *length = 0; 271 270 } 271 } 272 273 void kBucketSetLm(kBucket_pt bucket, poly lm) 274 { 275 kBucketMergeLm(bucket); 276 pNext(lm) = NULL; 277 bucket->buckets[0] = lm; 278 bucket->buckets_length[0] = 1; 272 279 } 273 280 … … 358 365 } 359 366 367 368 ////////////////////////////////////////////////////////////////////////// 369 /// 370 /// Add to Bucket a poly ,i.e. Bpoly == n*Bpoly 371 /// 372 void kBucket_Add_q(kBucket_pt bucket, poly q, int *l) 373 { 374 if (q == NULL) return; 375 assume(*l <= 0 || pLength(q) == *l); 376 377 int i, l1; 378 ring r = bucket->bucket_ring; 379 380 if (*l <= 0) 381 { 382 l1 = pLength(q); 383 *l = l1; 384 } 385 else 386 l1 = *l; 387 388 kBucketMergeLm(bucket); 389 kbTest(bucket); 390 i = pLogLength(l1); 391 392 while (bucket->buckets[i] != NULL) 393 { 394 q = p_Add_q(q, bucket->buckets[i], 395 l1, bucket->buckets_length[i], r); 396 bucket->buckets[i] = NULL; 397 bucket->buckets_length[i] = 0; 398 i = pLogLength(l1); 399 } 400 401 bucket->buckets[i] = q; 402 bucket->buckets_length[i]=l1; 403 if (i >= bucket->buckets_used) 404 bucket->buckets_used = i; 405 else 406 kBucketAdjustBucketsUsed(bucket); 407 kbTest(bucket); 408 } 409 410 411 360 412 ////////////////////////////////////////////////////////////////////////// 361 413 /// … … 432 484 #endif 433 485 kbTest(bucket); 486 } 487 488 ////////////////////////////////////////////////////////////////////////// 489 /// 490 /// Bpoly == Bpoly - m*p; where m is a monom 491 /// Does not destroy p and m 492 /// assume (l <= 0 || pLength(p) == l) 493 void kBucket_Plus_mm_Mult_pp(kBucket_pt bucket, poly m, poly p, int l) 494 { 495 assume(l <= 0 || pLength(p) == l); 496 int i, l1; 497 poly p1 = p; 498 poly last; 499 ring r = bucket->bucket_ring; 500 501 if (l <= 0) 502 { 503 l1 = pLength(p1); 504 l = l1; 505 } 506 else 507 l1 = l; 508 509 if (m == NULL || p == NULL) return; 510 511 kBucketMergeLm(bucket); 512 kbTest(bucket); 513 i = pLogLength(l1); 514 515 if (i <= bucket->buckets_used && bucket->buckets[i] != NULL) 516 { 517 p1 = p_Plus_mm_Mult_qq(bucket->buckets[i], m, p1, 518 bucket->buckets_length[i], l1, r); 519 l1 = bucket->buckets_length[i]; 520 bucket->buckets[i] = NULL; 521 bucket->buckets_length[i] = 0; 522 i = pLogLength(l1); 523 } 524 else 525 { 526 p1 = r->p_Procs->pp_Mult_mm(p1, m, r, last); 527 } 528 529 while (bucket->buckets[i] != NULL) 530 { 531 p1 = p_Add_q(p1, bucket->buckets[i], 532 l1, bucket->buckets_length[i], r); 533 bucket->buckets[i] = NULL; 534 bucket->buckets_length[i] = 0; 535 i = pLogLength(l1); 536 } 537 538 bucket->buckets[i] = p1; 539 bucket->buckets_length[i]=l1; 540 if (i >= bucket->buckets_used) 541 bucket->buckets_used = i; 542 else 543 kBucketAdjustBucketsUsed(bucket); 544 545 kbTest(bucket); 546 } 547 548 poly kBucket_ExtractLarger(kBucket_pt bucket, poly q, poly append) 549 { 550 if (q == NULL) return append; 551 poly lm; 552 do 553 { 554 lm = kBucketGetLm(bucket); 555 if (lm == NULL) return append; 556 if (p_LmCmp(lm, q, bucket->bucket_ring) == 1) 557 { 558 lm = kBucketExtractLm(bucket); 559 pNext(append) = lm; 560 pIter(append); 561 } 562 else 563 { 564 return append; 565 } 566 } 567 while (1); 434 568 } 435 569 -
Singular/kbuckets.h
r33ec11 r2f436b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kbuckets.h,v 1.1 3 2000-11-28 11:50:52 obachman Exp $ */6 /* $Id: kbuckets.h,v 1.14 2000-12-31 15:14:32 obachman Exp $ */ 7 7 #include "structs.h" 8 8 #include "p_Procs.h" … … 37 37 // i.e., afterwards Bpoly == 0 38 38 void kBucketClear(kBucket_pt bucket, poly *p, int *length); 39 inline poly kBucketClear(kBucket_pt bucket) 40 { 41 int dummy; 42 poly p; 43 kBucketClear(bucket, &p, &dummy); 44 return p; 45 } 39 46 40 47 // Canonicalizes Bpoly, i.e. converts polys of buckets into one poly in … … 53 60 // 54 61 inline poly kBucketExtractLm(kBucket_pt bucket); 62 63 ///////////////////////////////////////////////////////////////////////////// 64 // Sets Lm of Bpoly, i.e. Bpoly is changed s.t. 65 // Bpoly = Bpoly + m 66 // assumes that m is larger than all monomials of Bpoly 67 void kBucketSetLm(kBucket_pt bucket, poly lm); 68 55 69 56 70 ///////////////////////////////////////////////////////////////////////////// … … 92 106 void kBucket_Mult_n(kBucket_pt bucket, number n); 93 107 108 ////////////////////////////////////////////////////////////////////////// 109 /// 110 /// Extract all monomials of bucket which are larger than q 111 /// Append those to append, and return last monomial of append 112 poly kBucket_ExtractLarger(kBucket_pt bucket, poly q, poly append); 113 114 115 ////////////////////////////////////////////////////////////////////////// 116 /// 117 /// Add to Bucket a poly ,i.e. Bpoly == Bpoly + q 118 /// 119 void kBucket_Add_q(kBucket_pt bucket, poly q, int* lq); 120 121 // first, do ExtractLarger 122 // then add q 123 inline poly 124 kBucket_ExtractLarger_Add_q(kBucket_pt bucket, poly append, poly q, int *lq) 125 { 126 append = kBucket_ExtractLarger(bucket, q, append); 127 kBucket_Add_q(bucket, q, lq); 128 return append; 129 } 94 130 95 131 ////////////////////////////////////////////////////////////////////////// … … 101 137 poly spNother = NULL); 102 138 139 ////////////////////////////////////////////////////////////////////////// 140 /// 141 /// Bpoly == Bpoly + m*p; where m is a monom 142 /// Does not destroy p and m 143 /// assume (l <= 0 || pLength(p) == l) 144 void kBucket_Plus_mm_Mult_pp(kBucket_pt bucket, poly m, poly p, int l); 103 145 104 146 ////////////////////////////////////////////////////////////////////////// -
Singular/kstd1.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.7 6 2000-12-21 16:37:49obachman Exp $ */4 /* $Id: kstd1.cc,v 1.77 2000-12-31 15:14:33 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 11 11 12 12 // define if tailrings should be used 13 //#define HAVE_TAIL_RING13 #define HAVE_TAIL_RING 14 14 15 15 #include "mod2.h" … … 738 738 { 739 739 pLmFree(strat->L[j].p); /*deletes the short spoly and computes*/ 740 strat->L[j].p = NULL; 740 741 poly m1 = NULL, m2 = NULL; 741 742 // check that spoly creation is ok … … 752 753 strat->tailRing, m1, m2, strat->R); 753 754 755 strat->L[j].SetLmCurrRing(); 754 756 if (!strat->honey) 755 757 strat->initEcart(&strat->L[j]); … … 795 797 { 796 798 pLmFree(strat->L[i].p); 799 strat->L[i].p = NULL; 797 800 poly m1 = NULL, m2 = NULL; 798 801 // check that spoly creation is ok … … 810 813 if (! strat->L[i].IsNull()) 811 814 { 815 strat->L[i].SetLmCurrRing(); 812 816 strat->L[i].SetpFDeg(); 813 817 strat->L[i].ecart -
Singular/kutil.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.9 1 2000-12-21 16:37:50obachman Exp $ */4 /* $Id: kutil.cc,v 1.92 2000-12-31 15:14:33 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 696 696 { 697 697 kFalseReturn(kTest_L(&(strat->L[i]), strat->tailRing, 698 (pNext(strat->L[i].p) != strat->tail), i,698 strat->L[i].Next() != strat->tail, i, 699 699 strat->T, strat->tl)); 700 if (strat->use_buckets && pNext(strat->L[i].p) != strat->tail &&701 strat->L[i]. p1 != NULL)700 if (strat->use_buckets && strat->L[i].Next() != strat->tail && 701 strat->L[i].Next() != NULL && strat->L[i].p1 != NULL) 702 702 { 703 703 assume(strat->L[i].bucket != NULL); -
Singular/kutil.h
r33ec11 r2f436b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1.5 3 2000-12-21 16:37:51obachman Exp $ */6 /* $Id: kutil.h,v 1.54 2000-12-31 15:14:34 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for kStd … … 96 96 97 97 // Iterations 98 // simply get the next monomial 99 KINLINE poly Next(); 98 100 KINLINE void LmDeleteAndIter(); 99 101 -
Singular/longalg.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longalg.cc,v 1.5 2 2000-12-15 18:49:31 SingularExp $ */4 /* $Id: longalg.cc,v 1.53 2000-12-31 15:14:35 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: algebraic numbers … … 2570 2570 BOOLEAN naDBTest(number a, char *f,int l) 2571 2571 { 2572 #if 0 2572 2573 lnumber x=(lnumber)a; 2573 2574 if (x == NULL) … … 2612 2613 p = p->ne; 2613 2614 } 2615 #endif 2614 2616 return TRUE; 2615 2617 } -
Singular/matpol.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: matpol.cc,v 1.3 6 2000-12-20 17:20:01obachman Exp $ */4 /* $Id: matpol.cc,v 1.37 2000-12-31 15:14:35 obachman Exp $ */ 5 5 6 6 /* … … 33 33 /*0 implementation*/ 34 34 35 static void ppp(matrix);36 static void qqq() {int i=0;}37 35 38 36 typedef int perm[100]; -
Singular/mpr_numeric.cc
r33ec11 r2f436b 3 3 ****************************************/ 4 4 5 /* $Id: mpr_numeric.cc,v 1.1 2 2000-12-18 15:44:42obachman Exp $ */5 /* $Id: mpr_numeric.cc,v 1.13 2000-12-31 15:14:36 obachman Exp $ */ 6 6 7 7 /* … … 150 150 omFreeSize( (ADDRESS) exp, (n+1) * sizeof(Exponent_t) ); 151 151 152 p OrdPolyMerge(pit);152 pSortAdd(pit); 153 153 return pit; 154 154 } -
Singular/mpsr_Get.cc
r33ec11 r2f436b 3 3 ****************************************/ 4 4 5 /* $Id: mpsr_Get.cc,v 1.3 4 2000-12-12 11:03:00obachman Exp $ */5 /* $Id: mpsr_Get.cc,v 1.35 2000-12-31 15:14:36 obachman Exp $ */ 6 6 /*************************************************************** 7 7 * … … 566 566 567 567 failr(mpsr_GetPoly(link, p, node->numchild, mlv->r)); 568 if (IsUnOrdered) p = p OrdPolyMerge(p);568 if (IsUnOrdered) p = pSort(p); 569 569 pTest(p); 570 570 mlv->lv = mpsr_InitLeftv(POLY_CMD, (void *) p); … … 580 580 581 581 failr(mpsr_GetPolyVector(link, p, node->numchild, mlv->r)); 582 if (IsUnOrdered) p = p OrdPolyMerge(p);582 if (IsUnOrdered) p = pSort(p); 583 583 pTest(p); 584 584 mlv->lv = mpsr_InitLeftv(VECTOR_CMD, (void *) p); … … 599 599 mp_failr(IMP_GetUint32(link, &nmon)); 600 600 failr(mpsr_GetPoly(link, id->m[i], nmon, r)); 601 if (IsUnOrdered) id->m[i] = p OrdPolyMerge(id->m[i]);601 if (IsUnOrdered) id->m[i] = pSort(id->m[i]); 602 602 } 603 603 idTest(id); … … 626 626 mp_failr(IMP_GetUint32(link, &nmon)); 627 627 failr(mpsr_GetPolyVector(link, id->m[i], nmon, r)); 628 if (IsUnOrdered) id->m[i] = p OrdPolyMerge(id->m[i]);628 if (IsUnOrdered) id->m[i] = pSort(id->m[i]); 629 629 } 630 630 if (rank == 1) … … 664 664 mp_failr(IMP_GetUint32(link, &nmon)); 665 665 failr(mpsr_GetPoly(link, mp->m[i], nmon, mlv->r)); 666 if (IsUnOrdered) mp->m[i] = p OrdPolyMerge(mp->m[i]);666 if (IsUnOrdered) mp->m[i] = pSort(mp->m[i]); 667 667 } 668 668 -
Singular/pInline0.h
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pInline0.h,v 1. 5 2000-11-23 17:34:11obachman Exp $9 * Version: $Id: pInline0.h,v 1.6 2000-12-31 15:14:37 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE0_H … … 20 20 #include "mod2.h" 21 21 #include "p_polys.h" 22 #include "ring.h" 22 23 23 PINLINE0 voidp_SetCompP(poly p, int i, ring r)24 PINLINE0 int p_SetCompP(poly p, int i, ring r) 24 25 { 25 while (p != NULL) 26 if (p == NULL) return 0; 27 28 #ifdef PDEBUG 29 poly q = p; 30 #endif 31 32 int l = 0; 33 34 if (rOrd_SetCompRequiresSetm(r)) 26 35 { 27 p_SetComp(p, i, r); 28 p_SetmComp(p, r); 29 pIter(p); 36 do 37 { 38 p_SetComp(p, i, r); 39 p_SetmComp(p, r); 40 l++; 41 pIter(p); 42 } 43 while (p != NULL); 30 44 } 45 else 46 { 47 do 48 { 49 p_SetComp(p, i, r); 50 l++; 51 pIter(p); 52 } 53 while(p != NULL); 54 } 55 #ifdef PDEBUG 56 p_Test(q, r); 57 assume(l == pLength(q)); 58 #endif 59 return l; 31 60 } 32 61 33 PINLINE0 voidp_SetCompP(poly p, int i, ring lmRing, ring tailRing)62 PINLINE0 int p_SetCompP(poly p, int i, ring lmRing, ring tailRing) 34 63 { 35 64 if (p != NULL) … … 37 66 p_SetComp(p, i, lmRing); 38 67 p_SetmComp(p, lmRing); 39 p_SetCompP(pNext(p), i, tailRing);68 return p_SetCompP(pNext(p), i, tailRing) + 1; 40 69 } 70 else 71 return 0; 41 72 } 42 73 … … 77 108 } 78 109 return result; 110 } 111 112 BOOLEAN p_IsConstantPoly(poly p, ring r) 113 { 114 while(p!=NULL) 115 { 116 if (! p_LmIsConstantComp(p, r)) 117 return FALSE; 118 pIter(p); 119 } 120 return TRUE; 79 121 } 80 122 -
Singular/pInline1.h
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pInline1.h,v 1.1 4 2000-12-05 13:01:11obachman Exp $9 * Version: $Id: pInline1.h,v 1.15 2000-12-31 15:14:37 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE1_H … … 492 492 return TRUE; 493 493 } 494 // test if monomial is a constant, i.e. if all exponents and the component 495 // is zero 496 PINLINE1 BOOLEAN p_LmIsConstant(const poly p, const ring r) 497 { 498 if (p_LmIsConstantComp(p, r)) 499 return (p_GetComp(p, r) == 0); 500 return FALSE; 501 } 502 503 // like the respective p_LmIs* routines, except that p might be empty 504 PINLINE1 BOOLEAN p_IsConstantComp(const poly p, const ring r) 505 { 506 if (p == NULL) return TRUE; 507 return p_LmIsConstantComp(p, r); 508 } 509 510 PINLINE1 BOOLEAN p_IsConstant(const poly p, const ring r) 511 { 512 if (p == NULL) return TRUE; 513 return p_LmIsConstant(p, r); 514 } 494 515 495 516 PINLINE1 BOOLEAN p_LmExpVectorAddIsOk(const poly p1, const poly p2, -
Singular/pInline2.h
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pInline2.h,v 1.2 2 2000-12-05 13:01:11obachman Exp $9 * Version: $Id: pInline2.h,v 1.23 2000-12-31 15:14:37 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE2_H … … 23 23 #include "numbers.h" 24 24 #include "p_Procs.h" 25 #include "sbuckets.h" 25 26 26 27 PINLINE2 number p_SetCoeff(poly p, number n, ring r) … … 437 438 PINLINE2 poly p_Mult_nn(poly p, number n, const ring r) 438 439 { 439 return r->p_Procs->p_Mult_nn(p, n, r); 440 if (n_IsOne(n, r)) 441 return p; 442 else 443 return r->p_Procs->p_Mult_nn(p, n, r); 440 444 } 441 445 … … 459 463 PINLINE2 poly pp_Mult_nn(poly p, number n, const ring r) 460 464 { 461 return r->p_Procs->pp_Mult_nn(p, n, r); 465 if (n_IsOne(n, r)) 466 return p_Copy(p, r); 467 else 468 return r->p_Procs->pp_Mult_nn(p, n, r); 462 469 } 463 470 … … 465 472 PINLINE2 poly pp_Mult_mm(poly p, poly m, const ring r) 466 473 { 467 poly last; 468 return r->p_Procs->pp_Mult_mm(p, m, r, last); 474 if (p_LmIsConstant(m, r)) 475 return pp_Mult_nn(p, pGetCoeff(m), r); 476 else 477 { 478 poly last; 479 return r->p_Procs->pp_Mult_mm(p, m, r, last); 480 } 469 481 } 470 482 … … 472 484 PINLINE2 poly p_Mult_mm(poly p, poly m, const ring r) 473 485 { 474 return r->p_Procs->p_Mult_mm(p, m, r); 486 if (p_LmIsConstant(m, r)) 487 return p_Mult_nn(p, pGetCoeff(m), r); 488 else 489 return r->p_Procs->p_Mult_mm(p, m, r); 475 490 } 476 491 … … 494 509 PINLINE2 poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, const ring r) 495 510 { 496 return r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, r); 511 int shorter; 512 return r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, shorter, r); 513 } 514 515 PINLINE2 poly pp_Mult_Coeff_mm_DivSelect(poly p, int &lp, const poly m, const ring r) 516 { 517 int shorter; 518 poly pp = r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, shorter, r); 519 lp -= shorter; 520 return pp; 497 521 } 498 522 … … 565 589 // returns p + m*q destroys p, const: q, m 566 590 // this should be implemented more efficiently 567 PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, const ring r) 591 PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, 592 const ring r) 568 593 { 569 594 poly res, last; … … 575 600 576 601 res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, NULL, r, last); 602 lp = (lp + lq) - shorter; 577 603 pSetCoeff0(m, n_old); 578 604 n_Delete(&n_neg, r); … … 580 606 } 581 607 608 PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, const ring r) 609 { 610 int lp = 0, lq = 0; 611 return p_Plus_mm_Mult_qq(p, m, q, lp, lq, r); 612 } 613 582 614 PINLINE2 poly p_Merge_q(poly p, poly q, const ring r) 583 615 { 584 616 return r->p_Procs->p_Merge_q(p, q, r); 617 } 618 619 PINLINE2 poly p_SortAdd(poly p, const ring r, BOOLEAN revert) 620 { 621 if (revert) p = pReverse(p); 622 return sBucketSortAdd(p, r); 623 } 624 625 PINLINE2 poly p_SortMerge(poly p, const ring r, BOOLEAN revert) 626 { 627 if (revert) p = pReverse(p); 628 return sBucketSortMerge(p, r); 585 629 } 586 630 -
Singular/p_MemCmp.h
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_MemCmp.h,v 1. 1 2000-09-04 14:08:17 obachman Exp $9 * Version: $Id: p_MemCmp.h,v 1.2 2000-12-31 15:14:37 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef P_MEM_CMP_H … … 765 765 while (0) 766 766 767 /*************************************************************** 768 * 769 * Bitmask 770 * 771 *******************************************************************/ 772 #define _p_MemCmp_Bitmask_Declare(s1, s2, bitmask) \ 773 const unsigned long* _s1 = ((unsigned long*) s1); \ 774 const unsigned long* _s2 = ((unsigned long*) s2); \ 775 register const unsigned long _bitmask = bitmask; \ 776 register unsigned long _v1; \ 777 register unsigned long _v2; \ 778 register unsigned long _i \ 779 780 781 #define p_MemCmp_Bitmask_LengthGeneral(s1, s2, bitmask, length, actionG, actionS) \ 782 do \ 783 { \ 784 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 785 const unsigned long _l = (unsigned long) length; \ 786 \ 787 _i=0; \ 788 \ 789 while (_i < _l) \ 790 { \ 791 _v1 = _s1[_i]; \ 792 _v2 = _s2[_i]; \ 793 \ 794 if ((_v1 > _v2) || \ 795 (((_v1 & _bitmask) ^ (_v2 & _bitmask)) != ((_v2 - _v1) & _bitmask))) \ 796 actionS; \ 797 _i++; \ 798 } \ 799 actionG; \ 800 } \ 801 while (0) 802 803 804 #define _p_MemCmp_Bitmask(i, actionS) \ 805 do \ 806 { \ 807 _i = i; \ 808 _v1 = _s1[i]; \ 809 _v2 = _s2[i]; \ 810 if ((_v1 > _v2) || \ 811 (((_v1 & _bitmask) ^ (_v2 & _bitmask)) != ((_v2 - _v1) & _bitmask))) \ 812 actionS; \ 813 } \ 814 while (0) 815 816 #define _p_MemCmp_Bitmask_LengthTwo(actionS) \ 817 do \ 818 { \ 819 _p_MemCmp_Bitmask(0, actionS); \ 820 _p_MemCmp_Bitmask(1, actionS); \ 821 } \ 822 while (0) 823 824 #define _p_MemCmp_Bitmask_LengthThree(actionS) \ 825 do \ 826 { \ 827 _p_MemCmp_Bitmask_LengthTwo(actionS); \ 828 _p_MemCmp_Bitmask(2, actionS); \ 829 } \ 830 while (0) 831 832 #define _p_MemCmp_Bitmask_LengthFour(actionS) \ 833 do \ 834 { \ 835 _p_MemCmp_Bitmask_LengthThree(actionS); \ 836 _p_MemCmp_Bitmask(3, actionS); \ 837 } \ 838 while (0) 839 840 841 #define _p_MemCmp_Bitmask_LengthFive(actionS) \ 842 do \ 843 { \ 844 _p_MemCmp_Bitmask_LengthFour(actionS); \ 845 _p_MemCmp_Bitmask(4, actionS); \ 846 } \ 847 while (0) 848 849 850 #define _p_MemCmp_Bitmask_LengthSix(actionS) \ 851 do \ 852 { \ 853 _p_MemCmp_Bitmask_LengthFive(actionS); \ 854 _p_MemCmp_Bitmask(5, actionS); \ 855 } \ 856 while (0) 857 858 #define _p_MemCmp_Bitmask_LengthSeven(actionS) \ 859 do \ 860 { \ 861 _p_MemCmp_Bitmask_LengthSix(actionS); \ 862 _p_MemCmp_Bitmask(6, actionS); \ 863 } \ 864 while (0) 865 866 #define _p_MemCmp_Bitmask_LengthEight(actionS) \ 867 do \ 868 { \ 869 _p_MemCmp_Bitmask_LengthSeven(actionS); \ 870 _p_MemCmp_Bitmask(7, actionS); \ 871 } \ 872 while (0) 873 874 #define p_MemCmp_Bitmask_LengthZero(s1, s2, bitmask, length, actionG, actionS) actionG 875 876 #define p_MemCmp_Bitmask_LengthOne(s1, s2, bitmask, length, actionG, actionS) \ 877 do \ 878 { \ 879 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 880 _p_MemCmp_Bitmask(0, actionS); \ 881 actionG; \ 882 } \ 883 while (0) 884 885 #define p_MemCmp_Bitmask_LengthTwo(s1, s2, bitmask, length, actionG, actionS) \ 886 do \ 887 { \ 888 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 889 _p_MemCmp_Bitmask_LengthTwo(actionS); \ 890 actionG; \ 891 } \ 892 while (0) 893 894 #define p_MemCmp_Bitmask_LengthThree(s1, s2, bitmask, length, actionG, actionS) \ 895 do \ 896 { \ 897 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 898 _p_MemCmp_Bitmask_LengthThree(actionS); \ 899 actionG; \ 900 } \ 901 while (0) 902 903 #define p_MemCmp_Bitmask_LengthFour(s1, s2, bitmask, length, actionG, actionS) \ 904 do \ 905 { \ 906 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 907 _p_MemCmp_Bitmask_LengthFour(actionS); \ 908 actionG; \ 909 } \ 910 while (0) 911 912 #define p_MemCmp_Bitmask_LengthFive(s1, s2, bitmask, length, actionG, actionS) \ 913 do \ 914 { \ 915 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 916 _p_MemCmp_Bitmask_LengthFive(actionS); \ 917 actionG; \ 918 } \ 919 while (0) 920 921 #define p_MemCmp_Bitmask_LengthSix(s1, s2, bitmask, length, actionG, actionS) \ 922 do \ 923 { \ 924 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 925 _p_MemCmp_Bitmask_LengthSix(actionS); \ 926 actionG; \ 927 } \ 928 while (0) 929 930 #define p_MemCmp_Bitmask_LengthSeven(s1, s2, bitmask, length, actionG, actionS) \ 931 do \ 932 { \ 933 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 934 _p_MemCmp_Bitmask_LengthSeven(actionS); \ 935 actionG; \ 936 } \ 937 while (0) 938 939 #define p_MemCmp_Bitmask_LengthEigth(s1, s2, bitmask, length, actionG, actionS) \ 940 do \ 941 { \ 942 _p_MemCmp_Bitmask_Declare(s1, s2, bitmask); \ 943 _p_MemCmp_Bitmask_LengthEigth(actionS); \ 944 actionG; \ 945 } \ 946 while (0) 947 948 767 949 #endif // P_MEM_CMP -
Singular/p_Merge_q__Template.cc
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Merge_q__Template.cc,v 1. 3 2000-12-07 15:03:58 obachman Exp $9 * Version: $Id: p_Merge_q__Template.cc,v 1.4 2000-12-31 15:14:38 obachman Exp $ 10 10 *******************************************************************/ 11 11 … … 36 36 // should never get here 37 37 dReportError("Equal monomials in p_Merge_q"); 38 goto Finish;39 38 return NULL; 39 40 40 Greater: 41 41 a = pNext(a) = p; -
Singular/p_Mult_q.cc
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Mult_q.cc,v 1. 6 2000-11-23 17:34:11obachman Exp $9 * Version: $Id: p_Mult_q.cc,v 1.7 2000-12-31 15:14:38 obachman Exp $ 10 10 *******************************************************************/ 11 11 #include "mod2.h" … … 20 20 #include "p_Procs.h" 21 21 #include "p_Numbers.h" 22 23 24 poly _p_Mult_q(poly p, poly q, const int copy, const ring r) 22 #include "kbuckets.h" 23 24 #include "p_Mult_q.h" 25 26 BOOLEAN pqLength(poly p, poly q, int &lp, int &lq, const int min) 27 { 28 int l = 0; 29 30 do 31 { 32 if (p == NULL) 33 { 34 lp = l; 35 if (l < min) 36 { 37 if (q != NULL) 38 lq = l+1; 39 else 40 lq = l; 41 return FALSE; 42 } 43 lq = l + pLength(q); 44 return TRUE; 45 } 46 pIter(p); 47 if (q == NULL) 48 { 49 lq = l; 50 if (l < min) 51 { 52 lp = l+1; 53 return FALSE; 54 } 55 lp = l + 1 + pLength(p); 56 return TRUE; 57 } 58 pIter(q); 59 l++; 60 } 61 while (1); 62 } 63 64 65 static poly _p_Mult_q_Bucket(poly p, const int lp, 66 poly q, const int lq, 67 const int copy, const ring r) 68 { 69 assume(p != NULL && pNext(p) != NULL && q != NULL && pNext(q) != NULL); 70 pAssume1(! pHaveCommonMonoms(p, q)); 71 assume(lp >= 1 && lq >= 1); 72 p_Test(p, r); 73 p_Test(q, r); 74 75 poly res = pp_Mult_mm(p,q,r); // holds initially q1*p 76 poly qq = pNext(q); // we iter of this 77 poly qn = pp_Mult_mm(qq, p,r); // holds p1*qi 78 poly pp = pNext(p); // used for Lm(qq)*pp 79 poly rr = res; // last monom which is surely not NULL 80 poly rn = pNext(res); // pNext(rr) 81 number n, n1; 82 83 kBucket_pt bucket = kBucketCreate(r); 84 85 // initialize bucket 86 kBucketInit(bucket, pNext(rn), lp - 2); 87 pNext(rn) = NULL; 88 89 // now the main loop 90 Top: 91 if (rn == NULL) goto Smaller; 92 p_LmCmpAction(rn, qn, r, goto Equal, goto Greater, goto Smaller); 93 94 Greater: 95 // rn > qn, so iter 96 rr = rn; 97 pNext(rn) = kBucketExtractLm(bucket); 98 pIter(rn); 99 goto Top; 100 101 // rn < qn, append qn to rr, and compute next Lm(qq)*pp 102 Smaller: 103 pNext(rr) = qn; 104 rr = qn; 105 pIter(qn); 106 Work: // compute res + Lm(qq)*pp 107 if (rn == NULL) 108 { 109 pNext(rr) = pp_Mult_mm(pp, qq, r); 110 kBucketInit(bucket, pNext(pNext(rr)), lp - 2); 111 pNext(pNext(rr)) = NULL; 112 } 113 else 114 { 115 kBucketSetLm(bucket, rn); 116 kBucket_Plus_mm_Mult_pp(bucket, qq, pp, lp - 1); 117 pNext(rr) = kBucketExtractLm(bucket); 118 } 119 120 pIter(qq); 121 if (qq == NULL) goto Finish; 122 rn = pNext(rr); 123 goto Top; 124 125 Equal: 126 n1 = pGetCoeff(rn); 127 n = n_Add(n1, pGetCoeff(qn), r); 128 n_Delete(&n1, r); 129 if (n_IsZero(n, r)) 130 { 131 n_Delete(&n, r); 132 p_LmFree(rn, r); 133 } 134 else 135 { 136 pSetCoeff0(rn, n); 137 rr = rn; 138 } 139 rn = kBucketExtractLm(bucket); 140 n_Delete(&pGetCoeff(qn),r); 141 qn = p_LmFreeAndNext(qn, r); 142 goto Work; 143 144 Finish: 145 assume(rr != NULL && pNext(rr) != NULL); 146 pNext(pNext(rr)) = kBucketClear(bucket); 147 kBucketDestroy(&bucket); 148 149 if (!copy) 150 { 151 p_Delete(&p, r); 152 p_Delete(&q, r); 153 } 154 p_Test(res, r); 155 return res; 156 } 157 158 159 static poly _p_Mult_q_Normal(poly p, poly q, const int copy, const ring r) 25 160 { 26 161 assume(p != NULL && pNext(p) != NULL && q != NULL && pNext(q) != NULL); … … 95 230 } 96 231 232 233 poly _p_Mult_q(poly p, poly q, const int copy, const ring r) 234 { 235 int lp, lq, l; 236 poly pt; 237 238 pqLength(p, q, lp, lq, MIN_LENGTH_BUCKET); 239 240 if (lp < lq) 241 { 242 pt = p; 243 p = q; 244 q = pt; 245 l = lp; 246 lp = lq; 247 lq = l; 248 } 249 if (lq < MIN_LENGTH_BUCKET || TEST_OPT_NOT_BUCKETS) 250 return _p_Mult_q_Normal(p, q, copy, r); 251 else 252 { 253 assume(lp == pLength(p)); 254 assume(lq == pLength(q)); 255 return _p_Mult_q_Bucket(p, lp, q, lq, copy, r); 256 } 257 } -
Singular/p_Procs.h
r33ec11 r2f436b 8 8 * Author: obachman (Olaf Bachmann) 9 9 * Created: 8/00 10 * Version: $Id: p_Procs.h,v 1.1 1 2000-12-07 15:03:59 obachman Exp $10 * Version: $Id: p_Procs.h,v 1.12 2000-12-31 15:14:39 obachman Exp $ 11 11 *******************************************************************/ 12 12 #ifndef P_PROCS_H … … 32 32 const ring r, poly &last); 33 33 typedef poly (*p_Neg_Proc_Ptr)(poly p, const ring r); 34 typedef poly (*pp_Mult_Coeff_mm_DivSelect_Proc_Ptr)(poly p, const poly m, 35 const ring r); 34 typedef poly (*pp_Mult_Coeff_mm_DivSelect_Proc_Ptr)(poly p, const poly m, 35 int &shorter,const ring r); 36 typedef poly (*pp_Mult_Coeff_mm_DivSelectMult_Proc_Ptr) 37 (poly p,const poly m, const poly a, const poly b, int &shorter,const ring r); 38 36 39 typedef poly (*p_Merge_q_Proc_Ptr)(poly p, poly q, const ring r); 37 40 typedef void (*p_kBucketSetLm_Proc_Ptr)(kBucket_pt bucket); … … 51 54 p_Neg_Proc_Ptr p_Neg; 52 55 pp_Mult_Coeff_mm_DivSelect_Proc_Ptr pp_Mult_Coeff_mm_DivSelect; 56 pp_Mult_Coeff_mm_DivSelectMult_Proc_Ptr pp_Mult_Coeff_mm_DivSelectMult; 53 57 p_Merge_q_Proc_Ptr p_Merge_q; 54 58 p_kBucketSetLm_Proc_Ptr p_kBucketSetLm; -
Singular/p_Procs_Dynamic.cc
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 12/00 9 * Version: $Id: p_Procs_Dynamic.cc,v 1. 2 2000-12-12 08:44:49 obachman Exp $9 * Version: $Id: p_Procs_Dynamic.cc,v 1.3 2000-12-31 15:14:39 obachman Exp $ 10 10 *******************************************************************/ 11 11 #include "mod2.h" … … 105 105 case pp_Mult_Coeff_mm_DivSelect_Proc: 106 106 return pp_Mult_Coeff_mm_DivSelect__FieldGeneral_LengthGeneral_OrdGeneral; 107 case pp_Mult_Coeff_mm_DivSelectMult_Proc: 108 return pp_Mult_Coeff_mm_DivSelectMult__FieldGeneral_LengthGeneral_OrdGeneral; 107 109 case p_Merge_q_Proc: 108 110 return p_Merge_q__FieldGeneral_LengthGeneral_OrdGeneral; … … 147 149 case pp_Mult_Coeff_mm_DivSelect_Proc: 148 150 return "pp_Mult_Coeff_mm_DivSelect__FieldGeneral_LengthGeneral_OrdGeneral"; 151 case pp_Mult_Coeff_mm_DivSelectMult_Proc: 152 return "pp_Mult_Coeff_mm_DivSelectMult__FieldGeneral_LengthGeneral_OrdGeneral"; 149 153 case p_Merge_q_Proc: 150 154 return "p_Merge_q__FieldGeneral_LengthGeneral_OrdGeneral"; -
Singular/p_Procs_Generate.cc
r33ec11 r2f436b 8 8 * Author: obachman (Olaf Bachmann) 9 9 * Created: 8/00 10 * Version: $Id: p_Procs_Generate.cc,v 1. 3 2000-12-20 17:20:02obachman Exp $10 * Version: $Id: p_Procs_Generate.cc,v 1.4 2000-12-31 15:14:39 obachman Exp $ 11 11 *******************************************************************/ 12 12 … … 70 70 71 71 const char* macros_length[] = 72 {"p_MemCopy", "p_MemAdd", "p_MemSum", NULL};72 {"p_MemCopy", "p_MemAdd", "p_MemSum", "p_MemDiff", NULL}; 73 73 74 74 const char* macros_length_ord[] = {"p_MemCmp", NULL}; … … 147 147 { 148 148 printf("#define DECLARE_LENGTH(what) what\n"); 149 printf("#define p_MemAddAdjust(p, r) p_MemAdd_NegWeightAdjust(p, r)\n"); 149 if (proc != pp_Mult_Coeff_mm_DivSelectMult_Proc) 150 printf("#define p_MemAddAdjust(p, r) p_MemAdd_NegWeightAdjust(p, r)\n"); 151 else 152 printf("#define p_MemAddAdjust(p, r) ((void)0)\n"); 150 153 } 151 154 … … 156 159 else 157 160 printf("#define DECLARE_ORDSGN(what) what\n"); 161 162 if (proc == pp_Mult_Coeff_mm_DivSelectMult_Proc) 163 { 164 printf("#undef DECLARE_LENGTH_2\n"); 165 printf("#undef p_MemCmp_Bitmask_2\n"); 166 if (length != LengthGeneral) 167 { 168 printf("#define DECLARE_LENGTH_2(what) ((void)0)\n"); 169 if (length < LengthTwo) 170 printf("#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_%s\n", p_LengthEnum_2_String((p_Length) ((int) length + 2))); 171 else 172 printf("#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthZero\n"); 173 } 174 else 175 { 176 printf("#define DECLARE_LENGTH_2(what) what \n"); 177 printf("#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthGeneral\n"); 178 } 179 180 181 printf("#undef p_MemAddAdjust\n"); 182 printf("#define p_MemAddAdjust(p, r) ((void)0)\n"); 183 } 158 184 159 185 printf("#undef %s\n#define %s %s\n", s_what, s_what, s_full_proc_name); -
Singular/p_Procs_Impl.h
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 12/00 9 * Version: $Id: p_Procs_Impl.h,v 1. 3 2000-12-20 17:18:52obachman Exp $9 * Version: $Id: p_Procs_Impl.h,v 1.4 2000-12-31 15:14:39 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef P_PROCS_IMPL_H … … 188 188 p_Neg_Proc, 189 189 pp_Mult_Coeff_mm_DivSelect_Proc, 190 pp_Mult_Coeff_mm_DivSelectMult_Proc, 190 191 p_Merge_q_Proc, 191 192 p_kBucketSetLm_Proc, … … 277 278 case p_Neg_Proc: return "p_Neg_Proc"; 278 279 case pp_Mult_Coeff_mm_DivSelect_Proc: return "pp_Mult_Coeff_mm_DivSelect_Proc"; 280 case pp_Mult_Coeff_mm_DivSelectMult_Proc: return "pp_Mult_Coeff_mm_DivSelectMult_Proc"; 279 281 case p_Merge_q_Proc: return "p_Merge_q_Proc"; 280 282 case p_kBucketSetLm_Proc: return "p_kBucketSetLm_Proc"; … … 519 521 pp_Mult_mm_Noether_Filter(field, length, ord); 520 522 break; 521 523 524 case pp_Mult_Coeff_mm_DivSelectMult_Proc: 525 if (length == LengthOne) 526 { 527 field = FieldGeneral; 528 length = LengthGeneral; 529 ord = OrdGeneral; 530 return; 531 } 532 break; 533 522 534 default: break; 523 535 } … … 590 602 case pp_Mult_nn_Proc: 591 603 case pp_Mult_Coeff_mm_DivSelect_Proc: 604 case pp_Mult_Coeff_mm_DivSelectMult_Proc: 592 605 return index(field, length); 593 606 … … 627 640 while (0) \ 628 641 629 #define SetProcs(field, length, ord) \ 630 do \ 631 { \ 632 SetProc(p_Delete, field, LengthGeneral, OrdGeneral); \ 633 SetProc(p_Mult_nn, field, LengthGeneral, OrdGeneral); \ 634 SetProc(pp_Mult_nn, field, length, OrdGeneral); \ 635 SetProc(p_ShallowCopyDelete, FieldGeneral, length, OrdGeneral); \ 636 SetProc(p_Copy, field, length, OrdGeneral); \ 637 SetProc(pp_Mult_mm, field, length, OrdGeneral); \ 638 SetProc(pp_Mult_mm_Noether, field, length, ord); \ 639 SetProc(p_Mult_mm, field, length, OrdGeneral); \ 640 SetProc(p_Add_q, field, length, ord); \ 641 SetProc(p_Minus_mm_Mult_qq, field, length, ord); \ 642 SetProc(p_kBucketSetLm, field, length, ord); \ 643 SetProc(p_Neg, field, LengthGeneral, OrdGeneral); \ 644 SetProc(pp_Mult_Coeff_mm_DivSelect, field, length, OrdGeneral); \ 645 SetProc(p_Merge_q, FieldGeneral, length, ord); \ 646 } \ 642 #define SetProcs(field, length, ord) \ 643 do \ 644 { \ 645 SetProc(p_Delete, field, LengthGeneral, OrdGeneral); \ 646 SetProc(p_Mult_nn, field, LengthGeneral, OrdGeneral); \ 647 SetProc(pp_Mult_nn, field, length, OrdGeneral); \ 648 SetProc(p_ShallowCopyDelete, FieldGeneral, length, OrdGeneral); \ 649 SetProc(p_Copy, field, length, OrdGeneral); \ 650 SetProc(pp_Mult_mm, field, length, OrdGeneral); \ 651 SetProc(pp_Mult_mm_Noether, field, length, ord); \ 652 SetProc(p_Mult_mm, field, length, OrdGeneral); \ 653 SetProc(p_Add_q, field, length, ord); \ 654 SetProc(p_Minus_mm_Mult_qq, field, length, ord); \ 655 SetProc(p_kBucketSetLm, field, length, ord); \ 656 SetProc(p_Neg, field, LengthGeneral, OrdGeneral); \ 657 SetProc(pp_Mult_Coeff_mm_DivSelect, field, length, OrdGeneral); \ 658 SetProc(pp_Mult_Coeff_mm_DivSelectMult, field, length, OrdGeneral); \ 659 SetProc(p_Merge_q, FieldGeneral, length, ord); \ 660 } \ 647 661 while (0) 648 662 -
Singular/p_Procs_Set.h
r33ec11 r2f436b 12 12 * Author: obachman (Olaf Bachmann) 13 13 * Created: 12/00 14 * Version: $Id: p_Procs_Set.h,v 1. 2 2000-12-12 08:44:50 obachman Exp $14 * Version: $Id: p_Procs_Set.h,v 1.3 2000-12-31 15:14:40 obachman Exp $ 15 15 *******************************************************************/ 16 16 … … 114 114 #endif 115 115 116 #define CheckProc(which) \ 117 do \ 118 { \ 119 if (p_Procs->which == NULL) \ 120 { \ 121 dReportBug("p_Procs is NULL"); \ 122 Warn("Singular will work properly, but much slower"); \ 123 p_Procs->which = (which##_Proc_Ptr) \ 124 which##__FieldGeneral_LengthGeneral_OrdGeneral; \ 125 } \ 126 } \ 127 while (0) 128 116 129 // Choose a set of p_Procs 117 130 void p_ProcsSet(ring r, p_Procs_s* p_Procs) … … 130 143 InitSetProcs(field, length, ord); 131 144 SetProcs(field, length, ord); 132 assume( 133 (p_Procs->p_Delete != NULL) && 134 (p_Procs->p_ShallowCopyDelete != NULL) && 135 (p_Procs->p_Mult_nn != NULL) && 136 (p_Procs->pp_Mult_nn != NULL) && 137 (p_Procs->p_Copy != NULL) && 138 (p_Procs->pp_Mult_mm != NULL) && 139 (p_Procs->pp_Mult_mm_Noether != NULL) && 140 (p_Procs->p_Mult_mm != NULL) && 141 (p_Procs->p_Add_q != NULL) && 142 (p_Procs->p_Neg != NULL) && 143 (p_Procs->pp_Mult_Coeff_mm_DivSelect != NULL) && 144 (p_Procs->p_Merge_q != NULL) && 145 (p_Procs->p_kBucketSetLm != NULL) && 146 (p_Procs->p_Minus_mm_Mult_qq != NULL)); 145 CheckProc(p_Copy); 146 CheckProc(p_Delete); 147 CheckProc(p_ShallowCopyDelete); 148 CheckProc(p_Mult_nn); 149 CheckProc(pp_Mult_nn); 150 CheckProc(pp_Mult_mm); 151 CheckProc(pp_Mult_mm_Noether); 152 CheckProc(p_Mult_mm); 153 CheckProc(p_Add_q); 154 CheckProc(p_Minus_mm_Mult_qq); 155 CheckProc(p_Neg); 156 CheckProc(pp_Mult_Coeff_mm_DivSelect); 157 CheckProc(pp_Mult_Coeff_mm_DivSelectMult); 158 CheckProc(p_Merge_q); 159 CheckProc(p_kBucketSetLm); 160 147 161 assume(p_Procs->pp_Mult_mm_Noether != pp_Mult_mm_Noether__FieldGeneral_LengthGeneral_OrdGeneral || 148 162 p_Procs->p_Minus_mm_Mult_qq == p_Minus_mm_Mult_qq__FieldGeneral_LengthGeneral_OrdGeneral || -
Singular/p_Procs_Static.cc
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 12/00 9 * Version: $Id: p_Procs_Static.cc,v 1. 2 2000-12-12 08:44:50 obachman Exp $9 * Version: $Id: p_Procs_Static.cc,v 1.3 2000-12-31 15:14:40 obachman Exp $ 10 10 *******************************************************************/ 11 11 #include "mod2.h" … … 19 19 #include "p_MemCopy.h" 20 20 #include "kbuckets.h" 21 #include "dError.h" 21 22 22 23 BOOLEAN p_procs_dynamic = FALSE; 23 24 25 #define p_Procs_Static 24 26 #include "p_Procs_Static.inc" 25 27 -
Singular/p_polys.h
r33ec11 r2f436b 8 8 * Author: obachman (Olaf Bachmann) 9 9 * Created: 9/00 10 * Version: $Id: p_polys.h,v 1.1 8 2000-12-20 11:15:47obachman Exp $10 * Version: $Id: p_polys.h,v 1.19 2000-12-31 15:14:40 obachman Exp $ 11 11 *******************************************************************/ 12 12 #ifndef P_POLYS_H … … 185 185 // i.e., test if all exponents are zero 186 186 PINLINE1 BOOLEAN p_LmIsConstantComp(const poly p, const ring r); 187 PINLINE1 BOOLEAN p_LmIsConstant(const poly p, const ring r); 188 187 189 // return TRUE, if p_LmExpVectorAdd stays within ExpBound of ring r, 188 190 // FALSE, otherwise … … 211 213 // return the total degree of the long var l containing number_of_exp exponents 212 214 PINLINE2 unsigned long p_GetTotalDegree(const unsigned long l, const ring r, const int number_of_exps); 215 216 217 // like the respective p_LmIs* routines, except that p might be empty 218 PINLINE1 BOOLEAN p_IsConstantComp(const poly p, const ring r); 219 PINLINE1 BOOLEAN p_IsConstant(const poly p, const ring r); 220 PINLINE0 BOOLEAN p_IsConstantPoly(const poly p, const ring r); 213 221 214 222 // return TRUE if all monoms have the same component … … 279 287 PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, const ring r); 280 288 289 // returns p + m*q destroys p, const: q, m 290 PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, 291 const ring r); 292 281 293 // returns p*q, destroys p and q 282 294 PINLINE2 poly p_Mult_q(poly p, poly q, const ring r); … … 287 299 PINLINE2 poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, const ring r); 288 300 301 // returns p*Coeff(m) for such monomials pm of p, for which m is divisble by pm 302 // if lp is length of p on input then lp is length of returned poly on output 303 PINLINE2 poly pp_Mult_Coeff_mm_DivSelect(poly p, int &lp, const poly m, const ring r); 304 289 305 // returns merged p and q, assumes p and q have no monomials which are equal 290 306 PINLINE2 poly p_Merge_q(poly p, poly c, const ring r); 307 // sorts p using bucket sort: returns sorted poly 308 // assumes that monomials of p are all different 309 // reverses it first, if revert == TRUE, use this if input p is "almost" sorted 310 // correctly 311 PINLINE2 poly p_SortMerge(poly p, const ring r, BOOLEAN revert = FALSE); 312 // like SortMerge, except that p may have equal monimals 313 PINLINE2 poly p_SortAdd(poly p, const ring r, BOOLEAN revert = FALSE); 291 314 292 315 /*************************************************************** … … 301 324 #define p_SetmComp p_Setm 302 325 303 // reverses the monomials of p304 PINLINE0 voidp_SetCompP(poly a, int i, ring r);305 PINLINE0 voidp_SetCompP(poly a, int i, ring lmRing, ring tailRing);326 // sets component of poly a to i, returns length of a 327 PINLINE0 int p_SetCompP(poly a, int i, ring r); 328 PINLINE0 int p_SetCompP(poly a, int i, ring lmRing, ring tailRing); 306 329 PINLINE0 long p_MaxComp(poly p, ring lmRing, ring tailRing); 307 330 inline long p_MaxComp(poly p,ring lmRing) {return p_MaxComp(p,lmRing,lmRing);} -
Singular/polys.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys.cc,v 1.7 4 2000-12-20 11:15:47obachman Exp $ */4 /* $Id: polys.cc,v 1.75 2000-12-31 15:14:41 obachman Exp $ */ 5 5 6 6 /* … … 231 231 poly pHomogen (poly p, int varnum) 232 232 { 233 poly q=NULL; 234 poly res; 233 poly q=NULL, qn; 235 234 int o,ii; 235 sBucket_pt bp; 236 236 237 237 if (p!=NULL) … … 250 250 } 251 251 q = pCopy(p); 252 res = q;252 bp = sBucketCreate(currRing); 253 253 while (q != NULL) 254 254 { … … 259 259 pSetm(q); 260 260 } 261 pIter(q); 262 } 263 q = pOrdPolyInsertSetm(res); 261 qn = pNext(q); 262 pNext(q) = NULL; 263 sBucket_Add_p(bp, q, 1); 264 q = qn; 265 } 266 sBucketDestroyAdd(bp, &q, &ii); 264 267 } 265 268 return q; -
Singular/polys.h
r33ec11 r2f436b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys.h,v 1.5 1 2000-12-20 11:15:48obachman Exp $ */6 /* $Id: polys.h,v 1.52 2000-12-31 15:14:41 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT - all basic methods to manipulate polynomials of the … … 209 209 // p*Coeff(m) for such monomials pm of p, for which m is divisble by pm 210 210 #define ppMult_Coeff_mm_DivSelect(p, m) pp_Mult_Coeff_mm_DivSelect(p, m, currRing) 211 /************************************************************************* 212 * 213 * Sort routines 214 * 215 *************************************************************************/ 216 // sorts p, assumes all monomials in p are different 217 #define pSortMerger(p) pSort(p) 218 #define pSort(p) p_SortMerge(p, currRing) 219 220 // sorts p, p may have equal monomials 221 #define pSortAdd(p) p_SortAdd(p, currRing) 222 223 224 // Assume: If considerd only as poly in any component of p 225 // (say, monomials of other components of p are set to 0), 226 // then p is already sorted correctly 227 #define pSortCompCorrect(p) pSort(p) 228 211 229 /*************************************************************** 212 230 * … … 214 232 * 215 233 ***************************************************************/ 216 #define pLmIsConstantComp(p) p_LmIsConstantComp(p, currRing) 234 // return true if all p is eihter NULL, or if all exponents 235 // of p are 0 and Comp of p is zero 236 #define pIsConstantComp(p) p_IsConstantComp(p, currRing) 237 // like above, except that Comp might be != 0 238 #define pIsConstant(p) p_IsConstant(p,currRing) 239 // like above, except that p must be != NULL 240 #define pLmIsConstantComp(p) p_LmIsConstantComp(p, currRing) 241 #define pLmIsConstant(p) p_LmIsConstant(p,currRing) 242 243 // return TRUE if all monomials of p are constant 244 #define pIsConstantPoly(p) p_IsConstantPoly(p, currRing) 245 246 #define pIsPurePower(p) p_IsPurePower(p, currRing) 247 #define pIsVector(p) (pGetComp(p)>0) 217 248 218 249 … … 235 266 236 267 /*-------------predicate on polys ----------------------*/ 237 BOOLEAN p_IsConstant(const poly p, const ring r);238 #define pIsConstant(p) p_IsConstant(p,currRing)239 BOOLEAN pIsConstantPoly(poly p);240 #define pIsPurePower(p) p_IsPurePower(p, currRing)241 #define pIsVector(p) (pGetComp(p)>0)242 268 BOOLEAN pHasNotCF(poly p1, poly p2); /*has no common factor ?*/ 243 269 void pSplit(poly p, poly * r); /*p => IN(p), r => REST(p) */ … … 347 373 // the leading monomial of p2 in p1 348 374 void pCancelPolyByMonom (poly p1,poly p2,polyset * P,int * SizeOfSet); 349 350 // orders monoms of poly using insertion sort, performs pSetm on each351 // monom (i.e. sets Order field)352 poly pOrdPolyInsertSetm(poly p);353 354 // orders monoms of poly using merge sort (ususally faster than355 // insertion sort). ASSUMES that pSetm was performed on monoms356 // (i.e. that Order field is set correctly)357 poly pOrdPolyMerge(poly p);358 375 359 376 poly pPermPoly (poly p, int * perm, ring OldRing, nMapFunc nMap, -
Singular/polys1.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys1.cc,v 1.6 0 2000-12-20 11:23:47 SingularExp $ */4 /* $Id: polys1.cc,v 1.61 2000-12-31 15:14:42 obachman Exp $ */ 5 5 6 6 /* … … 27 27 #include "clapsing.h" 28 28 #endif 29 30 /*-------- several access procedures to monomials -------------------- */31 /*232 *test if the monomial is a constant33 */34 BOOLEAN p_IsConstant(const poly p, const ring r)35 {36 if (p!=NULL)37 {38 int i;39 for (i=r->N;i;i--)40 {41 if (p_GetExp(p,i,r)!=0) return FALSE;42 }43 if (p_GetComp(p,r)>0) return FALSE;44 }45 return TRUE;46 }47 48 /*249 *test if the polynom is a constant50 */51 BOOLEAN pIsConstantPoly(poly p)52 {53 while(p!=NULL)54 {55 for (int i=pVariables;i;i--)56 {57 if (pGetExp(p,i)!=0) return FALSE;58 }59 pIter(p);60 }61 return TRUE;62 }63 64 29 65 30 … … 739 704 } 740 705 741 // orders monoms of poly using merge sort (ususally faster than742 // insertion sort). ASSUMES that pSetm was performed on monoms743 poly pOrdPolyMerge(poly p)744 {745 poly qq,pp,result=NULL;746 747 if (p == NULL) return NULL;748 749 loop750 {751 qq = p;752 loop753 {754 if (pNext(p) == NULL)755 {756 result=pAdd(result, qq);757 pTest(result);758 return result;759 }760 if (pLmCmp(p,pNext(p)) != 1)761 {762 pp = p;763 pIter(p);764 pNext(pp) = NULL;765 result = pAdd(result, qq);766 break;767 }768 pIter(p);769 }770 }771 }772 773 // orders monoms of poly using insertion sort, performs pSetm on each monom774 poly pOrdPolyInsertSetm(poly p)775 {776 poly qq,result = NULL;777 778 #if 0779 while (p != NULL)780 {781 qq = p;782 pIter(p);783 qq->next = NULL;784 pSetm(qq);785 result = pAdd(result,qq);786 pTest(result);787 }788 #else789 while (p != NULL)790 {791 qq = p;792 pIter(p);793 qq->next = result;794 result = qq;795 pSetm(qq);796 }797 p = result;798 result = NULL;799 while (p != NULL)800 {801 qq = p;802 pIter(p);803 qq->next = NULL;804 result = pAdd(result, qq);805 }806 pTest(result);807 #endif808 return result;809 }810 706 811 707 /*2 … … 921 817 } 922 818 } 923 result=p OrdPolyMerge(result);819 result=pSortAdd(result); 924 820 #else 925 821 // if (qq!=NULL) -
Singular/pp_Mult_Coeff_mm_DivSelect__Template.cc
r33ec11 r2f436b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pp_Mult_Coeff_mm_DivSelect__Template.cc,v 1. 4 2000-12-07 15:04:01obachman Exp $9 * Version: $Id: pp_Mult_Coeff_mm_DivSelect__Template.cc,v 1.5 2000-12-31 15:14:42 obachman Exp $ 10 10 *******************************************************************/ 11 11 … … 17 17 * 18 18 ***************************************************************/ 19 LINKAGE poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, const ring r) 19 LINKAGE poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, int &shorter, 20 const ring r) 20 21 { 21 22 number n = pGetCoeff(m); … … 24 25 if (p == NULL) return NULL; 25 26 spolyrec rp; 27 DECLARE_LENGTH(const unsigned long length = r->ExpL_Size); 28 int Shorter = 0; 26 29 poly q = &rp; 27 30 omBin bin = r->PolyBin; 28 DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);29 31 30 32 do … … 38 40 p_MemCopy(q->exp, p->exp, length); 39 41 } 42 else 43 { 44 Shorter++; 45 } 40 46 pIter(p); 41 47 } … … 43 49 pNext(q) = NULL; 44 50 51 shorter = Shorter; 45 52 p_Test(rp.next, r); 46 53 return rp.next; -
Singular/prCopy.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: prCopy.cc,v 1.1 0 2000-12-08 14:43:46 SingularExp $ */4 /* $Id: prCopy.cc,v 1.11 2000-12-31 15:14:43 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - implementation of functions for Copy/Move/Delete for Polys … … 14 14 #include "ring.h" 15 15 #include "ideals.h" 16 17 // define to 0 to never revert, 18 // 1 to always revert 19 // undef if revert as given by parameter 20 // #define REVERT 0 21 22 // a sorting of polys based on buckets 23 class pBucketPoly 24 { 25 public: 26 poly p; 27 long length; 28 long max_length; 29 }; 30 31 static inline poly p_BucketSort(poly p, const ring r) 32 { 33 #if PDEBUG > 0 34 long l_orig = pLength(p); 35 #endif 36 37 long max_length = 1; 38 long i; 39 long l_p; 40 pBucketPoly buckets[BIT_SIZEOF_LONG - 3]; 41 poly q; 42 43 buckets[0].p = p; 44 buckets[0].length = 1; 45 buckets[0].max_length = 2; 46 q = pNext(p); 47 pNext(buckets[0].p) = NULL; 48 49 while (q != NULL) 50 { 51 p = q; 52 pIter(q); 53 pNext(p) = NULL; 54 i = 0; 55 l_p = 1; 56 while (1) 57 { 58 if (buckets[i].p == NULL) 59 { 60 buckets[i].p = p; 61 buckets[i].length = l_p; 62 break; 63 } 64 buckets[i].p = p_Merge_q(buckets[i].p, p, r); 65 buckets[i].length += l_p; 66 if (buckets[i].length <= buckets[i].max_length) 67 break; 68 p = buckets[i].p; 69 l_p = buckets[i].length; 70 buckets[i].p = NULL; 71 buckets[i].length = 0; 72 i++; 73 if (i == max_length) 74 { 75 buckets[i].p = p; 76 buckets[i].length = l_p; 77 buckets[i].max_length = 1 << (i + 1); 78 max_length = i+1; 79 break; 80 } 81 } 82 } 83 84 i = 0; 85 while (buckets[i].p == NULL) i++; 86 p = buckets[i].p; 87 for (i++; i<max_length; i++) 88 { 89 if (buckets[i].p != NULL) 90 p = p_Merge_q(buckets[i].p, p, r); 91 } 92 93 p_Test(p, r); 94 #if PDEBUG > 0 95 assume(l_orig == pLength(p)); 96 #endif 97 return p; 98 } 99 100 // Sorts poly, reverts it first -- this way, almost sorted polys's 101 // don't have n^2 sorting property 102 poly prSortR(poly p, ring r, BOOLEAN revert) 103 { 104 if (p == NULL) return NULL; 105 poly qq, result = NULL; 106 107 #ifdef REVERT 108 #if REVERT == 1 109 revert = 1; 110 #elif REVERT == 0 111 revert = 0; 112 #endif 113 #endif 114 if (revert) 115 { 116 // there must be a bug here: consider m1->m2 117 while (p != NULL) 118 { 119 qq = p; 120 pIter(p); 121 qq->next = result; 122 result = qq; 123 } 124 p = result; 125 } 126 127 return p_BucketSort(p, r); 128 } 16 #include "sbuckets.h" 129 17 130 18 static inline void … … 330 218 } 331 219 332 /////////////////////////////////////////////////////////////////////////333 // prDelete334 typedef void (*prDeleteProc_t)(poly &src_p, ring src_r);335 336 static inline void prDeleteR_NSimple(poly &p, ring r)337 {338 poly next;339 340 while (p != NULL)341 {342 next = pNext(p);343 omFreeBin(p, r->PolyBin);344 p = next;345 }346 }347 348 static inline void prDeleteR_NoNSimple(poly &p, ring r)349 {350 poly next;351 352 while (p != NULL)353 {354 next = pNext(p);355 nDelete(&pGetCoeff(p));356 omFreeBin(p, r->PolyBin);357 p = next;358 }359 }360 361 void prDelete(poly &p)362 {363 if (rField_has_simple_Alloc(currRing))364 prDeleteR_NSimple(p, currRing);365 else366 prDeleteR_NoNSimple(p, currRing);367 }368 369 void prDeleteR(poly &p, ring r)370 {371 if (rField_has_simple_Alloc(r))372 prDeleteR_NSimple(p, r);373 else374 prDeleteR_NoNSimple(p, r);375 }376 377 378 static inline void idrDelete(ideal &id, ring r, prDeleteProc_t prproc)379 {380 if (id == NULL) return;381 int i = IDELEMS(id);382 383 for (; i>=0; i--)384 prproc(id->m[i], r);385 386 omFreeSize(id->m, IDELEMS(id)*sizeof(poly));387 omFreeBin(id, sip_sideal_bin);388 id = NULL;389 }390 391 void idrDelete(ideal &id)392 {393 prDeleteProc_t prproc;394 if (rField_has_simple_Alloc(currRing))395 prproc = prDeleteR_NSimple;396 else397 prproc = prDeleteR_NoNSimple;398 399 idrDelete(id, currRing, prproc);400 }401 402 void idrDeleteR(ideal &id, ring r)403 {404 prDeleteProc_t prproc;405 if (rField_has_simple_Alloc(r))406 prproc = prDeleteR_NSimple;407 else408 prproc = prDeleteR_NoNSimple;409 410 idrDelete(id, r, prproc);411 }412 413 414 415 -
Singular/prCopy.h
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: prCopy.h,v 1. 1 1999-11-15 17:20:42obachman Exp $ */4 /* $Id: prCopy.h,v 1.2 2000-12-31 15:14:43 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - declarations of functions for Copy/Move/Delete for Polys … … 12 12 * MoveR, CopyR, DeleteR, HeadR, SortR 13 13 * Assume: ideal/poly from ring r 14 * Coef (r) == Coef(currRing)14 * Coeff(r) == Coeff(currRing) 15 15 * Move, Delete: input object is destroyed and set to NULL 16 16 * 17 * Sort: revert == TRUE is faster for polys which are almost sorted correctly18 17 * 19 18 ************************************************************************/ … … 23 22 poly prCopyR(poly p, ring r); 24 23 poly prHeadR(poly p, ring r); 25 void prDeleteR(poly &p, ring r);26 poly prSortR(poly p, ring r, BOOLEAN revert = TRUE);27 poly prMergeR(poly p1, poly p2, ring r);28 24 29 25 ideal idrMoveR_NoSort(ideal &id, ring r); … … 32 28 ideal idrCopyR(ideal id, ring r); 33 29 ideal idrHeadR(ideal id, ring r); 34 void idrDeleteR(ideal &id, ring r);35 36 /*************************************************************************37 *38 * Copy, Delete, Sort39 *40 *************************************************************************/41 42 inline poly pSort(poly p, BOOLEAN revert = TRUE)43 {44 return prSortR(p, currRing, revert);45 }46 47 inline poly pMerge(poly p1, poly p2)48 {49 return prMergeR(p1, p2, currRing);50 }51 52 /*************************************************************************53 *54 * Specialized sort routines55 *56 *************************************************************************/57 // TBC:58 // Assume: If considerd only as poly in any component of p59 // (say, monomials of other components of p are set to 0),60 // then p is already sorted correctly61 #define pSortCompCorrect(p) pSort(p, TRUE)62 30 63 31 32 33 -
Singular/prCopyMacros.h
r33ec11 r2f436b 46 46 #define PR_SORT_POLY(p, d_r, s_r) ((void)0) 47 47 #else 48 #define PR_SORT_POLY(p, d_r, s_r) p = p rSortR(p, d_r, d_r->OrdSgn == s_r->OrdSgn)48 #define PR_SORT_POLY(p, d_r, s_r) p = p_SortMerge(p, d_r, d_r->OrdSgn == s_r->OrdSgn) 49 49 #endif 50 50 -
Singular/ring.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.15 2 2000-12-20 11:15:48obachman Exp $ */4 /* $Id: ring.cc,v 1.153 2000-12-31 15:14:43 obachman Exp $ */ 5 5 6 6 /* … … 1991 1991 } 1992 1992 1993 // return TRUE if p_SetComp requires p_Setm 1994 BOOLEAN rOrd_SetCompRequiresSetm(ring r) 1995 { 1996 if (r->typ != NULL) 1997 { 1998 int pos; 1999 for (pos=0;pos<r->OrdSize;pos++) 2000 { 2001 sro_ord* o=&(r->typ[pos]); 2002 if (o->ord_typ == ro_syzcomp || o->ord_typ == ro_syz) return TRUE; 2003 } 2004 } 2005 return FALSE; 2006 } 2007 1993 2008 // return TRUE if p->exp[r->pOrdIndex] holds total degree of p */ 1994 2009 BOOLEAN rOrd_is_Totaldegree_Ordering(ring r =currRing) -
Singular/ring.h
r33ec11 r2f436b 7 7 * ABSTRACT - the interpreter related ring operations 8 8 */ 9 /* $Id: ring.h,v 1.6 1 2000-12-14 16:38:55obachman Exp $ */9 /* $Id: ring.h,v 1.62 2000-12-31 15:14:44 obachman Exp $ */ 10 10 11 11 /* includes */ … … 231 231 // return TRUE if p->exp[r->pOrdIndex] holds total degree of p */ 232 232 BOOLEAN rOrd_is_Totaldegree_Ordering(ring r =currRing); 233 // return TRUE if p_SetComp requires p_Setm 234 BOOLEAN rOrd_SetCompRequiresSetm(ring r); 233 235 rOrderType_t rGetOrderType(ring r); 234 236 /* returns TRUE if var(i) belongs to p-block */ 235 237 BOOLEAN rIsPolyVar(int i, ring r = currRing); 238 239 inline BOOLEAN rOrd_is_c_dp(ring r) 240 { 241 return (r->order[0] == ringorder_c && 242 r->order[1] == ringorder_dp && 243 r->order[2] == 0); 244 } 236 245 237 246 #ifdef HAVE_PLURAL -
Singular/sparsmat.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: sparsmat.cc,v 1.4 6 2000-12-06 11:03:30 SingularExp $ */4 /* $Id: sparsmat.cc,v 1.47 2000-12-31 15:14:45 obachman Exp $ */ 5 5 6 6 /* … … 22 22 #include "sparsmat.h" 23 23 #include "prCopy.h" 24 25 /* ----------------- general definitions ------------------ */ 26 /* in structs.h 27 typedef struct smprec sm_prec; 28 typedef sm_prec * smpoly; 29 struct smprec{ 30 smpoly n; // the next element 31 int pos; // position 32 int e; // level 33 poly m; // the element 34 float f; // complexity of the element 35 }; 36 */ 37 38 #if OLD > 0 39 static poly smSelectCopy(poly, const poly); 24 #include "p_Procs.h" 25 #include "kbuckets.h" 26 #include "p_Mult_q.h" 27 28 // define SM_NO_BUCKETS, if sparsemat stuff should not use buckets 29 // #define SM_NO_BUCKETS 30 31 // this is also influenced by TEST_OPT_NOTBUCKETS 32 #ifndef SM_NO_BUCKETS 33 // buckets do carry a small additional overhead: only use them if 34 // min-length of polys is >= SM_MIN_LENGTH_BUCKET 35 #define SM_MIN_LENGTH_BUCKET MIN_LENGTH_BUCKET - 5 40 36 #else 41 #define smSelectCopy ppMult_Coeff_mm_DivSelect37 #define SM_MIN_LENGTH_BUCKET INT_MAX 42 38 #endif 39 43 40 44 41 /* declare internal 'C' stuff */ … … 58 55 static BOOLEAN smHaveDenom(poly); 59 56 static number smCleardenom(ideal); 57 58 static poly pp_Mult_Coeff_mm_DivSelect_MultDiv(poly p, int &lp, poly m, 59 poly a, poly b) 60 { 61 if (rOrd_is_c_dp(currRing)) 62 { 63 int shorter; 64 p = currRing->p_Procs->pp_Mult_Coeff_mm_DivSelectMult(p, m, a, b, 65 shorter, currRing); 66 lp -= shorter; 67 } 68 else 69 { 70 p = pp_Mult_Coeff_mm_DivSelect(p, lp, m, currRing); 71 smExpMultDiv(p, a, b); 72 } 73 return p; 74 } 75 76 static poly smSelectCopy_ExpMultDiv(poly p, poly m, poly a, poly b) 77 { 78 int lp = 0; 79 return pp_Mult_Coeff_mm_DivSelect_MultDiv(p, lp, m, a, b); 80 } 81 60 82 61 83 /* class for sparse matrix: … … 134 156 }; 135 157 158 Exponent_t smExpBound(ideal Id) 159 { 160 Exponent_t max = 0; 161 long ldeg; 162 int dummy, i, n = IDELEMS(Id); 163 164 for (i=0; i<n; i++) 165 { 166 if (Id->m[i] != NULL) 167 { 168 ldeg = pLDeg(Id->m[i], &dummy); 169 if (ldeg > max) max = ldeg; 170 } 171 } 172 return max*2*n; 173 } 174 175 // #define HOMOG_LP 136 176 /* ----------------- ops with rings ------------------ */ 137 177 ideal smRingCopy(ideal I, ring *ri, sip_sring &tmpR) … … 139 179 ring origR =NULL; 140 180 ideal II; 141 if (currRing->order[0]!=ringorder_c) 142 { 143 origR =currRing; 144 tmpR=*origR; 145 int *ord=(int*)omAlloc0(3*sizeof(int)); 146 int *block0=(int*)omAlloc(3*sizeof(int)); 147 int *block1=(int*)omAlloc(3*sizeof(int)); 148 ord[0]=ringorder_c; 181 origR =currRing; 182 tmpR=*origR; 183 int *ord=(int*)omAlloc0(3*sizeof(int)); 184 int *block0=(int*)omAlloc(3*sizeof(int)); 185 int *block1=(int*)omAlloc(3*sizeof(int)); 186 ord[0]=ringorder_c; 187 #ifdef HOMOG_LP 188 if (idHomIdeal(I)) 189 ord[1] = ringorder_lp; 190 else 191 #endif 149 192 ord[1]=ringorder_dp; 150 tmpR.order=ord; 151 tmpR.OrdSgn=1; 152 block0[1]=1; 153 tmpR.block0=block0; 154 block1[1]=tmpR.N; 155 tmpR.block1=block1; 156 rComplete(&tmpR,1); 157 rChangeCurrRing(&tmpR); 158 // fetch data from the old ring 159 II=idInit(IDELEMS(I),I->rank); 160 int k; 161 for (k=0;k<IDELEMS(I);k++) II->m[k] = prCopyR( I->m[k], origR); 162 } 163 else 164 { 165 II=idCopy(I); 166 } 193 tmpR.order=ord; 194 tmpR.OrdSgn=1; 195 block0[1]=1; 196 tmpR.block0=block0; 197 block1[1]=tmpR.N; 198 tmpR.block1=block1; 199 200 tmpR.bitmask = smExpBound(I); 201 202 // unfortunately, we can not work (yet) with r->N == 0 203 if (tmpR.bitmask < 1) tmpR.bitmask = 1; 204 if (tmpR.bitmask > currRing->bitmask) tmpR.bitmask = currRing->bitmask; 205 206 rComplete(&tmpR,1); 207 rChangeCurrRing(&tmpR); 208 if (TEST_OPT_PROT) 209 Print("[%d:%d]", (long) tmpR.bitmask, tmpR.ExpL_Size); 210 // fetch data from the old ring 211 II = idrCopyR(I, origR); 212 idTest(II); 167 213 *ri = origR; 168 214 return II; … … 951 997 { 952 998 res = res->n = smElemCopy(b); 953 res->m = smMult(b->m, w);999 res->m = ppMult_qq(b->m, w); 954 1000 res->e = 1; 955 1001 res->f = smPolyWeight(res); … … 966 1012 { 967 1013 res = res->n = smElemCopy(b); 968 res->m = smMult(b->m, w);1014 res->m = ppMult_qq(b->m, w); 969 1015 res->e = 1; 970 1016 res->f = smPolyWeight(res); … … 973 1019 else 974 1020 { 975 ha = smMult(a->m, p);1021 ha = ppMult_qq(a->m, p); 976 1022 pDelete(&a->m); 977 hb = smMult(b->m, w);1023 hb = ppMult_qq(b->m, w); 978 1024 ha = pAdd(ha, hb); 979 1025 if (ha != NULL) … … 1680 1726 1681 1727 /* ----------------- arithmetic ------------------ */ 1682 1683 /*1684 * returns a*b1685 * a,b NOT destroyed1686 */1687 poly smMult(poly a, poly b)1688 {1689 poly pa, res, r;1690 1691 if (smSmaller(a, b))1692 {1693 r = a;1694 a = b;1695 b = r;1696 }1697 if (pNext(b) == NULL)1698 {1699 if (pLmIsConstantComp(b))1700 return ppMult_nn(a, pGetCoeff(b));1701 else1702 return ppMult_mm(a, b);1703 }1704 pa = res = ppMult_mm(a, b);1705 pIter(b);1706 do1707 {1708 r = ppMult_mm(a, b);1709 smCombineChain(&pa, r);1710 pIter(b);1711 } while (b != NULL);1712 return res;1713 }1714 1715 1728 /*2 1716 1729 * exact division a/b … … 1770 1783 } 1771 1784 1785 #define X_MAS 1786 #ifdef X_MAS 1787 1772 1788 /* 1773 1789 * returns the part of (a*b)/exp(lead(c)) with nonegative exponents … … 1776 1792 { 1777 1793 poly pa, e, res, r; 1778 BOOLEAN lead; 1779 1780 if (smSmaller(a, b)) 1794 BOOLEAN lead;\ 1795 int la, lb, lr; 1796 1797 if ((c == NULL) || pLmIsConstantComp(c)) 1798 { 1799 return ppMult_qq(a, b); 1800 } 1801 1802 pqLength(a, b, la, lb, SM_MIN_LENGTH_BUCKET); 1803 1804 // we iter over b, so, make sure b is the shortest 1805 // such that we minimize our iterations 1806 if (lb > la) 1781 1807 { 1782 1808 r = a; 1783 1809 a = b; 1784 1810 b = r; 1785 } 1786 if ((c == NULL) || pLmIsConstantComp(c)) 1787 { 1788 if (pNext(b) == NULL) 1789 { 1790 if (pLmIsConstantComp(b)) 1791 return ppMult_nn(a, pGetCoeff(b)); 1792 else 1793 return ppMult_mm(a, b); 1794 } 1795 pa = res = ppMult_mm(a, b); 1796 pIter(b); 1797 do 1798 { 1799 r = ppMult_mm(a, b); 1800 smCombineChain(&pa, r); 1801 pIter(b); 1802 } while (b != NULL); 1803 return res; 1811 lr = la; 1812 la = lb; 1813 lb = lr; 1804 1814 } 1805 1815 res = NULL; … … 1812 1822 { 1813 1823 lead = pLmDivisibleByNoComp(e, a); 1814 r = smSelectCopy(a, e); 1815 smExpMultDiv(r, b, c); 1824 r = smSelectCopy_ExpMultDiv(a, e, b, c); 1816 1825 } 1817 1826 else … … 1842 1851 } 1843 1852 } 1844 do 1853 1854 if (!TEST_OPT_NOT_BUCKETS && lb >= SM_MIN_LENGTH_BUCKET) 1855 { 1856 // use buckets if minimum length is smaller than threshold 1857 spolyrec rp; 1858 poly append; 1859 // find the last monomial before pa 1860 if (res == pa) 1861 { 1862 append = &rp; 1863 pNext(append) = res; 1864 } 1865 else 1866 { 1867 append = res; 1868 while (pNext(append) != pa) 1869 { 1870 assume(pNext(append) != NULL); 1871 pIter(append); 1872 } 1873 } 1874 kBucket_pt bucket = kBucketCreate(currRing); 1875 kBucketInit(bucket, pNext(append), 0); 1876 do 1877 { 1878 pSetCoeff0(e,pGetCoeff(b)); 1879 if (smIsNegQuot(e, b, c)) 1880 { 1881 lr = la; 1882 r = pp_Mult_Coeff_mm_DivSelect_MultDiv(a, lr, e, b, c); 1883 if (pLmDivisibleByNoComp(e, a)) 1884 append = kBucket_ExtractLarger_Add_q(bucket, append, r, &lr); 1885 else 1886 kBucket_Add_q(bucket, r, &lr); 1887 } 1888 else 1889 { 1890 r = ppMult_mm(a, e); 1891 append = kBucket_ExtractLarger_Add_q(bucket, append, r, &la); 1892 } 1893 pIter(b); 1894 } while (b != NULL); 1895 pNext(append) = kBucketClear(bucket); 1896 kBucketDestroy(&bucket); 1897 } 1898 else 1899 { 1900 // use old sm stuff 1901 do 1902 { 1903 pSetCoeff0(e,pGetCoeff(b)); 1904 if (smIsNegQuot(e, b, c)) 1905 { 1906 r = smSelectCopy_ExpMultDiv(a, e, b, c); 1907 if (pLmDivisibleByNoComp(e, a)) 1908 smCombineChain(&pa, r); 1909 else 1910 pa = pAdd(pa,r); 1911 } 1912 else 1913 { 1914 r = ppMult_mm(a, e); 1915 smCombineChain(&pa, r); 1916 } 1917 pIter(b); 1918 } while (b != NULL); 1919 } 1920 pLmFree(e); 1921 return res; 1922 } 1923 1924 #else 1925 1926 /* 1927 * returns the part of (a*b)/exp(lead(c)) with nonegative exponents 1928 */ 1929 poly smMultDiv(poly a, poly b, const poly c) 1930 { 1931 poly pa, e, res, r; 1932 BOOLEAN lead; 1933 1934 if ((c == NULL) || pLmIsConstantComp(c)) 1935 { 1936 return ppMult_qq(a, b); 1937 } 1938 if (smSmaller(a, b)) 1939 { 1940 r = a; 1941 a = b; 1942 b = r; 1943 } 1944 res = NULL; 1945 e = pInit(); 1946 lead = FALSE; 1947 while (!lead) 1845 1948 { 1846 1949 pSetCoeff0(e,pGetCoeff(b)); 1847 1950 if (smIsNegQuot(e, b, c)) 1848 1951 { 1849 r = smSelectCopy(a, e); 1850 smExpMultDiv(r, b, c); 1952 lead = pLmDivisibleByNoComp(e, a); 1953 r = smSelectCopy_ExpMultDiv(a, e, b, c); 1954 } 1955 else 1956 { 1957 lead = TRUE; 1958 r = ppMult_mm(a, e); 1959 } 1960 if (lead) 1961 { 1962 if (res != NULL) 1963 { 1964 smFindRef(&pa, &res, r); 1965 if (pa == NULL) 1966 lead = FALSE; 1967 } 1968 else 1969 { 1970 pa = res = r; 1971 } 1972 } 1973 else 1974 res = pAdd(res, r); 1975 pIter(b); 1976 if (b == NULL) 1977 { 1978 pLmFree(e); 1979 return res; 1980 } 1981 } 1982 do 1983 { 1984 pSetCoeff0(e,pGetCoeff(b)); 1985 if (smIsNegQuot(e, b, c)) 1986 { 1987 r = smSelectCopy_ExpMultDiv(a, e, b, c); 1851 1988 if (pLmDivisibleByNoComp(e, a)) 1852 1989 smCombineChain(&pa, r); … … 1864 2001 return res; 1865 2002 } 1866 2003 #endif 1867 2004 /*n 1868 2005 * exact division a/b … … 1880 2017 } 1881 2018 2019 1882 2020 /* ------------ internals arithmetic ------------- */ 1883 2021 static void smExactPolyDiv(poly a, poly b) … … 1887 2025 poly h; 1888 2026 number y, yn; 1889 1890 do 1891 { 1892 y = nDiv(pGetCoeff(a), x); 1893 nNormalize(y); 1894 pSetCoeff(a,y); 1895 yn = nNeg(nCopy(y)); 1896 pSetCoeff0(e,yn); 1897 if (smIsNegQuot(e, a, b)) 1898 { 1899 h = smSelectCopy(tail, e); 1900 smExpMultDiv(h, a, b); 1901 } 1902 else 1903 h = ppMult_mm(tail, e); 1904 nDelete(&yn); 1905 a = pNext(a) = pAdd(pNext(a), h); 1906 } while (a!=NULL); 2027 int lt = pLength(tail); 2028 2029 if (lt + 1 >= SM_MIN_LENGTH_BUCKET && !TEST_OPT_NOT_BUCKETS) 2030 { 2031 kBucket_pt bucket = kBucketCreate(currRing); 2032 kBucketInit(bucket, pNext(a), 0); 2033 int lh = 0; 2034 do 2035 { 2036 y = nDiv(pGetCoeff(a), x); 2037 nNormalize(y); 2038 pSetCoeff(a,y); 2039 yn = nNeg(nCopy(y)); 2040 pSetCoeff0(e,yn); 2041 lh = lt; 2042 if (smIsNegQuot(e, a, b)) 2043 { 2044 h = pp_Mult_Coeff_mm_DivSelect_MultDiv(tail, lh, e, a, b); 2045 } 2046 else 2047 h = ppMult_mm(tail, e); 2048 nDelete(&yn); 2049 kBucket_Add_q(bucket, h, &lh); 2050 2051 a = pNext(a) = kBucketExtractLm(bucket); 2052 } while (a!=NULL); 2053 kBucketDestroy(&bucket); 2054 } 2055 else 2056 { 2057 do 2058 { 2059 y = nDiv(pGetCoeff(a), x); 2060 nNormalize(y); 2061 pSetCoeff(a,y); 2062 yn = nNeg(nCopy(y)); 2063 pSetCoeff0(e,yn); 2064 if (smIsNegQuot(e, a, b)) 2065 h = smSelectCopy_ExpMultDiv(tail, e, a, b); 2066 else 2067 h = ppMult_mm(tail, e); 2068 nDelete(&yn); 2069 a = pNext(a) = pAdd(pNext(a), h); 2070 } while (a!=NULL); 2071 } 1907 2072 pLmFree(e); 1908 2073 } … … 1940 2105 pLmTest(b); 1941 2106 pLmTest(c); 2107 poly bc = p_New(currRing); 2108 2109 p_ExpVectorDiff(bc, b, c, currRing); 2110 1942 2111 while(t!=NULL) 1943 2112 { 1944 pExpVectorAdd Sub(t, b,c);2113 pExpVectorAdd(t, bc); 1945 2114 pIter(t); 1946 2115 } 1947 } 2116 p_LmFree(bc, currRing); 2117 } 2118 1948 2119 1949 2120 static void smPolyDivN(poly a, const number x) … … 2016 2187 *px = pa; 2017 2188 } 2189 2018 2190 2019 2191 static void smFindRef(poly *ref, poly *px, poly r) -
Singular/structs.h
r33ec11 r2f436b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: structs.h,v 1.5 1 2000-12-20 11:15:49obachman Exp $ */6 /* $Id: structs.h,v 1.52 2000-12-31 15:14:45 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 79 79 class namerec; 80 80 class kBucket; 81 class sBucket; 81 82 #endif 82 83 … … 145 146 typedef namerec * namehdl; 146 147 typedef kBucket* kBucket_pt; 148 typedef sBucket* sBucket_pt; 147 149 typedef struct p_Procs_s p_Procs_s; 148 150 -
Singular/syz0.cc
r33ec11 r2f436b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz0.cc,v 1.3 5 2000-12-06 11:03:31 SingularExp $ */4 /* $Id: syz0.cc,v 1.36 2000-12-31 15:14:46 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: resolutions … … 995 995 { 996 996 if (res[1]->m[i]) 997 res[1]->m[i] = p OrdPolyMerge(res[1]->m[i]);997 res[1]->m[i] = pSort(res[1]->m[i]); 998 998 } 999 999 }
Note: See TracChangeset
for help on using the changeset viewer.