- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am sure this is possible but my aged brain has so far failed me.
I would like to find the maximum of every n elements of an array, for example if n is 5 then I want the max of a[0 to 4], max of a[5 to 9], max of a[10 to 14] and so on.
I'm doing this quite a lot at times so would like to save some cycles and the planet in the process.
TTFN
I am sure this is possible but my aged brain has so far failed me.
I would like to find the maximum of every n elements of an array, for example if n is 5 then I want the max of a[0 to 4], max of a[5 to 9], max of a[10 to 14] and so on.
I'm doing this quite a lot at times so would like to save some cycles and the planet in the process.
TTFN
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
IPP library has got a functions ippsMaxIndx which is declared in ipps.h
This function returns the maximum value of the input vector pSrc, and stores the result in pMax.
I hope this function could be helpful for you to find max value in an array.
Below is small example of usage of this function.
Ipp16s src[] = { 1, -2, 3, 8, -6 };
Ipp16s max;
int len = 5;
int indx;
ippsMaxIndx_16s ( src, len, &max, &indx );
result: max = 8 indx = 3
Regards,
Naveen Gv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Naveen, but the calls to ippsMaxIndx_16s would introduce too much overhead. I was rather hoping that there was a function in IPP that would do what I want. I can live without this actually :)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page