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_TRANS TRANS,
75
* ATL_srefgemv performs one of the matrix-vector operations
77
* y := alpha * op( A ) * x + beta * y,
79
* where op( X ) is one of
81
* op( X ) = X or op( X ) = X'.
83
* where alpha and beta are scalars, x and y are vectors and op( A ) is
89
* TRANS (input) const enum ATLAS_TRANS
90
* On entry, TRANS specifies the operation to be performed as
93
* TRANS = AtlasNoTrans y := alpha*A *x + beta*y,
95
* TRANS = AtlasConj y := alpha*A *x + beta*y,
97
* TRANS = AtlasTrans y := alpha*A'*x + beta*y,
99
* TRANS = AtlasConjTrans y := alpha*A'*x + beta*y.
103
* M (input) const int
104
* On entry, M specifies the number of rows of the matrix A
105
* when TRANS = AtlasNoTrans or TRANS = AtlasConj, and the num-
106
* ber of columns of the matrix A otherwise. M must be at least
107
* zero. Unchanged on exit.
109
* N (input) const int
110
* On entry, N specifies the number of columns of the matrix A
111
* when TRANS = AtlasNoTrans or TRANS = AtlasConj, and the num-
112
* ber of rows of the matrix A otherwise. N must be at least ze-
113
* ro. Unchanged on exit.
115
* ALPHA (input) const float
116
* On entry, ALPHA specifies the scalar alpha. When ALPHA is
117
* supplied as zero then A and X need not be set on input. Un-
120
* A (input) const float *
121
* On entry, A points to an array of size equal to or greater
122
* than LDA * ka * sizeof( float ), where ka is n when
123
* TRANS = AtlasNotrans or TRANS = AtlasConj, and m otherwise.
124
* Before entry, when TRANS = AtlasNotrans or TRANS = AtlasConj,
125
* the leading m by n part of the array A must contain the ma-
126
* trix coefficients, and otherwise the leading n by m part of
127
* the array A must contain the matrix coefficients. Unchanged
130
* LDA (input) const int
131
* On entry, LDA specifies the leading dimension of A as decla-
132
* red in the calling (sub) program. LDA must be at least
133
* MAX( 1, m ) when TRANS = AtlasNotrans or TRANS = AtlasConj,
134
* and MAX( 1, n ) otherwise. Unchanged on exit.
136
* X (input) const float *
137
* On entry, X points to the first entry to be accessed of an
138
* incremented array of size equal to or greater than
139
* ( 1 + ( n - 1 ) * abs( INCX ) ) * sizeof( float ),
140
* that contains the vector x. Unchanged on exit.
142
* INCX (input) const int
143
* On entry, INCX specifies the increment for the elements of X.
144
* INCX must not be zero. Unchanged on exit.
146
* BETA (input) const float
147
* On entry, BETA specifies the scalar beta. When BETA is
148
* supplied as zero then Y need not be set on input. Unchanged
151
* Y (input/output) float *
152
* On entry, Y points to the first entry to be accessed of an
153
* incremented array of size equal to or greater than
154
* ( 1 + ( m - 1 ) * abs( INCY ) ) * sizeof( float ),
155
* that contains the vector y. Before entry with BETA non-zero,
156
* the incremented array Y must contain the vector y. On exit,
157
* Y is overwritten by the updated vector y.
159
* INCY (input) const int
160
* On entry, INCY specifies the increment for the elements of Y.
161
* INCY must not be zero. Unchanged on exit.
163
* ---------------------------------------------------------------------
166
* .. Executable Statements ..
169
if( ( M == 0 ) || ( N == 0 ) ||
170
( ( ALPHA == ATL_sZERO ) && ( BETA == ATL_sONE ) ) ) return;
172
if( ALPHA == ATL_sZERO ) { Msvscal( M, BETA, Y, INCY ); return; }
174
if( ( TRANS == AtlasNoTrans ) || ( TRANS == AtlasConj ) )
175
{ ATL_srefgemvN( M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY ); }
177
{ ATL_srefgemvT( M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY ); }
179
* End of ATL_srefgemv