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

◆ LAPACKE_clantr_work()

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

Definition at line 35 of file lapacke_clantr_work.c.

39{
40 lapack_int info = 0;
41 float res = 0.;
42 if( matrix_layout == LAPACK_COL_MAJOR ) {
43 /* Call LAPACK function */
44 res = LAPACK_clantr( &norm, &uplo, &diag, &m, &n, a, &lda, work );
45 } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
46 float* work_lapack = NULL;
47 char norm_lapack;
48 char uplo_lapack;
49 /* Check leading dimension(s) */
50 if( lda < n ) {
51 info = -8;
52 LAPACKE_xerbla( "LAPACKE_clantr_work", info );
53 return info;
54 }
55 if( LAPACKE_lsame( norm, '1' ) || LAPACKE_lsame( norm, 'o' ) ) {
56 norm_lapack = 'i';
57 } else if( LAPACKE_lsame( norm, 'i' ) ) {
58 norm_lapack = '1';
59 } else {
60 norm_lapack = norm;
61 }
62 if( LAPACKE_lsame( uplo, 'u' ) ) {
63 uplo_lapack = 'l';
64 } else {
65 uplo_lapack = 'u';
66 }
67 /* Allocate memory for work array(s) */
68 if( LAPACKE_lsame( norm_lapack, 'i' ) ) {
69 work_lapack = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
70 if( work_lapack == NULL ) {
72 goto exit_level_0;
73 }
74 }
75 /* Call LAPACK function */
76 res = LAPACK_clantr( &norm_lapack, &uplo_lapack, &diag, &n, &m, a, &lda, work_lapack );
77 /* Release memory and exit */
78 if( work_lapack ) {
79 LAPACKE_free( work_lapack );
80 }
81exit_level_0:
82 if( info == LAPACK_WORK_MEMORY_ERROR ) {
83 LAPACKE_xerbla( "LAPACKE_clantr_work", info );
84 }
85 } else {
86 info = -1;
87 LAPACKE_xerbla( "LAPACKE_clantr_work", info );
88 }
89 return res;
90}
#define lapack_int
Definition: lapack.h:87
#define LAPACK_clantr(...)
Definition: lapack.h:10249
#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: