- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I need to get the sign value of each element in a vector.
is there a simple way to do so.
exp:
input: (32float) 1.26 0 63.54 -8.3 -1.2 1.6 5 -9 ....
output: 1 1 1 -1 -1 1 1 -1
thanks
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can you check the ippsThreshold_LTValGTVal function?
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear customer,
You could use IPP threshold_LT & GT function, for instance:
ippsThreshold_LT_32s(pSrc, pDst, len, -1); //replace all value with -1, if <-1 ippsThreshold_GT_32s(pSrc, pDst, len, 1); //otherwise set to 1
Hope it would be useful to you.
Best regards,
Fiona
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
another, may be the fastest, method is to use ippsRShiftC functions - just cast pointers as (Ipp32s*) and shift on 31:
IPPAPI(IppStatus, ippsRShiftC_32s, (const Ipp32s* pSrc, int val, Ipp32s* pDst, int len))
and then in-place ippsOrC with 1 (cast pointers as Ipp32u):
IPPAPI(IppStatus, ippsOrC_32u_I, ( Ipp32u val, Ipp32u* pSrcDst, int len))
regards, Igor

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page