Changeset a0f2b6 in git
- Timestamp:
- Aug 30, 2018, 11:00:33 AM (5 years ago)
- Branches:
- (u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
- Children:
- 72436190c57e0fc29bf8613364fedc842ab8f950
- Parents:
- 220277fa8e83a4114de1b10f16c45589bf2e4730
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/shiftop.cc
r220277f ra0f2b6 344 344 } 345 345 346 // appends m2ExpV to m1ExpV where m1Last is the last Vblock of m1 and m2Last the last Vblock of m2 347 // also adds their components (one of them is always zero) 346 // appends m2ExpV to m1ExpV, also adds their components (one of them is always zero) 348 347 void p_LPExpVappend(int *m1ExpV, int *m2ExpV, int m1Length, int m2Length, const ring ri) { 349 348 #ifdef SHIFT_MULT_DEBUG … … 366 365 } 367 366 368 // prepends m2ExpV to m1ExpV where m1Last is the last Vblock of m1 and m2Last the last Vblock of m2 369 // also adds their components (one of them is always zero) 367 // prepends m2ExpV to m1ExpV, also adds their components (one of them is always zero) 370 368 void p_LPExpVprepend(int *m1ExpV, int *m2ExpV, int m1Length, int m2Length, const ring ri) { 371 369 #ifdef SHIFT_MULT_DEBUG … … 376 374 assume(m1Length + m2Length <= ri->N); 377 375 378 // s ave m1379 int *m1Tmp=(int *)omAlloc0((m1Length+1)*sizeof(int));380 for (int i = 1; i < 1 + m1Length; ++i){381 m1 Tmp[i] = m1ExpV[i];376 // shift m1 by m2Length 377 for (int i = m2Length + m1Length; i >= 1 + m2Length; --i) 378 { 379 m1ExpV[i] = m1ExpV[i - m2Length]; 382 380 } 383 381 … … 388 386 m1ExpV[i] = m2ExpV[i]; 389 387 } 390 // then append m1 again391 for (int i = 1 + m2Length; i < 1 + m2Length + m1Length; ++i) {392 m1ExpV[i] = m1Tmp[i - m2Length];393 }394 omFreeSize((ADDRESS) m1Tmp, (m1Length+1)*sizeof(int));395 388 396 389 assume(m1ExpV[0] == 0 || m2ExpV[0] == 0); // one component should be zero (otherwise this doesn't make any sense)
Note: See TracChangeset
for help on using the changeset viewer.