LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
 All Classes Files Functions Variables Typedefs Macros
lapacke_ctp_trans.c File Reference
#include "lapacke_utils.h"
Include dependency graph for lapacke_ctp_trans.c:

Go to the source code of this file.

Functions/Subroutines

void LAPACKE_ctp_trans (int matrix_order, char uplo, char diag, lapack_int n, const lapack_complex_float *in, lapack_complex_float *out)

Function/Subroutine Documentation

void LAPACKE_ctp_trans ( int  matrix_order,
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.

{
lapack_int i, j, st;
lapack_logical colmaj, upper, unit;
if( in == NULL || out == NULL ) return ;
colmaj = ( matrix_order == LAPACK_COL_MAJOR );
upper = LAPACKE_lsame( uplo, 'u' );
unit = LAPACKE_lsame( diag, 'u' );
if( ( !colmaj && ( matrix_order != LAPACK_ROW_MAJOR ) ) ||
( !upper && !LAPACKE_lsame( uplo, 'l' ) ) ||
( !unit && !LAPACKE_lsame( diag, 'n' ) ) ) {
/* Just exit if any of input parameters are wrong */
return;
}
if( unit ) {
/* If unit, then don't touch diagonal, start from 1st column or row */
st = 1;
} else {
/* If non-unit, then check diagonal also, starting from [0,0] */
st = 0;
}
/* Perform conversion:
* Since col_major upper and row_major lower are equal,
* and col_major lower and row_major upper are equals too -
* using one code for equal cases. XOR( colmaj, upper )
*/
if( ( colmaj || upper ) && !( colmaj && upper ) ) {
for( j = st; j < n; j++ ) {
for( i = 0; i < j+1-st; i++ ) {
out[ j-i + (i*(2*n-i+1))/2 ] = in[ ((j+1)*j)/2 + i ];
}
}
} else {
for( j = 0; j < n-st; j++ ) {
for( i = j+st; i < n; i++ ) {
out[ j + ((i+1)*i)/2 ] = in[ (j*(2*n-j+1))/2 + i-j ];
}
}
}
}

Here is the call graph for this function:

Here is the caller graph for this function: