Changeset 9c9e2a4 in git
- Timestamp:
- Dec 8, 1997, 7:24:47 PM (26 years ago)
- Branches:
- (u'spielwiese', 'ec94ef7a30b928574c0c3daf41f6804dff5f6b69')
- Children:
- 31a2be7f2a739a97c14524d60b3f53ce30ff4336
- Parents:
- b7ef56a82852de8fabcb051596fe67049852b346
- Location:
- factory
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cf_factor.cc
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_factor.cc,v 1. 7 1997-09-09 09:25:52schmidt Exp $ */2 /* $Id: cf_factor.cc,v 1.8 1997-12-08 18:24:23 schmidt Exp $ */ 3 3 4 4 //{{{ docu … … 45 45 return FpFactorizeUnivariateB( f, issqrfree ); 46 46 else 47 return FpFactorizeUnivariateCZ( f, issqrfree );47 return FpFactorizeUnivariateCZ( f, issqrfree, 0, Variable(), Variable() ); 48 48 } 49 49 else { … … 60 60 ASSERT( f.isUnivariate(), "multivariate factorization not implemented" ); 61 61 ASSERT( getCharacteristic() > 0, "char 0 factorization not implemented" ); 62 return FpFactorizeUnivariateCZ( f, false, 1, alpha );62 return FpFactorizeUnivariateCZ( f, false, 1, alpha, Variable() ); 63 63 } 64 64 -
factory/cf_random.cc
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_random.cc,v 1. 5 1997-10-22 13:44:34schmidt Exp $ */2 /* $Id: cf_random.cc,v 1.6 1997-12-08 18:24:25 schmidt Exp $ */ 3 3 4 4 #include <config.h> … … 16 16 class RandomGenerator { 17 17 private: 18 #ifdef macintosh 19 // mac does not like const long int in a class 20 long int ia, im, iq, ir, deflt; 21 #else 22 const long int 23 ia = 16807, 24 im = 2147483647, 25 iq = 127773, 26 ir = 2836, 27 deflt = 123459876; 28 #endif 29 18 const long int ia, im, iq, ir, deflt; 30 19 long s; 31 20 … … 33 22 void seedInit( long ss ) { s = ((ss == 0) ? deflt : ss); } 34 23 public: 35 #ifdef macintosh36 24 RandomGenerator(); 37 25 RandomGenerator( long ss ); 38 #else39 RandomGenerator() { seedInit( (long)time( 0 ) ); }40 RandomGenerator( long ss ) { seedInit( ss ); }41 #endif42 26 ~RandomGenerator() {} 43 27 long generate(); … … 45 29 }; 46 30 47 #ifdef macintosh 48 RandomGenerator::RandomGenerator() 31 RandomGenerator::RandomGenerator() : ia(16807), im(2147483647), iq(127773), ir(2836), deflt(123459876) 49 32 { 50 ia = 16807;51 im = 2147483647;52 iq = 127773;53 ir = 2836;54 deflt = 123459876;55 33 seedInit( (long)time( 0 ) ); 56 34 } 57 35 58 RandomGenerator::RandomGenerator( long ss ) 36 RandomGenerator::RandomGenerator( long ss ) : ia(16807), im(2147483647), iq(127773), ir(2836), deflt(123459876) 59 37 { 60 ia = 16807;61 im = 2147483647;62 iq = 127773;63 ir = 2836;64 deflt = 123459876;65 38 seedInit( ss ); 66 39 } 67 #endif68 40 69 41 long -
factory/fac_cantzass.cc
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_cantzass.cc,v 1. 3 1997-09-09 09:03:31schmidt Exp $ */2 /* $Id: fac_cantzass.cc,v 1.4 1997-12-08 18:24:28 schmidt Exp $ */ 3 3 4 4 #include <config.h> … … 43 43 static CanonicalForm powerMod2( const CanonicalForm & f, MP_INT * q, int s, const CanonicalForm & d ); 44 44 45 CFFList FpFactorizeUnivariateCZ( const CanonicalForm& f, bool issqrfree, int numext, const Variable & alpha, const Variable &beta )45 CFFList FpFactorizeUnivariateCZ( const CanonicalForm& f, bool issqrfree, int numext, const Variable alpha, const Variable beta ) 46 46 { 47 47 CFFList F, G, H, HH; -
factory/fac_cantzass.h
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_cantzass.h,v 1. 2 1997-06-19 12:23:40schmidt Exp $ */2 /* $Id: fac_cantzass.h,v 1.3 1997-12-08 18:24:29 schmidt Exp $ */ 3 3 4 4 #ifndef INCL_FAC_CANTZASS_H … … 10 10 #include "canonicalform.h" 11 11 12 CFFList FpFactorizeUnivariateCZ( const CanonicalForm& f, bool issqrfree = false, int numext = 0, const Variable & alpha = Variable(), const Variable & beta = Variable());12 CFFList FpFactorizeUnivariateCZ( const CanonicalForm& f, bool issqrfree, int numext, const Variable alpha, const Variable beta ); 13 13 14 14 //CFFList FpFactorizeUnivariateCZ( const CanonicalForm& f ); -
factory/fac_iterfor.cc
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_iterfor.cc,v 1. 4 1997-06-19 12:23:33schmidt Exp $ */2 /* $Id: fac_iterfor.cc,v 1.5 1997-12-08 18:24:31 schmidt Exp $ */ 3 3 4 4 #include <config.h> … … 22 22 IteratedFor::IteratedFor( int from, int to, int max ) : MAX( max ), FROM( from ), TO( to ), N( TO-FROM ), last( false ) 23 23 { 24 ASSERT( n>= 0 && max >= 0, "illegal iterated for" );24 ASSERT( N >= 0 && max >= 0, "illegal iterated for" ); 25 25 index = new int[N+1]; 26 26 imax = new int[N+1]; -
factory/fac_sqrfree.cc
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_sqrfree.cc,v 1. 6 1997-06-19 12:23:21schmidt Exp $ */2 /* $Id: fac_sqrfree.cc,v 1.7 1997-12-08 18:24:32 schmidt Exp $ */ 3 3 4 4 #include <config.h> … … 96 96 } 97 97 98 intisSqrFreeZ ( const CanonicalForm & f )98 bool isSqrFreeZ ( const CanonicalForm & f ) 99 99 { 100 100 return gcd( f, f.deriv() ).degree() == 0; -
factory/fac_univar.cc
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_univar.cc,v 1.1 4 1997-09-29 06:53:25 schmidt Exp $ */2 /* $Id: fac_univar.cc,v 1.15 1997-12-08 18:24:35 schmidt Exp $ */ 3 3 4 4 #include <config.h> … … 451 451 setCharacteristic( p[i] ); 452 452 fp = mapinto( f ); 453 F[i] = FpFactorizeUnivariateCZ( fp, true );453 F[i] = FpFactorizeUnivariateCZ( fp, true, 0, Variable(), Variable() ); 454 454 // if ( p[i] < 23 && fp.degree() < 10 ) 455 455 // F[i] = FpFactorizeUnivariateB( fp, true ); 456 456 // else 457 // F[i] = FpFactorizeUnivariateCZ( fp, true );457 // F[i] = FpFactorizeUnivariateCZ( fp, true, 0, Variable, Variable() ); 458 458 DEBOUTLN( cerr, "F[i] = " << F[i] << ", p = " << p[i] ); 459 459 } -
factory/ffops.cc
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: ffops.cc,v 1. 5 1997-10-22 13:42:23schmidt Exp $ */2 /* $Id: ffops.cc,v 1.6 1997-12-08 18:24:37 schmidt Exp $ */ 3 3 4 4 #include <config.h> … … 45 45 int ff_biginv ( const int a ) 46 46 { 47 long long intu, r0 = a, r1 = ff_prime, q0 = 1, q1 = 0;47 INT64 u, r0 = a, r1 = ff_prime, q0 = 1, q1 = 0; 48 48 while ( ( r0 > 0 ) && ( r1 > 0 ) ) { 49 49 u = r0 / r1; -
factory/ffops.h
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: ffops.h,v 1. 4 1997-09-09 07:06:29schmidt Exp $ */2 /* $Id: ffops.h,v 1.5 1997-12-08 18:24:38 schmidt Exp $ */ 3 3 4 4 #ifndef INCL_FFOPS_H … … 44 44 } 45 45 46 inline int ff_bignorm ( const long long inta )46 inline int ff_bignorm ( const INT64 a ) 47 47 { 48 int n = (int)(a % ( long long int)ff_prime);48 int n = (int)(a % (INT64)ff_prime); 49 49 if ( n < 0 ) 50 50 return n + ff_prime; … … 71 71 { 72 72 if ( ff_big ) 73 return ff_bignorm( ( long long int)a * (long long int)b );73 return ff_bignorm( (INT64)a * (INT64)b ); 74 74 else 75 75 return ff_longnorm ( (long)a * (long)b ); -
factory/readcf.y
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: readcf.y,v 1. 4 1997-06-19 12:42:58schmidt Exp $ */2 /* $Id: readcf.y,v 1.5 1997-12-08 18:24:42 schmidt Exp $ */ 3 3 4 4 %{ 5 6 #ifdef WINNT 7 #include <malloc.h> 8 #include <memory.h> 9 #define alloca _alloca 10 #endif 5 11 6 12 #include <config.h> -
factory/sm_sparsemod.cc
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: sm_sparsemod.cc,v 1. 3 1997-10-09 14:47:19schmidt Exp $ */2 /* $Id: sm_sparsemod.cc,v 1.4 1997-12-08 18:24:45 schmidt Exp $ */ 3 3 4 4 //{{{ docu … … 380 380 return N( gcd( primif, primig ) ); 381 381 382 int varf[ levis ], varg[ levis ], schnitt[ levis ]; 382 int * varf = new int[levis]; 383 int * varg = new int[levis]; 384 int * schnitt = new int[levis]; 383 385 384 386 while ( ABFRAGE == 1 ) … … 433 435 } 434 436 435 436 437 438 delete [] varf; delete [] varg; delete [] schnitt; 437 439 438 440 -
factory/timing.h
rb7ef56 r9c9e2a4 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: timing.h,v 1. 3 1997-06-19 12:21:54schmidt Exp $ */2 /* $Id: timing.h,v 1.4 1997-12-08 18:24:47 schmidt Exp $ */ 3 3 4 4 /* It should be possible to include this file multiple times for different */ … … 14 14 #ifdef TIMING 15 15 #include <time.h> 16 #ifndef WINNT 16 17 #include <sys/times.h> 17 18 #include <sys/param.h> 19 #endif 18 20 #include <stdio.h> 19 21 … … 34 36 #endif 35 37 38 #ifdef WINNT 39 #define TIMING_START(t) { clock_t timing_ ## t ## _start, timing_ ## t ## _end; \ 40 timing_ ## t ## _start = clock(); 41 #define TIMING_END(t) timing_ ## t ## _end = clock(); \ 42 timing_ ## t ## _time += timing_ ## t ## _end - timing_ ## t ## _start; } 43 #define TIMING_DEFINE_PRINT(t) clock_t timing_ ## t ## _time; \ 44 void timing_print_ ## t ( char * msg ) { \ 45 fprintf( stderr, "%s%.2f sec\n", msg, float(timing_ ## t ## _time) / HZ ); \ 46 } 47 #define TIMING_DEFINE_PRINTPROTO(t) void timing_print_ ## t ( char * ); 48 #define TIMING_PRINT(t, msg) timing_print_ ## t ( msg ); 49 #else 36 50 #define TIMING_START(t) { struct tms timing_ ## t ## _start, timing_ ## t ## _end; \ 37 51 times( &timing_ ## t ## _start ); … … 48 62 #define TIMING_DEFINE_PRINTPROTO(t) void timing_print_ ## t ( char * ); 49 63 #define TIMING_PRINT(t, msg) timing_print_ ## t ( msg ); 64 #endif 50 65 #else /* TIMING */ 51 66 #define TIMING_START(t)
Note: See TracChangeset
for help on using the changeset viewer.