Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Getting a vector subset

David_B_11
Beginner
223 Views

Hi,

I'm new to IPP, and I have a somewhat basic question. Suppose I have a vector "v" of float32 values 1-9. I want to take some of the middle values (e.g. 5-7) and assign them to another vector "v_subset." I can't seem to find the function to do that. ippsMove_32f and ippsCopy_32f seem to only allow me to take the first x values of the vector, but I'm interested in a subset from the middle of the vector. Basically, what I'm trying to accomplish is something like the following:

void main()

{

Ipp32f v[9] = {1,2,3,4,5,6,7,8,9};

Ipp32f v_subset[3];

\\ some function that sets Ipp32f v_subset equal to {"5 6 7"}

}

Thanks for your help!

0 Kudos
2 Replies
SergeyKostrov
Valued Contributor II
223 Views
Hi David, You need to do this: ... Ipp32f v[9] = {1,2,3,4,5,6,7,8,9}; Ipp32f v_subset[3] = { 0, 0, 0 }; ippsCopy_32f( &v[4], &v_subset[0], 3 ); ...
0 Kudos
David_B_11
Beginner
223 Views
Works! Thanks Sergey for your quick reply and help. -David
0 Kudos
Reply