-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmncalf.F
44 lines (43 loc) · 1.15 KB
/
mncalf.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
*
* $Id: mncalf.F,v 1.1.1.1 2000/06/08 11:19:19 andras Exp $
*
* $Log: mncalf.F,v $
* Revision 1.1.1.1 2000/06/08 11:19:19 andras
* import of MINUIT from CERNlib 2000
*
* Revision 1.1.1.1 1996/03/07 14:31:28 mclareni
* Minuit
*
*
#include "minuit/pilot.h"
SUBROUTINE MNCALF(FCN,PVEC,YCALF,FUTIL)
#include "minuit/d506dp.inc"
CC Called only from MNIMPR. Transforms the function FCN
CC by dividing out the quadratic part in order to find further
CC minima. Calculates ycalf = (f-fmin)/(x-xmin)*v*(x-xmin)
CC
#include "minuit/d506cm.inc"
EXTERNAL FCN,FUTIL
DIMENSION PVEC(15)
NPARX = NPAR
CALL MNINEX(PVEC)
CALL FCN(NPARX,GIN,F,U,4,FUTIL)
NFCN = NFCN + 1
DO 200 I= 1, NPAR
GRD(I) = 0.
DO 200 J= 1, NPAR
M = MAX(I,J)
N = MIN(I,J)
NDEX = M*(M-1)/2 + N
200 GRD(I) = GRD(I) + VTHMAT(NDEX) * (XT(J)-PVEC(J))
DENOM = 0.
DO 210 I= 1, NPAR
210 DENOM = DENOM + GRD(I) * (XT(I)-PVEC(I))
IF (DENOM .LE. ZERO) THEN
DCOVAR = 1.
ISW(2) = 0
DENOM = 1.0
ENDIF
YCALF = (F-APSI) / DENOM
RETURN
END