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

Go to the source code of this file.

Functions

lapack_int LAPACKE_ztfsm_work (int matrix_layout, char transr, char side, char uplo, char trans, char diag, lapack_int m, lapack_int n, lapack_complex_double alpha, const lapack_complex_double *a, lapack_complex_double *b, lapack_int ldb)

Function Documentation

◆ LAPACKE_ztfsm_work()

lapack_int LAPACKE_ztfsm_work ( int matrix_layout,
char transr,
char side,
char uplo,
char trans,
char diag,
lapack_int m,
lapack_int n,
lapack_complex_double alpha,
const lapack_complex_double * a,
lapack_complex_double * b,
lapack_int ldb )

Definition at line 35 of file lapacke_ztfsm_work.c.

40{
41 lapack_int info = 0;
42 if( matrix_layout == LAPACK_COL_MAJOR ) {
43 /* Call LAPACK function and adjust info */
44 LAPACK_ztfsm( &transr, &side, &uplo, &trans, &diag, &m, &n, &alpha, a,
45 b, &ldb );
46 if( info < 0 ) {
47 info = info - 1;
48 }
49 } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
50 lapack_int ldb_t = MAX(1,m);
51 lapack_complex_double* b_t = NULL;
52 lapack_complex_double* a_t = NULL;
53 /* Check leading dimension(s) */
54 if( ldb < n ) {
55 info = -12;
56 LAPACKE_xerbla( "LAPACKE_ztfsm_work", info );
57 return info;
58 }
59 /* Allocate memory for temporary array(s) */
61 LAPACKE_malloc( sizeof(lapack_complex_double) * ldb_t * MAX(1,n) );
62 if( b_t == NULL ) {
64 goto exit_level_0;
65 }
66 if( IS_Z_NONZERO(alpha) ) {
69 ( MAX(1,n) * MAX(2,n+1) ) / 2 );
70 if( a_t == NULL ) {
72 goto exit_level_1;
73 }
74 }
75 /* Transpose input matrices */
76 if( IS_Z_NONZERO(alpha) ) {
77 LAPACKE_zge_trans( matrix_layout, m, n, b, ldb, b_t, ldb_t );
78 }
79 if( IS_Z_NONZERO(alpha) ) {
80 LAPACKE_ztf_trans( matrix_layout, transr, uplo, diag, n, a, a_t );
81 }
82 /* Call LAPACK function and adjust info */
83 LAPACK_ztfsm( &transr, &side, &uplo, &trans, &diag, &m, &n, &alpha, a_t,
84 b_t, &ldb_t );
85 info = 0; /* LAPACK call is ok! */
86 /* Transpose output matrices */
87 LAPACKE_zge_trans( LAPACK_COL_MAJOR, m, n, b_t, ldb_t, b, ldb );
88 /* Release memory and exit */
89 if( IS_Z_NONZERO(alpha) ) {
90 LAPACKE_free( a_t );
91 }
92exit_level_1:
93 LAPACKE_free( b_t );
94exit_level_0:
95 if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
96 LAPACKE_xerbla( "LAPACKE_ztfsm_work", info );
97 }
98 } else {
99 info = -1;
100 LAPACKE_xerbla( "LAPACKE_ztfsm_work", info );
101 }
102 return info;
103}
#define alpha
Definition eval.h:35
#define lapack_int
Definition lapack.h:83
#define LAPACK_ztfsm(...)
Definition lapack.h:19836
#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
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)
#define IS_Z_NONZERO(x)
#define MAX(x, y)
void LAPACKE_ztf_trans(int matrix_layout, char transr, char uplo, char diag, lapack_int n, const lapack_complex_double *in, lapack_complex_double *out)
n