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"
40
void Mjoin(Mjoin(PATL,syr2k_putL),BNM)
41
(const int N, const TYPE *D, const SCALAR beta0, TYPE *A, const int lda)
44
* Takes D with property (D + D') = (D + D')', and writes it to
45
* lower part of symmetric matrix A
49
const TYPE *Dc=D, *Dr;
51
const register SCALAR beta=beta0;
53
for (j=0; j != N; j++)
55
for (Dr=Dc+j, i=j; i != N; i++, Dr += N)
61
Ac[i] = Ac[i]*beta + Dc[i] + *Dr;
71
void Mjoin(Mjoin(PATL,her2k_putL),BNM)
73
void Mjoin(Mjoin(PATL,syr2k_putL),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
* lower part of symmetric 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
A[j2] += Dc[j2] + Dc[j2];
104
A[j2+1] += Dc[j2+1] + Dc[j2+1];
108
for (i=j2+2; i != N2; i += 2, Dr += ldD2)
111
A[i+1] += Dc[i+1] MPi Dr[1];
115
A[j2] = Dc[j2] + Dc[j2];
119
A[j2+1] = Dc[j2+1] + Dc[j2+1];
123
for (i=j2+2; i != N2; i += 2, Dr += ldD2)
126
A[i+1] = Dc[i+1] MPi Dr[1];
129
#elif defined(BETAN1) || defined(BETAXI0)
130
A[j2] = ATL_MulByBETA(A[j2]) + Dc[j2] + Dc[j2];
134
A[j2+1] = ATL_MulByBETA(A[j2+1]) + Dc[j2+1] + Dc[j2+1];
138
for (i=j2+2; i != N2; i += 2, Dr += ldD2)
140
A[i] = ATL_MulByBETA(A[i]) + Dc[i] + *Dr;
141
A[i+1] = ATL_MulByBETA(A[i+1]) + Dc[i+1] MPi Dr[1];
147
A[j2] = ra*rbeta - ia*ibeta + Dc[j2] + Dc[j2];
148
A[j2+1] = rbeta*ia + ibeta*ra + Dc[j2+1] + Dc[j2+1];
151
for (i=j2+2; i != N2; i += 2, Dr += ldD2)
155
A[i] = ra*rbeta - ia*ibeta + Dc[i] + *Dr;
156
A[i+1] = rbeta*ia + ibeta*ra + Dc[i+1] + Dr[1];