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
- solving eigenvalue problem

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

BABAK

Beginner

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

05-29-2016
10:58 AM

51 Views

solving eigenvalue problem

I am trying to solve the following eigenvalue problem using lapack95:

program comp USE mkl95_lapack USE mkl95_PRECISION USE mkl95_BLAS implicit none real, dimension(2,2) :: A real, dimension(1) :: t real, dimension(2) :: c A = reshape((/-5., 2., 2., -2./),(/2,2/)) call sytrd(A, t) call orgtr(A, t) call rsteqr(c, t, A) write(*,*) c end program comp

But the results aren't correct. I only can deduce this implementation from the program's help for lapack95. What would be the correct way for doing this implementation?

Link Copied

3 Replies

mecej4

Black Belt

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

05-29-2016
02:18 PM

51 Views

When you use the "computational" routines in Lapack, you have greater control over the individual phases of the computation, but you also take on the responsibility to understand what each routine does and how to use them in the correct sequence. I do not know what your real objective is (beyond this simple 2 X 2 matrix example), but here is your program, corrected:

program comp USE lapack95 implicit none integer i real, dimension(2,2) :: A real, dimension(2) :: tau, d real, dimension(1) :: e A = reshape((/-5., 2., 2., -2./),(/2,2/)) call sytrd(A, tau) do i=1,2 d(i)=A(i,i) end do e(1)=A(1,2) call rsteqr(d, e) write(*,*) d end program comp

When run, it gives the eigenvalues as -1, -6, which I can check by hand.

Ying_H_Intel

Employee

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

05-29-2016
06:47 PM

51 Views

Hi Babak,

If you'd like to try lapack driver function to Computes all eigenvalues and eigenvectors of a symmetric or Hermitian matrix

You may refer to the function list in setion of Symmetric Eigenproblems in mkl manual:

for example, you need eigenvalues only, it's more efficient to call sterf. If T is positive-definite, pteqr can compute small

eigenvalues more accurately than ?steqr.

To solve the problem by a single call, use one of the divide and conquer routines stevd, syevd, spevd, or

sbevd for real symmetric matrices or heevd, hpevd, or hbevd for complex Hermitian matrices.

Best Regards,

Ying

BABAK

Beginner

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

07-14-2016
04:12 AM

51 Views

Hi Mecej4,

How can I now compute the eigenvectors? I use the subroutine "call rsteqr(d,e,z)" with z as a (n,n) matrix, but the results are not correct.

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.