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"
58
void Mjoin( PATL, tpmvLC )
60
const enum ATLAS_DIAG DIAG,
61
const int N, /* N > 0 assumed */
71
* Mjoin( PATL, tpmvLC ) performs the following matrix-vector operation
73
* x := conjg( A ) * x,
75
* where x is an n-element vector and A is an n by n unit or non-unit,
76
* lower triangular matrix supplied in packed form.
78
* This is a blocked version of the algorithm. For a more detailed des-
79
* cription of the arguments of this function, see the reference imple-
80
* mentation in the ATLAS/src/blas/reference directory.
82
* ---------------------------------------------------------------------
85
* .. Local Variables ..
90
TYPE one[2] = { ATL_rone, ATL_rzero };
94
int incX, lda, lda0, mb, mb1, n, nb;
97
int incX, lda, m, mb, n1, nb, nb1;
99
void (*tpmv0)( const int, const TYPE *, const int,
101
#define gpmv0 Mjoin( PATL, gpmvLNc_a1_x1_b1_y1 )
103
* .. Executable Statements ..
106
ATL_GetPartMVN( A, LDA, &mb, &nb );
108
if( DIAG == AtlasNonUnit ) tpmv0 = Mjoin( PATL, tpmvLCN );
109
else tpmv0 = Mjoin( PATL, tpmvLCU );
112
mb1 = N - ( ( N - 1 ) / mb ) * mb; incX = (mb SHIFT); x0 = X;
113
lda = lda0 = LDA; A0 = (TYPE *)(A); MLpnext( N, A, lda );
115
for( n = N - mb, X += ((N-mb) SHIFT); n > 0; n -= mb, X -= incX )
117
MLpprev( mb, A, lda ); tpmv0( mb, A, lda, X );
118
gpmv0( mb, n, one, A0 + (n SHIFT), lda0, x0, 1, one, X, 1 );
120
tpmv0( mb1, A0, lda0, x0 );
122
nb1 = N - ( n1 = ( ( N - 1 ) / nb ) * nb );
123
incX = (nb SHIFT); x0 = ( X += (n1 SHIFT) );
124
lda = LDA; MLpnext( n1, A, lda ); tpmv0( nb1, A, lda, X ); x0 = X; X -= incX;
125
for( m = nb1; m < N; m += nb, X -= incX, x0 -= incX )
127
MLpprev( nb, A, lda );
128
gpmv0( m, nb, one, A + (nb SHIFT), lda, X, 1, one, x0, 1 );
129
tpmv0( nb, A, lda, X );
133
* End of Mjoin( PATL, tpmvLC )