1 /* blas/source_syrk_r.h
3 * Copyright (C) 2001, 2007 Brian Gough
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 if (Order == CblasRowMajor) {
29 trans = (Trans == CblasConjTrans) ? CblasTrans : Trans;
31 uplo = (Uplo == CblasUpper) ? CblasLower : CblasUpper;
33 if (Trans == CblasTrans || Trans == CblasConjTrans) {
40 /* form y := beta*y */
42 if (uplo == CblasUpper) {
43 for (i = 0; i < N; i++) {
44 for (j = i; j < N; j++) {
49 for (i = 0; i < N; i++) {
50 for (j = 0; j <= i; j++) {
55 } else if (beta != 1.0) {
56 if (uplo == CblasUpper) {
57 for (i = 0; i < N; i++) {
58 for (j = i; j < N; j++) {
59 C[ldc * i + j] *= beta;
63 for (i = 0; i < N; i++) {
64 for (j = 0; j <= i; j++) {
65 C[ldc * i + j] *= beta;
74 if (uplo == CblasUpper && trans == CblasNoTrans) {
76 for (i = 0; i < N; i++) {
77 for (j = i; j < N; j++) {
79 for (k = 0; k < K; k++) {
80 temp += A[i * lda + k] * A[j * lda + k];
82 C[i * ldc + j] += alpha * temp;
86 } else if (uplo == CblasUpper && trans == CblasTrans) {
88 for (i = 0; i < N; i++) {
89 for (j = i; j < N; j++) {
91 for (k = 0; k < K; k++) {
92 temp += A[k * lda + i] * A[k * lda + j];
94 C[i * ldc + j] += alpha * temp;
98 } else if (uplo == CblasLower && trans == CblasNoTrans) {
100 for (i = 0; i < N; i++) {
101 for (j = 0; j <= i; j++) {
103 for (k = 0; k < K; k++) {
104 temp += A[i * lda + k] * A[j * lda + k];
106 C[i * ldc + j] += alpha * temp;
110 } else if (uplo == CblasLower && trans == CblasTrans) {
112 for (i = 0; i < N; i++) {
113 for (j = 0; j <= i; j++) {
115 for (k = 0; k < K; k++) {
116 temp += A[k * lda + i] * A[k * lda + j];
118 C[i * ldc + j] += alpha * temp;
123 BLAS_ERROR("unrecognized operation");