lapacke_*tp_trans: condition should be inverted
authoreugene.chereshnev <eugenechereshnev@gmail.com>
Wed, 1 Feb 2017 20:07:06 +0000 (12:07 -0800)
committereugene.chereshnev <eugenechereshnev@gmail.com>
Sat, 4 Feb 2017 02:47:03 +0000 (18:47 -0800)
The function converts <in> from <matrix_layout> to opposite layout.
E.g. for upper case (all indices are 0-based):
col-major, upper: a(i,j) is stored in ap[(1 + j)*j/2 + i]
row-major, upper: a(i,j) is stored in ap[(n + n-i+1)*i/2 + j-i]

LAPACKE/utils/lapacke_ctp_trans.c
LAPACKE/utils/lapacke_dtp_trans.c
LAPACKE/utils/lapacke_stp_trans.c
LAPACKE/utils/lapacke_ztp_trans.c

index 2c51ddd..6678e1a 100644 (file)
@@ -69,7 +69,7 @@ void LAPACKE_ctp_trans( int matrix_layout, char uplo, char diag,
      * 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 ) ) {
+    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 ];
index 483af39..7d7455d 100644 (file)
@@ -69,7 +69,7 @@ void LAPACKE_dtp_trans( int matrix_layout, char uplo, char diag,
      * 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 ) ) {
+    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 ];
index 2370842..7e67600 100644 (file)
@@ -69,7 +69,7 @@ void LAPACKE_stp_trans( int matrix_layout, char uplo, char diag,
      * 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 ) ) {
+    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 ];
index b3654e5..e7369ba 100644 (file)
@@ -69,7 +69,7 @@ void LAPACKE_ztp_trans( int matrix_layout, char uplo, char diag,
      * 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 ) ) {
+    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 ];