mndscal.cxx

Go to the documentation of this file.
00001 // @(#)root/minuit2:$Id: mndscal.cxx 20880 2007-11-19 11:23:41Z rdm $
00002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005  
00003 
00004 /**********************************************************************
00005  *                                                                    *
00006  * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
00007  *                                                                    *
00008  **********************************************************************/
00009 
00010 /* dscal.f -- translated by f2c (version 20010320).
00011    You must link the resulting object file with the libraries:
00012         -lf2c -lm   (in that order)
00013 */
00014 
00015 namespace ROOT {
00016 
00017    namespace Minuit2 {
00018 
00019 
00020 int Mndscal(unsigned int n, double da, double* dx, int incx) {
00021    /* System generated locals */
00022    int i__1, i__2;
00023    
00024    /* Local variables */
00025    int i__, m, nincx, mp1;
00026    
00027    
00028    /*     scales a vector by a constant. */
00029    /*     uses unrolled loops for increment equal to one. */
00030    /*     jack dongarra, linpack, 3/11/78. */
00031    /*     modified 3/93 to return if incx .le. 0. */
00032    /*     modified 12/3/93, array(1) declarations changed to array(*) */
00033    
00034    
00035    /* Parameter adjustments */
00036    --dx;
00037    
00038    /* Function Body */
00039    if (n <= 0 || incx <= 0) {
00040       return 0;
00041    }
00042    if (incx == 1) {
00043       goto L20;
00044    }
00045    
00046    /*        code for increment not equal to 1 */
00047    
00048    nincx = n * incx;
00049    i__1 = nincx;
00050    i__2 = incx;
00051    for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
00052       dx[i__] = da * dx[i__];
00053       /* L10: */
00054    }
00055    return 0;
00056    
00057    /*        code for increment equal to 1 */
00058    
00059    
00060    /*        clean-up loop */
00061    
00062 L20:
00063       m = n % 5;
00064    if (m == 0) {
00065       goto L40;
00066    }
00067    i__2 = m;
00068    for (i__ = 1; i__ <= i__2; ++i__) {
00069       dx[i__] = da * dx[i__];
00070       /* L30: */
00071    }
00072    if (n < 5) {
00073       return 0;
00074    }
00075 L40:
00076       mp1 = m + 1;
00077    i__2 = n;
00078    for (i__ = mp1; i__ <= i__2; i__ += 5) {
00079       dx[i__] = da * dx[i__];
00080       dx[i__ + 1] = da * dx[i__ + 1];
00081       dx[i__ + 2] = da * dx[i__ + 2];
00082       dx[i__ + 3] = da * dx[i__ + 3];
00083       dx[i__ + 4] = da * dx[i__ + 4];
00084       /* L50: */
00085    }
00086    return 0;
00087 } /* dscal_ */
00088 
00089    }  // namespace Minuit2
00090 
00091 }  // namespace ROOT

Generated on Tue Jul 5 14:37:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1