Changeset 3e55bc in git
- Timestamp:
- Jun 9, 1997, 5:56:14 PM (26 years ago)
- Branches:
- (u'spielwiese', '91e5db82acc17434e4062bcfa44e6efa7d41fd30')
- Children:
- db12c52f20de2574cfcb364effcf969b39384547
- Parents:
- 6c02a5092325a53a0cda2cf6756a4ba1d9765c67
- Location:
- libfac
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
libfac/00README
r6c02a5 r3e55bc 1 This is the file 00README.libfac for version 0.2. 1of libfac.1 This is the file 00README.libfac for version 0.2.4 of libfac. 2 2 3 3 ######### What is libfac? 4 4 libfac is an extension to factory (see the factory documentation for details 5 about factory and what it does), which implements factorization of polynomials 6 over finite fields and algorithms for manipulation of polynomial ideals via 7 the characteristic set methods (e.g., calculating the charcteristic set and the 8 irreducible characteristic series). 9 10 Note: libfac is just beta-code. There are bugs, I think. Please help to test 11 this code! Submit a bug-report if you found a bug! 5 about factory and what it does; look at REQUIREMENTS how to get factory), 6 which implements factorization of polynomials over finite fields and algorithms 7 for manipulation of polynomial ideals via the characteristic set methods 8 (e.g., calculating the characteristic set and the irreducible characteristic 9 series). 10 11 Note: libfac is just beta-code (as long version is < 1.0.0). There are bugs, I 12 think. Please help to test this code! Submit a bug-report if you found a bug! 12 13 13 14 ######### Copyright ##################### … … 23 24 a) this 00README alone 24 25 b) your code/binary or whatever which uses a binary version of this library 25 (libfac.a and/or libfac-g.a), if you state anywhere in your documentation,26 that you use this code, who is and how to contact the author.27 If you don't have a documentation for your code/binary or whatever, you28 have to distribute this 00README as well.26 (libfac.a, libfac-g.a, and/or libsingfac.a), if you state anywhere in your 27 documentation, that you use this code, who is and how to contact the 28 author. If you don't have a documentation for your code/binary or 29 whatever, you have to distribute this 00README as well. 29 30 30 31 In other words: You are not allowed to distribute the sources or part of the … … 33 34 34 35 In no event you are allowed to modify the sources (beside the Makefile's, 35 configure.in, configure and install-sh). 36 configure.in, configure, makedirs and install-sh). 37 36 38 Note that no permission is granted to extract a portion of the source code of 37 39 this library and incorporate it into another program. … … 42 44 Note: This restricted copyright will change in future to a more "free" one. 43 45 But for now I want to keep track of the sources (this is the intention of the 44 restrictions of this licen ce). They aren't in their final state and there will46 restrictions of this license). They aren't in their final state and there will 45 47 be bugs (or even "features"). So please let *me* fix any problems. 46 48 … … 73 75 74 76 ######### REQUIREMENTS ################### 75 * You need factory to compile this code. Factory is designed and maintained 76 (at least until 30.9.96) by 77 Ruediger Stobbe <stobbe@mathematik.uni-kl.de> . 78 This code compiles, works and is tested with factoryversion 1.1 79 and factoryversion 1.2beta . 80 factory is not yet available to the public. You have to contact the holder 81 of the copyright first. To my knowledge this is (at least since 1.10.96): 82 Prof. Dr. Gert-Martin Greuel 83 FB Mathematik 84 Uni. Kaiserslautern 85 D-67618 Kaiserslautern 86 GERMANY 87 email: greuel@mathematik.uni-kl.de 77 * You need the library factory, which is part of Singular, to compile this 78 code. Get it from 79 ftp://www.mathematik.uni-kl.de/pub/Math/Factory or 80 http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/Factory 88 81 89 82 * gcc 2.7.2 ( earlier versions of gcc *may* work as well as any other ANSI C++ … … 98 91 configure [--with-debug] [--with-Singular] [--includedir=path-to-factory.h] 99 92 make 100 this will produce libfac.a or singlibfac.a (depending on --with-Singular). 101 102 B) Using Makefile.dist 93 this will produce libfac.a or libsingfac.a (depending on --with-Singular). 94 The only difference between libfac.a and libsingfac.a is: we don't instantiate 95 any templates for libsingfac.a. 96 97 B) Using Makefile.dist (this is not recommended; maybe you have to edit a lot 98 to reflect your systems configuration.) 103 99 copy Makefile.dist to Makefile 104 100 Edit the factoryversion and the path to the factory library in the top Makefile 105 101 (in this directory). 106 102 currently: factoryversion=1.2b 107 (I have tested with factoryversion 1.1 & 1.2beta; earlier versions *don't* work) 103 (I have tested with factoryversion 1.1 & 1.2beta & 1.2c; earlier versions 104 *don't* work) 108 105 109 106 type: … … 158 155 159 156 ########### KNOWN BUGS ############################ 160 *The irreducible characteristic series stuff doesn't work for some problems.157 o The irreducible characteristic series stuff doesn't work for some problems. 161 158 You will get a warning: 162 159 "Factorization over algebraic function field required!" … … 165 162 Don't trust the result you'll get in such a case!!!!!! 166 163 167 *The performance of the irreducible characteristic series stuff heavily164 o The performance of the irreducible characteristic series stuff heavily 168 165 depends on the ordering of the variables in some cases. No (nearly) optimal 169 ordering of the variables is cho osen automatically, right now.166 ordering of the variables is chosen automatically, right now. 170 167 E.g.: if your ideal is (t^10-x, t^31-t^6-t-y, t^8-z) and you choose the 171 168 variable ordering with t > z > y > x, the calculation of the irreducible … … 176 173 Since version 0.2 of the library: 177 174 (There is now a function: Varlist neworder(const CFList & PolyList ), 178 which returns a list of heuristically optimal reorder d variables;175 which returns a list of heuristically optimal reordered variables; 179 176 if you use the library for programming purpose, look at factor.h how to 180 177 use this function in your code) … … 182 179 respective program, if and how this is incorporated. 183 180 184 *Factorization is slow for large polynomials. There are mainly two reasons181 o Factorization is slow for large polynomials. There are mainly two reasons 185 182 for this: 186 183 a) the factorization algorithm is shipped with no "tricks" yet. (I'm working 187 184 on that, but it heavily depends on b) ) 188 b) factory has an extrem ly slow GCD-algorithm for the case of characteristic189 p>0 ( people are working on it )185 b) factory has an extremely slow GCD-algorithm for the case of 186 characteristic p>0 ( people are working on it ) 190 187 There will be a quite different, faster factorization algorithm in the 191 188 future. … … 197 194 e.g.: 0.1 major=0 minor=1 no bugfixnumber (no bugfix incorporated) 198 195 199 V0.1 *Initial version for alpha-testers200 201 V0.2 *Added neworder(..) and reorder(..) for IrrCharSeries202 *Added external strings (in factor/version.cc):196 V0.1 o Initial version for alpha-testers 197 198 V0.2 o Added neworder(..) and reorder(..) for IrrCharSeries 199 o Added external strings (in factor/version.cc): 203 200 libfac_name - the name of the game 204 201 libfac_version - the version number 205 202 libfac_date - the date libfac_version was released 206 203 libfac_author - who wants to know? 207 * added support for factorization of homogenious polynomials (in204 o added support for factorization of homogeneous polynomials (in 208 205 factor/homogfactor.cc), 209 206 reorganized code in factor/Factor.cc and factor/Factor.h 210 *added files factor/debug.cc, factor/debug.h, factor/timing.h;207 o added files factor/debug.cc, factor/debug.h, factor/timing.h; 211 208 mainly for internal use 212 209 213 V0.2.1 *changed lc == 1 to lc == unit in choose_mainvar (factor/Factor.cc)214 *changed cerr and cout messages for use with Singular (all .cc files)210 V0.2.1 o changed lc == 1 to lc == unit in choose_mainvar (factor/Factor.cc) 211 o changed cerr and cout messages for use with Singular (all .cc files) 215 212 (why the hell don't they use libiostream?) 216 *added configure -- basics only; (old)Makefile changed to213 o added configure -- basics only; (old)Makefile changed to 217 214 Makefile.dist (if nothing works...) 218 215 Makefile produced with configure uses GNU coding standards 219 216 o released Apr 25 1997 217 218 V0.2.2 o Added ranlib in Makefile.in after installing - Sun's seem to need it 219 o Put -I. before CPPFLAGS in Makefile.in 220 o hardcoded ./install-sh and ./mkinstalldirs in Makefile.in for 221 INSTALL; some machines have a broken install (e.g. HP ) 222 commented out the search for AC_PROG_INSTALL in configure.in 223 o Internal note: Singular now contains definitions from class.cc and 224 tmpl_inst.h in claptmpl.cc 225 o released May 15 1997 226 227 V0.2.3 o Added factor/interrupt.cc and interrupt.h to support interrupting 228 calculations: We define a global variable "libfac_interruptflag" 229 in factor/version.cc which, if not zero, interrupts the ongoing 230 calculation. Factorize() will then return an empty list (CFFList), 231 IrrCharSeries will return an empty list of lists (ListCFList). 232 Modified: factor/Factor.cc and charset/charset.cc for this purpose. 233 o version for Macaulay2-Testers 234 o released May 28 1997 235 236 V0.2.4 o Changed factor/SqrFree.cc (SqrFreed): Have to interchange variables 237 if one derivative is zero but not all (e.g. no p'th power) 238 example: (y^12+x^10)^2 mod 5 239 Internal note: have to look at SqrFreeTest!! 240 o Changed factor/Factor.cc (Factorize): multiplied exponent of factors 241 into Output (should be one if Sqrfree doesn't fail); this is for 242 security only (and should be removed later..) 243 o Changed factor/helpstuff (myappend): added support for lists with 244 multiple copies of one element (this doesn't happen for this 245 algorithms... but you never know) 246 o Changed factor/interrupt.{cc|h}: Removed interrupt.cc; added (inline) 247 code to interrupt.h; factor.h will now define the external variable 248 "libfac_interruptflag" 249 Doesn't any longer issue any message about user-interrupt - the 250 CA-System, which has control, should warn user that calculation is 251 aborted. Removed libfac_messageflag from factor/version.cc 252 o Summary: removed: factor/interrupt.cc 253 changed: factor/SqrFree.cc factor/Factor.cc 254 factor/helpstuff.cc Makefile.in configure.in 255 factor/interrupt.h factor.h factor/version.cc 256 o Internal note: something changed in unvivariate factorization over 257 extension fields from factory-1.2b to 1.2c: same polynomial now uses 258 4 to 12 times longer to factor! Perhaps it's this new random 259 generator? 260 o released May 30 1997 261 -
libfac/Makefile.dist
r6c02a5 r3e55bc 1 # $Id: Makefile.dist,v 1. 1.1.1 1997-05-02 17:00:43Singular Exp $1 # $Id: Makefile.dist,v 1.2 1997-06-09 15:55:46 Singular Exp $ 2 2 ################################################# 3 3 factoryversion = 1.2b … … 7 7 AR = ar cr 8 8 RANLIB = ranlib 9 LIBPREF = libfac9 LIBPREFX = libfac 10 10 OPTMARK = 11 LIBFAC = $(LIBPREF )$(OPTMARK).a12 LIBFAC-G = $(LIBPREF )-g$(OPTMARK).a11 LIBFAC = $(LIBPREFIX)$(OPTMARK).a 12 LIBFAC-G = $(LIBPREFIX)-g$(OPTMARK).a 13 13 SINGLIBFAC = libsingfac$(OPTMARK).a 14 14 SINGLIBFAC-G = libsingfac-g$(OPTMARK).a … … 53 53 OPTOBJ/%.o: factor/%.cc ; $(OPTCXX) -c $< $(CFLAGS) $(IFLAGS) $(OPTFLAGS) -o $@ 54 54 55 .c.a:56 $(CXX) $(CFLAGS) $(OPTFLAGS) -c $< -o $*.o57 $(AR) $@ $*.o58 $(RANLIB) $@59 60 55 61 56 FACTORSRC1 = factor/SqrFree.cc factor/Factor.cc \ … … 95 90 $(LD) -o test $(LIBPATH) DEBOBJ/test.o $(DEBLIBS) 96 91 97 opttest: libfac OPTOBJ/test.o 92 opttest: libfac OPTOBJ/test.o 98 93 $(OPTLD) -o test $(LIBPATH) OPTOBJ/test.o $(OPTLIBS) 99 94 … … 161 156 OPTOBJ/tmpl_inst.o: factor/tmpl_inst.cc ; $(OPTCXX) -c $< $(CFLAGS) $(OPTFLAGSTMPL) $(IFLAGS) -o $@ 162 157 163 OPTOBJ/optdepend:164 ./bin/makedep -P OPTOBJ $(IFLAGS) $(FACTORSRC1) $(CHARSETSRC1) > $@165 166 DEBOBJ/debdepend:167 ./bin/makedep -P DEBOBJ $(DEFINES) $(IFLAGS) $(FACTORSRC1) $(CHARSETSRC1) > $@168 -
libfac/Makefile.in
r6c02a5 r3e55bc 1 # $Id: Makefile.in,v 1. 6 1997-05-21 13:05:34 obachmanExp $1 # $Id: Makefile.in,v 1.7 1997-06-09 15:55:47 Singular Exp $ 2 2 ################################################# 3 3 SHELL = /bin/sh 4 RM = rm -f4 RM = -rm -f 5 5 ################################################# 6 6 TARGETNAME = @targetname@ 7 LIBFACVERSION = @libfacversion@ 7 LIBFACNAME = @libfac_name@ 8 LIBFACVERSION = @libfac_version@ 9 LIBFACDATE = @libfac_date@ 10 LIBFACAUTHOR = @libfac_author@ 8 11 LIBFACNAME = @libfac@ 9 12 SINGLIBFACNAME = @libsingfac@ … … 20 23 libdir = @libdir@ 21 24 includedir = @includedir@ 22 templatedir = ${includedir}/templates23 25 24 26 ## … … 29 31 CXX = @CXX@ 30 32 INSTALL = ./install-sh -c 31 INSTALL_PROGRAM = ${INSTALL}32 33 INSTALL_DATA = ${INSTALL} -m 644 33 MKINSTALLDIRS = ./mkinstalldirs 34 INSTALL_PROGRAM = ${INSTALL} 35 MKINSTALLDIRS = ./mkinstalldirs 34 36 35 37 ## … … 41 43 DEFS = @DEFS@ 42 44 LDFLAGS = @LDFLAGS@ 43 LIBS = @LIBS@ 45 LIBS = @LIBS@ -lfac -lcf -lmem -lgmp 44 46 45 47 ## … … 50 52 factor/MVMultiHensel.cc factor/Truefactor.cc \ 51 53 factor/helpstuff.cc factor/debug.cc factor/version.cc \ 52 factor/homogfactor.cc 54 factor/homogfactor.cc 53 55 FACTORSRC2 = factor/tmpl_inst.cc 54 56 FACTORSRC = $(FACTORSRC2) $(FACTORSRC1) … … 59 61 FACTORINCL = factor/Factor.h factor/MVMultiHensel.h factor/Truefactor.h \ 60 62 factor/tmpl_inst.h factor/SqrFree.h factor/helpstuff.h \ 61 factor/debug.h factor/timing.h factor/homogfactor.h 62 FACTORTEMPL = factor/class.h factor/class.cc factor/tmpl_inst.h 63 63 factor/debug.h factor/timing.h factor/homogfactor.h \ 64 factor/interrupt.h 64 65 CHARSETINCL = charset/csutil.h charset/charset.h charset/reorder.h 65 66 … … 84 85 ## 85 86 87 .SUFFIXES: .cc .h .o 86 88 87 all: OPTOBJ ${TARGETNAME} 88 89 OPTOBJ: 90 ${MKINSTALLDIRS} OPTOBJ 91 92 .SUFFIXES: .cc .h .o 89 all: ${TARGETNAME} 93 90 94 91 OPTOBJ/%.o: %.cc … … 144 141 ${MKINSTALLDIRS} ${includedir} 145 142 ${MKINSTALLDIRS} ${libdir} 146 ${MKINSTALLDIRS} ${templatedir}147 143 ${INSTALL_DATA} ${LIBFACINCLUDE} ${includedir} 148 144 ${INSTALL_PROGRAM} ${TARGETNAME}.a ${libdir} 149 $ {RANLIB}${libdir}/${TARGETNAME}.a145 $(RANLIB) ${libdir}/${TARGETNAME}.a 150 146 151 147 uninstall: -
libfac/bin/makeheader
r6c02a5 r3e55bc 1 #!/ bin/perl1 #!/usr/local/bin/perl 2 2 3 3 ### -
libfac/charset/Makefile
r6c02a5 r3e55bc 1 # static char rcsid[] = "@(#) $Id: Makefile,v 1. 1.1.1 1997-05-02 17:00:44Singular Exp $";1 # static char rcsid[] = "@(#) $Id: Makefile,v 1.2 1997-06-09 15:55:52 Singular Exp $"; 2 2 ################################################ 3 3 # testcs: CharSet(F) -
libfac/charset/charset.cc
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 static char * rcsid = "$Id: charset.cc,v 1. 1.1.1 1997-05-02 17:00:44Singular Exp $";4 static char * rcsid = "$Id: charset.cc,v 1.2 1997-06-09 15:55:53 Singular Exp $"; 5 5 ///////////////////////////////////////////////////////////// 6 6 // FACTORY - Includes … … 9 9 #include <SqrFree.h> 10 10 #include <Factor.h> 11 #include <interrupt.h> 11 12 // Charset - Includes 12 13 #include "csutil.h" … … 33 34 #include "debug.h" 34 35 36 // the next computes a characteristic set (a basic set in Wang's sense) 35 37 CFList 36 38 BasicSet( const CFList &PS ) … … 86 88 #include "debug.h" 87 89 88 // The modified CharSet 90 // The modified CharSet (an extended characteristic set with certain factors 91 // canceled; this is a characteristic set in Wang's sense) 89 92 CFList 90 93 MCharSetN( const CFList &PS, PremForm & Remembern ){ … … 144 147 } 145 148 149 // the "original" extended characteristic set 146 150 CFList 147 151 CharSet( const CFList &PS ){ … … 365 369 if ( cls(cs.getFirst()) > 0 ){ 366 370 ts = irras(cs,ts2, reducible); 371 372 // INTERRUPTHANDLER 373 if ( interrupt_handle() ) return ListCFList() ; 374 // INTERRUPTHANDLER 375 367 376 DEBOUTLN(cout, "ts is: ", ts); 368 377 DEBOUTLN(cout, "ts2 is: ", ts2); … … 380 389 if ( cls(cs.getFirst()) > 0 ){ 381 390 ts = irras(cs,ts2,reducible); 391 392 // INTERRUPTHANDLER 393 if ( interrupt_handle() ) return ListCFList() ; 394 // INTERRUPTHANDLER 395 382 396 DEBOUTLN(cout, "ts is: ", ts); 383 397 DEBOUTLN(cout, "ts2 is: ", ts2); … … 469 483 DEBOUT(cout, "irras: factoring: ", elem); 470 484 qs = Factorize(elem); 485 486 // INTERRUPTHANDLER 487 if ( interrupt_handle() ) return CFList() ; 488 // INTERRUPTHANDLER 489 471 490 qs.removeFirst(); 472 491 DEBOUTLN(cout, " = ", qs); -
libfac/charset/charset.h
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: charset.h,v 1. 1.1.1 1997-05-02 17:00:44Singular Exp $4 // $Id: charset.h,v 1.2 1997-06-09 15:55:53 Singular Exp $ 5 5 //////////////////////////////////////////////////////////// 6 6 -
libfac/charset/csutil.cc
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 static char * rcsid = "$Id: csutil.cc,v 1. 1.1.1 1997-05-02 17:00:44 Singular Exp $";4 static char * rcsid = "$Id: csutil.cc,v 1.2 1997-06-09 15:55:54 Singular Exp $"; 5 5 ///////////////////////////////////////////////////////////// 6 6 // FACTORY - Includes -
libfac/charset/csutil.h
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: csutil.h,v 1. 1.1.1 1997-05-02 17:00:44Singular Exp $4 // $Id: csutil.h,v 1.2 1997-06-09 15:55:55 Singular Exp $ 5 5 //////////////////////////////////////////////////////////// 6 6 -
libfac/charset/reorder.cc
r6c02a5 r3e55bc 12 12 ///////////////////////////////////////////////////////////// 13 13 // emacs edit mode for this file is -*- C++ -*- 14 static char * rcsid = "$Id: reorder.cc,v 1. 1.1.1 1997-05-02 17:00:44Singular Exp $";14 static char * rcsid = "$Id: reorder.cc,v 1.2 1997-06-09 15:55:56 Singular Exp $"; 15 15 //////////////////////////////////////////////////////////// 16 16 // FACTORY - Includes -
libfac/charset/reorder.h
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: reorder.h,v 1. 1.1.1 1997-05-02 17:00:44Singular Exp $4 // $Id: reorder.h,v 1.2 1997-06-09 15:55:56 Singular Exp $ 5 5 //////////////////////////////////////////////////////////// 6 6 #ifndef INCL_REORDER_H -
libfac/charset/testcs.cc
r6c02a5 r3e55bc 1 // $Id: testcs.cc,v 1. 1.1.1 1997-05-02 17:00:44Singular Exp $1 // $Id: testcs.cc,v 1.2 1997-06-09 15:55:57 Singular Exp $ 2 2 3 3 #include <factory.h> -
libfac/configure
r6c02a5 r3e55bc 2 2 3 3 # Guess values for system-dependent variables and create Makefiles. 4 # Generated automatically using autoconf version 2. 94 # Generated automatically using autoconf version 2.10 5 5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. 6 6 # … … 335 335 336 336 -version | --version | --versio | --versi | --vers) 337 echo "configure generated by autoconf version 2. 9"337 echo "configure generated by autoconf version 2.10" 338 338 exit 0 ;; 339 339 … … 519 519 520 520 521 libfacversion="0.2.2" 521 libfac_name="\"Factorization and characteristic sets library\"" 522 523 libfac_version="0.2.4" 524 525 libfac_date="\"May 30 1997\"" 526 527 libfac_author="\"M. Messollen\"" 528 522 529 523 530 libfac="libfac" … … 579 586 LDFLAGS="-L. ${LDFLAGS}" 580 587 581 if test "${CXXFLAGS+set}" != set; then 582 ac_cxxflags_set=no 583 if test "$with_debug" = yes; then 584 CXXFLAGS="-g" 585 else 586 CXXFLAGS="-O" 587 cat >> confdefs.h <<\EOF 588 if test "$with_debug" = yes; then 589 CXXFLAGS="-g" 590 else 591 CXXFLAGS="-O" 592 cat >> confdefs.h <<\EOF 588 593 #define NDEBUG 1 589 594 EOF 590 595 591 fi 592 fi 593 596 fi 594 597 595 598 ac_ext=C … … 642 645 #endif 643 646 EOF 644 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:64 5: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then647 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then 645 648 ac_cv_prog_gxx=yes 646 649 else … … 691 694 CXXCPP="${CXX-g++} -E" 692 695 cat > conftest.$ac_ext <<EOF 693 #line 69 4"configure"696 #line 697 "configure" 694 697 #include "confdefs.h" 695 698 #include <stdlib.h> 696 699 EOF 697 700 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 698 { (eval echo configure: 699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }701 { (eval echo configure:702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 699 702 ac_err=`grep -v '^ *+' conftest.out` 700 703 if test -z "$ac_err"; then … … 798 801 fi 799 802 800 for ac_hdr in factory.h 801 do 802 ac_safe=`echo "$ac_hdr" | tr './\055' '___'` 803 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 803 804 ac_safe=`echo "factory.h" | tr './\055' '___'` 805 echo $ac_n "checking for factory.h""... $ac_c" 1>&6 804 806 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 805 807 echo $ac_n "(cached) $ac_c" 1>&6 806 808 else 807 809 cat > conftest.$ac_ext <<EOF 808 #line 8 09"configure"810 #line 811 "configure" 809 811 #include "confdefs.h" 810 #include < $ac_hdr>812 #include <factory.h> 811 813 EOF 812 814 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 813 { (eval echo configure:81 4: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }815 { (eval echo configure:816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 814 816 ac_err=`grep -v '^ *+' conftest.out` 815 817 if test -z "$ac_err"; then … … 825 827 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 826 828 echo "$ac_t""yes" 1>&6 827 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` 828 cat >> confdefs.h <<EOF 829 #define $ac_tr_hdr 1 830 EOF 831 829 : 832 830 else 833 831 echo "$ac_t""no" 1>&6 834 fi 835 done 836 837 838 if test "$ac_cv_header_factory_h" != yes; then 839 if test "$enable_factory" != yes; then 840 { echo "configure: error: Need factory.h to built libfac" 1>&2; exit 1; } 841 else 842 echo "configure: warning: Make sure to _install_ factory.h befor building libfac" 1>&2 843 fi 844 fi 832 echo "configure: warning: factory.h not found! Install factory before building libfac!" 1>&2 833 fi 834 845 835 846 836 … … 851 841 else 852 842 cat > conftest.$ac_ext <<EOF 853 #line 8 54 "configure"843 #line 844 "configure" 854 844 #include "confdefs.h" 855 845 … … 901 891 ; return 0; } 902 892 EOF 903 if { (eval echo configure: 904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then893 if { (eval echo configure:894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 904 894 rm -rf conftest* 905 895 ac_cv_c_const=yes … … 927 917 for ac_kw in inline __inline__ __inline; do 928 918 cat > conftest.$ac_ext <<EOF 929 #line 9 30 "configure"919 #line 920 "configure" 930 920 #include "confdefs.h" 931 921 … … 935 925 ; return 0; } 936 926 EOF 937 if { (eval echo configure:9 38: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then927 if { (eval echo configure:928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 938 928 rm -rf conftest* 939 929 ac_cv_c_inline=$ac_kw; break … … 960 950 961 951 if test ${GXX} = yes; then 962 if test "$ac_cxxflags_set" = no; then 963 if test "$with_debug" = yes; then 964 CXXFLAGS="-O -g" 965 else 966 CXXFLAGS="-O3 " 967 fi 952 if test "$with_debug" = yes; then 953 CXXFLAGS="-O -g" 954 else 955 CXXFLAGS="-O3 " 968 956 fi 969 957 CXXTEMPLFLAGS="-fno-implicit-templates" … … 1061 1049 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; 1062 1050 -version | --version | --versio | --versi | --vers | --ver | --ve | --v) 1063 echo "$CONFIG_STATUS generated by autoconf version 2. 9"1051 echo "$CONFIG_STATUS generated by autoconf version 2.10" 1064 1052 exit 0 ;; 1065 1053 -help | --help | --hel | --he | --h) … … 1101 1089 s%@infodir@%$infodir%g 1102 1090 s%@mandir@%$mandir%g 1103 s%@libfacversion@%$libfacversion%g 1091 s%@libfac_name@%$libfac_name%g 1092 s%@libfac_version@%$libfac_version%g 1093 s%@libfac_date@%$libfac_date%g 1094 s%@libfac_author@%$libfac_author%g 1104 1095 s%@libfac@%$libfac%g 1105 1096 s%@libfac_g@%$libfac_g%g … … 1178 1169 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 1179 1170 1171 -
libfac/configure.in
r6c02a5 r3e55bc 3 3 dnl 4 4 5 dnl 6 dnl Initialisation 7 dnl 5 8 AC_INIT(factor.h) 6 9 … … 8 11 dnl Set up variables for Makefile.in 9 12 dnl 10 AC_SUBST(libfacversion) 11 libfacversion="0.2.2" 13 dnl Change libfac variables here: 14 AC_SUBST(libfac_name) 15 libfac_name="\"Factorization and characteristic sets library\"" 16 AC_SUBST(libfac_version) 17 libfac_version="0.2.4" 18 AC_SUBST(libfac_date) 19 libfac_date="\"May 30 1997\"" 20 AC_SUBST(libfac_author) 21 libfac_author="\"M. Messollen\"" 22 12 23 AC_SUBST(libfac) 13 24 libfac="libfac" … … 66 77 LDFLAGS="-L. ${LDFLAGS}" 67 78 68 if test "${CXXFLAGS+set}" != set; then 69 ac_cxxflags_set=no 70 if test "$with_debug" = yes; then 71 CXXFLAGS="-g" 72 else 73 CXXFLAGS="-O" 74 AC_DEFINE(NDEBUG) 75 fi 79 if test "$with_debug" = yes; then 80 CXXFLAGS="-g" 81 else 82 CXXFLAGS="-O" 83 AC_DEFINE(NDEBUG) 76 84 fi 77 78 85 79 86 dnl … … 91 98 92 99 dnl 100 dnl programs for installation 101 dnl 102 dnl ac_save_path=${PATH} 103 dnl PATH="$PATH:.." 104 dnl AC_PROG_INSTALL 105 dnl AC_PATH_PROG(MKINSTALLDIRS, mkinstalldirs, -mkdir -p) 106 dnl PATH="$ac_save_path" 107 108 dnl 93 109 dnl Checks for header files. 94 110 dnl 95 AC_CHECK_HEADERS(factory.h) 96 97 if test "$ac_cv_header_factory_h" != yes; then 98 if test "$enable_factory" != yes; then 99 AC_MSG_ERROR(Need factory.h to built libfac) 100 else 101 AC_MSG_WARN(Make sure to _install_ factory.h befor building libfac) 102 fi 103 fi 111 AC_CHECK_HEADER(factory.h,,AC_MSG_WARN(factory.h not found! Install factory before building libfac!)) 104 112 105 113 dnl … … 118 126 dnl 119 127 if test ${GXX} = yes; then 120 if test "$ac_cxxflags_set" = no; then 121 if test "$with_debug" = yes; then 122 CXXFLAGS="-O -g" 123 else 124 CXXFLAGS="-O3 " 125 fi 128 if test "$with_debug" = yes; then 129 CXXFLAGS="-O -g" 130 else 131 CXXFLAGS="-O3 " 126 132 fi 127 133 CXXTEMPLFLAGS="-fno-implicit-templates" … … 132 138 133 139 AC_OUTPUT(Makefile) 140 141 dnl 142 dnl Plans: 143 dnl 1) look for libraries (warn if not found) for building testprog 144 dnl 1) search for perl -
libfac/factor.h
r6c02a5 r3e55bc 2 2 // Created by -- makeheader -- 3 3 /////////////////////////////////////// 4 #ifndef FACTOR_H 5 #define FACTOR_H 6 4 7 #include <factory.h> 8 9 // Set this to a nonzero value to interrupt the computation 10 extern int libfac_interruptflag; 11 12 // some values you can ask for: 13 extern char * libfac_name; 14 extern char * libfac_version; 15 extern char * libfac_date; 16 extern char * libfac_author; 5 17 6 18 //// Note: second argument for Factorize is for internal use only. … … 68 80 CFList reorder( const Varlist & betterorder, const CFList & PS); 69 81 ListCFList reorder(const Varlist & betterorder, const ListCFList & Q); 82 83 #endif /* FACTOR_H */ -
libfac/factor/Factor.cc
r6c02a5 r3e55bc 1 1 /* Copyright 1996 Michael Messollen. All rights reserved. */ 2 2 /////////////////////////////////////////////////////////////////////////////// 3 static char * rcsid = "$Id: Factor.cc,v 1. 1.1.1 1997-05-02 17:00:45Singular Exp $ ";3 static char * rcsid = "$Id: Factor.cc,v 1.2 1997-06-09 15:55:58 Singular Exp $ "; 4 4 static char * errmsg = "\nYou found a bug!\nPlease inform (Michael Messollen) michael@math.uni-sb.de \nPlease include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you."; 5 5 /////////////////////////////////////////////////////////////////////////////// … … 13 13 #include "Truefactor.h" 14 14 #include "homogfactor.h" 15 #include "interrupt.h" 15 16 16 17 #ifdef FACTORDEBUG … … 28 29 TIMING_DEFINE_PRINT(hensel_time); 29 30 TIMING_DEFINE_PRINT(truefactor_time); 31 32 extern int libfac_interruptflag; 33 #ifdef HAVE_SINGULAR 34 extern void WerrorS(char *); 35 #endif 30 36 31 37 /////////////////////////////////////////////////////////////// … … 204 210 else { 205 211 #ifdef HAVE_SINGULAR 206 extern void WerrorS(char *);207 212 WerrorS("libfac: ERROR: not_monic1: case lt is a sum."); 208 213 #else … … 222 227 else { 223 228 #ifdef HAVE_SINGULAR 224 extern void WerrorS(char *);225 229 WerrorS("libfac: ERROR: not_monic2: case lt is a sum."); 226 230 #else … … 312 316 else { 313 317 #ifdef HAVE_SINGULAR 314 extern void WerrorS(char *);315 318 WerrorS("libfac: evaluate: Extension not inFF() or inGF() !"); 316 319 #else … … 384 387 else { 385 388 #ifdef HAVE_SINGULAR 386 extern void WerrorS(char *);387 389 WerrorS("libfac: spezializePoly ERROR: Working over given extension-field not yet implemented!"); 388 390 #else … … 419 421 else { 420 422 #ifdef HAVE_SINGULAR 421 extern void WerrorS(char *);422 423 WerrorS("libfac: evaluate: Extension not inFF() or inGF() !"); 423 424 #else … … 504 505 CFMap m; 505 506 507 // INTERRUPTHANDLER 508 if ( interrupt_handle() ) return CFFList() ; 509 // INTERRUPTHANDLER 510 506 511 if ( F.isUnivariate() ){ // could have lost one Variable elsewhere 507 512 if ( degree(Extension) == 0 ){ … … 528 533 f=swapvar(F,mainvar,level(F)); 529 534 535 // INTERRUPTHANDLER 536 if ( interrupt_handle() ) return CFFList() ; 537 // INTERRUPTHANDLER 538 530 539 if ( oldmainvar != mainvar ){ 531 540 DEBOUTSL(cout); DEBOUT(cout,"Swapped poly ", F); … … 545 554 CFFList Outputlist_a, Outputlist_b; 546 555 Outputlist_a = Factorized(ff,alpha); 556 DEBOUTLN(cout, "Outputlist_a = ", Outputlist_a); 547 557 Outputlist_b = Factorized(ffuni,alpha); 558 DEBOUTLN(cout, "Outputlist_b = ", Outputlist_b); 548 559 Outputlist = myUnion(Outputlist_a, Outputlist_b); 549 560 // have to back-swapvar the factors.... … … 552 563 Outputlist2.append(CFFactor(swapvar(copy.factor(),oldmainvar,mainvar),copy.exp())); 553 564 } 565 DEBOUTLN(cout, "Outputlist2 (a+b swapped) (to return) = ", Outputlist2); 554 566 return Outputlist2; 555 567 } … … 587 599 if (success == 0 ){ // No spezialisation could be found 588 600 #ifdef HAVE_SINGULAR 589 extern void WerrorS(char *);590 601 WerrorS("libfac: Factorize: ERROR: Not able to find a valid specialization!"); 591 602 #else … … 596 607 return Outputlist; 597 608 } 609 610 // INTERRUPTHANDLER 611 if ( interrupt_handle() ) return CFFList() ; 612 // INTERRUPTHANDLER 613 598 614 ffuni = substitutePoly(ff,Substitutionlist); 599 615 // We now have an univariat poly; factorize that … … 623 639 DEBOUT(cout, " = ", UnivariateFactorlist); DEBOUTNL(cout); 624 640 641 // INTERRUPTHANDLER 642 if ( interrupt_handle() ) return CFFList() ; 643 // INTERRUPTHANDLER 644 625 645 TIMING_START(hensel_time); 626 646 Outputlist = MultiHensel(ff,UnivariateFactorlist,Substitutionlist); … … 628 648 TIMING_END(hensel_time); 629 649 650 // INTERRUPTHANDLER 651 if ( interrupt_handle() ) return CFFList() ; 652 // INTERRUPTHANDLER 653 630 654 TIMING_START(truefactor_time); 631 655 Outputlist = Truefactors(ff, level(ff), Substitutionlist, Outputlist); 632 656 DEBOUTLN(cout, "Outputlist after Truefactors: ", Outputlist); 633 657 TIMING_END(truefactor_time); 658 659 // INTERRUPTHANDLER 660 if ( interrupt_handle() ) return CFFList() ; 661 // INTERRUPTHANDLER 634 662 635 663 if ( lt != f.genOne() ){ … … 664 692 CFMap m; 665 693 694 // INTERRUPTHANDLER 695 if ( interrupt_handle() ) return CFFList() ; 696 // INTERRUPTHANDLER 697 666 698 DEBINCLEVEL(cout, "Factorize"); 667 699 DEBOUTMSG(cout, rcsid); … … 669 701 TIMING_START(factorize_time); 670 702 Outputlist= factorize(F); 671 // cout << "Factoring in char=0 of " << F << " = " << Outputlist << endl;672 // Factorization in char=0 doesn't sometimes return at least two elements!!!673 if ( getNumVars(Outputlist.getFirst().factor()) != 0 )674 Outputlist.insert(CFFactor(1,1));675 //cout << " Factorize in char=0: returning with: " << Outputlist << endl;676 TIMING_END(factorize_time);677 DEBDECLEVEL(cout, "Factorize");678 TIMING_PRINT(factorize_time, "\ntime used for factorization : ");679 return Outputlist;703 // cout << "Factoring in char=0 of " << F << " = " << Outputlist << endl; 704 // Factorization in char=0 doesn't sometimes return at least two elements!!! 705 if ( getNumVars(Outputlist.getFirst().factor()) != 0 ) 706 Outputlist.insert(CFFactor(1,1)); 707 //cout << " Factorize in char=0: returning with: " << Outputlist << endl; 708 TIMING_END(factorize_time); 709 DEBDECLEVEL(cout, "Factorize"); 710 TIMING_PRINT(factorize_time, "\ntime used for factorization : "); 711 return Outputlist; 680 712 } 681 713 TIMING_START(factorize_time); … … 684 716 // (If gcd is fast...) 685 717 /////// 686 // if ( ! SqrFreeTest(F) ){718 // if ( ! SqrFreeTest(F) ){ 687 719 if ( ! is_SqrFree ){ 688 TIMING_START(sqrfree_time); 689 SqrFreeList = InternalSqrFree(F) ; // first sqrfree the polynomial 690 // don't use sqrFree(F), factory's internal sqrFree for multiv. 691 // Polynomials; it's wrong!! Ex.: char=p f= x^p*(y+1); 692 // InternalSqrFree(f)= ( y+1, (x)^p ), sqrFree(f)= ( y+1 ) . 693 TIMING_END(sqrfree_time); 720 TIMING_START(sqrfree_time); 721 SqrFreeList = InternalSqrFree(F) ; // first sqrfree the polynomial 722 // don't use sqrFree(F), factory's internal sqrFree for multiv. 723 // Polynomials; it's wrong!! Ex.: char=p f= x^p*(y+1); 724 // InternalSqrFree(f)= ( y+1, (x)^p ), sqrFree(f)= ( y+1 ) . 725 TIMING_END(sqrfree_time); 726 727 // INTERRUPTHANDLER 728 if ( interrupt_handle() ) return CFFList() ; 729 // INTERRUPTHANDLER 730 694 731 } 695 732 else 696 733 SqrFreeList.append(CFFactor(F,1)); 697 734 DEBOUTLN(cout, "InternalSqrFreeList= ", SqrFreeList); 698 735 for ( i=SqrFreeList; i.hasItem(); i++ ){ … … 707 744 Intermediatelist=factorize(g,1); // poly is sqr-free! 708 745 for ( j=Intermediatelist; j.hasItem(); j++ ) 709 Outputlist.append( CFFactor( m(j.getItem().factor()),exp)); 746 //Normally j.getItem().exp() should be 1 747 Outputlist.append( CFFactor( m(j.getItem().factor()),exp*j.getItem().exp())); 710 748 } 711 749 else{ // multivariate polynomial … … 720 758 Intermediatelist = Factorized(g, minpoly, 0); 721 759 760 // INTERRUPTHANDLER 761 if ( interrupt_handle() ) return CFFList() ; 762 // INTERRUPTHANDLER 763 722 764 for ( j=Intermediatelist; j.hasItem(); j++ ) 723 Outputlist= myappend( Outputlist, CFFactor(m(j.getItem().factor()),exp)); 765 //Normally j.getItem().exp() should be 1 766 Outputlist= myappend( Outputlist, CFFactor(m(j.getItem().factor()),exp*j.getItem().exp())); 724 767 } 725 768 } … … 738 781 } 739 782 } 740 783 741 784 r=F/g; 742 785 Outputlist2.insert(CFFactor(r,1)); 743 786 744 787 DEBDECLEVEL(cout, "Factorize"); 745 788 TIMING_END(factorize_time); -
libfac/factor/Factor.h
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: Factor.h,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $4 // $Id: Factor.h,v 1.2 1997-06-09 15:55:59 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef FACTOR_H -
libfac/factor/MVMultiHensel.cc
r6c02a5 r3e55bc 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // static char * rcsid = "$Id: MVMultiHensel.cc,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $";4 // static char * rcsid = "$Id: MVMultiHensel.cc,v 1.2 1997-06-09 15:56:00 Singular Exp $"; 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 // FACTORY - Includes -
libfac/factor/MVMultiHensel.h
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: MVMultiHensel.h,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $4 // $Id: MVMultiHensel.h,v 1.2 1997-06-09 15:56:00 Singular Exp $ 5 5 ///////////////////////////////////////////////////////////// 6 6 #ifndef MULTIHENSEL_H -
libfac/factor/Makefile
r6c02a5 r3e55bc 1 # static char rcsid[] = "@(#) $Id: Makefile,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $";1 # static char rcsid[] = "@(#) $Id: Makefile,v 1.2 1997-06-09 15:56:01 Singular Exp $"; 2 2 ############################################################################# 3 3 # testcs: CharSet(F) -
libfac/factor/SqrFree.cc
r6c02a5 r3e55bc 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 static char * rcsid = "$Id: SqrFree.cc,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $";4 static char * rcsid = "$Id: SqrFree.cc,v 1.2 1997-06-09 15:56:02 Singular Exp $"; 5 5 static char * errmsg = "\nYou found a bug!\nPlease inform (Michael Messollen) michael@math.uni-sb.de .n Please include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you."; 6 6 /////////////////////////////////////////////////////////////////////////////// … … 21 21 TIMING_DEFINE_PRINT(squarefree_time); 22 22 TIMING_DEFINE_PRINT(gcd_time); 23 24 #ifdef HAVE_SINGULAR 25 extern void WerrorS(char *); 26 #endif 23 27 24 28 // forward declaration: … … 122 126 } 123 127 #ifdef HAVE_SINGULAR 124 extern void WerrorS(char *);125 128 WerrorS("libfac: ERROR: SqrFreeTest: we should never fall trough here!"); 126 129 #else … … 189 192 // is it Pth root? 190 193 n=level(f); // maybe less indeterminants 191 if ( getCharacteristic() > 0 ){ // Pth roots only apply to char > 0 194 g= f.deriv(); 195 if ( getCharacteristic() > 0 && g.isZero() ){ // Pth roots only apply to char > 0 192 196 for (int k=1; k<=n; k++) { 193 197 g=swapvar(f,k,n) ; g = g.deriv(); 194 if ( ! g.isZero() ) break; // can`t be Pth root 198 if ( ! g.isZero() ){ // can`t be Pth root 199 CFFList Outputlist2= SqrFreed(swapvar(f,k,n)); 200 for (CFFListIterator inter=Outputlist2; inter.hasItem(); inter++){ 201 Outputlist= myappend(Outputlist, CFFactor(swapvar(inter.getItem().factor(),k,n), inter.getItem().exp())); 202 } 203 return Outputlist; 204 } 195 205 else 196 206 if ( k==n ) { // really is Pth power … … 242 252 } 243 253 #ifdef HAVE_SINGULAR 244 extern void WerrorS(char *);245 254 WerrorS("libfac: ERROR: SqrFreed: we should never fall trough here!"); 246 255 #else -
libfac/factor/SqrFree.h
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: SqrFree.h,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $4 // $Id: SqrFree.h,v 1.2 1997-06-09 15:56:03 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef SQRFREE_H -
libfac/factor/Truefactor.cc
r6c02a5 r3e55bc 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 //static char * rcsid = "@(#) $Id: Truefactor.cc,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $";4 //static char * rcsid = "@(#) $Id: Truefactor.cc,v 1.2 1997-06-09 15:56:04 Singular Exp $"; 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 // Factory - Includes … … 19 19 #include "timing.h" 20 20 21 #ifdef HAVE_SINGULAR 22 extern void WerrorS(char *); 23 #endif 21 24 /////////////////////////////////////////////////////////////// 22 25 // generate all different k-subsets of the set with n // … … 86 89 CFFList Returnlist; 87 90 91 DEBOUTLN(cout, "Remove_from_List called with L= ",L); 92 DEBOUTLN(cout, " and elem= ",elem); 88 93 for ( ListIterator<CFFactor> i = L ; i.hasItem(); i++) 89 94 if ( i.getItem().factor() != elem ) … … 158 163 159 164 // step 2: Do we have to check combinations? 160 degU = L.length(); 161 if ( degU == 0 ) // No elements: Return 165 degU = L.length(); 166 if ( degU == 0 ) // No elements: Return 167 return FAC; 168 else 169 if ( degU < 4 ){ // Less then four elements: no combinations possible 170 FAC.append( CFFactor(U,1) ); 162 171 return FAC; 163 else 164 if ( degU < 4 ){ // Less then four elements: no combinations possible 165 FAC.append( CFFactor(U,1) ); 166 return FAC; 167 } 168 else { 169 M = 1; r = r - FAC.length(); degU = degree(U, levelU)/2; 170 } 171 172 DEBOUTLN(cout,"Truefactors: (step2) M = ", M); 173 DEBOUTLN(cout," r = ", r); 174 DEBOUTLN(cout," degU= ", degU); 175 172 } 173 else { 174 M = 1; r = r - FAC.length(); degU = degree(U, levelU)/2; 175 } 176 177 DEBOUTLN(cout,"Truefactors: (step2) M = ", M); 178 DEBOUTLN(cout," r = ", r); 179 DEBOUTLN(cout," degU= ", degU); 180 176 181 // Now do the real work! 177 182 // Test all the combinations of possible factors. 178 183 179 184 onemore=1; 180 185 // steps 3 to 6 181 186 while (1){ … … 212 217 degU = degree(U, levelU)/2; // new degU 213 218 // L = L \ {factor} 219 // Hier ist noch etwas faul; wir muessen (f=prod(f_i)) die f_i 220 // entfernen und nicht f! 214 221 L = Remove_from_List( L, factor.factor() ); 215 222 r -= 1; … … 271 278 if ( PossibleFactors.length() < n ) { // a little check 272 279 #ifdef HAVE_SINGULAR 273 extern void WerrorS(char *);274 280 WerrorS("libfac: ERROR: TakeNorms less then two items remaining!"); 275 281 #else … … 314 320 else{ 315 321 #ifdef HAVE_SINGULAR 316 extern void WerrorS(char *);317 322 WerrorS("libfac: TakeNorms: somethings wrong with remaining factors!"); 318 323 #else -
libfac/factor/Truefactor.h
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: Truefactor.h,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $4 // $Id: Truefactor.h,v 1.2 1997-06-09 15:56:05 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef TRUEFACTOR_H -
libfac/factor/class.cc
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // static char * rcsid = "@(#) $Id: class.cc,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $";4 // static char * rcsid = "@(#) $Id: class.cc,v 1.2 1997-06-09 15:56:05 Singular Exp $"; 5 5 //////////////////////////////////////////////////////////// 6 6 … … 36 36 void Substitution<T>::print ( ostream& s ) const 37 37 { 38 #ifndef NOSTREAMIO39 38 s << "(" << factor() << ")^" << exp(); 40 #endif41 39 } 42 40 -
libfac/factor/class.h
r6c02a5 r3e55bc 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: class.h,v 1. 1.1.1 1997-05-02 17:00:46 Singular Exp $4 // $Id: class.h,v 1.2 1997-06-09 15:56:06 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef INCL_CLASS_H … … 33 33 friend int operator== ( const Substitution<T>&, const Substitution<T>& ); 34 34 void print ( ostream& ) const; 35 #ifndef NOSTREAMIO36 35 friend ostream& operator<< ( ostream & os, const Substitution<T> & f ) 37 36 { … … 39 38 return os; 40 39 } 41 #endif42 40 }; 43 41 -
libfac/factor/debug.cc
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // static char * rcsid = "$Id: debug.cc,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $ ";4 // static char * rcsid = "$Id: debug.cc,v 1.2 1997-06-09 15:56:07 Singular Exp $ "; 5 5 //////////////////////////////////////////////////////////// 6 6 static int deb_level; -
libfac/factor/debug.h
r6c02a5 r3e55bc 1 1 /* Copyright 1996 Michael Messollen. All rights reserved. */ 2 2 //////////////////////////////////////////////////////////// 3 // static char * rcsid = "$Id: debug.h,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $" ;3 // static char * rcsid = "$Id: debug.h,v 1.2 1997-06-09 15:56:08 Singular Exp $" ; 4 4 //////////////////////////////////////////////////////////// 5 5 // It is possible to include this file multiple times for different -
libfac/factor/helpstuff.cc
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // static char * rcsid = "$Id: helpstuff.cc,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $";4 // static char * rcsid = "$Id: helpstuff.cc,v 1.2 1997-06-09 15:56:08 Singular Exp $"; 5 5 //////////////////////////////////////////////////////////// 6 6 // FACTORY - Includes … … 38 38 copy = i.getItem(); 39 39 if ( copy.factor() == TheFactor.factor() ) 40 exp = copy.exp();40 exp += copy.exp(); 41 41 else 42 42 Outputlist.append(copy); -
libfac/factor/helpstuff.h
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: helpstuff.h,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $4 // $Id: helpstuff.h,v 1.2 1997-06-09 15:56:09 Singular Exp $ 5 5 //////////////////////////////////////////////////////////// 6 6 #ifndef HELPSTUFF_H -
libfac/factor/homogfactor.cc
r6c02a5 r3e55bc 1 1 /* Copyright 1997 Michael Messollen. All rights reserved. */ 2 2 //////////////////////////////////////////////////////////// 3 // static char * rcsid = "$Id: homogfactor.cc,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $ ";3 // static char * rcsid = "$Id: homogfactor.cc,v 1.2 1997-06-09 15:56:10 Singular Exp $ "; 4 4 //////////////////////////////////////////////////////////// 5 5 // FACTORY - Includes -
libfac/factor/homogfactor.h
r6c02a5 r3e55bc 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: homogfactor.h,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $4 // $Id: homogfactor.h,v 1.2 1997-06-09 15:56:10 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef HFACTOR_H -
libfac/factor/test.cc
r6c02a5 r3e55bc 1 //static char rcsid[] = "@(#) $Id: test.cc,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $";1 //static char rcsid[] = "@(#) $Id: test.cc,v 1.2 1997-06-09 15:56:11 Singular Exp $"; 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // CLAP - Includes -
libfac/factor/timing.h
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // static char * rcsid = "$Id: timing.h,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $";4 // static char * rcsid = "$Id: timing.h,v 1.2 1997-06-09 15:56:12 Singular Exp $"; 5 5 //////////////////////////////////////////////////////////// 6 6 // It is possible to include this file multiple times for different -
libfac/factor/tmpl_inst.cc
r6c02a5 r3e55bc 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: tmpl_inst.cc,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $4 // $Id: tmpl_inst.cc,v 1.2 1997-06-09 15:56:12 Singular Exp $ 5 5 //////////////////////////////////////////////////////////// 6 6 -
libfac/factor/tmpl_inst.cc.factory1.1
r6c02a5 r3e55bc 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: tmpl_inst.cc.factory1.1,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $2 // $Id: tmpl_inst.cc.factory1.1,v 1.2 1997-06-09 15:56:13 Singular Exp $ 3 3 4 4 #include <templates/array.cc> -
libfac/factor/tmpl_inst.h
r6c02a5 r3e55bc 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: tmpl_inst.h,v 1. 1.1.1 1997-05-02 17:00:46Singular Exp $4 // $Id: tmpl_inst.h,v 1.2 1997-06-09 15:56:14 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef TMPL_INST_H -
libfac/factor/version.cc
r6c02a5 r3e55bc 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: version.cc,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $ 4 // $Id: version.cc,v 1.2 1997-06-09 15:56:14 Singular Exp $ 5 static char * rcsid = "@(#) libfac version 0.2.4 [May 29 1997] (C) 1996-97 M. Messollen"; 5 6 /////////////////////////////////////////////////////////////////////////////// 6 7 7 8 char * libfac_name = "Factorization and characteristic sets library"; 8 char * libfac_version = "0.2. 1";9 char * libfac_date = " Apr 261997";9 char * libfac_version = "0.2.4"; 10 char * libfac_date = "May 30 1997"; 10 11 char * libfac_author = "M. Messollen"; 11 12 13 int libfac_interruptflag=0; -
libfac/header.tpl
r6c02a5 r3e55bc 2 2 // Created by -- makeheader -- 3 3 /////////////////////////////////////// 4 #ifndef FACTOR_H 5 #define FACTOR_H 6 4 7 #include <factory.h> 8 9 .INCLUDE factor/interrupt.h 10 11 // some values you can ask for: 12 extern char * libfac_name; 13 extern char * libfac_version; 14 extern char * libfac_date; 15 extern char * libfac_author; 5 16 6 17 //// Note: second argument for Factorize is for internal use only. … … 22 33 23 34 .INCLUDE charset/reorder.h 35 36 #endif /* FACTOR_H */ -
libfac/test.cc
r6c02a5 r3e55bc 1 //static char rcsid[] = "$Id: test.cc,v 1. 1.1.1 1997-05-02 17:00:43Singular Exp $";1 //static char rcsid[] = "$Id: test.cc,v 1.2 1997-06-09 15:55:50 Singular Exp $"; 2 2 /////////////////////////////////////////////////////////////////////////////// 3 // FACTORY - Includes4 // (x+y+z)*(x+y-z)*(x-y+z)*(x-y-z)*x*y;5 #include <factory.h>6 3 // Factor - Includes 7 4 #include "factor.h" 8 #include "tmpl_inst.h"9 #include "helpstuff.h"10 5 11 extern char * libfac_name;12 extern char * libfac_version;13 extern char * libfac_date;14 extern char * libfac_author;15 6 16 7 void
Note: See TracChangeset
for help on using the changeset viewer.