Make LAPACKE_[cz]tgexc pass ifst/ilst as pointer outputs

Per LAPACK docs, in [cz]tgexc, ilst is [in,out]. The LAPACKE C
interface was passing both ifst and ilst by value as input-only
scalars, so callers could never observe the updated ilst value.

Change both ifst and ilst to lapack_int* pointers in the complex
tgexc variants to match the real-precision stgexc/dtgexc interface
and the underlying Fortran semantics.

Fixes #771
This commit is contained in:
Julien Schueller
2026-06-11 15:05:22 +02:00
parent 91c0f61b87
commit 283cf5b76d
6 changed files with 16 additions and 16 deletions
+4 -4
View File
@@ -4153,14 +4153,14 @@ lapack_int LAPACKE_ctgexc( int matrix_layout, lapack_logical wantq,
lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* q, lapack_int ldq,
lapack_complex_float* z, lapack_int ldz,
lapack_int ifst, lapack_int ilst );
lapack_int ifst, lapack_int* ilst );
lapack_int LAPACKE_ztgexc( int matrix_layout, lapack_logical wantq,
lapack_logical wantz, lapack_int n,
lapack_complex_double* a, lapack_int lda,
lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* q, lapack_int ldq,
lapack_complex_double* z, lapack_int ldz,
lapack_int ifst, lapack_int ilst );
lapack_int ifst, lapack_int* ilst );
lapack_int LAPACKE_stgsen( int matrix_layout, lapack_int ijob,
lapack_logical wantq, lapack_logical wantz,
@@ -9933,14 +9933,14 @@ lapack_int LAPACKE_ctgexc_work( int matrix_layout, lapack_logical wantq,
lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* q, lapack_int ldq,
lapack_complex_float* z, lapack_int ldz,
lapack_int ifst, lapack_int ilst );
lapack_int ifst, lapack_int* ilst );
lapack_int LAPACKE_ztgexc_work( int matrix_layout, lapack_logical wantq,
lapack_logical wantz, lapack_int n,
lapack_complex_double* a, lapack_int lda,
lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* q, lapack_int ldq,
lapack_complex_double* z, lapack_int ldz,
lapack_int ifst, lapack_int ilst );
lapack_int ifst, lapack_int* ilst );
lapack_int LAPACKE_stgsen_work( int matrix_layout, lapack_int ijob,
lapack_logical wantq, lapack_logical wantz,
+4 -4
View File
@@ -4119,14 +4119,14 @@ int64_t LAPACKE_ctgexc_64( int matrix_layout, lapack_logical wantq,
lapack_complex_float* b, int64_t ldb,
lapack_complex_float* q, int64_t ldq,
lapack_complex_float* z, int64_t ldz,
int64_t ifst, int64_t ilst );
int64_t ifst, int64_t* ilst );
int64_t LAPACKE_ztgexc_64( int matrix_layout, lapack_logical wantq,
lapack_logical wantz, int64_t n,
lapack_complex_double* a, int64_t lda,
lapack_complex_double* b, int64_t ldb,
lapack_complex_double* q, int64_t ldq,
lapack_complex_double* z, int64_t ldz,
int64_t ifst, int64_t ilst );
int64_t ifst, int64_t* ilst );
int64_t LAPACKE_stgsen_64( int matrix_layout, int64_t ijob,
lapack_logical wantq, lapack_logical wantz,
@@ -9900,14 +9900,14 @@ int64_t LAPACKE_ctgexc_work_64( int matrix_layout, lapack_logical wantq,
lapack_complex_float* b, int64_t ldb,
lapack_complex_float* q, int64_t ldq,
lapack_complex_float* z, int64_t ldz,
int64_t ifst, int64_t ilst );
int64_t ifst, int64_t* ilst );
int64_t LAPACKE_ztgexc_work_64( int matrix_layout, lapack_logical wantq,
lapack_logical wantz, int64_t n,
lapack_complex_double* a, int64_t lda,
lapack_complex_double* b, int64_t ldb,
lapack_complex_double* q, int64_t ldq,
lapack_complex_double* z, int64_t ldz,
int64_t ifst, int64_t ilst );
int64_t ifst, int64_t* ilst );
int64_t LAPACKE_stgsen_work_64( int matrix_layout, int64_t ijob,
lapack_logical wantq, lapack_logical wantz,
+1 -1
View File
@@ -38,7 +38,7 @@ lapack_int API_SUFFIX(LAPACKE_ctgexc)( int matrix_layout, lapack_logical wantq,
lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* q, lapack_int ldq,
lapack_complex_float* z, lapack_int ldz,
lapack_int ifst, lapack_int ilst )
lapack_int ifst, lapack_int* ilst )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_ctgexc", -1 );
+3 -3
View File
@@ -38,13 +38,13 @@ lapack_int API_SUFFIX(LAPACKE_ctgexc_work)( int matrix_layout, lapack_logical wa
lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* q, lapack_int ldq,
lapack_complex_float* z, lapack_int ldz,
lapack_int ifst, lapack_int ilst )
lapack_int ifst, lapack_int* ilst )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_ctgexc( &wantq, &wantz, &n, a, &lda, b, &ldb, q, &ldq, z, &ldz,
&ifst, &ilst, &info );
&ifst, ilst, &info );
if( info < 0 ) {
info = info - 1;
}
@@ -120,7 +120,7 @@ lapack_int API_SUFFIX(LAPACKE_ctgexc_work)( int matrix_layout, lapack_logical wa
}
/* Call LAPACK function and adjust info */
LAPACK_ctgexc( &wantq, &wantz, &n, a_t, &lda_t, b_t, &ldb_t, q_t,
&ldq_t, z_t, &ldz_t, &ifst, &ilst, &info );
&ldq_t, z_t, &ldz_t, &ifst, ilst, &info );
if( info < 0 ) {
info = info - 1;
}
+1 -1
View File
@@ -38,7 +38,7 @@ lapack_int API_SUFFIX(LAPACKE_ztgexc)( int matrix_layout, lapack_logical wantq,
lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* q, lapack_int ldq,
lapack_complex_double* z, lapack_int ldz,
lapack_int ifst, lapack_int ilst )
lapack_int ifst, lapack_int* ilst )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_ztgexc", -1 );
+3 -3
View File
@@ -38,13 +38,13 @@ lapack_int API_SUFFIX(LAPACKE_ztgexc_work)( int matrix_layout, lapack_logical wa
lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* q, lapack_int ldq,
lapack_complex_double* z, lapack_int ldz,
lapack_int ifst, lapack_int ilst )
lapack_int ifst, lapack_int* ilst )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_ztgexc( &wantq, &wantz, &n, a, &lda, b, &ldb, q, &ldq, z, &ldz,
&ifst, &ilst, &info );
&ifst, ilst, &info );
if( info < 0 ) {
info = info - 1;
}
@@ -120,7 +120,7 @@ lapack_int API_SUFFIX(LAPACKE_ztgexc_work)( int matrix_layout, lapack_logical wa
}
/* Call LAPACK function and adjust info */
LAPACK_ztgexc( &wantq, &wantz, &n, a_t, &lda_t, b_t, &ldb_t, q_t,
&ldq_t, z_t, &ldz_t, &ifst, &ilst, &info );
&ldq_t, z_t, &ldz_t, &ifst, ilst, &info );
if( info < 0 ) {
info = info - 1;
}