LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ LAPACKE_ctz_trans()

void LAPACKE_ctz_trans ( int  matrix_layout,
char  direct,
char  uplo,
char  diag,
lapack_int  m,
lapack_int  n,
const lapack_complex_float in,
lapack_int  ldin,
lapack_complex_float out,
lapack_int  ldout 
)

Definition at line 84 of file lapacke_ctz_trans.c.

88{
89 lapack_logical colmaj, front, lower, unit;
90
91 if( in == NULL || out == NULL ) return ;
92
93 colmaj = ( matrix_layout == LAPACK_COL_MAJOR );
94 front = LAPACKE_lsame( direct, 'f' );
95 lower = LAPACKE_lsame( uplo, 'l' );
96 unit = LAPACKE_lsame( diag, 'u' );
97
98 if( ( !colmaj && ( matrix_layout != LAPACK_ROW_MAJOR ) ) ||
99 ( !front && !LAPACKE_lsame( direct, 'b' ) ) ||
100 ( !lower && !LAPACKE_lsame( uplo, 'u' ) ) ||
101 ( !unit && !LAPACKE_lsame( diag, 'n' ) ) ) {
102 /* Just exit if any of input parameters are wrong */
103 return;
104 }
105
106 /* Initial offsets and sizes of triangular and rectangular parts */
107 lapack_int tri_in_offset = 0;
108 lapack_int tri_out_offset = 0;
109 lapack_int tri_n = MIN(m,n);
110 lapack_int rect_in_offset = -1;
111 lapack_int rect_out_offset = -1;
112 lapack_int rect_m = ( m > n ) ? m - n : m;
113 lapack_int rect_n = ( n > m ) ? n - m : n;
114
115 /* Fix offsets depending on the shape of the matrix */
116 if( front ) {
117 if( lower && m > n ) {
118 rect_in_offset = tri_n * ( !colmaj ? ldin : 1 );
119 rect_out_offset = tri_n * ( colmaj ? ldout : 1 );
120 } else if( !lower && n > m ) {
121 rect_in_offset = tri_n * ( colmaj ? ldin : 1 );
122 rect_out_offset = tri_n * ( !colmaj ? ldout : 1 );
123 }
124 } else {
125 if( m > n ) {
126 tri_in_offset = rect_m * ( !colmaj ? ldin : 1 );
127 tri_out_offset = rect_m * ( colmaj ? ldout : 1 );
128 if( !lower ) {
129 rect_in_offset = 0;
130 rect_out_offset = 0;
131 }
132 } else if( n > m ) {
133 tri_in_offset = rect_n * ( colmaj ? ldin : 1 );
134 tri_out_offset = rect_n * ( !colmaj ? ldout : 1 );
135 if( lower ) {
136 rect_in_offset = 0;
137 rect_out_offset = 0;
138 }
139 }
140 }
141
142 /* Copy & transpose rectangular part */
143 if( rect_in_offset >= 0 && rect_out_offset >= 0 ) {
144 LAPACKE_cge_trans( matrix_layout, rect_m, rect_n,
145 &in[rect_in_offset], ldin,
146 &out[rect_out_offset], ldout );
147 }
148
149 /* Copy & transpose triangular part */
150 return LAPACKE_ctr_trans( matrix_layout, uplo, diag, tri_n,
151 &in[tri_in_offset], ldin,
152 &out[tri_out_offset], ldout );
153}
#define lapack_int
Definition: lapack.h:87
#define lapack_logical
Definition: lapack.h:103
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:35
#define MIN(x, y)
Definition: lapacke_utils.h:49
void LAPACKE_ctr_trans(int matrix_layout, char uplo, char diag, lapack_int n, const lapack_complex_float *in, lapack_int ldin, lapack_complex_float *out, lapack_int ldout)
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)
Here is the call graph for this function:
Here is the caller graph for this function: