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

Go to the source code of this file.

Functions

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

Function Documentation

◆ LAPACKE_slantr_work()

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

Definition at line 35 of file lapacke_slantr_work.c.

38{
39 lapack_int info = 0;
40 float res = 0.;
41 if( matrix_layout == LAPACK_COL_MAJOR ) {
42 /* Call LAPACK function */
43 res = LAPACK_slantr( &norm, &uplo, &diag, &m, &n, a, &lda, work );
44 } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
45 float* work_lapack = NULL;
46 char norm_lapack;
47 char uplo_lapack;
48 /* Check leading dimension(s) */
49 if( lda < n ) {
50 info = -8;
51 LAPACKE_xerbla( "LAPACKE_slantr_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 if( LAPACKE_lsame( uplo, 'u' ) ) {
62 uplo_lapack = 'l';
63 } else {
64 uplo_lapack = 'u';
65 }
66 /* Allocate memory for work array(s) */
67 if( LAPACKE_lsame( norm_lapack, 'i' ) ) {
68 work_lapack = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
69 if( work_lapack == NULL ) {
71 goto exit_level_0;
72 }
73 }
74 /* Call LAPACK function */
75 res = LAPACK_slantr( &norm_lapack, &uplo_lapack, &diag, &n, &m, a, &lda, work_lapack );
76 /* Release memory and exit */
77 if( work_lapack ) {
78 LAPACKE_free( work_lapack );
79 }
80exit_level_0:
81 if( info == LAPACK_WORK_MEMORY_ERROR ) {
82 LAPACKE_xerbla( "LAPACKE_slantr_work", info );
83 }
84 } else {
85 info = -1;
86 LAPACKE_xerbla( "LAPACKE_slantr_work", info );
87 }
88 return res;
89}
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB
#define lapack_int
Definition lapack.h:83
#define LAPACK_slantr(...)
Definition lapack.h:10265
#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