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.
24 if (alpha == 0.0 && beta == 1.0)
27 /* form y := beta*y */
29 INDEX iy = OFFSET(N, incY);
30 for (i = 0; i < N; i++) {
34 } else if (beta != 1.0) {
35 INDEX iy = OFFSET(N, incY);
36 for (i = 0; i < N; i++) {
45 /* form y := alpha*A*x + y */
47 if ((order == CblasRowMajor && Uplo == CblasUpper)
48 || (order == CblasColMajor && Uplo == CblasLower)) {
49 INDEX ix = OFFSET(N, incX);
50 INDEX iy = OFFSET(N, incY);
51 for (i = 0; i < N; i++) {
52 BASE tmp1 = alpha * X[ix];
54 const INDEX j_min = i + 1;
55 const INDEX j_max = N;
56 INDEX jx = OFFSET(N, incX) + j_min * incX;
57 INDEX jy = OFFSET(N, incY) + j_min * incY;
59 Y[iy] += tmp1 * Ap[TPUP(N, i, i)];
61 for (j = j_min; j < j_max; j++) {
62 const BASE apk = Ap[TPUP(N, i, j)];
68 Y[iy] += alpha * tmp2;
72 } else if ((order == CblasRowMajor && Uplo == CblasLower)
73 || (order == CblasColMajor && Uplo == CblasUpper)) {
74 INDEX ix = OFFSET(N, incX);
75 INDEX iy = OFFSET(N, incY);
76 for (i = 0; i < N; i++) {
77 BASE tmp1 = alpha * X[ix];
80 const INDEX j_min = 0;
81 const INDEX j_max = i;
82 INDEX jx = OFFSET(N, incX) + j_min * incX;
83 INDEX jy = OFFSET(N, incY) + j_min * incY;
85 Y[iy] += tmp1 * Ap[TPLO(N, i, i)];
87 for (j = j_min; j < j_max; j++) {
88 const BASE apk = Ap[TPLO(N, i, j)];
94 Y[iy] += alpha * tmp2;
99 BLAS_ERROR("unrecognized operation");