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

« back to all changes in this revision

Viewing changes to src/blas/level2/kernel/ATL_tbmvLCN.c

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2013-06-11 15:58:16 UTC
  • mfrom: (1.1.3 upstream)
  • mto: (2.2.21 experimental)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20130611155816-b72z8f621tuhbzn0
Tags: upstream-3.10.1
Import upstream version 3.10.1

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 25, 2000
7
 
 *
8
 
 * Author         : Antoine P. Petitet
9
 
 * Contributor(s) : R. Clint Whaley
10
 
 * Originally developed at the University of Tennessee,
11
 
 * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
12
 
 *
13
 
 * ---------------------------------------------------------------------
14
 
 *
15
 
 * -- Copyright notice and Licensing terms:
16
 
 *
17
 
 *  Redistribution  and  use in  source and binary forms, with or without
18
 
 *  modification, are  permitted provided  that the following  conditions
19
 
 *  are met:
20
 
 *
21
 
 * 1. Redistributions  of  source  code  must retain the above copyright
22
 
 *    notice, this list of conditions and the following disclaimer.
23
 
 * 2. Redistributions in binary form must reproduce  the above copyright
24
 
 *    notice,  this list of conditions, and the  following disclaimer in
25
 
 *    the documentation and/or other materials provided with the distri-
26
 
 *    bution.
27
 
 * 3. The name of the University,  the ATLAS group,  or the names of its
28
 
 *    contributors  may not be used to endorse or promote products deri-
29
 
 *    ved from this software without specific written permission.
30
 
 *
31
 
 * -- Disclaimer:
32
 
 *
33
 
 * THIS  SOFTWARE  IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34
 
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,  INCLUDING,  BUT NOT
35
 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
36
 
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
37
 
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,  INDIRECT, INCIDENTAL, SPE-
38
 
 * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
39
 
 * TO,  PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
40
 
 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
41
 
 * RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (IN-
42
 
 * CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
43
 
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44
 
 *
45
 
 * ---------------------------------------------------------------------
46
 
 */
47
 
/*
48
 
 * Include files
49
 
 */
50
 
#include "atlas_misc.h"
51
 
#include "atlas_mv.h"
52
 
#include "atlas_r1.h"
53
 
#include "atlas_level1.h"
54
 
#include "atlas_kernel2.h"
55
 
#include "atlas_reflvl2.h"
56
 
#include "atlas_lvl2.h"
57
 
 
58
 
#ifdef TREAL
59
 
#define    MinN_tbmvLCN      16
60
 
#else
61
 
#define    MinN_tbmvLCN       8
62
 
#endif
63
 
 
64
 
void Mjoin( PATL, tbmvLCN )
65
 
(
66
 
   const int                  N,
67
 
   const int                  K,
68
 
   const TYPE                 * A,
69
 
   const int                  LDA,
70
 
   TYPE                       * X
71
 
)
72
 
{
73
 
/*
74
 
 * Purpose
75
 
 * =======
76
 
 *
77
 
 * Mjoin( PATL, tbmvLCN ) performs the following matrix-vector operation
78
 
 *
79
 
 *    x := conjg( A  ) * x,
80
 
 *
81
 
 * where x is an n-element vector and  A  is an n by n  non-unit,  lower
82
 
 * triangular band matrix, with ( k + 1 ) diagonals.
83
 
 *
84
 
 * This is a  recursive  version of the  algorithm.  For a more detailed
85
 
 * description of  the arguments of this function, see the reference im-
86
 
 * plementation in the  ATLAS/src/blas/reference directory.
87
 
 *
88
 
 * ---------------------------------------------------------------------
89
 
 */
90
 
/*
91
 
 * .. Local Variables ..
92
 
 */
93
 
#ifdef TREAL
94
 
#define    one                ATL_rone
95
 
#define    lda2               LDA
96
 
#else
97
 
   const TYPE                 one[2] = { ATL_rone, ATL_rzero };
98
 
   const int                  lda2   = ( LDA << 1 );
99
 
#endif
100
 
   int                        ja, kl, ku, ma, na, n1, n1s, n2;
101
 
/* ..
102
 
 * .. Executable Statements ..
103
 
 *
104
 
 */
105
 
   if( N <= MinN_tbmvLCN )
106
 
   { Mjoin( PATL, reftbmvLCN )( N, K, A, LDA, X, 1 ); }
107
 
   else
108
 
   {
109
 
      n2 = N - ( n1 = ( N >> 1 ) ); n1s = (n1 SHIFT);
110
 
      Mjoin( PATL, tbmvLCN )( n2, K, A+n1*lda2, LDA, X+n1s );
111
 
      ja = n1 - K; ja = Mmax( ja, 0 ); ma = Mmin( n2, K );
112
 
      ku = na = n1 - ja;  kl = K - ku; kl = Mmax( kl, 0 );
113
 
      Mjoin( PATL, gbmvNc_a1_x1_b1_y1 )( ma, na, kl, ku, one, A+ja*lda2, LDA,
114
 
                                         X+(ja SHIFT), 1, one, X+n1s, 1 );
115
 
      Mjoin( PATL, tbmvLCN )( n1, K, A, LDA, X );
116
 
   }
117
 
/*
118
 
 * End of Mjoin( PATL, tbmvLCN )
119
 
 */
120
 
}