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

Go to the source code of this file.

Functions

lapack_int LAPACKE_cgtrfs_work (int matrix_layout, char trans, lapack_int n, lapack_int nrhs, const lapack_complex_float *dl, const lapack_complex_float *d, const lapack_complex_float *du, const lapack_complex_float *dlf, const lapack_complex_float *df, const lapack_complex_float *duf, const lapack_complex_float *du2, const lapack_int *ipiv, const lapack_complex_float *b, lapack_int ldb, lapack_complex_float *x, lapack_int ldx, float *ferr, float *berr, lapack_complex_float *work, float *rwork)

Function Documentation

◆ LAPACKE_cgtrfs_work()

lapack_int LAPACKE_cgtrfs_work ( int matrix_layout,
char trans,
lapack_int n,
lapack_int nrhs,
const lapack_complex_float * dl,
const lapack_complex_float * d,
const lapack_complex_float * du,
const lapack_complex_float * dlf,
const lapack_complex_float * df,
const lapack_complex_float * duf,
const lapack_complex_float * du2,
const lapack_int * ipiv,
const lapack_complex_float * b,
lapack_int ldb,
lapack_complex_float * x,
lapack_int ldx,
float * ferr,
float * berr,
lapack_complex_float * work,
float * rwork )

Definition at line 35 of file lapacke_cgtrfs_work.c.

48{
49 lapack_int info = 0;
50 if( matrix_layout == LAPACK_COL_MAJOR ) {
51 /* Call LAPACK function and adjust info */
52 LAPACK_cgtrfs( &trans, &n, &nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b,
53 &ldb, x, &ldx, ferr, berr, work, rwork, &info );
54 if( info < 0 ) {
55 info = info - 1;
56 }
57 } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
58 lapack_int ldb_t = MAX(1,n);
59 lapack_int ldx_t = MAX(1,n);
60 lapack_complex_float* b_t = NULL;
61 lapack_complex_float* x_t = NULL;
62 /* Check leading dimension(s) */
63 if( ldb < nrhs ) {
64 info = -14;
65 LAPACKE_xerbla( "LAPACKE_cgtrfs_work", info );
66 return info;
67 }
68 if( ldx < nrhs ) {
69 info = -16;
70 LAPACKE_xerbla( "LAPACKE_cgtrfs_work", info );
71 return info;
72 }
73 /* Allocate memory for temporary array(s) */
76 ldb_t * MAX(1,nrhs) );
77 if( b_t == NULL ) {
79 goto exit_level_0;
80 }
83 ldx_t * MAX(1,nrhs) );
84 if( x_t == NULL ) {
86 goto exit_level_1;
87 }
88 /* Transpose input matrices */
89 LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
90 LAPACKE_cge_trans( matrix_layout, n, nrhs, x, ldx, x_t, ldx_t );
91 /* Call LAPACK function and adjust info */
92 LAPACK_cgtrfs( &trans, &n, &nrhs, dl, d, du, dlf, df, duf, du2, ipiv,
93 b_t, &ldb_t, x_t, &ldx_t, ferr, berr, work, rwork,
94 &info );
95 if( info < 0 ) {
96 info = info - 1;
97 }
98 /* Transpose output matrices */
99 LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
100 /* Release memory and exit */
101 LAPACKE_free( x_t );
102exit_level_1:
103 LAPACKE_free( b_t );
104exit_level_0:
105 if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
106 LAPACKE_xerbla( "LAPACKE_cgtrfs_work", info );
107 }
108 } else {
109 info = -1;
110 LAPACKE_xerbla( "LAPACKE_cgtrfs_work", info );
111 }
112 return info;
113}
#define LAPACK_cgtrfs(...)
Definition lapack.h:5763
#define lapack_int
Definition lapack.h:83
#define lapack_complex_float
Definition lapack.h:45
#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)
#define MAX(x, y)
void LAPACKE_cge_trans(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *in, lapack_int ldin, lapack_complex_float *out, lapack_int ldout)
n