LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_ctr_trans()

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 
)

Definition at line 39 of file lapacke_ctr_trans.c.

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