| 551 | // and set the values to the corresponding input data. |
| 552 | template <typename T > |
| 553 | void remapData( const std::vector<T> &in, std::vector<T> &out ) |
| 554 | { |
| 555 | computeIndices(); |
| 556 | out.resize( m_numIdsUsed ); |
| 557 | for( unsigned int i = 0; i < m_fromOldIds.size(); i++ ) |
| 558 | { |
| 559 | auto &blockPointer = m_fromOldIds[ i ]; |
| 560 | if( blockPointer ) |
| 561 | { |
| 562 | std::vector<int> &block = *blockPointer; |
| 563 | for( int j = 0; j < m_blockSize; j++ ) |
| 564 | { |
| 565 | int newId = block[j]; |
| 566 | if( newId != -1 ) |
| 567 | { |
| 568 | int oldId = i * m_blockSize + j; |
| 569 | out[ newId ] = in[oldId]; |
| 570 | } |
| 571 | } |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | // Like remapData, but instead of returning remapped data, return the |
| 577 | // original id corresponding to each id of the output |
no test coverage detected