info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
- lapack_int lda_t = MAX(1,lda);
+ lapack_int lda_t = MAX(1,k2);
+ lapack_int i;
+ for( i = k1; i <= k2; i++ ) {
+ lda_t = MAX( lda_t, ipiv[k1 + ( i - k1 ) * ABS( incx ) - 1] );
+ }
lapack_complex_float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
goto exit_level_0;
}
/* Transpose input matrices */
- LAPACKE_cge_trans( matrix_layout, lda, n, a, lda, a_t, lda_t );
+ LAPACKE_cge_trans( matrix_layout, lda_t, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_claswp( &n, a_t, &lda_t, &k1, &k2, ipiv, &incx );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
- LAPACKE_cge_trans( LAPACK_COL_MAJOR, lda, n, a_t, lda_t, a, lda );
+ LAPACKE_cge_trans( LAPACK_COL_MAJOR, lda_t, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
- lapack_int lda_t = MAX(1,lda);
+ lapack_int lda_t = MAX(1,k2);
+ lapack_int i;
+ for( i = k1; i <= k2; i++ ) {
+ lda_t = MAX( lda_t, ipiv[k1 + ( i - k1 ) * ABS( incx ) - 1] );
+ }
double* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
goto exit_level_0;
}
/* Transpose input matrices */
- LAPACKE_dge_trans( matrix_layout, lda, n, a, lda, a_t, lda_t );
+ LAPACKE_dge_trans( matrix_layout, lda_t, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_dlaswp( &n, a_t, &lda_t, &k1, &k2, ipiv, &incx );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
- LAPACKE_dge_trans( LAPACK_COL_MAJOR, lda, n, a_t, lda_t, a, lda );
+ LAPACKE_dge_trans( LAPACK_COL_MAJOR, lda_t, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
- lapack_int lda_t = MAX(1,lda);
+ lapack_int lda_t = MAX(1,k2);
+ lapack_int i;
+ for( i = k1; i <= k2; i++ ) {
+ lda_t = MAX( lda_t, ipiv[k1 + ( i - k1 ) * ABS( incx ) - 1] );
+ }
float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
goto exit_level_0;
}
/* Transpose input matrices */
- LAPACKE_sge_trans( matrix_layout, lda, n, a, lda, a_t, lda_t );
+ LAPACKE_sge_trans( matrix_layout, lda_t, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_slaswp( &n, a_t, &lda_t, &k1, &k2, ipiv, &incx );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
- LAPACKE_sge_trans( LAPACK_COL_MAJOR, lda, n, a_t, lda_t, a, lda );
+ LAPACKE_sge_trans( LAPACK_COL_MAJOR, lda_t, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
- lapack_int lda_t = MAX(1,lda);
+ lapack_int lda_t = MAX(1,k2);
+ lapack_int i;
+ for( i = k1; i <= k2; i++ ) {
+ lda_t = MAX( lda_t, ipiv[k1 + ( i - k1 ) * ABS( incx ) - 1] );
+ }
lapack_complex_double* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
goto exit_level_0;
}
/* Transpose input matrices */
- LAPACKE_zge_trans( matrix_layout, lda, n, a, lda, a_t, lda_t );
+ LAPACKE_zge_trans( matrix_layout, lda_t, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_zlaswp( &n, a_t, &lda_t, &k1, &k2, ipiv, &incx );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
- LAPACKE_zge_trans( LAPACK_COL_MAJOR, lda, n, a_t, lda_t, a, lda );
+ LAPACKE_zge_trans( LAPACK_COL_MAJOR, lda_t, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0: