00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "lapacke.h"
00035 #include "lapacke_utils.h"
00036
00037 lapack_int LAPACKE_dspgvx( int matrix_order, lapack_int itype, char jobz,
00038 char range, char uplo, lapack_int n, double* ap,
00039 double* bp, double vl, double vu, lapack_int il,
00040 lapack_int iu, double abstol, lapack_int* m,
00041 double* w, double* z, lapack_int ldz,
00042 lapack_int* ifail )
00043 {
00044 lapack_int info = 0;
00045 lapack_int* iwork = NULL;
00046 double* work = NULL;
00047 if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
00048 LAPACKE_xerbla( "LAPACKE_dspgvx", -1 );
00049 return -1;
00050 }
00051 #ifndef LAPACK_DISABLE_NAN_CHECK
00052
00053 if( LAPACKE_d_nancheck( 1, &abstol, 1 ) ) {
00054 return -13;
00055 }
00056 if( LAPACKE_dsp_nancheck( n, ap ) ) {
00057 return -7;
00058 }
00059 if( LAPACKE_dsp_nancheck( n, bp ) ) {
00060 return -8;
00061 }
00062 if( LAPACKE_lsame( range, 'v' ) ) {
00063 if( LAPACKE_d_nancheck( 1, &vl, 1 ) ) {
00064 return -9;
00065 }
00066 }
00067 if( LAPACKE_lsame( range, 'v' ) ) {
00068 if( LAPACKE_d_nancheck( 1, &vu, 1 ) ) {
00069 return -10;
00070 }
00071 }
00072 #endif
00073
00074 iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,5*n) );
00075 if( iwork == NULL ) {
00076 info = LAPACK_WORK_MEMORY_ERROR;
00077 goto exit_level_0;
00078 }
00079 work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,8*n) );
00080 if( work == NULL ) {
00081 info = LAPACK_WORK_MEMORY_ERROR;
00082 goto exit_level_1;
00083 }
00084
00085 info = LAPACKE_dspgvx_work( matrix_order, itype, jobz, range, uplo, n, ap,
00086 bp, vl, vu, il, iu, abstol, m, w, z, ldz, work,
00087 iwork, ifail );
00088
00089 LAPACKE_free( work );
00090 exit_level_1:
00091 LAPACKE_free( iwork );
00092 exit_level_0:
00093 if( info == LAPACK_WORK_MEMORY_ERROR ) {
00094 LAPACKE_xerbla( "LAPACKE_dspgvx", info );
00095 }
00096 return info;
00097 }