Changeset 6fcddc9 in git
- Timestamp:
- Nov 22, 2012, 10:20:13 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 96d505212a6d61ec4e31fe4f7c2e2044f89eb69eb3cd39575ad9cf110a22729b4ce72d7fef6726fdcadaf23fbd63bd8fb7aadb287ac4a983f63fb33c
- Parents:
- 30664c5b3e3d2f68b6afbb78f3f1798066c4f5b2
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-11-22 22:20:13+01:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-11-26 17:18:46+01:00
- Location:
- libpolys/polys/nc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/nc/nc.h
r30664c r6fcddc9 112 112 // iAltVarsStart, iAltVarsEnd are only used together with nc_type=nc_exterior 113 113 // 1 <= iAltVarsStart <= iAltVarsEnd <= r->N 114 unsigned int iFirstAltVar, iLastAltVar; // = 0 by default114 short iFirstAltVar, iLastAltVar; // = 0 by default 115 115 116 116 // for factors of super-commutative algebras we need … … 125 125 inline nc_type ncRingType() const { return (type); }; 126 126 127 inline unsigned int& FirstAltVar()127 inline short& FirstAltVar() 128 128 { assume(ncRingType() == nc_exterior); return (data.sca.iFirstAltVar); }; 129 inline unsigned int& LastAltVar ()129 inline short& LastAltVar () 130 130 { assume(ncRingType() == nc_exterior); return (data.sca.iLastAltVar ); }; 131 131 132 inline unsigned int FirstAltVar() const132 inline short FirstAltVar() const 133 133 { assume(ncRingType() == nc_exterior); return (data.sca.iFirstAltVar); }; 134 inline unsigned int LastAltVar () const134 inline short LastAltVar () const 135 135 { assume(ncRingType() == nc_exterior); return (data.sca.iLastAltVar ); }; 136 136 -
libpolys/polys/nc/sca.cc
r30664c r6fcddc9 95 95 #endif 96 96 97 const unsigned int iFirstAltVar = scaFirstAltVar(rRing);98 const unsigned int iLastAltVar = scaLastAltVar(rRing);97 const short iFirstAltVar = scaFirstAltVar(rRing); 98 const short iLastAltVar = scaLastAltVar(rRing); 99 99 100 100 register unsigned int tpower = 0; 101 101 register unsigned int cpower = 0; 102 102 103 for( register unsigned int j = iLastAltVar; j >= iFirstAltVar; j-- )103 for( register short j = iLastAltVar; j >= iFirstAltVar; j-- ) 104 104 { 105 105 const unsigned int iExpM = p_GetExp(pMonomM, j, rRing); … … 333 333 // preserves pMonom. may return NULL! 334 334 // if result != NULL => next(result) = NULL, lt(result) = x_i * lt(pMonom) 335 static inline poly sca_xi_Mult_mm( unsigned int i, const poly pMonom, const ring rRing)335 static inline poly sca_xi_Mult_mm(short i, const poly pMonom, const ring rRing) 336 336 { 337 337 #ifdef PDEBUG … … 345 345 return NULL; 346 346 347 const unsigned int iFirstAltVar = scaFirstAltVar(rRing);347 const short iFirstAltVar = scaFirstAltVar(rRing); 348 348 349 349 register unsigned int cpower = 0; 350 350 351 for( register unsigned int j = iFirstAltVar; j < i ; j++ )351 for( register short j = iFirstAltVar; j < i ; j++ ) 352 352 cpower ^= p_GetExp(pMonom, j, rRing); 353 353 … … 530 530 531 531 // return x_i * pPoly; preserve pPoly. 532 static inline poly sca_xi_Mult_pp( unsigned int i, const poly pPoly, const ring rRing)532 static inline poly sca_xi_Mult_pp(short i, const poly pPoly, const ring rRing) 533 533 { 534 534 assume( rIsSCA(rRing) ); … … 1213 1213 1214 1214 // return x_i * pPoly; preserve pPoly. 1215 poly sca_pp_Mult_xi_pp( unsigned int i, const poly pPoly, const ring rRing)1215 poly sca_pp_Mult_xi_pp(short i, const poly pPoly, const ring rRing) 1216 1216 { 1217 1217 assume(1 <= i); 1218 assume(i <= (unsigned int)rRing->N);1218 assume(i <= rVar(rRing)); 1219 1219 1220 1220 if(rIsSCA(rRing)) … … 1450 1450 // either create a copy of m or return NULL 1451 1451 static inline poly m_KillSquares(const poly m, 1452 const unsigned int iFirstAltVar, const unsigned int iLastAltVar,1452 const short iFirstAltVar, const short iLastAltVar, 1453 1453 const ring r) 1454 1454 { 1455 1455 #ifdef PDEBUG 1456 1456 p_Test(m, r); 1457 assume( (iFirstAltVar >= 1) && (iLastAltVar <= r ->N) && (iFirstAltVar <= iLastAltVar) );1457 assume( (iFirstAltVar >= 1) && (iLastAltVar <= rVar(r)) && (iFirstAltVar <= iLastAltVar) ); 1458 1458 1459 1459 #if 0 … … 1465 1465 assume( m != NULL ); 1466 1466 1467 for( unsigned int k = iFirstAltVar; k <= iLastAltVar; k++)1467 for(short k = iFirstAltVar; k <= iLastAltVar; k++) 1468 1468 if( p_GetExp(m, k, r) > 1 ) 1469 1469 return NULL; … … 1476 1476 // returns a new poly! 1477 1477 poly p_KillSquares(const poly p, 1478 const unsigned int iFirstAltVar, const unsigned int iLastAltVar,1478 const short iFirstAltVar, const short iLastAltVar, 1479 1479 const ring r) 1480 1480 { … … 1531 1531 // returns the reduced ideal or zero ideal. 1532 1532 ideal id_KillSquares(const ideal id, 1533 const unsigned int iFirstAltVar, const unsigned int iLastAltVar,1533 const short iFirstAltVar, const short iLastAltVar, 1534 1534 const ring r, const bool bSkipZeroes) 1535 1535 { 1536 1536 if (id == NULL) return id; // zero ideal 1537 1537 1538 assume( (iFirstAltVar >= 1) && (iLastAltVar <= r ->N) && (iFirstAltVar <= iLastAltVar) );1538 assume( (iFirstAltVar >= 1) && (iLastAltVar <= rVar(r)) && (iFirstAltVar <= iLastAltVar) ); 1539 1539 1540 1540 const int iSize = IDELEMS(id); … … 1548 1548 { 1549 1549 PrintS("ideal id: \n"); 1550 for ( int i = 0; i < IDELEMS(id); i++)1550 for (unsigned int i = 0; i < IDELEMS(id); i++) 1551 1551 { 1552 1552 Print("; id[%d] = ", i+1); -
libpolys/polys/nc/sca.h
r30664c r6fcddc9 16 16 17 17 18 static inline unsigned int scaFirstAltVar(ring r)18 static inline short scaFirstAltVar(ring r) 19 19 { 20 20 assume(rIsSCA(r)); … … 23 23 } 24 24 25 static inline unsigned int scaLastAltVar(ring r)25 static inline short scaLastAltVar(ring r) 26 26 { 27 27 assume(rIsSCA(r)); … … 32 32 33 33 // The following inlines are just helpers for setup functions. 34 static inline void scaFirstAltVar(ring r, int n)34 static inline void scaFirstAltVar(ring r, short n) 35 35 { 36 36 assume(rIsSCA(r)); … … 39 39 } 40 40 41 static inline void scaLastAltVar(ring r, int n)41 static inline void scaLastAltVar(ring r, short n) 42 42 { 43 43 assume(rIsSCA(r)); … … 54 54 // this is not a basic operation... but it for efficiency we did it specially for SCA: 55 55 // return x_i * pPoly; preserve pPoly. 56 poly sca_pp_Mult_xi_pp( unsigned int i, const poly pPoly, const ring rRing);56 poly sca_pp_Mult_xi_pp(short i, const poly pPoly, const ring rRing); 57 57 58 58 ////////////////////////////////////////////////////////////////////////////////////// … … 134 134 // reduce polynomial p modulo <y_i^2> , i = iFirstAltVar .. iLastAltVar 135 135 poly p_KillSquares(const poly p, 136 const unsigned int iFirstAltVar, const unsigned int iLastAltVar,136 const short iFirstAltVar, const short iLastAltVar, 137 137 const ring r); 138 138 … … 143 143 // default - no skipping! 144 144 ideal id_KillSquares(const ideal id, 145 const unsigned int iFirstAltVar, const unsigned int iLastAltVar,145 const short iFirstAltVar, const short iLastAltVar, 146 146 const ring r, const bool bSkipZeroes = false); 147 147
Note: See TracChangeset
for help on using the changeset viewer.