OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
lapacke_zlange_work.c File Reference
#include "lapacke_utils.h"

Go to the source code of this file.

Functions

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

Function Documentation

◆ LAPACKE_zlange_work()

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

Definition at line 35 of file lapacke_zlange_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_zlange( &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_zlange_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_zlange( &norm_lapack, &n, &m, a, &lda, work_lapack );
70 /* Release memory and exit */
71 if( work_lapack ) {
72 LAPACKE_free( work_lapack );
73 }
74exit_level_0:
75 if( info == LAPACK_WORK_MEMORY_ERROR ) {
76 LAPACKE_xerbla( "LAPACKE_zlange_work", info );
77 }
78 } else {
79 info = -1;
80 LAPACKE_xerbla( "LAPACKE_zlange_work", info );
81 }
82 return res;
83}
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB
#define LAPACK_zlange(...)
Definition lapack.h:9605
#define lapack_int
Definition lapack.h:83
#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)
void LAPACKE_xerbla(const char *name, lapack_int info)
#define MAX(x, y)
n