Changeset 7b00dbc in git
- Timestamp:
- Feb 25, 2014, 11:49:26 AM (10 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- eeb5b0cee52862b60f2f9f5250185bd15e1f6103
- Parents:
- 4cda398594e14a9c3953996550f1d55f247252fc6776cf84c738527c16538ce2c9d45fdaf0e39c11
- Files:
-
- 3 added
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/ehv.lib
r4cda39 r7b00dbc 538 538 ERROR("// Not implemented for this ordering, please change to global ordering."); 539 539 } 540 540 if (size(I) == 0) { return( ideal(0) ); } 541 541 //Compute the equidimensional radical J of I. 542 542 ideal J = equiRadEHV(I,#); -
Singular/LIB/normal.lib
r6776cf r7b00dbc 925 925 L = insert(L,0,1); 926 926 L[3] = delt; 927 setring(P); 927 928 return(L); 928 929 } -
Singular/LIB/realclassify.lib
r6776cf r7b00dbc 606 606 h = f-jet(f, 2)-corank_part(f); 607 607 } 608 poly g = cleardenom(f-jet(f, 2)); 608 poly g = f-jet(f, 2); 609 poly lead_g = leadcoef(g); 610 if(lead_g > 0) 611 { 612 g = g/lead_g; 613 } 614 if(lead_g < 0) 615 { 616 g = -g/lead_g; 617 } 609 618 610 619 return(list(c, lambda, k, g)); -
Singular/extra.cc
r6776cf r7b00dbc 14 14 #include <misc/auxiliary.h> 15 15 16 #define SI_DONT_HAVE_GLOBAL_VARS17 16 #include <factory/factory.h> 18 17 … … 77 76 #include <kernel/shiftgb.h> 78 77 #include <kernel/linearAlgebra.h> 78 79 #include <kernel/hutil.h> 79 80 80 81 // for tests of t-rep-GB … … 3153 3154 else 3154 3155 #endif 3156 /*==================== Roune Hilb =================*/ 3157 if (strcmp(sys_cmd, "hilbroune") == 0) 3158 { 3159 ideal I; 3160 if ((h!=NULL) && (h->Typ()==IDEAL_CMD)) 3161 { 3162 I=(ideal)h->CopyD(); 3163 slicehilb(I); 3164 } 3165 else return TRUE; 3166 return FALSE; 3167 } 3155 3168 /*==================== minor =================*/ 3156 3169 if (strcmp(sys_cmd, "minor")==0) -
Singular/feOpt.cc
r6776cf r7b00dbc 14 14 #include <stdlib.h> 15 15 16 #define SI_DONT_HAVE_GLOBAL_VARS17 16 #include <factory/factory.h> 18 17 -
Singular/interpolation.cc
r6776cf r7b00dbc 8 8 #include <kernel/mod2.h> 9 9 #include <misc/options.h> 10 #define SI_DONT_HAVE_GLOBAL_VARS 11 # include <factory/factory.h> 10 #include <factory/factory.h> 12 11 13 12 #include <misc/intvec.h> -
Singular/iparith.cc
r6776cf r7b00dbc 2495 2495 { 2496 2496 res->data=(char *)idSect((ideal)u->Data(),(ideal)v->Data()); 2497 setFlag(res,FLAG_STD);2498 2497 return FALSE; 2499 2498 } -
Singular/ipassign.cc
r6776cf r7b00dbc 248 248 } 249 249 250 assume( currRing->cf->extRing->qideal == NULL );251 252 250 AlgExtInfo A; 253 251 254 252 A.r = rCopy(currRing->cf->extRing); // Copy ground field! 253 // if minpoly was already set: 254 if( currRing->cf->extRing->qideal != NULL ) id_Delete(&(A.r->qideal),A.r); 255 255 ideal q = idInit(1,1); 256 if ((p==NULL) ||(DEN((fraction)(p)) != NULL) ||(NUM((fraction)p)==NULL)) 257 { 258 Werror("Could not construct the alg. extension: minpoly==0"); 259 // cleanup A: TODO 260 rDelete( A.r ); 261 return TRUE; 262 } 256 263 257 264 assume( DEN((fraction)(p)) == NULL ); // minpoly must be a fraction with poly numerator...!! -
Singular/ipshell.cc
r6776cf r7b00dbc 15 15 #include <misc/mylimits.h> 16 16 17 #define SI_DONT_HAVE_GLOBAL_VARS18 17 #include <factory/factory.h> 19 18 … … 2199 2198 lists v=(lists)L->m[1].Data(); 2200 2199 R->N = v->nr+1; 2200 if (R->N<=0) 2201 { 2202 WerrorS("no ring variables"); 2203 goto rCompose_err; 2204 } 2201 2205 R->names = (char **)omAlloc0(R->N * sizeof(char_ptr)); 2202 2206 int i; -
Singular/janet.cc
r6776cf r7b00dbc 793 793 } 794 794 795 #if 0 795 796 static void go_right(NodeM *current,poly_function disp) 796 797 { … … 803 804 } 804 805 805 #if 0806 806 void ForEach(TreeM *t,poly_function disp) 807 807 { -
Singular/libparse.cc
r6776cf r7b00dbc 1062 1062 #ifdef STANDALONE_PARSER 1063 1063 #include <Singular/utils.h> 1064 1065 // int initializeGMP(){ return 1; } // NEEDED FOR MAIN APP. LINKING!!!1066 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???1067 1064 1068 1065 #define HAVE_LIBPARSER -
Singular/libparse.ll
r6776cf r7b00dbc 10 10 #ifdef STANDALONE_PARSER 11 11 #include <Singular/utils.h> 12 13 // int initializeGMP(){ return 1; } // NEEDED FOR MAIN APP. LINKING!!!14 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???15 12 16 13 #define HAVE_LIBPARSER -
Singular/misc_ip.cc
r6776cf r7b00dbc 20 20 #include <Singular/si_signals.h> 21 21 22 #define SI_DONT_HAVE_GLOBAL_VARS23 22 #include <factory/factory.h> 24 23 … … 402 401 #undef HAVE_DYN_RL 403 402 #endif 404 405 #define SI_DONT_HAVE_GLOBAL_VARS406 403 407 404 //#ifdef HAVE_LIBPARSER … … 1267 1264 errorreported = 0; 1268 1265 } 1269 1270 /*1271 #ifdef LIBSINGULAR1272 // the init routines of factory need mmInit1273 int mmInit( void )1274 {1275 return 1;1276 }1277 #endif1278 */ -
Singular/mmalloc.h
r6776cf r7b00dbc 10 10 #include <stdlib.h> 11 11 12 int mmInit(void);13 12 #undef reallocSize 14 13 #undef freeSize -
Singular/subexpr.cc
r6776cf r7b00dbc 954 954 return INT_CMD; 955 955 case VMINPOLY: 956 data=NULL; 956 957 return NUMBER_CMD; 957 958 case VNOETHER: 959 data=NULL; 958 960 return POLY_CMD; 959 961 //case COMMAND: -
Singular/test.cc
r6776cf r7b00dbc 52 52 53 53 #include <polys/clapsing.h> 54 55 56 // int initializeGMP(){ return 1; } // NEEDED FOR MAIN APP. LINKING!!!57 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???58 54 59 55 -
Singular/tesths.cc
r6776cf r7b00dbc 17 17 #include <misc/options.h> 18 18 19 #define SI_DONT_HAVE_GLOBAL_VARS20 19 #include <factory/factory.h> 21 20 … … 53 52 extern int siInit(char *); 54 53 55 // int initializeGMP(){ return 1; }56 57 54 int mmInit( void ) 58 55 { … … 73 70 char** argv) /* parameter array */ 74 71 { 75 //mmInit();72 mmInit(); 76 73 // Don't worry: ifdef OM_NDEBUG, then all these calls are undef'ed 77 74 omInitRet_2_Info(argv[0]); -
Singular/walk.cc
r6776cf r7b00dbc 437 437 #endif 438 438 439 #ifdef CHECK_IDEAL_MWALK 439 440 static void idString(ideal L, const char* st) 440 441 { … … 448 449 Print(" %s;", pString(L->m[nL-1])); 449 450 } 450 451 //unused 452 //#if 0 451 #endif 452 453 #if defined(CHECK_IDEAL_MWALK) || defined(ENDWALKS) 453 454 static void headidString(ideal L, char* st) 454 455 { … … 462 463 Print(" %s;", pString(pHead(L->m[nL-1]))); 463 464 } 464 //#endif 465 466 //unused 467 //#if 0 465 #endif 466 467 #if defined(CHECK_IDEAL_MWALK) || defined(ENDWALKS) 468 468 static void idElements(ideal L, char* st) 469 469 { … … 503 503 omFree(K); 504 504 } 505 //#endif505 #endif 506 506 507 507 … … 4611 4611 clock_t tim; 4612 4612 nstep=0; 4613 int i, k,nwalk,endwalks = 0;4613 int i,nwalk,endwalks = 0; 4614 4614 int nV = currRing->N; 4615 4615 … … 4696 4696 else 4697 4697 { 4698 NORMAL_GW:4699 4698 #ifndef BUCHBERGER_ALG 4700 4699 if(isNolVector(curr_weight) == 0) … … 4778 4777 } 4779 4778 4780 NEXT_VECTOR:4779 //NEXT_VECTOR: 4781 4780 to = clock(); 4782 4781 //intvec* next_weight = MkInterRedNextWeight(curr_weight,target_weight,G); … … 6790 6789 clock_t tinput = clock(); 6791 6790 #endif 6792 int nsteppert=0, i, k,nV = currRing->N, nwalk=0, npert_tmp=0;6791 int nsteppert=0, i, nV = currRing->N, nwalk=0, npert_tmp=0; 6793 6792 int *npert=(int*)omAlloc(2*nV*sizeof(int)); 6794 6793 ideal Gomega, M,F, G1, Gomega1, Gomega2, M1, F1; -
Tst/Short.lst
r4cda39 r7b00dbc 55 55 Short/bug_54.tst 56 56 Short/bug_55.tst 57 Short/bug_554.tst 57 58 Short/bug_532_s.tst 58 59 Short/bug_538_s.tst -
dyn_modules/bigintm/Makefile.am
r6776cf r7b00dbc 4 4 5 5 if ENABLE_P_PROCS_DYNAMIC 6 #noinst_LTLIBRARIES=bigintm.la7 check_LTLIBRARIES=bigintm.la6 noinst_LTLIBRARIES=bigintm.la 7 # check_LTLIBRARIES=bigintm.la 8 8 9 9 endif -
dyn_modules/callpolymake/Makefile.am
r6776cf r7b00dbc 10 10 11 11 # forcefully enable exceptions for polymake 12 POLYMAKE_CFLAGS = -fexceptions -frtti13 14 12 AM_LDFLAGS = ${PM_LDFLAGS} 15 13 # -release ${PACKAGE_VERSION} … … 24 22 -I${top_srcdir}/libpolys -I${top_builddir}/libpolys \ 25 23 -I${top_builddir}/factory/include $(GMP_CFLAGS) $(PM_INC) $(PM_CFLAGS) \ 26 $(POLYMAKE_C FLAGS) $(FACTORY_CFLAGS)24 $(POLYMAKE_CXXFLAGS) $(FACTORY_CFLAGS) 27 25 28 26 P_PROCS_CPPFLAGS_COMMON = -DDYNAMIC_VERSION 29 27 30 polymake_la_CPPFLAGS = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON} ${POLYMAKE_C FLAGS}31 polymake_la_CXXFLAGS = ${POLYMAKE_C FLAGS}32 polymake_la_CFLAGS = ${POLYMAKE_C FLAGS}28 polymake_la_CPPFLAGS = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON} ${POLYMAKE_CXXFLAGS} 29 polymake_la_CXXFLAGS = ${POLYMAKE_CXXFLAGS} 30 polymake_la_CFLAGS = ${POLYMAKE_CXXFLAGS} 33 31 34 32 if ENABLE_P_PROCS_DYNAMIC -
factory/canonicalform.cc
r6776cf r7b00dbc 23 23 CanonicalForm readCF( ISTREAM& ); 24 24 #endif /* NOSTREAMIO */ 25 26 //{{{ initialization27 int initializeCharacteristic();28 29 #ifdef SINGULAR30 extern int mmInit(void);31 #endif32 33 int34 initCanonicalForm( void )35 {36 static bool initialized = false;37 if ( ! initialized ) {38 #if defined (SINGULAR)39 (void)mmInit();40 #endif41 42 (void)initializeCharacteristic();43 initialized = true;44 }45 return 1;46 }47 //}}}48 25 49 26 //{{{ constructors, destructors, selectors -
factory/canonicalform.h
r6776cf r7b00dbc 56 56 } 57 57 58 59 int initCanonicalForm( void );60 #ifndef SI_DONT_HAVE_GLOBAL_VARS61 static int cf_is_initialized_now = initCanonicalForm();62 #endif63 58 64 59 //{{{ class CanonicalForm -
factory/cf_char.cc
r6776cf r7b00dbc 16 16 static int theCharacteristic = 0; 17 17 static int theDegree = 1; 18 19 int initializeCharacteristic ()20 {21 theCharacteristic = 0;22 theDegree = 1;23 return 1;24 }25 18 26 19 void setCharacteristic( int c ) … … 65 58 } 66 59 67 int getExp()68 {69 return InternalPrimePower::getk();70 }71 72 73 60 int getGFDegree() 74 61 { -
factory/cf_factor.cc
r6776cf r7b00dbc 41 41 #endif 42 42 43 int getExp(); /* cf_char.cc */44 45 43 //static bool isUnivariateBaseDomain( const CanonicalForm & f ) 46 44 //{ -
factory/cf_factory.cc
r6776cf r7b00dbc 276 276 else if ( symmetric ) { 277 277 mpz_init( dummy ); 278 InternalPrimePower::initialize(); 278 279 if ( mpz_cmp( InternalPrimePower::primepowhalf, InternalPrimePower::MPI( value ) ) < 0 ) 279 280 mpz_sub( dummy, InternalPrimePower::MPI( value ), InternalPrimePower::primepow ); -
factory/int_pp.cc
r6776cf r7b00dbc 17 17 int InternalPrimePower::prime; 18 18 int InternalPrimePower::exp; 19 int InternalPrimePower::initialized = InternalPrimePower::initialize();19 bool InternalPrimePower::initialized = false; 20 20 21 21 … … 27 27 InternalPrimePower::InternalPrimePower( const int i ) 28 28 { 29 initialize(); 29 30 mpz_init_set_si( thempi, i ); 30 31 if ( mpz_cmp_si( thempi, 0 ) < 0 ) { … … 41 42 InternalPrimePower::InternalPrimePower( const char * str, const int base ) 42 43 { 44 initialize(); 43 45 mpz_init_set_str( thempi, str, base ); 44 46 if ( mpz_cmp_si( thempi, 0 ) < 0 ) { … … 76 78 } 77 79 78 int InternalPrimePower::initialize() 79 { 80 void InternalPrimePower::initialize() 81 { 82 if (initialized) return; 80 83 mpz_init_set_si( primepow, 3 ); 81 84 mpz_init_set_si( primepowhalf, 1 ); 82 85 prime = 3; 83 86 exp = 1; 84 return 1;87 initialized = true; 85 88 } 86 89 … … 89 92 { 90 93 ASSERT( p > 1 && k > 0, "illegal prime power" ); 94 initialize(); 91 95 if ( p != prime || k != exp ) { 92 96 mpz_set_si( primepow, p ); … … 96 100 exp = k; 97 101 } 98 }99 100 int101 InternalPrimePower::getp()102 {103 return prime;104 }105 106 int107 InternalPrimePower::getk()108 {109 return exp;110 102 } 111 103 -
factory/int_pp.h
r6776cf r7b00dbc 27 27 private: 28 28 mpz_t thempi; 29 static intinitialized;29 static bool initialized; 30 30 static int prime; 31 31 static int exp; 32 32 static mpz_t primepow; 33 33 static mpz_t primepowhalf; 34 static intinitialize();34 static void initialize(); 35 35 static mpz_ptr MPI( const InternalCF * const c ); 36 36 public: … … 56 56 57 57 static void setPrimePower( int p, int k ); 58 static int getp();59 static int getk();60 58 61 59 bool is_imm() const; -
factory/test.cc
r6776cf r7b00dbc 2 2 #include <resources/feFopen.h> 3 3 #include "cf_assert.h" 4 5 int mmInit(void) {6 #ifdef SINGULAR7 // this is a hack to make linker baheave on Mac OS X 10.6.8 / 64 bit8 // since otherwise both debug and release DYNAMIC tests failed there with:9 /*10 dyld: lazy symbol binding failed: Symbol not found: __Z7feFopenPKcS0_11 Referenced from: ...BUILDDIR/factory/.libs/libfactory_g-3.1.3.dylib12 Expected in: flat namespace13 14 dyld: Symbol not found: __Z7feFopenPKcS0_15 Referenced from: ...BUILDDIR/factory/.libs/libfactory_g-3.1.3.dylib16 Expected in: flat namespace17 */18 const int f = (int)(long)(void*)feFopen;19 return (f ^ f) + 1;20 #else21 return 1;22 #endif23 }24 4 25 5 int test2 (int p) -
kernel/GMPrat.cc
r6776cf r7b00dbc 31 31 32 32 // ---------------------------------------------------------------------------- 33 // Miscellaneous34 // ----------------------------------------------------------------------------35 36 Rational Rational::save; // dummy variable37 38 // ----------------------------------------------------------------------------39 33 // disconnect a rational from its reference 40 34 // ---------------------------------------------------------------------------- 41 35 42 void Rational::disconnect( 36 void Rational::disconnect() 43 37 { 44 38 if( p->n>1) 45 39 { 40 rep *old_p = p; 46 41 p->n--; 47 42 p = new rep; 48 } 49 else 50 { 51 mpq_clear(p->rat); 52 } 53 mpq_init(p->rat); 43 mpq_init(p->rat); 44 mpq_set(p->rat, old_p->rat); 45 } 54 46 } 55 47 … … 116 108 Rational& Rational::operator=(int a) 117 109 { 118 disconnect(); 110 if( p->n>1) 111 { 112 p->n--; 113 p = new rep; 114 mpq_init(p->rat); 115 } 119 116 mpq_set_si(p->rat,(long) a,1); 120 117 return *this; … … 223 220 Rational::operator+=(const Rational &a) 224 221 { 225 mpq_set(save.p->rat,p->rat); 226 disconnect(); 227 mpq_add(p->rat,save.p->rat,a.p->rat); 222 disconnect(); 223 mpq_add(p->rat,p->rat,a.p->rat); 228 224 return *this; 229 225 } … … 232 228 Rational::operator-=(const Rational &a) 233 229 { 234 mpq_set(save.p->rat,p->rat); 235 disconnect(); 236 mpq_sub(p->rat,save.p->rat,a.p->rat); 230 disconnect(); 231 mpq_sub(p->rat,p->rat,a.p->rat); 237 232 return *this; 238 233 } … … 241 236 Rational::operator*=(const Rational &a) 242 237 { 243 mpq_set(save.p->rat,p->rat); 244 disconnect(); 245 mpq_mul(p->rat,save.p->rat,a.p->rat); 238 disconnect(); 239 mpq_mul(p->rat,p->rat,a.p->rat); 246 240 return *this; 247 241 } … … 250 244 Rational::operator/=(const Rational &a) 251 245 { 252 mpq_set(save.p->rat,p->rat); 253 disconnect(); 254 mpq_div(p->rat,save.p->rat,a.p->rat); 246 disconnect(); 247 mpq_div(p->rat,p->rat,a.p->rat); 255 248 return *this; 256 249 } … … 263 256 Rational::operator++() 264 257 { 265 mpq_set(save.p->rat,p->rat); 266 *this=1; 267 mpq_add(p->rat,p->rat,save.p->rat); 258 disconnect(); 259 mpz_add(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat)); 268 260 return *this; 269 261 } … … 274 266 Rational erg(*this); 275 267 276 mpq_set(save.p->rat,p->rat); 277 *this=1; 278 mpq_add(p->rat,p->rat,save.p->rat); 268 disconnect(); 269 mpz_add(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat)); 279 270 return erg; 280 271 } … … 283 274 Rational::operator--() 284 275 { 285 mpq_set(save.p->rat,p->rat); 286 *this=1; 287 mpq_sub(p->rat,save.p->rat,p->rat); 276 disconnect(); 277 mpz_sub(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat)); 288 278 return *this; 289 279 } … … 294 284 Rational erg(*this); 295 285 296 mpq_set(save.p->rat,p->rat); 297 *this=1; 298 mpq_sub(p->rat,save.p->rat,p->rat); 286 disconnect(); 287 mpz_sub(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat)); 299 288 return erg; 300 289 } -
kernel/GMPrat.h
r6776cf r7b00dbc 22 22 23 23 rep *p; 24 static Rational save;25 24 26 25 void disconnect(); -
kernel/fglmcomb.cc
r6776cf r7b00dbc 13 13 #include <kernel/mod2.h> 14 14 15 #define SI_DONT_HAVE_GLOBAL_VARS16 15 #include <factory/factory.h> 17 16 #include <misc/options.h> -
kernel/hilb.cc
r6776cf r7b00dbc 17 17 #include <kernel/hutil.h> 18 18 #include <kernel/stairc.h> 19 //ADICHANGES: 20 #include <kernel/ideals.h> 21 #include <kernel/kstd1.h> 22 #include<gmp.h> 23 #include<vector> 24 19 25 20 26 static int **Qpol; 21 27 static int *Q0, *Ql; 22 28 static int hLength; 29 23 30 24 31 static int hMinModulweight(intvec *modulweight) … … 213 220 } 214 221 } 215 222 // ---------------------------------- ADICHANGES --------------------------------------------- 223 //!!!!!!!!!!!!!!!!!!!!! Just for Monomial Ideals !!!!!!!!!!!!!!!!!!!!!!!!!!!! 224 225 //returns the degree of the monomial 226 static int DegMon(poly p) 227 { 228 #if 1 229 int i,deg; 230 deg = 0; 231 for(i=1;i<=currRing->N;i++) 232 { 233 deg = deg + p_GetExp(p, i, currRing); 234 } 235 return(deg); 236 #else 237 return(p_Deg(p, currRing)); 238 #endif 239 } 240 241 //Tests if the ideal is sorted by degree 242 static bool idDegSortTest(ideal I) 243 { 244 if((I == NULL)||(idIs0(I))) 245 { 246 return(TRUE); 247 } 248 for(int i = 0; i<IDELEMS(I)-1; i++) 249 { 250 if(DegMon(I->m[i])>DegMon(I->m[i+1])) 251 { 252 idPrint(I); 253 Werror("Ideal is not deg sorted!!"); 254 return(FALSE); 255 } 256 } 257 return(TRUE); 258 } 259 260 //adds the new polynomial at the coresponding position 261 //and simplifies the ideal 262 static ideal SortByDeg_p(ideal I, poly p) 263 { 264 int i,j; 265 if((I == NULL) || (idIs0(I))) 266 { 267 ideal res = idInit(1,1); 268 res->m[0] = p; 269 return(res); 270 } 271 idSkipZeroes(I); 272 #if 1 273 for(i = 0; (i<IDELEMS(I)) && (DegMon(I->m[i])<=DegMon(p)); i++) 274 { 275 if(p_DivisibleBy( I->m[i],p, currRing)) 276 { 277 return(I); 278 } 279 } 280 for(i = IDELEMS(I)-1; (i>=0) && (DegMon(I->m[i])>=DegMon(p)); i--) 281 { 282 if(p_DivisibleBy(p,I->m[i], currRing)) 283 { 284 I->m[i] = NULL; 285 } 286 } 287 if(idIs0(I)) 288 { 289 idSkipZeroes(I); 290 I->m[0] = p; 291 return(I); 292 } 293 #endif 294 idSkipZeroes(I); 295 //First I take the case when all generators have the same degree 296 if(DegMon(I->m[0]) == DegMon(I->m[IDELEMS(I)-1])) 297 { 298 if(DegMon(p)<DegMon(I->m[0])) 299 { 300 idInsertPoly(I,p); 301 idSkipZeroes(I); 302 for(i=IDELEMS(I)-1;i>=1; i--) 303 { 304 I->m[i] = I->m[i-1]; 305 } 306 I->m[0] = p; 307 return(I); 308 } 309 if(DegMon(p)>=DegMon(I->m[IDELEMS(I)-1])) 310 { 311 idInsertPoly(I,p); 312 idSkipZeroes(I); 313 return(I); 314 } 315 } 316 if(DegMon(p)<=DegMon(I->m[0])) 317 { 318 idInsertPoly(I,p); 319 idSkipZeroes(I); 320 for(i=IDELEMS(I)-1;i>=1; i--) 321 { 322 I->m[i] = I->m[i-1]; 323 } 324 I->m[0] = p; 325 return(I); 326 } 327 if(DegMon(p)>=DegMon(I->m[IDELEMS(I)-1])) 328 { 329 idInsertPoly(I,p); 330 idSkipZeroes(I); 331 return(I); 332 } 333 for(i = IDELEMS(I)-2; ;) 334 { 335 if(DegMon(p)==DegMon(I->m[i])) 336 { 337 idInsertPoly(I,p); 338 idSkipZeroes(I); 339 for(j = IDELEMS(I)-1; j>=i+1;j--) 340 { 341 I->m[j] = I->m[j-1]; 342 } 343 I->m[i] = p; 344 return(I); 345 } 346 if(DegMon(p)>DegMon(I->m[i])) 347 { 348 idInsertPoly(I,p); 349 idSkipZeroes(I); 350 for(j = IDELEMS(I)-1; j>=i+2;j--) 351 { 352 I->m[j] = I->m[j-1]; 353 } 354 I->m[i+1] = p; 355 return(I); 356 } 357 i--; 358 } 359 } 360 361 //it sorts the ideal by the degrees 362 static ideal SortByDeg(ideal I) 363 { 364 if(idIs0(I)) 365 { 366 return(I); 367 } 368 idSkipZeroes(I); 369 int i; 370 ideal res; 371 idSkipZeroes(I); 372 res = idInit(1,1); 373 res->m[0] = poly(0); 374 for(i = 0; i<=IDELEMS(I)-1;i++) 375 { 376 res = SortByDeg_p(res, I->m[i]); 377 } 378 idSkipZeroes(res); 379 //idDegSortTest(res); 380 return(res); 381 } 382 383 //idQuot(I,p) for I monomial ideal, p a ideal with a single monomial. 384 ideal idQuotMon(ideal Iorig, ideal p) 385 { 386 if(idIs0(Iorig)) 387 { 388 ideal res = idInit(1,1); 389 res->m[0] = poly(0); 390 return(res); 391 } 392 if(idIs0(p)) 393 { 394 ideal res = idInit(1,1); 395 res->m[0] = pOne(); 396 return(res); 397 } 398 ideal I = idCopy(Iorig); 399 ideal res = idInit(IDELEMS(I),1); 400 int i,j; 401 int dummy; 402 for(i = 0; i<IDELEMS(I); i++) 403 { 404 res->m[i] = p_Copy(I->m[i], currRing); 405 for(j = 1; (j<=currRing->N) ; j++) 406 { 407 dummy = p_GetExp(p->m[0], j, currRing); 408 if(dummy > 0) 409 { 410 if(p_GetExp(I->m[i], j, currRing) < dummy) 411 { 412 p_SetExp(res->m[i], j, 0, currRing); 413 } 414 else 415 { 416 p_SetExp(res->m[i], j, p_GetExp(I->m[i], j, currRing) - dummy, currRing); 417 } 418 } 419 } 420 p_Setm(res->m[i], currRing); 421 if(DegMon(res->m[i]) == DegMon(I->m[i])) 422 { 423 res->m[i] = NULL; 424 } 425 else 426 { 427 I->m[i] = NULL; 428 } 429 } 430 idSkipZeroes(res); 431 idSkipZeroes(I); 432 if(!idIs0(res)) 433 { 434 for(i = 0; i<=IDELEMS(res)-1; i++) 435 { 436 I = SortByDeg_p(I,res->m[i]); 437 } 438 } 439 //idDegSortTest(I); 440 return(I); 441 } 442 443 //id_Add for monomials 444 static ideal idAddMon(ideal I, ideal p) 445 { 446 #if 1 447 I = SortByDeg_p(I,p->m[0]); 448 #else 449 I = id_Add(I,p,currRing); 450 #endif 451 //idSkipZeroes(I); 452 return(I); 453 } 454 455 //searches for a variable that is not yet used (assumes that the ideal is sqrfree) 456 static poly ChoosePVar (ideal I) 457 { 458 bool flag=TRUE; 459 int i,j; 460 poly res; 461 for(i=1;i<=currRing->N;i++) 462 { 463 flag=TRUE; 464 for(j=IDELEMS(I)-1;(j>=0)&&(flag);j--) 465 { 466 if(p_GetExp(I->m[j], i, currRing)>0) 467 { 468 flag=FALSE; 469 } 470 } 471 472 if(flag == TRUE) 473 { 474 res = p_ISet(1, currRing); 475 p_SetExp(res, i, 1, currRing); 476 p_Setm(res,currRing); 477 return(res); 478 } 479 else 480 { 481 p_Delete(&res, currRing); 482 } 483 } 484 return(NULL); //i.e. it is the maximal ideal 485 } 486 487 //choice XL: last entry divided by x (xy10z15 -> y9z14) 488 static poly ChoosePXL(ideal I) 489 { 490 int i,j,dummy=0; 491 poly m; 492 for(i = IDELEMS(I)-1; (i>=0) && (dummy == 0); i--) 493 { 494 for(j = 1; (j<=currRing->N) && (dummy == 0); j++) 495 { 496 if(p_GetExp(I->m[i],j, currRing)>1) 497 { 498 dummy = 1; 499 } 500 } 501 } 502 m = p_Copy(I->m[i+1],currRing); 503 for(j = 1; j<=currRing->N; j++) 504 { 505 dummy = p_GetExp(m,j,currRing); 506 if(dummy >= 1) 507 { 508 p_SetExp(m, j, dummy-1, currRing); 509 } 510 } 511 if(!p_IsOne(m, currRing)) 512 { 513 p_Setm(m, currRing); 514 return(m); 515 } 516 m = ChoosePVar(I); 517 return(m); 518 } 519 520 //choice XF: first entry divided by x (xy10z15 -> y9z14) 521 static poly ChoosePXF(ideal I) 522 { 523 int i,j,dummy=0; 524 poly m; 525 for(i =0 ; (i<=IDELEMS(I)-1) && (dummy == 0); i++) 526 { 527 for(j = 1; (j<=currRing->N) && (dummy == 0); j++) 528 { 529 if(p_GetExp(I->m[i],j, currRing)>1) 530 { 531 dummy = 1; 532 } 533 } 534 } 535 m = p_Copy(I->m[i-1],currRing); 536 for(j = 1; j<=currRing->N; j++) 537 { 538 dummy = p_GetExp(m,j,currRing); 539 if(dummy >= 1) 540 { 541 p_SetExp(m, j, dummy-1, currRing); 542 } 543 } 544 if(!p_IsOne(m, currRing)) 545 { 546 p_Setm(m, currRing); 547 return(m); 548 } 549 m = ChoosePVar(I); 550 return(m); 551 } 552 553 //choice OL: last entry the first power (xy10z15 -> xy9z15) 554 static poly ChoosePOL(ideal I) 555 { 556 int i,j,dummy; 557 poly m; 558 for(i = IDELEMS(I)-1;i>=0;i--) 559 { 560 m = p_Copy(I->m[i],currRing); 561 for(j=1;j<=currRing->N;j++) 562 { 563 dummy = p_GetExp(m,j,currRing); 564 if(dummy > 0) 565 { 566 p_SetExp(m,j,dummy-1,currRing); 567 p_Setm(m,currRing); 568 } 569 } 570 if(!p_IsOne(m, currRing)) 571 { 572 return(m); 573 } 574 else 575 { 576 p_Delete(&m,currRing); 577 } 578 } 579 m = ChoosePVar(I); 580 return(m); 581 } 582 583 //choice OF: first entry the first power (xy10z15 -> xy9z15) 584 static poly ChoosePOF(ideal I) 585 { 586 int i,j,dummy; 587 poly m; 588 for(i = 0 ;i<=IDELEMS(I)-1;i++) 589 { 590 m = p_Copy(I->m[i],currRing); 591 for(j=1;j<=currRing->N;j++) 592 { 593 dummy = p_GetExp(m,j,currRing); 594 if(dummy > 0) 595 { 596 p_SetExp(m,j,dummy-1,currRing); 597 p_Setm(m,currRing); 598 } 599 } 600 if(!p_IsOne(m, currRing)) 601 { 602 return(m); 603 } 604 else 605 { 606 p_Delete(&m,currRing); 607 } 608 } 609 m = ChoosePVar(I); 610 return(m); 611 } 612 613 //choice VL: last entry the first variable with power (xy10z15 -> y) 614 static poly ChoosePVL(ideal I) 615 { 616 int i,j,dummy; 617 bool flag = TRUE; 618 poly m = p_ISet(1,currRing); 619 for(i = IDELEMS(I)-1;(i>=0) && (flag);i--) 620 { 621 flag = TRUE; 622 for(j=1;(j<=currRing->N) && (flag);j++) 623 { 624 dummy = p_GetExp(I->m[i],j,currRing); 625 if(dummy >= 2) 626 { 627 p_SetExp(m,j,1,currRing); 628 p_Setm(m,currRing); 629 flag = FALSE; 630 } 631 } 632 if(!p_IsOne(m, currRing)) 633 { 634 return(m); 635 } 636 } 637 m = ChoosePVar(I); 638 return(m); 639 } 640 641 //choice VF: first entry the first variable with power (xy10z15 -> y) 642 static poly ChoosePVF(ideal I) 643 { 644 int i,j,dummy; 645 bool flag = TRUE; 646 poly m = p_ISet(1,currRing); 647 for(i = 0;(i<=IDELEMS(I)-1) && (flag);i++) 648 { 649 flag = TRUE; 650 for(j=1;(j<=currRing->N) && (flag);j++) 651 { 652 dummy = p_GetExp(I->m[i],j,currRing); 653 if(dummy >= 2) 654 { 655 p_SetExp(m,j,1,currRing); 656 p_Setm(m,currRing); 657 flag = FALSE; 658 } 659 } 660 if(!p_IsOne(m, currRing)) 661 { 662 return(m); 663 } 664 } 665 m = ChoosePVar(I); 666 return(m); 667 } 668 669 //choice JL: last entry just variable with power (xy10z15 -> y10) 670 static poly ChoosePJL(ideal I) 671 { 672 int i,j,dummy; 673 bool flag = TRUE; 674 poly m = p_ISet(1,currRing); 675 for(i = IDELEMS(I)-1;(i>=0) && (flag);i--) 676 { 677 flag = TRUE; 678 for(j=1;(j<=currRing->N) && (flag);j++) 679 { 680 dummy = p_GetExp(I->m[i],j,currRing); 681 if(dummy >= 2) 682 { 683 p_SetExp(m,j,dummy-1,currRing); 684 p_Setm(m,currRing); 685 flag = FALSE; 686 } 687 } 688 if(!p_IsOne(m, currRing)) 689 { 690 return(m); 691 } 692 } 693 m = ChoosePVar(I); 694 return(m); 695 } 696 697 //choice JF: last entry just variable with power -1 (xy10z15 -> y9) 698 static poly ChoosePJF(ideal I) 699 { 700 int i,j,dummy; 701 bool flag = TRUE; 702 poly m = p_ISet(1,currRing); 703 for(i = 0;(i<=IDELEMS(I)-1) && (flag);i++) 704 { 705 flag = TRUE; 706 for(j=1;(j<=currRing->N) && (flag);j++) 707 { 708 dummy = p_GetExp(I->m[i],j,currRing); 709 if(dummy >= 2) 710 { 711 p_SetExp(m,j,dummy-1,currRing); 712 p_Setm(m,currRing); 713 flag = FALSE; 714 } 715 } 716 if(!p_IsOne(m, currRing)) 717 { 718 return(m); 719 } 720 } 721 m = ChoosePVar(I); 722 return(m); 723 } 724 725 //chooses 1 \neq p \not\in S. This choice should be made optimal 726 static poly ChooseP(ideal I) 727 { 728 poly m; 729 // TEST TO SEE WHICH ONE IS BETTER 730 //m = ChoosePXL(I); 731 //m = ChoosePXF(I); 732 //m = ChoosePOL(I); 733 //m = ChoosePOF(I); 734 //m = ChoosePVL(I); 735 //m = ChoosePVF(I); 736 m = ChoosePJL(I); 737 //m = ChoosePJF(I); 738 return(m); 739 } 740 741 //searches for a monomial of degree d>=2 and divides it by a variable (result monomial of deg d-1) 742 static poly SearchP(ideal I) 743 { 744 int i,j,exp; 745 poly res; 746 if(DegMon(I->m[IDELEMS(I)-1])<=1) 747 { 748 res = ChoosePVar(I); 749 return(res); 750 } 751 i = IDELEMS(I)-1; 752 res = p_Copy(I->m[i], currRing); 753 for(j=1;j<=currRing->N;j++) 754 { 755 exp = p_GetExp(I->m[i], j, currRing); 756 if(exp > 0) 757 { 758 p_SetExp(res, j, exp - 1, currRing); 759 p_Setm(res,currRing); 760 return(res); 761 } 762 } 763 } 764 765 //test if the ideal is of the form (x1, ..., xr) 766 static bool JustVar(ideal I) 767 { 768 #if 0 769 int i,j; 770 bool foundone; 771 for(i=0;i<=IDELEMS(I)-1;i++) 772 { 773 foundone = FALSE; 774 for(j = 1;j<=currRing->N;j++) 775 { 776 if(p_GetExp(I->m[i], j, currRing)>0) 777 { 778 if(foundone == TRUE) 779 { 780 return(FALSE); 781 } 782 foundone = TRUE; 783 } 784 } 785 } 786 return(TRUE); 787 #else 788 if(DegMon(I->m[IDELEMS(I)-1])>1) 789 { 790 return(FALSE); 791 } 792 return(TRUE); 793 #endif 794 } 795 796 //computes the Euler Characteristic of the ideal 797 static void eulerchar (ideal I, int variables, mpz_ptr ec) 798 { 799 loop 800 { 801 mpz_t dummy; 802 if(JustVar(I) == TRUE) 803 { 804 if(IDELEMS(I) == variables) 805 { 806 mpz_init(dummy); 807 if((variables % 2) == 0) 808 {mpz_set_si(dummy, 1);} 809 else 810 {mpz_set_si(dummy, -1);} 811 mpz_add(ec, ec, dummy); 812 } 813 //mpz_clear(dummy); 814 return; 815 } 816 ideal p = idInit(1,1); 817 p->m[0] = SearchP(I); 818 //idPrint(I); 819 //idPrint(p); 820 //printf("\nNow get in idQuotMon\n"); 821 ideal Ip = idQuotMon(I,p); 822 //idPrint(Ip); 823 //Ip = SortByDeg(Ip); 824 int i,howmanyvarinp = 0; 825 for(i = 1;i<=currRing->N;i++) 826 { 827 if(p_GetExp(p->m[0],i,currRing)>0) 828 { 829 howmanyvarinp++; 830 } 831 } 832 eulerchar(Ip, variables-howmanyvarinp, ec); 833 id_Delete(&Ip, currRing); 834 I = idAddMon(I,p); 835 } 836 } 837 838 //tests if an ideal is Square Free, if no, returns the variable which appears at powers >1 839 static poly SqFree (ideal I) 840 { 841 int i,j; 842 bool flag=TRUE; 843 poly notsqrfree = NULL; 844 if(DegMon(I->m[IDELEMS(I)-1])<=1) 845 { 846 return(notsqrfree); 847 } 848 for(i=IDELEMS(I)-1;(i>=0)&&(flag);i--) 849 { 850 for(j=1;(j<=currRing->N)&&(flag);j++) 851 { 852 if(p_GetExp(I->m[i],j,currRing)>1) 853 { 854 flag=FALSE; 855 notsqrfree = p_ISet(1,currRing); 856 p_SetExp(notsqrfree,j,1,currRing); 857 } 858 } 859 } 860 if(notsqrfree != NULL) 861 { 862 p_Setm(notsqrfree,currRing); 863 } 864 return(notsqrfree); 865 } 866 867 //checks if a polynomial is in I 868 static bool IsIn(poly p, ideal I) 869 { 870 //assumes that I is ordered by degree 871 if(idIs0(I)) 872 { 873 if(p==poly(0)) 874 { 875 return(TRUE); 876 } 877 else 878 { 879 return(FALSE); 880 } 881 } 882 if(p==poly(0)) 883 { 884 return(FALSE); 885 } 886 int i,j; 887 bool flag; 888 for(i = 0;i<IDELEMS(I);i++) 889 { 890 flag = TRUE; 891 for(j = 1;(j<=currRing->N) &&(flag);j++) 892 { 893 if(p_GetExp(p, j, currRing)<p_GetExp(I->m[i], j, currRing)) 894 { 895 flag = FALSE; 896 } 897 } 898 if(flag) 899 { 900 return(TRUE); 901 } 902 } 903 return(FALSE); 904 } 905 906 //computes the lcm of min I, I monomial ideal 907 static poly LCMmon(ideal I) 908 { 909 if(idIs0(I)) 910 { 911 return(NULL); 912 } 913 poly m; 914 int dummy,i,j; 915 m = p_ISet(1,currRing); 916 for(i=1;i<=currRing->N;i++) 917 { 918 dummy=0; 919 for(j=IDELEMS(I)-1;j>=0;j--) 920 { 921 if(p_GetExp(I->m[j],i,currRing) > dummy) 922 { 923 dummy = p_GetExp(I->m[j],i,currRing); 924 } 925 } 926 p_SetExp(m,i,dummy,currRing); 927 } 928 p_Setm(m,currRing); 929 return(m); 930 } 931 932 //the Roune Slice Algorithm 933 void rouneslice(ideal I, ideal S, poly q, poly x, int &prune, int &moreprune, int &steps, int &NNN, mpz_ptr &hilbertcoef, int* &hilbpower) 934 { 935 loop 936 { 937 (steps)++; 938 int i,j; 939 int dummy; 940 poly m; 941 ideal p, koszsimp; 942 //----------- PRUNING OF S --------------- 943 //S SHOULD IN THIS POINT BE ORDERED BY DEGREE 944 for(i=IDELEMS(S)-1;i>=0;i--) 945 { 946 if(IsIn(S->m[i],I)) 947 { 948 S->m[i]=NULL; 949 prune++; 950 } 951 } 952 idSkipZeroes(S); 953 //---------------------------------------- 954 for(i=IDELEMS(I)-1;i>=0;i--) 955 { 956 m = p_Copy(I->m[i],currRing); 957 for(j=1;j<=currRing->N;j++) 958 { 959 dummy = p_GetExp(m,j,currRing); 960 if(dummy > 0) 961 { 962 p_SetExp(m,j,dummy-1,currRing); 963 } 964 } 965 p_Setm(m, currRing); 966 if(IsIn(m,S)) 967 { 968 I->m[i]=NULL; 969 //printf("\n Deleted, since pi(m) is in S\n");pWrite(m); 970 } 971 } 972 idSkipZeroes(I); 973 //----------- MORE PRUNING OF S ------------ 974 m = LCMmon(I); 975 if(m != NULL) 976 { 977 for(i=0;i<IDELEMS(S);i++) 978 { 979 if(!(p_DivisibleBy(S->m[i], m, currRing))) 980 { 981 S->m[i] = NULL; 982 j++; 983 moreprune++; 984 } 985 else 986 { 987 if(pLmEqual(S->m[i],m)) 988 { 989 S->m[i] = NULL; 990 moreprune++; 991 } 992 } 993 } 994 idSkipZeroes(S); 995 } 996 /*printf("\n---------------------------\n"); 997 printf("\n I\n");idPrint(I); 998 printf("\n S\n");idPrint(S); 999 printf("\n q\n");pWrite(q); 1000 getchar();*/ 1001 1002 if(idIs0(I)) 1003 { 1004 id_Delete(&I, currRing); 1005 id_Delete(&S, currRing); 1006 p_Delete(&m, currRing); 1007 break; 1008 } 1009 m = LCMmon(I); 1010 if(!p_DivisibleBy(x,m, currRing)) 1011 { 1012 //printf("\nx does not divide lcm(I)"); 1013 //printf("\nEmpty set");pWrite(q); 1014 id_Delete(&I, currRing); 1015 id_Delete(&S, currRing); 1016 p_Delete(&m, currRing); 1017 break; 1018 } 1019 m = SqFree(I); 1020 if(m==NULL) 1021 { 1022 //printf("\n Corner: "); 1023 //pWrite(q); 1024 //printf("\n With the facets of the dual simplex:\n"); 1025 //idPrint(I); 1026 mpz_t ec; 1027 mpz_init(ec); 1028 mpz_ptr ec_ptr = ec; 1029 eulerchar(I, currRing->N, ec_ptr); 1030 bool flag = FALSE; 1031 if(NNN==0) 1032 { 1033 hilbertcoef = (mpz_ptr)omAlloc((NNN+1)*sizeof(mpz_t)); 1034 hilbpower = (int*)omAlloc((NNN+1)*sizeof(int)); 1035 mpz_init( &hilbertcoef[NNN]); 1036 mpz_set( &hilbertcoef[NNN], ec); 1037 mpz_clear(ec); 1038 hilbpower[NNN] = DegMon(q); 1039 NNN++; 1040 } 1041 else 1042 { 1043 //I look if the power appears already 1044 for(i = 0;(i<NNN)&&(flag == FALSE)&&(DegMon(q)>=hilbpower[i]);i++) 1045 { 1046 if((hilbpower[i]) == (DegMon(q))) 1047 { 1048 flag = TRUE; 1049 mpz_add(&hilbertcoef[i],&hilbertcoef[i],ec_ptr); 1050 } 1051 } 1052 if(flag == FALSE) 1053 { 1054 hilbertcoef = (mpz_ptr)omRealloc(hilbertcoef, (NNN+1)*sizeof(mpz_t)); 1055 hilbpower = (int*)omRealloc(hilbpower, (NNN+1)*sizeof(int)); 1056 mpz_init(&hilbertcoef[NNN]); 1057 for(j = NNN; j>i; j--) 1058 { 1059 mpz_set(&hilbertcoef[j],&hilbertcoef[j-1]); 1060 hilbpower[j] = hilbpower[j-1]; 1061 } 1062 mpz_set( &hilbertcoef[i], ec); 1063 mpz_clear(ec); 1064 hilbpower[i] = DegMon(q); 1065 NNN++; 1066 } 1067 } 1068 break; 1069 } 1070 m = ChooseP(I); 1071 p = idInit(1,1); 1072 p->m[0] = m; 1073 ideal Ip = idQuotMon(I,p); 1074 ideal Sp = idQuotMon(S,p); 1075 poly pq = pp_Mult_mm(q,m,currRing); 1076 rouneslice(Ip, Sp, pq, x, prune, moreprune, steps, NNN, hilbertcoef,hilbpower); 1077 //id_Delete(&Ip, currRing); 1078 //id_Delete(&Sp, currRing); 1079 S = idAddMon(S,p); 1080 p->m[0]=NULL; 1081 id_Delete(&p, currRing); // p->m[0] was also in S 1082 p_Delete(&pq,currRing); 1083 } 1084 } 1085 1086 //it computes the first hilbert series by means of Roune Slice Algorithm 1087 void slicehilb(ideal I) 1088 { 1089 //printf("Adi changes are here: \n"); 1090 int i, NNN = 0; 1091 int steps = 0, prune = 0, moreprune = 0; 1092 mpz_ptr hilbertcoef; 1093 int *hilbpower; 1094 ideal S = idInit(1,1); 1095 poly q = p_ISet(1,currRing); 1096 ideal X = idInit(1,1); 1097 X->m[0]=p_One(currRing); 1098 for(i=1;i<=currRing->N;i++) 1099 { 1100 p_SetExp(X->m[0],i,1,currRing); 1101 } 1102 p_Setm(X->m[0],currRing); 1103 I = id_Mult(I,X,currRing); 1104 I = SortByDeg(I); 1105 //printf("\n-------------RouneSlice--------------\n"); 1106 rouneslice(I,S,q,X->m[0],prune, moreprune, steps, NNN, hilbertcoef, hilbpower); 1107 //printf("\nIn total Prune got rid of %i elements\n",prune); 1108 //printf("\nIn total More Prune got rid of %i elements\n",moreprune); 1109 //printf("\nSteps of rouneslice: %i\n\n", steps); 1110 mpz_t coefhilb; 1111 mpz_t dummy; 1112 mpz_init(coefhilb); 1113 mpz_init(dummy); 1114 printf("\n// %8d t^0",1); 1115 for(i = 0; i<NNN; i++) 1116 { 1117 if(mpz_sgn(&hilbertcoef[i])!=0) 1118 { 1119 gmp_printf("\n// %8Zd t^%d",&hilbertcoef[i],hilbpower[i]); 1120 } 1121 } 1122 omFreeSize(hilbertcoef, (NNN)*sizeof(mpz_t)); 1123 omFreeSize(hilbpower, (NNN)*sizeof(int)); 1124 //printf("\n-------------------------------------\n"); 1125 } 1126 1127 // -------------------------------- END OF CHANGES ------------------------------------------- 216 1128 static intvec * hSeries(ideal S, intvec *modulweight, 217 1129 int /*notstc*/, intvec *wdegree, ideal Q, ring tailRing) … … 472 1384 } 473 1385 1386 1387 -
kernel/hutil.h
r6776cf r7b00dbc 74 74 void hDegreeSeries(intvec *s1, intvec *s2, int *co, int *mu); 75 75 76 void slicehilb(ideal I); 76 77 #endif -
kernel/khstd.cc
r6776cf r7b00dbc 155 155 #if ADIDEBUG 156 156 PrintS("\nOriginal\n"); 157 int j, l, k;157 int i, j, l, k; 158 158 if (hilb == NULL) 159 159 return; -
kernel/kstdfac.cc
r6776cf r7b00dbc 641 641 } 642 642 643 n->P.pLength=0; 643 644 n->P.p=fac->m[i]; 644 645 n->initEcart(&n->P); -
kernel/kutil.cc
r6776cf r7b00dbc 396 396 if (p_GetExp(p,i,r) > p_GetExp(h,i,r)) return ; // does not divide 397 397 #ifdef HAVE_RINGS 398 ///should check also if the lc is a zero divisor, if it divides all the others 398 // Note: As long as qring j forbidden if j contains integer (i.e. ground rings are 399 // domains), no zerodivisor test needed CAUTION 399 400 if (rField_is_Ring(currRing) && currRing->OrdSgn == -1) 400 401 if(n_DivBy(p_GetCoeff(h,r->cf),lc,r->cf) == 0) … … 725 726 } 726 727 727 if ( i >= 0 && T->pLength != 0728 && ! rIsSyzIndexRing(currRing) && T->pLength != pLength(p))728 if ((i >= 0) && (T->pLength != 0) 729 && (! rIsSyzIndexRing(currRing)) && (T->pLength != pLength(p))) 729 730 { 730 731 int l=T->pLength; … … 5510 5511 { 5511 5512 L->length = 0; 5513 L->pLength = 0; 5512 5514 } 5513 5515 -
kernel/misc.cc
r6776cf r7b00dbc 11 11 #include <kernel/mod2.h> 12 12 13 #define SI_DONT_HAVE_GLOBAL_VARS 14 # include <factory/factory.h> 13 #include <factory/factory.h> 15 14 /* libfac version strings */ 16 15 -
kernel/syz0.cc
r6776cf r7b00dbc 772 772 } 773 773 774 #if 0 774 775 static void syMergeSortResolventFB(resolvente res,int length, int initial=1) 775 776 { … … 826 827 } 827 828 } 829 #endif 828 830 829 831 BOOLEAN syTestOrder(ideal M) -
kernel/test.cc
r6776cf r7b00dbc 50 50 #include <polys/clapsing.h> 51 51 52 53 // The following are needed due to FACTORY (e.g. initCanonicalForm)54 // int initializeGMP(){ return 1; }55 int mmInit(void) {return 1; }56 52 57 53 // // TODO: DUE to the use of HALT in npolygon.cc :((( -
libpolys/coeffs/OPAE.cc
r6776cf r7b00dbc 28 28 // DEFINITION DER FUNKTIONEN 29 29 30 number nAEAdd(number a, number b, const coeffs r)30 number nAEAdd(number a, number b, const coeffs) 31 31 { 32 32 int_poly* f=reinterpret_cast<int_poly*> (a); … … 38 38 } 39 39 40 number nAEMult(number a, number b, const coeffs r)40 number nAEMult(number a, number b, const coeffs) 41 41 { 42 42 int_poly* f=reinterpret_cast<int_poly*> (a); … … 48 48 } 49 49 50 number nAESub(number a, number b, const coeffs r)50 number nAESub(number a, number b, const coeffs) 51 51 { 52 52 int_poly* f=reinterpret_cast<int_poly*> (a); … … 59 59 60 60 61 number nAEDiv(number a, number b, const coeffs r)61 number nAEDiv(number a, number b, const coeffs) 62 62 { 63 63 int_poly* f=reinterpret_cast<int_poly*> (a); … … 70 70 71 71 72 number nAEIntDiv(number a, number b, const coeffs r)72 number nAEIntDiv(number a, number b, const coeffs) 73 73 { 74 74 … … 81 81 } 82 82 83 number nAEIntMod(number a, number b,const coeffs r)83 number nAEIntMod(number a, number, const coeffs) 84 84 { 85 85 return a; 86 86 } 87 87 88 number nAEExactDiv(number a, number b, const coeffs r)88 number nAEExactDiv(number a, number b, const coeffs) 89 89 { 90 90 int_poly* f=reinterpret_cast<int_poly*> (a); … … 98 98 99 99 100 number nAEInit(long i, const coeffs r)100 number nAEInit(long i, const coeffs) 101 101 { 102 102 mpz_t m; 103 mpz_init_set_ui(m, i);103 mpz_init_set_ui(m, i); 104 104 int_poly* res=new int_poly; 105 105 res->poly_set(m); … … 108 108 } 109 109 110 number nAEInitMPZ(mpz_t m, const coeffs r)110 number nAEInitMPZ(mpz_t m, const coeffs) 111 111 { 112 112 int_poly* res=new int_poly; … … 117 117 118 118 119 int nAESize (number a, const coeffs r)119 int nAESize (number a, const coeffs) 120 120 { 121 121 int_poly* f=reinterpret_cast<int_poly*> (a); … … 123 123 } 124 124 125 int nAEInt(number & a,const coeffs r)125 int nAEInt(number &, const coeffs) 126 126 { 127 127 return 1; … … 129 129 130 130 131 number nAEMPZ(number a, const coeffs r)131 number nAEMPZ(number a, const coeffs) 132 132 { 133 133 return a; … … 135 135 136 136 137 number nAENeg(number c, const coeffs r)137 number nAENeg(number c, const coeffs) 138 138 { 139 139 int_poly* f=reinterpret_cast<int_poly*> (c); … … 144 144 } 145 145 146 number nAECopy(number c, const coeffs r)146 number nAECopy(number c, const coeffs) 147 147 { 148 148 return (number) c; 149 149 } 150 150 151 number nAERePart(number c, const coeffs r)151 number nAERePart(number c, const coeffs) 152 152 { 153 153 return (number) c; 154 154 } 155 155 156 number nAEImPart(number c, const coeffs r)156 number nAEImPart(number c, const coeffs) 157 157 { 158 158 return (number) c; 159 159 } 160 160 161 void nAEWriteLong (number &a, const coeffs r)161 void nAEWriteLong (number &a, const coeffs) 162 162 { 163 163 int_poly* f=reinterpret_cast <int_poly*>(a); … … 166 166 } 167 167 168 void nAEWriteShort (number &a, const coeffs r)168 void nAEWriteShort (number &a, const coeffs) 169 169 { 170 170 int_poly* f=reinterpret_cast <int_poly*>(a); … … 174 174 175 175 176 const char * nAERead (const char * s, number *a,const coeffs r)176 const char * nAERead (const char *, number *, const coeffs) 177 177 { 178 178 char* c=new char; … … 181 181 } 182 182 183 number nAENormalize (number a, number b,const coeffs r) // ?183 number nAENormalize (number a, number, const coeffs) // ? 184 184 { 185 185 return a; 186 186 } 187 187 188 BOOLEAN nAEGreater (number a, number b, const coeffs r)188 BOOLEAN nAEGreater (number a, number b, const coeffs) 189 189 { 190 190 int_poly* f=reinterpret_cast<int_poly*> (a); … … 194 194 } 195 195 196 BOOLEAN nAEEqual (number a, number b, const coeffs r)196 BOOLEAN nAEEqual (number a, number b, const coeffs) 197 197 { 198 198 int_poly* f=reinterpret_cast<int_poly*> (a); … … 202 202 } 203 203 204 BOOLEAN nAEIsZero (number a, const coeffs r)204 BOOLEAN nAEIsZero (number a, const coeffs) 205 205 { 206 206 int_poly* f=reinterpret_cast<int_poly*> (a); … … 209 209 } 210 210 211 BOOLEAN nAEIsOne (number a, const coeffs r)211 BOOLEAN nAEIsOne (number a, const coeffs) 212 212 { 213 213 int_poly* f=reinterpret_cast<int_poly*> (a); … … 216 216 } 217 217 218 BOOLEAN nAEIsMOne (number a, const coeffs r)218 BOOLEAN nAEIsMOne (number a, const coeffs) 219 219 { 220 220 int_poly* f=reinterpret_cast<int_poly*> (a); … … 225 225 BOOLEAN nAEGreaterZero (number a, const coeffs r) 226 226 { 227 if (nAEIsZero(a, r) == FALSE) { return TRUE; }227 if (nAEIsZero(a, r) == FALSE) { return TRUE; } 228 228 else { return FALSE; } 229 229 } 230 230 231 void nAEPower (number a, int i, number * result,const coeffs r)231 void nAEPower (number, int, number *, const coeffs) 232 232 { 233 233 return; 234 234 } 235 235 236 number nAEGetDenom (number & a, const coeffs r)236 number nAEGetDenom (number &, const coeffs) 237 237 { 238 238 return (number) 1; 239 239 } 240 240 241 number nAEGetNumerator (number &a, const coeffs r)241 number nAEGetNumerator (number &a, const coeffs) 242 242 { 243 243 return a; 244 244 } 245 245 246 number nAEGcd (number a, number b,const coeffs r)246 number nAEGcd (number a, number b, const coeffs) 247 247 { 248 248 int_poly* f=reinterpret_cast<int_poly*> (a); … … 253 253 } 254 254 255 number nAELcm (number a, number b,const coeffs r)255 number nAELcm (number a, number b, const coeffs) 256 256 { 257 257 int_poly* f=reinterpret_cast<int_poly*> (a); … … 265 265 } 266 266 267 void nAEDelete (number * a, const coeffs r)267 void nAEDelete (number *, const coeffs) 268 268 { 269 269 return; … … 271 271 272 272 /* 273 number nAESetMap (number a, const coeffs r)273 number nAESetMap (number a, const coeffs) 274 274 { 275 275 return a; 276 276 } 277 277 */ 278 char* nAEName (number a, const coeffs r)278 char* nAEName (number, const coeffs) 279 279 { char *c=new char; 280 280 *c='c'; … … 282 282 } 283 283 284 void nAEInpMult (number & a, number b,const coeffs r)284 void nAEInpMult (number &, number, const coeffs) 285 285 { 286 286 return ; 287 287 } 288 288 289 void nAECoeffWrite (const coeffs r, BOOLEAN details)289 void nAECoeffWrite (const coeffs, BOOLEAN) 290 290 { 291 291 return; 292 292 } 293 293 294 BOOLEAN nAEClearContent (number a,const coeffs r)294 BOOLEAN nAEClearContent (number, const coeffs) 295 295 { 296 296 return FALSE; 297 297 } 298 298 299 BOOLEAN nAEClearDenominators (number a,const coeffs r)299 BOOLEAN nAEClearDenominators (number, const coeffs) 300 300 { 301 301 return FALSE; … … 307 307 308 308 309 BOOLEAN n_AEInitChar(coeffs r,void * p) // vlt noch void* p hin 310 { 311 309 BOOLEAN n_AEInitChar(coeffs r, void *) 310 { 312 311 r->ch = 0; 313 312 r->cfKillChar=NULL; -
libpolys/coeffs/OPAE.h
r6776cf r7b00dbc 9 9 10 10 BOOLEAN n_AEInitChar(coeffs , void *); 11 BOOLEAN nAECoeffIsEqual (number a, number b, const coeffs r);11 BOOLEAN nAECoeffIsEqual (number a, number b, const coeffs r); 12 12 number nAEMult (number a, number b, const coeffs r); 13 number nAESub (number a, number b, const coeffs r);14 number nAEAdd (number a, number b, const coeffs r);15 number nAEDiv (number a, number b, const coeffs r);13 number nAESub (number a, number b, const coeffs r); 14 number nAEAdd (number a, number b, const coeffs r); 15 number nAEDiv (number a, number b, const coeffs r); 16 16 number nAEIntDiv (number a, number b, const coeffs r); //Hir wollte wir was gucken 17 17 number nAEIntMod (number a, number b, const coeffs r);// Hir wollte wir was gucken 18 number nAEExactDiv (number a, number b, const coeffs r);18 number nAEExactDiv (number a, number b, const coeffs r); 19 19 number nAEInit (long i, const coeffs r); 20 20 number nAEInitMPZ (mpz_t m, const coeffs r); //nachgucken/fragen 21 21 int nAESize (number a, const coeffs r);/// 22 int nAEInt (number &a, const coeffs r);23 number nAEMPZ (number a, const coeffs r); //nachgucken/fragen24 number nAENeg (number c, const coeffs r);25 number nAECopy (number a, number b, const coeffs r); // nachgicken26 number nAERePart (number a, number b, const coeffs r); // nachgicken27 number nAEImPart (number a, number b, const coeffs r); // nachgicken22 int nAEInt (number &a, const coeffs r); 23 number nAEMPZ (number a, const coeffs r); //nachgucken/fragen 24 number nAENeg (number c, const coeffs r); 25 number nAECopy (number a, number b, const coeffs r); // nachgicken 26 number nAERePart (number a, number b, const coeffs r); // nachgicken 27 number nAEImPart (number a, number b, const coeffs r); // nachgicken 28 28 29 29 void nAEWriteLong (number &a, const coeffs r);// … … 31 31 32 32 33 const char * nAERead (const char *s, number *a, const coeffs r);34 number nAENormalize (number a, number b,const coeffs r);//35 BOOLEAN nAEGreater (number a, number b, const coeffs r);//36 BOOLEAN nAEEqual (number a, number b, const coeffs r);37 BOOLEAN nAEIsZero (number a, const coeffs r);38 BOOLEAN nAEIsOne (number a, const coeffs r);39 BOOLEAN nAEIsMOne (number a, const coeffs r);40 BOOLEAN nAEGreaterZero (number a, number b, const coeffs r);41 void nAEPower (number a, int i, number * result, const coeffs r);33 const char * nAERead (const char *s, number *a, const coeffs r); 34 number nAENormalize (number a, number b, const coeffs r);// 35 BOOLEAN nAEGreater (number a, number b, const coeffs r);// 36 BOOLEAN nAEEqual (number a, number b, const coeffs r); 37 BOOLEAN nAEIsZero (number a, const coeffs r); 38 BOOLEAN nAEIsOne (number a, const coeffs r); 39 BOOLEAN nAEIsMOne (number a, const coeffs r); 40 BOOLEAN nAEGreaterZero (number a, number b, const coeffs r); 41 void nAEPower (number a, int i, number * result, const coeffs r); 42 42 number nAEGetDenom (number &a, const coeffs r);// 43 43 number nAEGetNumerator (number &a, const coeffs r);// 44 number nAEGcd (number a, number b,const coeffs r);45 number nAELcm (number a, number b,const coeffs r);44 number nAEGcd (number a, number b, const coeffs r); 45 number nAELcm (number a, number b, const coeffs r); 46 46 47 47 void nAEDelete (number *a, const coeffs r);// … … 51 51 void nAECoeffWrite (const coeffs r, BOOLEAN details);// 52 52 53 BOOLEAN nAEClearContent (number a, const coeffs r);//54 BOOLEAN nAEClearDenominators (number a, const coeffs r);//53 BOOLEAN nAEClearContent (number a, const coeffs r);// 54 BOOLEAN nAEClearDenominators (number a, const coeffs r);// 55 55 56 56 -
libpolys/coeffs/OPAEQ.cc
r6776cf r7b00dbc 29 29 // DEFINITION DER FUNKTIONEN 30 30 31 number nAEQAdd(number a, number b, const coeffs r)31 number nAEQAdd(number a, number b, const coeffs) 32 32 { 33 33 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 39 39 } 40 40 41 number nAEQMult(number a, number b, const coeffs r)41 number nAEQMult(number a, number b, const coeffs) 42 42 { 43 43 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 49 49 } 50 50 51 number nAEQSub(number a, number b, const coeffs r)51 number nAEQSub(number a, number b, const coeffs) 52 52 { 53 53 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 60 60 61 61 62 number nAEQDiv(number a, number b, const coeffs r)62 number nAEQDiv(number a, number b, const coeffs) 63 63 { 64 64 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 72 72 73 73 74 number nAEQIntDiv(number a, number b, const coeffs r)74 number nAEQIntDiv(number a, number b, const coeffs) 75 75 { 76 76 … … 83 83 } 84 84 85 number nAEQIntMod(number a, number b,const coeffs r)85 number nAEQIntMod(number a, number, const coeffs) 86 86 { 87 87 return a; 88 88 } 89 89 90 number nAEQExactDiv(number a, number b, const coeffs r)90 number nAEQExactDiv(number a, number b, const coeffs) 91 91 { 92 92 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 101 101 102 102 103 number nAEQInit(long i, const coeffs r)103 number nAEQInit(long i, const coeffs) 104 104 { 105 105 number res = (number) i; … … 107 107 } 108 108 109 number nAEQInitMPZ(mpz_t m, const coeffs r)109 number nAEQInitMPZ(mpz_t m, const coeffs) 110 110 { 111 111 number res= (number) m; … … 113 113 } 114 114 115 int nAEQSize (number a, const coeffs r)115 int nAEQSize (number a, const coeffs) 116 116 { 117 117 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 119 119 } 120 120 121 int nAEQInt(number & a,const coeffs r)121 int nAEQInt(number &, const coeffs) 122 122 { 123 123 return 1; … … 125 125 126 126 127 number nAEQMPZ(number a, const coeffs r)127 number nAEQMPZ(number a, const coeffs) 128 128 { 129 129 return a; … … 131 131 132 132 133 number nAEQNeg(number c, const coeffs r)133 number nAEQNeg(number c, const coeffs) 134 134 { 135 135 Q_poly* f=reinterpret_cast<Q_poly*> (c); … … 140 140 } 141 141 142 number nAEQCopy(number c, const coeffs r)142 number nAEQCopy(number c, const coeffs) 143 143 { 144 144 return (number) c; 145 145 } 146 146 147 number nAEQRePart(number c, const coeffs r)147 number nAEQRePart(number c, const coeffs) 148 148 { 149 149 return (number) c; 150 150 } 151 151 152 number nAEQImPart(number c, const coeffs r)152 number nAEQImPart(number c, const coeffs) 153 153 { 154 154 return (number) c; 155 155 } 156 156 157 void nAEQWriteLong (number & a, const coeffs r)157 void nAEQWriteLong (number &, const coeffs) 158 158 { 159 159 return; 160 160 } 161 161 162 void nAEQWriteShort (number & a, const coeffs r)162 void nAEQWriteShort (number &, const coeffs) 163 163 { 164 164 return ; … … 166 166 167 167 168 const char * nAEQRead (const char * s, number *a,const coeffs r)168 const char * nAEQRead (const char *, number *, const coeffs) 169 169 { 170 170 return ""; 171 171 } 172 172 173 number nAEQNormalize (number a, number b,const coeffs r) // ?173 number nAEQNormalize (number a, number , const coeffs) // ? 174 174 { 175 175 return a; 176 176 } 177 177 178 BOOLEAN nAEQGreater (number a, number b, const coeffs r)178 BOOLEAN nAEQGreater (number a, number b, const coeffs) 179 179 { 180 180 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 184 184 } 185 185 186 BOOLEAN nAEQEqual (number a, number b, const coeffs r)186 BOOLEAN nAEQEqual (number a, number b, const coeffs) 187 187 { 188 188 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 192 192 } 193 193 194 BOOLEAN nAEQIsZero (number a, const coeffs r)194 BOOLEAN nAEQIsZero (number a, const coeffs) 195 195 { 196 196 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 199 199 } 200 200 201 BOOLEAN nAEQIsOne (number a, const coeffs r)201 BOOLEAN nAEQIsOne (number a, const coeffs) 202 202 { 203 203 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 206 206 } 207 207 208 BOOLEAN nAEQIsMOne (number a, const coeffs r)208 BOOLEAN nAEQIsMOne (number a, const coeffs) 209 209 { 210 210 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 215 215 BOOLEAN nAEQGreaterZero (number a, const coeffs r) 216 216 { 217 if (nAEQIsZero(a, r) == FALSE) { return TRUE; }217 if (nAEQIsZero(a, r) == FALSE) { return TRUE; } 218 218 else { return FALSE; } 219 219 } 220 220 221 void nAEQPower (number a, int i, number * result,const coeffs r)221 void nAEQPower (number, int, number *, const coeffs) 222 222 { 223 223 return; 224 224 } 225 225 226 number nAEQGetDenom (number & a, const coeffs r)226 number nAEQGetDenom (number &, const coeffs) 227 227 { 228 228 return (number) 1; 229 229 } 230 230 231 number nAEQGetNumerator (number &a, const coeffs r)231 number nAEQGetNumerator (number &a, const coeffs) 232 232 { 233 233 return a; 234 234 } 235 235 236 number nAEQGcd (number a, number b,const coeffs r)236 number nAEQGcd (number a, number b, const coeffs) 237 237 { 238 238 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 243 243 } 244 244 245 number nAEQLcm (number a, number b,const coeffs r)245 number nAEQLcm (number a, number b, const coeffs) 246 246 { 247 247 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 256 256 } 257 257 258 void nAEQDelete (number * a, const coeffs r)258 void nAEQDelete (number *, const coeffs) 259 259 { 260 260 return; … … 262 262 263 263 /* 264 number nAEQSetMap (number a, const coeffs r)264 number nAEQSetMap (number a, const coeffs) 265 265 { 266 266 return a; 267 267 } 268 268 */ 269 char* nAEQName (number a, const coeffs r)269 char* nAEQName (number, const coeffs) 270 270 { 271 271 char* c=new char; … … 275 275 } 276 276 277 void nAEQInpMult (number & a, number b,const coeffs r)277 void nAEQInpMult (number &, number, const coeffs) 278 278 { 279 279 return ; 280 280 } 281 281 282 void nAEQCoeffWrite (const coeffs r, BOOLEAN details)282 void nAEQCoeffWrite (const coeffs, BOOLEAN) 283 283 { 284 284 return; 285 285 } 286 286 287 BOOLEAN nAEQClearContent (number a,const coeffs r)287 BOOLEAN nAEQClearContent (number, const coeffs) 288 288 { 289 289 return FALSE; 290 290 } 291 291 292 BOOLEAN nAEQClearDenominators (number a,const coeffs r)292 BOOLEAN nAEQClearDenominators (number, const coeffs) 293 293 { 294 294 return FALSE; … … 300 300 301 301 302 BOOLEAN n_QAEInitChar(coeffs r,void *p) // vlt noch void* p hin 303 { 304 305 306 302 BOOLEAN n_QAEInitChar(coeffs r, void *) 303 { 307 304 r->ch=0; 308 305 r->cfKillChar=NULL; -
libpolys/coeffs/OPAEQ.h
r6776cf r7b00dbc 9 9 10 10 BOOLEAN n_QAEInitChar(coeffs , void *); 11 BOOLEAN nAEQCoeffIsEqual (number a, number b, const coeffs r);11 BOOLEAN nAEQCoeffIsEqual (number a, number b, const coeffs r); 12 12 number nAEQMult (number a, number b, const coeffs r); 13 number nAEQSub (number a, number b, const coeffs r);14 number nAEQAdd (number a, number b, const coeffs r);15 number nAEQDiv (number a, number b, const coeffs r);13 number nAEQSub (number a, number b, const coeffs r); 14 number nAEQAdd (number a, number b, const coeffs r); 15 number nAEQDiv (number a, number b, const coeffs r); 16 16 number nAEQIntDiv (number a, number b, const coeffs r); //Hir wollte wir was gucken 17 17 number nAEQIntMod (number a, number b, const coeffs r);// Hir wollte wir was gucken 18 number nAEQExactDiv (number a, number b, const coeffs r);18 number nAEQExactDiv (number a, number b, const coeffs r); 19 19 number nAEQInit (long i, const coeffs r); 20 20 number nAEQInitMPZ (mpz_t m, const coeffs r); //nachgucken/fragen 21 21 int nAEQSize (number a, const coeffs r);/// 22 int nAEQInt (number &a, const coeffs r);23 number nAEQMPZ (number a, const coeffs r); //nachgucken/fragen24 number nAEQNeg (number c, const coeffs r);25 number nAEQCopy (number a, number b, const coeffs r); // nachgicken26 number nAEQRePart (number a, number b, const coeffs r); // nachgicken27 number nAEQImPart (number a, number b, const coeffs r); // nachgicken22 int nAEQInt (number &a, const coeffs r); 23 number nAEQMPZ (number a, const coeffs r); //nachgucken/fragen 24 number nAEQNeg (number c, const coeffs r); 25 number nAEQCopy (number a, number b, const coeffs r); // nachgicken 26 number nAEQRePart (number a, number b, const coeffs r); // nachgicken 27 number nAEQImPart (number a, number b, const coeffs r); // nachgicken 28 28 29 29 void nAEQWriteLong (number &a, const coeffs r);// … … 31 31 32 32 33 const char * nAEQRead (const char *s, number *a, const coeffs r);34 number nAEQNormalize (number a, number b,const coeffs r);//35 BOOLEAN nAEQGreater (number a, number b, const coeffs r);//36 BOOLEAN nAEQEqual (number a, number b, const coeffs r);37 BOOLEAN nAEQIsZero (number a, const coeffs r);38 BOOLEAN nAEQIsOne (number a, const coeffs r);39 BOOLEAN nAEQIsMOne (number a, const coeffs r);40 BOOLEAN nAEQGreaterZero (number a, number b, const coeffs r);41 void nAEQPower (number a, int i, number * result, const coeffs r);33 const char * nAEQRead (const char *s, number *a, const coeffs r); 34 number nAEQNormalize (number a, number b, const coeffs r);// 35 BOOLEAN nAEQGreater (number a, number b, const coeffs r);// 36 BOOLEAN nAEQEqual (number a, number b, const coeffs r); 37 BOOLEAN nAEQIsZero (number a, const coeffs r); 38 BOOLEAN nAEQIsOne (number a, const coeffs r); 39 BOOLEAN nAEQIsMOne (number a, const coeffs r); 40 BOOLEAN nAEQGreaterZero (number a, number b, const coeffs r); 41 void nAEQPower (number a, int i, number * result, const coeffs r); 42 42 number nAEQGetDenom (number &a, const coeffs r);// 43 43 number nAEQGetNumerator (number &a, const coeffs r);// 44 number nAEQGcd (number a, number b,const coeffs r);45 number nAEQLcm (number a, number b,const coeffs r);44 number nAEQGcd (number a, number b, const coeffs r); 45 number nAEQLcm (number a, number b, const coeffs r); 46 46 47 47 void nAEQDelete (number *a, const coeffs r);// … … 51 51 void nAEQCoeffWrite (const coeffs r, BOOLEAN details);// 52 52 53 BOOLEAN nAEQClearContent (number a, const coeffs r);//54 BOOLEAN nAEQClearDenominators (number a, const coeffs r);//53 BOOLEAN nAEQClearContent (number a, const coeffs r);// 54 BOOLEAN nAEQClearDenominators (number a, const coeffs r);// 55 55 56 56 -
libpolys/coeffs/OPAEp.cc
r6776cf r7b00dbc 29 29 // DEFINITION DER FUNKTIONEN 30 30 31 number nAEpAdd(number a, number b, const coeffs r)31 number nAEpAdd(number a, number b, const coeffs) 32 32 { 33 33 p_poly* f=reinterpret_cast<p_poly*> (a); … … 39 39 } 40 40 41 number nAEpMult(number a, number b, const coeffs r)41 number nAEpMult(number a, number b, const coeffs) 42 42 { 43 43 p_poly* f=reinterpret_cast<p_poly*> (a); … … 49 49 } 50 50 51 number nAEpSub(number a, number b, const coeffs r)51 number nAEpSub(number a, number b, const coeffs) 52 52 { 53 53 p_poly* f=reinterpret_cast<p_poly*> (a); … … 60 60 61 61 62 number nAEpDiv(number a, number b, const coeffs r)62 number nAEpDiv(number a, number b, const coeffs) 63 63 { 64 64 p_poly* f=reinterpret_cast<p_poly*> (a); … … 72 72 73 73 74 number nAEpIntDiv(number a, number b, const coeffs r)74 number nAEpIntDiv(number a, number b, const coeffs) 75 75 { 76 76 … … 83 83 } 84 84 85 number nAEpIntMod(number a, number b,const coeffs r)85 number nAEpIntMod(number a, number, const coeffs) 86 86 { 87 87 return a; 88 88 } 89 89 90 number nAEpExactDiv(number a, number b, const coeffs r)90 number nAEpExactDiv(number a, number b, const coeffs) 91 91 { 92 92 p_poly* f=reinterpret_cast<p_poly*> (a); … … 101 101 102 102 103 number nAEpInit(long i, const coeffs r)103 number nAEpInit(long i, const coeffs) 104 104 { 105 105 int j=7; 106 106 mpz_t m; 107 mpz_init_set_ui(m, i);107 mpz_init_set_ui(m, i); 108 108 p_poly* res=new p_poly; 109 res->p_poly_set(m, j);109 res->p_poly_set(m, j); 110 110 number res1=reinterpret_cast<number>(res); 111 111 return res1; 112 112 } 113 113 114 number nAEpInitMPZ(mpz_t m, const coeffs r)114 number nAEpInitMPZ(mpz_t m, const coeffs) 115 115 { 116 116 int j=7; 117 117 p_poly* res=new p_poly; 118 res->p_poly_set(m, j);118 res->p_poly_set(m, j); 119 119 number res1=reinterpret_cast<number>(res); 120 120 return res1; … … 122 122 } 123 123 124 int nAEpSize (number a, const coeffs r)124 int nAEpSize (number a, const coeffs) 125 125 { 126 126 p_poly* f=reinterpret_cast<p_poly*> (a); … … 128 128 } 129 129 130 int nAEpInt(number & a,const coeffs r)130 int nAEpInt(number &, const coeffs) 131 131 { 132 132 return 1; … … 134 134 135 135 136 number nAEpMPZ(number a, const coeffs r)136 number nAEpMPZ(number a, const coeffs) 137 137 { 138 138 return a; … … 140 140 141 141 142 number nAEpNeg(number c, const coeffs r)142 number nAEpNeg(number c, const coeffs) 143 143 { 144 144 p_poly* f=reinterpret_cast<p_poly*> (c); … … 149 149 } 150 150 151 number nAEpCopy(number c, const coeffs r)151 number nAEpCopy(number c, const coeffs) 152 152 { 153 153 return c; 154 154 } 155 155 156 number nAEpRePart(number c, const coeffs r)156 number nAEpRePart(number c, const coeffs) 157 157 { 158 158 return c; 159 159 } 160 160 161 number nAEpImPart(number c, const coeffs r)161 number nAEpImPart(number c, const coeffs) 162 162 { 163 163 return c; 164 164 } 165 165 166 void nAEpWriteLong (number &a, const coeffs r)166 void nAEpWriteLong (number &a, const coeffs) 167 167 { 168 168 p_poly* f=reinterpret_cast <p_poly*>(a); … … 172 172 } 173 173 174 void nAEpWriteShort (number &a, const coeffs r)174 void nAEpWriteShort (number &a, const coeffs) 175 175 { 176 176 p_poly* f=reinterpret_cast <p_poly*>(a); … … 180 180 181 181 182 const char * nAEpRead (const char * s, number *a,const coeffs r)182 const char * nAEpRead (const char *, number *a, const coeffs) 183 183 { 184 184 p_poly& f=reinterpret_cast <p_poly&>(a); … … 191 191 } 192 192 193 number nAEpNormalize (number a, number b,const coeffs r) // ?193 number nAEpNormalize (number a, number, const coeffs) // ? 194 194 { 195 195 return a; 196 196 } 197 197 198 BOOLEAN nAEpGreater (number a, number b, const coeffs r)198 BOOLEAN nAEpGreater (number a, number b, const coeffs) 199 199 { 200 200 p_poly* f=reinterpret_cast<p_poly*> (a); … … 204 204 } 205 205 206 BOOLEAN nAEpEqual (number a, number b, const coeffs r)206 BOOLEAN nAEpEqual (number a, number b, const coeffs) 207 207 { 208 208 p_poly* f=reinterpret_cast<p_poly*> (a); … … 212 212 } 213 213 214 BOOLEAN nAEpIsZero (number a, const coeffs r)214 BOOLEAN nAEpIsZero (number a, const coeffs) 215 215 { 216 216 p_poly* f=reinterpret_cast<p_poly*> (a); … … 219 219 } 220 220 221 BOOLEAN nAEpIsOne (number a, const coeffs r)221 BOOLEAN nAEpIsOne (number a, const coeffs) 222 222 { 223 223 p_poly* f=reinterpret_cast<p_poly*> (a); … … 226 226 } 227 227 228 BOOLEAN nAEpIsMOne (number a, const coeffs r)229 { 230 number b=nAEpNeg(a, r);228 BOOLEAN nAEpIsMOne (number a, const coeffs r) 229 { 230 number b=nAEpNeg(a, r); 231 231 p_poly* f=reinterpret_cast<p_poly*> (b); 232 232 if (f->is_one() == 1) {return FALSE;} … … 236 236 BOOLEAN nAEpGreaterZero (number a, const coeffs r) 237 237 { 238 if (nAEpIsZero(a, r) == FALSE) { return TRUE; }238 if (nAEpIsZero(a, r) == FALSE) { return TRUE; } 239 239 else { return FALSE; } 240 240 } 241 241 242 void nAEpPower (number a, int i, number * result,const coeffs r)242 void nAEpPower (number, int, number *, const coeffs) 243 243 { 244 244 return; 245 245 } 246 246 247 number nAEpGetDenom (number & a, const coeffs r)247 number nAEpGetDenom (number &, const coeffs) 248 248 { 249 249 return (number) 1; 250 250 } 251 251 252 number nAEpGetNumerator (number &a, const coeffs r)252 number nAEpGetNumerator (number &a, const coeffs) 253 253 { 254 254 return a; 255 255 } 256 256 257 number nAEpGcd (number a, number b,const coeffs r)257 number nAEpGcd (number a, number b, const coeffs) 258 258 { 259 259 p_poly* f=reinterpret_cast<p_poly*> (a); … … 264 264 } 265 265 266 number nAEpLcm (number a, number b,const coeffs r)266 number nAEpLcm (number a, number b, const coeffs) 267 267 { 268 268 p_poly* f=reinterpret_cast<p_poly*> (a); … … 277 277 } 278 278 279 void nAEpDelete (number * a, const coeffs r)279 void nAEpDelete (number *, const coeffs) 280 280 { 281 281 return; … … 283 283 284 284 /* 285 number nAEpSetMap (number a, const coeffs r)285 number nAEpSetMap (number a, const coeffs) 286 286 { 287 287 return a; 288 288 } 289 289 */ 290 char* nAEpName (number a, const coeffs r)290 char* nAEpName (number, const coeffs) 291 291 { 292 292 char* c=new char; 293 293 *c='c'; 294 294 295 return c; ;296 } 297 298 void nAEpInpMult (number &a, number b, const coeffs r)299 { 300 p_poly* f=reinterpret_cast<p_poly*> (a); 301 p_poly* g=reinterpret_cast<p_poly*> ( g);295 return c; 296 } 297 298 void nAEpInpMult (number &a, number b, const coeffs) 299 { 300 p_poly* f=reinterpret_cast<p_poly*> (a); 301 p_poly* g=reinterpret_cast<p_poly*> (b); 302 302 f->p_poly_mult_n_to(*g); 303 303 a=(number) f; … … 305 305 } 306 306 307 void nAEpCoeffWrite (const coeffs r, BOOLEAN details)307 void nAEpCoeffWrite (const coeffs, BOOLEAN) 308 308 { 309 309 return; 310 310 } 311 311 312 BOOLEAN nAEpClearContent (number a,const coeffs r)312 BOOLEAN nAEpClearContent (number, const coeffs) 313 313 { 314 314 return FALSE; 315 315 } 316 316 317 BOOLEAN nAEpClearDenominators (number a,const coeffs r)317 BOOLEAN nAEpClearDenominators (number, const coeffs) 318 318 { 319 319 return FALSE; … … 325 325 326 326 327 BOOLEAN n_pAEInitChar(coeffs r, void *p) // vlt noch void* p hin327 BOOLEAN n_pAEInitChar(coeffs r, void *p) 328 328 { 329 329 //Charakteristik abgreifen! -
libpolys/coeffs/OPAEp.h
r6776cf r7b00dbc 9 9 10 10 BOOLEAN n_pAEInitChar(coeffs , void *); 11 BOOLEAN nAEpCoeffIsEqual (number a, number b, const coeffs r);11 BOOLEAN nAEpCoeffIsEqual (number a, number b, const coeffs r); 12 12 number nAEpMult (number a, number b, const coeffs r); 13 number nAEpSub (number a, number b, const coeffs r);14 number nAEpAdd (number a, number b, const coeffs r);15 number nAEpDiv (number a, number b, const coeffs r);13 number nAEpSub (number a, number b, const coeffs r); 14 number nAEpAdd (number a, number b, const coeffs r); 15 number nAEpDiv (number a, number b, const coeffs r); 16 16 number nAEpIntDiv (number a, number b, const coeffs r); //Hir wollte wir was gucken 17 17 number nAEpIntMod (number a, number b, const coeffs r);// Hir wollte wir was gucken 18 number nAEpExactDiv (number a, number b, const coeffs r);18 number nAEpExactDiv (number a, number b, const coeffs r); 19 19 number nAEpInit (long i, const coeffs r); 20 20 number nAEpInitMPZ (mpz_t m, const coeffs r); //nachgucken/fragen 21 21 int nAEpSize (number a, const coeffs r);/// 22 int nAEpInt (number &a, const coeffs r);23 number nAEpMPZ (number a, const coeffs r); //nachgucken/fragen24 number nAEpNeg (number c, const coeffs r);25 number nAEpCopy (number a, number b, const coeffs r); // nachgicken26 number nAEpRePart (number a, number b, const coeffs r); // nachgicken27 number nAEpImPart (number a, number b, const coeffs r); // nachgicken22 int nAEpInt (number &a, const coeffs r); 23 number nAEpMPZ (number a, const coeffs r); //nachgucken/fragen 24 number nAEpNeg (number c, const coeffs r); 25 number nAEpCopy (number a, number b, const coeffs r); // nachgicken 26 number nAEpRePart (number a, number b, const coeffs r); // nachgicken 27 number nAEpImPart (number a, number b, const coeffs r); // nachgicken 28 28 29 29 void nAEpWriteLong (number &a, const coeffs r);// … … 31 31 32 32 33 const char * nAEpRead (const char *s, number *a, const coeffs r);34 number nAEpNormalize (number a, number b,const coeffs r);//35 BOOLEAN nAEpGreater (number a, number b, const coeffs r);//36 BOOLEAN nAEpEqual (number a, number b, const coeffs r);37 BOOLEAN nAEpIsZero (number a, const coeffs r);38 BOOLEAN nAEpIsOne (number a, const coeffs r);39 BOOLEAN nAEpIsMOne (number a, const coeffs r);40 BOOLEAN nAEpGreaterZero (number a, number b, const coeffs r);41 void nAEpPower (number a, int i, number * result, const coeffs r);33 const char * nAEpRead (const char *s, number *a, const coeffs r); 34 number nAEpNormalize (number a, number b, const coeffs r);// 35 BOOLEAN nAEpGreater (number a, number b, const coeffs r);// 36 BOOLEAN nAEpEqual (number a, number b, const coeffs r); 37 BOOLEAN nAEpIsZero (number a, const coeffs r); 38 BOOLEAN nAEpIsOne (number a, const coeffs r); 39 BOOLEAN nAEpIsMOne (number a, const coeffs r); 40 BOOLEAN nAEpGreaterZero (number a, number b, const coeffs r); 41 void nAEpPower (number a, int i, number * result, const coeffs r); 42 42 number nAEpGetDenom (number &a, const coeffs r);// 43 43 number nAEpGetNumerator (number &a, const coeffs r);// 44 number nAEpGcd (number a, number b,const coeffs r);45 number nAEpLcm (number a, number b,const coeffs r);44 number nAEpGcd (number a, number b, const coeffs r); 45 number nAEpLcm (number a, number b, const coeffs r); 46 46 47 47 void nAEpDelete (number *a, const coeffs r);// … … 51 51 void nAEpCoeffWrite (const coeffs r, BOOLEAN details);// 52 52 53 BOOLEAN nAEpClearContent (number a, const coeffs r);//54 BOOLEAN nAEpClearDenominators (number a, const coeffs r);//53 BOOLEAN nAEpClearContent (number a, const coeffs r);// 54 BOOLEAN nAEpClearDenominators (number a, const coeffs r);// 55 55 56 56 -
libpolys/coeffs/bigintmat.cc
r6776cf r7b00dbc 20 20 #include <string.h> 21 21 22 #if 0 22 23 // Ungetestet 23 24 static void bimRowContent(bigintmat *bimat, int rowpos, int colpos); 24 25 static void bimReduce(bigintmat *bimat, int rpiv, int colpos, 25 26 int ready, int all); 26 27 #endif 27 28 28 29 … … 688 689 } 689 690 691 #if 0 690 692 // Ungetestet 691 693 // (According to C. Fieker) Seems to have a lot of memory leaks (pure adaptation of the … … 772 774 } 773 775 } 776 #endif 774 777 775 778 // columnwise concatination of two bigintmats -
libpolys/coeffs/longrat.cc
r6776cf r7b00dbc 2827 2827 } 2828 2828 2829 static char* nlCoeffString(const coeffs r)2829 static char* nlCoeffString(const coeffs) 2830 2830 { 2831 2831 return omStrDup("0"); -
libpolys/coeffs/modulop.cc
r6776cf r7b00dbc 343 343 } 344 344 while (((*s) >= '0') && ((*s) <= '9')); 345 if (ii >= r->ch) ii = ii % r->ch;345 if (ii >= (unsigned long)r->ch) ii = ii % r->ch; 346 346 *i=(int)ii; 347 347 } -
libpolys/coeffs/rintegers.cc
r6776cf r7b00dbc 383 383 } 384 384 385 static char* nrzCoeffString(const coeffs r)385 static char* nrzCoeffString(const coeffs) 386 386 { 387 387 return omStrDup("integer"); -
libpolys/coeffs/test.cc
r6776cf r7b00dbc 24 24 #include <coeffs/rintegers.h> 25 25 26 27 // int initializeGMP(void){ return 1; }28 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???29 26 30 27 #include <iostream> -
libpolys/polys/clapconv.cc
r6776cf r7b00dbc 13 13 #include <misc/auxiliary.h> 14 14 15 #define SI_DONT_HAVE_GLOBAL_VARS16 15 #include <factory/factory.h> 17 16 … … 35 34 static void convRecTrP ( const CanonicalForm & f, int * exp, poly & result, int offs, const ring r ); 36 35 37 static void convRecGFGF ( const CanonicalForm & f, int * exp, poly & result );36 //static void convRecGFGF ( const CanonicalForm & f, int * exp, poly & result ); 38 37 39 38 static number convFactoryNSingAN( const CanonicalForm &f, const ring r); -
libpolys/polys/clapsing.cc
r6776cf r7b00dbc 14 14 15 15 #include <misc/auxiliary.h> 16 17 #define SI_DONT_HAVE_GLOBAL_VARS18 16 19 17 #include <misc/auxiliary.h> … … 1466 1464 On(SW_SYMMETRIC_FF); 1467 1465 CFList L; 1468 poly p;1469 1466 if (rField_is_Q(r) || rField_is_Zp(r)) 1470 1467 { -
libpolys/polys/ext_fields/algext.cc
r6776cf r7b00dbc 653 653 poly aAsPoly; 654 654 const char * result = p_Read(s, aAsPoly, naRing); 655 definiteReduce(aAsPoly, naMinpoly, cf);655 if (aAsPoly!=NULL) definiteReduce(aAsPoly, naMinpoly, cf); 656 656 *a = (number)aAsPoly; 657 657 return result; -
libpolys/polys/kbuckets.cc
r6776cf r7b00dbc 1162 1162 return rn; 1163 1163 } 1164 static BOOLEAN nIsPseudoUnit(number n, ring r)1165 {1166 if (rField_is_Zp(r))1167 return TRUE;1168 1169 if (rParameter(r)==NULL)1170 {1171 return (n_Size(n,r->cf)==1);1172 }1173 //if (r->parameter!=NULL)1174 return (n_IsOne(n,r->cf) || n_IsMOne(n,r->cf));1175 }1176 1164 1177 1165 #ifndef USE_COEF_BUCKETS 1178 1166 void kBucketSimpleContent(kBucket_pt) {} 1179 1167 #else 1168 static BOOLEAN nIsPseudoUnit(number n, ring r) 1169 { 1170 if (rField_is_Zp(r)) 1171 return TRUE; 1172 1173 if (rParameter(r)==NULL) 1174 { 1175 return (n_Size(n,r->cf)==1); 1176 } 1177 //if (r->parameter!=NULL) 1178 return (n_IsOne(n,r->cf) || n_IsMOne(n,r->cf)); 1179 } 1180 1180 1181 void kBucketSimpleContent(kBucket_pt bucket) 1181 1182 { -
libpolys/polys/linalg_from_matpol.cc
r6776cf r7b00dbc 7 7 8 8 static void mp_PartClean(matrix, int, int, const ring); 9 static void mp_FinalClean(matrix, const ring);10 9 static int mp_PrepareRow (matrix, int, int, const ring); 11 10 static int mp_PreparePiv (matrix, int, int, const ring); … … 231 230 232 231 232 static poly minuscopy (poly p, const ring R) 233 { 234 poly w; 235 number e; 236 e = n_Init(-1, R); 237 w = p_Copy(p, R); 238 p_Mult_nn(w, e, R); 239 n_Delete(&e, R); 240 return w; 241 } 242 233 243 234 244 /*2 -
libpolys/polys/matpol.cc
r6776cf r7b00dbc 610 610 } 611 611 612 static poly minuscopy (poly p, const ring R)613 {614 poly w;615 number e;616 e = n_Init(-1, R);617 w = p_Copy(p, R);618 p_Mult_nn(w, e, R);619 n_Delete(&e, R);620 return w;621 }622 623 612 /*2 624 613 * insert a monomial into a list, avoid duplicates … … 727 716 for (j=lc-1;j>=0;j--) if(q1[j]) p_Delete(&q1[j], R); 728 717 } 729 }730 731 static void mp_FinalClean(matrix a, const ring)732 {733 omFreeSize((ADDRESS)a->m,a->nrows*a->ncols*sizeof(poly));734 omFreeBin((ADDRESS)a, sip_sideal_bin);735 718 } 736 719 … … 1368 1351 } 1369 1352 1370 static inline BOOLEAN smSmaller(poly a, poly b)1371 {1372 loop1373 {1374 pIter(b);1375 if (b == NULL) return TRUE;1376 pIter(a);1377 if (a == NULL) return FALSE;1378 }1379 }1380 1381 static BOOLEAN sm_IsNegQuot(poly a, const poly b, const poly c, const ring R)1382 {1383 if (p_LmDivisibleByNoComp(c, b, R))1384 {1385 p_ExpVectorDiff(a, b, c, R);1386 // Hmm: here used to be a pSetm(a): but it is unnecessary,1387 // if b and c are correct1388 return FALSE;1389 }1390 else1391 {1392 int i;1393 for (i=rVar(R); i>0; i--)1394 {1395 if(p_GetExp(c,i,R) > p_GetExp(b,i,R))1396 p_SetExp(a,i,p_GetExp(c,i,R)-p_GetExp(b,i,R),R);1397 else1398 p_SetExp(a,i,0,R);1399 }1400 // here we actually might need a pSetm, if a is to be used in1401 // comparisons1402 return TRUE;1403 }1404 }1405 1406 1353 static void mp_ElimBar(matrix a0, matrix re, poly div, int lr, int lc, const ring R) 1407 1354 { -
libpolys/polys/monomials/p_polys.cc
r6776cf r7b00dbc 2814 2814 assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf; 2815 2815 2816 poly start=ph; 2817 2818 number d, h; 2816 number h; 2819 2817 poly p; 2820 2818 -
libpolys/polys/simpleideals.cc
r6776cf r7b00dbc 34 34 static int idpowerpoint; 35 35 /*index of the actual monomial in idpower*/ 36 static poly * givenideal;37 /*the ideal from which a power is computed*/38 36 39 37 /*2 … … 997 995 } 998 996 999 /*21000 *computes recursively all generators of a certain degree1001 *of the ideal "givenideal"1002 *elms is the number elements in the given ideal1003 *actelm is the actual element to handle1004 *deg is the degree of the power to compute1005 *gendeg is the actual degree of the generator in consideration1006 */1007 static void makepotence(int elms,int actelm,int deg,int gendeg, const ring r)1008 {1009 poly p;1010 int i=0;1011 1012 if ((idpowerpoint == 0) && (actelm ==1))1013 {1014 idpower[idpowerpoint] = p_One(r);1015 gendeg = 0;1016 }1017 while (i<=deg)1018 {1019 if (deg == gendeg)1020 {1021 idpowerpoint++;1022 return;1023 }1024 if (actelm == elms)1025 {1026 p=p_Power(p_Copy(givenideal[actelm-1],r),deg-gendeg,r);1027 idpower[idpowerpoint]=p_Mult_q(idpower[idpowerpoint],p,r);1028 idpowerpoint++;1029 return;1030 }1031 else1032 {1033 p = p_Copy(idpower[idpowerpoint],r);1034 makepotence(elms,actelm+1,deg,gendeg,r);1035 idpower[idpowerpoint] = p;1036 }1037 gendeg++;1038 idpower[idpowerpoint]=p_Mult_q(idpower[idpowerpoint],p_Copy(givenideal[actelm-1],r),r);1039 i++;1040 }1041 }1042 1043 /*21044 *returns the deg-th power of the ideal gid1045 */1046 //ideal idPower(ideal gid,int deg)1047 //{1048 // int i;1049 // ideal id;1050 //1051 // if (deg < 1) deg = 1;1052 // i = binom(IDELEMS(gid)+deg-1,deg);1053 // id=idInit(i,1);1054 // idpower = id->m;1055 // givenideal = gid->m;1056 // idpowerpoint = 0;1057 // makepotence(IDELEMS(gid),1,deg,0);1058 // idpower = NULL;1059 // givenideal = NULL;1060 // idpowerpoint = 0;1061 // return id;1062 //}1063 997 static void id_NextPotence(ideal given, ideal result, 1064 998 int begin, int end, int deg, int restdeg, poly ap, const ring r) -
libpolys/reporter/dError.cc
r6776cf r7b00dbc 50 50 int dReportError(const char* fmt, ...) 51 51 { 52 #if 0 52 53 #ifdef HAVE_EXECINFO_H 53 54 #define SIZE 50 54 55 void *buffer[SIZE+1]; int ret; 56 #endif 55 57 #endif 56 58 -
libpolys/reporter/reporter.cc
r6776cf r7b00dbc 354 354 #ifdef HAVE_VSNPRINTF 355 355 l = vsnprintf(s, ls+511, fmt, ap); 356 if ((l==-1)||(s[l]!='\0')||(l!= strlen(s)))356 if ((l==-1)||(s[l]!='\0')||(l!=(int)strlen(s))) 357 357 { 358 358 printf("Print problem: l=%d, fmt=>>%s<<\n",l,fmt); -
libpolys/tests/common.h
r6776cf r7b00dbc 31 31 32 32 #include <polys/nc/gb_hack.h> 33 34 // int initializeGMP(){ return 1; } // due to Factory...35 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???36 33 37 34 // #pragma GCC diagnostic ignored "-Wwrite-strings" -
standalone.test/test.cc
r6776cf r7b00dbc 7 7 #include <reporter/reporter.h> 8 8 #include <resources/feResource.h> 9 10 // int initializeGMP(){ return 1; }11 int mmInit(void) {return 1; }12 9 13 10 #include <polys/monomials/ring.h> -
standalone.test/tt.cc
r6776cf r7b00dbc 3 3 #include <Singular/libsingular.h> 4 4 #include <unistd.h> 5 6 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???7 5 8 6
Note: See TracChangeset
for help on using the changeset viewer.