Logo ROOT  
Reference Guide
mndaxpy.cxx
Go to the documentation of this file.
1// @(#)root/minuit2:$Id$
2// Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7 * *
8 **********************************************************************/
9
10/* daxpy.f -- translated by f2c (version 20010320).
11 You must link the resulting object file with the libraries:
12 -lf2c -lm (in that order)
13*/
14
15namespace ROOT {
16
17 namespace Minuit2 {
18
19
20int Mndaxpy(unsigned int n, double da, const double* dx, int incx, double* dy,
21 int incy) {
22 /* System generated locals */
23 int i__1;
24
25 /* Local variables */
26 int i__, m, ix, iy, mp1;
27
28
29 /* constant times a vector plus a vector. */
30 /* uses unrolled loops for increments equal to one. */
31 /* jack dongarra, linpack, 3/11/78. */
32 /* modified 12/3/93, array(1) declarations changed to array(*) */
33
34
35 /* Parameter adjustments */
36 --dy;
37 --dx;
38
39 /* Function Body */
40 if (n <= 0) {
41 return 0;
42 }
43 if (da == 0.) {
44 return 0;
45 }
46 if (incx == 1 && incy == 1) {
47 goto L20;
48 }
49
50 /* code for unequal increments or equal increments */
51 /* not equal to 1 */
52
53 ix = 1;
54 iy = 1;
55 if (incx < 0) {
56 ix = (-static_cast<int>(n) + 1) * incx + 1;
57 }
58 if (incy < 0) {
59 iy = (-static_cast<int>(n) + 1) * incy + 1;
60 }
61 i__1 = n;
62 for (i__ = 1; i__ <= i__1; ++i__) {
63 dy[iy] += da * dx[ix];
64 ix += incx;
65 iy += incy;
66 /* L10: */
67 }
68 return 0;
69
70 /* code for both increments equal to 1 */
71
72
73 /* clean-up loop */
74
75L20:
76 m = n % 4;
77 if (m == 0) {
78 goto L40;
79 }
80 i__1 = m;
81 for (i__ = 1; i__ <= i__1; ++i__) {
82 dy[i__] += da * dx[i__];
83 /* L30: */
84 }
85 if (n < 4) {
86 return 0;
87 }
88L40:
89 mp1 = m + 1;
90 i__1 = n;
91 for (i__ = mp1; i__ <= i__1; i__ += 4) {
92 dy[i__] += da * dx[i__];
93 dy[i__ + 1] += da * dx[i__ + 1];
94 dy[i__ + 2] += da * dx[i__ + 2];
95 dy[i__ + 3] += da * dx[i__ + 3];
96 /* L50: */
97 }
98 return 0;
99} /* daxpy_ */
100
101
102 } // namespace Minuit2
103
104} // namespace ROOT
const Int_t n
Definition: legend1.C:16
int Mndaxpy(unsigned int, double, const double *, int, double *, int)
Definition: mndaxpy.cxx:20
VSD Structures.
Definition: StringConv.hxx:21
auto * m
Definition: textangle.C:8