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_ctgsja( int matrix_order, char jobu, char jobv, char jobq,
00038 lapack_int m, lapack_int p, lapack_int n,
00039 lapack_int k, lapack_int l, lapack_complex_float* a,
00040 lapack_int lda, lapack_complex_float* b,
00041 lapack_int ldb, float tola, float tolb, float* alpha,
00042 float* beta, lapack_complex_float* u, lapack_int ldu,
00043 lapack_complex_float* v, lapack_int ldv,
00044 lapack_complex_float* q, lapack_int ldq,
00045 lapack_int* ncycle )
00046 {
00047 lapack_int info = 0;
00048 lapack_complex_float* work = NULL;
00049 if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
00050 LAPACKE_xerbla( "LAPACKE_ctgsja", -1 );
00051 return -1;
00052 }
00053 #ifndef LAPACK_DISABLE_NAN_CHECK
00054
00055 if( LAPACKE_cge_nancheck( matrix_order, m, n, a, lda ) ) {
00056 return -10;
00057 }
00058 if( LAPACKE_cge_nancheck( matrix_order, p, n, b, ldb ) ) {
00059 return -12;
00060 }
00061 if( LAPACKE_lsame( jobq, 'i' ) || LAPACKE_lsame( jobq, 'q' ) ) {
00062 if( LAPACKE_cge_nancheck( matrix_order, n, n, q, ldq ) ) {
00063 return -22;
00064 }
00065 }
00066 if( LAPACKE_s_nancheck( 1, &tola, 1 ) ) {
00067 return -14;
00068 }
00069 if( LAPACKE_s_nancheck( 1, &tolb, 1 ) ) {
00070 return -15;
00071 }
00072 if( LAPACKE_lsame( jobu, 'i' ) || LAPACKE_lsame( jobu, 'u' ) ) {
00073 if( LAPACKE_cge_nancheck( matrix_order, m, m, u, ldu ) ) {
00074 return -18;
00075 }
00076 }
00077 if( LAPACKE_lsame( jobv, 'i' ) || LAPACKE_lsame( jobv, 'v' ) ) {
00078 if( LAPACKE_cge_nancheck( matrix_order, p, p, v, ldv ) ) {
00079 return -20;
00080 }
00081 }
00082 #endif
00083
00084 work = (lapack_complex_float*)
00085 LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
00086 if( work == NULL ) {
00087 info = LAPACK_WORK_MEMORY_ERROR;
00088 goto exit_level_0;
00089 }
00090
00091 info = LAPACKE_ctgsja_work( matrix_order, jobu, jobv, jobq, m, p, n, k, l,
00092 a, lda, b, ldb, tola, tolb, alpha, beta, u, ldu,
00093 v, ldv, q, ldq, work, ncycle );
00094
00095 LAPACKE_free( work );
00096 exit_level_0:
00097 if( info == LAPACK_WORK_MEMORY_ERROR ) {
00098 LAPACKE_xerbla( "LAPACKE_ctgsja", info );
00099 }
00100 return info;
00101 }