2
* Automatically Tuned Linear Algebra Software v3.2
3
* (C) Copyright 1997 R. Clint Whaley
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
8
* 1. Redistributions of source code must retain the above copyright
9
* notice, this list of conditions and the following disclaimer.
10
* 2. Redistributions in binary form must reproduce the above copyright
11
* notice, this list of conditions, and the following disclaimer in the
12
* documentation and/or other materials provided with the distribution.
13
* 3. The name of the University of Tennessee, the ATLAS group,
14
* or the names of its contributers may not be used to endorse
15
* or promote products derived from this software without specific
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE
22
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
* POSSIBILITY OF SUCH DAMAGE.
31
#include "atlas_kern3.h"
39
void Mjoin(Mjoin(PATL,syr2k_putU),BNM)
40
(const int N, const TYPE *D, const SCALAR beta0, TYPE *A, const int lda)
43
* Takes D with property (D + D') = (D + D')', and writes it to
44
* upper part of symetric matrix A
48
const int ldap1 = lda+1;
49
const TYPE *Dc=D, *Dr;
51
const register SCALAR beta=beta0;
53
for (j=0; j != N; j++)
55
for (Dr=Dc+j, Ar=Ad, i=j; i != N; i++, Dr += N, Ar += lda)
61
*Ar = *Ar*beta + Dc[i] + *Dr;
71
void Mjoin(Mjoin(PATL,her2k_putU),BNM)
73
void Mjoin(Mjoin(PATL,syr2k_putU),BNM)
75
(const int N, const TYPE *D, const SCALAR beta0, TYPE *A, const int lda)
78
* Takes D with property (D + D') = (D + D')', and writes it to
79
* upper part of symetric matrix A
83
const int N2=N<<1, lda2=lda<<1;
88
const TYPE *Dc=D, *Dr;
90
const register TYPE rbeta=*beta0;
93
const register TYPE rbeta=*beta0, ibeta=beta0[1];
96
for (j2=0; j2 != N2; j2 += 2)
100
for (i=0; i != j2; i += 2, Dr += ldD2)
103
A[i+1] += Dc[i+1] MPi Dr[1];
105
A[j2] += Dc[j2] + Dc[j2];
109
A[j2+1] += Dc[j2+1] + Dc[j2+1];
112
for (i=0; i != j2; i += 2, Dr += ldD2)
115
A[i+1] = Dc[i+1] MPi Dr[1];
117
A[j2] = Dc[j2] + Dc[j2];
121
A[j2+1] = Dc[j2+1] + Dc[j2+1];
123
#elif defined(BETAN1) || defined(BETAXI0)
124
for (i=0; i != j2; i += 2, Dr += ldD2)
126
A[i] = ATL_MulByBETA(A[i]) + Dc[i] + *Dr;
127
A[i+1] = ATL_MulByBETA(A[i+1]) + Dc[i+1] MPi Dr[1];
129
A[j2] = ATL_MulByBETA(A[j2]) + Dc[j2] + Dc[j2];
133
A[j2+1] = ATL_MulByBETA(A[j2+1]) + Dc[j2+1] + Dc[j2+1];
136
for (i=0; i <= j2; i += 2, Dr += ldD2)
140
A[i] = ra*rbeta - ia*ibeta + Dc[i] + *Dr;
141
A[i+1] = rbeta*ia + ibeta*ra + Dc[i+1] + Dr[1];