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
- Efficient calculation of vT A v

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

Carlos_C_

Beginner

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

01-02-2017
09:10 AM

30 Views

Efficient calculation of vT A v

Hi,

What is the most efficient way to calculate v^{T}Av where A is a CRS sparse matrix and v is a vector using Intel MKL (Fortran)?

Thanks in advance.

Carlos

Link Copied

3 Replies

Zhen_Z_Intel

Employee

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

01-02-2017
06:11 PM

30 Views

Dear customer,

The quadratic form x'*A*x is actually calculated as a sum of `n^2`

terms `A(i,j)*x(i)*x(j)`

, where `i`

and `j`

runs from `1`

to `n.`

Are you going to use CSR format for matrix A? If so, you could split the quadratic form into two equations. You could use mkl_?csrsymv to calculate y:=A*x first and then use ?dot to calculate sum of dot multiplication of two vectors res=x' * y. Hope it would be useful to you.

Best regards,

Fiona

Carlos_C_

Beginner

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

01-03-2017
07:49 AM

30 Views

Hi,

Thanks for the reply, I was wondering if there was a built-in function for such calculation in MKL, thus my question.

Best regards

Carlos

Zhen_Z_Intel

Employee

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

01-03-2017
06:10 PM

30 Views

Dear customer,

I am afraid there might no real quadratic form function for matrix with sparse storage format. The good way is to separate calculation. Thanks.

Best regards,

Fiona

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.