~ubuntu-branches/ubuntu/vivid/atlas/vivid

« back to all changes in this revision

Viewing changes to src/blas/reference/level2/ATL_srefgemv.c

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2002-04-13 10:07:52 UTC
  • Revision ID: james.westby@ubuntu.com-20020413100752-va9zm0rd4gpurdkq
Tags: upstream-3.2.1ln
ImportĀ upstreamĀ versionĀ 3.2.1ln

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ---------------------------------------------------------------------
 
2
 *
 
3
 * -- Automatically Tuned Linear Algebra Software (ATLAS)
 
4
 *    (C) Copyright 2000 All Rights Reserved
 
5
 *
 
6
 * -- ATLAS routine -- Version 3.2 -- December 15, 2000
 
7
 *
 
8
 * -- Suggestions,  comments,  bugs reports should be sent to the follo-
 
9
 *    wing e-mail address: atlas@cs.utk.edu
 
10
 *
 
11
 * Author         : Antoine P. Petitet
 
12
 * University of Tennessee - Innovative Computing Laboratory
 
13
 * Knoxville TN, 37996-1301, USA.
 
14
 *
 
15
 * ---------------------------------------------------------------------
 
16
 *
 
17
 * -- Copyright notice and Licensing terms:
 
18
 *
 
19
 *  Redistribution  and  use in  source and binary forms, with or without
 
20
 *  modification, are  permitted provided  that the following  conditions
 
21
 *  are met:
 
22
 *
 
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-
 
28
 *    bution.
 
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.
 
32
 *
 
33
 * -- Disclaimer:
 
34
 *
 
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.
 
46
 *
 
47
 * ---------------------------------------------------------------------
 
48
 */
 
49
/*
 
50
 * Include files
 
51
 */
 
52
#include "atlas_refmisc.h"
 
53
#include "atlas_reflvl2.h"
 
54
#include "atlas_reflevel2.h"
 
55
 
 
56
void ATL_srefgemv
 
57
(
 
58
   const enum ATLAS_TRANS     TRANS,
 
59
   const int                  M,
 
60
   const int                  N,
 
61
   const float                ALPHA,
 
62
   const float                * A,
 
63
   const int                  LDA,
 
64
   const float                * X,
 
65
   const int                  INCX,
 
66
   const float                BETA,
 
67
   float                      * Y,
 
68
   const int                  INCY
 
69
)
 
70
{
 
71
/*
 
72
 * Purpose
 
73
 * =======
 
74
 *
 
75
 * ATL_srefgemv performs one of the matrix-vector operations
 
76
 *
 
77
 *    y := alpha * op( A ) * x + beta * y,
 
78
 *
 
79
 * where op( X ) is one of
 
80
 *
 
81
 *    op( X ) = X   or   op( X ) = X'.
 
82
 *
 
83
 * where  alpha and beta are scalars, x and y are vectors and op( A ) is
 
84
 * an m by n matrix.
 
85
 *
 
86
 * Arguments
 
87
 * =========
 
88
 *
 
89
 * TRANS   (input)                       const enum ATLAS_TRANS
 
90
 *         On entry,  TRANS  specifies the  operation to be performed as
 
91
 *         follows:
 
92
 *
 
93
 *            TRANS = AtlasNoTrans    y := alpha*A *x + beta*y,
 
94
 *
 
95
 *            TRANS = AtlasConj       y := alpha*A *x + beta*y,
 
96
 *
 
97
 *            TRANS = AtlasTrans      y := alpha*A'*x + beta*y,
 
98
 *
 
99
 *            TRANS = AtlasConjTrans  y := alpha*A'*x + beta*y.
 
100
 *
 
101
 *         Unchanged on exit.
 
102
 *
 
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.
 
108
 *
 
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.
 
114
 *
 
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-
 
118
 *         changed on exit.
 
119
 *
 
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
 
128
 *         on exit.
 
129
 *
 
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.
 
135
 *
 
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.
 
141
 *
 
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.
 
145
 *
 
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
 
149
 *         on exit.
 
150
 *
 
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.
 
158
 *
 
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.
 
162
 *
 
163
 * ---------------------------------------------------------------------
 
164
 */
 
165
/* ..
 
166
 * .. Executable Statements ..
 
167
 *
 
168
 */
 
169
   if( ( M == 0 ) || ( N == 0 ) ||
 
170
       ( ( ALPHA == ATL_sZERO ) && ( BETA == ATL_sONE  ) ) ) return;
 
171
 
 
172
   if( ALPHA == ATL_sZERO ) { Msvscal( M, BETA, Y, INCY ); return; }
 
173
 
 
174
   if( ( TRANS == AtlasNoTrans ) || ( TRANS == AtlasConj ) )
 
175
   { ATL_srefgemvN( M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY ); }
 
176
   else
 
177
   { ATL_srefgemvT( M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY ); }
 
178
/*
 
179
 * End of ATL_srefgemv
 
180
 */
 
181
}