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

Go to the source code of this file.

Functions

lapack_int LAPACKE_ctprfb (int matrix_layout, char side, char trans, char direct, char storev, lapack_int m, lapack_int n, lapack_int k, lapack_int l, const lapack_complex_float *v, lapack_int ldv, const lapack_complex_float *t, lapack_int ldt, lapack_complex_float *a, lapack_int lda, lapack_complex_float *b, lapack_int ldb)

Function Documentation

◆ LAPACKE_ctprfb()

lapack_int LAPACKE_ctprfb ( int matrix_layout,
char side,
char trans,
char direct,
char storev,
lapack_int m,
lapack_int n,
lapack_int k,
lapack_int l,
const lapack_complex_float * v,
lapack_int ldv,
const lapack_complex_float * t,
lapack_int ldt,
lapack_complex_float * a,
lapack_int lda,
lapack_complex_float * b,
lapack_int ldb )

Definition at line 35 of file lapacke_ctprfb.c.

42{
43 lapack_int ncols_v, nrows_v, ncols_a, nrows_a;
44 lapack_int info = 0;
45 lapack_int ldwork;
46 lapack_int work_size;
47 lapack_complex_float* work = NULL;
48 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
49 LAPACKE_xerbla( "LAPACKE_ctprfb", -1 );
50 return -1;
51 }
52#ifndef LAPACK_DISABLE_NAN_CHECK
53 if( LAPACKE_get_nancheck() ) {
54 /* Optionally check input matrices for NaNs
55 * V is m-by-k (left, columnwise)
56 * or n-by-k (right, columnwise)
57 * or k-by-m (left, rowwise)
58 * or k-by-n (right, rowwise)
59 * T is k-by-k
60 * A is k-by-n (left)
61 * or m-by-k (right)
62 * B is m-by-n
63 */
64 if( LAPACKE_lsame( storev, 'C' ) ) {
65 ncols_v = k;
66 nrows_v = LAPACKE_lsame( side, 'L' ) ? m :
67 LAPACKE_lsame( side, 'R' ) ? n : 0;
68 } else if( LAPACKE_lsame( storev, 'R' ) ) {
69 ncols_v = LAPACKE_lsame( side, 'L' ) ? m :
70 LAPACKE_lsame( side, 'R' ) ? n : 0;
71 nrows_v = k;
72 } else {
73 ncols_v = 0;
74 nrows_v = 0;
75 }
76 nrows_a = LAPACKE_lsame( side, 'L' ) ? k :
77 LAPACKE_lsame( side, 'R' ) ? m : 0;
78 ncols_a = LAPACKE_lsame( side, 'L' ) ? n :
79 LAPACKE_lsame( side, 'R' ) ? k : 0;
80 if( LAPACKE_cge_nancheck( matrix_layout, ncols_a, nrows_a, a, lda ) ) {
81 return -14;
82 }
83 if( LAPACKE_cge_nancheck( matrix_layout, m, n, b, ldb ) ) {
84 return -16;
85 }
86 if( LAPACKE_cge_nancheck( matrix_layout, k, k, t, ldt ) ) {
87 return -12;
88 }
89 if( LAPACKE_cge_nancheck( matrix_layout, nrows_v, ncols_v, v, ldv ) ) {
90 return -10;
91 }
92 }
93#endif
94 if (side=='l' || side=='L') {
95 ldwork = k;
96 work_size = MAX(1,ldwork) * MAX(1,n);
97 }
98 else {
99 ldwork = m;
100 work_size = MAX(1,ldwork) * MAX(1,k);
101 }
102 /* Allocate memory for working array(s) */
103 work = (lapack_complex_float*)
104 LAPACKE_malloc( sizeof(lapack_complex_float) * work_size );
105 if( work == NULL ) {
107 goto exit_level_0;
108 }
109 /* Call middle-level interface */
110 info = LAPACKE_ctprfb_work( matrix_layout, side, trans, direct, storev, m, n,
111 k, l, v, ldv, t, ldt, a, lda, b, ldb, work,
112 ldwork );
113 /* Release memory and exit */
114 LAPACKE_free( work );
115exit_level_0:
116 if( info == LAPACK_WORK_MEMORY_ERROR ) {
117 LAPACKE_xerbla( "LAPACKE_ctprfb", info );
118 }
119 return info;
120}
#define lapack_int
Definition lapack.h:83
#define lapack_complex_float
Definition lapack.h:45
#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
lapack_int LAPACKE_ctprfb_work(int matrix_layout, char side, char trans, char direct, char storev, lapack_int m, lapack_int n, lapack_int k, lapack_int l, const lapack_complex_float *v, lapack_int ldv, const lapack_complex_float *t, lapack_int ldt, lapack_complex_float *a, lapack_int lda, lapack_complex_float *b, lapack_int ldb, lapack_complex_float *work, lapack_int ldwork)
#define LAPACK_ROW_MAJOR
Definition lapacke.h:52
int LAPACKE_get_nancheck(void)
#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)
lapack_logical LAPACKE_cge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *a, lapack_int lda)
n