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
* Contributor(s) : R. Clint Whaley
10
* Originally developed at the University of Tennessee,
11
* Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
13
* ---------------------------------------------------------------------
15
* -- Copyright notice and Licensing terms:
17
* Redistribution and use in source and binary forms, with or without
18
* modification, are permitted provided that the following conditions
21
* 1. Redistributions of source code must retain the above copyright
22
* notice, this list of conditions and the following disclaimer.
23
* 2. Redistributions in binary form must reproduce the above copyright
24
* notice, this list of conditions, and the following disclaimer in
25
* the documentation and/or other materials provided with the distri-
27
* 3. The name of the University, the ATLAS group, or the names of its
28
* contributors may not be used to endorse or promote products deri-
29
* ved from this software without specific written permission.
33
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
36
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
37
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
38
* CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
39
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
40
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
41
* RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
42
* CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
43
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45
* ---------------------------------------------------------------------
50
#include "atlas_misc.h"
53
#include "atlas_level1.h"
54
#include "atlas_kernel2.h"
55
#include "atlas_reflvl2.h"
56
#include "atlas_lvl2.h"
64
void Mjoin( PATL, syrU )
78
* Mjoin( PATL, syrU ) performs the symmetric rank 1 operation
80
* A := alpha * x * x' + A,
82
* where alpha is a scalar, x is an n-element vector and A is an n by n
85
* This is a recursive version of the algorithm. For a more detailed
86
* description of the arguments of this function, see the reference im-
87
* plementation in the ATLAS/src/blas/reference directory.
89
* ---------------------------------------------------------------------
92
* .. Local Variables ..
97
int i, j, jy, n1, n1s, n2;
99
const TYPE one[2] = { ATL_rone, ATL_rzero };
100
register TYPE t0_i, t0_r;
101
const int incy2 = 2 * INCY, lda2 = (LDA SHIFT);
102
int i, iax, j, jy, n1, n1s, n2;
105
#define ger Mjoin( PATL, ger1_a1_x1_yX )
107
#define ger Mjoin( PATL, ger1u_a1_x1_yX )
110
* .. Executable Statements ..
116
for( j = 0, jy = 0; j < N; j++, jy += INCY, A += LDA )
117
{ t0 = Y[jy]; for( i = 0; i <= j; i++ ) { A[i] += X[i] * t0; } }
119
for( j = 0, jy = 0; j < N; j++, jy += incy2, A += lda2 )
121
t0_r = Y[jy]; t0_i = Y[jy+1];
122
for( i = 0, iax = 0; i <= j; i++, iax += 2 )
124
A[iax ] += X[iax] * t0_r - X[iax+1] * t0_i;
125
A[iax+1] += X[iax] * t0_i + X[iax+1] * t0_r;
132
n2 = N - ( n1 = ( N >> 1 ) ); n1s = (n1 SHIFT);
133
Mjoin( PATL, syrU )( n1, X, Y, INCY, A, LDA );
134
MUrnext( n1, A, LDA ); Y += n1s * INCY;
135
ger( n1, n2, one, X, 1, Y, INCY, A - n1s, LDA ); X += n1s;
136
Mjoin( PATL, syrU )( n2, X, Y, INCY, A, LDA );
139
* End of Mjoin( PATL, syrU )