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

Go to the source code of this file.

Functions

lapack_int LAPACKE_zupmtr_work (int matrix_layout, char side, char uplo, char trans, lapack_int m, lapack_int n, const lapack_complex_double *ap, const lapack_complex_double *tau, lapack_complex_double *c, lapack_int ldc, lapack_complex_double *work)

Function Documentation

◆ LAPACKE_zupmtr_work()

lapack_int LAPACKE_zupmtr_work ( int matrix_layout,
char side,
char uplo,
char trans,
lapack_int m,
lapack_int n,
const lapack_complex_double * ap,
const lapack_complex_double * tau,
lapack_complex_double * c,
lapack_int ldc,
lapack_complex_double * work )

Definition at line 35 of file lapacke_zupmtr_work.c.

41{
42 lapack_int info = 0;
43 if( matrix_layout == LAPACK_COL_MAJOR ) {
44 /* Call LAPACK function and adjust info */
45 LAPACK_zupmtr( &side, &uplo, &trans, &m, &n, ap, tau, c, &ldc, work,
46 &info );
47 if( info < 0 ) {
48 info = info - 1;
49 }
50 } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
51 lapack_int r = LAPACKE_lsame( side, 'l' ) ? m : n;
52 lapack_int ldc_t = MAX(1,m);
53 lapack_complex_double* c_t = NULL;
54 lapack_complex_double* ap_t = NULL;
55 /* Check leading dimension(s) */
56 if( ldc < n ) {
57 info = -10;
58 LAPACKE_xerbla( "LAPACKE_zupmtr_work", info );
59 return info;
60 }
61 /* Allocate memory for temporary array(s) */
63 LAPACKE_malloc( sizeof(lapack_complex_double) * ldc_t * MAX(1,n) );
64 if( c_t == NULL ) {
66 goto exit_level_0;
67 }
68 ap_t = (lapack_complex_double*)
70 ( MAX(1,r) * MAX(2,r+1) ) / 2 );
71 if( ap_t == NULL ) {
73 goto exit_level_1;
74 }
75 /* Transpose input matrices */
76 LAPACKE_zge_trans( matrix_layout, m, n, c, ldc, c_t, ldc_t );
77 LAPACKE_zpp_trans( matrix_layout, uplo, r, ap, ap_t );
78 /* Call LAPACK function and adjust info */
79 LAPACK_zupmtr( &side, &uplo, &trans, &m, &n, ap_t, tau, c_t, &ldc_t,
80 work, &info );
81 if( info < 0 ) {
82 info = info - 1;
83 }
84 /* Transpose output matrices */
85 LAPACKE_zge_trans( LAPACK_COL_MAJOR, m, n, c_t, ldc_t, c, ldc );
86 /* Release memory and exit */
87 LAPACKE_free( ap_t );
88exit_level_1:
89 LAPACKE_free( c_t );
90exit_level_0:
91 if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
92 LAPACKE_xerbla( "LAPACKE_zupmtr_work", info );
93 }
94 } else {
95 info = -1;
96 LAPACKE_xerbla( "LAPACKE_zupmtr_work", info );
97 }
98 return info;
99}
#define lapack_int
Definition lapack.h:83
#define LAPACK_zupmtr(...)
Definition lapack.h:22988
#define lapack_complex_double
Definition lapack.h:63
#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
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition lapacke.h:56
lapack_logical LAPACKE_lsame(char ca, char cb)
void LAPACKE_xerbla(const char *name, lapack_int info)
void LAPACKE_zge_trans(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_double *in, lapack_int ldin, lapack_complex_double *out, lapack_int ldout)
void LAPACKE_zpp_trans(int matrix_layout, char uplo, lapack_int n, const lapack_complex_double *in, lapack_complex_double *out)
#define MAX(x, y)
n