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

« back to all changes in this revision

Viewing changes to src/testing/ATL_f77sbmv.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
 *             Automatically Tuned Linear Algebra Software v3.2
 
3
 *                   (C) Copyright 1999 Antoine P. Petitet                   
 
4
 *
 
5
 * Redistribution and use in source and binary forms, with or without
 
6
 * modification, are permitted provided that the following conditions
 
7
 * are met:
 
8
 *   1. Redistributions of source code must retain the above copyright
 
9
 *      notice, this list of conditions and the following disclaimer.
 
10
 *   2. Redistributions in binary form must reproduce the above copyright
 
11
 *      notice, this list of conditions, and the following disclaimer in the
 
12
 *      documentation and/or other materials provided with the distribution.
 
13
 *   3. The name of the University of Tennessee, the ATLAS group,
 
14
 *      or the names of its contributers may not be used to endorse
 
15
 *      or promote products derived from this software without specific
 
16
 *      written permission.
 
17
 *
 
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 
19
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 
20
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
21
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE
 
22
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
23
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
24
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
25
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
26
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
27
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
28
 * POSSIBILITY OF SUCH DAMAGE. 
 
29
 *
 
30
 */
 
31
#include "atlas_misc.h"
 
32
#include "atlas_tst.h"
 
33
#include "atlas_f77blas.h"
 
34
 
 
35
void Mjoin( PATL, f77sbmv )
 
36
(
 
37
   const enum ATLAS_UPLO     UPLO,
 
38
   const int                 N,
 
39
   const int                 K,
 
40
   const SCALAR              ALPHA,
 
41
   const TYPE                * A,
 
42
   const int                 LDA,
 
43
   const TYPE                * X,
 
44
   const int                 INCX,
 
45
   const SCALAR              BETA,
 
46
   TYPE                      * Y,
 
47
   const int                 INCY
 
48
)
 
49
{
 
50
#if defined( StringSunStyle )
 
51
   #if defined( ATL_FunkyInts )
 
52
   F77_INTEGER               ONE = 1;
 
53
   #else
 
54
   int                       ONE = 1;
 
55
   #endif
 
56
#elif defined( StringStructVal ) || defined( StringStructPtr )
 
57
   F77_CHAR                  fuplo;
 
58
#elif defined( StringCrayStyle )
 
59
   F77_CHAR                  fuplo;
 
60
#endif
 
61
 
 
62
   char                      cuplo;
 
63
 
 
64
#ifdef ATL_FunkyInts
 
65
   const F77_INTEGER         F77N    = N,
 
66
   const F77_INTEGER         F77K    = K,
 
67
                             F77lda  = LDA,
 
68
                             F77incx = INCX, F77incy = INCY;
 
69
#else
 
70
   #define F77N              N
 
71
   #define F77K              K
 
72
   #define F77lda            LDA
 
73
   #define F77incx           INCX
 
74
   #define F77incy           INCY
 
75
#endif
 
76
 
 
77
#ifdef TCPLX
 
78
   TYPE                      alpha[2], beta[2];
 
79
 
 
80
   *alpha = *ALPHA; alpha[1] = ALPHA[1];
 
81
   *beta  = *BETA;  beta [1] = BETA [1];
 
82
#else
 
83
   TYPE                      alpha = ALPHA, beta = BETA;
 
84
#endif
 
85
 
 
86
   if( UPLO == AtlasUpper ) cuplo = 'U';
 
87
   else                     cuplo = 'L';
 
88
 
 
89
   if( INCX < 0 ) X -= ( ( 1 - N ) * INCX ) SHIFT;
 
90
   if( INCY < 0 ) Y -= ( ( 1 - N ) * INCY ) SHIFT;
 
91
 
 
92
#if   defined( StringSunStyle  )
 
93
   F77sbmv( &cuplo, &F77N, &F77K, SADD alpha, A, &F77lda, X, &F77incx,
 
94
            SADD beta, Y, &F77incy, ONE );
 
95
#elif defined( StringCrayStyle )
 
96
   fuplo = ATL_C2F_TransChar( cuplo );
 
97
   F77sbmv( fuplo,  &F77N, &F77K, SADD alpha, A, &F77lda, X, &F77incx,
 
98
            SADD beta, Y, &F77incy );
 
99
#elif defined( StringStructVal )
 
100
   fuplo.len = 1; fuplo.cp = &cuplo;
 
101
   F77sbmv( fuplo,  &F77N, &F77K, SADD alpha, A, &F77lda, X, &F77incx,
 
102
            SADD beta, Y, &F77incy );
 
103
#elif defined( StringStructPtr )
 
104
   fuplo.len = 1; fuplo.cp = &cuplo;
 
105
   F77sbmv( &fuplo, &F77N, &F77K, SADD alpha, A, &F77lda, X, &F77incx,
 
106
            SADD beta, Y, &F77incy );
 
107
#else
 
108
   (void) fprintf( stderr, "\n\nF77/C interface not defined!!\n\n" );
 
109
   exit( -1 );
 
110
#endif
 
111
}