Changeset b78996 in git
- Timestamp:
- Apr 14, 2011, 3:34:10 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- a665ebdc0e6f023769cadc08a35bd0eb3f3ad935
- Parents:
- 2f5936105b139a5635034b6eb233c5405b3e3e29
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-04-14 15:34:10+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:30:32+01:00
- Location:
- libpolys/polys
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/matpol.cc
r2f5936 rb78996 30 30 #include "monomials/ring.h" 31 31 #include "monomials/p_polys.h" 32 // #include <kernel/sparsmat.h>33 32 34 33 #include "coeffrings.h" … … 365 364 int *qrow, *qcol; 366 365 poly *Xarray; 367 ring _R;366 const ring _R; 368 367 369 368 void mpInitMat(); … … 1094 1093 if (ap[jj] != NULL) 1095 1094 { 1096 q2 = SM_MULT(ap[jj], elim, div );1095 q2 = SM_MULT(ap[jj], elim, div, _R); 1097 1096 if (a[jj] != NULL) 1098 1097 { 1099 q1 = SM_MULT(a[jj], piv, div );1098 q1 = SM_MULT(a[jj], piv, div, _R); 1100 1099 p_Delete(&a[jj], _R); 1101 1100 q2 = p_Add_q(q2, q1, _R); … … 1104 1103 else if (a[jj] != NULL) 1105 1104 { 1106 q2 = SM_MULT(a[jj], piv, div );1105 q2 = SM_MULT(a[jj], piv, div, _R); 1107 1106 } 1108 1107 if ((q2!=NULL) && div) 1109 SM_DIV(q2, div );1108 SM_DIV(q2, div, _R); 1110 1109 a[jj] = q2; 1111 1110 } … … 1119 1118 if (a[jj] != NULL) 1120 1119 { 1121 q2 = SM_MULT(a[jj], piv, div );1120 q2 = SM_MULT(a[jj], piv, div, _R); 1122 1121 p_Delete(&a[jj], _R); 1123 1122 if (div) 1124 SM_DIV(q2, div );1123 SM_DIV(q2, div, _R); 1125 1124 a[jj] = q2; 1126 1125 } … … 1839 1838 if (a[j] != NULL) 1840 1839 { 1841 q1 = SM_MULT(a[j], piv, div );1840 q1 = SM_MULT(a[j], piv, div, _R); 1842 1841 if (ap[j] != NULL) 1843 1842 { 1844 q2 = SM_MULT(ap[j], elim, div );1843 q2 = SM_MULT(ap[j], elim, div, _R); 1845 1844 q1 = p_Add_q(q1,q2, _R); 1846 1845 } 1847 1846 } 1848 1847 else if (ap[j] != NULL) 1849 q1 = SM_MULT(ap[j], elim, div );1848 q1 = SM_MULT(ap[j], elim, div, _R); 1850 1849 if (q1 != NULL) 1851 1850 { 1852 1851 if (div) 1853 SM_DIV(q1, div );1852 SM_DIV(q1, div, _R); 1854 1853 q[j] = q1; 1855 1854 } … … 1862 1861 if (a[j] != NULL) 1863 1862 { 1864 q1 = SM_MULT(a[j], piv, div );1863 q1 = SM_MULT(a[j], piv, div, _R); 1865 1864 if (div) 1866 SM_DIV(q1, div );1865 SM_DIV(q1, div, _R); 1867 1866 q[j] = q1; 1868 1867 } -
libpolys/polys/simpleideals.h
r2f5936 rb78996 8 8 * ABSTRACT - all basic methods to manipulate ideals 9 9 */ 10 #include <omalloc/omalloc.h> 10 11 #include <polys/monomials/ring.h> 11 #include <omalloc/omalloc.h>12 12 13 13 struct sip_sideal -
libpolys/polys/sparsmat.cc
r2f5936 rb78996 8 8 */ 9 9 10 #include <kernel/mod2.h> 11 #include <kernel/options.h> 12 #include <kernel/febase.h> 13 #include <kernel/intvec.h> 14 #include <kernel/ring.h> 15 #include <kernel/polys.h> 16 #include <kernel/ideals.h> 17 #include <kernel/numbers.h> 18 #include <kernel/sparsmat.h> 19 #include <kernel/prCopy.h> 20 #include <kernel/p_Procs.h> 21 #include <kernel/kbuckets.h> 22 #include <kernel/p_Mult_q.h> 10 #include "config.h" 11 #include <misc/auxiliary.h> 12 13 #include <omalloc/omalloc.h> 14 #include <misc/mylimits.h> 15 16 #include <misc/options.h> 17 18 #include <reporter/reporter.h> 19 #include <misc/intvec.h> 20 21 #include <coeffs/numbers.h> 22 #include "coeffrings.h" 23 24 #include "monomials/ring.h" 25 #include "monomials/p_polys.h" 26 27 #include "simpleideals.h" 28 29 30 #include "sparsmat.h" 31 #include "prCopy.h" 32 33 #include "templates/p_Procs.h" 34 35 #include "kbuckets.h" 36 #include "operations/p_Mult_q.h" 23 37 24 38 // define SM_NO_BUCKETS, if sparsemat stuff should not use buckets … … 67 81 68 82 static poly pp_Mult_Coeff_mm_DivSelect_MultDiv(poly p, int &lp, poly m, 69 poly a, poly b )83 poly a, poly b, const ring currRing) 70 84 { 71 85 if (rOrd_is_Comp_dp(currRing) && currRing->ExpL_Size > 2) … … 83 97 { 84 98 p = pp_Mult_Coeff_mm_DivSelect(p, lp, m, currRing); 85 sm ExpMultDiv(p, a, b);99 sm_ExpMultDiv(p, a, b, currRing); 86 100 } 87 101 return p; 88 102 } 89 103 90 static poly sm SelectCopy_ExpMultDiv(poly p, poly m, poly a, poly b)104 static poly sm_SelectCopy_ExpMultDiv(poly p, poly m, poly a, poly b, const ring currRing) 91 105 { 92 106 int lp = 0; 93 return pp_Mult_Coeff_mm_DivSelect_MultDiv(p, lp, m, a, b );107 return pp_Mult_Coeff_mm_DivSelect_MultDiv(p, lp, m, a, b, currRing); 94 108 } 95 109 … … 133 147 smpoly piv, oldpiv; // pivot and previous pivot 134 148 smpoly dumm; // allocated dummy 149 const ring _R; 150 135 151 void smColToRow(); 136 152 void smRowToCol(); … … 157 173 void smNormalize(); 158 174 public: 159 sparse_mat(ideal );175 sparse_mat(ideal, const ring); 160 176 ~sparse_mat(); 161 177 int smGetSign() { return sign; } … … 175 191 */ 176 192 static void smMinSelect(long *, int, int); 177 long smExpBound( ideal m, int di, int ra, int t) 193 194 long sm_ExpBound( ideal m, int di, int ra, int t, const ring currRing) 178 195 { 179 196 poly p; … … 193 210 while(p!=NULL) 194 211 { 195 k = p GetComp(p)-1;212 k = p_GetComp(p, currRing)-1; 196 213 kr = r[k]; 197 for (j= pVariables;j>0;j--)198 { 199 if(p GetExp(p,j)>kc)200 kc=p GetExp(p,j);201 if(p GetExp(p,j)>kr)202 kr=p GetExp(p,j);214 for (j=rVar(currRing);j>0;j--) 215 { 216 if(p_GetExp(p,j, currRing)>kc) 217 kc=p_GetExp(p,j, currRing); 218 if(p_GetExp(p,j, currRing)>kr) 219 kr=p_GetExp(p,j, currRing); 203 220 } 204 221 r[k] = kr; … … 244 261 245 262 /* ----------------- ops with rings ------------------ */ 246 ring sm RingChange(ring *origR, long bound)247 { 248 *origR =currRing;263 ring sm_RingChange(const ring currRing, long bound) 264 { 265 // *origR =currRing; 249 266 ring tmpR=rCopy0(currRing,FALSE,FALSE); 250 267 int *ord=(int*)omAlloc0(3*sizeof(int)); … … 268 285 if ((*origR)->qideal!=NULL) 269 286 { 270 tmpR->qideal= idrCopyR_NoSort((*origR)->qideal, (*origR), tmpR);271 } 272 rChangeCurrRing(tmpR);287 tmpR->qideal= idrCopyR_NoSort((*origR)->qideal, currRing, tmpR); 288 } 289 // rChangeCurrRing(tmpR); 273 290 if (TEST_OPT_PROT) 274 291 Print("[%ld:%d]", (long) tmpR->bitmask, tmpR->ExpL_Size); … … 276 293 } 277 294 278 void sm KillModifiedRing(ring r)295 void sm_KillModifiedRing(ring r) 279 296 { 280 297 if (r->qideal!=NULL) id_Delete(&(r->qideal),r); -
libpolys/polys/sparsmat.h
r2f5936 rb78996 11 11 12 12 13 poly sm Mult(poly, poly);14 void sm PolyDiv(poly, poly);15 poly sm MultDiv(poly, poly, const poly);16 void sm SpecialPolyDiv(poly, poly);13 poly sm_Mult(poly, poly, const ring); 14 void sm_PolyDiv(poly, poly, const ring); 15 poly sm_MultDiv(poly, poly, const poly, const ring); 16 void sm_SpecialPolyDiv(poly, poly, const ring); 17 17 /* ----------------- macros ------------------ */ 18 18 /* #define OLD_DIV 1 */ 19 19 20 20 #ifdef OLD_DIV 21 #define SM_MULT(A,B,C ) smMult(A,B)22 #define SM_DIV sm PolyDiv21 #define SM_MULT(A,B,C, R) sm_Mult(A,B,R) 22 #define SM_DIV sm_PolyDiv 23 23 #else 24 #define SM_MULT sm MultDiv25 #define SM_DIV sm SpecialPolyDiv24 #define SM_MULT sm_MultDiv 25 #define SM_DIV sm_SpecialPolyDiv 26 26 #endif 27 27 28 poly sm CallDet(ideal I);29 void sm CallBareiss(ideal smat, int x, int y, ideal & M, intvec ** iv);30 ideal sm CallSolv(ideal I);28 poly sm_CallDet(ideal I, const ring); 29 void sm_CallBareiss(ideal smat, int x, int y, ideal & M, intvec ** iv, const ring); 30 ideal sm_CallSolv(ideal I, const ring); 31 31 32 ring sm RingChange(ring *, long);33 void sm KillModifiedRing(ring r);34 long sm ExpBound(ideal, int, int, int);35 BOOLEAN sm CheckDet(ideal, int, BOOLEAN);32 ring sm_RingChange(const ring, long); 33 void sm_KillModifiedRing(ring r); 34 long sm_ExpBound(ideal, int, int, int, const ring); 35 BOOLEAN sm_CheckDet(ideal, int, BOOLEAN, const ring); 36 36 #endif
Note: See TracChangeset
for help on using the changeset viewer.