Changeset 4a81ec in git for libfac/factor


Ignore:
Timestamp:
Sep 12, 1997, 9:20:02 AM (27 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
0fbdd16f374f7f4570da62a453e2328e4d8a4b4c
Parents:
0479e09dbc0fb17be7ebce384df4ba0318ba20eb
Message:
* hannes/michael: libfac-0.3.0


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

Legend:

Unmodified
Added
Removed
  • libfac/factor/Factor.cc

    r0479e09 r4a81ec  
    11/* Copyright 1996 Michael Messollen. All rights reserved. */
    22///////////////////////////////////////////////////////////////////////////////
    3 static char * rcsid = "$Id: Factor.cc,v 1.2 1997-06-09 15:55:58 Singular Exp $ ";
     3static char * rcsid = "$Id: Factor.cc,v 1.3 1997-09-12 07:19:46 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///////////////////////////////////////////////////////////////////////////////
     
    1414#include "homogfactor.h"
    1515#include "interrupt.h"
     16// some CC's need this:
     17#include "Factor.h"
     18
     19#ifdef SINGULAR
     20#  define HAVE_SINGULAR
     21#endif
    1622
    1723#ifdef FACTORDEBUG
     
    3036TIMING_DEFINE_PRINT(truefactor_time);
    3137
    32 extern int libfac_interruptflag;
    33 #ifdef HAVE_SINGULAR
    34 extern void WerrorS(char *);
    35 #endif
    3638
    3739///////////////////////////////////////////////////////////////
     
    139141// Return the list of factors.                               //
    140142///////////////////////////////////////////////////////////////
    141 CFFList
     143static CFFList
    142144not_monic( const CFFList & TheList, const CanonicalForm & ltt, const CanonicalForm & F, int levelF){
    143145  CFFList Returnlist,IntermediateList;
     
    210212          else {
    211213#ifdef HAVE_SINGULAR
     214            extern void WerrorS(char *);
    212215            WerrorS("libfac: ERROR: not_monic1: case lt is a sum.");
    213216#else
     
    227230        else {
    228231#ifdef HAVE_SINGULAR
     232          extern void WerrorS(char *);
    229233          WerrorS("libfac: ERROR: not_monic2: case lt is a sum.");
    230234#else
     
    308312// field getCharacteristik()^Extension.                      //
    309313///////////////////////////////////////////////////////////////
    310 static CanonicalForm
     314CanonicalForm
    311315generate_mipo( int degree_of_Extension , const Variable & Extension ){
    312316  FFRandom gen;
     
    316320    else {
    317321#ifdef HAVE_SINGULAR
     322    extern void WerrorS(char *);
    318323    WerrorS("libfac: evaluate: Extension not inFF() or inGF() !");
    319324#else
     
    387392    else {
    388393#ifdef HAVE_SINGULAR
     394      extern void WerrorS(char *);
    389395      WerrorS("libfac: spezializePoly ERROR: Working over given extension-field not yet implemented!");
    390396#else
     
    421427  else {
    422428#ifdef HAVE_SINGULAR
     429    extern void WerrorS(char *);
    423430    WerrorS("libfac: evaluate: Extension not inFF() or inGF() !");
    424431#else
     
    428435    FFRandom gen; }}
    429436  REvaluation k(1,n,gen);
     437  k.nextpoint();
    430438  for ( int i=1; i<=maxtries ; i++){
    431     //    k.nextpoint();
     439    // k.nextpoint();
    432440    SFormList Substitutionlist;
    433441    for ( int j=1; j<=n; j++ )
     
    496504///////////////////////////////////////////////////////////////
    497505CFFList
    498 Factorized( const CanonicalForm & F, const Variable & alpha, int Mainvar=0){
     506Factorized( const CanonicalForm & F, const Variable & alpha, int Mainvar){
    499507  CanonicalForm f,lt,ff,ffuni;
    500508  Variable Extension=alpha;
     
    599607    if (success == 0 ){ // No spezialisation could be found
    600608#ifdef HAVE_SINGULAR
     609      extern void WerrorS(char *);
    601610      WerrorS("libfac: Factorize: ERROR: Not able to find a valid specialization!");   
    602611#else
     
    684693///////////////////////////////////////////////////////////////
    685694CFFList
    686 Factorize( const CanonicalForm & F, int is_SqrFree=0 ){
     695Factorize( const CanonicalForm & F, int is_SqrFree ){
    687696  CFFList Outputlist,SqrFreeList,Intermediatelist,Outputlist2;
    688697  ListIterator<CFFactor> i,j;
     
    700709  if ( getCharacteristic() == 0 ) { // char == 0
    701710    TIMING_START(factorize_time);
     711    //cout << "Factoring in char=0 of " << F << " = " << Outputlist << endl;
    702712    Outputlist= factorize(F);
    703     //  cout << "Factoring in char=0 of " << F << " = " << Outputlist << endl;
    704713    // Factorization in char=0 doesn't sometimes return at least two elements!!!
    705714    if ( getNumVars(Outputlist.getFirst().factor()) != 0 )
  • libfac/factor/Factor.h

    r0479e09 r4a81ec  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: Factor.h,v 1.2 1997-06-09 15:55:59 Singular Exp $
     4// $Id: Factor.h,v 1.3 1997-09-12 07:19:47 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef FACTOR_H
    77#define FACTOR_H
     8CanonicalForm generate_mipo( int degree_of_Extension , const Variable & Extension );
    89CFFList Factorized( const CanonicalForm & F, const Variable & alpha, int Mainvar=0);
    910/*BEGINPUBLIC*/
  • libfac/factor/MVMultiHensel.cc

    r0479e09 r4a81ec  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // static char * rcsid = "$Id: MVMultiHensel.cc,v 1.2 1997-06-09 15:56:00 Singular Exp $";
     4// static char * rcsid = "$Id: MVMultiHensel.cc,v 1.3 1997-09-12 07:19:48 Singular Exp $";
    55///////////////////////////////////////////////////////////////////////////////
    66// FACTORY - Includes
     
    99#include "tmpl_inst.h"
    1010#include "helpstuff.h"
     11// some CC's need this:
     12#include "MVMultiHensel.h"
     13
     14#ifdef SINGULAR
     15#  define HAVE_SINGULAR
     16#endif
    1117
    1218#ifdef HENSELDEBUG
  • libfac/factor/MVMultiHensel.h

    r0479e09 r4a81ec  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: MVMultiHensel.h,v 1.2 1997-06-09 15:56:00 Singular Exp $
     4// $Id: MVMultiHensel.h,v 1.3 1997-09-12 07:19:48 Singular Exp $
    55/////////////////////////////////////////////////////////////
    66#ifndef MULTIHENSEL_H
  • libfac/factor/SqrFree.cc

    r0479e09 r4a81ec  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 static char * rcsid = "$Id: SqrFree.cc,v 1.2 1997-06-09 15:56:02 Singular Exp $";
    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.";
     4static char * rcsid = "$Id: SqrFree.cc,v 1.3 1997-09-12 07:19:50 Singular Exp $";
     5static 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///////////////////////////////////////////////////////////////////////////////
    77// FACTORY - Includes
     
    1010#include "tmpl_inst.h"
    1111#include "helpstuff.h"
     12// some CC's need this:
     13#include "SqrFree.h"
     14
     15#ifdef SINGULAR
     16#  define HAVE_SINGULAR
     17#endif
    1218
    1319#ifdef SQRFREEDEBUG
     
    2228TIMING_DEFINE_PRINT(gcd_time);
    2329
    24 #ifdef HAVE_SINGULAR
    25 extern void WerrorS(char *);
    26 #endif 
    27 
    28 // forward declaration:
    29 CFFList SqrFree( const CanonicalForm & r );
    30 CFFList InternalSqrFree( const CanonicalForm & r );
    3130
    3231static inline CFFactor
     
    5251PthRoot( const CanonicalForm & f ){
    5352  CanonicalForm RES, R = f;
    54   int n= getNumVars(R), p= getCharacteristic();
     53  int n= max(level(R),getNumVars(R)), p= getCharacteristic();
    5554 
    5655  if (n==0){ // constant
     
    7877///////////////////////////////////////////////////////////////
    7978int
    80 SqrFreeTest( const CanonicalForm & r, int opt=1){
     79SqrFreeTest( const CanonicalForm & r, int opt){
    8180  CanonicalForm f=r, g;
    8281  int n=level(f);
     
    126125  }
    127126#ifdef HAVE_SINGULAR
     127  extern void WerrorS(char *);
    128128  WerrorS("libfac: ERROR: SqrFreeTest: we should never fall trough here!");
    129129#else
     
    197197      g=swapvar(f,k,n) ; g = g.deriv();
    198198      if ( ! g.isZero() ){ // can`t be Pth root
    199         CFFList Outputlist2= SqrFreed(swapvar(f,k,n));
     199        CFFList Outputlist2= SqrFreed(swapvar(f,k,n)); 
    200200        for (CFFListIterator inter=Outputlist2; inter.hasItem(); inter++){
    201201          Outputlist= myappend(Outputlist, CFFactor(swapvar(inter.getItem().factor(),k,n), inter.getItem().exp()));
     
    252252  }
    253253#ifdef HAVE_SINGULAR
     254  extern void WerrorS(char *);
    254255  WerrorS("libfac: ERROR: SqrFreed: we should never fall trough here!");
    255256#else
  • libfac/factor/SqrFree.h

    r0479e09 r4a81ec  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: SqrFree.h,v 1.2 1997-06-09 15:56:03 Singular Exp $
     4// $Id: SqrFree.h,v 1.3 1997-09-12 07:19:51 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef SQRFREE_H
     
    88
    99/*BEGINPUBLIC*/
    10 // int SqrFreeTest( const CanonicalForm & r, int opt=1) ;
    1110// CFFList SqrFree( const CanonicalForm & f ) ;
     11/*ENDPUBLIC*/
    1212CFFList InternalSqrFree( const CanonicalForm & f ) ;
    13 /*ENDPUBLIC*/
    14 int SqrFreeTest( const CanonicalForm & r, int opt=1) ;
     13int     SqrFreeTest( const CanonicalForm & r, int opt=1) ;
    1514CFFList SqrFree( const CanonicalForm & f ) ;
    1615#endif /* SQRFREE_H */
  • libfac/factor/Truefactor.cc

    r0479e09 r4a81ec  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 //static char * rcsid = "@(#) $Id: Truefactor.cc,v 1.2 1997-06-09 15:56:04 Singular Exp $";
     4//static char * rcsid = "@(#) $Id: Truefactor.cc,v 1.3 1997-09-12 07:19:52 Singular Exp $";
    55///////////////////////////////////////////////////////////////////////////////
    66// Factory - Includes
     
    99#include "tmpl_inst.h"
    1010#include "helpstuff.h"
     11// some CC's need this:
     12#include "Truefactor.h"
     13
     14#ifdef SINGULAR
     15#  define HAVE_SINGULAR
     16#endif
    1117
    1218#ifdef TRUEFACTORDEBUG
     
    1925#include "timing.h"
    2026
    21 #ifdef HAVE_SINGULAR
    22 extern void WerrorS(char *);
    23 #endif
    2427///////////////////////////////////////////////////////////////
    2528// generate all different k-subsets of the set with n        //
     
    233236// Check if poly f is in Fp (returns true) or in Fp(a)       //
    234237///////////////////////////////////////////////////////////////
    235 bool
     238static bool
    236239is_in_Fp( const CanonicalForm & f ){
    237240  if ( f.inCoeffDomain() )
     
    278281    if ( PossibleFactors.length() < n ) { // a little check
    279282#ifdef HAVE_SINGULAR
     283      extern void WerrorS(char *);
    280284      WerrorS("libfac: ERROR: TakeNorms less then two items remaining!");
    281285#else
     
    320324      else{
    321325#ifdef HAVE_SINGULAR
     326        extern void WerrorS(char *);
    322327        WerrorS("libfac: TakeNorms: somethings wrong with remaining factors!");
    323328#else
  • libfac/factor/Truefactor.h

    r0479e09 r4a81ec  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: Truefactor.h,v 1.2 1997-06-09 15:56:05 Singular Exp $
     4// $Id: Truefactor.h,v 1.3 1997-09-12 07:19:53 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef TRUEFACTOR_H
  • libfac/factor/class.cc

    r0479e09 r4a81ec  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // static char * rcsid = "@(#) $Id: class.cc,v 1.2 1997-06-09 15:56:05 Singular Exp $";
     4// static char * rcsid = "@(#) $Id: class.cc,v 1.3 1997-09-12 07:19:53 Singular Exp $";
    55////////////////////////////////////////////////////////////
    66
     
    3333}
    3434
     35#ifndef NOSTREAMIO
    3536template <class T>
    3637void Substitution<T>::print ( ostream& s ) const
     
    3839        s << "(" << factor() << ")^" << exp();
    3940}
     41#endif
    4042
    4143////////////////////////////////////////////////////////////
  • libfac/factor/class.h

    r0479e09 r4a81ec  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: class.h,v 1.3 1997-08-01 10:51:28 Singular Exp $
     4// $Id: class.h,v 1.4 1997-09-12 07:19:54 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef INCL_CLASS_H
     
    1212#include <iostream.h>
    1313#endif
    14 
    1514
    1615template <class T>
     
    4140        return os;
    4241    }
    43 #endif   
     42#endif
    4443};
    4544
     
    5352/*
    5453$Log: not supported by cvs2svn $
    55 Revision 1.2  1997/06/09 15:56:06  Singular
    56 * hannes/michael: libfac 0.2.4
    57 
    5854Revision 1.2  1997/04/25 22:21:26  michael
    5955Version for libfac-0.2.1
  • libfac/factor/debug.cc

    r0479e09 r4a81ec  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // static char * rcsid = "$Id: debug.cc,v 1.2 1997-06-09 15:56:07 Singular Exp $ ";
     4// static char * rcsid = "$Id: debug.cc,v 1.3 1997-09-12 07:19:55 Singular Exp $ ";
    55////////////////////////////////////////////////////////////
    66static int deb_level;
  • libfac/factor/debug.h

    r0479e09 r4a81ec  
    11/* Copyright 1996 Michael Messollen. All rights reserved. */
    22////////////////////////////////////////////////////////////
    3 // static char * rcsid = "$Id: debug.h,v 1.2 1997-06-09 15:56:08 Singular Exp $" ;
     3// static char * rcsid = "$Id: debug.h,v 1.3 1997-09-12 07:19:55 Singular Exp $" ;
    44////////////////////////////////////////////////////////////
    55// It is possible to include this file multiple times for different
     
    4545(stream << deb_level_msg, stream.flush())
    4646#define DEBOUT(stream,msg,object) \
    47 (stream << msg << object, stream.flush())
     47(stream << deb_level_msg << msg << object, stream.flush())
    4848#define DEBOUTLN(stream,msg,object) \
    4949(stream << deb_level_msg << msg << object << endl)
  • libfac/factor/helpstuff.cc

    r0479e09 r4a81ec  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // static char * rcsid = "$Id: helpstuff.cc,v 1.2 1997-06-09 15:56:08 Singular Exp $";
     4// static char * rcsid = "$Id: helpstuff.cc,v 1.3 1997-09-12 07:19:56 Singular Exp $";
    55////////////////////////////////////////////////////////////
    66// FACTORY - Includes
     
    88// Factor - Includes
    99#include "tmpl_inst.h"
     10// some CC's need this:
     11#include "helpstuff.h"
    1012
    1113bool
     
    1820  else { b=aa; }
    1921  return retvalue;
     22}
     23
     24void
     25mydivrem( const CanonicalForm& f, const CanonicalForm& g, CanonicalForm& a, CanonicalForm& b ){
     26  bool retvalue;
     27  CanonicalForm aa,bb;
     28  retvalue = divremt(f,g,a,bb);
     29  aa= f-g*a;
     30  if ( aa==bb ) { b=bb; }
     31  else { b=aa; }
    2032}
    2133
     
    6072
    6173int
    62 Powerup( const int base , const int exp=1){
     74Powerup( const int base , const int exp){
    6375  int retvalue=1;
    6476  if ( exp == 0 )  return retvalue ;
  • libfac/factor/helpstuff.h

    r0479e09 r4a81ec  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: helpstuff.h,v 1.2 1997-06-09 15:56:09 Singular Exp $
     4// $Id: helpstuff.h,v 1.3 1997-09-12 07:19:57 Singular Exp $
    55////////////////////////////////////////////////////////////
    66#ifndef HELPSTUFF_H
    77#define HELPSTUFF_H
    88bool mydivremt ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& );
     9void mydivrem( const CanonicalForm& f, const CanonicalForm& g, CanonicalForm& a, CanonicalForm& b );
    910///////////////////////////////////////////////////////////////
    1011// Now some procedures used in MVMultiHensel and in Truefactors
  • libfac/factor/homogfactor.cc

    r0479e09 r4a81ec  
    11/* Copyright 1997 Michael Messollen. All rights reserved. */
    22////////////////////////////////////////////////////////////
    3 // static char * rcsid = "$Id: homogfactor.cc,v 1.2 1997-06-09 15:56:10 Singular Exp $ ";
     3// static char * rcsid = "$Id: homogfactor.cc,v 1.3 1997-09-12 07:19:57 Singular Exp $ ";
    44////////////////////////////////////////////////////////////
    55// FACTORY - Includes
     
    88#include "tmpl_inst.h"
    99#include "Factor.h"
     10// some CC's need it:
     11#include "homogfactor.h"
    1012
    1113#ifdef HFACTORDEBUG
  • libfac/factor/homogfactor.h

    r0479e09 r4a81ec  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: homogfactor.h,v 1.2 1997-06-09 15:56:10 Singular Exp $
     4// $Id: homogfactor.h,v 1.3 1997-09-12 07:19:58 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef HFACTOR_H
    77#define HFACTOR_H
    8 CFList get_Terms( const CanonicalForm & f );
    9 bool is_homogeneous( const CanonicalForm & f);
    10 CFFList  HomogFactor( const CanonicalForm & g, const Variable  & minpoly, const int Mainvar );
     8CFList  get_Terms( const CanonicalForm & f );
     9bool    is_homogeneous( const CanonicalForm & f);
     10CFFList HomogFactor( const CanonicalForm & g, const Variable  & minpoly, const int Mainvar );
    1111#endif /* HFACTOR_H */
    1212
  • libfac/factor/timing.h

    r0479e09 r4a81ec  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // static char * rcsid = "$Id: timing.h,v 1.2 1997-06-09 15:56:12 Singular Exp $";
     4// static char * rcsid = "$Id: timing.h,v 1.3 1997-09-12 07:19:59 Singular Exp $";
    55////////////////////////////////////////////////////////////
    66// It is possible to include this file multiple times for different
  • libfac/factor/tmpl_inst.cc

    r0479e09 r4a81ec  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: tmpl_inst.cc,v 1.2 1997-06-09 15:56:12 Singular Exp $
     4// $Id: tmpl_inst.cc,v 1.3 1997-09-12 07:20:00 Singular Exp $
    55////////////////////////////////////////////////////////////
    66
     
    8282template class Array<Variable>;
    8383
     84// for database
     85#ifdef HAVE_DATABASE
     86template class List<CFFList>;
     87template class ListIterator<CFFList>;
     88#endif /* HAVE_DATABASE */
    8489////////////////////////////////////////////////////////////
    8590/*
  • libfac/factor/tmpl_inst.h

    r0479e09 r4a81ec  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: tmpl_inst.h,v 1.2 1997-06-09 15:56:14 Singular Exp $
     4// $Id: tmpl_inst.h,v 1.3 1997-09-12 07:20:01 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef TMPL_INST_H
     
    3737typedef Array<int> Intarray;
    3838
    39 typedef Array<CFArray> CCFArray ;
    40 typedef Array<CCFArray> CCCFArray ;
     39#ifdef HAVE_DATABASE
     40typedef List<CFFList> ListCFFList;
     41typedef ListIterator<CFFList> ListCFFListIterator;
     42#endif
     43
     44//typedef Array<CFArray> CCFArray ;
     45//typedef Array<CCFArray> CCCFArray ;
    4146
    4247#endif /* TMPL_INST_H */
  • libfac/factor/version.cc

    r0479e09 r4a81ec  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: version.cc,v 1.2 1997-06-09 15:56:14 Singular Exp $
     4// $Id: version.cc,v 1.3 1997-09-12 07:20:02 Singular Exp $
    55static char * rcsid = "@(#) libfac version 0.2.4 [May 29 1997] (C) 1996-97 M. Messollen";
    66///////////////////////////////////////////////////////////////////////////////
    77
    88char * libfac_name = "Factorization and characteristic sets library";
    9 char * libfac_version = "0.2.4";
    10 char * libfac_date = "May 30 1997";
     9char * libfac_version = "0.3.0";
     10char * libfac_date = "Sep 11 1997";
    1111char * libfac_author = "M. Messollen";
    1212
Note: See TracChangeset for help on using the changeset viewer.