Changeset 690e21e in git
- Timestamp:
- Jan 27, 2010, 7:17:56 PM (13 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- 210bd9653b629172ad9e359805bf1651153f6120
- Parents:
- a4875334edd65075db8edd5f072597fac0983b5f
- Location:
- kernel
- Files:
-
- 1 added
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile.in
ra48753 r690e21e 168 168 eigenval.h units.h mod_raw.h kbuckets.h sbuckets.h\ 169 169 mpr_global.h mpr_inout.h mpr_base.h mpr_numeric.h \ 170 fegetopt.h distrib.h \170 fegetopt.h distrib.h options.h \ 171 171 ratgring.h shiftgb.h prCopy.h prCopyMacros.h \ 172 172 p_MemAdd.h p_MemCopy.h p_MemCmp.h p_Numbers.h \ -
kernel/fast_maps.cc
ra48753 r690e21e 11 11 #include "mod2.h" 12 12 #include <omalloc.h> 13 #include "options.h" 13 14 #include "p_polys.h" 14 15 #include "prCopy.h" -
kernel/febase.cc
ra48753 r690e21e 26 26 #include "omalloc.h" 27 27 #include "dError.h" 28 #include "options.h" 28 29 29 30 #define fePutChar(c) fputc((unsigned char)(c),stdout) -
kernel/feread.cc
ra48753 r690e21e 22 22 #include "febase.h" 23 23 #include "omalloc.h" 24 #include "options.h" 24 25 25 26 #include "../Singular/static.h" -
kernel/fglmcomb.cc
ra48753 r690e21e 12 12 13 13 #ifdef HAVE_FGLM 14 #include " structs.h"14 #include "options.h" 15 15 #include "polys.h" 16 16 #include "ideals.h" -
kernel/fglmzero.cc
ra48753 r690e21e 22 22 23 23 #ifdef HAVE_FGLM 24 #include " structs.h"24 #include "options.h" 25 25 #include "polys.h" 26 26 #include "ideals.h" -
kernel/gr_kstd2.cc
ra48753 r690e21e 17 17 #include "ideals.h" 18 18 #include "febase.h" 19 #include "options.h" 19 20 #include "kutil.h" 20 21 #include "kstd1.h" … … 25 26 #include "weight.h" 26 27 #include "intvec.h" 27 #include "structs.h"28 28 #include "gring.h" 29 29 #include "sca.h" -
kernel/gring.cc
ra48753 r690e21e 24 24 25 25 #include "febase.h" 26 #include "options.h" 26 27 #include "ring.h" 27 28 #include "polys.h" -
kernel/ideals.cc
ra48753 r690e21e 16 16 #endif /* ifndef NDEBUG */ 17 17 18 #include " structs.h"18 #include "options.h" 19 19 #include "omalloc.h" 20 20 #include "febase.h" -
kernel/intvec.cc
ra48753 r690e21e 9 9 #define INTVEC_CC 10 10 #include "mod2.h" 11 #include "structs.h"12 11 #include "febase.h" 12 #include "options.h" 13 13 #include "intvec.h" 14 14 #include "omalloc.h" -
kernel/khstd.cc
ra48753 r690e21e 8 8 9 9 #include "mod2.h" 10 #include "structs.h"11 10 #include "febase.h" 11 #include "options.h" 12 12 #include "polys.h" 13 13 #include "intvec.h" -
kernel/kspoly.cc
ra48753 r690e21e 9 9 // #define PDEBUG 2 10 10 #include "mod2.h" 11 #include "options.h" 11 12 #include "kutil.h" 12 13 #include "numbers.h" -
kernel/kstd1.cc
ra48753 r690e21e 16 16 17 17 #include "mod2.h" 18 #include "omalloc.h" 18 19 19 20 #ifndef NDEBUG … … 29 30 #endif /* if MYTEST */ 30 31 31 #include "structs.h" 32 #include "omalloc.h" 32 #include "options.h" 33 33 #include "kutil.h" 34 34 #include "kInline.cc" -
kernel/kstd2.cc
ra48753 r690e21e 35 35 #endif 36 36 #include "kutil.h" 37 #include " structs.h"37 #include "options.h" 38 38 #include "omalloc.h" 39 39 #include "polys.h" -
kernel/kstdfac.cc
ra48753 r690e21e 8 8 9 9 #include "mod2.h" 10 #include "structs.h"11 10 #include "omalloc.h" 11 #include "options.h" 12 12 #include "polys.h" 13 13 #include "ideals.h" -
kernel/kutil.cc
ra48753 r690e21e 22 22 23 23 #include <mylimits.h> 24 #include " structs.h"24 #include "options.h" 25 25 #include "gring.h" 26 26 #include "sca.h" -
kernel/maps.cc
ra48753 r690e21e 8 8 9 9 #include "mod2.h" 10 #include " structs.h"10 #include "options.h" 11 11 #include "febase.h" 12 12 #include "polys.h" -
kernel/misc.cc
ra48753 r690e21e 17 17 #include "omalloc.h" 18 18 #include "structs.h" 19 #include "options.h" 19 20 #include "febase.h" 20 21 //#include "cntrlc.h" -
kernel/mpr_base.cc
ra48753 r690e21e 17 17 18 18 //-> includes 19 #include " structs.h"19 #include "options.h" 20 20 #include "polys.h" 21 21 #include "ideals.h" -
kernel/mpr_numeric.cc
ra48753 r690e21e 16 16 17 17 //-> includes 18 #include " structs.h"18 #include "options.h" 19 19 #include "febase.h" 20 20 #include "omalloc.h" -
kernel/ncSAMult.cc
ra48753 r690e21e 30 30 31 31 32 #include "options.h" 32 33 #include <ncSAMult.h> // for CMultiplier etc classes 33 34 #include <sca.h> // for SCA -
kernel/p_Mult_q.cc
ra48753 r690e21e 17 17 * Assumes: pLength(p) >= 2 pLength(q) >=2 18 18 ***************************************************************/ 19 #include "options.h" 19 20 #include "p_polys.h" 20 21 #include "p_Procs.h" -
kernel/polys.cc
ra48753 r690e21e 13 13 #include <ctype.h> 14 14 #include "mod2.h" 15 #include " structs.h"15 #include "options.h" 16 16 #include "omalloc.h" 17 17 #include "febase.h" … … 281 281 } 282 282 283 BOOLEAN _p_Test(poly p, ring r, int level); 283 284 poly pmInit(const char *st, BOOLEAN &ok) 284 285 { … … 295 296 return NULL; 296 297 } 298 #ifdef PDEBUG 299 _p_Test(p,currRing,PDEBUG); 300 #endif 297 301 ok=!errorreported; 298 302 return p; -
kernel/polys.h
ra48753 r690e21e 205 205 #define pMult_mm(p, m) p_Mult_mm(p, m, currRing) 206 206 #define pAdd(p, q) p_Add_q(p, q, currRing) 207 #define pPower(p, q) p_Power(p, q, currRing) 207 208 #define pMinus_mm_Mult_qq(p, m, q) p_Minus_mm_Mult_qq(p, m, q, currRing) 208 209 #define pPlus_mm_Mult_qq(p, m, q) p_Plus_mm_Mult_qq(p, m, q, currRing) … … 331 332 /*-------------operations on polynomials:------------*/ 332 333 poly pSub(poly a, poly b); 333 poly p Power(poly p, int i);334 poly p_Power(poly p, int i, const ring r); 334 335 335 336 // ----------------- define to enable new p_procs -----*/ -
kernel/polys1.cc
ra48753 r690e21e 12 12 #include <string.h> 13 13 #include "mod2.h" 14 #include " structs.h"14 #include "options.h" 15 15 #include "numbers.h" 16 16 #include "ffields.h" … … 130 130 * destroys p 131 131 */ 132 static poly p MonPower(poly p, int exp)132 static poly p_MonPower(poly p, int exp, const ring r) 133 133 { 134 134 int i; 135 135 136 if(!n IsOne(pGetCoeff(p)))136 if(!n_IsOne(pGetCoeff(p),r)) 137 137 { 138 138 number x, y; 139 139 y = pGetCoeff(p); 140 n Power(y,exp,&x);141 n Delete(&y);140 n_Power(y,exp,&x,r); 141 n_Delete(&y,r); 142 142 pSetCoeff0(p,x); 143 143 } 144 for (i= pVariables; i!=0; i--)145 { 146 p MultExp(p,i, exp);147 } 148 p Setm(p);144 for (i=rVar(r); i!=0; i--) 145 { 146 p_MultExp(p,i, exp,r); 147 } 148 p_Setm(p,r); 149 149 return p; 150 150 } … … 154 154 * destroys p, keeps q 155 155 */ 156 static void p MonMult(poly p, poly q)156 static void p_MonMult(poly p, poly q, const ring r) 157 157 { 158 158 number x, y; … … 160 160 161 161 y = pGetCoeff(p); 162 x = n Mult(y,pGetCoeff(q));163 n Delete(&y);162 x = n_Mult(y,pGetCoeff(q),r); 163 n_Delete(&y,r); 164 164 pSetCoeff0(p,x); 165 165 //for (i=pVariables; i!=0; i--) … … 168 168 //} 169 169 //p->Order += q->Order; 170 p ExpVectorAdd(p,q);170 p_ExpVectorAdd(p,q,r); 171 171 } 172 172 … … 175 175 * keeps p, q 176 176 */ 177 static poly p MonMultC(poly p, poly q)177 static poly p_MonMultC(poly p, poly q, const ring rr) 178 178 { 179 179 number x; 180 180 int i; 181 poly r = p Init();182 183 x = n Mult(pGetCoeff(p),pGetCoeff(q));181 poly r = p_Init(rr); 182 183 x = n_Mult(pGetCoeff(p),pGetCoeff(q),rr); 184 184 pSetCoeff0(r,x); 185 p ExpVectorSum(r,p, q);185 p_ExpVectorSum(r,p, q, rr); 186 186 return r; 187 187 } … … 192 192 * with binomial coef. 193 193 */ 194 static poly p TwoMonPower(poly p, int exp)194 static poly p_TwoMonPower(poly p, int exp, const ring r) 195 195 { 196 196 int eh, e; … … 204 204 if (bin == NULL) 205 205 { 206 p MonPower(p,exp);207 p MonPower(tail,exp);206 p_MonPower(p,exp,r); 207 p_MonPower(tail,exp,r); 208 208 #ifdef PDEBUG 209 p Test(p);209 p_Test(p,r); 210 210 #endif 211 211 return p; … … 217 217 for (e=1; e<exp; e++) 218 218 { 219 a[e+1] = p MonMultC(a[e],p);219 a[e+1] = p_MonMultC(a[e],p,r); 220 220 } 221 221 res = a[exp]; 222 b = p Head(tail);222 b = p_Head(tail,r); 223 223 for (e=exp-1; e>eh; e--) 224 224 { 225 225 h = a[e]; 226 x = n Mult(bin[exp-e],pGetCoeff(h));227 p SetCoeff(h,x);228 p MonMult(h,b);226 x = n_Mult(bin[exp-e],pGetCoeff(h),r); 227 p_SetCoeff(h,x,r); 228 p_MonMult(h,b,r); 229 229 res = pNext(res) = h; 230 p MonMult(b,tail);230 p_MonMult(b,tail,r); 231 231 } 232 232 for (e=eh; e!=0; e--) 233 233 { 234 234 h = a[e]; 235 x = n Mult(bin[e],pGetCoeff(h));236 p SetCoeff(h,x);237 p MonMult(h,b);235 x = n_Mult(bin[e],pGetCoeff(h),r); 236 p_SetCoeff(h,x,r); 237 p_MonMult(h,b,r); 238 238 res = pNext(res) = h; 239 p MonMult(b,tail);240 } 241 p DeleteLm(&tail);239 p_MonMult(b,tail,r); 240 } 241 p_DeleteLm(&tail,r); 242 242 pNext(res) = b; 243 243 pNext(b) = NULL; … … 256 256 // } 257 257 #ifdef PDEBUG 258 p Test(res);258 p_Test(res,r); 259 259 #endif 260 260 return res; 261 261 } 262 262 263 static poly p Pow(poly p, int i)264 { 265 poly rc = p Copy(p);263 static poly p_Pow(poly p, int i, const ring r) 264 { 265 poly rc = p_Copy(p,r); 266 266 i -= 2; 267 267 do 268 268 { 269 rc = p Mult(rc,pCopy(p));270 p Normalize(rc);269 rc = p_Mult_q(rc,p_Copy(p,r),r); 270 p_Normalize(rc,r); 271 271 i--; 272 272 } 273 273 while (i != 0); 274 return p Mult(rc,p);274 return p_Mult_q(rc,p,r); 275 275 } 276 276 … … 279 279 * p will be destroyed 280 280 */ 281 poly p Power(poly p, int i)281 poly p_Power(poly p, int i, const ring r) 282 282 { 283 283 poly rc=NULL; … … 285 285 if (i==0) 286 286 { 287 p Delete(&p);288 return p One();287 p_Delete(&p,r); 288 return p_One(r); 289 289 } 290 290 291 291 if(p!=NULL) 292 292 { 293 if ( (i > 0) && ((unsigned long ) i > ( currRing->bitmask)))294 { 295 Werror("exponent %d is too large, max. is %ld",i, currRing->bitmask);293 if ( (i > 0) && ((unsigned long ) i > (r->bitmask))) 294 { 295 Werror("exponent %d is too large, max. is %ld",i,r->bitmask); 296 296 return NULL; 297 297 } … … 309 309 break; 310 310 case 2: 311 rc=p Mult(pCopy(p),p);311 rc=p_Mult_q(p_Copy(p,r),p,r); 312 312 break; 313 313 default: 314 314 if (i < 0) 315 315 { 316 p Delete(&p);316 p_Delete(&p,r); 317 317 return NULL; 318 318 } … … 320 320 { 321 321 #ifdef HAVE_PLURAL 322 if (rIsPluralRing(currRing)) /* in the NC case nothing helps :-( */323 324 325 rc = pCopy(p);326 327 328 rc = pMult(pCopy(p),rc);329 330 331 pDelete(&p);332 333 322 if (rIsPluralRing(r)) /* in the NC case nothing helps :-( */ 323 { 324 int j=i; 325 rc = p_Copy(p,r); 326 while (j>1) 327 { 328 rc = p_Mult_q(p_Copy(p,r),rc,r); 329 j--; 330 } 331 p_Delete(&p,r); 332 return rc; 333 } 334 334 #endif 335 335 rc = pNext(p); 336 336 if (rc == NULL) 337 return p MonPower(p,i);337 return p_MonPower(p,i,r); 338 338 /* else: binom ?*/ 339 int char_p=rChar( currRing);339 int char_p=rChar(r); 340 340 if ((pNext(rc) != NULL) 341 341 #ifdef HAVE_RINGS 342 || rField_is_Ring( currRing)342 || rField_is_Ring(r) 343 343 #endif 344 344 ) 345 return p Pow(p,i);345 return p_Pow(p,i,r); 346 346 if ((char_p==0) || (i<=char_p)) 347 return p TwoMonPower(p,i);348 poly p_p=p TwoMonPower(pCopy(p),char_p);349 return p Mult(pPower(p,i-char_p),p_p);347 return p_TwoMonPower(p,i,r); 348 poly p_p=p_TwoMonPower(p_Copy(p,r),char_p,r); 349 return p_Mult_q(p_Power(p,i-char_p,r),p_p,r); 350 350 } 351 351 /*end default:*/ … … 633 633 pIter(c_n); 634 634 } 635 635 c_n=c_n_n->n; 636 636 while (c_n!=NULL) 637 637 { // each monom: coeff in Q -
kernel/ring.cc
ra48753 r690e21e 18 18 #endif /* ifndef NDEBUG */ 19 19 20 #include " structs.h"20 #include "options.h" 21 21 #include "omalloc.h" 22 22 #include "polys.h" -
kernel/sca.cc
ra48753 r690e21e 30 30 31 31 #include "febase.h" 32 #include "options.h" 32 33 33 34 #include "p_polys.h" -
kernel/sparsmat.cc
ra48753 r690e21e 9 9 10 10 #include "mod2.h" 11 #include " structs.h"11 #include "options.h" 12 12 #include "febase.h" 13 #include "structs.h"14 13 #include "intvec.h" 15 14 #include "ring.h" -
kernel/structs.h
ra48753 r690e21e 708 708 #endif 709 709 710 /*711 ** Set operations (small sets only)712 */713 714 #define Sy_bit(x) ((unsigned)1<<(x))715 #define Sy_inset(x,s) ((Sy_bit(x)&(s))?TRUE:FALSE)716 #define BTEST1(a) Sy_inset((a), test)717 #define BVERBOSE(a) Sy_inset((a), verbose)718 719 /*720 ** defines for BITSETs721 */722 723 #define V_SHOW_MEM 2724 #define V_YACC 3725 #define V_REDEFINE 4726 #define V_READING 5727 #define V_LOAD_LIB 6728 #define V_DEBUG_LIB 7729 #define V_LOAD_PROC 8730 #define V_DEF_RES 9731 #define V_DEBUG_MEM 10732 #define V_SHOW_USE 11733 #define V_IMAP 12734 #define V_PROMPT 13735 #define V_NSB 14736 #define V_CONTENTSB 15737 #define V_CANCELUNIT 16738 #define V_MODPSOLVSB 17739 #define V_UPTORADICAL 18740 #define V_FINDMONOM 19741 #define V_COEFSTRAT 20742 #define V_IDLIFT 21743 #define V_LENGTH 22744 /* for tests: 23-30 */745 #define V_DEG_STOP 31746 747 748 #define OPT_PROT 0749 #define OPT_REDSB 1750 #define OPT_NOT_BUCKETS 2751 #define OPT_NOT_SUGAR 3752 #define OPT_INTERRUPT 4753 #define OPT_SUGARCRIT 5754 #define OPT_DEBUG 6755 #define OPT_REDTHROUGH 7756 #define OPT_RETURN_SB 9757 #define OPT_FASTHC 10758 #define OPT_OLDSTD 20759 #define OPT_KEEPVARS 21760 #define OPT_STAIRCASEBOUND 22761 #define OPT_MULTBOUND 23762 #define OPT_DEGBOUND 24763 #define OPT_REDTAIL 25764 #define OPT_INTSTRATEGY 26765 #define OPT_FINDET 27766 #define OPT_INFREDTAIL 28767 #define OPT_SB_1 29768 #define OPT_NOTREGULARITY 30769 #define OPT_WEIGHTM 31770 771 /* define ring dependent options */772 #define TEST_RINGDEP_OPTS \773 (Sy_bit(OPT_INTSTRATEGY) | Sy_bit(OPT_REDTHROUGH) | Sy_bit(OPT_REDTAIL))774 775 #define TEST_OPT_PROT BTEST1(OPT_PROT)776 #define TEST_OPT_REDSB BTEST1(OPT_REDSB)777 #define TEST_OPT_NOT_BUCKETS BTEST1(OPT_NOT_BUCKETS)778 #define TEST_OPT_NOT_SUGAR BTEST1(OPT_NOT_SUGAR)779 #define TEST_OPT_SUGARCRIT BTEST1(OPT_SUGARCRIT)780 #define TEST_OPT_DEBUG BTEST1(OPT_DEBUG)781 #define TEST_OPT_FASTHC BTEST1(OPT_FASTHC)782 #define TEST_OPT_INTSTRATEGY BTEST1(OPT_INTSTRATEGY)783 #define TEST_OPT_FINDET BTEST1(OPT_FINDET)784 #define TEST_OPT_RETURN_SB BTEST1(OPT_RETURN_SB)785 #define TEST_OPT_KEEPVARS BTEST1(OPT_KEEPVARS)786 #define TEST_OPT_DEGBOUND BTEST1(OPT_DEGBOUND)787 #define TEST_OPT_MULTBOUND BTEST1(OPT_MULTBOUND)788 #define TEST_OPT_STAIRCASEBOUND BTEST1(OPT_STAIRCASEBOUND)789 #define TEST_OPT_REDTAIL BTEST1(OPT_REDTAIL)790 #define TEST_OPT_INFREDTAIL BTEST1(OPT_INFREDTAIL)791 #define TEST_OPT_SB_1 BTEST1(OPT_SB_1)792 #define TEST_OPT_NOTREGULARITY BTEST1(OPT_NOTREGULARITY)793 #define TEST_OPT_WEIGHTM BTEST1(OPT_WEIGHTM)794 #define TEST_OPT_REDTHROUGH BTEST1(OPT_REDTHROUGH)795 #define TEST_OPT_OLDSTD BTEST1(OPT_OLDSTD)796 #define TEST_OPT_CONTENTSB BVERBOSE(V_CONTENTSB)797 #define TEST_OPT_CANCELUNIT BVERBOSE(V_CANCELUNIT)798 #define TEST_OPT_IDLIFT BVERBOSE(V_IDLIFT)799 #define TEST_OPT_LENGTH BVERBOSE(V_LENGTH)800 801 #define TEST_VERB_NSB BVERBOSE(V_NSB)802 #define TEST_V_DEG_STOP BVERBOSE(V_DEG_STOP)803 #define TEST_V_MODPSOLVSB BVERBOSE(V_MODPSOLVSB)804 #define TEST_V_COEFSTRAT BVERBOSE(V_COEFSTRAT)805 #define TEST_V_UPTORADICAL BVERBOSE(V_UPTORADICAL)806 #define TEST_V_FINDMONOM BVERBOSE(V_FINDMONOM)807 808 710 extern struct omBin_s* char_ptr_bin; 809 711 extern struct omBin_s* sleftv_bin; -
kernel/summator.cc
ra48753 r690e21e 22 22 #ifdef HAVE_PLURAL 23 23 #include "summator.h" // for CPolynomialSummator class 24 #include "options.h" 24 25 #include "ring.h" 25 26 #include "p_polys.h" -
kernel/syz.cc
ra48753 r690e21e 10 10 11 11 #include "mod2.h" 12 #include " structs.h"12 #include "options.h" 13 13 #include "omalloc.h" 14 14 #include "polys.h" -
kernel/syz0.cc
ra48753 r690e21e 9 9 10 10 #include "mod2.h" 11 #include " structs.h"11 #include "options.h" 12 12 #include "omalloc.h" 13 13 #include "polys.h" -
kernel/syz1.cc
ra48753 r690e21e 9 9 #include "mod2.h" 10 10 #include <mylimits.h> 11 #include " structs.h"11 #include "options.h" 12 12 #include "omalloc.h" 13 13 #include "polys.h" -
kernel/syz2.cc
ra48753 r690e21e 9 9 #include "mod2.h" 10 10 #include <mylimits.h> 11 #include " structs.h"11 #include "options.h" 12 12 #include "omalloc.h" 13 13 #include "syz.h" -
kernel/syz3.cc
ra48753 r690e21e 9 9 #include "mod2.h" 10 10 #include <mylimits.h> 11 #include "structs.h" 12 //#include "attrib.h" 11 #include "options.h" 13 12 #include "omalloc.h" 14 13 #include "polys.h" -
kernel/tgb.cc
ra48753 r690e21e 17 17 ///@TODO: no tail reductions in syz comp 18 18 #include "mod2.h" 19 #include "options.h" 19 20 #include "tgb.h" 20 21 #include "tgb_internal.h" -
kernel/tgbgauss.cc
ra48753 r690e21e 7 7 */ 8 8 #include "mod2.h" 9 #include "options.h" 9 10 #include "tgbgauss.h" 10 11 #include <omalloc.h> -
kernel/walkMain.cc
ra48753 r690e21e 9 9 #include <string.h> 10 10 #include "mod2.h" 11 #include " structs.h"11 #include "options.h" 12 12 #include "intvec.h" 13 13 #include "int64vec.h" -
kernel/weight.cc
ra48753 r690e21e 10 10 #include <math.h> 11 11 #include "mod2.h" 12 #include " structs.h"12 #include "options.h" 13 13 #include "omalloc.h" 14 14 #include "polys.h"
Note: See TracChangeset
for help on using the changeset viewer.