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,
73
* ATL_drefspmv performs the matrix-vector operation
75
* y := alpha * A * x + beta * y,
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.
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
88
* UPLO = AtlasUpper The upper triangular part of A is
91
* UPLO = AtlasLower The lower triangular part of A is
97
* On entry, N specifies the order of the matrix A. N must be at
98
* least zero. Unchanged on exit.
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-
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.
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.
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.
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
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.
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.
145
* ---------------------------------------------------------------------
148
* .. Executable Statements ..
151
if( ( N == 0 ) || ( ( ALPHA == ATL_dZERO ) &&
152
( BETA == ATL_dONE ) ) ) return;
153
if( ALPHA == ATL_dZERO ) { Mdvscal( N, BETA, Y, INCY ); return; }
155
if( UPLO == AtlasUpper )
157
ATL_drefspmvU( N, ALPHA, A, 1, X, INCX, BETA, Y, INCY );
161
ATL_drefspmvL( N, ALPHA, A, N, X, INCX, BETA, Y, INCY );
164
* End of ATL_drefspmv