Changeset 3e55bc in git


Ignore:
Timestamp:
Jun 9, 1997, 5:56:14 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '91e5db82acc17434e4062bcfa44e6efa7d41fd30')
Children:
db12c52f20de2574cfcb364effcf969b39384547
Parents:
6c02a5092325a53a0cda2cf6756a4ba1d9765c67
Message:
* hannes/michael: libfac 0.2.4


git-svn-id: file:///usr/local/Singular/svn/trunk@377 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
libfac
Files:
40 edited

Legend:

Unmodified
Added
Removed
  • libfac/00README

    r6c02a5 r3e55bc  
    1 This is the file 00README.libfac for version 0.2.1 of libfac.
     1This is the file 00README.libfac for version 0.2.4 of libfac.
    22
    33######### What is libfac?
    44libfac 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!
     5about factory and what it does; look at REQUIREMENTS how to get factory),
     6which implements factorization of polynomials over finite fields and algorithms
     7for manipulation of polynomial ideals via the characteristic set methods
     8(e.g., calculating the characteristic set and the irreducible characteristic
     9series).
     10
     11Note: libfac is just beta-code (as long version is < 1.0.0). There are bugs, I
     12think. Please help to test this code! Submit a bug-report if you found a bug!
    1213
    1314######### Copyright #####################
     
    2324 a) this 00README alone
    2425 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, you
    28     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.
    2930
    3031In other words: You are not allowed to distribute the sources or part of the
     
    3334
    3435In no event you are allowed to modify the sources (beside the Makefile's,
    35 configure.in, configure and install-sh).
     36configure.in, configure, makedirs and install-sh).
     37
    3638Note that no permission is granted to extract a portion of the source code of
    3739this library and incorporate it into another program.
     
    4244Note: This restricted copyright will change in future to a more "free" one.
    4345But for now I want to keep track of the sources (this is the intention of the
    44 restrictions of this licence). They aren't in their final state and there will
     46restrictions of this license). They aren't in their final state and there will
    4547be bugs (or even "features"). So please let *me* fix any problems.
    4648
     
    7375
    7476######### 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
    8881 
    8982* gcc 2.7.2 ( earlier versions of gcc *may* work as well as any other ANSI C++
     
    9891  configure [--with-debug] [--with-Singular] [--includedir=path-to-factory.h]
    9992  make
    100 this will produce libfac.a or singlibfac.a (depending on --with-Singular).
    101 
    102 B) Using Makefile.dist
     93this will produce libfac.a or libsingfac.a (depending on --with-Singular).
     94The only difference between libfac.a and libsingfac.a is: we don't instantiate
     95any templates for libsingfac.a.
     96
     97B) Using Makefile.dist (this is not recommended; maybe you have to edit a lot
     98to reflect your systems configuration.)
    10399copy Makefile.dist to Makefile
    104100Edit the factoryversion and the path to the factory library in the top Makefile
    105101(in this directory).
    106102currently: 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)
    108105
    109106type:
     
    158155
    159156########### KNOWN BUGS ############################
    160 * The  irreducible characteristic series stuff doesn't work for some problems.
     157o The  irreducible characteristic series stuff doesn't work for some problems.
    161158  You will get a warning:
    162159         "Factorization over algebraic function field required!"
     
    165162  Don't trust the result you'll get in such a case!!!!!!
    166163
    167 * The performance of the irreducible characteristic series stuff heavily
     164o The performance of the irreducible characteristic series stuff heavily
    168165  depends on the ordering of the variables in some cases. No (nearly) optimal
    169   ordering of the variables is choosen automatically, right now.
     166  ordering of the variables is chosen automatically, right now.
    170167  E.g.: if your ideal is (t^10-x, t^31-t^6-t-y, t^8-z) and you choose the
    171168  variable ordering with t > z > y > x, the calculation of the irreducible
     
    176173Since version 0.2 of the library:
    177174(There is now a function: Varlist neworder(const CFList & PolyList ),
    178  which returns a list of heuristically optimal reorderd variables;
     175 which returns a list of heuristically optimal reordered variables;
    179176 if you use the library for programming purpose, look at factor.h how to
    180177 use this function in your code)
     
    182179respective program, if and how this is incorporated.
    183180
    184 * Factorization is slow for large polynomials. There are mainly two reasons
     181o Factorization is slow for large polynomials. There are mainly two reasons
    185182  for this:
    186183   a) the factorization algorithm is shipped with no "tricks" yet. (I'm working
    187184      on that, but it heavily depends on b) )
    188    b) factory has an extremly slow GCD-algorithm for the case of characteristic
    189       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 )
    190187  There will be a quite different, faster factorization algorithm in the
    191188  future.
     
    197194          e.g.: 0.1 major=0 minor=1 no bugfixnumber (no bugfix incorporated)
    198195
    199 V0.1    * Initial version for alpha-testers
    200 
    201 V0.2    * Added neworder(..) and reorder(..) for IrrCharSeries
    202         * Added external strings (in factor/version.cc):
     196V0.1    o Initial version for alpha-testers
     197
     198V0.2    o Added neworder(..) and reorder(..) for IrrCharSeries
     199        o Added external strings (in factor/version.cc):
    203200            libfac_name     - the name of the game
    204201            libfac_version  - the version number
    205202            libfac_date     - the date libfac_version was released
    206203            libfac_author   - who wants to know?
    207         * added support for factorization of homogenious polynomials (in
     204        o added support for factorization of homogeneous polynomials (in
    208205          factor/homogfactor.cc),
    209206          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;
    211208          mainly for internal use
    212209
    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)
     210V0.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)
    215212          (why the hell don't they use libiostream?)
    216         * added configure -- basics only; (old)Makefile changed to
     213        o added configure -- basics only; (old)Makefile changed to
    217214          Makefile.dist (if nothing works...)
    218215          Makefile produced with configure uses GNU coding standards
    219 
     216        o released Apr 25 1997
     217
     218V0.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
     227V0.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
     236V0.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:43 Singular Exp $
     1# $Id: Makefile.dist,v 1.2 1997-06-09 15:55:46 Singular Exp $
    22#################################################
    33factoryversion = 1.2b
     
    77AR = ar cr
    88RANLIB = ranlib
    9 LIBPREF = libfac
     9LIBPREFX = libfac
    1010OPTMARK =
    11 LIBFAC = $(LIBPREF)$(OPTMARK).a
    12 LIBFAC-G = $(LIBPREF)-g$(OPTMARK).a
     11LIBFAC = $(LIBPREFIX)$(OPTMARK).a
     12LIBFAC-G = $(LIBPREFIX)-g$(OPTMARK).a
    1313SINGLIBFAC = libsingfac$(OPTMARK).a
    1414SINGLIBFAC-G = libsingfac-g$(OPTMARK).a 
     
    5353OPTOBJ/%.o: factor/%.cc ; $(OPTCXX) -c $< $(CFLAGS) $(IFLAGS) $(OPTFLAGS) -o $@
    5454
    55 .c.a:
    56         $(CXX) $(CFLAGS) $(OPTFLAGS) -c $< -o $*.o
    57         $(AR) $@ $*.o
    58         $(RANLIB) $@
    59 
    6055
    6156FACTORSRC1 =    factor/SqrFree.cc factor/Factor.cc \
     
    9590                $(LD) -o test $(LIBPATH) DEBOBJ/test.o $(DEBLIBS)
    9691
    97 opttest:        libfac OPTOBJ/test.o   
     92opttest:        libfac OPTOBJ/test.o
    9893                $(OPTLD) -o test $(LIBPATH) OPTOBJ/test.o $(OPTLIBS)
    9994
     
    161156OPTOBJ/tmpl_inst.o: factor/tmpl_inst.cc ; $(OPTCXX) -c $< $(CFLAGS) $(OPTFLAGSTMPL) $(IFLAGS) -o $@
    162157
    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 obachman Exp $
     1# $Id: Makefile.in,v 1.7 1997-06-09 15:55:47 Singular Exp $
    22#################################################
    33SHELL           = /bin/sh
    4 RM              = rm -f
     4RM              = -rm -f
    55#################################################
    66TARGETNAME              = @targetname@
    7 LIBFACVERSION           = @libfacversion@
     7LIBFACNAME              = @libfac_name@
     8LIBFACVERSION           = @libfac_version@
     9LIBFACDATE              = @libfac_date@
     10LIBFACAUTHOR            = @libfac_author@
    811LIBFACNAME              = @libfac@
    912SINGLIBFACNAME          = @libsingfac@
     
    2023libdir          = @libdir@
    2124includedir      = @includedir@
    22 templatedir     = ${includedir}/templates
    2325
    2426##
     
    2931CXX             = @CXX@
    3032INSTALL         = ./install-sh -c
    31 INSTALL_PROGRAM = ${INSTALL}
    3233INSTALL_DATA    = ${INSTALL} -m 644
    33 MKINSTALLDIRS   = ./mkinstalldirs
     34INSTALL_PROGRAM = ${INSTALL}
     35MKINSTALLDIRS   = ./mkinstalldirs
    3436
    3537##
     
    4143DEFS            = @DEFS@
    4244LDFLAGS         = @LDFLAGS@
    43 LIBS            = @LIBS@
     45LIBS            = @LIBS@ -lfac -lcf -lmem -lgmp
    4446
    4547##
     
    5052                factor/MVMultiHensel.cc factor/Truefactor.cc \
    5153                factor/helpstuff.cc  factor/debug.cc factor/version.cc \
    52                 factor/homogfactor.cc
     54                factor/homogfactor.cc 
    5355FACTORSRC2 =    factor/tmpl_inst.cc
    5456FACTORSRC =     $(FACTORSRC2) $(FACTORSRC1)
     
    5961FACTORINCL =    factor/Factor.h factor/MVMultiHensel.h factor/Truefactor.h \
    6062                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
    6465CHARSETINCL =   charset/csutil.h charset/charset.h charset/reorder.h
    6566
     
    8485##
    8586
     87.SUFFIXES:      .cc .h .o
    8688
    87 all: OPTOBJ ${TARGETNAME}
    88 
    89 OPTOBJ:
    90         ${MKINSTALLDIRS} OPTOBJ
    91 
    92 .SUFFIXES:      .cc .h .o
     89all: ${TARGETNAME}
    9390
    9491OPTOBJ/%.o: %.cc
     
    144141        ${MKINSTALLDIRS} ${includedir}
    145142        ${MKINSTALLDIRS} ${libdir}
    146         ${MKINSTALLDIRS} ${templatedir}
    147143        ${INSTALL_DATA} ${LIBFACINCLUDE} ${includedir}
    148144        ${INSTALL_PROGRAM} ${TARGETNAME}.a ${libdir}
    149         ${RANLIB} ${libdir}/${TARGETNAME}.a
     145        $(RANLIB) ${libdir}/${TARGETNAME}.a
    150146
    151147uninstall:
  • libfac/bin/makeheader

    r6c02a5 r3e55bc  
    1 #!/bin/perl
     1#!/usr/local/bin/perl
    22
    33###
  • libfac/charset/Makefile

    r6c02a5 r3e55bc  
    1 # static char rcsid[] = "@(#) $Id: Makefile,v 1.1.1.1 1997-05-02 17:00:44 Singular Exp $";
     1# static char rcsid[] = "@(#) $Id: Makefile,v 1.2 1997-06-09 15:55:52 Singular Exp $";
    22################################################
    33# testcs:   CharSet(F)
  • libfac/charset/charset.cc

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// 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:44 Singular Exp $";
     4static char * rcsid = "$Id: charset.cc,v 1.2 1997-06-09 15:55:53 Singular Exp $";
    55/////////////////////////////////////////////////////////////
    66// FACTORY - Includes
     
    99#include <SqrFree.h>
    1010#include <Factor.h>
     11#include <interrupt.h>
    1112// Charset - Includes
    1213#include "csutil.h"
     
    3334#include "debug.h"
    3435
     36// the next computes a characteristic set (a basic set in Wang's sense)
    3537CFList
    3638BasicSet( const CFList &PS )
     
    8688#include "debug.h"
    8789
    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)
    8992CFList
    9093MCharSetN( const CFList &PS, PremForm & Remembern ){
     
    144147}
    145148
     149// the "original" extended characteristic set
    146150CFList
    147151CharSet( const CFList &PS ){
     
    365369    if ( cls(cs.getFirst()) > 0 ){
    366370      ts = irras(cs,ts2, reducible);
     371
     372      // INTERRUPTHANDLER
     373      if ( interrupt_handle() ) return ListCFList() ;
     374      // INTERRUPTHANDLER
     375
    367376      DEBOUTLN(cout, "ts is: ", ts);
    368377      DEBOUTLN(cout, "ts2 is: ", ts2);
     
    380389          if ( cls(cs.getFirst()) > 0 ){
    381390            ts = irras(cs,ts2,reducible);
     391
     392            // INTERRUPTHANDLER
     393            if ( interrupt_handle() ) return ListCFList() ;
     394            // INTERRUPTHANDLER
     395
    382396            DEBOUTLN(cout, "ts is: ", ts);
    383397            DEBOUTLN(cout, "ts2 is: ", ts2);
     
    469483    DEBOUT(cout, "irras: factoring: ", elem);
    470484    qs = Factorize(elem);
     485
     486    // INTERRUPTHANDLER
     487    if ( interrupt_handle() ) return CFList() ;
     488    // INTERRUPTHANDLER
     489
    471490    qs.removeFirst();
    472491    DEBOUTLN(cout, "  = ", qs);
  • libfac/charset/charset.h

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: charset.h,v 1.1.1.1 1997-05-02 17:00:44 Singular Exp $
     4// $Id: charset.h,v 1.2 1997-06-09 15:55:53 Singular Exp $
    55////////////////////////////////////////////////////////////
    66
  • libfac/charset/csutil.cc

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// 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 $";
     4static char * rcsid = "$Id: csutil.cc,v 1.2 1997-06-09 15:55:54 Singular Exp $";
    55/////////////////////////////////////////////////////////////
    66// FACTORY - Includes
  • libfac/charset/csutil.h

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: csutil.h,v 1.1.1.1 1997-05-02 17:00:44 Singular Exp $
     4// $Id: csutil.h,v 1.2 1997-06-09 15:55:55 Singular Exp $
    55////////////////////////////////////////////////////////////
    66
  • libfac/charset/reorder.cc

    r6c02a5 r3e55bc  
    1212/////////////////////////////////////////////////////////////
    1313// 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:44 Singular Exp $";
     14static char * rcsid = "$Id: reorder.cc,v 1.2 1997-06-09 15:55:56 Singular Exp $";
    1515////////////////////////////////////////////////////////////
    1616// FACTORY - Includes
  • libfac/charset/reorder.h

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: reorder.h,v 1.1.1.1 1997-05-02 17:00:44 Singular Exp $
     4// $Id: reorder.h,v 1.2 1997-06-09 15:55:56 Singular Exp $
    55////////////////////////////////////////////////////////////
    66#ifndef INCL_REORDER_H
  • libfac/charset/testcs.cc

    r6c02a5 r3e55bc  
    1 // $Id: testcs.cc,v 1.1.1.1 1997-05-02 17:00:44 Singular Exp $
     1// $Id: testcs.cc,v 1.2 1997-06-09 15:55:57 Singular Exp $
    22
    33#include <factory.h>
  • libfac/configure

    r6c02a5 r3e55bc  
    22
    33# Guess values for system-dependent variables and create Makefiles.
    4 # Generated automatically using autoconf version 2.9
     4# Generated automatically using autoconf version 2.10
    55# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
    66#
     
    335335
    336336  -version | --version | --versio | --versi | --vers)
    337     echo "configure generated by autoconf version 2.9"
     337    echo "configure generated by autoconf version 2.10"
    338338    exit 0 ;;
    339339
     
    519519
    520520
    521 libfacversion="0.2.2"
     521libfac_name="\"Factorization and characteristic sets library\""
     522
     523libfac_version="0.2.4"
     524
     525libfac_date="\"May 30 1997\""
     526
     527libfac_author="\"M. Messollen\""
     528
    522529
    523530libfac="libfac"
     
    579586LDFLAGS="-L. ${LDFLAGS}"
    580587
    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
     588if test "$with_debug" = yes; then
     589  CXXFLAGS="-g"
     590else
     591  CXXFLAGS="-O"
     592  cat >> confdefs.h <<\EOF
    588593#define NDEBUG 1
    589594EOF
    590595 
    591   fi
    592 fi
    593 
     596fi
    594597
    595598ac_ext=C
     
    642645#endif
    643646EOF
    644 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
     647if { 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
    645648  ac_cv_prog_gxx=yes
    646649else
     
    691694  CXXCPP="${CXX-g++} -E"
    692695  cat > conftest.$ac_ext <<EOF
    693 #line 694 "configure"
     696#line 697 "configure"
    694697#include "confdefs.h"
    695698#include <stdlib.h>
    696699EOF
    697700ac_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; }
    699702ac_err=`grep -v '^ *+' conftest.out`
    700703if test -z "$ac_err"; then
     
    798801fi
    799802
    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
     804ac_safe=`echo "factory.h" | tr './\055' '___'`
     805echo $ac_n "checking for factory.h""... $ac_c" 1>&6
    804806if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    805807  echo $ac_n "(cached) $ac_c" 1>&6
    806808else
    807809  cat > conftest.$ac_ext <<EOF
    808 #line 809 "configure"
     810#line 811 "configure"
    809811#include "confdefs.h"
    810 #include <$ac_hdr>
     812#include <factory.h>
    811813EOF
    812814ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    813 { (eval echo configure:814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     815{ (eval echo configure:816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    814816ac_err=`grep -v '^ *+' conftest.out`
    815817if test -z "$ac_err"; then
     
    825827if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    826828  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  :
    832830else
    833831  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
     832echo "configure: warning: factory.h not found! Install factory before building libfac!" 1>&2
     833fi
     834
    845835
    846836
     
    851841else
    852842  cat > conftest.$ac_ext <<EOF
    853 #line 854 "configure"
     843#line 844 "configure"
    854844#include "confdefs.h"
    855845
     
    901891; return 0; }
    902892EOF
    903 if { (eval echo configure:904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     893if { (eval echo configure:894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    904894  rm -rf conftest*
    905895  ac_cv_c_const=yes
     
    927917for ac_kw in inline __inline__ __inline; do
    928918  cat > conftest.$ac_ext <<EOF
    929 #line 930 "configure"
     919#line 920 "configure"
    930920#include "confdefs.h"
    931921
     
    935925; return 0; }
    936926EOF
    937 if { (eval echo configure:938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     927if { (eval echo configure:928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    938928  rm -rf conftest*
    939929  ac_cv_c_inline=$ac_kw; break
     
    960950
    961951if 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 "
    968956  fi
    969957  CXXTEMPLFLAGS="-fno-implicit-templates"
     
    10611049    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
    10621050  -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"
    10641052    exit 0 ;;
    10651053  -help | --help | --hel | --he | --h)
     
    11011089s%@infodir@%$infodir%g
    11021090s%@mandir@%$mandir%g
    1103 s%@libfacversion@%$libfacversion%g
     1091s%@libfac_name@%$libfac_name%g
     1092s%@libfac_version@%$libfac_version%g
     1093s%@libfac_date@%$libfac_date%g
     1094s%@libfac_author@%$libfac_author%g
    11041095s%@libfac@%$libfac%g
    11051096s%@libfac_g@%$libfac_g%g
     
    11781169test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
    11791170
     1171
  • libfac/configure.in

    r6c02a5 r3e55bc  
    33dnl
    44
     5dnl
     6dnl Initialisation
     7dnl
    58AC_INIT(factor.h)
    69
     
    811dnl Set up variables for Makefile.in
    912dnl
    10 AC_SUBST(libfacversion)
    11 libfacversion="0.2.2"
     13dnl Change libfac variables here:
     14AC_SUBST(libfac_name)
     15libfac_name="\"Factorization and characteristic sets library\""
     16AC_SUBST(libfac_version)
     17libfac_version="0.2.4"
     18AC_SUBST(libfac_date)
     19libfac_date="\"May 30 1997\""
     20AC_SUBST(libfac_author)
     21libfac_author="\"M. Messollen\""
     22
    1223AC_SUBST(libfac)
    1324libfac="libfac"
     
    6677LDFLAGS="-L. ${LDFLAGS}"
    6778
    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
     79if test "$with_debug" = yes; then
     80  CXXFLAGS="-g"
     81else
     82  CXXFLAGS="-O"
     83  AC_DEFINE(NDEBUG) 
    7684fi
    77 
    7885
    7986dnl
     
    9198
    9299dnl
     100dnl programs for installation
     101dnl
     102dnl ac_save_path=${PATH}
     103dnl PATH="$PATH:.." 
     104dnl AC_PROG_INSTALL
     105dnl AC_PATH_PROG(MKINSTALLDIRS, mkinstalldirs, -mkdir -p)
     106dnl PATH="$ac_save_path"
     107
     108dnl
    93109dnl Checks for header files.
    94110dnl
    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
     111AC_CHECK_HEADER(factory.h,,AC_MSG_WARN(factory.h not found! Install factory before building libfac!))
    104112
    105113dnl
     
    118126dnl
    119127if 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 "
    126132  fi
    127133  CXXTEMPLFLAGS="-fno-implicit-templates"
     
    132138 
    133139AC_OUTPUT(Makefile)
     140
     141dnl
     142dnl Plans:
     143dnl 1) look for libraries (warn if not found) for building testprog
     144dnl 1) search for perl
  • libfac/factor.h

    r6c02a5 r3e55bc  
    22// Created by -- makeheader --
    33///////////////////////////////////////
     4#ifndef FACTOR_H
     5#define FACTOR_H
     6
    47#include <factory.h>
     8
     9// Set this to a nonzero value to interrupt the computation
     10extern int libfac_interruptflag;
     11
     12// some values you can ask for:
     13extern char * libfac_name;
     14extern char * libfac_version;
     15extern char * libfac_date;
     16extern char * libfac_author;
    517
    618//// Note: second argument for Factorize is for internal use only.
     
    6880CFList reorder( const Varlist & betterorder, const CFList & PS);
    6981ListCFList reorder(const Varlist & betterorder, const ListCFList & Q);
     82
     83#endif /* FACTOR_H */
  • libfac/factor/Factor.cc

    r6c02a5 r3e55bc  
    11/* Copyright 1996 Michael Messollen. All rights reserved. */
    22///////////////////////////////////////////////////////////////////////////////
    3 static char * rcsid = "$Id: Factor.cc,v 1.1.1.1 1997-05-02 17:00:45 Singular Exp $ ";
     3static char * rcsid = "$Id: Factor.cc,v 1.2 1997-06-09 15:55:58 Singular Exp $ ";
    44static 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.";
    55///////////////////////////////////////////////////////////////////////////////
     
    1313#include "Truefactor.h"
    1414#include "homogfactor.h"
     15#include "interrupt.h"
    1516
    1617#ifdef FACTORDEBUG
     
    2829TIMING_DEFINE_PRINT(hensel_time);
    2930TIMING_DEFINE_PRINT(truefactor_time);
     31
     32extern int libfac_interruptflag;
     33#ifdef HAVE_SINGULAR
     34extern void WerrorS(char *);
     35#endif
    3036
    3137///////////////////////////////////////////////////////////////
     
    204210          else {
    205211#ifdef HAVE_SINGULAR
    206             extern void WerrorS(char *);
    207212            WerrorS("libfac: ERROR: not_monic1: case lt is a sum.");
    208213#else
     
    222227        else {
    223228#ifdef HAVE_SINGULAR
    224           extern void WerrorS(char *);
    225229          WerrorS("libfac: ERROR: not_monic2: case lt is a sum.");
    226230#else
     
    312316    else {
    313317#ifdef HAVE_SINGULAR
    314     extern void WerrorS(char *);
    315318    WerrorS("libfac: evaluate: Extension not inFF() or inGF() !");
    316319#else
     
    384387    else {
    385388#ifdef HAVE_SINGULAR
    386       extern void WerrorS(char *);
    387389      WerrorS("libfac: spezializePoly ERROR: Working over given extension-field not yet implemented!");
    388390#else
     
    419421  else {
    420422#ifdef HAVE_SINGULAR
    421     extern void WerrorS(char *);
    422423    WerrorS("libfac: evaluate: Extension not inFF() or inGF() !");
    423424#else
     
    504505  CFMap m;
    505506
     507  // INTERRUPTHANDLER
     508  if ( interrupt_handle() ) return CFFList() ;
     509  // INTERRUPTHANDLER
     510
    506511  if ( F.isUnivariate() ){ // could have lost one Variable elsewhere
    507512    if ( degree(Extension) == 0 ){
     
    528533  f=swapvar(F,mainvar,level(F));
    529534 
     535  // INTERRUPTHANDLER
     536  if ( interrupt_handle() ) return CFFList() ;
     537  // INTERRUPTHANDLER
     538
    530539  if ( oldmainvar != mainvar ){
    531540    DEBOUTSL(cout); DEBOUT(cout,"Swapped poly ", F);
     
    545554      CFFList Outputlist_a, Outputlist_b;
    546555      Outputlist_a = Factorized(ff,alpha);
     556      DEBOUTLN(cout, "Outputlist_a = ", Outputlist_a);
    547557      Outputlist_b = Factorized(ffuni,alpha);
     558      DEBOUTLN(cout, "Outputlist_b = ", Outputlist_b);
    548559      Outputlist = myUnion(Outputlist_a, Outputlist_b);
    549560      // have to back-swapvar the factors....
     
    552563        Outputlist2.append(CFFactor(swapvar(copy.factor(),oldmainvar,mainvar),copy.exp()));
    553564      }
     565      DEBOUTLN(cout, "Outputlist2 (a+b swapped) (to return) = ", Outputlist2);
    554566      return Outputlist2;
    555567    }
     
    587599    if (success == 0 ){ // No spezialisation could be found
    588600#ifdef HAVE_SINGULAR
    589       extern void WerrorS(char *);
    590601      WerrorS("libfac: Factorize: ERROR: Not able to find a valid specialization!");   
    591602#else
     
    596607      return Outputlist;
    597608    }
     609
     610    // INTERRUPTHANDLER
     611    if ( interrupt_handle() ) return CFFList() ;
     612    // INTERRUPTHANDLER
     613
    598614    ffuni = substitutePoly(ff,Substitutionlist);
    599615    // We now have an univariat poly; factorize that
     
    623639    DEBOUT(cout, " = ", UnivariateFactorlist); DEBOUTNL(cout);
    624640
     641    // INTERRUPTHANDLER
     642    if ( interrupt_handle() ) return CFFList() ;
     643    // INTERRUPTHANDLER
     644
    625645    TIMING_START(hensel_time);
    626646    Outputlist = MultiHensel(ff,UnivariateFactorlist,Substitutionlist);
     
    628648    TIMING_END(hensel_time);
    629649
     650    // INTERRUPTHANDLER
     651    if ( interrupt_handle() ) return CFFList() ;
     652    // INTERRUPTHANDLER
     653
    630654    TIMING_START(truefactor_time);
    631655    Outputlist = Truefactors(ff, level(ff), Substitutionlist, Outputlist);
    632656    DEBOUTLN(cout, "Outputlist after Truefactors: ", Outputlist);
    633657    TIMING_END(truefactor_time);
     658
     659    // INTERRUPTHANDLER
     660    if ( interrupt_handle() ) return CFFList() ;
     661    // INTERRUPTHANDLER
    634662
    635663    if ( lt != f.genOne() ){
     
    664692  CFMap m;
    665693
     694  // INTERRUPTHANDLER
     695  if ( interrupt_handle() ) return CFFList() ;
     696  // INTERRUPTHANDLER
     697
    666698  DEBINCLEVEL(cout, "Factorize");
    667699  DEBOUTMSG(cout, rcsid);
     
    669701    TIMING_START(factorize_time);
    670702    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;
    680712  }
    681713  TIMING_START(factorize_time);
     
    684716  // (If gcd is fast...)
    685717  ///////
    686 //  if ( ! SqrFreeTest(F) ){
     718  //  if ( ! SqrFreeTest(F) ){
    687719  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
    694731  }
    695732  else
    696       SqrFreeList.append(CFFactor(F,1));
     733    SqrFreeList.append(CFFactor(F,1));
    697734  DEBOUTLN(cout, "InternalSqrFreeList= ", SqrFreeList);
    698735  for ( i=SqrFreeList; i.hasItem(); i++ ){
     
    707744        Intermediatelist=factorize(g,1); // poly is sqr-free!
    708745        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()));
    710748      }
    711749      else{ // multivariate polynomial
     
    720758          Intermediatelist = Factorized(g, minpoly, 0);
    721759
     760        // INTERRUPTHANDLER
     761        if ( interrupt_handle() ) return CFFList() ;
     762        // INTERRUPTHANDLER
     763
    722764        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()));
    724767      }
    725768  }
     
    738781      }
    739782    }
    740 
     783 
    741784  r=F/g;
    742785  Outputlist2.insert(CFFactor(r,1));
    743 
     786 
    744787  DEBDECLEVEL(cout, "Factorize");
    745788  TIMING_END(factorize_time);
  • libfac/factor/Factor.h

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: Factor.h,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $
     4// $Id: Factor.h,v 1.2 1997-06-09 15:55:59 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef FACTOR_H
  • libfac/factor/MVMultiHensel.cc

    r6c02a5 r3e55bc  
    22///////////////////////////////////////////////////////////////////////////////
    33// 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:46 Singular Exp $";
     4// static char * rcsid = "$Id: MVMultiHensel.cc,v 1.2 1997-06-09 15:56:00 Singular Exp $";
    55///////////////////////////////////////////////////////////////////////////////
    66// FACTORY - Includes
  • libfac/factor/MVMultiHensel.h

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: MVMultiHensel.h,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $
     4// $Id: MVMultiHensel.h,v 1.2 1997-06-09 15:56:00 Singular Exp $
    55/////////////////////////////////////////////////////////////
    66#ifndef MULTIHENSEL_H
  • libfac/factor/Makefile

    r6c02a5 r3e55bc  
    1 # static char rcsid[] = "@(#) $Id: Makefile,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $";
     1# static char rcsid[] = "@(#) $Id: Makefile,v 1.2 1997-06-09 15:56:01 Singular Exp $";
    22#############################################################################
    33# testcs:   CharSet(F)
  • libfac/factor/SqrFree.cc

    r6c02a5 r3e55bc  
    22///////////////////////////////////////////////////////////////////////////////
    33// 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:46 Singular Exp $";
     4static char * rcsid = "$Id: SqrFree.cc,v 1.2 1997-06-09 15:56:02 Singular Exp $";
    55static 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.";
    66///////////////////////////////////////////////////////////////////////////////
     
    2121TIMING_DEFINE_PRINT(squarefree_time);
    2222TIMING_DEFINE_PRINT(gcd_time);
     23
     24#ifdef HAVE_SINGULAR
     25extern void WerrorS(char *);
     26#endif 
    2327
    2428// forward declaration:
     
    122126  }
    123127#ifdef HAVE_SINGULAR
    124   extern void WerrorS(char *);
    125128  WerrorS("libfac: ERROR: SqrFreeTest: we should never fall trough here!");
    126129#else
     
    189192// is it Pth root?
    190193  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
    192196    for (int k=1; k<=n; k++) {
    193197      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      }
    195205      else
    196206        if ( k==n ) { // really is Pth power
     
    242252  }
    243253#ifdef HAVE_SINGULAR
    244   extern void WerrorS(char *);
    245254  WerrorS("libfac: ERROR: SqrFreed: we should never fall trough here!");
    246255#else
  • libfac/factor/SqrFree.h

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: SqrFree.h,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $
     4// $Id: SqrFree.h,v 1.2 1997-06-09 15:56:03 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef SQRFREE_H
  • libfac/factor/Truefactor.cc

    r6c02a5 r3e55bc  
    22///////////////////////////////////////////////////////////////////////////////
    33// 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:46 Singular Exp $";
     4//static char * rcsid = "@(#) $Id: Truefactor.cc,v 1.2 1997-06-09 15:56:04 Singular Exp $";
    55///////////////////////////////////////////////////////////////////////////////
    66// Factory - Includes
     
    1919#include "timing.h"
    2020
     21#ifdef HAVE_SINGULAR
     22extern void WerrorS(char *);
     23#endif
    2124///////////////////////////////////////////////////////////////
    2225// generate all different k-subsets of the set with n        //
     
    8689  CFFList Returnlist;
    8790
     91  DEBOUTLN(cout, "Remove_from_List called with L= ",L);
     92  DEBOUTLN(cout, "                     and  elem= ",elem);
    8893  for ( ListIterator<CFFactor> i = L ; i.hasItem(); i++)
    8994    if ( i.getItem().factor() != elem )
     
    158163
    159164// 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) );
    162171      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 
    176181// Now do the real work!
    177182// Test all the combinations of possible factors.
    178183
    179     onemore=1;
     184  onemore=1;
    180185// steps 3 to 6
    181186  while (1){
     
    212217        degU = degree(U, levelU)/2; // new degU
    213218        // L = L \ {factor}
     219        // Hier ist noch etwas faul; wir muessen (f=prod(f_i)) die f_i
     220        // entfernen und nicht f!
    214221        L = Remove_from_List( L, factor.factor() );
    215222        r -= 1;
     
    271278    if ( PossibleFactors.length() < n ) { // a little check
    272279#ifdef HAVE_SINGULAR
    273       extern void WerrorS(char *);
    274280      WerrorS("libfac: ERROR: TakeNorms less then two items remaining!");
    275281#else
     
    314320      else{
    315321#ifdef HAVE_SINGULAR
    316         extern void WerrorS(char *);
    317322        WerrorS("libfac: TakeNorms: somethings wrong with remaining factors!");
    318323#else
  • libfac/factor/Truefactor.h

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: Truefactor.h,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $
     4// $Id: Truefactor.h,v 1.2 1997-06-09 15:56:05 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef TRUEFACTOR_H
  • libfac/factor/class.cc

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// 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:46 Singular Exp $";
     4// static char * rcsid = "@(#) $Id: class.cc,v 1.2 1997-06-09 15:56:05 Singular Exp $";
    55////////////////////////////////////////////////////////////
    66
     
    3636void Substitution<T>::print ( ostream& s ) const
    3737{
    38 #ifndef NOSTREAMIO
    3938        s << "(" << factor() << ")^" << exp();
    40 #endif 
    4139}
    4240
  • libfac/factor/class.h

    r6c02a5 r3e55bc  
    22///////////////////////////////////////////////////////////////////////////////
    33// 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 $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef INCL_CLASS_H
     
    3333    friend int operator== ( const Substitution<T>&, const Substitution<T>& );
    3434    void print ( ostream& ) const;
    35 #ifndef NOSTREAMIO   
    3635    friend ostream& operator<< ( ostream & os, const Substitution<T> & f )
    3736    {
     
    3938        return os;
    4039    }
    41 #endif   
    4240};
    4341
  • libfac/factor/debug.cc

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// 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:46 Singular Exp $ ";
     4// static char * rcsid = "$Id: debug.cc,v 1.2 1997-06-09 15:56:07 Singular Exp $ ";
    55////////////////////////////////////////////////////////////
    66static int deb_level;
  • libfac/factor/debug.h

    r6c02a5 r3e55bc  
    11/* Copyright 1996 Michael Messollen. All rights reserved. */
    22////////////////////////////////////////////////////////////
    3 // static char * rcsid = "$Id: debug.h,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $" ;
     3// static char * rcsid = "$Id: debug.h,v 1.2 1997-06-09 15:56:08 Singular Exp $" ;
    44////////////////////////////////////////////////////////////
    55// It is possible to include this file multiple times for different
  • libfac/factor/helpstuff.cc

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// 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:46 Singular Exp $";
     4// static char * rcsid = "$Id: helpstuff.cc,v 1.2 1997-06-09 15:56:08 Singular Exp $";
    55////////////////////////////////////////////////////////////
    66// FACTORY - Includes
     
    3838    copy = i.getItem();
    3939    if ( copy.factor() == TheFactor.factor() )
    40       exp = copy.exp();
     40      exp += copy.exp();
    4141    else
    4242      Outputlist.append(copy);
  • libfac/factor/helpstuff.h

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: helpstuff.h,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $
     4// $Id: helpstuff.h,v 1.2 1997-06-09 15:56:09 Singular Exp $
    55////////////////////////////////////////////////////////////
    66#ifndef HELPSTUFF_H
  • libfac/factor/homogfactor.cc

    r6c02a5 r3e55bc  
    11/* Copyright 1997 Michael Messollen. All rights reserved. */
    22////////////////////////////////////////////////////////////
    3 // static char * rcsid = "$Id: homogfactor.cc,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $ ";
     3// static char * rcsid = "$Id: homogfactor.cc,v 1.2 1997-06-09 15:56:10 Singular Exp $ ";
    44////////////////////////////////////////////////////////////
    55// FACTORY - Includes
  • libfac/factor/homogfactor.h

    r6c02a5 r3e55bc  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: homogfactor.h,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $
     4// $Id: homogfactor.h,v 1.2 1997-06-09 15:56:10 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#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:46 Singular Exp $";
     1//static char rcsid[] = "@(#) $Id: test.cc,v 1.2 1997-06-09 15:56:11 Singular Exp $";
    22///////////////////////////////////////////////////////////////////////////////
    33// CLAP - Includes
  • libfac/factor/timing.h

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// 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:46 Singular Exp $";
     4// static char * rcsid = "$Id: timing.h,v 1.2 1997-06-09 15:56:12 Singular Exp $";
    55////////////////////////////////////////////////////////////
    66// It is possible to include this file multiple times for different
  • libfac/factor/tmpl_inst.cc

    r6c02a5 r3e55bc  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: tmpl_inst.cc,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $
     4// $Id: tmpl_inst.cc,v 1.2 1997-06-09 15:56:12 Singular Exp $
    55////////////////////////////////////////////////////////////
    66
  • libfac/factor/tmpl_inst.cc.factory1.1

    r6c02a5 r3e55bc  
    11// 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:46 Singular Exp $
     2// $Id: tmpl_inst.cc.factory1.1,v 1.2 1997-06-09 15:56:13 Singular Exp $
    33
    44#include <templates/array.cc>
  • libfac/factor/tmpl_inst.h

    r6c02a5 r3e55bc  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: tmpl_inst.h,v 1.1.1.1 1997-05-02 17:00:46 Singular Exp $
     4// $Id: tmpl_inst.h,v 1.2 1997-06-09 15:56:14 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef TMPL_INST_H
  • libfac/factor/version.cc

    r6c02a5 r3e55bc  
    22///////////////////////////////////////////////////////////////////////////////
    33// 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 $
     5static char * rcsid = "@(#) libfac version 0.2.4 [May 29 1997] (C) 1996-97 M. Messollen";
    56///////////////////////////////////////////////////////////////////////////////
    67
    78char * libfac_name = "Factorization and characteristic sets library";
    8 char * libfac_version = "0.2.1";
    9 char * libfac_date = "Apr 26 1997";
     9char * libfac_version = "0.2.4";
     10char * libfac_date = "May 30 1997";
    1011char * libfac_author = "M. Messollen";
    1112
     13int    libfac_interruptflag=0;
  • libfac/header.tpl

    r6c02a5 r3e55bc  
    22// Created by -- makeheader --
    33///////////////////////////////////////
     4#ifndef FACTOR_H
     5#define FACTOR_H
     6
    47#include <factory.h>
     8
     9.INCLUDE factor/interrupt.h
     10
     11// some values you can ask for:
     12extern char * libfac_name;
     13extern char * libfac_version;
     14extern char * libfac_date;
     15extern char * libfac_author;
    516
    617//// Note: second argument for Factorize is for internal use only.
     
    2233
    2334.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:43 Singular Exp $";
     1//static char rcsid[] = "$Id: test.cc,v 1.2 1997-06-09 15:55:50 Singular Exp $";
    22///////////////////////////////////////////////////////////////////////////////
    3 // FACTORY - Includes
    4 //       (x+y+z)*(x+y-z)*(x-y+z)*(x-y-z)*x*y;
    5 #include <factory.h>
    63// Factor - Includes
    74#include "factor.h"
    8 #include "tmpl_inst.h"
    9 #include "helpstuff.h"
    105
    11 extern char * libfac_name;
    12 extern char * libfac_version;
    13 extern char * libfac_date;
    14 extern char * libfac_author;
    156
    167void
Note: See TracChangeset for help on using the changeset viewer.