Register to reply

Fortran LAPACK DYSEV

by tarekph
Tags: dysev, fortran, lapack
Share this thread:
tarekph
#1
May24-12, 04:47 PM
P: 1
Hello
I am a beginner in programming with Fortran and I want to use the LAPACK DSYEV in my program.
I am an example to determine the eigenvalues ​​of a matrix (3x3) after I use it in my program but when I compile I get this error
"" "" "** One entry to DSYEV parameter number 5 Had an illegal value" "" ""
Here is my example:
Program eigenvalue

implicit none

! statements
double precision :: A (3.3), w (3), Work (3)
integer :: i INFO, LWORK, LDA = 3
character :: N, U

! A matrix
A (1 : ) = (/ 3, 1, 3 /)
A (2, : ) = (/ 1, 5, 6 /)
A (3 : ) = (/ 3, 6, 5 /)




CALL DSYEV ('N', 'U', 3, Q, W, LDA, WORK, LWORK, INFO)

! print the solution
do i = 1, 3
write (*, 9) i, w (i)
end do

9 format ('x [' i1 '] =', f5.2)
end programs eigenvalue
I know not how I met the LDA or WORK .. LWORK........
thank you
Phys.Org News Partner Science news on Phys.org
Suddenly, the sun is eerily quiet: Where did the sunspots go?
'Moral victories' might spare you from losing again
Mammoth and mastodon behavior was less roam, more stay at home
Mark44
#2
May24-12, 05:41 PM
Mentor
P: 21,216
Quote Quote by tarekph View Post
Hello
I am a beginner in programming with Fortran and I want to use the LAPACK DSYEV in my program.
I am an example to determine the eigenvalues ​​of a matrix (3x3) after I use it in my program but when I compile I get this error
"" "" "** One entry to DSYEV parameter number 5 Had an illegal value" "" ""
Here is my example:
Program eigenvalue

implicit none

! statements
double precision :: A (3.3), w (3), Work (3)
integer :: i INFO, LWORK, LDA = 3
character :: N, U

! A matrix
A (1 : ) = (/ 3, 1, 3 /)
A (2, : ) = (/ 1, 5, 6 /)
A (3 : ) = (/ 3, 6, 5 /)




CALL DSYEV ('N', 'U', 3, Q, W, LDA, WORK, LWORK, INFO)

! print the solution
do i = 1, 3
write (*, 9) i, w (i)
end do

9 format ('x [' i1 '] =', f5.2)
end programs eigenvalue
I know not how I met the LDA or WORK .. LWORK........
thank you
I see a couple of mistakes in your code.
1) In this line -- double precision :: A (3.3) -- there should be a comma between the two 3s, not a period.
2) You passed Q in the call to DSYEV. That's the parameter that should be the array A.

I found a link to some documentation on DSYEV - it explains what the parameters need to be - http://www.netlib.org/lapack/double/dsyev.f


Register to reply

Related Discussions
Fortran Lapack Compile Issue Programming & Computer Science 5
Strange results using dgesv (lapack) via fortran 90 Programming & Computer Science 7
Lapack/blas routine to solve y = Ax Engineering, Comp Sci, & Technology Homework 1
LAPACK for Fortran under Cygwin Math & Science Software 2
Accessing Fortran Modules within a Fortran library from Fortran Programming & Computer Science 0