LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_str_trans()

void LAPACKE_str_trans ( int  matrix_layout,
char  uplo,
char  diag,
lapack_int  n,
const float *  in,
lapack_int  ldin,
float *  out,
lapack_int  ldout 
)

Definition at line 40 of file lapacke_str_trans.c.

43 {
44  lapack_int i, j, st;
45  lapack_logical colmaj, lower, unit;
46 
47  if( in == NULL || out == NULL ) return ;
48 
49  colmaj = ( matrix_layout == LAPACK_COL_MAJOR );
50  lower = LAPACKE_lsame( uplo, 'l' );
51  unit = LAPACKE_lsame( diag, 'u' );
52 
53  if( ( !colmaj && ( matrix_layout != LAPACK_ROW_MAJOR ) ) ||
54  ( !lower && !LAPACKE_lsame( uplo, 'u' ) ) ||
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 || lower ) && !( colmaj && lower ) ) {
73  for( j = st; j < MIN( n, ldout ); j++ ) {
74  for( i = 0; i < MIN( j+1-st, ldin ); i++ ) {
75  out[ j+i*ldout ] = in[ i+j*ldin ];
76  }
77  }
78  } else {
79  for( j = 0; j < MIN( n-st, ldout ); j++ ) {
80  for( i = j+st; i < MIN( n, ldin ); i++ ) {
81  out[ j+i*ldout ] = in[ i+j*ldin ];
82  }
83  }
84  }
85 }
#define lapack_logical
Definition: lapacke.h:51
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define MIN(x, y)
Definition: lapacke_utils.h:50
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: