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
17namespace Minuit2 {
18
19int Mndaxpy(unsigned int n, double da, const double *dx, int incx, double *dy, int incy)
20{
21 /* System generated locals */
22 int i__1;
23
24 /* Local variables */
25 int i__, m, ix, iy, mp1;
26
27 /* constant times a vector plus a vector. */
28 /* uses unrolled loops for increments equal to one. */
29 /* jack dongarra, linpack, 3/11/78. */
30 /* modified 12/3/93, array(1) declarations changed to array(*) */
31
32 /* Parameter adjustments */
33 --dy;
34 --dx;
35
36 /* Function Body */
37 if (n <= 0) {
38 return 0;
39 }
40 if (da == 0.) {
41 return 0;
42 }
43 if (incx == 1 && incy == 1) {
44 goto L20;
45 }
46
47 /* code for unequal increments or equal increments */
48 /* not equal to 1 */
49
50 ix = 1;
51 iy = 1;
52 if (incx < 0) {
53 ix = (-static_cast<int>(n) + 1) * incx + 1;
54 }
55 if (incy < 0) {
56 iy = (-static_cast<int>(n) + 1) * incy + 1;
57 }
58 i__1 = n;
59 for (i__ = 1; i__ <= i__1; ++i__) {
60 dy[iy] += da * dx[ix];
61 ix += incx;
62 iy += incy;
63 /* L10: */
64 }
65 return 0;
66
67 /* code for both increments equal to 1 */
68
69 /* clean-up loop */
70
71L20:
72 m = n % 4;
73 if (m == 0) {
74 goto L40;
75 }
76 i__1 = m;
77 for (i__ = 1; i__ <= i__1; ++i__) {
78 dy[i__] += da * dx[i__];
79 /* L30: */
80 }
81 if (n < 4) {
82 return 0;
83 }
84L40:
85 mp1 = m + 1;
86 i__1 = n;
87 for (i__ = mp1; i__ <= i__1; i__ += 4) {
88 dy[i__] += da * dx[i__];
89 dy[i__ + 1] += da * dx[i__ + 1];
90 dy[i__ + 2] += da * dx[i__ + 2];
91 dy[i__ + 3] += da * dx[i__ + 3];
92 /* L50: */
93 }
94 return 0;
95} /* daxpy_ */
96
97} // namespace Minuit2
98
99} // namespace ROOT
const Int_t n
Definition: legend1.C:16
int Mndaxpy(unsigned int, double, const double *, int, double *, int)
Definition: mndaxpy.cxx:19
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
TMarker m
Definition: textangle.C:8