- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Thor Andreas
PS: Any Intel libraries who does interpolation? spline?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you find another solution, please let us know!
Koen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Thanks
Thor Andreas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andreas,
it seems that SIMD can't be applied efficiently for such algorithm so just a pure C code should be good enough. What do you think?
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vladimir,
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:
for(int k=0;k{
iKhat = (int)floor(pTi);
iKhat = max(0,iKhat); iKhat = min(iKhat,pLength-2);
iTfractional = pTi- iKhat;
Out= 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.
Thanks,
Thor Andreas
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page