3 * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 if (alpha == 0.0 && beta == 1.0)
29 /* form y := beta*y */
31 INDEX iy = OFFSET(N, incY);
32 for (i = 0; i < N; i++) {
36 } else if (beta != 1.0) {
37 INDEX iy = OFFSET(N, incY);
38 for (i = 0; i < N; i++) {
47 /* form y := alpha*A*x + y */
49 if ((order == CblasRowMajor && Uplo == CblasUpper)
50 || (order == CblasColMajor && Uplo == CblasLower)) {
51 INDEX ix = OFFSET(N, incX);
52 INDEX iy = OFFSET(N, incY);
54 for (i = 0; i < N; i++) {
55 BASE tmp1 = alpha * X[ix];
57 const INDEX j_min = i + 1;
58 const INDEX j_max = GSL_MIN(N, i + K + 1);
59 INDEX jx = OFFSET(N, incX) + j_min * incX;
60 INDEX jy = OFFSET(N, incY) + j_min * incY;
61 Y[iy] += tmp1 * A[0 + i * lda];
62 for (j = j_min; j < j_max; j++) {
63 BASE Aij = A[(j - i) + i * lda];
69 Y[iy] += alpha * tmp2;
73 } else if ((order == CblasRowMajor && Uplo == CblasLower)
74 || (order == CblasColMajor && Uplo == CblasUpper)) {
75 INDEX ix = OFFSET(N, incX);
76 INDEX iy = OFFSET(N, incY);
78 for (i = 0; i < N; i++) {
79 BASE tmp1 = alpha * X[ix];
81 const INDEX j_min = (i > K) ? i - K : 0;
82 const INDEX j_max = i;
83 INDEX jx = OFFSET(N, incX) + j_min * incX;
84 INDEX jy = OFFSET(N, incY) + j_min * incY;
85 for (j = j_min; j < j_max; j++) {
86 BASE Aij = A[(K - i + j) + i * lda];
92 Y[iy] += tmp1 * A[K + i * lda] + alpha * tmp2;
97 BLAS_ERROR("unrecognized operation");