LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
 All Classes Files Functions Variables Typedefs Macros
lapacke_sbdsqr_work.c File Reference
#include "lapacke_utils.h"
Include dependency graph for lapacke_sbdsqr_work.c:

Go to the source code of this file.

Functions/Subroutines

lapack_int LAPACKE_sbdsqr_work (int matrix_order, 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, float *work)

Function/Subroutine Documentation

lapack_int LAPACKE_sbdsqr_work ( int  matrix_order,
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,
float *  work 
)

Definition at line 36 of file lapacke_sbdsqr_work.c.

{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_sbdsqr( &uplo, &n, &ncvt, &nru, &ncc, d, e, vt, &ldvt, u, &ldu,
c, &ldc, work, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int ldc_t = MAX(1,n);
lapack_int ldu_t = MAX(1,nru);
lapack_int ldvt_t = MAX(1,n);
float* vt_t = NULL;
float* u_t = NULL;
float* c_t = NULL;
/* Check leading dimension(s) */
if( ldc < ncc ) {
info = -14;
LAPACKE_xerbla( "LAPACKE_sbdsqr_work", info );
return info;
}
if( ldu < n ) {
info = -12;
LAPACKE_xerbla( "LAPACKE_sbdsqr_work", info );
return info;
}
if( ldvt < ncvt ) {
info = -10;
LAPACKE_xerbla( "LAPACKE_sbdsqr_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
if( ncvt != 0 ) {
vt_t = (float*)
LAPACKE_malloc( sizeof(float) * ldvt_t * MAX(1,ncvt) );
if( vt_t == NULL ) {
goto exit_level_0;
}
}
if( nru != 0 ) {
u_t = (float*)LAPACKE_malloc( sizeof(float) * ldu_t * MAX(1,n) );
if( u_t == NULL ) {
goto exit_level_1;
}
}
if( ncc != 0 ) {
c_t = (float*)LAPACKE_malloc( sizeof(float) * ldc_t * MAX(1,ncc) );
if( c_t == NULL ) {
goto exit_level_2;
}
}
/* Transpose input matrices */
if( ncvt != 0 ) {
LAPACKE_sge_trans( matrix_order, n, ncvt, vt, ldvt, vt_t, ldvt_t );
}
if( nru != 0 ) {
LAPACKE_sge_trans( matrix_order, nru, n, u, ldu, u_t, ldu_t );
}
if( ncc != 0 ) {
LAPACKE_sge_trans( matrix_order, n, ncc, c, ldc, c_t, ldc_t );
}
/* Call LAPACK function and adjust info */
LAPACK_sbdsqr( &uplo, &n, &ncvt, &nru, &ncc, d, e, vt_t, &ldvt_t, u_t,
&ldu_t, c_t, &ldc_t, work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
if( ncvt != 0 ) {
LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, ncvt, vt_t, ldvt_t, vt,
ldvt );
}
if( nru != 0 ) {
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nru, n, u_t, ldu_t, u, ldu );
}
if( ncc != 0 ) {
LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, ncc, c_t, ldc_t, c, ldc );
}
/* Release memory and exit */
if( ncc != 0 ) {
LAPACKE_free( c_t );
}
exit_level_2:
if( nru != 0 ) {
LAPACKE_free( u_t );
}
exit_level_1:
if( ncvt != 0 ) {
LAPACKE_free( vt_t );
}
exit_level_0:
LAPACKE_xerbla( "LAPACKE_sbdsqr_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_sbdsqr_work", info );
}
return info;
}

Here is the call graph for this function:

Here is the caller graph for this function: