I have situation where I have a vector and a set of indices in this vector. The number of indices is equal the number of elements in the vector. Then I want copy the value of the vector at the specific indices over to a second vector. Can IPP (or other intel libraries) be used to perform this task?
I guess you would do something like taking the pointer to the beginning of the vector and add the indices and take the value at this memory location:
B = value_at(A+ix);
Any help would be highly appreciated.
I will use this to perform interpolation. Find the interpolation coefficients based on the closest index to the point you would like to interpolate.
PS: Any Intel libraries who does interpolation? spline?
If you find another solution, please let us know!
I have developed my own interpolation library based on the IPP functions. The library does linear,shifted linear and cubic spline interpolation for 32f and 32fc. But to optimize this library such a function I sugested would be very nice.
Sounds reasonable. I did not really expect to find such an operation either. I though that there might have been a routine that could e.g. load a 32bit value from 4 memory locations at the same time, but that migtht not be that easy to implement
. Doing this by using a regular for loop works OK though.
What I am doing is this:
iKhat = (int)floor(pTi
iKhat = max(0,iKhat); iKhat = min(iKhat,pLength-2);
iTfractional = pTi
= iCoefs[iKhat+1]*iTfractional + iCoefs[iKhat]*(1.0f-iTfractional);
The flooring,max/min, the subtraction,addition and multiplication can be done using SIMD, but its the retrieving of the coefs from the remapped positions kHat which is not possible to do using some kind of SIMD. But this might not be so performance degrading.