1
/* ---------------------------------------------------------------------
3
* -- Automatically Tuned Linear Algebra Software (ATLAS)
4
* (C) Copyright 2000 All Rights Reserved
6
* -- ATLAS routine -- Version 3.2 -- December 15, 2000
8
* -- Suggestions, comments, bugs reports should be sent to the follo-
9
* wing e-mail address: atlas@cs.utk.edu
11
* Author : Antoine P. Petitet
12
* University of Tennessee - Innovative Computing Laboratory
13
* Knoxville TN, 37996-1301, USA.
15
* ---------------------------------------------------------------------
17
* -- Copyright notice and Licensing terms:
19
* Redistribution and use in source and binary forms, with or without
20
* modification, are permitted provided that the following conditions
23
* 1. Redistributions of source code must retain the above copyright
24
* notice, this list of conditions and the following disclaimer.
25
* 2. Redistributions in binary form must reproduce the above copyright
26
* notice, this list of conditions, and the following disclaimer in
27
* the documentation and/or other materials provided with the distri-
29
* 3. The name of the University, the ATLAS group, or the names of its
30
* contributors may not be used to endorse or promote products deri-
31
* ved from this software without specific written permission.
35
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
38
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
39
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
40
* CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
41
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
42
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
43
* RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
44
* CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
45
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47
* ---------------------------------------------------------------------
52
#include "atlas_refmisc.h"
53
#include "atlas_reflvl2.h"
54
#include "atlas_reflevel2.h"
58
const enum ATLAS_UPLO UPLO,
59
const enum ATLAS_TRANS TRANS,
60
const enum ATLAS_DIAG DIAG,
71
* ATL_creftpmv performs one of the matrix-vector operations
73
* x := A * x, or x := conjg( A ) * x, or
75
* x := A'* x, or x := conjg( A' ) * x,
77
* where x is an n-element vector and A is an n by n unit, or non-unit,
78
* upper or lower triangular matrix, supplied in packed form.
83
* UPLO (input) const enum ATLAS_UPLO
84
* On entry, UPLO specifies whether the matrix is an upper or
85
* lower triangular matrix as follows:
87
* UPLO = AtlasUpper A is an upper triangular matrix.
89
* UPLO = AtlasLower A is a lower triangular matrix.
93
* TRANS (input) const enum ATLAS_TRANS
94
* On entry, TRANS specifies the operation to be performed as
97
* TRANS = AtlasNoTrans x := A *x,
99
* TRANS = AtlasConj x := conjg( A ) * x,
101
* TRANS = AtlasTrans x := A'*x,
103
* TRANS = AtlasConjTrans x := conjg( A' )*x.
107
* DIAG (input) const enum ATLAS_DIAG
108
* On entry, DIAG specifies whether or not A is unit triangu-
111
* DIAG = AtlasUnit A is assumed to be unit triangular,
113
* DIAG = AtlasNonUnit A is not assumed to be unit trian-
118
* N (input) const int
119
* On entry, N specifies the order of the matrix A. N must be at
120
* least zero. Unchanged on exit.
122
* A (input) const float *
123
* On entry, A points to an array of size equal to or greater
124
* than (( n*(n+1) ) / 2) * sizeof( float [2] ). Before entry
125
* with UPLO = AtlasUpper, the array A must contain the upper
126
* triangular matrix packed sequentially, column by column, so
127
* that A[ 0 ] contains a(0,0), A[ 1 ] and A[ 2 ] contain a(0,1)
128
* and a(1,1) respectively, and so on. Before entry with
129
* UPLO = AtlasLower, the array A must contain the lower tri-
130
* angular matrix packed sequentially, column by column, so that
131
* A[ 0 ] contains a(0,0), A[ 1 ] and A[ 2 ] contain a(1,0) and
132
* a( 2, 0 ) respectively, and so on.
134
* Note that when DIAG = AtlasUnit, the diagonal elements of A
135
* are not referenced, but are assumed to be unity. Unchanged
138
* X (input/output) float *
139
* On entry, X points to the first entry to be accessed of an
140
* incremented array of size equal to or greater than
141
* ( 1 + ( n - 1 ) * abs( INCX ) ) * sizeof( float [2] ),
142
* that contains the vector x. On exit, X is overwritten with
143
* the tranformed vector x.
145
* INCX (input) const int
146
* On entry, INCX specifies the increment for the elements of X.
147
* INCX must not be zero. Unchanged on exit.
149
* ---------------------------------------------------------------------
152
* .. Executable Statements ..
157
if( UPLO == AtlasUpper )
159
if( TRANS == AtlasNoTrans )
161
if( DIAG == AtlasNonUnit )
163
ATL_creftpmvUNN( N, A, 1, X, INCX );
167
ATL_creftpmvUNU( N, A, 1, X, INCX );
170
else if( TRANS == AtlasConj )
172
if( DIAG == AtlasNonUnit )
174
ATL_creftpmvUCN( N, A, 1, X, INCX );
178
ATL_creftpmvUCU( N, A, 1, X, INCX );
181
else if( TRANS == AtlasTrans )
183
if( DIAG == AtlasNonUnit )
185
ATL_creftpmvUTN( N, A, 1, X, INCX );
189
ATL_creftpmvUTU( N, A, 1, X, INCX );
194
if( DIAG == AtlasNonUnit )
196
ATL_creftpmvUHN( N, A, 1, X, INCX );
200
ATL_creftpmvUHU( N, A, 1, X, INCX );
206
if( TRANS == AtlasNoTrans )
208
if( DIAG == AtlasNonUnit )
210
ATL_creftpmvLNN( N, A, N, X, INCX );
214
ATL_creftpmvLNU( N, A, N, X, INCX );
217
else if( TRANS == AtlasConj )
219
if( DIAG == AtlasNonUnit )
221
ATL_creftpmvLCN( N, A, N, X, INCX );
225
ATL_creftpmvLCU( N, A, N, X, INCX );
228
else if( TRANS == AtlasTrans )
230
if( DIAG == AtlasNonUnit )
232
ATL_creftpmvLTN( N, A, N, X, INCX );
236
ATL_creftpmvLTU( N, A, N, X, INCX );
241
if( DIAG == AtlasNonUnit )
243
ATL_creftpmvLHN( N, A, N, X, INCX );
247
ATL_creftpmvLHU( N, A, N, X, INCX );
252
* End of ATL_creftpmv