lapack_int LAPACKE_strsyl( int matrix_layout, char trana, char tranb, lapack_int isgn, lapack_int m, lapack_int n, const float* a, lapack_int lda, const float* b, lapack_int ldb, float* c, lapack_int ldc, float* scale ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_strsyl", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, m, m, a, lda ) ) { return -7; } if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) { return -9; } if( LAPACKE_sge_nancheck( matrix_layout, m, n, c, ldc ) ) { return -11; } #endif return LAPACKE_strsyl_work( matrix_layout, trana, tranb, isgn, m, n, a, lda, b, ldb, c, ldc, scale ); }
lapack_int LAPACKE_sgghrd( int matrix_order, char compq, char compz, lapack_int n, lapack_int ilo, lapack_int ihi, float* a, lapack_int lda, float* b, lapack_int ldb, float* q, lapack_int ldq, float* z, lapack_int ldz ) { if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sgghrd", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_order, n, n, a, lda ) ) { return -7; } if( LAPACKE_sge_nancheck( matrix_order, n, n, b, ldb ) ) { return -9; } if( LAPACKE_lsame( compq, 'i' ) || LAPACKE_lsame( compq, 'v' ) ) { if( LAPACKE_sge_nancheck( matrix_order, n, n, q, ldq ) ) { return -11; } } if( LAPACKE_lsame( compz, 'i' ) || LAPACKE_lsame( compz, 'v' ) ) { if( LAPACKE_sge_nancheck( matrix_order, n, n, z, ldz ) ) { return -13; } } #endif return LAPACKE_sgghrd_work( matrix_order, compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z, ldz ); }
lapack_int LAPACKE_sgghd3( int matrix_layout, char compq, char compz, lapack_int n, lapack_int ilo, lapack_int ihi, float* a, lapack_int lda, float* b, lapack_int ldb, float* q, lapack_int ldq, float* z, lapack_int ldz ) { lapack_int info = 0; lapack_int lwork = -1; float* work = NULL; float work_query; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sgghd3", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) { return -7; } if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) { return -9; } if( LAPACKE_lsame( compq, 'i' ) || LAPACKE_lsame( compq, 'v' ) ) { if( LAPACKE_sge_nancheck( matrix_layout, n, n, q, ldq ) ) { return -11; } } if( LAPACKE_lsame( compz, 'i' ) || LAPACKE_lsame( compz, 'v' ) ) { if( LAPACKE_sge_nancheck( matrix_layout, n, n, z, ldz ) ) { return -13; } } } #endif /* Query optimal working array(s) size */ info = LAPACKE_sgghd3_work( matrix_layout, compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z, ldz, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sgghd3_work( matrix_layout, compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z, ldz, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sgghd3", info ); } return info; }
lapack_int LAPACKE_stprfb( int matrix_layout, char side, char trans, char direct, char storev, lapack_int m, lapack_int n, lapack_int k, lapack_int l, const float* v, lapack_int ldv, const float* t, lapack_int ldt, float* a, lapack_int lda, float* b, lapack_int ldb) { lapack_int info = 0; lapack_int ldwork; lapack_int work_size; float* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_stprfb", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, k, m, a, lda ) ) { return -14; } if( LAPACKE_sge_nancheck( matrix_layout, m, n, b, ldb ) ) { return -16; } if( LAPACKE_sge_nancheck( matrix_layout, ldt, k, t, ldt ) ) { return -12; } if( LAPACKE_sge_nancheck( matrix_layout, ldv, k, v, ldv ) ) { return -10; } #endif if (side=='l' || side=='L') { ldwork = k; work_size = MAX(1,ldwork) * MAX(1,n); } else { ldwork = m; work_size = MAX(1,ldwork) * MAX(1,k); } /* Allocate memory for working array(s) */ work = (float*) LAPACKE_malloc( sizeof(float) * work_size ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_stprfb_work( matrix_layout, side, trans, direct, storev, m, n, k, l, v, ldv, t, ldt, a, lda, b, ldb, work, ldwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_stprfb", info ); } return info; }
lapack_int LAPACKE_spbrfs( int matrix_layout, char uplo, lapack_int n, lapack_int kd, lapack_int nrhs, const float* ab, lapack_int ldab, const float* afb, lapack_int ldafb, const float* b, lapack_int ldb, float* x, lapack_int ldx, float* ferr, float* berr ) { lapack_int info = 0; lapack_int* iwork = NULL; float* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_spbrfs", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_spb_nancheck( matrix_layout, uplo, n, kd, ab, ldab ) ) { return -6; } if( LAPACKE_spb_nancheck( matrix_layout, uplo, n, kd, afb, ldafb ) ) { return -8; } if( LAPACKE_sge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) { return -10; } if( LAPACKE_sge_nancheck( matrix_layout, n, nrhs, x, ldx ) ) { return -12; } } #endif /* Allocate memory for working array(s) */ iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,n) ); if( iwork == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,3*n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_1; } /* Call middle-level interface */ info = LAPACKE_spbrfs_work( matrix_layout, uplo, n, kd, nrhs, ab, ldab, afb, ldafb, b, ldb, x, ldx, ferr, berr, work, iwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_1: LAPACKE_free( iwork ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_spbrfs", info ); } return info; }
lapack_int LAPACKE_sormbr( int matrix_layout, char vect, char side, char trans, lapack_int m, lapack_int n, lapack_int k, const float* a, lapack_int lda, const float* tau, float* c, lapack_int ldc ) { lapack_int info = 0; lapack_int lwork = -1; float* work = NULL; float work_query; lapack_int nq, ar, ac; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sormbr", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ nq = LAPACKE_lsame( side, 'l' ) ? m : n; ar = LAPACKE_lsame( vect, 'q' ) ? nq : MIN(nq,k); ac = LAPACKE_lsame( vect, 'q' ) ? MIN(nq,k) : nq; if( LAPACKE_sge_nancheck( matrix_layout, ar, ac, a, lda ) ) { return -8; } if( LAPACKE_sge_nancheck( matrix_layout, m, n, c, ldc ) ) { return -11; } if( LAPACKE_s_nancheck( MIN(nq,k), tau, 1 ) ) { return -10; } #endif /* Query optimal working array(s) size */ info = LAPACKE_sormbr_work( matrix_layout, vect, side, trans, m, n, k, a, lda, tau, c, ldc, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sormbr_work( matrix_layout, vect, side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sormbr", info ); } return info; }
lapack_int LAPACKE_sbdsqr( int matrix_layout, char uplo, lapack_int n, lapack_int ncvt, lapack_int nru, lapack_int ncc, float* d, float* e, float* vt, lapack_int ldvt, float* u, lapack_int ldu, float* c, lapack_int ldc ) { lapack_int info = 0; float* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sbdsqr", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( ncc != 0 ) { if( LAPACKE_sge_nancheck( matrix_layout, n, ncc, c, ldc ) ) { return -13; } } if( LAPACKE_s_nancheck( n, d, 1 ) ) { return -7; } if( LAPACKE_s_nancheck( n-1, e, 1 ) ) { return -8; } if( nru != 0 ) { if( LAPACKE_sge_nancheck( matrix_layout, nru, n, u, ldu ) ) { return -11; } } if( ncvt != 0 ) { if( LAPACKE_sge_nancheck( matrix_layout, n, ncvt, vt, ldvt ) ) { return -9; } } #endif /* Allocate memory for working array(s) */ work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,4*n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sbdsqr_work( matrix_layout, uplo, n, ncvt, nru, ncc, d, e, vt, ldvt, u, ldu, c, ldc, work ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sbdsqr", info ); } return info; }
lapack_int LAPACKE_stgevc( int matrix_layout, char side, char howmny, const lapack_logical* select, lapack_int n, const float* s, lapack_int lds, const float* p, lapack_int ldp, float* vl, lapack_int ldvl, float* vr, lapack_int ldvr, lapack_int mm, lapack_int* m ) { lapack_int info = 0; float* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_stgevc", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, n, n, p, ldp ) ) { return -8; } if( LAPACKE_sge_nancheck( matrix_layout, n, n, s, lds ) ) { return -6; } if( LAPACKE_lsame( side, 'b' ) || LAPACKE_lsame( side, 'l' ) ) { if( LAPACKE_sge_nancheck( matrix_layout, n, mm, vl, ldvl ) ) { return -10; } } if( LAPACKE_lsame( side, 'b' ) || LAPACKE_lsame( side, 'r' ) ) { if( LAPACKE_sge_nancheck( matrix_layout, n, mm, vr, ldvr ) ) { return -12; } } } #endif /* Allocate memory for working array(s) */ work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,6*n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_stgevc_work( matrix_layout, side, howmny, select, n, s, lds, p, ldp, vl, ldvl, vr, ldvr, mm, m, work ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_stgevc", info ); } return info; }
lapack_int LAPACKE_sgglse( int matrix_layout, lapack_int m, lapack_int n, lapack_int p, float* a, lapack_int lda, float* b, lapack_int ldb, float* c, float* d, float* x ) { lapack_int info = 0; lapack_int lwork = -1; float* work = NULL; float work_query; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sgglse", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) { return -5; } if( LAPACKE_sge_nancheck( matrix_layout, p, n, b, ldb ) ) { return -7; } if( LAPACKE_s_nancheck( m, c, 1 ) ) { return -9; } if( LAPACKE_s_nancheck( p, d, 1 ) ) { return -10; } #endif /* Query optimal working array(s) size */ info = LAPACKE_sgglse_work( matrix_layout, m, n, p, a, lda, b, ldb, c, d, x, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sgglse_work( matrix_layout, m, n, p, a, lda, b, ldb, c, d, x, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sgglse", info ); } return info; }
lapack_int LAPACKE_sggbal( int matrix_layout, char job, lapack_int n, float* a, lapack_int lda, float* b, lapack_int ldb, lapack_int* ilo, lapack_int* ihi, float* lscale, float* rscale ) { lapack_int info = 0; /* Additional scalars declarations for work arrays */ lapack_int lwork; float* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sggbal", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_lsame( job, 'p' ) || LAPACKE_lsame( job, 's' ) || LAPACKE_lsame( job, 'b' ) ) { if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) { return -4; } } if( LAPACKE_lsame( job, 'p' ) || LAPACKE_lsame( job, 's' ) || LAPACKE_lsame( job, 'b' ) ) { if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) { return -6; } } #endif /* Additional scalars initializations for work arrays */ if( LAPACKE_lsame( job, 's' ) || LAPACKE_lsame( job, 'b' ) ) { lwork = MAX(1,6*n); } else { lwork = 1; } /* Allocate memory for working array(s) */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sggbal_work( matrix_layout, job, n, a, lda, b, ldb, ilo, ihi, lscale, rscale, work ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sggbal", info ); } return info; }
lapack_int LAPACKE_strrfs( int matrix_order, char uplo, char trans, char diag, lapack_int n, lapack_int nrhs, const float* a, lapack_int lda, const float* b, lapack_int ldb, const float* x, lapack_int ldx, float* ferr, float* berr ) { lapack_int info = 0; lapack_int* iwork = NULL; float* work = NULL; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_strrfs", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_str_nancheck( matrix_order, uplo, diag, n, a, lda ) ) { return -7; } if( LAPACKE_sge_nancheck( matrix_order, n, nrhs, b, ldb ) ) { return -9; } if( LAPACKE_sge_nancheck( matrix_order, n, nrhs, x, ldx ) ) { return -11; } #endif /* Allocate memory for working array(s) */ iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,n) ); if( iwork == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,3*n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_1; } /* Call middle-level interface */ info = LAPACKE_strrfs_work( matrix_order, uplo, trans, diag, n, nrhs, a, lda, b, ldb, x, ldx, ferr, berr, work, iwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_1: LAPACKE_free( iwork ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_strrfs", info ); } return info; }
lapack_int LAPACKE_sggev( int matrix_layout, char jobvl, char jobvr, lapack_int n, float* a, lapack_int lda, float* b, lapack_int ldb, float* alphar, float* alphai, float* beta, float* vl, lapack_int ldvl, float* vr, lapack_int ldvr ) { lapack_int info = 0; lapack_int lwork = -1; float* work = NULL; float work_query; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sggev", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) { return -5; } if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) { return -7; } #endif /* Query optimal working array(s) size */ info = LAPACKE_sggev_work( matrix_layout, jobvl, jobvr, n, a, lda, b, ldb, alphar, alphai, beta, vl, ldvl, vr, ldvr, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sggev_work( matrix_layout, jobvl, jobvr, n, a, lda, b, ldb, alphar, alphai, beta, vl, ldvl, vr, ldvr, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sggev", info ); } return info; }
lapack_int LAPACKE_sgelsy( int matrix_order, lapack_int m, lapack_int n, lapack_int nrhs, float* a, lapack_int lda, float* b, lapack_int ldb, lapack_int* jpvt, float rcond, lapack_int* rank ) { lapack_int info = 0; lapack_int lwork = -1; float* work = NULL; float work_query; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sgelsy", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_order, m, n, a, lda ) ) { return -5; } if( LAPACKE_sge_nancheck( matrix_order, MAX(m,n), nrhs, b, ldb ) ) { return -7; } if( LAPACKE_s_nancheck( 1, &rcond, 1 ) ) { return -10; } #endif /* Query optimal working array(s) size */ info = LAPACKE_sgelsy_work( matrix_order, m, n, nrhs, a, lda, b, ldb, jpvt, rcond, rank, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sgelsy_work( matrix_order, m, n, nrhs, a, lda, b, ldb, jpvt, rcond, rank, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sgelsy", info ); } return info; }
lapack_int LAPACKE_sgesvj( int matrix_layout, char joba, char jobu, char jobv, lapack_int m, lapack_int n, float* a, lapack_int lda, float* sva, lapack_int mv, float* v, lapack_int ldv, float* stat ) { lapack_int info = 0; lapack_int lwork = MAX(6,m+n); float* work = NULL; lapack_int i; lapack_int nrows_v; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sgesvj", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ nrows_v = LAPACKE_lsame( jobv, 'v' ) ? MAX(0,n) : ( LAPACKE_lsame( jobv, 'a' ) ? MAX(0,mv) : 0 ); if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) { return -7; } if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 'v' ) ) { if( LAPACKE_sge_nancheck( matrix_layout, nrows_v, n, v, ldv ) ) { return -11; } } #endif /* Allocate memory for working array(s) */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } work[0] = stat[0]; /* Significant if jobu = 'c' */ /* Call middle-level interface */ info = LAPACKE_sgesvj_work( matrix_layout, joba, jobu, jobv, m, n, a, lda, sva, mv, v, ldv, work, lwork ); /* Backup significant data from working array(s) */ for( i=0; i<6; i++ ) { stat[i] = work[i]; } /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sgesvj", info ); } return info; }
lapack_int LAPACKE_sormlq( int matrix_order, char side, char trans, lapack_int m, lapack_int n, lapack_int k, const float* a, lapack_int lda, const float* tau, float* c, lapack_int ldc ) { lapack_int info = 0; lapack_int lwork = -1; float* work = NULL; float work_query; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sormlq", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_order, k, m, a, lda ) ) { return -7; } if( LAPACKE_sge_nancheck( matrix_order, m, n, c, ldc ) ) { return -10; } if( LAPACKE_s_nancheck( k, tau, 1 ) ) { return -9; } #endif /* Query optimal working array(s) size */ info = LAPACKE_sormlq_work( matrix_order, side, trans, m, n, k, a, lda, tau, c, ldc, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sormlq_work( matrix_order, side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sormlq", info ); } return info; }
lapack_int LAPACKE_shseqr( int matrix_order, char job, char compz, lapack_int n, lapack_int ilo, lapack_int ihi, float* h, lapack_int ldh, float* wr, float* wi, float* z, lapack_int ldz ) { lapack_int info = 0; lapack_int lwork = -1; float* work = NULL; float work_query; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_shseqr", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_order, n, n, h, ldh ) ) { return -7; } if( LAPACKE_lsame( compz, 'i' ) || LAPACKE_lsame( compz, 'v' ) ) { if( LAPACKE_sge_nancheck( matrix_order, n, n, z, ldz ) ) { return -11; } } #endif /* Query optimal working array(s) size */ info = LAPACKE_shseqr_work( matrix_order, job, compz, n, ilo, ihi, h, ldh, wr, wi, z, ldz, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_shseqr_work( matrix_order, job, compz, n, ilo, ihi, h, ldh, wr, wi, z, ldz, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_shseqr", info ); } return info; }
lapack_int LAPACKE_stfsm( int matrix_layout, char transr, char side, char uplo, char trans, char diag, lapack_int m, lapack_int n, float alpha, const float* a, float* b, lapack_int ldb ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_stfsm", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( IS_S_NONZERO(alpha) ) { if( LAPACKE_stf_nancheck( matrix_layout, transr, uplo, diag, n, a ) ) { return -10; } } if( LAPACKE_s_nancheck( 1, &alpha, 1 ) ) { return -9; } if( IS_S_NONZERO(alpha) ) { if( LAPACKE_sge_nancheck( matrix_layout, m, n, b, ldb ) ) { return -11; } } } #endif return LAPACKE_stfsm_work( matrix_layout, transr, side, uplo, trans, diag, m, n, alpha, a, b, ldb ); }
lapack_int LAPACKE_sstedc( int matrix_order, char compz, lapack_int n, float* d, float* e, float* z, lapack_int ldz ) { lapack_int info = 0; lapack_int liwork = -1; lapack_int lwork = -1; lapack_int* iwork = NULL; float* work = NULL; lapack_int iwork_query; float work_query; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sstedc", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_s_nancheck( n, d, 1 ) ) { return -4; } if( LAPACKE_s_nancheck( n-1, e, 1 ) ) { return -5; } if( LAPACKE_lsame( compz, 'i' ) || LAPACKE_lsame( compz, 'v' ) ) { if( LAPACKE_sge_nancheck( matrix_order, n, n, z, ldz ) ) { return -6; } } #endif /* Query optimal working array(s) size */ info = LAPACKE_sstedc_work( matrix_order, compz, n, d, e, z, ldz, &work_query, lwork, &iwork_query, liwork ); if( info != 0 ) { goto exit_level_0; } liwork = (lapack_int)iwork_query; lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork ); if( iwork == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_1; } /* Call middle-level interface */ info = LAPACKE_sstedc_work( matrix_order, compz, n, d, e, z, ldz, work, lwork, iwork, liwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_1: LAPACKE_free( iwork ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sstedc", info ); } return info; }
lapack_int LAPACKE_sgeqrt( int matrix_layout, lapack_int m, lapack_int n, lapack_int nb, float* a, lapack_int lda, float* t, lapack_int ldt ) { lapack_int info = 0; float* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sgeqrt", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) { return -5; } #endif /* Allocate memory for working array(s) */ work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,nb) * MAX(1,n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sgeqrt_work( matrix_layout, m, n, nb, a, lda, t, ldt, work ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sgeqrt", info ); } return info; }
lapack_logical LAPACKE_sgg_nancheck( int matrix_order, lapack_int m, lapack_int n, const float *a, lapack_int lda ) { return LAPACKE_sge_nancheck( matrix_order, m, n, a, lda ); }
lapack_int LAPACKE_ssfrk( int matrix_order, char transr, char uplo, char trans, lapack_int n, lapack_int k, float alpha, const float* a, lapack_int lda, float beta, float* c ) { if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_ssfrk", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ lapack_int ka = LAPACKE_lsame( trans, 'n' ) ? k : n; lapack_int na = LAPACKE_lsame( trans, 'n' ) ? n : k; if( LAPACKE_sge_nancheck( matrix_order, na, ka, a, lda ) ) { return -8; } if( LAPACKE_s_nancheck( 1, &alpha, 1 ) ) { return -7; } if( LAPACKE_s_nancheck( 1, &beta, 1 ) ) { return -10; } if( LAPACKE_spf_nancheck( n, c ) ) { return -11; } #endif return LAPACKE_ssfrk_work( matrix_order, transr, uplo, trans, n, k, alpha, a, lda, beta, c ); }
lapack_int LAPACKE_sposvx( int matrix_layout, char fact, char uplo, lapack_int n, lapack_int nrhs, float* a, lapack_int lda, float* af, lapack_int ldaf, char* equed, float* s, float* b, lapack_int ldb, float* x, lapack_int ldx, float* rcond, float* ferr, float* berr ) { lapack_int info = 0; lapack_int* iwork = NULL; float* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sposvx", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_spo_nancheck( matrix_layout, uplo, n, a, lda ) ) { return -6; } if( LAPACKE_lsame( fact, 'f' ) ) { if( LAPACKE_spo_nancheck( matrix_layout, uplo, n, af, ldaf ) ) { return -8; } } if( LAPACKE_sge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) { return -12; } if( LAPACKE_lsame( fact, 'f' ) && LAPACKE_lsame( *equed, 'y' ) ) { if( LAPACKE_s_nancheck( n, s, 1 ) ) { return -11; } } } #endif /* Allocate memory for working array(s) */ iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,n) ); if( iwork == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,3*n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_1; } /* Call middle-level interface */ info = LAPACKE_sposvx_work( matrix_layout, fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond, ferr, berr, work, iwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_1: LAPACKE_free( iwork ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sposvx", info ); } return info; }
lapack_int LAPACKE_sgetrs( int matrix_layout, char trans, lapack_int n, lapack_int nrhs, const float* a, lapack_int lda, const lapack_int* ipiv, float* b, lapack_int ldb ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sgetrs", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) { return -5; } if( LAPACKE_sge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) { return -8; } #endif return LAPACKE_sgetrs_work( matrix_layout, trans, n, nrhs, a, lda, ipiv, b, ldb ); }
lapack_int LAPACKE_sgesdd( int matrix_order, char jobz, lapack_int m, lapack_int n, float* a, lapack_int lda, float* s, float* u, lapack_int ldu, float* vt, lapack_int ldvt ) { lapack_int info = 0; lapack_int lwork = -1; lapack_int* iwork = NULL; float* work = NULL; float work_query; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sgesdd", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_order, m, n, a, lda ) ) { return -5; } #endif /* Allocate memory for working array(s) */ iwork = (lapack_int*) LAPACKE_malloc( sizeof(lapack_int) * MAX(1,8*MIN(m,n)) ); if( iwork == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Query optimal working array(s) size */ info = LAPACKE_sgesdd_work( matrix_order, jobz, m, n, a, lda, s, u, ldu, vt, ldvt, &work_query, lwork, iwork ); if( info != 0 ) { goto exit_level_1; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_1; } /* Call middle-level interface */ info = LAPACKE_sgesdd_work( matrix_order, jobz, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, iwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_1: LAPACKE_free( iwork ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sgesdd", info ); } return info; }
lapack_int LAPACKE_sgesvd( int matrix_layout, char jobu, char jobvt, lapack_int m, lapack_int n, float* a, lapack_int lda, float* s, float* u, lapack_int ldu, float* vt, lapack_int ldvt, float* superb ) { lapack_int info = 0; lapack_int lwork = -1; float* work = NULL; float work_query; lapack_int i; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sgesvd", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) { return -6; } } #endif /* Query optimal working array(s) size */ info = LAPACKE_sgesvd_work( matrix_layout, jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sgesvd_work( matrix_layout, jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork ); /* Backup significant data from working array(s) */ for( i=0; i<MIN(m,n)-1; i++ ) { superb[i] = work[i+1]; } /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sgesvd", info ); } return info; }
lapack_int LAPACKE_strttp( int matrix_order, char uplo, lapack_int n, const float* a, lapack_int lda, float* ap ) { if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_strttp", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_order, n, n, a, lda ) ) { return -4; } #endif return LAPACKE_strttp_work( matrix_order, uplo, n, a, lda, ap ); }
lapack_int LAPACKE_sgetrf( int matrix_layout, lapack_int m, lapack_int n, float* a, lapack_int lda, lapack_int* ipiv ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sgetrf", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) { return -4; } #endif return LAPACKE_sgetrf_work( matrix_layout, m, n, a, lda, ipiv ); }
lapack_int LAPACKE_strttf( int matrix_layout, char transr, char uplo, lapack_int n, const float* a, lapack_int lda, float* arf ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_strttf", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) { return -5; } #endif return LAPACKE_strttf_work( matrix_layout, transr, uplo, n, a, lda, arf ); }
lapack_int LAPACKE_clacp2( int matrix_layout, char uplo, lapack_int m, lapack_int n, const float* a, lapack_int lda, lapack_complex_float* b, lapack_int ldb ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_clacp2", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) { return -5; } #endif return LAPACKE_clacp2_work( matrix_layout, uplo, m, n, a, lda, b, ldb ); }
lapack_int LAPACKE_slag2d( int matrix_order, lapack_int m, lapack_int n, const float* sa, lapack_int ldsa, double* a, lapack_int lda ) { if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_slag2d", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_order, m, n, sa, ldsa ) ) { return -4; } #endif return LAPACKE_slag2d_work( matrix_order, m, n, sa, ldsa, a, lda ); }