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

Go to the source code of this file.

Functions

lapack_int LAPACKE_sgeqp3_work (int matrix_order, lapack_int m, lapack_int n, float *a, lapack_int lda, lapack_int *jpvt, float *tau, float *work, lapack_int lwork)
 

Function Documentation

lapack_int LAPACKE_sgeqp3_work ( int  matrix_order,
lapack_int  m,
lapack_int  n,
float *  a,
lapack_int  lda,
lapack_int *  jpvt,
float *  tau,
float *  work,
lapack_int  lwork 
)

Definition at line 36 of file lapacke_sgeqp3_work.c.

39 {
40  lapack_int info = 0;
41  if( matrix_order == LAPACK_COL_MAJOR ) {
42  /* Call LAPACK function and adjust info */
43  LAPACK_sgeqp3( &m, &n, a, &lda, jpvt, tau, work, &lwork, &info );
44  if( info < 0 ) {
45  info = info - 1;
46  }
47  } else if( matrix_order == LAPACK_ROW_MAJOR ) {
48  lapack_int lda_t = MAX(1,m);
49  float* a_t = NULL;
50  /* Check leading dimension(s) */
51  if( lda < n ) {
52  info = -5;
53  LAPACKE_xerbla( "LAPACKE_sgeqp3_work", info );
54  return info;
55  }
56  /* Query optimal working array(s) size if requested */
57  if( lwork == -1 ) {
58  LAPACK_sgeqp3( &m, &n, a, &lda_t, jpvt, tau, work, &lwork, &info );
59  return (info < 0) ? (info - 1) : info;
60  }
61  /* Allocate memory for temporary array(s) */
62  a_t = (float*)