- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I Have a 8x8 symmetric matrix A and I wont compute the eigenvalues and eigenvectors with dsyevd function.
The parameter are following:
but the output program is incorrect !!? why?
help me, please!!!
The parameter are following:
...
// Var dichiaration
job = 'V';
uplo = 'L';
n = 8;
lda = 8;
lwork = 3*pow(n,2)+(5+2*3)*n+1;
liwork = 5*n+2;
// alloc the vectors
work = (double*)calloc(lwork,sizeof(double));
w = (double*)calloc(n,sizeof(double));
iwork = (int*)calloc(liwork,sizeof(int));
// call dsyevd for compute the eigenvalues and eigenvectors
dsyevd(&job,&uplo,&n,A,&lda,w,work,&lwork,iwork,&liwork,&info);
...
but the output program is incorrect !!? why?
help me, please!!!
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(float *)--->(double *)
or
dsyevd--->ssyevd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry, I have been wrong to write...
but the problem remains!
but the problem remains!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the "A" matrix is a two-dimensional or one-dimensional array?
A = (double**)malloc(n*double*);
for(i=0; i
A=(double*)calloc(n,sizeof(double));
}or
A = (double*)calloc(n,sizeof(double));where n = 8 ?????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's a 2-dimensional Fortran array, not a **.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can declare an array in C of size n*n of type double for !, and be sure to load in in Fortran style, i.e., column order, as I had stated in an earlier response.
lda will be set to n in this case.
Bruce
Reply
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