Package: pdl / 1:2.019-5

minuit_default_integer_8.patch Patch series | download
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
Description: Use 64bit integers in Minuit module.
 For the time being, always use 64bit integers in Fortran libs
 slatec and minuit by default, as Debian perl packages switched
 to ivsize=8 on all arches, implying a 64bit index type in PDL.
Author: Henning Glawe <glaweh@debian.org>
Forwarded: https://sourceforge.net/p/pdl/patches/84/

--- a/Lib/Minuit/FCN.c
+++ b/Lib/Minuit/FCN.c
@@ -35,15 +35,15 @@
 #endif 
 
 static SV* mnfunname;
-static int ene;
+static long long ene;
 
-void FCN(int* npar,double* grad,double* fval,double* xval,int* iflag,double* futil);
+void FCN(long long* npar,double* grad,double* fval,double* xval,long long* iflag,double* futil);
 
-void FCN(int* npar,double* grad,double* fval,double* xval,int* iflag,double* futil){
+void FCN(long long* npar,double* grad,double* fval,double* xval,long long* iflag,double* futil){
 
   SV* funname;
 
-  int count,i;
+  long long count,i;
   double* x;
 
   I32 ax ; 
@@ -54,7 +54,7 @@ void FCN(int* npar,double* grad,double*
   pdl* pxval;
   SV* pxvalsv;
   
-  int ndims;
+  long long ndims;
   PDL_Indx *pdims;
 
   dSP;
--- a/Lib/Minuit/minuit.pd
+++ b/Lib/Minuit/minuit.pd
@@ -6,18 +6,18 @@ pp_addhdr('
 #include<string.h>
 #include "FCN.c"
 
-extern void MNINIT(int*,int*,int*);
-extern void MNSETI(char*,int);
-extern void MNPARM(int*,char*,double*,double*,double*,double*,int*,int);
-extern void MNEXCM(void* f,char*,double*,int*,int*,double* futil,int);
-extern void MNPOUT(int*,char*,double*,double*,double*,double*,int*,int);
-extern void MNSTAT(double*,double*,double*,int*,int*,int*);
-extern void MNEMAT(double*,int*); /* Matrix here! */
-extern void MNERRS(int*,double*,double*,double*,double*);
-extern void MNCONT(void* f,int*,int*,int*,double*,double*,int*,double* futil);
+extern void MNINIT(long long*,long long*,long long*);
+extern void MNSETI(char*,long);
+extern void MNPARM(long long*,char*,double*,double*,double*,double*,long long*,long);
+extern void MNEXCM(void* f,char*,double*,long long*,long long*,double* futil,long);
+extern void MNPOUT(long long*,char*,double*,double*,double*,double*,long long*,long);
+extern void MNSTAT(double*,double*,double*,long long*,long long*,long long*);
+extern void MNEMAT(double*,long long*); /* Matrix here! */
+extern void MNERRS(long long*,double*,double*,double*,double*);
+extern void MNCONT(void* f,long long*,long long*,long long*,double*,double*,long long*,double* futil);
 
-extern void ABRE(int*,char*,char*,int,int);
-extern void CIERRA(int*);
+extern void ABRE(long*,char*,char*,long,long);
+extern void CIERRA(long long*);
 ');                   
 		      # add C code to the section preceding 
 		      # the first MODULE keyword
@@ -94,7 +94,7 @@ sub mn_init{
 ');
 
 pp_def('mninit',
-        Pars => 'int a();int b(); int c();',
+        Pars => 'longlong a();longlong b(); longlong c();',
         Code => 'MNINIT($P(a),$P(b),$P(c));
       ');
 pp_addxs('','
@@ -102,7 +102,7 @@ void
 mnseti(str)
 	char* str;
 	CODE:
-	 int largo;
+	 long largo;
 	 largo = strlen(str);
 	 MNSETI(str,largo);
 ');
@@ -115,14 +115,14 @@ mnseti(str)
 #       ');  
 
 pp_def('mn_abre',
-        Pars => 'int l();',
+        Pars => 'longlong l();',
         OtherPars => 'char* nombre; char* mode;',
         Code => '
-         int l1,l2; l1 = strlen($COMP(nombre)); l2 = strlen($COMP(mode));
+         long l1,l2; l1 = strlen($COMP(nombre)); l2 = strlen($COMP(mode));
          ABRE($P(l),$COMP(nombre),$COMP(mode),l1,l2);
 ');
 pp_def('mn_cierra',
-        Pars => 'int l();',
+        Pars => 'longlong l();',
         Code => 'CIERRA($P(l));'
 );
 
@@ -176,9 +176,9 @@ sub mn_def_pars{
 ');
 
 pp_def('mnparm',
-       Pars => 'int a(); double b(); double c(); double d(); double e(); int [o] ia()',
+       Pars => 'longlong a(); double b(); double c(); double d(); double e(); longlong [o] ia()',
        OtherPars => "char* str",
-       Code => ' int largo; largo=strlen($COMP(str));
+       Code => ' long largo; largo=strlen($COMP(str));
                  MNPARM($P(a),$COMP(str),$P(b),$P(c),$P(d),$P(e),$P(ia),largo);
        ');
 
@@ -214,10 +214,10 @@ sub mn_excm{
 ');
 
 pp_def('mnexcm',
-	Pars =>'double a(n); int ia(); int [o] ib();',
-	OtherPars => 'char* str; SV* function; int numelem;',
+	Pars =>'double a(n); longlong ia(); longlong [o] ib();',
+	OtherPars => 'char* str; SV* function; IV numelem;',
 	Code => 'double zero;
-        int largo; largo=strlen($COMP(str));
+        long largo; largo=strlen($COMP(str));
         ene = $COMP(numelem);
 	zero = 0.0;
 	mnfunname = $COMP(function);
@@ -252,7 +252,7 @@ pp_addpm('
 ');
 
 pp_def('mnpout',
-	Pars => 'int ia(); double [o] a(); double [o] b(); double [o] c(); double [o] d();int [o] ib();',
+	Pars => 'longlong ia(); double [o] a(); double [o] b(); double [o] c(); double [o] d();longlong [o] ib();',
 	OtherPars => 'SV* str;',
 	Code => 'STRLEN largo; SV* tempo; char* uuu;
 	tempo = SvRV($COMP(str));
@@ -278,7 +278,7 @@ pp_addpm('
   }
 ');
 pp_def('mnstat',
-        Pars => 'double [o] a(); double [o] b(); double [o] c(); int [o] ia(); int [o] ib(); int [o] ic();',
+        Pars => 'double [o] a(); double [o] b(); double [o] c(); longlong [o] ia(); longlong [o] ib(); longlong [o] ic();',
         Code => 'MNSTAT($P(a),$P(b),$P(c),$P(ia),$P(ib),$P(ic));
        ');
 
@@ -306,7 +306,7 @@ pp_addpm('
 ');
 pp_def('mnemat',
         Pars => 'double [o] mat(n,n);',
-        Code => 'int numrows; numrows = $SIZE(n);
+        Code => 'long long numrows; numrows = $SIZE(n);
         MNEMAT($P(mat),&numrows);
        ');
 
@@ -334,7 +334,7 @@ pp_addpm('
   }
 ');
 pp_def('mnerrs',
-	Pars => 'int ia(); double [o] a(); double [o] b(); double [o] c(); double [o] d();',
+	Pars => 'longlong ia(); double [o] a(); double [o] b(); double [o] c(); double [o] d();',
         Code => 'MNERRS($P(ia),$P(a),$P(b),$P(c),$P(d));
        ');
 
@@ -368,8 +368,8 @@ pp_addpm('
 ');
 
 pp_def('mncont',
-        Pars => 'int ia(); int ib(); int ic(); double [o] a(n); double [o] b(n); int [o] id();',
-        OtherPars => 'SV* function; int numelem;',
+        Pars => 'longlong ia(); longlong ib(); longlong ic(); double [o] a(n); double [o] b(n); longlong [o] id();',
+        OtherPars => 'SV* function; IV numelem;',
         Code => ' double zero;
 	zero = 0.0; 
         mnfunname = $COMP(function);