LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_clange_work()

float LAPACKE_clange_work ( int  matrix_layout,
char  norm,
lapack_int  m,
lapack_int  n,
const lapack_complex_float a,
lapack_int  lda,
float *  work 
)

Definition at line 35 of file lapacke_clange_work.c.

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