From 4e1b521e2737382dda184afa1265aa84f2ea1d53 Mon Sep 17 00:00:00 2001 From: buffer51 Date: Sat, 7 Nov 2015 19:31:13 -0500 Subject: [PATCH] Fix lapack complex implementation of lauu2 and potf2 for Android (use FLOAT instead of FLOAT[2] as imaginary part is not used). --- lapack/lauu2/zlauu2_L.c | 9 ++++----- lapack/lauu2/zlauu2_U.c | 7 +++---- lapack/potf2/zpotf2_L.c | 17 ++++++++--------- lapack/potf2/zpotf2_U.c | 17 ++++++++--------- 4 files changed, 23 insertions(+), 27 deletions(-) diff --git a/lapack/lauu2/zlauu2_L.c b/lapack/lauu2/zlauu2_L.c index 84baeca..1bc8b4c 100644 --- a/lapack/lauu2/zlauu2_L.c +++ b/lapack/lauu2/zlauu2_L.c @@ -46,7 +46,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, BLASLONG n, lda; FLOAT *a; - FLOAT temp[2]; + FLOAT temp; BLASLONG i; n = args -> n; @@ -64,12 +64,11 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, a + i * COMPSIZE, lda, NULL, 0, NULL, 0); if (i < n - 1) { - temp[0] = DOTC_K(n - i - 1, + temp = CREAL(DOTC_K(n - i - 1, a + (i + 1 + i * lda) * COMPSIZE, 1, - a + (i + 1 + i * lda) * COMPSIZE, 1); - GET_IMAGE(temp[1]); + a + (i + 1 + i * lda) * COMPSIZE, 1)); - *(a + (i + i * lda) * COMPSIZE + 0) += temp[0]; + *(a + (i + i * lda) * COMPSIZE + 0) += temp; *(a + (i + i * lda) * COMPSIZE + 1) = ZERO; GEMV_U(n - i - 1, i, 0, dp1, ZERO, diff --git a/lapack/lauu2/zlauu2_U.c b/lapack/lauu2/zlauu2_U.c index fd0a15f..02b7b2f 100644 --- a/lapack/lauu2/zlauu2_U.c +++ b/lapack/lauu2/zlauu2_U.c @@ -46,7 +46,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, BLASLONG n, lda; FLOAT *a; - FLOAT temp[2]; + FLOAT temp; BLASLONG i; n = args -> n; @@ -64,10 +64,9 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, a + i * lda * COMPSIZE, 1, NULL, 0, NULL, 0); if (i < n - 1) { - temp[0] = DOTC_K(n - i - 1, a + (i + (i + 1) * lda) * COMPSIZE, lda, a + (i + (i + 1) * lda) * COMPSIZE, lda); - GET_IMAGE(temp[1]); + temp = CREAL(DOTC_K(n - i - 1, a + (i + (i + 1) * lda) * COMPSIZE, lda, a + (i + (i + 1) * lda) * COMPSIZE, lda)); - *(a + (i + i * lda) * COMPSIZE + 0) += temp[0]; + *(a + (i + i * lda) * COMPSIZE + 0) += temp; *(a + (i + i * lda) * COMPSIZE + 1) = ZERO; GEMV_O(i, n - i - 1, 0, dp1, ZERO, diff --git a/lapack/potf2/zpotf2_L.c b/lapack/potf2/zpotf2_L.c index 33e9b60..d265c5d 100644 --- a/lapack/potf2/zpotf2_L.c +++ b/lapack/potf2/zpotf2_L.c @@ -51,7 +51,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, BLASLONG n, lda; FLOAT *a; - FLOAT ajj[2]; + FLOAT ajj; FLOAT *aoffset; BLASLONG i, j; @@ -68,18 +68,17 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, for (j = 0; j < n; j++) { - ajj[0] = DOTC_K(j, a + j * 2, lda, a + j * 2, lda); - GET_IMAGE(ajj[1]); + ajj = CREAL(DOTC_K(j, a + j * 2, lda, a + j * 2, lda)); - ajj[0] = *(aoffset + j * 2) - ajj[0]; + ajj = *(aoffset + j * 2) - ajj; - if (ajj[0] <= 0){ - *(aoffset + j * 2 + 0) = ajj[0]; + if (ajj <= 0){ + *(aoffset + j * 2 + 0) = ajj; *(aoffset + j * 2 + 1) = ZERO; return j + 1; } - ajj[0] = SQRT(ajj[0]); - *(aoffset + j * 2 + 0) = ajj[0]; + ajj = SQRT(ajj); + *(aoffset + j * 2 + 0) = ajj; *(aoffset + j * 2 + 1) = ZERO; i = n - j - 1; @@ -90,7 +89,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, a + j * 2, lda, aoffset + (j + 1) * 2, 1, sb); - SCAL_K(i, 0, 0, ONE / ajj[0], ZERO, + SCAL_K(i, 0, 0, ONE / ajj, ZERO, aoffset + (j + 1) * 2, 1, NULL, 0, NULL, 0); } diff --git a/lapack/potf2/zpotf2_U.c b/lapack/potf2/zpotf2_U.c index e0ccd46..594a90a 100644 --- a/lapack/potf2/zpotf2_U.c +++ b/lapack/potf2/zpotf2_U.c @@ -51,7 +51,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, BLASLONG n, lda; FLOAT *a; - FLOAT ajj[2]; + FLOAT ajj; BLASLONG i, j; n = args -> n; @@ -65,19 +65,18 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, for (j = 0; j < n; j++) { - ajj[0] = DOTC_K(j, a, 1, a, 1); - GET_IMAGE(ajj[1]); + ajj = CREAL(DOTC_K(j, a, 1, a, 1)); - ajj[0] = *(a + j * 2) - ajj[0]; + ajj = *(a + j * 2) - ajj; - if (ajj[0] <= 0){ - *(a + j * 2 + 0) = ajj[0]; + if (ajj <= 0){ + *(a + j * 2 + 0) = ajj; *(a + j * 2 + 1) = ZERO; return j + 1; } - ajj[0] = SQRT(ajj[0]); - *(a + j * 2 + 0) = ajj[0]; + ajj = SQRT(ajj); + *(a + j * 2 + 0) = ajj; *(a + j * 2 + 1) = ZERO; i = n - j - 1; @@ -88,7 +87,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, a, 1, a + (j + lda) * 2, lda, sb); - SCAL_K(i, 0, 0, ONE / ajj[0], ZERO, + SCAL_K(i, 0, 0, ONE / ajj, ZERO, a + (j + lda) * 2, lda, NULL, 0, NULL, 0); } -- 2.7.4