- Timestamp:
- Oct 15, 2003, 7:19:41 PM (21 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- ecd23349865d588d280037e46df36f300536d5a2
- Parents:
- 2499bf918092002632ace751f0bbae7bd5a2cccb
- Location:
- factory
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/NTLconvert.cc
r2499bf rd07137 1 /* $Id: NTLconvert.cc,v 1.1 1 2003-08-28 11:54:31Singular Exp $ */1 /* $Id: NTLconvert.cc,v 1.12 2003-10-15 17:19:38 Singular Exp $ */ 2 2 #include <config.h> 3 3 … … 453 453 char dummy[2]; 454 454 int minusremainder=0; 455 char numbers[]="0123456789abcdef"; 455 456 456 457 coeff_long=to_long(coefficient); … … 479 480 480 481 int l=0; 481 while (coefficient> 9)482 while (coefficient>15) 482 483 { 483 484 ZZ quotient,remaind; 484 ZZ ten;ten=1 0;485 ZZ ten;ten=16; 485 486 DivRem(quotient,remaind,coefficient,ten); 486 dummy[0]= (char)(to_long(remaind)+'0');487 dummy[0]=numbers[to_long(remaind)]; 487 488 //tmp*=10; tmp+=to_long(remaind); 488 489 … … 505 506 } 506 507 //built up the string in dummy[0] 507 dummy[0]= (char)(to_long(coefficient)+'0');508 dummy[0]=numbers[to_long(coefficient)]; 508 509 strcat(cf_stringtemp,dummy); 509 510 //tmp*=10; tmp+=to_long(coefficient); … … 526 527 527 528 //convert the string to canonicalform using the char*-Constructor 528 return CanonicalForm(cf_stringtemp2 );529 return CanonicalForm(cf_stringtemp2,16); 529 530 //return tmp; 530 531 } -
factory/canonicalform.cc
r2499bf rd07137 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: canonicalform.cc,v 1.3 2 2001-06-18 08:44:35 pfister Exp $ */2 /* $Id: canonicalform.cc,v 1.33 2003-10-15 17:19:39 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 49 49 50 50 //{{{ constructors, destructors, selectors 51 CanonicalForm::CanonicalForm( const char * str ) : value( CFFactory::basic( str) )51 CanonicalForm::CanonicalForm( const char * str, const int base ) : value( CFFactory::basic( str, base ) ) 52 52 { 53 53 } -
factory/canonicalform.h
r2499bf rd07137 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: canonicalform.h,v 1.2 7 2001-06-22 15:57:41Singular Exp $ */2 /* $Id: canonicalform.h,v 1.28 2003-10-15 17:19:39 Singular Exp $ */ 3 3 4 4 #ifndef INCL_CANONICALFORM_H … … 56 56 CF_INLINE CanonicalForm( const Variable & ); 57 57 CF_INLINE CanonicalForm( const Variable &, int ); 58 CanonicalForm( const char * ); // use with caution - does only handle integers !!!58 CanonicalForm( const char *, const int base=10 ); // use with caution - does only handle integers !!! 59 59 60 60 CF_NO_INLINE ~CanonicalForm(); -
factory/cf_factory.cc
r2499bf rd07137 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_factory.cc,v 1. 3 1997-06-19 12:27:13 schmidtExp $ */2 /* $Id: cf_factory.cc,v 1.4 2003-10-15 17:19:40 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 119 119 120 120 InternalCF * 121 CFFactory::basic ( const char * str, int base ) 122 { 123 if ( currenttype == IntegerDomain ) { 124 InternalInteger * dummy = new InternalInteger( str, base ); 125 if ( dummy->is_imm() ) { 126 InternalCF * res = int2imm( dummy->intval() ); 127 delete dummy; 128 return res; 129 } 130 else 131 return dummy; 132 } 133 // else if ( currenttype == RationalDomain ) { 134 // InternalRational * dummy = new InternalRational( str ); 135 // if ( dummy->is_imm() ) { 136 // InternalCF * res = int2imm( dummy->intval() ); 137 // delete dummy; 138 // return res; 139 // } 140 // else 141 // return dummy; 142 // } 143 else if ( currenttype == FiniteFieldDomain ) { 144 InternalInteger * dummy = new InternalInteger( str, base ); 145 InternalCF * res = int2imm_p( dummy->intmod( ff_prime ) ); 146 delete dummy; 147 return res; 148 } 149 else if ( currenttype == GaloisFieldDomain ) { 150 InternalInteger * dummy = new InternalInteger( str, base ); 151 InternalCF * res = int2imm_gf( gf_int2gf( dummy->intmod( ff_prime ) ) ); 152 delete dummy; 153 return res; 154 } 155 else if ( currenttype == PrimePowerDomain ) 156 return new InternalPrimePower( str, base ); 157 else { 158 ASSERT( 0, "illegal basic domain!" ); 159 return 0; 160 } 161 } 162 163 InternalCF * 121 164 CFFactory::basic ( int type, const char * const str ) 122 165 { -
factory/cf_factory.h
r2499bf rd07137 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_factory.h,v 1. 3 2001-11-05 17:07:12Singular Exp $ */2 /* $Id: cf_factory.h,v 1.4 2003-10-15 17:19:40 Singular Exp $ */ 3 3 4 4 #ifndef INCL_CF_FACTORY_H … … 25 25 static InternalCF * basic ( int type, int value ); 26 26 static InternalCF * basic ( const char * str ); 27 static InternalCF * basic ( const char * str, int base ); 27 28 static InternalCF * basic ( int type, const char * const str ); 28 29 static InternalCF * basic ( int type, int value, bool nonimm ); -
factory/int_int.cc
r2499bf rd07137 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: int_int.cc,v 1.1 6 2001-01-24 12:59:36Singular Exp $ */2 /* $Id: int_int.cc,v 1.17 2003-10-15 17:19:40 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 27 27 InternalInteger::InternalInteger( const MP_INT & mpi) : thempi( mpi ) {} 28 28 29 InternalInteger::InternalInteger( const char * str )30 { 31 mpz_init_set_str( &thempi, str, 10);29 InternalInteger::InternalInteger( const char * str, const int base ) 30 { 31 mpz_init_set_str( &thempi, str, base ); 32 32 } 33 33 -
factory/int_int.h
r2499bf rd07137 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: int_int.h,v 1.1 0 2000-09-04 13:31:30 obachmanExp $ */2 /* $Id: int_int.h,v 1.11 2003-10-15 17:19:41 Singular Exp $ */ 3 3 4 4 #ifndef INCL_INT_INT_H … … 58 58 } 59 59 InternalInteger( const int i ); 60 InternalInteger( const char * str );60 InternalInteger( const char * str, const int base=10 ); 61 61 InternalInteger( const MP_INT & ); 62 62 ~InternalInteger(); -
factory/int_pp.cc
r2499bf rd07137 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: int_pp.cc,v 1. 9 1998-06-26 16:14:26 schmidtExp $ */2 /* $Id: int_pp.cc,v 1.10 2003-10-15 17:19:41 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 38 38 InternalPrimePower::InternalPrimePower( const MP_INT & mpi ) : thempi( mpi ) {} 39 39 40 InternalPrimePower::InternalPrimePower( const char * str )41 { 42 mpz_init_set_str( &thempi, str, 10);40 InternalPrimePower::InternalPrimePower( const char * str, const int base ) 41 { 42 mpz_init_set_str( &thempi, str, base ); 43 43 if ( mpz_cmp_si( &thempi, 0 ) < 0 ) { 44 44 mpz_neg( &thempi, &thempi ); -
factory/int_pp.h
r2499bf rd07137 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: int_pp.h,v 1. 3 1997-06-19 12:22:29 schmidtExp $ */2 /* $Id: int_pp.h,v 1.4 2003-10-15 17:19:41 Singular Exp $ */ 3 3 4 4 #ifndef INCL_INT_PP_H … … 36 36 } 37 37 InternalPrimePower( const int i ); 38 InternalPrimePower( const char * str );38 InternalPrimePower( const char * str, const int base=10 ); 39 39 InternalPrimePower( const MP_INT & ); 40 40 ~InternalPrimePower();
Note: See TracChangeset
for help on using the changeset viewer.