1
/* ---------------------------------------------------------------------
3
* -- Automatically Tuned Linear Algebra Software (ATLAS)
4
* (C) Copyright 2000 All Rights Reserved
6
* -- ATLAS routine -- Version 3.2 -- December 25, 2000
8
* Author : Antoine P. Petitet
9
* Originally developed at the University of Tennessee,
10
* Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
12
* ---------------------------------------------------------------------
14
* -- Copyright notice and Licensing terms:
16
* Redistribution and use in source and binary forms, with or without
17
* modification, are permitted provided that the following conditions
20
* 1. Redistributions of source code must retain the above copyright
21
* notice, this list of conditions and the following disclaimer.
22
* 2. Redistributions in binary form must reproduce the above copyright
23
* notice, this list of conditions, and the following disclaimer in
24
* the documentation and/or other materials provided with the distri-
26
* 3. The name of the University, the ATLAS group, or the names of its
27
* contributors may not be used to endorse or promote products deri-
28
* ved from this software without specific written permission.
32
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
36
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
37
* CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
38
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
40
* RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
41
* CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
42
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44
* ---------------------------------------------------------------------
49
#include "atlas_misc.h"
52
#include "atlas_level1.h"
53
#include "atlas_kernel2.h"
54
#include "atlas_reflvl2.h"
55
#include "atlas_lvl2.h"
64
* Workaround for icc bug on IA64Itan2
66
#ifdef ATL_IntelIccBugs
67
#pragma optimize("", off);
69
void Mjoin( PATL, hprL )
83
* Mjoin( PATL, hprL ) performs the Hermitian rank 1 operation
85
* A := alpha* x * conjg( x' ) + A,
87
* where alpha is a real scalar, x is an n-element vector and A is an n
88
* by n Hermitian matrix, supplied in packed form.
90
* This is a recursive version of the algorithm. For a more detailed
91
* description of the arguments of this function, see the reference im-
92
* plementation in the ATLAS/src/blas/reference directory.
94
* ---------------------------------------------------------------------
97
* .. Local Variables ..
102
int i, iaij, j, jaj, jy, lda = LDA, n1, n1s, n2;
104
const TYPE one[2] = { ATL_rone, ATL_rzero };
105
register TYPE t0_i, t0_r;
106
const int incy2 = 2 * INCY;
107
int i, iaij, ix, j, jaj, jy, lda = LDA,
108
lda2 = (LDA << 1), n1, n1s, n2;
110
#define gpr Mjoin( PATL, gpr1cL_a1_x1_yX )
112
* .. Executable Statements ..
117
for( j = 0, jaj = 0, jy = 0; j < N; j++, jy += incy2, X += 2 )
119
t0_r = Y[jy]; t0_i = -Y[jy+1];
120
A[jaj] += (*X) * t0_r - X[1] * t0_i; A[jaj+1] = ATL_rzero;
122
for( i = j+1, iaij = jaj+2, ix = 2; i < N; i++, iaij += 2, ix += 2 )
124
A[iaij ] += X[ix] * t0_r - X[ix+1] * t0_i;
125
A[iaij+1] += X[ix] * t0_i + X[ix+1] * t0_r;
127
jaj += lda2; lda2 -= 2;
132
n2 = N - ( n1 = ( N >> 1 ) ); n1s = (n1 SHIFT);
133
Mjoin( PATL, hprL )( n1, X, Y, INCY, A, lda ); X += n1s;
134
gpr( n2, n1, one, X, 1, Y, INCY, A + n1s, lda ); Y += n1s * INCY;
135
MLpnext( n1, A, lda ); Mjoin( PATL, hprL )( n2, X, Y, INCY, A, lda );
138
* End of Mjoin( PATL, hprL )