Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- Better way to compute phi0 + sigma*vector?

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

Fiori

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-30-2016
05:23 PM

54 Views

Better way to compute phi0 + sigma*vector?

Hello!

I want to compute this quantity **prob = phi0 + sigma*atilde**, where phi0 and sigma are scalars and atilde a vector 1xind. I have computed it like this:

for(i=0;i<ind;i++){ones= 1.0;} cblas_dcopy(ind, ones, 1, B, 1); cblas_dscal(ind, phi0, B, 1); cblas_dcopy(ind, atilde, 1, Bcan, 1); cblas_dscal(ind, sqrt(sigma2), Bcan, 1); vdAdd(ind, B, Bcan, prob);

I would like to ask if there is a better way to do it.

Thank you very much.

1 Solution

Andrey_N_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-30-2016
10:55 PM

54 Views

Hi,

you might want to have a look at Intel MKL VM v?LinearFrac() function with shifta=phi, scalea=sigma, a=atilde, scaleb=0, b declared, and shiftb=1.The additional details on the function and respective examples are available https://software.intel.com/en-us/node/521774

Andrey

Link Copied

2 Replies

Andrey_N_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-30-2016
10:55 PM

55 Views

Hi,

you might want to have a look at Intel MKL VM v?LinearFrac() function with shifta=phi, scalea=sigma, a=atilde, scaleb=0, b declared, and shiftb=1.The additional details on the function and respective examples are available https://software.intel.com/en-us/node/521774

Andrey

Fiori

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-01-2016
11:47 AM

54 Views

You are the best!!! Thanks a lot!!!

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

For more complete information about compiler optimizations, see our Optimization Notice.