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

« back to all changes in this revision

Viewing changes to interfaces/blas/C/src/cblas_strmv.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 R. Clint Whaley                     
 
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
 
 
32
#define SREAL
 
33
#include "atlas_misc.h"
 
34
#include "cblas.h"
 
35
#ifdef ATL_USEPTHREADS
 
36
   #include "atlas_ptalias2.h"
 
37
#endif
 
38
#include "atlas_level2.h"
 
39
 
 
40
void cblas_strmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
 
41
                 const enum CBLAS_TRANSPOSE TA, const enum CBLAS_DIAG Diag,
 
42
                 const int N, const float *A, const int lda,
 
43
                 float *X, const int incX)
 
44
{
 
45
   int info = 2000;
 
46
   enum CBLAS_UPLO uplo;
 
47
   enum CBLAS_TRANSPOSE ta;
 
48
   #define x X
 
49
 
 
50
#ifndef NoCblasErrorChecks
 
51
   if (Order != CblasColMajor && Order != CblasRowMajor)
 
52
      info = cblas_errprn(1, info, "Order must be %d or %d, but is set to %d",
 
53
                          CblasRowMajor, CblasColMajor, Order);
 
54
   if (Uplo != CblasUpper && Uplo != CblasLower)
 
55
      info = cblas_errprn(2, info, "UPLO must be %d or %d, but is set to %d",
 
56
                          CblasUpper, CblasLower, Uplo);
 
57
   if (TA != CblasNoTrans && TA != CblasTrans && TA != CblasConjTrans)
 
58
      info = cblas_errprn(3, info, 
 
59
                          "TransA must be %d, %d or %d, but is set to %d",
 
60
                          CblasNoTrans, CblasTrans, CblasConjTrans, TA);
 
61
   if (Diag != CblasUnit && Diag != CblasNonUnit)
 
62
      info = cblas_errprn(4, info, "DIAG must be %d or %d, but is set to %d",
 
63
                          CblasUnit, CblasNonUnit, Diag);
 
64
 
 
65
   if (N < 0) info = cblas_errprn(5, info, 
 
66
                        "N cannot be less than zero; is set to %d.", N);
 
67
   if (lda < N || lda < 1)
 
68
      info = cblas_errprn(7, info, "lda must be >= MAX(N,1): lda=%d N=%d",
 
69
                          lda, N);
 
70
   if (!incX) info = cblas_errprn(9, info,
 
71
                                  "incX cannot be zero; is set to %d.", incX);
 
72
   if (info != 2000)
 
73
   {
 
74
      cblas_xerbla(info, "cblas_strmv", "");
 
75
      return;
 
76
   }
 
77
#endif
 
78
   if (incX < 0) x += (1-N)*incX;
 
79
   if (Order == CblasColMajor)
 
80
      ATL_strmv(Uplo, TA, Diag, N, A, lda, x, incX);
 
81
   else
 
82
   {
 
83
      uplo = ( (Uplo == CblasUpper) ? CblasLower : CblasUpper );
 
84
      if (TA == CblasNoTrans) ta = CblasTrans;
 
85
      else ta = CblasNoTrans;
 
86
      ATL_strmv(uplo, ta, Diag, N, A, lda, x, incX);
 
87
   }
 
88
}