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

« back to all changes in this revision

Viewing changes to src/blas/reference/level2/ATL_creftpmv.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_creftpmv
 
57
(
 
58
   const enum ATLAS_UPLO      UPLO,
 
59
   const enum ATLAS_TRANS     TRANS,
 
60
   const enum ATLAS_DIAG      DIAG,
 
61
   const int                  N,
 
62
   const float                * A,
 
63
   float                      * X,
 
64
   const int                  INCX
 
65
)
 
66
{
 
67
/*
 
68
 * Purpose
 
69
 * =======
 
70
 *
 
71
 * ATL_creftpmv performs one of the matrix-vector operations
 
72
 *
 
73
 *    x := A * x,   or   x := conjg( A  ) * x,   or
 
74
 *
 
75
 *    x := A'* x,   or   x := conjg( A' ) * x,
 
76
 *
 
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.
 
79
 *
 
80
 * Arguments
 
81
 * =========
 
82
 *
 
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:
 
86
 *
 
87
 *             UPLO = AtlasUpper   A is an upper triangular matrix.
 
88
 *
 
89
 *             UPLO = AtlasLower   A is a lower triangular matrix.
 
90
 *
 
91
 *         Unchanged on exit.
 
92
 *
 
93
 * TRANS   (input)                       const enum ATLAS_TRANS
 
94
 *         On entry,  TRANS  specifies the  operation to be performed as
 
95
 *         follows:
 
96
 *
 
97
 *            TRANS = AtlasNoTrans     x := A *x,
 
98
 *
 
99
 *            TRANS = AtlasConj        x := conjg( A ) * x,
 
100
 *
 
101
 *            TRANS = AtlasTrans       x := A'*x,
 
102
 *
 
103
 *            TRANS = AtlasConjTrans   x := conjg( A' )*x.
 
104
 *
 
105
 *         Unchanged on exit.
 
106
 *
 
107
 * DIAG    (input)                       const enum ATLAS_DIAG
 
108
 *         On entry, DIAG specifies whether or not A is unit triangu-
 
109
 *         lar as follows:
 
110
 *
 
111
 *            DIAG = AtlasUnit       A is assumed to be unit triangular,
 
112
 *
 
113
 *            DIAG = AtlasNonUnit    A is not assumed to be unit trian-
 
114
 *                                   gular.
 
115
 *
 
116
 *         Unchanged on exit.
 
117
 *
 
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.
 
121
 *
 
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.
 
133
 *
 
134
 *         Note that when  DIAG = AtlasUnit,  the diagonal elements of A
 
135
 *         are not referenced,  but are  assumed to be unity.  Unchanged
 
136
 *         on exit.
 
137
 *
 
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.
 
144
 *
 
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.
 
148
 *
 
149
 * ---------------------------------------------------------------------
 
150
 */
 
151
/* ..
 
152
 * .. Executable Statements ..
 
153
 *
 
154
 */
 
155
   if( N == 0 ) return;
 
156
 
 
157
   if( UPLO == AtlasUpper )
 
158
   {
 
159
      if(      TRANS == AtlasNoTrans )
 
160
      {
 
161
         if( DIAG == AtlasNonUnit )
 
162
         {
 
163
            ATL_creftpmvUNN( N,    A, 1,   X, INCX );
 
164
         }
 
165
         else
 
166
         {
 
167
            ATL_creftpmvUNU( N,    A, 1,   X, INCX );
 
168
         }
 
169
      }
 
170
      else if( TRANS == AtlasConj    )
 
171
      {
 
172
         if( DIAG == AtlasNonUnit )
 
173
         {
 
174
            ATL_creftpmvUCN( N,    A, 1,   X, INCX );
 
175
         }
 
176
         else
 
177
         {
 
178
            ATL_creftpmvUCU( N,    A, 1,   X, INCX );
 
179
         }
 
180
      }
 
181
      else if( TRANS == AtlasTrans   )
 
182
      {
 
183
         if( DIAG == AtlasNonUnit )
 
184
         {
 
185
            ATL_creftpmvUTN( N,    A, 1,   X, INCX );
 
186
         }
 
187
         else
 
188
         {
 
189
            ATL_creftpmvUTU( N,    A, 1,   X, INCX );
 
190
         }
 
191
      }
 
192
      else
 
193
      {
 
194
         if( DIAG == AtlasNonUnit )
 
195
         {
 
196
            ATL_creftpmvUHN( N,    A, 1,   X, INCX );
 
197
         }
 
198
         else
 
199
         {
 
200
            ATL_creftpmvUHU( N,    A, 1,   X, INCX );
 
201
         }
 
202
      }
 
203
   }
 
204
   else
 
205
   {
 
206
      if(      TRANS == AtlasNoTrans )
 
207
      {
 
208
         if( DIAG == AtlasNonUnit )
 
209
         {
 
210
            ATL_creftpmvLNN( N,    A, N,   X, INCX );
 
211
         }
 
212
         else
 
213
         {
 
214
            ATL_creftpmvLNU( N,    A, N,   X, INCX );
 
215
         }
 
216
      }
 
217
      else if( TRANS == AtlasConj    )
 
218
      {
 
219
         if( DIAG == AtlasNonUnit )
 
220
         {
 
221
            ATL_creftpmvLCN( N,    A, N,   X, INCX );
 
222
         }
 
223
         else
 
224
         {
 
225
            ATL_creftpmvLCU( N,    A, N,   X, INCX );
 
226
         }
 
227
      }
 
228
      else if( TRANS == AtlasTrans   )
 
229
      {
 
230
         if( DIAG == AtlasNonUnit )
 
231
         {
 
232
            ATL_creftpmvLTN( N,    A, N,   X, INCX );
 
233
         }
 
234
         else
 
235
         {
 
236
            ATL_creftpmvLTU( N,    A, N,   X, INCX );
 
237
         }
 
238
      }
 
239
      else
 
240
      {
 
241
         if( DIAG == AtlasNonUnit )
 
242
         {
 
243
            ATL_creftpmvLHN( N,    A, N,   X, INCX );
 
244
         }
 
245
         else
 
246
         {
 
247
            ATL_creftpmvLHU( N,    A, N,   X, INCX );
 
248
         }
 
249
      }
 
250
   }
 
251
/*
 
252
 * End of ATL_creftpmv
 
253
 */
 
254
}