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

I want to take the sum of a product of two symmetric matrices, meaning that if A and B are symmetric matrices than I want to compute

c=sum(A*B)

where c is a scalar and the multiplication is done element wise. Is there some way to do this by using an MKL routine or is the fastest method using the default compiler commands?

Elad

1 Solution

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

**vectors**(i.e., 1-D arrays) that happen to be mis-arranged as square matrices. Look up the

**reshape**function in your Fortran manual, so that you can cast the operation that is desired by you into an equivalent scalar product evaluation.

Link Copied

4 Replies

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

**vectors**(i.e., 1-D arrays) that happen to be mis-arranged as square matrices. Look up the

**reshape**function in your Fortran manual, so that you can cast the operation that is desired by you into an equivalent scalar product evaluation.

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

Elad

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

Is there some routine other than reshape that converts a symmetrical matrix into a packed scheme?

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

[fortran]program treshape integer A(3,3) data A/11,12,13,21,22,23,31,32,33/ call sub(A,3*3) end program treshape subroutine sub(A,n) integer A(n) write(*,10)(i,A(i),i=1,n) 10 format(I4,2x,I4) return end subroutine sub [/fortran]Converting a dense matrix to packed or banded matrices is straightforward. Read the section on matrix storage schemes in the MKL manual.

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