Changeset 4a81ec in git for libfac/factor
- Timestamp:
- Sep 12, 1997, 9:20:02 AM (27 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 0fbdd16f374f7f4570da62a453e2328e4d8a4b4c
- Parents:
- 0479e09dbc0fb17be7ebce384df4ba0318ba20eb
- Location:
- libfac/factor
- Files:
-
- 2 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
libfac/factor/Factor.cc
r0479e09 r4a81ec 1 1 /* Copyright 1996 Michael Messollen. All rights reserved. */ 2 2 /////////////////////////////////////////////////////////////////////////////// 3 static char * rcsid = "$Id: Factor.cc,v 1. 2 1997-06-09 15:55:58Singular Exp $ ";3 static char * rcsid = "$Id: Factor.cc,v 1.3 1997-09-12 07:19:46 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 /////////////////////////////////////////////////////////////////////////////// … … 14 14 #include "homogfactor.h" 15 15 #include "interrupt.h" 16 // some CC's need this: 17 #include "Factor.h" 18 19 #ifdef SINGULAR 20 # define HAVE_SINGULAR 21 #endif 16 22 17 23 #ifdef FACTORDEBUG … … 30 36 TIMING_DEFINE_PRINT(truefactor_time); 31 37 32 extern int libfac_interruptflag;33 #ifdef HAVE_SINGULAR34 extern void WerrorS(char *);35 #endif36 38 37 39 /////////////////////////////////////////////////////////////// … … 139 141 // Return the list of factors. // 140 142 /////////////////////////////////////////////////////////////// 141 CFFList143 static CFFList 142 144 not_monic( const CFFList & TheList, const CanonicalForm & ltt, const CanonicalForm & F, int levelF){ 143 145 CFFList Returnlist,IntermediateList; … … 210 212 else { 211 213 #ifdef HAVE_SINGULAR 214 extern void WerrorS(char *); 212 215 WerrorS("libfac: ERROR: not_monic1: case lt is a sum."); 213 216 #else … … 227 230 else { 228 231 #ifdef HAVE_SINGULAR 232 extern void WerrorS(char *); 229 233 WerrorS("libfac: ERROR: not_monic2: case lt is a sum."); 230 234 #else … … 308 312 // field getCharacteristik()^Extension. // 309 313 /////////////////////////////////////////////////////////////// 310 staticCanonicalForm314 CanonicalForm 311 315 generate_mipo( int degree_of_Extension , const Variable & Extension ){ 312 316 FFRandom gen; … … 316 320 else { 317 321 #ifdef HAVE_SINGULAR 322 extern void WerrorS(char *); 318 323 WerrorS("libfac: evaluate: Extension not inFF() or inGF() !"); 319 324 #else … … 387 392 else { 388 393 #ifdef HAVE_SINGULAR 394 extern void WerrorS(char *); 389 395 WerrorS("libfac: spezializePoly ERROR: Working over given extension-field not yet implemented!"); 390 396 #else … … 421 427 else { 422 428 #ifdef HAVE_SINGULAR 429 extern void WerrorS(char *); 423 430 WerrorS("libfac: evaluate: Extension not inFF() or inGF() !"); 424 431 #else … … 428 435 FFRandom gen; }} 429 436 REvaluation k(1,n,gen); 437 k.nextpoint(); 430 438 for ( int i=1; i<=maxtries ; i++){ 431 // 439 // k.nextpoint(); 432 440 SFormList Substitutionlist; 433 441 for ( int j=1; j<=n; j++ ) … … 496 504 /////////////////////////////////////////////////////////////// 497 505 CFFList 498 Factorized( const CanonicalForm & F, const Variable & alpha, int Mainvar =0){506 Factorized( const CanonicalForm & F, const Variable & alpha, int Mainvar){ 499 507 CanonicalForm f,lt,ff,ffuni; 500 508 Variable Extension=alpha; … … 599 607 if (success == 0 ){ // No spezialisation could be found 600 608 #ifdef HAVE_SINGULAR 609 extern void WerrorS(char *); 601 610 WerrorS("libfac: Factorize: ERROR: Not able to find a valid specialization!"); 602 611 #else … … 684 693 /////////////////////////////////////////////////////////////// 685 694 CFFList 686 Factorize( const CanonicalForm & F, int is_SqrFree =0){695 Factorize( const CanonicalForm & F, int is_SqrFree ){ 687 696 CFFList Outputlist,SqrFreeList,Intermediatelist,Outputlist2; 688 697 ListIterator<CFFactor> i,j; … … 700 709 if ( getCharacteristic() == 0 ) { // char == 0 701 710 TIMING_START(factorize_time); 711 //cout << "Factoring in char=0 of " << F << " = " << Outputlist << endl; 702 712 Outputlist= factorize(F); 703 // cout << "Factoring in char=0 of " << F << " = " << Outputlist << endl;704 713 // Factorization in char=0 doesn't sometimes return at least two elements!!! 705 714 if ( getNumVars(Outputlist.getFirst().factor()) != 0 ) -
libfac/factor/Factor.h
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: Factor.h,v 1. 2 1997-06-09 15:55:59Singular Exp $4 // $Id: Factor.h,v 1.3 1997-09-12 07:19:47 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef FACTOR_H 7 7 #define FACTOR_H 8 CanonicalForm generate_mipo( int degree_of_Extension , const Variable & Extension ); 8 9 CFFList Factorized( const CanonicalForm & F, const Variable & alpha, int Mainvar=0); 9 10 /*BEGINPUBLIC*/ -
libfac/factor/MVMultiHensel.cc
r0479e09 r4a81ec 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // static char * rcsid = "$Id: MVMultiHensel.cc,v 1. 2 1997-06-09 15:56:00Singular Exp $";4 // static char * rcsid = "$Id: MVMultiHensel.cc,v 1.3 1997-09-12 07:19:48 Singular Exp $"; 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 // FACTORY - Includes … … 9 9 #include "tmpl_inst.h" 10 10 #include "helpstuff.h" 11 // some CC's need this: 12 #include "MVMultiHensel.h" 13 14 #ifdef SINGULAR 15 # define HAVE_SINGULAR 16 #endif 11 17 12 18 #ifdef HENSELDEBUG -
libfac/factor/MVMultiHensel.h
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: MVMultiHensel.h,v 1. 2 1997-06-09 15:56:00Singular Exp $4 // $Id: MVMultiHensel.h,v 1.3 1997-09-12 07:19:48 Singular Exp $ 5 5 ///////////////////////////////////////////////////////////// 6 6 #ifndef MULTIHENSEL_H -
libfac/factor/SqrFree.cc
r0479e09 r4a81ec 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 static char * rcsid = "$Id: SqrFree.cc,v 1. 2 1997-06-09 15:56:02Singular 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.";4 static char * rcsid = "$Id: SqrFree.cc,v 1.3 1997-09-12 07:19:50 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."; 6 6 /////////////////////////////////////////////////////////////////////////////// 7 7 // FACTORY - Includes … … 10 10 #include "tmpl_inst.h" 11 11 #include "helpstuff.h" 12 // some CC's need this: 13 #include "SqrFree.h" 14 15 #ifdef SINGULAR 16 # define HAVE_SINGULAR 17 #endif 12 18 13 19 #ifdef SQRFREEDEBUG … … 22 28 TIMING_DEFINE_PRINT(gcd_time); 23 29 24 #ifdef HAVE_SINGULAR25 extern void WerrorS(char *);26 #endif27 28 // forward declaration:29 CFFList SqrFree( const CanonicalForm & r );30 CFFList InternalSqrFree( const CanonicalForm & r );31 30 32 31 static inline CFFactor … … 52 51 PthRoot( const CanonicalForm & f ){ 53 52 CanonicalForm RES, R = f; 54 int n= getNumVars(R), p= getCharacteristic();53 int n= max(level(R),getNumVars(R)), p= getCharacteristic(); 55 54 56 55 if (n==0){ // constant … … 78 77 /////////////////////////////////////////////////////////////// 79 78 int 80 SqrFreeTest( const CanonicalForm & r, int opt =1){79 SqrFreeTest( const CanonicalForm & r, int opt){ 81 80 CanonicalForm f=r, g; 82 81 int n=level(f); … … 126 125 } 127 126 #ifdef HAVE_SINGULAR 127 extern void WerrorS(char *); 128 128 WerrorS("libfac: ERROR: SqrFreeTest: we should never fall trough here!"); 129 129 #else … … 197 197 g=swapvar(f,k,n) ; g = g.deriv(); 198 198 if ( ! g.isZero() ){ // can`t be Pth root 199 CFFList Outputlist2= SqrFreed(swapvar(f,k,n)); 199 CFFList Outputlist2= SqrFreed(swapvar(f,k,n)); 200 200 for (CFFListIterator inter=Outputlist2; inter.hasItem(); inter++){ 201 201 Outputlist= myappend(Outputlist, CFFactor(swapvar(inter.getItem().factor(),k,n), inter.getItem().exp())); … … 252 252 } 253 253 #ifdef HAVE_SINGULAR 254 extern void WerrorS(char *); 254 255 WerrorS("libfac: ERROR: SqrFreed: we should never fall trough here!"); 255 256 #else -
libfac/factor/SqrFree.h
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: SqrFree.h,v 1. 2 1997-06-09 15:56:03Singular Exp $4 // $Id: SqrFree.h,v 1.3 1997-09-12 07:19:51 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef SQRFREE_H … … 8 8 9 9 /*BEGINPUBLIC*/ 10 // int SqrFreeTest( const CanonicalForm & r, int opt=1) ;11 10 // CFFList SqrFree( const CanonicalForm & f ) ; 11 /*ENDPUBLIC*/ 12 12 CFFList InternalSqrFree( const CanonicalForm & f ) ; 13 /*ENDPUBLIC*/ 14 int SqrFreeTest( const CanonicalForm & r, int opt=1) ; 13 int SqrFreeTest( const CanonicalForm & r, int opt=1) ; 15 14 CFFList SqrFree( const CanonicalForm & f ) ; 16 15 #endif /* SQRFREE_H */ -
libfac/factor/Truefactor.cc
r0479e09 r4a81ec 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 //static char * rcsid = "@(#) $Id: Truefactor.cc,v 1. 2 1997-06-09 15:56:04Singular Exp $";4 //static char * rcsid = "@(#) $Id: Truefactor.cc,v 1.3 1997-09-12 07:19:52 Singular Exp $"; 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 // Factory - Includes … … 9 9 #include "tmpl_inst.h" 10 10 #include "helpstuff.h" 11 // some CC's need this: 12 #include "Truefactor.h" 13 14 #ifdef SINGULAR 15 # define HAVE_SINGULAR 16 #endif 11 17 12 18 #ifdef TRUEFACTORDEBUG … … 19 25 #include "timing.h" 20 26 21 #ifdef HAVE_SINGULAR22 extern void WerrorS(char *);23 #endif24 27 /////////////////////////////////////////////////////////////// 25 28 // generate all different k-subsets of the set with n // … … 233 236 // Check if poly f is in Fp (returns true) or in Fp(a) // 234 237 /////////////////////////////////////////////////////////////// 235 bool238 static bool 236 239 is_in_Fp( const CanonicalForm & f ){ 237 240 if ( f.inCoeffDomain() ) … … 278 281 if ( PossibleFactors.length() < n ) { // a little check 279 282 #ifdef HAVE_SINGULAR 283 extern void WerrorS(char *); 280 284 WerrorS("libfac: ERROR: TakeNorms less then two items remaining!"); 281 285 #else … … 320 324 else{ 321 325 #ifdef HAVE_SINGULAR 326 extern void WerrorS(char *); 322 327 WerrorS("libfac: TakeNorms: somethings wrong with remaining factors!"); 323 328 #else -
libfac/factor/Truefactor.h
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: Truefactor.h,v 1. 2 1997-06-09 15:56:05Singular Exp $4 // $Id: Truefactor.h,v 1.3 1997-09-12 07:19:53 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef TRUEFACTOR_H -
libfac/factor/class.cc
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // static char * rcsid = "@(#) $Id: class.cc,v 1. 2 1997-06-09 15:56:05Singular Exp $";4 // static char * rcsid = "@(#) $Id: class.cc,v 1.3 1997-09-12 07:19:53 Singular Exp $"; 5 5 //////////////////////////////////////////////////////////// 6 6 … … 33 33 } 34 34 35 #ifndef NOSTREAMIO 35 36 template <class T> 36 37 void Substitution<T>::print ( ostream& s ) const … … 38 39 s << "(" << factor() << ")^" << exp(); 39 40 } 41 #endif 40 42 41 43 //////////////////////////////////////////////////////////// -
libfac/factor/class.h
r0479e09 r4a81ec 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: class.h,v 1. 3 1997-08-01 10:51:28Singular Exp $4 // $Id: class.h,v 1.4 1997-09-12 07:19:54 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef INCL_CLASS_H … … 12 12 #include <iostream.h> 13 13 #endif 14 15 14 16 15 template <class T> … … 41 40 return os; 42 41 } 43 #endif 42 #endif 44 43 }; 45 44 … … 53 52 /* 54 53 $Log: not supported by cvs2svn $ 55 Revision 1.2 1997/06/09 15:56:06 Singular56 * hannes/michael: libfac 0.2.457 58 54 Revision 1.2 1997/04/25 22:21:26 michael 59 55 Version for libfac-0.2.1 -
libfac/factor/debug.cc
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // static char * rcsid = "$Id: debug.cc,v 1. 2 1997-06-09 15:56:07Singular Exp $ ";4 // static char * rcsid = "$Id: debug.cc,v 1.3 1997-09-12 07:19:55 Singular Exp $ "; 5 5 //////////////////////////////////////////////////////////// 6 6 static int deb_level; -
libfac/factor/debug.h
r0479e09 r4a81ec 1 1 /* Copyright 1996 Michael Messollen. All rights reserved. */ 2 2 //////////////////////////////////////////////////////////// 3 // static char * rcsid = "$Id: debug.h,v 1. 2 1997-06-09 15:56:08Singular Exp $" ;3 // static char * rcsid = "$Id: debug.h,v 1.3 1997-09-12 07:19:55 Singular Exp $" ; 4 4 //////////////////////////////////////////////////////////// 5 5 // It is possible to include this file multiple times for different … … 45 45 (stream << deb_level_msg, stream.flush()) 46 46 #define DEBOUT(stream,msg,object) \ 47 (stream << msg << object, stream.flush())47 (stream << deb_level_msg << msg << object, stream.flush()) 48 48 #define DEBOUTLN(stream,msg,object) \ 49 49 (stream << deb_level_msg << msg << object << endl) -
libfac/factor/helpstuff.cc
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // static char * rcsid = "$Id: helpstuff.cc,v 1. 2 1997-06-09 15:56:08Singular Exp $";4 // static char * rcsid = "$Id: helpstuff.cc,v 1.3 1997-09-12 07:19:56 Singular Exp $"; 5 5 //////////////////////////////////////////////////////////// 6 6 // FACTORY - Includes … … 8 8 // Factor - Includes 9 9 #include "tmpl_inst.h" 10 // some CC's need this: 11 #include "helpstuff.h" 10 12 11 13 bool … … 18 20 else { b=aa; } 19 21 return retvalue; 22 } 23 24 void 25 mydivrem( 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; } 20 32 } 21 33 … … 60 72 61 73 int 62 Powerup( const int base , const int exp =1){74 Powerup( const int base , const int exp){ 63 75 int retvalue=1; 64 76 if ( exp == 0 ) return retvalue ; -
libfac/factor/helpstuff.h
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: helpstuff.h,v 1. 2 1997-06-09 15:56:09Singular Exp $4 // $Id: helpstuff.h,v 1.3 1997-09-12 07:19:57 Singular Exp $ 5 5 //////////////////////////////////////////////////////////// 6 6 #ifndef HELPSTUFF_H 7 7 #define HELPSTUFF_H 8 8 bool mydivremt ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& ); 9 void mydivrem( const CanonicalForm& f, const CanonicalForm& g, CanonicalForm& a, CanonicalForm& b ); 9 10 /////////////////////////////////////////////////////////////// 10 11 // Now some procedures used in MVMultiHensel and in Truefactors -
libfac/factor/homogfactor.cc
r0479e09 r4a81ec 1 1 /* Copyright 1997 Michael Messollen. All rights reserved. */ 2 2 //////////////////////////////////////////////////////////// 3 // static char * rcsid = "$Id: homogfactor.cc,v 1. 2 1997-06-09 15:56:10Singular Exp $ ";3 // static char * rcsid = "$Id: homogfactor.cc,v 1.3 1997-09-12 07:19:57 Singular Exp $ "; 4 4 //////////////////////////////////////////////////////////// 5 5 // FACTORY - Includes … … 8 8 #include "tmpl_inst.h" 9 9 #include "Factor.h" 10 // some CC's need it: 11 #include "homogfactor.h" 10 12 11 13 #ifdef HFACTORDEBUG -
libfac/factor/homogfactor.h
r0479e09 r4a81ec 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: homogfactor.h,v 1. 2 1997-06-09 15:56:10Singular Exp $4 // $Id: homogfactor.h,v 1.3 1997-09-12 07:19:58 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef HFACTOR_H 7 7 #define HFACTOR_H 8 CFList get_Terms( const CanonicalForm & f );9 bool is_homogeneous( const CanonicalForm & f);10 CFFList 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 ); 11 11 #endif /* HFACTOR_H */ 12 12 -
libfac/factor/timing.h
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // static char * rcsid = "$Id: timing.h,v 1. 2 1997-06-09 15:56:12Singular Exp $";4 // static char * rcsid = "$Id: timing.h,v 1.3 1997-09-12 07:19:59 Singular Exp $"; 5 5 //////////////////////////////////////////////////////////// 6 6 // It is possible to include this file multiple times for different -
libfac/factor/tmpl_inst.cc
r0479e09 r4a81ec 2 2 //////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: tmpl_inst.cc,v 1. 2 1997-06-09 15:56:12Singular Exp $4 // $Id: tmpl_inst.cc,v 1.3 1997-09-12 07:20:00 Singular Exp $ 5 5 //////////////////////////////////////////////////////////// 6 6 … … 82 82 template class Array<Variable>; 83 83 84 // for database 85 #ifdef HAVE_DATABASE 86 template class List<CFFList>; 87 template class ListIterator<CFFList>; 88 #endif /* HAVE_DATABASE */ 84 89 //////////////////////////////////////////////////////////// 85 90 /* -
libfac/factor/tmpl_inst.h
r0479e09 r4a81ec 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: tmpl_inst.h,v 1. 2 1997-06-09 15:56:14Singular Exp $4 // $Id: tmpl_inst.h,v 1.3 1997-09-12 07:20:01 Singular Exp $ 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 #ifndef TMPL_INST_H … … 37 37 typedef Array<int> Intarray; 38 38 39 typedef Array<CFArray> CCFArray ; 40 typedef Array<CCFArray> CCCFArray ; 39 #ifdef HAVE_DATABASE 40 typedef List<CFFList> ListCFFList; 41 typedef ListIterator<CFFList> ListCFFListIterator; 42 #endif 43 44 //typedef Array<CFArray> CCFArray ; 45 //typedef Array<CCFArray> CCCFArray ; 41 46 42 47 #endif /* TMPL_INST_H */ -
libfac/factor/version.cc
r0479e09 r4a81ec 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 // emacs edit mode for this file is -*- C++ -*- 4 // $Id: version.cc,v 1. 2 1997-06-09 15:56:14Singular Exp $4 // $Id: version.cc,v 1.3 1997-09-12 07:20:02 Singular Exp $ 5 5 static char * rcsid = "@(#) libfac version 0.2.4 [May 29 1997] (C) 1996-97 M. Messollen"; 6 6 /////////////////////////////////////////////////////////////////////////////// 7 7 8 8 char * libfac_name = "Factorization and characteristic sets library"; 9 char * libfac_version = "0. 2.4";10 char * libfac_date = " May 301997";9 char * libfac_version = "0.3.0"; 10 char * libfac_date = "Sep 11 1997"; 11 11 char * libfac_author = "M. Messollen"; 12 12
Note: See TracChangeset
for help on using the changeset viewer.