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

« back to all changes in this revision

Viewing changes to src/blas/reference/level2/ATL_drefspmv.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_drefspmv
 
57
(
 
58
   const enum ATLAS_UPLO      UPLO,
 
59
   const int                  N,
 
60
   const double               ALPHA,
 
61
   const double               * A,
 
62
   const double               * X,
 
63
   const int                  INCX,
 
64
   const double               BETA,
 
65
   double                     * Y,
 
66
   const int                  INCY
 
67
)
 
68
{
 
69
/*
 
70
 * Purpose
 
71
 * =======
 
72
 *
 
73
 * ATL_drefspmv performs the matrix-vector operation
 
74
 *
 
75
 *    y := alpha * A * x + beta * y,
 
76
 *
 
77
 * where alpha and beta are scalars, x and y are n-element vectors and A
 
78
 * is an n by n symmetric matrix, supplied in packed form.
 
79
 *
 
80
 * Arguments
 
81
 * =========
 
82
 *
 
83
 * UPLO    (input)                       const enum ATLAS_UPLO
 
84
 *         On entry, UPLO  specifies whether the upper or lower triangu-
 
85
 *         lar part of the matrix A is supplied in the packed array A
 
86
 *         as follows:
 
87
 *
 
88
 *             UPLO = AtlasUpper   The upper triangular part of A is
 
89
 *                                 supplied in A.
 
90
 *
 
91
 *             UPLO = AtlasLower   The lower triangular part of A is
 
92
 *                                 supplied in A.
 
93
 *
 
94
 *         Unchanged on exit.
 
95
 *
 
96
 * N       (input)                       const int
 
97
 *         On entry, N specifies the order of the matrix A. N must be at
 
98
 *         least zero. Unchanged on exit.
 
99
 *
 
100
 * ALPHA   (input)                       const double
 
101
 *         On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
 
102
 *         supplied as zero then  A and X  need not be set on input. Un-
 
103
 *         changed on exit.
 
104
 *
 
105
 * A       (input)                       const double *
 
106
 *         On entry,  A  points  to an array of size equal to or greater
 
107
 *         than   (( n*(n+1) ) / 2) * sizeof(   double  ).  Before entry
 
108
 *         with UPLO = AtlasUpper, the array  A  must contain  the upper
 
109
 *         triangular  part of the symmetric matrix packed sequentially,
 
110
 *         column by column, so that A[ 0 ] contains a(0,0), A[ 1 ]  and
 
111
 *         A[ 2 ] contain a(0,1) and a(1,1) respectively, and so on.
 
112
 *         Before entry with UPLO = AtlasLower, the array A must contain
 
113
 *         the lower triangular  part of the symmetric matrix packed se-
 
114
 *         quentially, column by column, so that A[ 0 ] contains a(0,0),
 
115
 *         A[ 1 ] and A[ 2 ] contain a(1,0) and a(2,0) respectively, and
 
116
 *         so on. Unchanged on exit.
 
117
 *
 
118
 * X       (input)                       const double *
 
119
 *         On entry,  X  points to the  first entry to be accessed of an
 
120
 *         incremented array of size equal to or greater than
 
121
 *            ( 1 + ( n - 1 ) * abs( INCX ) ) * sizeof(   double  ),
 
122
 *         that contains the vector x. Unchanged on exit.
 
123
 *
 
124
 * INCX    (input)                       const int
 
125
 *         On entry, INCX specifies the increment for the elements of X.
 
126
 *         INCX must not be zero. Unchanged on exit.
 
127
 *
 
128
 * BETA    (input)                       const double
 
129
 *         On entry,  BETA  specifies the scalar  beta.   When  BETA  is
 
130
 *         supplied as zero then Y  need not be set on input.  Unchanged
 
131
 *         on exit.
 
132
 *
 
133
 * Y       (input/output)                double *
 
134
 *         On entry,  Y  points to the  first entry to be accessed of an
 
135
 *         incremented array of size equal to or greater than
 
136
 *            ( 1 + ( n - 1 ) * abs( INCY ) ) * sizeof(   double  ),
 
137
 *         that contains the vector y.  Before entry with BETA non-zero,
 
138
 *         the incremented array  Y  must contain the vector y. On exit,
 
139
 *         Y is overwritten by the updated vector y.
 
140
 *
 
141
 * INCY    (input)                       const int
 
142
 *         On entry, INCY specifies the increment for the elements of Y.
 
143
 *         INCY must not be zero. Unchanged on exit.
 
144
 *
 
145
 * ---------------------------------------------------------------------
 
146
 */
 
147
/* ..
 
148
 * .. Executable Statements ..
 
149
 *
 
150
 */
 
151
   if( ( N == 0 ) || ( ( ALPHA == ATL_dZERO ) &&
 
152
                       ( BETA  == ATL_dONE  ) ) ) return;
 
153
   if( ALPHA == ATL_dZERO ) { Mdvscal( N, BETA, Y, INCY ); return; }
 
154
 
 
155
   if( UPLO == AtlasUpper )
 
156
   {
 
157
      ATL_drefspmvU( N,    ALPHA, A, 1,   X, INCX, BETA, Y, INCY );
 
158
   }
 
159
   else
 
160
   {
 
161
      ATL_drefspmvL( N,    ALPHA, A, N,   X, INCX, BETA, Y, INCY );
 
162
   }
 
163
/*
 
164
 * End of ATL_drefspmv
 
165
 */
 
166
}