LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ LAPACKE_dlarfb()

lapack_int LAPACKE_dlarfb ( int  matrix_layout,
char  side,
char  trans,
char  direct,
char  storev,
lapack_int  m,
lapack_int  n,
lapack_int  k,
const double *  v,
lapack_int  ldv,
const double *  t,
lapack_int  ldt,
double *  c,
lapack_int  ldc 
)

Definition at line 35 of file lapacke_dlarfb.c.

40{
41 lapack_int info = 0;
42 lapack_int ldwork;
43 double* work = NULL;
44 lapack_int nrows_v, ncols_v;
45 lapack_logical left, col, forward;
46 char uplo;
47 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
48 LAPACKE_xerbla( "LAPACKE_dlarfb", -1 );
49 return -1;
50 }
51#ifndef LAPACK_DISABLE_NAN_CHECK
52 if( LAPACKE_get_nancheck() ) {
53 /* Optionally check input matrices for NaNs */
54 left = LAPACKE_lsame( side, 'l' );
55 col = LAPACKE_lsame( storev, 'c' );
56 forward = LAPACKE_lsame( direct, 'f' );
57
58 nrows_v = ( col && left ) ? m : ( ( col && !left ) ? n : ( !col ? k : 1) );
59 ncols_v = ( !col && left ) ? m : ( ( !col && !left ) ? n : ( col ? k : 1 ) );
60 uplo = ( ( left && col ) || !( left || col ) ) ? 'l' : 'u';
61
62 if( !forward && ( col && k > nrows_v ) || ( !col && k > ncols_v )) {
63 LAPACKE_xerbla( "LAPACKE_dlarfb", -8 );
64 return -8;
65 }
66 if( LAPACKE_dtz_nancheck( matrix_layout, direct, uplo, 'u',
67 nrows_v, ncols_v, v, ldv ) ) {
68 return -9;
69 }
70 if( LAPACKE_dge_nancheck( matrix_layout, k, k, t, ldt ) ) {
71 return -11;
72 }
73 if( LAPACKE_dge_nancheck( matrix_layout, m, n, c, ldc ) ) {
74 return -13;
75 }
76 }
77#endif
78 if( LAPACKE_lsame( side, 'l' ) ) {
79 ldwork = n;
80 } else if( LAPACKE_lsame( side, 'r' ) ) {
81 ldwork = m;
82 } else {
83 ldwork = 1;
84 }
85 /* Allocate memory for working array(s) */
86 work = (double*)LAPACKE_malloc( sizeof(double) * ldwork * MAX(1,k) );
87 if( work == NULL ) {
89 goto exit_level_0;
90 }
91 /* Call middle-level interface */
92 info = LAPACKE_dlarfb_work( matrix_layout, side, trans, direct, storev, m, n,
93 k, v, ldv, t, ldt, c, ldc, work, ldwork );
94 /* Release memory and exit */
95 LAPACKE_free( work );
96exit_level_0:
97 if( info == LAPACK_WORK_MEMORY_ERROR ) {
98 LAPACKE_xerbla( "LAPACKE_dlarfb", info );
99 }
100 return info;
101}
#define lapack_int
Definition: lapack.h:87
#define lapack_logical
Definition: lapack.h:103
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:55
lapack_int LAPACKE_dlarfb_work(int matrix_layout, char side, char trans, char direct, char storev, lapack_int m, lapack_int n, lapack_int k, const double *v, lapack_int ldv, const double *t, lapack_int ldt, double *c, lapack_int ldc, double *work, lapack_int ldwork)
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
int LAPACKE_get_nancheck(void)
#define LAPACKE_malloc(size)
Definition: lapacke.h:43
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:35
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_dtz_nancheck(int matrix_layout, char direct, char uplo, char diag, lapack_int m, lapack_int n, const double *a, lapack_int lda)
#define MAX(x, y)
Definition: lapacke_utils.h:46
lapack_logical LAPACKE_dge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const double *a, lapack_int lda)
Here is the call graph for this function: