LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_dlange_work()

double LAPACKE_dlange_work ( int  matrix_layout,
char  norm,
lapack_int  m,
lapack_int  n,
const double *  a,
lapack_int  lda,
double *  work 
)

Definition at line 35 of file lapacke_dlange_work.c.

38 {
39  lapack_int info = 0;
40  double res = 0.;
41  char norm_lapack;
42  if( matrix_layout == LAPACK_COL_MAJOR ) {
43  /* Call LAPACK function */
44  res = LAPACK_dlange( &norm, &m, &n, a, &lda, work );
45  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
46  double* work_lapack = NULL;
47  /* Check leading dimension(s) */
48  if( lda < n ) {
49  info = -6;
50  LAPACKE_xerbla( "LAPACKE_dlange_work", info );
51  return info;
52  }
53  if( LAPACKE_lsame( norm, '1' ) || LAPACKE_lsame( norm, 'o' ) ) {
54  norm_lapack = 'i';
55  } else if( LAPACKE_lsame( norm, 'i' ) ) {
56  norm_lapack = '1';
57  } else {
58  norm_lapack = norm;
59  }
60  /* Allocate memory for work array(s) */
61  if( LAPACKE_lsame( norm_lapack, 'i' ) ) {
62  work_lapack = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
63  if( work_lapack == NULL ) {
65  goto exit_level_0;
66  }
67  }
68  /* Call LAPACK function */
69  res = LAPACK_dlange( &norm_lapack, &n, &m, a, &lda, work_lapack );
70  /* Release memory and exit */
71  if( work_lapack ) {
72  LAPACKE_free( work_lapack );
73  }
74 exit_level_0:
75  if( info == LAPACK_WORK_MEMORY_ERROR ) {
76  LAPACKE_xerbla( "LAPACKE_dlange_work", info );
77  }
78  } else {
79  info = -1;
80  LAPACKE_xerbla( "LAPACKE_dlange_work", info );
81  }
82  return res;
83 }
#define lapack_int
Definition: lapack.h:83
#define LAPACK_dlange(...)
Definition: lapack.h:9573
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:55
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
#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)
#define MAX(x, y)
Definition: lapacke_utils.h:46
Here is the call graph for this function:
Here is the caller graph for this function: