Coverage Report

Created: 2023-06-07 06:06

/src/igraph/vendor/lapack/daxpy.c
Line
Count
Source (jump to first uncovered line)
1
/*  -- translated by f2c (version 20191129).
2
   You must link the resulting object file with libf2c:
3
  on Microsoft Windows system, link with libf2c.lib;
4
  on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5
  or, if you install libf2c.a in a standard place, with -lf2c -lm
6
  -- in that order, at the end of the command line, as in
7
    cc *.o -lf2c -lm
8
  Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9
10
    http://www.netlib.org/f2c/libf2c.zip
11
*/
12
13
#include "f2c.h"
14
15
/* > \brief \b DAXPY   
16
17
    =========== DOCUMENTATION ===========   
18
19
   Online html documentation available at   
20
              http://www.netlib.org/lapack/explore-html/   
21
22
    Definition:   
23
    ===========   
24
25
         SUBROUTINE DAXPY(N,DA,DX,INCX,DY,INCY)   
26
27
         DOUBLE PRECISION DA   
28
         INTEGER INCX,INCY,N   
29
         DOUBLE PRECISION DX(*),DY(*)   
30
31
32
   > \par Purpose:   
33
    =============   
34
   >   
35
   > \verbatim   
36
   >   
37
   >    DAXPY constant times a vector plus a vector.   
38
   >    uses unrolled loops for increments equal to one.   
39
   > \endverbatim   
40
41
    Arguments:   
42
    ==========   
43
44
   > \param[in] N   
45
   > \verbatim   
46
   >          N is INTEGER   
47
   >         number of elements in input vector(s)   
48
   > \endverbatim   
49
   >   
50
   > \param[in] DA   
51
   > \verbatim   
52
   >          DA is DOUBLE PRECISION   
53
   >           On entry, DA specifies the scalar alpha.   
54
   > \endverbatim   
55
   >   
56
   > \param[in] DX   
57
   > \verbatim   
58
   >          DX is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCX ) )   
59
   > \endverbatim   
60
   >   
61
   > \param[in] INCX   
62
   > \verbatim   
63
   >          INCX is INTEGER   
64
   >         storage spacing between elements of DX   
65
   > \endverbatim   
66
   >   
67
   > \param[in,out] DY   
68
   > \verbatim   
69
   >          DY is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCY ) )   
70
   > \endverbatim   
71
   >   
72
   > \param[in] INCY   
73
   > \verbatim   
74
   >          INCY is INTEGER   
75
   >         storage spacing between elements of DY   
76
   > \endverbatim   
77
78
    Authors:   
79
    ========   
80
81
   > \author Univ. of Tennessee   
82
   > \author Univ. of California Berkeley   
83
   > \author Univ. of Colorado Denver   
84
   > \author NAG Ltd.   
85
86
   > \date November 2017   
87
88
   > \ingroup double_blas_level1   
89
90
   > \par Further Details:   
91
    =====================   
92
   >   
93
   > \verbatim   
94
   >   
95
   >     jack dongarra, linpack, 3/11/78.   
96
   >     modified 12/3/93, array(1) declarations changed to array(*)   
97
   > \endverbatim   
98
   >   
99
    =====================================================================   
100
   Subroutine */ int igraphdaxpy_(integer *n, doublereal *da, doublereal *dx, 
101
  integer *incx, doublereal *dy, integer *incy)
102
0
{
103
    /* System generated locals */
104
0
    integer i__1;
105
106
    /* Local variables */
107
0
    integer i__, m, ix, iy, mp1;
108
109
110
/*  -- Reference BLAS level1 routine (version 3.8.0) --   
111
    -- Reference BLAS is a software package provided by Univ. of Tennessee,    --   
112
    -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--   
113
       November 2017   
114
115
116
    =====================================================================   
117
118
       Parameter adjustments */
119
0
    --dy;
120
0
    --dx;
121
122
    /* Function Body */
123
0
    if (*n <= 0) {
124
0
  return 0;
125
0
    }
126
0
    if (*da == 0.) {
127
0
  return 0;
128
0
    }
129
0
    if (*incx == 1 && *incy == 1) {
130
131
/*        code for both increments equal to 1   
132
133
134
          clean-up loop */
135
136
0
  m = *n % 4;
137
0
  if (m != 0) {
138
0
      i__1 = m;
139
0
      for (i__ = 1; i__ <= i__1; ++i__) {
140
0
    dy[i__] += *da * dx[i__];
141
0
      }
142
0
  }
143
0
  if (*n < 4) {
144
0
      return 0;
145
0
  }
146
0
  mp1 = m + 1;
147
0
  i__1 = *n;
148
0
  for (i__ = mp1; i__ <= i__1; i__ += 4) {
149
0
      dy[i__] += *da * dx[i__];
150
0
      dy[i__ + 1] += *da * dx[i__ + 1];
151
0
      dy[i__ + 2] += *da * dx[i__ + 2];
152
0
      dy[i__ + 3] += *da * dx[i__ + 3];
153
0
  }
154
0
    } else {
155
156
/*        code for unequal increments or equal increments   
157
            not equal to 1 */
158
159
0
  ix = 1;
160
0
  iy = 1;
161
0
  if (*incx < 0) {
162
0
      ix = (-(*n) + 1) * *incx + 1;
163
0
  }
164
0
  if (*incy < 0) {
165
0
      iy = (-(*n) + 1) * *incy + 1;
166
0
  }
167
0
  i__1 = *n;
168
0
  for (i__ = 1; i__ <= i__1; ++i__) {
169
0
      dy[iy] += *da * dx[ix];
170
0
      ix += *incx;
171
0
      iy += *incy;
172
0
  }
173
0
    }
174
0
    return 0;
175
0
} /* igraphdaxpy_ */
176