LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
void LAPACKE_sge_trans ( int  matrix_layout,
lapack_int  m,
lapack_int  n,
const float *  in,
lapack_int  ldin,
float *  out,
lapack_int  ldout 
)

Definition at line 40 of file lapacke_sge_trans.c.

43 {
44  lapack_int i, j, x, y;
45 
46  if( in == NULL || out == NULL ) return;
47 
48  if( matrix_layout == LAPACK_COL_MAJOR ) {
49  x = n;
50  y = m;
51  } else if ( matrix_layout == LAPACK_ROW_MAJOR ) {
52  x = m;
53  y = n;
54  } else {
55  /* Unknown input layout */
56  return;
57  }
58 
59  /* In case of incorrect m, n, ldin or ldout the function does nothing */
60  for( i = 0; i < MIN( y, ldin ); i++ ) {
61  for( j = 0; j < MIN( x, ldout ); j++ ) {
62  out[ (size_t)i*ldout + j ] = in[ (size_t)j*ldin + i ];
63  }
64  }
65 }
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define MIN(x, y)
Definition: lapacke_utils.h:50
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
#define lapack_int
Definition: lapacke.h:47