Changeset a0f2b6 in git


Ignore:
Timestamp:
Aug 30, 2018, 11:00:33 AM (6 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
72436190c57e0fc29bf8613364fedc842ab8f950
Parents:
220277fa8e83a4114de1b10f16c45589bf2e4730
Message:
Make prepend more efficient in letterplace kernel multiplication
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/shiftop.cc

    r220277f ra0f2b6  
    344344}
    345345
    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)
    348347void p_LPExpVappend(int *m1ExpV, int *m2ExpV, int m1Length, int m2Length, const ring ri) {
    349348#ifdef SHIFT_MULT_DEBUG
     
    366365}
    367366
    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)
    370368void p_LPExpVprepend(int *m1ExpV, int *m2ExpV, int m1Length, int m2Length, const ring ri) {
    371369#ifdef SHIFT_MULT_DEBUG
     
    376374  assume(m1Length + m2Length <= ri->N);
    377375
    378   // save m1
    379   int *m1Tmp=(int *)omAlloc0((m1Length+1)*sizeof(int));
    380   for (int i = 1; i < 1 + m1Length; ++i) {
    381     m1Tmp[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];
    382380  }
    383381
     
    388386    m1ExpV[i] = m2ExpV[i];
    389387  }
    390   // then append m1 again
    391   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));
    395388
    396389  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.