Changeset 49f1f45 in git for factory/winnt
- Timestamp:
- Nov 20, 2007, 11:08:40 AM (16 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 62f8cca6dc508c925bc4d657aea450dafba04fb9
- Parents:
- b1d37f6a1e89cd93b4ecab9f73e8d297d77180c0
- Location:
- factory/winnt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/winnt/factory.h
rb1d37f r49f1f45 1 /* ../factory/winnt/factory.h automatically generated by makeheader from ../factory/factory.template */1 /* winnt/factory.h automatically generated by makeheader from factory.template */ 2 2 /* emacs edit mode for this file is -*- C++ -*- */ 3 /* $Id: factory.h,v 1. 5 1997-12-09 16:37:34 schmidtExp $ */3 /* $Id: factory.h,v 1.6 2007-11-20 10:08:03 Singular Exp $ */ 4 4 5 5 #ifndef INCL_FACTORY_H … … 26 26 27 27 #ifndef NOSTREAMIO 28 #ifdef HAVE_IOSTREAM 29 #include <iostream> 30 #define OSTREAM std::ostream 31 #define ISTREAM std::istream 32 #elif defined(HAVE_IOSTREAM_H) 28 33 #include <iostream.h> 34 #define OSTREAM ostream 35 #define ISTREAM istream 36 #endif 29 37 #endif /* ! NOSTREAMIO */ 30 38 31 39 #ifdef SINGULAR 32 extern "C" { 40 #include "cf_gmp.h" 41 #else 33 42 #include <gmp.h> 34 }35 43 #endif /* SINGULAR */ 36 44 37 45 #ifdef macintosh 38 #include <: :templates:ftmpl_array.h>39 #include <: :templates:ftmpl_factor.h>40 #include <: :templates:ftmpl_list.h>41 #include <: :templates:ftmpl_matrix.h>46 #include <:templates:ftmpl_array.h> 47 #include <:templates:ftmpl_factor.h> 48 #include <:templates:ftmpl_list.h> 49 #include <:templates:ftmpl_matrix.h> 42 50 #else 43 51 #include <templates/ftmpl_array.h> … … 47 55 #endif 48 56 49 /* stuff included from . ./factory/cf_globals.h */57 /* stuff included from ./cf_globals.h */ 50 58 51 59 … … 54 62 55 63 56 /* stuff included from . ./factory/cf_primes.h */64 /* stuff included from ./cf_primes.h */ 57 65 58 66 … … 70 78 71 79 72 /* stuff included from . ./factory/cf_defs.h */80 /* stuff included from ./cf_defs.h */ 73 81 74 82 … … 99 107 const int SW_USE_EZGCD = 6; 100 108 const int SW_USE_SPARSEMOD = 7; 101 //}}} 102 103 104 /* stuff included from ../factory/variable.h */ 109 const int SW_USE_NTL=8; 110 const int SW_USE_NTL_GCD_0=9; 111 const int SW_USE_NTL_GCD_P=10; 112 const int SW_USE_NTL_SORT=11; 113 const int SW_USE_CHINREM_GCD=12; 114 const int SW_USE_GCD_P=13; 115 //}}} 116 117 118 /* stuff included from ./variable.h */ 105 119 106 120 … … 153 167 } 154 168 #ifndef NOSTREAMIO 155 friend ostream & operator << ( ostream& os, const Variable & v );169 friend OSTREAM & operator << ( OSTREAM & os, const Variable & v ); 156 170 #endif /* NOSTREAMIO */ 157 friend Variable rootOf( const CanonicalForm &, char name = '@' ); 158 }; 171 friend void swap_levels(); 172 friend Variable rootOf( const CanonicalForm &, char name ); 173 }; 174 Variable rootOf( const CanonicalForm &, char name = '@' ); 159 175 160 176 inline int level( const Variable & v ) { return v.level(); } … … 166 182 char getDefaultExtName(); 167 183 168 169 /* stuff included from ../factory/canonicalform.h */ 184 int ExtensionLevel(); 185 186 187 /* stuff included from ./canonicalform.h */ 188 189 190 #undef CF_INLINE 191 #define CF_INLINE 192 #undef CF_NO_INLINE 193 #define CF_NO_INLINE 194 195 196 class InternalCF; 197 198 inline int is_imm ( const InternalCF * const ptr ) 199 { 200 // returns 0 if ptr is not immediate 201 return ( ((int)((long)ptr)) & 3 ); 202 } 170 203 171 204 … … 173 206 174 207 static int cf_is_initialized_now = initCanonicalForm(); 175 176 class InternalCF;177 208 178 209 //{{{ class CanonicalForm … … 183 214 public: 184 215 // constructors, destructors, selectors 185 C anonicalForm();186 C anonicalForm( const CanonicalForm& );187 C anonicalForm( InternalCF* );188 C anonicalForm( const int );189 C anonicalForm( const Variable & );190 C anonicalForm( const Variable &, int );191 CanonicalForm( const char * ); // use with caution - does only handle integers !!!192 193 ~CanonicalForm();216 CF_INLINE CanonicalForm(); 217 CF_INLINE CanonicalForm( const CanonicalForm& ); 218 CF_INLINE CanonicalForm( InternalCF* ); 219 CF_INLINE CanonicalForm( const int ); 220 CF_INLINE CanonicalForm( const Variable & ); 221 CF_INLINE CanonicalForm( const Variable &, int ); 222 CanonicalForm( const char *, const int base=10 ); // use with caution - does only handle integers !!! 223 224 CF_NO_INLINE ~CanonicalForm(); 194 225 195 226 InternalCF* getval() const; // use with caution !!! … … 198 229 199 230 // predicates 200 bool isOne() const;201 bool isZero() const;202 bool isImm() const;231 CF_NO_INLINE bool isOne() const; 232 CF_NO_INLINE bool isZero() const; 233 inline bool isImm() const { return is_imm( value ); }; 203 234 204 235 bool inZ() const; … … 215 246 bool isFFinGF() const; 216 247 bool isUnivariate() const; 248 bool isHomogeneous() const; 217 249 218 250 // conversion functions … … 238 270 239 271 // assignment operators 240 C anonicalForm& operator = ( const CanonicalForm& );241 C anonicalForm& operator = ( const int );272 CF_NO_INLINE CanonicalForm& operator = ( const CanonicalForm& ); 273 CF_NO_INLINE CanonicalForm& operator = ( const int ); 242 274 243 275 CanonicalForm& operator += ( const CanonicalForm& ); … … 269 301 270 302 // arithmetic operators 271 friend CanonicalForm operator - ( const CanonicalForm& ); 272 273 friend CanonicalForm operator + ( const CanonicalForm&, const CanonicalForm& ); 274 friend CanonicalForm operator - ( const CanonicalForm&, const CanonicalForm& ); 275 friend CanonicalForm operator * ( const CanonicalForm&, const CanonicalForm& ); 276 friend CanonicalForm operator / ( const CanonicalForm&, const CanonicalForm& ); 277 friend CanonicalForm operator % ( const CanonicalForm&, const CanonicalForm& ); 278 279 friend CanonicalForm div ( const CanonicalForm&, const CanonicalForm& ); 280 friend CanonicalForm mod ( const CanonicalForm&, const CanonicalForm& ); 303 friend CF_NO_INLINE CanonicalForm operator - ( const CanonicalForm& ); 281 304 282 305 friend void divrem ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& ); 283 306 friend bool divremt ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& ); 284 307 308 friend CanonicalForm bgcd ( const CanonicalForm &, const CanonicalForm & ); 309 friend CanonicalForm bextgcd ( const CanonicalForm &, const CanonicalForm &, CanonicalForm &, CanonicalForm & ); 310 311 // input/output 285 312 #ifndef NOSTREAMIO 286 void print( ostream&, char * ) const; 287 friend ostream& operator << ( ostream&, const CanonicalForm& ); 288 friend istream& operator >> ( istream&, CanonicalForm& ); 313 void print( OSTREAM&, char * ) const; 314 void print( OSTREAM& ) const; 315 friend OSTREAM& operator << ( OSTREAM&, const CanonicalForm& ); 316 friend ISTREAM& operator >> ( ISTREAM&, CanonicalForm& ); 289 317 #endif /* NOSTREAMIO */ 290 318 … … 298 326 //}}} 299 327 300 // some useful functions 328 CF_INLINE CanonicalForm 329 operator + ( const CanonicalForm&, const CanonicalForm& ); 330 331 CF_NO_INLINE CanonicalForm 332 operator - ( const CanonicalForm&, const CanonicalForm& ); 333 334 CF_INLINE CanonicalForm 335 operator * ( const CanonicalForm&, const CanonicalForm& ); 336 337 CF_NO_INLINE CanonicalForm 338 operator / ( const CanonicalForm&, const CanonicalForm& ); 339 340 CF_NO_INLINE CanonicalForm 341 operator % ( const CanonicalForm&, const CanonicalForm& ); 342 343 CF_NO_INLINE CanonicalForm 344 div ( const CanonicalForm&, const CanonicalForm& ); 345 346 CF_NO_INLINE CanonicalForm 347 mod ( const CanonicalForm&, const CanonicalForm& ); 348 301 349 302 350 //{{{ function declarations from canonicalform.cc 351 CanonicalForm blcm ( const CanonicalForm & f, const CanonicalForm & g ); 352 303 353 CanonicalForm power ( const CanonicalForm & f, int n ); 304 354 305 355 CanonicalForm power ( const Variable & v, int n ); 306 307 bool divides ( const CanonicalForm & f, const CanonicalForm & g );308 356 //}}} 309 357 … … 313 361 CanonicalForm extgcd ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& ); 314 362 315 CanonicalForm iextgcd ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& );316 317 363 CanonicalForm lcm ( const CanonicalForm&, const CanonicalForm& ); 318 364 … … 324 370 325 371 CanonicalForm icontent ( const CanonicalForm & f ); 372 373 CanonicalForm vcontent ( const CanonicalForm & f, const Variable & x ); 326 374 //}}} 327 375 … … 386 434 level ( const CanonicalForm & f ) { return f.level(); } 387 435 388 inline CanonicalForm436 inline Variable 389 437 mvar ( const CanonicalForm & f ) { return f.mvar(); } 390 438 … … 394 442 inline CanonicalForm 395 443 den ( const CanonicalForm & f ) { return f.den(); } 444 445 inline int 446 sign ( const CanonicalForm & a ) { return a.sign(); } 396 447 397 448 inline CanonicalForm … … 418 469 } 419 470 420 inline CanonicalForm421 abs ( const CanonicalForm & f )422 {423 if ( f < 0 )424 return -f;425 else426 return f;427 }428 429 471 inline int 430 472 headdegree ( const CanonicalForm & f ) { return totaldegree( head( f ) ); } 473 474 431 475 //}}} 432 476 … … 456 500 457 501 458 /* stuff included from . ./factory/cf_binom.h */502 /* stuff included from ./cf_binom.h */ 459 503 460 504 … … 462 506 463 507 464 /* stuff included from . ./factory/cf_algorithm.h */508 /* stuff included from ./cf_algorithm.h */ 465 509 466 510 … … 472 516 void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r, const Variable & x ); 473 517 474 CanonicalForm common_den ( const CanonicalForm & f ); 518 CanonicalForm bCommonDen ( const CanonicalForm & f ); 519 520 bool fdivides ( const CanonicalForm & f, const CanonicalForm & g ); 521 522 CanonicalForm maxNorm ( const CanonicalForm & f ); 523 524 CanonicalForm euclideanNorm ( const CanonicalForm & f ); 475 525 //}}} 476 526 … … 479 529 480 530 void chineseRemainder ( const CFArray & x, const CFArray & q, CanonicalForm & xnew, CanonicalForm & qnew ); 531 532 CanonicalForm Farey ( const CanonicalForm & f, const CanonicalForm & q ); 481 533 //}}} 482 534 483 535 //{{{ function declarations from cf_factor.cc 536 bool isPurePoly(const CanonicalForm & f); 537 538 bool isPurePoly_m(const CanonicalForm & f); 539 484 540 CFFList factorize ( const CanonicalForm & f, bool issqrfree = false ); 485 541 … … 489 545 490 546 bool isSqrFree ( const CanonicalForm & f ); 547 548 CanonicalForm homogenize( const CanonicalForm & f, const Variable & x); 549 CanonicalForm homogenize( const CanonicalForm & f, const Variable & x, 550 const Variable & v1, const Variable & v2); 551 Variable get_max_degree_Variable(const CanonicalForm & f); 552 CFList get_Terms( const CanonicalForm & f ); 553 void getTerms( const CanonicalForm & f, const CanonicalForm & t, CFList & result ); 554 555 491 556 //}}} 492 557 … … 503 568 //}}} 504 569 505 506 /* stuff included from ../factory/cf_eval.h */ 570 //{{{ inline CanonicalForm abs ( const CanonicalForm & f ) 571 //{{{ docu 572 // 573 // abs() - return absolute value of `f'. 574 // 575 // The absolute value is defined in terms of the function 576 // `sign()'. If it reports negative sign for `f' than -`f' is 577 // returned, otherwise `f'. 578 // 579 // This behaviour is most useful for integers and rationals. But 580 // it may be used to sign-normalize the leading coefficient of 581 // arbitrary polynomials, too. 582 // 583 // Type info: 584 // ---------- 585 // f: CurrentPP 586 // 587 //}}} 588 inline CanonicalForm 589 abs ( const CanonicalForm & f ) 590 { 591 // it is not only more general to use `sign()' instead of a 592 // direct comparison `f < 0', it is faster, too 593 if ( sign( f ) < 0 ) 594 return -f; 595 else 596 return f; 597 } 598 //}}} 599 600 601 /* stuff included from ./cf_eval.h */ 507 602 508 603 … … 525 620 virtual void nextpoint(); 526 621 #ifndef NOSTREAMIO 527 friend ostream& operator<< ( ostream& s, const Evaluation &e );622 friend OSTREAM& operator<< ( OSTREAM& s, const Evaluation &e ); 528 623 #endif /* NOSTREAMIO */ 529 624 }; 530 625 531 626 532 /* stuff included from . ./factory/cf_generator.h */627 /* stuff included from ./cf_generator.h */ 533 628 534 629 … … 574 669 }; 575 670 576 class AlgExtGenerator : public CFGenerator671 class AlgExtGenerator //??? : public CFGenerator 577 672 { 578 673 private: 579 674 Variable algext; 580 CFGenerator **gens; 675 FFGenerator **gensf; 676 GFGenerator **gensg; 581 677 int n; 582 678 bool nomoreitems; … … 603 699 604 700 605 /* stuff included from ../factory/cf_iter.h */ 701 /* stuff included from ./cf_iter.h */ 702 703 704 #undef CF_INLINE 705 #define CF_INLINE 706 #undef CF_NO_INLINE 707 #define CF_NO_INLINE 606 708 607 709 … … 625 727 CFIterator& operator= ( const CanonicalForm& ); 626 728 627 CF Iterator& operator++ ();628 CF Iterator& operator++ ( int );629 int hasTerms () const;630 C anonicalForm coeff () const;631 int exp () const;632 }; 633 634 635 /* stuff included from . ./factory/cf_random.h */729 CF_NO_INLINE CFIterator& operator++ (); 730 CF_NO_INLINE CFIterator& operator++ ( int ); 731 CF_NO_INLINE int hasTerms () const; 732 CF_NO_INLINE CanonicalForm coeff () const; 733 CF_NO_INLINE int exp () const; 734 }; 735 736 737 /* stuff included from ./cf_random.h */ 636 738 637 739 … … 700 802 701 803 702 /* stuff included from . ./factory/cf_irred.h */804 /* stuff included from ./cf_irred.h */ 703 805 704 806 … … 706 808 707 809 708 /* stuff included from . ./factory/fac_util.h */810 /* stuff included from ./fac_util.h */ 709 811 710 812 … … 736 838 void divremainder( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & quot, CanonicalForm & rem, const modpk & pk ); 737 839 738 CanonicalForm maxCoeff( const CanonicalForm & f );739 740 840 bool Hensel ( const CanonicalForm & U, CFArray & G, const CFArray & lcG, const Evaluation & A, const modpk & bound, const Variable & x ); 741 841 … … 753 853 754 854 755 /* stuff included from . ./factory/cf_map.h */855 /* stuff included from ./cf_map.h */ 756 856 757 857 … … 789 889 CanonicalForm subst () const { return S; } 790 890 #ifndef NOSTREAMIO 791 friend ostream & operator << ( ostream & s, const MapPair & p ); 891 void print( OSTREAM&) const; 892 friend OSTREAM & operator << ( OSTREAM & s, const MapPair & p ); 792 893 #endif /* NOSTREAMIO */ 793 894 }; … … 827 928 CanonicalForm operator () ( const CanonicalForm & f ) const; 828 929 #ifndef NOSTREAMIO 829 friend ostream & operator << ( ostream& s, const CFMap & m );930 friend OSTREAM & operator << ( OSTREAM & s, const CFMap & m ); 830 931 #endif /* NOSTREAMIO */ 831 932 }; … … 837 938 838 939 839 /* stuff included from . ./factory/cf_reval.h */940 /* stuff included from ./cf_reval.h */ 840 941 841 942 … … 856 957 #ifdef SINGULAR 857 958 858 /* stuff included from . ./factory/gfops.h */959 /* stuff included from ./gfops.h */ 859 960 860 961 … … 864 965 865 966 866 /* stuff included from . ./factory/singext.h */967 /* stuff included from ./singext.h */ 867 968 868 969 … … 871 972 MP_INT gmp_denominator ( const CanonicalForm & f ); 872 973 974 int gf_value (const CanonicalForm & f ); 975 873 976 CanonicalForm make_cf ( const MP_INT & n ); 874 977 875 978 CanonicalForm make_cf ( const MP_INT & n, const MP_INT & d, bool normalize ); 876 979 980 CanonicalForm make_cf_from_gf ( const int z ); 981 877 982 878 983 #endif /* SINGULAR */ 879 984 985 #ifdef HAVE_BIFAC 986 /* stuff included from ./bifac.h */ 987 988 989 CFFList AbsFactorize( const CanonicalForm & a ); 990 991 class BIFAC 992 { 993 //////////////////////////////////////////////////////////////// 994 public: 995 //////////////////////////////////////////////////////////////// 996 997 // === KONST-/ DESTRUKTOREN ==== 998 BIFAC ( void ); // Konstruktor 999 virtual ~BIFAC( void ); // DESTRUKTOR 1000 1001 // === Funktionen ======= 1002 void bifac(CanonicalForm f, bool absolute=true); 1003 CFFList getFactors( void ){ return gl_RL; }; 1004 1005 1006 //////////////////////////////////////////////////////////////// 1007 private: 1008 //////////////////////////////////////////////////////////////// 1009 1010 // === Funktionen ======= 1011 void passedTime(); 1012 void biGanzMachen( CanonicalForm & f ); 1013 void biNormieren( CanonicalForm & f ) ; 1014 void convertResult( CanonicalForm & f, int ch, int sw); 1015 int findCharacteristic(CanonicalForm f); 1016 // void matrix_drucken( CFMatrix M ); 1017 long int anz_terme( CanonicalForm & f ); 1018 1019 CFList matrix2basis(CFMatrix A, int dim, int m, int n, CanonicalForm f); 1020 CFList basisOfG(CanonicalForm f); 1021 CFMatrix createA (CFList G, CanonicalForm f); 1022 CanonicalForm create_g (CFList G); 1023 CFList createRg (CFList G, CanonicalForm f); 1024 CFList createEg (CFList G, CanonicalForm f); 1025 CFList createEgUni (CFList G, CanonicalForm f); 1026 1027 void unifac(CanonicalForm f, int grad); 1028 CanonicalForm RationalFactor (CanonicalForm phi, CanonicalForm f, \ 1029 CanonicalForm fx, CanonicalForm g); 1030 void RationalFactorizationOnly (CFFList Phis, CanonicalForm f, CanonicalForm g); 1031 CFList getAbsoluteFactors (CanonicalForm f1, CanonicalForm phi); 1032 void AbsoluteFactorization (CFFList Phis, CanonicalForm f, CanonicalForm g); 1033 void bifacSqrFree( CanonicalForm f ); 1034 void bifacMain(CanonicalForm f); 1035 1036 1037 // === Variable ======= 1038 CFFList gl_RL; // where to store the rational factorization 1039 CFList gl_AL; // where to store the absolute factorization 1040 bool absolute; // Compute an absolute factorization as well? 1041 int exponent; // 1042 }; 1043 1044 #endif /* HAVE_BIFAC */ 1045 880 1046 #endif /* ! INCL_FACTORY_H */ -
factory/winnt/factoryconf.h
rb1d37f r49f1f45 1 /* ../factory/winnt/factoryconf.h automatically generated by makeheader from ../factory/factoryconf.template */1 /* winnt/factoryconf.h automatically generated by makeheader from factoryconf.template */ 2 2 /* emacs edit mode for this file is -*- C -*- */ 3 /* $Id: factoryconf.h,v 1. 5 1997-12-09 16:37:58 schmidtExp $ */3 /* $Id: factoryconf.h,v 1.6 2007-11-20 10:08:03 Singular Exp $ */ 4 4 5 5 #ifndef INCL_FACTORYCONF_H … … 20 20 /* }}} */ 21 21 22 /* stuff included from . ./factory/winnt/config.h */22 /* stuff included from ./winnt/config.h */ 23 23 24 24 /* emacs edit mode for this file is -*- C -*- */ 25 /* $Id: factoryconf.h,v 1. 5 1997-12-09 16:37:58 schmidtExp $ */25 /* $Id: factoryconf.h,v 1.6 2007-11-20 10:08:03 Singular Exp $ */ 26 26 27 27 #ifndef INCL_CONFIG_H … … 102 102 #endif /* ! INCL_CONFIG_H */ 103 103 104 /* stuff included from . ./factory/assert.h */104 /* stuff included from ./assert.h */ 105 105 106 106 /* emacs edit mode for this file is -*- C -*- */ 107 /* $Id: factoryconf.h,v 1. 5 1997-12-09 16:37:58 schmidtExp $ */107 /* $Id: factoryconf.h,v 1.6 2007-11-20 10:08:03 Singular Exp $ */ 108 108 109 109 /* This is for compatibility with standard assert.h */ … … 134 134 /* }}} */ 135 135 136 #ifdef __cplusplus 137 extern "C" { 138 #endif 139 136 140 #include <stdio.h> 137 141 #include <stdlib.h> 142 143 #ifdef __cplusplus 144 } 145 #endif 138 146 139 147 /* {{{ permanent macro definitions */
Note: See TracChangeset
for help on using the changeset viewer.