LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
void LAPACKE_ctp_trans ( int  matrix_layout,
char  uplo,
char  diag,
lapack_int  n,
const lapack_complex_float in,
lapack_complex_float out 
)

Definition at line 40 of file lapacke_ctp_trans.c.

43 {
44  lapack_int i, j, st;
45  lapack_logical colmaj, upper, unit;
46 
47  if( in == NULL || out == NULL ) return ;
48 
49  colmaj = ( matrix_layout == LAPACK_COL_MAJOR );
50  upper = LAPACKE_lsame( uplo, 'u' );
51  unit = LAPACKE_lsame( diag, 'u' );
52 
53  if( ( !colmaj && ( matrix_layout != LAPACK_ROW_MAJOR ) ) ||
54  ( !upper && !LAPACKE_lsame( uplo, 'l' ) ) ||
55  ( !unit && !LAPACKE_lsame( diag, 'n' ) ) ) {
56  /* Just exit if any of input parameters are wrong */
57  return;
58  }
59  if( unit ) {
60  /* If unit, then don't touch diagonal, start from 1st column or row */
61  st = 1;
62  } else {
63  /* If non-unit, then check diagonal also, starting from [0,0] */
64  st = 0;
65  }
66 
67  /* Perform conversion:
68  * Since col_major upper and row_major lower are equal,
69  * and col_major lower and row_major upper are equals too -
70  * using one code for equal cases. XOR( colmaj, upper )
71  */
72  if( ( colmaj || upper ) && !( colmaj && upper ) ) {
73  for( j = st; j < n; j++ ) {
74  for( i = 0; i < j+1-st; i++ ) {
75  out[ j-i + (i*(2*n-i+1))/2 ] = in[ ((j+1)*j)/2 + i ];
76  }
77  }
78  } else {
79  for( j = 0; j < n-st; j++ ) {
80  for( i = j+st; i < n; i++ ) {
81  out[ j + ((i+1)*i)/2 ] = in[ (j*(2*n-j+1))/2 + i-j ];
82  }
83  }
84  }
85 }
#define lapack_logical
Definition: lapacke.h:51
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:36
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
#define lapack_int
Definition: lapacke.h:47

Here is the call graph for this function:

Here is the caller graph for this function: