1 // generated by scripts/build-jcm800-preamp.py
2 // DO NOT MODIFY!
3 #include <iostream>
4 #include <cmath>
5 
6 #include <float.h>
7 #include <Eigen/Core>
8 
9 #include "gx_compiler.h"
10 #include "gx_plugin.h"
11 
12 using namespace Eigen;
13 
14 #define N_(x) (x)
15 
16 #define creal double
17 
sign(creal v)18 static inline int sign(creal v) {
19     return v < 0 ? -1 : 1;
20 }
21 
Heaviside(creal v)22 static inline int Heaviside(creal v) {
23     return v < 0 ? 0 : 1;  // Heaviside(0) == 1/2 in sympy but shouldn't matter
24 }
25 
26 static Matrix<creal, 7, 1> g_x;
27 creal g_v_data[8];
28 static Map<Matrix<creal, 8, 1> >g_v(g_v_data);
29 static int g_info;
30 static int g_nfev;
31 
32 
33 static creal x0_data[] = {-101.11169547,-4.28127308,-514.34759921,-230.31382521,-1133.65846006,-4.20085902,-20.3466745};
34 
35 #define real realtype  // real conflicts with Eigen::real of new eigen library version
36 typedef double real;
37 #ifndef _INTPP_H
38 #define _INTPP_H 1
39 
40 #ifndef NO_INTPP_INCLUDES
41 typedef double real;
42 typedef double treal;
43 //typedef float real;
44 //typedef float treal;
45 #endif
46 
47 template<typename M>
48 struct splinecoeffs {
49     real *x0;
50     real *xe;
51     real *stepi; // 1/h
52     int *k;
53     int *n;
54     int *nmap;
55     M **map;
56     treal **t;
57     treal **c;
58     int (*eval)(splinecoeffs *p, real *x, real *res);
59 };
60 
61 template<typename M>
62 struct splinedata {
63     splinecoeffs<M> *sc;
64     int m;
65     int n_input;
66     int n_output;
67     int n_state;
68     const char *func_id;
69     template<int K0> static int splev(splinecoeffs<M> *p, real *x, real *res);
70     template<int K0> static int splev_pp(splinecoeffs<M> *p, real *x, real *res);
71     template<int K0, int K1> static int splev(splinecoeffs<M> *p, real *x, real *res);
72     template<int K0, int K1> static int splevgr(splinecoeffs<M> *p, real xi[2], real res[1], real grad[2]);
73     template<int K0, int K1, int K2> static int splev(splinecoeffs<M> *p, real *x, real *res);
74     template<int K0, int K1, int K2, int K3> static int splev(splinecoeffs<M> *p, real *x, real *res);
75     union retval {
76 	char c[4];
77 	int i;
78     };
79 };
80 
81 template<typename M>
82 class SplineCalc {
83   protected:
84     splinedata<M> *sd;
85     real *s0;
86     real *temp;
87   public:
88     SplineCalc(splinedata<M> *sd_, real *s0_);
89     ~SplineCalc();
90     void reset();
91     void calc(real *in, real *out);
92 };
93 
94 //#define CHECK_BOUNDS
95 
96 #ifdef CHECK_BOUNDS
97 template<typename M>
98 void report(splinedata<M> *sd, real *t, int i);
99 template<typename M>
check(splinedata<M> * sd,creal * t,int i)100 static inline void check(splinedata<M> *sd, creal *t, int i) { if (i) report(sd, t, i); }
101 #else
102 #define check(sd, t, i) i
103 #endif
104 
105 #endif /* !_INTPP_H */
106 
107 #define NO_INTPP_INCLUDES
108 #include <cstdio>
109 #include <cstdlib>
110 
111 #ifndef NO_INTPP_INCLUDES
112 #include "intpp.h"
113 #include "intpp_inst.cc"
114 #endif
115 
116 #define always_inline inline __attribute__((always_inline))
117 
118 /****************************************************************
119  ** fpbspl evaluates the k non-zero b-splines of order k
120  ** at t[0] <= x < t[1] using the stable recurrence relation
121  ** of de boor and cox.
122  **
123  ** t: knot array
124  ** K: order (> 0)
125  ** h[K]: output array
126  */
fpbspl(treal * t,real x,real * h)127 template<int K> static always_inline void fpbspl(treal *t, real x, real *h)
128 {
129     real hh[K-1];
130     h[0] = 1;
131     for (int j = 0; j < K-1; j++) {
132 	for (int i = 0; i <= j; i++) {
133 	    hh[i] = h[i];
134 	}
135 	h[0] = 0;
136 	for (int i = 0; i <= j; i++) {
137 	    int li = i+1;
138 	    int lj = i-j;
139 	    real f = hh[i]/(t[li]-t[lj]);
140 	    h[i] = h[i]+f*(t[li]-x);
141 	    h[i+1] = f*(x-t[lj]);
142 	}
143     }
144 }
145 
fpbspl(treal * t,real x,real * h)146 template<> always_inline void fpbspl<2>(treal *t, real x, real *h)
147 {
148     h[0] = (t[1]-x)/(t[1]-t[0]);
149     h[1] = 1-h[0];
150 }
151 
152 
153 /****************************************************************
154  ** search for knot interval
155  ** n: len(map)
156  ** k: order
157  ** returns index l: t[l] <= x < t[l+1]
158  */
find_index(int n,int k,real xi,real x0,real xe,real stepi,char * cl)159 static always_inline int find_index(int n, int k, real xi, real x0, real xe, real stepi, char* cl)
160 {
161     int l;
162     if (k % 2) {
163 	l = static_cast<int>((xi - x0) * stepi + 0.5);
164     } else {
165 	l = static_cast<int>((xi - x0) * stepi);
166     }
167     if (l < 0) {
168 	*cl = -1;
169 	return 0;
170     }
171     if (l > n-2) {
172 	*cl = 1;
173 	return n-2;
174     }
175     return l;
176 }
177 
178 template<int K, typename M>
forward(int i,splinecoeffs<M> * p,real * xi,int ll,typename splinedata<M>::retval * cl,real * h)179 static always_inline int forward(int i, splinecoeffs<M> *p, real *xi, int ll,
180 			  typename splinedata<M>::retval *cl, real *h)
181 {
182     int l = p->map[i][find_index(p->nmap[i], K, xi[i], p->x0[i], p->xe[i], p->stepi[i], &cl->c[i])];
183     fpbspl<K>(p->t[i]+l, xi[i], h);
184     return ll*p->n[i] + l-K+1;
185 }
186 
187 /****************************************************************
188  ** evaluate the spline function at x
189  **
190  ** t[n+k]: knot array
191  ** c[m][n]: coefficents
192  ** k: order (k > 0), order = degree + 1
193  ** x: function argument
194  ** res: output array (size m)
195  */
196 template<>
197 template<int K0>
splev(splinecoeffs<unsigned short> * p,real xi[1],real * res)198 always_inline int splinedata<unsigned short>::splev(splinecoeffs<unsigned short> *p, real xi[1], real *res)
199 {
200     real h[K0];
201     retval cl;
202     cl.i = 0;
203     int ll = 0;
204     ll = forward<K0>(0, p, xi, ll, &cl, h);
205     treal *c = p->c[0]+ll;
206     real sp = 0;
207     for (int j = 0; j < K0; j++) {
208 	sp += c[j]*h[j];
209     }
210     *res = sp;
211     return cl.i;
212 }
213 
214 template<>
215 template<int K0>
splev(splinecoeffs<unsigned char> * p,real xi[1],real * res)216 always_inline int splinedata<unsigned char>::splev(splinecoeffs<unsigned char> *p, real xi[1], real *res)
217 {
218     real h[K0];
219     retval cl;
220     cl.i = 0;
221     int ll = 0;
222     ll = forward<K0>(0, p, xi, ll, &cl, h);
223     treal *c = p->c[0]+ll;
224     real sp = 0;
225     for (int j = 0; j < K0; j++) {
226 	sp += c[j]*h[j];
227     }
228     *res = sp;
229     return cl.i;
230 }
231 
232 template<>
233 template<>
splev_pp(splinecoeffs<unsigned short> * p,real xi[1],real * res)234 always_inline int splinedata<unsigned short>::splev_pp<4>(splinecoeffs<unsigned short> *p, real xi[1], real *res)
235 {
236     retval cl;
237     cl.i = 0;
238     int l = p->map[0][find_index(p->nmap[0], 4, xi[0], p->x0[0], p->xe[0], p->stepi[0], &cl.c[0])];
239     treal x = xi[0] - p->t[0][l];
240     treal *c = p->c[0] + (l-3)*4;
241     *res = ((c[0] * x + c[1]) * x + c[2]) * x + c[3];
242     return cl.i;
243 }
244 
245 template<>
246 template<>
splev_pp(splinecoeffs<unsigned char> * p,real xi[1],real * res)247 always_inline int splinedata<unsigned char>::splev_pp<4>(splinecoeffs<unsigned char> *p, real xi[1], real *res)
248 {
249     retval cl;
250     cl.i = 0;
251     int l = p->map[0][find_index(p->nmap[0], 4, xi[0], p->x0[0], p->xe[0], p->stepi[0], &cl.c[0])];
252     treal x = xi[0] - p->t[0][l];
253     treal *c = p->c[0] + (l-3)*4;
254     *res = ((c[0] * x + c[1]) * x + c[2]) * x + c[3];
255     return cl.i;
256 }
257 
258 template<>
259 template<>
splev_pp(splinecoeffs<unsigned short> * p,real xi[1],real * res)260 always_inline int splinedata<unsigned short>::splev_pp<2>(splinecoeffs<unsigned short> *p, real xi[1], real *res)
261 {
262     retval cl;
263     cl.i = 0;
264     int l = p->map[0][find_index(p->nmap[0], 2, xi[0], p->x0[0], p->xe[0], p->stepi[0], &cl.c[0])];
265     treal x = xi[0] - p->t[0][l];
266     treal *c = p->c[0] + (l-1)*2;
267     *res = c[0] * x + c[1];
268     return cl.i;
269 }
270 
271 template<>
272 template<>
splev_pp(splinecoeffs<unsigned char> * p,real xi[1],real * res)273 always_inline int splinedata<unsigned char>::splev_pp<2>(splinecoeffs<unsigned char> *p, real xi[1], real *res)
274 {
275     retval cl;
276     cl.i = 0;
277     int l = p->map[0][find_index(p->nmap[0], 2, xi[0], p->x0[0], p->xe[0], p->stepi[0], &cl.c[0])];
278     treal x = xi[0] - p->t[0][l];
279     treal *c = p->c[0] + (l-1)*2;
280     *res = c[0] * x + c[1];
281     return cl.i;
282 }
283 
284 /****************************************************************
285  ** evaluate the X-dim spline function
286  **
287  ** t: array of pointers to knot arrays
288  ** c[m][n[0]]...[n[X-1]]: coefficents
289  ** k: orders (2 <= k[i] <= 5), order = degree + 1
290  ** x: function arguments
291  ** res[m]: output array
292  */
293 template<typename M>
294 template<int K0, int K1>
splev(splinecoeffs<M> * p,real xi[2],real * res)295 int splinedata<M>::splev(splinecoeffs<M> *p, real xi[2], real *res)
296 {
297     real h[2][6];
298     retval cl;
299     cl.i = 0;
300     int ll = 0;
301     ll = forward<K0>(0, p, xi, ll, &cl, h[0]);
302     ll = forward<K1>(1, p, xi, ll, &cl, h[1]);
303     treal *c = p->c[0]+ll;
304     int j[2];
305     real sp = 0;
306     for (j[0] = 0; j[0] < K0; j[0]++) {
307 	for (j[1] = 0; j[1] < K1; j[1]++) {
308 	    sp += c[j[1]]*h[0][j[0]]*h[1][j[1]];
309 	}
310 	c += p->n[1];
311     }
312     *res = sp;
313     return cl.i;
314 }
315 
316 template<int K, int S>
deriv(real * t,real * wrk)317 static inline void deriv(real *t, real *wrk) {
318     for (int i = 0; i < K-1; i++, wrk += S) {
319 	real fac = t[i+1] - t[i+1-(K-1)];
320 	if (fac > 0) {
321 	    wrk[0] = (K-1) * (wrk[S] - wrk[0]) / fac;
322 	}
323     }
324 }
325 
326 template<int K0, int K1, int S0, int S1>
deriv2d(real * t,real * c)327 static inline void deriv2d(real *t, real *c) {
328     for (int i = 0; i < K0; i++) {
329 	deriv<K1, S1>(t, c);
330 	c += S0;
331     }
332 }
333 
334 template<int K0, int K1>
copy2d(real * c,real * wrk,int n)335 static inline void copy2d(real *c, real *wrk, int n)  {
336     int j[2];
337     for (j[0] = 0; j[0] < K0; j[0]++) {
338 	for (j[1] = 0; j[1] < K1; j[1]++) {
339 	    *wrk++ = *c++;
340 	}
341 	c += n - K1;
342     }
343 }
344 
345 template<int K0, int K1, int S>
eval2d(real * c,real * h0,real * h1)346 static inline real eval2d(real *c, real *h0, real *h1) {
347     int j[2];
348     real sp = 0;
349     for (j[0] = 0; j[0] < K0; j[0]++) {
350 	for (j[1] = 0; j[1] < K1; j[1]++) {
351 	    sp += *c++ * h0[j[0]] * h1[j[1]];
352 	}
353 	c += S;
354     }
355     return sp;
356 }
357 
358 template<typename M>
359 template<int K0, int K1>
splevgr(splinecoeffs<M> * p,real xi[2],real res[1],real grad[2])360 int splinedata<M>::splevgr(splinecoeffs<M> *p, real xi[2], real res[1], real grad[2])
361 {
362     real h0[K0];
363     real h1[K1];
364     retval cl;
365     cl.i = 0;
366     int ll = 0;
367 //  ll = forward<K0>(0, p, xi, ll, &cl, h0);
368     int l[2];
369     l[0] = p->map[0][find_index(p->nmap[0], K0, xi[0], p->x0[0], p->xe[0], p->stepi[0], &cl.c[0])];
370     fpbspl<K0>(p->t[0]+l[0], xi[0], h0);
371     ll = l[0]-(K0-1);
372 //  ll = forward<K1>(1, p, xi, ll, &cl, h1);
373     l[1] = p->map[1][find_index(p->nmap[1], K1, xi[1], p->x0[1], p->xe[1], p->stepi[1], &cl.c[1])];
374     fpbspl<K1>(p->t[1]+l[1], xi[1], h1);
375     ll = ll*p->n[1] + l[1]-(K1-1);
376 //
377     treal wrk[K0*K1];
378     copy2d<K0, K1>(p->c[0]+ll, wrk, p->n[1]);
379     res[0] = eval2d<K0, K1, 0>(wrk, h0, h1);
380 
381     deriv2d<K1, K0, 1, K1>(p->t[0]+l[0], wrk);
382     real hx[6];
383     fpbspl<K0-1>(p->t[0]+l[0], xi[0], hx);
384     grad[0] = eval2d<K0-1, K1, 0>(wrk, hx, h1);
385 
386     copy2d<K0, K1>(p->c[0]+ll, wrk, p->n[1]);
387     deriv2d<K0, K1, K1, 1>(p->t[1]+l[1], wrk);
388     fpbspl<K1-1>(p->t[1]+l[1], xi[1], hx);
389     grad[1] = eval2d<K0, K1-1, 1>(wrk, h0, hx);
390     return cl.i;
391 }
392 
393 template<typename M>
394 template<int K0, int K1, int K2>
splev(splinecoeffs<M> * p,real xi[3],real * res)395 int splinedata<M>::splev(splinecoeffs<M> *p, real xi[3], real *res)
396 {
397     real h[3][6];
398     retval cl;
399     cl.i = 0;
400     int ll = 0;
401     ll = forward<K0>(0, p, xi, ll, &cl, h[0]);
402     ll = forward<K1>(1, p, xi, ll, &cl, h[1]);
403     ll = forward<K2>(2, p, xi, ll, &cl, h[2]);
404     treal *cc = p->c[0];
405     int lc = ll;
406     int j[3];
407     real sp = 0;
408     for (j[0] = 0; j[0] < K0; j[0]++) {
409 	for (j[1] = 0; j[1] < K1; j[1]++) {
410 	    for (j[2] = 0; j[2] < K2; j[2]++) {
411 		sp += cc[lc]*h[0][j[0]]*h[1][j[1]]*h[2][j[2]];
412 		lc += 1;
413 	    }
414 	    lc += p->n[2]-K2;
415 	}
416 	lc += (p->n[1]-K1)*p->n[2];
417     }
418     *res = sp;
419     return cl.i;
420 }
421 
422 template<typename M>
423 template<int K0, int K1, int K2, int K3>
splev(splinecoeffs<M> * p,real xi[4],real * res)424 int splinedata<M>::splev(splinecoeffs<M> *p, real xi[4], real *res)
425 {
426     real h[4][6];
427     retval cl;
428     cl.i = 0;
429     int ll = 0;
430     ll = forward<K0>(0, p, xi, ll, &cl, h[0]);
431     ll = forward<K1>(1, p, xi, ll, &cl, h[1]);
432     ll = forward<K2>(2, p, xi, ll, &cl, h[2]);
433     ll = forward<K3>(3, p, xi, ll, &cl, h[3]);
434     treal *cc = p->c[0];
435     int lc = ll;
436     int j[4];
437     real sp = 0;
438     for (j[0] = 0; j[0] < K0; j[0]++) {
439 	for (j[1] = 0; j[1] < K1; j[1]++) {
440 	    for (j[2] = 0; j[2] < K2; j[2]++) {
441 		for (j[3] = 0; j[3] < K3; j[3]++) {
442 		    sp += cc[lc]*h[0][j[0]]*h[1][j[1]]*h[2][j[2]]*h[3][j[3]];
443 		    lc += 1;
444 		}
445 		lc += p->n[3]-K3;
446 	    }
447 	    lc += (p->n[2]-K2)*p->n[3];
448 	}
449 	lc += (p->n[1]-K1)*p->n[2]*p->n[3];
450     }
451     *res = sp;
452     return cl.i;
453 }
454 
455 template<typename M>
SplineCalc(splinedata<M> * sd_,real * s0_)456 SplineCalc<M>::SplineCalc(splinedata<M> *sd_, real *s0_)
457     : sd(sd_),
458       s0(s0_),
459       temp(new real[sd->n_input+sd->n_state]) {
460 }
461 
462 template<typename M>
~SplineCalc()463 SplineCalc<M>::~SplineCalc() {
464     delete[] temp;
465 }
466 
467 #ifdef CHECK_BOUNDS
report(splinedata * sd,real * t,int i)468 void report(splinedata *sd, real *t, int i)
469 {
470     printf("%s:", sd->func_id);
471     splinedata::retval cl;
472     cl.i = i;
473     for (int n = 0; n < 4; n++) {
474 	if (cl.c[n] < 0) {
475 	    printf(" %d:L[%g]", n, t[n]);
476 	} else if (cl.c[n] > 0) {
477 	    printf(" %d:U[%g]", n, t[n]);
478 	}
479     }
480     printf("\n");
481 }
482 #endif
483 
484 template<typename M>
calc(real * in,real * out)485 void SplineCalc<M>::calc(real *in, real *out)
486 {
487     for (int i = 0; i < sd->n_input; i++) {
488 	temp[i] = in[i];
489     }
490     real t[sd->m];
491     for (int i = 0; i < sd->m; i++) {
492 	splinecoeffs<M> *p = &sd->sc[i];
493 	check(sd, temp, (*p->eval)(p, temp, &t[i]));
494     }
495     for (int i = 0; i < sd->n_output; i++) {
496 	out[i] = t[i];
497     }
498     for (int i = 0; i < sd->n_state; i++) {
499 	temp[i+sd->n_input] = t[i+sd->n_output];
500     }
501 }
502 
503 template<typename M>
reset()504 void SplineCalc<M>::reset()
505 {
506     for (int i = 0; i < sd->n_state; i++) {
507 	temp[i+sd->n_input] = s0[i];
508     }
509 }
510 
511 template int splinedata<unsigned char>::splev_pp<4>(splinecoeffs<unsigned char> *p, real xi[2], real *res);
512 
513 #ifndef NO_INTPP_INCLUDES
514 #include "intpp.h"
515 #endif
516 namespace AmpData {
517 namespace nonlin_0 {
518 typedef unsigned char maptype;
519 real x0_0[1] = {-119.508269216};
520 real xe_0[1] = {148.877449521};
521 real hi_0[1] = {1.31899715702};
522 int k_0[1] = {4};
523 int nmap_0[1] = {355};
524 int n_0[1] = {39};
525 treal t0_0[43] = {
526   -215.79354119211405,-215.79354119211405,-215.79354119211405,-215.79354119211405,-118.75011746798432,-70.22840560591945,-58.09797764040323,-56.5816741447137,-55.82352239686894,-55.065370649024175,
527   -54.30721890117941,-53.54906715333465,-52.03276365764512,-49.000156666266065,-45.96754967488702,-39.902335692128915,-33.837121709370805,-21.706693743854586,-9.57626577833837,-3.5110517955802605,
528   -1.9947482998907333,-0.47844480420120616,2.554162187177848,8.619376169935958,14.684590152694065,20.749804135452173,26.815018118210283,29.847625109589334,32.880232100968385,35.91283909234744,
529   38.945446083726495,45.010660066484604,51.075874049242714,63.20630201475893,75.33672998027515,87.46715794579137,99.59758591130759,123.85844184234001,148.11929777337244,172.38015370440488,
530   172.38015370440488,172.38015370440488,172.38015370440488};
531 maptype a0_0[354] = {
532   3,4,4,4,4,4,4,4,4,4,
533   4,4,4,4,4,4,4,4,4,4,
534   4,4,4,4,4,4,4,4,4,4,
535   4,4,4,4,4,4,4,4,4,4,
536   4,4,4,4,4,4,4,4,4,4,
537   4,4,4,4,4,4,4,4,4,4,
538   4,4,4,4,4,5,5,5,5,5,
539   5,5,5,5,5,5,5,5,5,5,
540   5,6,6,7,8,9,10,11,11,12,
541   12,12,12,13,13,13,13,14,14,14,
542   14,14,14,14,14,15,15,15,15,15,
543   15,15,15,16,16,16,16,16,16,16,
544   16,16,16,16,16,16,16,16,16,17,
545   17,17,17,17,17,17,17,17,17,17,
546   17,17,17,17,17,18,18,18,18,18,
547   18,18,18,19,19,20,20,21,21,21,
548   21,22,22,22,22,22,22,22,22,23,
549   23,23,23,23,23,23,23,24,24,24,
550   24,24,24,24,24,25,25,25,25,25,
551   25,25,25,26,26,26,26,27,27,27,
552   27,28,28,28,28,29,29,29,29,30,
553   30,30,30,30,30,30,30,31,31,31,
554   31,31,31,31,31,32,32,32,32,32,
555   32,32,32,32,32,32,32,32,32,32,
556   32,33,33,33,33,33,33,33,33,33,
557   33,33,33,33,33,33,33,34,34,34,
558   34,34,34,34,34,34,34,34,34,34,
559   34,34,34,35,35,35,35,35,35,35,
560   35,35,35,35,35,35,35,35,35,36,
561   36,36,36,36,36,36,36,36,36,36,
562   36,36,36,36,36,36,36,36,36,36,
563   36,36,36,36,36,36,36,36,36,36,
564   36,37,37,37,37,37,37,37,37,37,
565   37,37,37,37,37,37,37,37,37,37,
566   37,37,37,37,37,37,37,37,37,37,
567   37,37,37,38};
568 treal c0_0[144] = {
569   -1.6873137730947968e-08,2.283373705907306e-06,-7.08366044887381e-05,0.00016094985081404104,1.0773629819818119e-07,-2.6289074572326475e-06,-0.00010436838272959129,-0.0006301219261502878,-4.3813060254044074e-06,1.3053741397540291e-05,
570   0.00040146240593189064,0.0004238755997537633,0.006950938857027557,-0.00014638761001061073,-0.001215934482642564,-0.0006058448954747285,0.03812445957054991,0.03147281105169455,0.04628443088943314,0.02144656244395482,
571   -0.014607563382236495,0.11818518802884288,0.15974790447129264,0.09124148997352426,-0.015591328547518634,0.08496093889885559,0.3137634956694214,0.27392108803937953,-0.009927806034353953,0.049499159930285946,
572   0.41570465461211475,0.5538420679993398,-0.003613308257829718,0.026918809438658223,0.4736410716559274,0.8931347516741054,-0.0007786511779558718,0.010482193611605111,0.5303523433233364,1.660612560301017,
573   -0.0001771877081884625,0.0033981645932615705,0.5724460146582606,3.3436478532585276,-5.90972253293622e-05,0.0017861425453452849,0.5881679807322562,5.105961793530823,-2.0878100771578455e-05,0.0007108305931157232,
574   0.6033126571262213,8.725847190649315,1.6272671169467374e-06,0.0003309401469160916,0.6096312195854904,12.406558431601251,-3.0490891639089684e-05,0.00039015848654441857,0.6183784546147153,19.85324757556291,
575   0.0002813674649289688,-0.0007194442073525958,0.6143840778983787,27.357428628715304,0.0022374857272430527,0.004400217440388554,0.6367087551787501,31.120112155359543,-0.002443033099687247,0.01457833972971075,
576   0.6654860077589153,32.103473174672544,-7.445119777083006e-05,0.003465200842287768,0.6928454914028523,33.1375530858228,-7.304069647906582e-05,0.0027878571736586763,0.7118085588595104,35.26847315413927,
577   -9.203191801796418e-06,0.0014588348128730133,0.7375656544766893,39.672003944499636,9.846820433221443e-06,0.001291376830066232,0.7542462765889886,44.19710994426894,5.541887360394889e-05,0.0014705460489980809,
578   0.770997929854389,48.821477677302184,7.87978917166114e-05,0.0024789280302722062,0.7949523352645198,53.56420687160392,3.6233408602374344e-05,0.0031958171422493816,0.8121616071490032,55.9999805241572,
579   -2.454176271533914e-05,0.0035254622069965445,0.8325446058945382,58.493349029632526,-6.88566870740012e-05,0.0033021856434226346,0.8532501785003934,61.04986778901328,-6.210649668334695e-05,0.002675739831551187,
580   0.871378877089742,63.66588906101117,-3.604600421055791e-05,0.001545672255239319,0.8969826447055279,69.03556317416984,-1.3518555506066317e-05,0.0008897920689580184,0.9117542569791581,74.52477263891492,
581   -4.171710256724323e-06,0.000397834477665508,0.9273737180494612,85.69154238626115,-2.214325453001808e-06,0.0002460205853789093,0.9351839555119544,96.99207639859175,-1.225126751269013e-06,0.0001654384391793668,
582   0.9401751295701202,108.36850678476425,-6.209590726258885e-07,0.00012085450376467978,0.9436479854915386,119.79539048410334,-2.850430075249797e-07,7.565950796454724e-05,0.9484155836185306,142.7513648625841,
583   -1.8920535850098484e-07,5.4913345945412075e-05,0.9515833928157438,165.80120074168525};
584 maptype *map_0[1] = {a0_0};
585 treal *t_0[1] = {t0_0};
586 treal *c_0[1] = {c0_0};
587 real x0_1[2] = {-119.508269216};
588 real xe_1[2] = {124.61659359};
589 real hi_1[2] = {1.31899715702};
590 int k_1[2] = {4};
591 int nmap_1[2] = {323};
592 int n_1[2] = {48};
593 treal t0_1[52] = {
594   -215.79354119211405,-215.79354119211405,-215.79354119211405,-215.79354119211405,-118.75011746798432,-70.22840560591945,-58.09797764040323,-56.5816741447137,-55.82352239686894,-55.065370649024175,
595   -54.30721890117941,-53.54906715333465,-52.03276365764512,-49.000156666266065,-45.96754967488702,-39.902335692128915,-33.837121709370805,-21.706693743854586,-9.57626577833837,-3.5110517955802605,
596   -2.752900047735497,-1.9947482998907333,-0.47844480420120616,2.554162187177848,5.586769178556903,8.619376169935958,11.651983161315012,14.684590152694065,17.71719714407312,20.749804135452173,
597   23.782411126831228,26.815018118210283,29.847625109589334,31.363928605278858,32.880232100968385,34.39653559665791,35.91283909234744,38.945446083726495,41.97805307510555,45.010660066484604,
598   48.04326705786366,51.075874049242714,57.14108803200082,63.20630201475893,75.33672998027515,87.46715794579137,99.59758591130759,123.85844184234001,172.38015370440488,172.38015370440488,
599   172.38015370440488,172.38015370440488};
600 maptype a0_1[322] = {
601   3,4,4,4,4,4,4,4,4,4,
602   4,4,4,4,4,4,4,4,4,4,
603   4,4,4,4,4,4,4,4,4,4,
604   4,4,4,4,4,4,4,4,4,4,
605   4,4,4,4,4,4,4,4,4,4,
606   4,4,4,4,4,4,4,4,4,4,
607   4,4,4,4,4,5,5,5,5,5,
608   5,5,5,5,5,5,5,5,5,5,
609   5,6,6,7,8,9,10,11,11,12,
610   12,12,12,13,13,13,13,14,14,14,
611   14,14,14,14,14,15,15,15,15,15,
612   15,15,15,16,16,16,16,16,16,16,
613   16,16,16,16,16,16,16,16,16,17,
614   17,17,17,17,17,17,17,17,17,17,
615   17,17,17,17,17,18,18,18,18,18,
616   18,18,18,19,20,21,21,22,22,22,
617   22,23,23,23,23,24,24,24,24,25,
618   25,25,25,26,26,26,26,27,27,27,
619   27,28,28,28,28,29,29,29,29,30,
620   30,30,30,31,31,31,31,32,32,33,
621   33,34,34,35,35,36,36,36,36,37,
622   37,37,37,38,38,38,38,39,39,39,
623   39,40,40,40,40,41,41,41,41,41,
624   41,41,41,42,42,42,42,42,42,42,
625   42,43,43,43,43,43,43,43,43,43,
626   43,43,43,43,43,43,43,44,44,44,
627   44,44,44,44,44,44,44,44,44,44,
628   44,44,44,45,45,45,45,45,45,45,
629   45,45,45,45,45,45,45,45,45,46,
630   46,46,46,46,46,46,46,46,46,46,
631   46,46,46,46,46,46,46,46,46,46,
632   46,46,46,46,46,46,46,46,46,46,
633   46,47};
634 treal c0_1[180] = {
635   1.0848462380964293e-07,-1.468078678975303e-05,0.0004554388467900852,-0.0010348154739325075,-6.926827699175401e-07,1.6902371157982944e-05,0.0006710289999751239,0.004051323541752485,2.816929130984947e-05,-8.392809016328463e-05,
636   -0.0025811736249478504,-0.0027252776403900265,-0.0446905647929792,0.0009411885870580284,0.00781776308031648,0.003895235708224949,-0.2451185155078063,-0.202352190272743,-0.2975824428460169,-0.1378891432531651,
637   0.09391838287499231,-0.7598632831568145,-1.0270877858299128,-0.5866306558994957,0.10024296672209858,-0.5462501247625271,-2.0173199489274425,-1.7611561080801312,0.0638315030566027,-0.31825198347401656,
638   -2.672743733302461,-3.5608880938752137,0.023229400313225696,-0.17307008664425141,-3.0452404195173335,-5.742346215974677,0.00500927083550711,-0.06740162395110483,-3.4098685149075125,-10.676790074493017,
639   0.0011289600690984286,-0.02182817467869464,-3.6804674260715875,-21.497745510124755,0.0003955061366950978,-0.01155709808308764,-3.781711837658065,-32.828417357041296,8.065543929835555e-05,-0.004360610031438406,
640   -3.8782561434877505,-56.102212462956054,7.077390934567486e-05,-0.0028930325367847536,-3.9222510378184667,-79.76708299563707,-8.396783874579635e-05,-0.00031747910931770134,-3.9611959180739635,-127.64503998619958,
641   0.0010273344018808912,-0.0033731765672955936,-4.005965150904645,-175.8926371084096,0.12607956503023027,0.015319832370473666,-3.933506127080011,-200.0845426084335,-0.10427536142116145,0.30208216015600353,
642   -3.6928672516766516,-203.00298830956112,-0.0022972441895976986,0.06491251760020961,-3.414629595286053,-205.6745482707608,-0.0029323318617046723,0.05446255941479127,-3.2336207487100004,-210.7109265064872,
643   -0.0006268694165330165,0.02778472910024383,-2.984197046537335,-220.09813400834423,-0.00047699613857886777,0.022081583374464628,-2.8329721186922416,-228.90998625697446,-0.0001790534620116404,0.017741957900319367,
644   -2.712202969000859,-237.31150291731925,-2.904731792126768e-05,0.016112961558137993,-2.6095343035585663,-245.3783748469969,0.0001587550867705028,0.015848694259911453,-2.512607162668699,-253.1446907929159,
645   0.0004013802026051694,0.0172930196180831,-2.4121013694560083,-260.6142573945086,0.000731603729069995,0.020944704843947833,-2.296141378918027,-267.7589795778188,0.001100295647572758,0.027600704595037797,
646   -2.1489222308540006,-274.5092472790924,0.0011320046972310152,0.03761099741527707,-1.9511607674177924,-280.74156108060157,0.000699100446660465,0.04790977349256718,-1.6918098796545378,-286.2811960086408,
647   0.0002823183542081732,0.05108991884589529,-1.5416963000895396,-288.7339029896136,-0.000268385091836766,0.05237415976804479,-1.3848133560089262,-290.95313351651595,-0.000667354611794246,0.05115330000921566,
648   -1.2278343068488093,-292.9334490799787,-0.0010856376846818574,0.048117563617031234,-1.0773095493122127,-294.679934641371,-0.0011223717443227808,0.03824062631901892,-0.8154190987493068,-297.53474649344264,
649   -0.0008682804034554786,0.02802948912274021,-0.614447883341131,-299.6872073270599,-0.0006109637917904033,0.02013002945675068,-0.46839899059551743,-301.3170236603891,-0.0004477728214474514,0.014571590257361577,
650   -0.36316261603832334,-302.56940354366094,-0.0002492843938587625,0.010497833290748378,-0.2871369069164824,-303.5492107932738,-0.000128473559440053,0.005961943716801739,-0.18730483725720898,-304.96019598427785,
651   -5.509644364222013e-05,0.0036242848294101957,-0.1291623098368094,-305.9055839607225,-1.903179046664134e-05,0.0016192545071359696,-0.06555593363048545,-307.03741931311396,-1.0521608343926757e-05,0.0009266632172047965,
652   -0.03467286206923881,-307.6283429185529,-4.137357935808846e-06,0.0005437683809126627,-0.016835897490056075,-307.9313642448178,-1.3662724279523318e-06,0.00024264084646534635,0.00224306347819632,-308.07884150099943,
653 };
654 maptype *map_1[2] = {a0_1};
655 treal *t_1[2] = {t0_1};
656 treal *c_1[1] = {c0_1};
657 splinecoeffs<maptype> sc[2] = {
658 	{x0_0, xe_0, hi_0, k_0, n_0, nmap_0, map_0, t_0, c_0, splinedata<unsigned char>::splev_pp<4>},
659 	{x0_1, xe_1, hi_1, k_1, n_1, nmap_1, map_1, t_1, c_1, splinedata<unsigned char>::splev_pp<4>},
660 };
661 splinedata<maptype> sd = {
662 	sc,
663 	2, /* number of calculated values */
664 	2, /* number of input values */
665 	2, /* number of output values */
666 	0, /* number of state values */
667 	"nonlin_0",
668 };
669 }; /* ! namespace nonlin_0 */
670 } // namespace AmpData
671 
672 // nonlin_0: 2420 bytes
673 // data size sum: 2436 bytes
674 #ifndef NO_INTPP_INCLUDES
675 #include "intpp.h"
676 #endif
677 namespace AmpData {
678 namespace nonlin_1 {
679 typedef unsigned char maptype;
680 real x0_0[1] = {-84.3557465684};
681 real xe_0[1] = {477.417648954};
682 real hi_0[1] = {5.01625748471};
683 int k_0[1] = {4};
684 int nmap_0[1] = {2819};
685 int n_0[1] = {97};
686 treal t0_0[101] = {
687   -288.2926463625786,-288.2926463625786,-288.2926463625786,-288.2926463625786,-84.15639476023611,-58.639363309943306,-45.880847584796896,-39.5015897222237,-38.704182489402044,-38.305478872991216,
688   -37.906775256580396,-37.508071640169575,-37.30871983196416,-37.10936802375875,-36.910016215553334,-36.71066440734792,-36.51131259914251,-36.31196079093709,-36.11260898273168,-35.913257174526265,
689   -35.71390536632086,-35.514553558115445,-35.31520174991003,-35.115849941704624,-34.7171463252938,-34.31844270888297,-33.91973909247214,-33.521035476061314,-33.122331859650494,-32.72362824323967,
690   -32.324924626828846,-31.527517394007194,-30.730110161185543,-29.932702928363895,-29.135295695542244,-28.337888462720592,-27.540481229898944,-26.743073997077293,-25.148259531433993,-23.55344506579069,
691   -21.95863060014739,-20.36381613450409,-18.76900166886079,-17.17418720321749,-13.984558271930888,-10.794929340644288,-9.997522107822636,-9.598818491411812,-9.200114875000986,-8.80141125859016,
692   -8.402707642179337,-7.605300409357685,-6.8078931765360355,-6.010485943714385,-5.213078710892734,-4.415671478071085,-2.820857012427784,-1.226042546784483,0.36877191885881744,1.963586384502118,
693   3.5584008501454187,5.153215315788719,6.748029781432019,8.34284424707532,11.532473178361922,13.127287644005222,14.722102109648523,16.316916575291824,17.911731040935123,21.101359972221726,
694   24.290988903508328,27.480617834794927,30.67024676608153,33.85987569736813,37.04950462865473,40.23913355994134,43.428762491227936,49.80802035380114,56.18727821637434,62.56653607894754,
695   68.94579394152075,75.32505180409395,81.70430966666714,94.46282539181355,107.22134111695996,119.97985684210636,132.73837256725278,145.49688829239918,171.013919742692,196.5309511929848,
696   222.0479826432776,247.56501409357043,273.0820455438632,324.11610844444886,375.15017134503444,426.1842342456201,477.2182971462057,528.2523600467913,528.2523600467913,528.2523600467913,
697   528.2523600467913};
698 maptype a0_0[2818] = {
699   3,4,4,4,4,4,4,4,4,4,
700   4,4,4,4,4,4,4,4,4,4,
701   4,4,4,4,4,4,4,4,4,4,
702   4,4,4,4,4,4,4,4,4,4,
703   4,4,4,4,4,4,4,4,4,4,
704   4,4,4,4,4,4,4,4,4,4,
705   4,4,4,4,4,4,4,4,4,4,
706   4,4,4,4,4,4,4,4,4,4,
707   4,4,4,4,4,4,4,4,4,4,
708   4,4,4,4,4,4,4,4,4,4,
709   4,4,4,4,4,4,4,4,4,4,
710   4,4,4,4,4,4,4,4,4,4,
711   4,4,4,4,4,4,4,4,4,5,
712   5,5,5,5,5,5,5,5,5,5,
713   5,5,5,5,5,5,5,5,5,5,
714   5,5,5,5,5,5,5,5,5,5,
715   5,5,5,5,5,5,5,5,5,5,
716   5,5,5,5,5,5,5,5,5,5,
717   5,5,5,5,5,5,5,5,5,5,
718   5,5,5,6,6,6,6,6,6,6,
719   6,6,6,6,6,6,6,6,6,6,
720   6,6,6,6,6,6,6,6,6,6,
721   6,6,6,6,6,7,7,7,7,8,
722   8,9,9,10,10,11,12,13,14,15,
723   16,17,18,19,20,21,22,23,23,24,
724   24,25,25,26,26,27,27,28,28,29,
725   29,30,30,30,30,31,31,31,31,32,
726   32,32,32,33,33,33,33,34,34,34,
727   34,35,35,35,35,36,36,36,36,37,
728   37,37,37,37,37,37,37,38,38,38,
729   38,38,38,38,38,39,39,39,39,39,
730   39,39,39,40,40,40,40,40,40,40,
731   40,41,41,41,41,41,41,41,41,42,
732   42,42,42,42,42,42,42,43,43,43,
733   43,43,43,43,43,43,43,43,43,43,
734   43,43,43,44,44,44,44,44,44,44,
735   44,44,44,44,44,44,44,44,44,45,
736   45,45,45,46,46,47,47,48,48,49,
737   49,50,50,50,50,51,51,51,51,52,
738   52,52,52,53,53,53,53,54,54,54,
739   54,55,55,55,55,55,55,55,55,56,
740   56,56,56,56,56,56,56,57,57,57,
741   57,57,57,57,57,58,58,58,58,58,
742   58,58,58,59,59,59,59,59,59,59,
743   59,60,60,60,60,60,60,60,60,61,
744   61,61,61,61,61,61,61,62,62,62,
745   62,62,62,62,62,63,63,63,63,63,
746   63,63,63,63,63,63,63,63,63,63,
747   63,64,64,64,64,64,64,64,64,65,
748   65,65,65,65,65,65,65,66,66,66,
749   66,66,66,66,66,67,67,67,67,67,
750   67,67,67,68,68,68,68,68,68,68,
751   68,68,68,68,68,68,68,68,68,69,
752   69,69,69,69,69,69,69,69,69,69,
753   69,69,69,69,69,70,70,70,70,70,
754   70,70,70,70,70,70,70,70,70,70,
755   70,71,71,71,71,71,71,71,71,71,
756   71,71,71,71,71,71,71,72,72,72,
757   72,72,72,72,72,72,72,72,72,72,
758   72,72,72,73,73,73,73,73,73,73,
759   73,73,73,73,73,73,73,73,73,74,
760   74,74,74,74,74,74,74,74,74,74,
761   74,74,74,74,74,75,75,75,75,75,
762   75,75,75,75,75,75,75,75,75,75,
763   75,76,76,76,76,76,76,76,76,76,
764   76,76,76,76,76,76,76,76,76,76,
765   76,76,76,76,76,76,76,76,76,76,
766   76,76,76,77,77,77,77,77,77,77,
767   77,77,77,77,77,77,77,77,77,77,
768   77,77,77,77,77,77,77,77,77,77,
769   77,77,77,77,77,78,78,78,78,78,
770   78,78,78,78,78,78,78,78,78,78,
771   78,78,78,78,78,78,78,78,78,78,
772   78,78,78,78,78,78,78,79,79,79,
773   79,79,79,79,79,79,79,79,79,79,
774   79,79,79,79,79,79,79,79,79,79,
775   79,79,79,79,79,79,79,79,79,80,
776   80,80,80,80,80,80,80,80,80,80,
777   80,80,80,80,80,80,80,80,80,80,
778   80,80,80,80,80,80,80,80,80,80,
779   80,81,81,81,81,81,81,81,81,81,
780   81,81,81,81,81,81,81,81,81,81,
781   81,81,81,81,81,81,81,81,81,81,
782   81,81,81,82,82,82,82,82,82,82,
783   82,82,82,82,82,82,82,82,82,82,
784   82,82,82,82,82,82,82,82,82,82,
785   82,82,82,82,82,82,82,82,82,82,
786   82,82,82,82,82,82,82,82,82,82,
787   82,82,82,82,82,82,82,82,82,82,
788   82,82,82,82,82,82,82,83,83,83,
789   83,83,83,83,83,83,83,83,83,83,
790   83,83,83,83,83,83,83,83,83,83,
791   83,83,83,83,83,83,83,83,83,83,
792   83,83,83,83,83,83,83,83,83,83,
793   83,83,83,83,83,83,83,83,83,83,
794   83,83,83,83,83,83,83,83,83,83,
795   83,84,84,84,84,84,84,84,84,84,
796   84,84,84,84,84,84,84,84,84,84,
797   84,84,84,84,84,84,84,84,84,84,
798   84,84,84,84,84,84,84,84,84,84,
799   84,84,84,84,84,84,84,84,84,84,
800   84,84,84,84,84,84,84,84,84,84,
801   84,84,84,84,84,85,85,85,85,85,
802   85,85,85,85,85,85,85,85,85,85,
803   85,85,85,85,85,85,85,85,85,85,
804   85,85,85,85,85,85,85,85,85,85,
805   85,85,85,85,85,85,85,85,85,85,
806   85,85,85,85,85,85,85,85,85,85,
807   85,85,85,85,85,85,85,85,85,86,
808   86,86,86,86,86,86,86,86,86,86,
809   86,86,86,86,86,86,86,86,86,86,
810   86,86,86,86,86,86,86,86,86,86,
811   86,86,86,86,86,86,86,86,86,86,
812   86,86,86,86,86,86,86,86,86,86,
813   86,86,86,86,86,86,86,86,86,86,
814   86,86,86,87,87,87,87,87,87,87,
815   87,87,87,87,87,87,87,87,87,87,
816   87,87,87,87,87,87,87,87,87,87,
817   87,87,87,87,87,87,87,87,87,87,
818   87,87,87,87,87,87,87,87,87,87,
819   87,87,87,87,87,87,87,87,87,87,
820   87,87,87,87,87,87,87,87,87,87,
821   87,87,87,87,87,87,87,87,87,87,
822   87,87,87,87,87,87,87,87,87,87,
823   87,87,87,87,87,87,87,87,87,87,
824   87,87,87,87,87,87,87,87,87,87,
825   87,87,87,87,87,87,87,87,87,87,
826   87,87,87,87,87,87,87,87,87,87,
827   87,88,88,88,88,88,88,88,88,88,
828   88,88,88,88,88,88,88,88,88,88,
829   88,88,88,88,88,88,88,88,88,88,
830   88,88,88,88,88,88,88,88,88,88,
831   88,88,88,88,88,88,88,88,88,88,
832   88,88,88,88,88,88,88,88,88,88,
833   88,88,88,88,88,88,88,88,88,88,
834   88,88,88,88,88,88,88,88,88,88,
835   88,88,88,88,88,88,88,88,88,88,
836   88,88,88,88,88,88,88,88,88,88,
837   88,88,88,88,88,88,88,88,88,88,
838   88,88,88,88,88,88,88,88,88,88,
839   88,88,88,88,88,88,88,88,88,89,
840   89,89,89,89,89,89,89,89,89,89,
841   89,89,89,89,89,89,89,89,89,89,
842   89,89,89,89,89,89,89,89,89,89,
843   89,89,89,89,89,89,89,89,89,89,
844   89,89,89,89,89,89,89,89,89,89,
845   89,89,89,89,89,89,89,89,89,89,
846   89,89,89,89,89,89,89,89,89,89,
847   89,89,89,89,89,89,89,89,89,89,
848   89,89,89,89,89,89,89,89,89,89,
849   89,89,89,89,89,89,89,89,89,89,
850   89,89,89,89,89,89,89,89,89,89,
851   89,89,89,89,89,89,89,89,89,89,
852   89,89,89,89,89,89,89,90,90,90,
853   90,90,90,90,90,90,90,90,90,90,
854   90,90,90,90,90,90,90,90,90,90,
855   90,90,90,90,90,90,90,90,90,90,
856   90,90,90,90,90,90,90,90,90,90,
857   90,90,90,90,90,90,90,90,90,90,
858   90,90,90,90,90,90,90,90,90,90,
859   90,90,90,90,90,90,90,90,90,90,
860   90,90,90,90,90,90,90,90,90,90,
861   90,90,90,90,90,90,90,90,90,90,
862   90,90,90,90,90,90,90,90,90,90,
863   90,90,90,90,90,90,90,90,90,90,
864   90,90,90,90,90,90,90,90,90,90,
865   90,90,90,90,90,91,91,91,91,91,
866   91,91,91,91,91,91,91,91,91,91,
867   91,91,91,91,91,91,91,91,91,91,
868   91,91,91,91,91,91,91,91,91,91,
869   91,91,91,91,91,91,91,91,91,91,
870   91,91,91,91,91,91,91,91,91,91,
871   91,91,91,91,91,91,91,91,91,91,
872   91,91,91,91,91,91,91,91,91,91,
873   91,91,91,91,91,91,91,91,91,91,
874   91,91,91,91,91,91,91,91,91,91,
875   91,91,91,91,91,91,91,91,91,91,
876   91,91,91,91,91,91,91,91,91,91,
877   91,91,91,91,91,91,91,91,91,91,
878   91,91,91,92,92,92,92,92,92,92,
879   92,92,92,92,92,92,92,92,92,92,
880   92,92,92,92,92,92,92,92,92,92,
881   92,92,92,92,92,92,92,92,92,92,
882   92,92,92,92,92,92,92,92,92,92,
883   92,92,92,92,92,92,92,92,92,92,
884   92,92,92,92,92,92,92,92,92,92,
885   92,92,92,92,92,92,92,92,92,92,
886   92,92,92,92,92,92,92,92,92,92,
887   92,92,92,92,92,92,92,92,92,92,
888   92,92,92,92,92,92,92,92,92,92,
889   92,92,92,92,92,92,92,92,92,92,
890   92,92,92,92,92,92,92,92,92,92,
891   92,92,92,92,92,92,92,92,92,92,
892   92,92,92,92,92,92,92,92,92,92,
893   92,92,92,92,92,92,92,92,92,92,
894   92,92,92,92,92,92,92,92,92,92,
895   92,92,92,92,92,92,92,92,92,92,
896   92,92,92,92,92,92,92,92,92,92,
897   92,92,92,92,92,92,92,92,92,92,
898   92,92,92,92,92,92,92,92,92,92,
899   92,92,92,92,92,92,92,92,92,92,
900   92,92,92,92,92,92,92,92,92,92,
901   92,92,92,92,92,92,92,92,92,92,
902   92,92,92,92,92,92,92,92,92,92,
903   92,92,92,92,92,92,92,92,92,93,
904   93,93,93,93,93,93,93,93,93,93,
905   93,93,93,93,93,93,93,93,93,93,
906   93,93,93,93,93,93,93,93,93,93,
907   93,93,93,93,93,93,93,93,93,93,
908   93,93,93,93,93,93,93,93,93,93,
909   93,93,93,93,93,93,93,93,93,93,
910   93,93,93,93,93,93,93,93,93,93,
911   93,93,93,93,93,93,93,93,93,93,
912   93,93,93,93,93,93,93,93,93,93,
913   93,93,93,93,93,93,93,93,93,93,
914   93,93,93,93,93,93,93,93,93,93,
915   93,93,93,93,93,93,93,93,93,93,
916   93,93,93,93,93,93,93,93,93,93,
917   93,93,93,93,93,93,93,93,93,93,
918   93,93,93,93,93,93,93,93,93,93,
919   93,93,93,93,93,93,93,93,93,93,
920   93,93,93,93,93,93,93,93,93,93,
921   93,93,93,93,93,93,93,93,93,93,
922   93,93,93,93,93,93,93,93,93,93,
923   93,93,93,93,93,93,93,93,93,93,
924   93,93,93,93,93,93,93,93,93,93,
925   93,93,93,93,93,93,93,93,93,93,
926   93,93,93,93,93,93,93,93,93,93,
927   93,93,93,93,93,93,93,93,93,93,
928   93,93,93,93,93,93,93,93,93,93,
929   93,93,93,93,93,94,94,94,94,94,
930   94,94,94,94,94,94,94,94,94,94,
931   94,94,94,94,94,94,94,94,94,94,
932   94,94,94,94,94,94,94,94,94,94,
933   94,94,94,94,94,94,94,94,94,94,
934   94,94,94,94,94,94,94,94,94,94,
935   94,94,94,94,94,94,94,94,94,94,
936   94,94,94,94,94,94,94,94,94,94,
937   94,94,94,94,94,94,94,94,94,94,
938   94,94,94,94,94,94,94,94,94,94,
939   94,94,94,94,94,94,94,94,94,94,
940   94,94,94,94,94,94,94,94,94,94,
941   94,94,94,94,94,94,94,94,94,94,
942   94,94,94,94,94,94,94,94,94,94,
943   94,94,94,94,94,94,94,94,94,94,
944   94,94,94,94,94,94,94,94,94,94,
945   94,94,94,94,94,94,94,94,94,94,
946   94,94,94,94,94,94,94,94,94,94,
947   94,94,94,94,94,94,94,94,94,94,
948   94,94,94,94,94,94,94,94,94,94,
949   94,94,94,94,94,94,94,94,94,94,
950   94,94,94,94,94,94,94,94,94,94,
951   94,94,94,94,94,94,94,94,94,94,
952   94,94,94,94,94,94,94,94,94,94,
953   94,94,94,94,94,94,94,94,94,94,
954   94,94,94,94,94,94,94,94,94,94,
955   94,95,95,95,95,95,95,95,95,95,
956   95,95,95,95,95,95,95,95,95,95,
957   95,95,95,95,95,95,95,95,95,95,
958   95,95,95,95,95,95,95,95,95,95,
959   95,95,95,95,95,95,95,95,95,95,
960   95,95,95,95,95,95,95,95,95,95,
961   95,95,95,95,95,95,95,95,95,95,
962   95,95,95,95,95,95,95,95,95,95,
963   95,95,95,95,95,95,95,95,95,95,
964   95,95,95,95,95,95,95,95,95,95,
965   95,95,95,95,95,95,95,95,95,95,
966   95,95,95,95,95,95,95,95,95,95,
967   95,95,95,95,95,95,95,95,95,95,
968   95,95,95,95,95,95,95,95,95,95,
969   95,95,95,95,95,95,95,95,95,95,
970   95,95,95,95,95,95,95,95,95,95,
971   95,95,95,95,95,95,95,95,95,95,
972   95,95,95,95,95,95,95,95,95,95,
973   95,95,95,95,95,95,95,95,95,95,
974   95,95,95,95,95,95,95,95,95,95,
975   95,95,95,95,95,95,95,95,95,95,
976   95,95,95,95,95,95,95,95,95,95,
977   95,95,95,95,95,95,95,95,95,95,
978   95,95,95,95,95,95,95,95,95,95,
979   95,95,95,95,95,95,95,95,95,95,
980   95,95,95,95,95,95,95,96};
981 treal c0_0[376] = {
982   -1.4098306912781866e-10,3.785479628582994e-08,-2.324316285693539e-06,9.634462871282249e-06,1.960181358648102e-08,-4.848446952761055e-08,-4.494217937028353e-06,-8.667118842496641e-05,-3.8377800906645655e-07,1.4520558117794282e-06,
983   3.1320756145940964e-05,9.275726642802674e-05,8.058124288697283e-06,-1.3237257479139876e-05,-0.000119040924651099,-6.831191554306465e-05,0.003638822081560925,0.00014097730069965273,0.0006958457504287977,0.0007255229802391752,
984   0.004670889111060192,0.008845846441063149,0.007862004002203824,0.0032150580837461157,0.019412623179141764,0.014432747582364111,0.01714326362430375,0.00805188350667582,0.02478657002351342,0.03765239677899713,
985   0.03790979904245813,0.018411627490388327,0.03409415836165908,0.06729988209938163,0.0797546521818247,0.041082765292381376,0.025629482570435055,0.08769007845529703,0.11065218107208565,0.05992668359129099,
986   0.020535568540425205,0.10301792953665312,0.14867016730453342,0.08567334873170579,0.008508184988790085,0.11529933769983304,0.19219210929059144,0.11956775812526615,-0.002017129445343131,0.12038770388601742,
987   0.2391767472013153,0.16253113598277213,-0.010668228781033587,0.11918134867907682,0.28693527102022465,0.21497981738085598,-0.015769209180709426,0.11280115658553257,0.33318140291674647,0.2768327668595422,
988   -0.017917922338409296,0.10337029549310106,0.376275572771012,0.34761099786708965,-0.017927268404173198,0.09265438484076285,0.41535344724845596,0.42658831324184804,-0.016771949403814695,0.08193288472309611,
989   0.450157735125656,0.5129299369683228,-0.014908007435508353,0.0719023294007556,0.4808250632269129,0.605792926721149,-0.013485932663309642,0.06298651468373057,0.5077153982018933,0.7043856450680901,
990   -0.01056455946308883,0.054921179498429167,0.531220510238437,0.8079959419870516,-0.007597694694493399,0.04228479530726693,0.5699768839302077,1.0278564232767526,-0.0055921681762785445,0.0331971102540273,
991   0.6000717926510764,1.2613485126383768,-0.004140082247370856,0.026508257227647908,0.6238765385851577,1.505522040732009,-0.003131611937591421,0.02155625993485283,0.643040035398887,1.7582153492909371,
992   -0.002381741262315317,0.01781050492071384,0.6587357069131958,2.0178259377903167,-0.0019408210578741607,0.014961678356793871,0.6718020949036164,2.2831465315515485,-0.0013465173267465796,0.012640241233051724,
993   0.6828070800639686,2.5532518243701197,-0.0008707301246721087,0.00941907326664953,0.7003973369971179,3.1050817954162833,-0.0006129355368492403,0.007336093768901817,0.7137580283784015,3.669131400390254,
994   -0.0004409042020333111,0.005869816077890806,0.7242885164062246,4.242641149168397,-0.00032996881823149003,0.004815075478842343,0.7328087262154785,4.823702866857068,-0.00025047713097302743,0.004025716912052134,
995   0.7398584380118525,5.410944244369379,-0.0002046610334437265,0.003426520084369212,0.7458009056934999,6.0033454981714325,-0.00014426760687552426,0.0029369255193348676,0.7508751632435607,6.600127544913067,
996   -9.629140369029607e-05,0.002246685320228387,0.7591420607947615,7.8045187976839046,-7.098927230493294e-05,0.001785984549661238,0.7655734210384255,9.020533244497143,-5.255961182529003e-05,0.001446340394529043,
997   0.7707283796170799,10.24573538917235,-4.7213527913433756e-05,0.0011948719067863356,0.7749406232020526,11.47836963045112,-1.974761181272241e-05,0.0009689814549151415,0.778391567844825,12.71710371077832,
998   -5.4972617037243696e-05,0.0008745001239726269,0.7813315789339821,13.960878280377749,6.31178681843194e-05,0.0003484733747810334,0.7852324105878037,16.460149134814554,-0.0027661275165766067,0.000952441110106551,
999   0.7893818450659309,18.97034262648757,0.03337280476381055,-0.0056647491557689856,0.785624216547036,19.599004505008278,-0.01078621129881676,0.034252824691541936,0.7970223856493744,19.913450386887725,
1000   -0.010582718433596582,0.02135132033491328,0.8191919593588541,20.23598745270275,-0.0009923009464007993,0.00869321600211588,0.8311708246498142,20.5653256229164,-0.001182329596975872,0.007506314074422235,
1001   0.8376296358754858,20.89803545814931,-0.00044052603991519946,0.0046779195577992295,0.8473454319002081,21.570140854252692,-0.00031459625000537306,0.003624083606375253,0.8539655092702291,22.248571360858524,
1002   -0.0001962409273418918,0.002871499630856695,0.8591451343249928,22.93167452589906,-0.0001517235006254813,0.0024020478263425374,0.8633502992099917,23.61848943530459,-9.808807298711842e-05,0.002039091575979201,
1003   0.8668916958913723,24.3083816408078,-6.16744044887281e-05,0.0015697947428584037,0.8726471999975167,25.695701475686946,-4.442835797282901e-05,0.0012747170455427246,0.8771836685453517,27.091154351545278,
1004   -3.348954139243773e-05,0.001062152081603185,0.8809105412336393,28.493161497868602,-2.6683222559134847e-05,0.0009019232664219256,0.8840428770102831,29.90061604105042,-2.2088178681282497e-05,0.0007742588984400619,
1005   0.8867160765738583,31.312686155853683,-1.667711339966583e-05,0.0006685792577981921,0.8890171357370091,32.72871346109606,-1.3575572323023186e-05,0.0005887885527133097,0.8910224041098471,34.14816368859959,
1006   3.870682341339684e-06,0.0005238369953528771,0.8927968354287474,35.57062158557842,1.652501762750896e-05,0.0005608751164921488,0.8962566645628054,38.42376718451725,1.025533165799457e-05,0.0006399381279642342,
1007   0.8981717388956004,39.85462385696781,4.217489203709734e-06,0.0006890041817986525,0.9002911553152158,41.288710377401316,-1.3606583009440145e-06,0.0007091825201709647,0.902521003693187,42.72627727870422,
1008   -6.5919455386986025e-06,0.0007026725275475353,0.90477265054668,44.16742907004963,-8.337302371781329e-06,0.0006395949469364391,0.909053985716819,47.060252983472736,-7.449588627944947e-06,0.0005598162443746847,
1009   0.9128796623531339,49.966034395389734,-6.315093844706993e-06,0.0004885319741330542,0.916223504160949,52.88323545568578,-5.222210236886068e-06,0.0004281035560404521,0.9191472313674356,55.810413718287215,
1010   -4.3340984409028905e-06,0.00037813281746995354,0.92171882622984,58.746338267744775,-3.584018510477514e-06,0.00033666032013550954,0.9239987511014315,61.689985681248636,-3.1164047298666206e-06,0.0003023652527416521,
1011   0.9260370055565125,64.64050761939896,-2.397927550774463e-06,0.0002725447286777092,0.9278707550661331,67.59719709834856,-1.7582332772723927e-06,0.0002266537341312325,0.9310552707849915,73.52679258666676,
1012   -1.3590446900958163e-06,0.00019300506375639925,0.9337323824710142,79.47500145791733,-1.0705780458318834e-06,0.00016699597418175295,0.9360289219228157,85.43902261536246,-8.554633498108393e-07,0.00014650749393263905,
1013   0.9380288413867284,91.41671043899811,-7.26565013231226e-07,0.00013013583003136704,0.9397936204862541,97.40637833182979,-5.433695525704639e-07,0.00011623099331138935,0.9413652579811407,103.40667142433091,
1014   -3.875120433256194e-07,9.543322636828125e-05,0.9440657792563745,115.43488643542663,-2.955848690540261e-07,8.060099087292065e-05,0.9463117145852102,127.49449432411251,-2.2764651014780293e-07,6.928731827309727e-05,
1015   0.9482240669344653,139.5805335437144,-1.889365693472967e-07,6.057402353461092e-05,0.9498809049060076,151.6892710006018,-1.3662970839616652e-07,5.334237296139283e-05,0.9513343090420538,163.81780929697055,
1016   -9.405186200125871e-08,4.288321926282487e-05,0.9537897005051623,188.12549895656414,-7.014801524368798e-08,3.5683446300890725e-05,0.9557944885812962,212.4897401795494,-5.297669610422804e-08,3.0313538967444306e-05,
1017   0.9574785357300128,236.90084688807764,-4.3382495941391207e-08,2.625811490557173e-05,0.9589220764010857,261.35171432750417,-3.079907645361472e-08,2.2937137365585694e-05,0.9601773932004939,285.8369354804065,
1018   -2.0795670460507038e-08,1.8221731350544535e-05,0.9622778974954699,334.89433445484354,-1.5313305483537226e-08,1.5037868687520437e-05,0.9639752700158608,384.0479791602135,-1.148795673562738e-08,1.2693368101732272e-05,
1019   0.9653905076984746,433.2806840883545,-9.203493258516892e-09,1.093453678179663e-05,0.9665963356825096,482.58001660466164};
1020 maptype *map_0[1] = {a0_0};
1021 treal *t_0[1] = {t0_0};
1022 treal *c_0[1] = {c0_0};
1023 real x0_1[2] = {-84.2062327123};
1024 real xe_1[2] = {426.234072198};
1025 real hi_1[2] = {20.0650299388};
1026 int k_1[2] = {4};
1027 int nmap_1[2] = {10243};
1028 int n_1[2] = {195};
1029 treal t0_1[199] = {
1030   -288.2926463625786,-288.2926463625786,-288.2926463625786,-288.2926463625786,-84.15639476023611,-58.639363309943306,-45.880847584796896,-42.6912186535103,-41.096404187866995,-39.5015897222237,
1031   -39.10288610581287,-38.704182489402044,-38.50483068119663,-38.305478872991216,-38.10612706478581,-38.0064511606831,-37.906775256580396,-37.80709935247769,-37.70742344837498,-37.60774754427228,
1032   -37.508071640169575,-37.408395736066865,-37.30871983196416,-37.258881879912806,-37.20904392786146,-37.1592059758101,-37.10936802375875,-37.05953007170739,-37.00969211965604,-36.95985416760469,
1033   -36.910016215553334,-36.86017826350198,-36.81034031145063,-36.760502359399275,-36.71066440734792,-36.660826455296565,-36.61098850324521,-36.56115055119386,-36.51131259914251,-36.46147464709115,
1034   -36.4116366950398,-36.36179874298845,-36.31196079093709,-36.26212283888574,-36.21228488683438,-36.162446934783034,-36.11260898273168,-36.062771030680324,-36.012933078628976,-35.96309512657762,
1035   -35.913257174526265,-35.81358127042356,-35.71390536632086,-35.61422946221815,-35.514553558115445,-35.41487765401274,-35.31520174991003,-35.21552584580733,-35.115849941704624,-35.016174037601914,
1036   -34.91649813349921,-34.81682222939651,-34.7171463252938,-34.617470421191086,-34.51779451708838,-34.41811861298568,-34.31844270888297,-34.21876680478026,-34.119090900677556,-33.91973909247214,
1037   -33.72038728426673,-33.521035476061314,-33.32168366785591,-33.122331859650494,-32.92298005144508,-32.72362824323967,-32.52427643503426,-32.324924626828846,-32.12557281862343,-31.92622101041802,
1038   -31.726869202212605,-31.527517394007194,-31.12881377759637,-30.730110161185543,-30.33140654477472,-29.932702928363895,-29.533999311953067,-29.135295695542244,-28.73659207913142,-28.337888462720592,
1039   -27.939184846309768,-27.540481229898944,-26.743073997077293,-25.94566676425564,-25.148259531433993,-24.35085229861234,-23.55344506579069,-22.756037832969042,-21.95863060014739,-21.16122336732574,
1040   -20.36381613450409,-18.76900166886079,-17.17418720321749,-15.57937273757419,-13.984558271930888,-10.794929340644288,-9.997522107822636,-9.598818491411812,-9.499142587309105,-9.399466683206398,
1041   -9.200114875000986,-9.000763066795574,-8.80141125859016,-8.602059450384749,-8.402707642179337,-8.004004025768511,-7.605300409357685,-7.20659679294686,-6.8078931765360355,-6.40918956012521,
1042   -6.010485943714385,-5.61178232730356,-5.213078710892734,-4.8143750944819095,-4.415671478071085,-3.618264245249434,-2.820857012427784,-2.0234497796061337,-1.226042546784483,-0.42863531396283283,
1043   0.36877191885881744,1.1661791516804678,1.963586384502118,2.760993617323768,3.5584008501454187,4.355808082967069,5.153215315788719,5.950622548610369,6.748029781432019,7.54543701425367,
1044   7.944140630664495,8.34284424707532,8.741547863486145,9.140251479896971,9.538955096307795,9.937658712718621,10.336362329129447,10.73506594554027,11.133769561951096,11.532473178361922,
1045   11.931176794772746,12.329880411183572,12.728584027594398,13.127287644005222,13.525991260416047,13.924694876826873,14.323398493237697,14.722102109648523,15.519509342470172,16.316916575291824,
1046   17.114323808113475,17.911731040935123,18.709138273756775,19.506545506578426,20.303952739400074,21.101359972221726,21.898767205043377,22.696174437865025,24.290988903508328,25.885803369151628,
1047   27.480617834794927,29.07543230043823,30.67024676608153,32.26506123172483,33.85987569736813,37.04950462865473,40.23913355994134,43.428762491227936,46.618391422514534,49.80802035380114,
1048   56.18727821637434,62.56653607894754,68.94579394152075,75.32505180409395,81.70430966666714,94.46282539181355,107.22134111695996,119.97985684210636,145.49688829239918,171.013919742692,
1049   196.5309511929848,222.0479826432776,273.0820455438632,324.11610844444886,426.1842342456201,528.2523600467913,528.2523600467913,528.2523600467913,528.2523600467913};
1050 maptype a0_1[10242] = {
1051   3,4,4,4,4,4,4,4,4,4,
1052   4,4,4,4,4,4,4,4,4,4,
1053   4,4,4,4,4,4,4,4,4,4,
1054   4,4,4,4,4,4,4,4,4,4,
1055   4,4,4,4,4,4,4,4,4,4,
1056   4,4,4,4,4,4,4,4,4,4,
1057   4,4,4,4,4,4,4,4,4,4,
1058   4,4,4,4,4,4,4,4,4,4,
1059   4,4,4,4,4,4,4,4,4,4,
1060   4,4,4,4,4,4,4,4,4,4,
1061   4,4,4,4,4,4,4,4,4,4,
1062   4,4,4,4,4,4,4,4,4,4,
1063   4,4,4,4,4,4,4,4,4,4,
1064   4,4,4,4,4,4,4,4,4,4,
1065   4,4,4,4,4,4,4,4,4,4,
1066   4,4,4,4,4,4,4,4,4,4,
1067   4,4,4,4,4,4,4,4,4,4,
1068   4,4,4,4,4,4,4,4,4,4,
1069   4,4,4,4,4,4,4,4,4,4,
1070   4,4,4,4,4,4,4,4,4,4,
1071   4,4,4,4,4,4,4,4,4,4,
1072   4,4,4,4,4,4,4,4,4,4,
1073   4,4,4,4,4,4,4,4,4,4,
1074   4,4,4,4,4,4,4,4,4,4,
1075   4,4,4,4,4,4,4,4,4,4,
1076   4,4,4,4,4,4,4,4,4,4,
1077   4,4,4,4,4,4,4,4,4,4,
1078   4,4,4,4,4,4,4,4,4,4,
1079   4,4,4,4,4,4,4,4,4,4,
1080   4,4,4,4,4,4,4,4,4,4,
1081   4,4,4,4,4,4,4,4,4,4,
1082   4,4,4,4,4,4,4,4,4,4,
1083   4,4,4,4,4,4,4,4,4,4,
1084   4,4,4,4,4,4,4,4,4,4,
1085   4,4,4,4,4,4,4,4,4,4,
1086   4,4,4,4,4,4,4,4,4,4,
1087   4,4,4,4,4,4,4,4,4,4,
1088   4,4,4,4,4,4,4,4,4,4,
1089   4,4,4,4,4,4,4,4,4,4,
1090   4,4,4,4,4,4,4,4,4,4,
1091   4,4,4,4,4,4,4,4,4,4,
1092   4,4,4,4,4,4,4,4,4,4,
1093   4,4,4,4,4,4,4,4,4,4,
1094   4,4,4,4,4,4,4,4,4,4,
1095   4,4,4,4,4,4,4,4,4,4,
1096   4,4,4,4,4,4,4,4,4,4,
1097   4,4,4,4,4,4,4,4,4,4,
1098   4,4,4,4,4,4,4,4,4,4,
1099   4,4,4,4,4,4,4,4,4,4,
1100   4,4,4,4,4,4,4,4,4,4,
1101   4,4,4,4,4,4,4,4,4,4,
1102   4,4,4,5,5,5,5,5,5,5,
1103   5,5,5,5,5,5,5,5,5,5,
1104   5,5,5,5,5,5,5,5,5,5,
1105   5,5,5,5,5,5,5,5,5,5,
1106   5,5,5,5,5,5,5,5,5,5,
1107   5,5,5,5,5,5,5,5,5,5,
1108   5,5,5,5,5,5,5,5,5,5,
1109   5,5,5,5,5,5,5,5,5,5,
1110   5,5,5,5,5,5,5,5,5,5,
1111   5,5,5,5,5,5,5,5,5,5,
1112   5,5,5,5,5,5,5,5,5,5,
1113   5,5,5,5,5,5,5,5,5,5,
1114   5,5,5,5,5,5,5,5,5,5,
1115   5,5,5,5,5,5,5,5,5,5,
1116   5,5,5,5,5,5,5,5,5,5,
1117   5,5,5,5,5,5,5,5,5,5,
1118   5,5,5,5,5,5,5,5,5,5,
1119   5,5,5,5,5,5,5,5,5,5,
1120   5,5,5,5,5,5,5,5,5,5,
1121   5,5,5,5,5,5,5,5,5,5,
1122   5,5,5,5,5,5,5,5,5,5,
1123   5,5,5,5,5,5,5,5,5,5,
1124   5,5,5,5,5,5,5,5,5,5,
1125   5,5,5,5,5,5,5,5,5,5,
1126   5,5,5,5,5,5,5,5,5,5,
1127   5,5,5,5,5,5,5,5,5,6,
1128   6,6,6,6,6,6,6,6,6,6,
1129   6,6,6,6,6,6,6,6,6,6,
1130   6,6,6,6,6,6,6,6,6,6,
1131   6,6,6,6,6,6,6,6,6,6,
1132   6,6,6,6,6,6,6,6,6,6,
1133   6,6,6,6,6,6,6,6,6,6,
1134   6,6,6,7,7,7,7,7,7,7,
1135   7,7,7,7,7,7,7,7,7,7,
1136   7,7,7,7,7,7,7,7,7,7,
1137   7,7,7,7,7,8,8,8,8,8,
1138   8,8,8,8,8,8,8,8,8,8,
1139   8,8,8,8,8,8,8,8,8,8,
1140   8,8,8,8,8,8,8,9,9,9,
1141   9,9,9,9,9,10,10,10,10,10,
1142   10,10,10,11,11,11,11,12,12,12,
1143   12,13,13,13,13,14,14,15,15,16,
1144   16,17,17,18,18,19,19,20,20,21,
1145   21,22,23,24,25,26,27,28,29,30,
1146   31,32,33,34,35,36,37,38,39,40,
1147   41,42,43,44,45,46,47,48,49,50,
1148   50,51,51,52,52,53,53,54,54,55,
1149   55,56,56,57,57,58,58,59,59,60,
1150   60,61,61,62,62,63,63,64,64,65,
1151   65,66,66,67,67,68,68,68,68,69,
1152   69,69,69,70,70,70,70,71,71,71,
1153   71,72,72,72,72,73,73,73,73,74,
1154   74,74,74,75,75,75,75,76,76,76,
1155   76,77,77,77,77,78,78,78,78,79,
1156   79,79,79,80,80,80,80,81,81,81,
1157   81,81,81,81,81,82,82,82,82,82,
1158   82,82,82,83,83,83,83,83,83,83,
1159   83,84,84,84,84,84,84,84,84,85,
1160   85,85,85,85,85,85,85,86,86,86,
1161   86,86,86,86,86,87,87,87,87,87,
1162   87,87,87,88,88,88,88,88,88,88,
1163   88,89,89,89,89,89,89,89,89,90,
1164   90,90,90,90,90,90,90,91,91,91,
1165   91,91,91,91,91,91,91,91,91,91,
1166   91,91,91,92,92,92,92,92,92,92,
1167   92,92,92,92,92,92,92,92,92,93,
1168   93,93,93,93,93,93,93,93,93,93,
1169   93,93,93,93,93,94,94,94,94,94,
1170   94,94,94,94,94,94,94,94,94,94,
1171   94,95,95,95,95,95,95,95,95,95,
1172   95,95,95,95,95,95,95,96,96,96,
1173   96,96,96,96,96,96,96,96,96,96,
1174   96,96,96,97,97,97,97,97,97,97,
1175   97,97,97,97,97,97,97,97,97,98,
1176   98,98,98,98,98,98,98,98,98,98,
1177   98,98,98,98,98,99,99,99,99,99,
1178   99,99,99,99,99,99,99,99,99,99,
1179   99,100,100,100,100,100,100,100,100,100,
1180   100,100,100,100,100,100,100,100,100,100,
1181   100,100,100,100,100,100,100,100,100,100,
1182   100,100,100,101,101,101,101,101,101,101,
1183   101,101,101,101,101,101,101,101,101,101,
1184   101,101,101,101,101,101,101,101,101,101,
1185   101,101,101,101,101,102,102,102,102,102,
1186   102,102,102,102,102,102,102,102,102,102,
1187   102,102,102,102,102,102,102,102,102,102,
1188   102,102,102,102,102,102,102,103,103,103,
1189   103,103,103,103,103,103,103,103,103,103,
1190   103,103,103,103,103,103,103,103,103,103,
1191   103,103,103,103,103,103,103,103,103,104,
1192   104,104,104,104,104,104,104,104,104,104,
1193   104,104,104,104,104,104,104,104,104,104,
1194   104,104,104,104,104,104,104,104,104,104,
1195   104,104,104,104,104,104,104,104,104,104,
1196   104,104,104,104,104,104,104,104,104,104,
1197   104,104,104,104,104,104,104,104,104,104,
1198   104,104,104,105,105,105,105,105,105,105,
1199   105,105,105,105,105,105,105,105,105,106,
1200   106,106,106,106,106,106,106,107,107,108,
1201   108,109,109,109,109,110,110,110,110,111,
1202   111,111,111,112,112,112,112,113,113,113,
1203   113,114,114,114,114,114,114,114,114,115,
1204   115,115,115,115,115,115,115,116,116,116,
1205   116,116,116,116,116,117,117,117,117,117,
1206   117,117,117,118,118,118,118,118,118,118,
1207   118,119,119,119,119,119,119,119,119,120,
1208   120,120,120,120,120,120,120,121,121,121,
1209   121,121,121,121,121,122,122,122,122,122,
1210   122,122,122,123,123,123,123,123,123,123,
1211   123,124,124,124,124,124,124,124,124,124,
1212   124,124,124,124,124,124,124,125,125,125,
1213   125,125,125,125,125,125,125,125,125,125,
1214   125,125,125,126,126,126,126,126,126,126,
1215   126,126,126,126,126,126,126,126,126,127,
1216   127,127,127,127,127,127,127,127,127,127,
1217   127,127,127,127,127,128,128,128,128,128,
1218   128,128,128,128,128,128,128,128,128,128,
1219   128,129,129,129,129,129,129,129,129,129,
1220   129,129,129,129,129,129,129,130,130,130,
1221   130,130,130,130,130,130,130,130,130,130,
1222   130,130,130,131,131,131,131,131,131,131,
1223   131,131,131,131,131,131,131,131,131,132,
1224   132,132,132,132,132,132,132,132,132,132,
1225   132,132,132,132,132,133,133,133,133,133,
1226   133,133,133,133,133,133,133,133,133,133,
1227   133,134,134,134,134,134,134,134,134,134,
1228   134,134,134,134,134,134,134,135,135,135,
1229   135,135,135,135,135,135,135,135,135,135,
1230   135,135,135,136,136,136,136,136,136,136,
1231   136,136,136,136,136,136,136,136,136,137,
1232   137,137,137,137,137,137,137,137,137,137,
1233   137,137,137,137,137,138,138,138,138,138,
1234   138,138,138,138,138,138,138,138,138,138,
1235   138,139,139,139,139,139,139,139,139,140,
1236   140,140,140,140,140,140,140,141,141,141,
1237   141,141,141,141,141,142,142,142,142,142,
1238   142,142,142,143,143,143,143,143,143,143,
1239   143,144,144,144,144,144,144,144,144,145,
1240   145,145,145,145,145,145,145,146,146,146,
1241   146,146,146,146,146,147,147,147,147,147,
1242   147,147,147,148,148,148,148,148,148,148,
1243   148,149,149,149,149,149,149,149,149,150,
1244   150,150,150,150,150,150,150,151,151,151,
1245   151,151,151,151,151,152,152,152,152,152,
1246   152,152,152,153,153,153,153,153,153,153,
1247   153,154,154,154,154,154,154,154,154,155,
1248   155,155,155,155,155,155,155,156,156,156,
1249   156,156,156,156,156,157,157,157,157,157,
1250   157,157,157,157,157,157,157,157,157,157,
1251   157,158,158,158,158,158,158,158,158,158,
1252   158,158,158,158,158,158,158,159,159,159,
1253   159,159,159,159,159,159,159,159,159,159,
1254   159,159,159,160,160,160,160,160,160,160,
1255   160,160,160,160,160,160,160,160,160,161,
1256   161,161,161,161,161,161,161,161,161,161,
1257   161,161,161,161,161,162,162,162,162,162,
1258   162,162,162,162,162,162,162,162,162,162,
1259   162,163,163,163,163,163,163,163,163,163,
1260   163,163,163,163,163,163,163,164,164,164,
1261   164,164,164,164,164,164,164,164,164,164,
1262   164,164,164,165,165,165,165,165,165,165,
1263   165,165,165,165,165,165,165,165,165,166,
1264   166,166,166,166,166,166,166,166,166,166,
1265   166,166,166,166,166,167,167,167,167,167,
1266   167,167,167,167,167,167,167,167,167,167,
1267   167,167,167,167,167,167,167,167,167,167,
1268   167,167,167,167,167,167,167,168,168,168,
1269   168,168,168,168,168,168,168,168,168,168,
1270   168,168,168,168,168,168,168,168,168,168,
1271   168,168,168,168,168,168,168,168,168,169,
1272   169,169,169,169,169,169,169,169,169,169,
1273   169,169,169,169,169,169,169,169,169,169,
1274   169,169,169,169,169,169,169,169,169,169,
1275   169,170,170,170,170,170,170,170,170,170,
1276   170,170,170,170,170,170,170,170,170,170,
1277   170,170,170,170,170,170,170,170,170,170,
1278   170,170,170,171,171,171,171,171,171,171,
1279   171,171,171,171,171,171,171,171,171,171,
1280   171,171,171,171,171,171,171,171,171,171,
1281   171,171,171,171,171,172,172,172,172,172,
1282   172,172,172,172,172,172,172,172,172,172,
1283   172,172,172,172,172,172,172,172,172,172,
1284   172,172,172,172,172,172,172,173,173,173,
1285   173,173,173,173,173,173,173,173,173,173,
1286   173,173,173,173,173,173,173,173,173,173,
1287   173,173,173,173,173,173,173,173,173,174,
1288   174,174,174,174,174,174,174,174,174,174,
1289   174,174,174,174,174,174,174,174,174,174,
1290   174,174,174,174,174,174,174,174,174,174,
1291   174,174,174,174,174,174,174,174,174,174,
1292   174,174,174,174,174,174,174,174,174,174,
1293   174,174,174,174,174,174,174,174,174,174,
1294   174,174,174,175,175,175,175,175,175,175,
1295   175,175,175,175,175,175,175,175,175,175,
1296   175,175,175,175,175,175,175,175,175,175,
1297   175,175,175,175,175,175,175,175,175,175,
1298   175,175,175,175,175,175,175,175,175,175,
1299   175,175,175,175,175,175,175,175,175,175,
1300   175,175,175,175,175,175,175,176,176,176,
1301   176,176,176,176,176,176,176,176,176,176,
1302   176,176,176,176,176,176,176,176,176,176,
1303   176,176,176,176,176,176,176,176,176,176,
1304   176,176,176,176,176,176,176,176,176,176,
1305   176,176,176,176,176,176,176,176,176,176,
1306   176,176,176,176,176,176,176,176,176,176,
1307   176,177,177,177,177,177,177,177,177,177,
1308   177,177,177,177,177,177,177,177,177,177,
1309   177,177,177,177,177,177,177,177,177,177,
1310   177,177,177,177,177,177,177,177,177,177,
1311   177,177,177,177,177,177,177,177,177,177,
1312   177,177,177,177,177,177,177,177,177,177,
1313   177,177,177,177,177,178,178,178,178,178,
1314   178,178,178,178,178,178,178,178,178,178,
1315   178,178,178,178,178,178,178,178,178,178,
1316   178,178,178,178,178,178,178,178,178,178,
1317   178,178,178,178,178,178,178,178,178,178,
1318   178,178,178,178,178,178,178,178,178,178,
1319   178,178,178,178,178,178,178,178,178,179,
1320   179,179,179,179,179,179,179,179,179,179,
1321   179,179,179,179,179,179,179,179,179,179,
1322   179,179,179,179,179,179,179,179,179,179,
1323   179,179,179,179,179,179,179,179,179,179,
1324   179,179,179,179,179,179,179,179,179,179,
1325   179,179,179,179,179,179,179,179,179,179,
1326   179,179,179,179,179,179,179,179,179,179,
1327   179,179,179,179,179,179,179,179,179,179,
1328   179,179,179,179,179,179,179,179,179,179,
1329   179,179,179,179,179,179,179,179,179,179,
1330   179,179,179,179,179,179,179,179,179,179,
1331   179,179,179,179,179,179,179,179,179,179,
1332   179,179,179,179,179,179,179,180,180,180,
1333   180,180,180,180,180,180,180,180,180,180,
1334   180,180,180,180,180,180,180,180,180,180,
1335   180,180,180,180,180,180,180,180,180,180,
1336   180,180,180,180,180,180,180,180,180,180,
1337   180,180,180,180,180,180,180,180,180,180,
1338   180,180,180,180,180,180,180,180,180,180,
1339   180,180,180,180,180,180,180,180,180,180,
1340   180,180,180,180,180,180,180,180,180,180,
1341   180,180,180,180,180,180,180,180,180,180,
1342   180,180,180,180,180,180,180,180,180,180,
1343   180,180,180,180,180,180,180,180,180,180,
1344   180,180,180,180,180,180,180,180,180,180,
1345   180,180,180,180,180,181,181,181,181,181,
1346   181,181,181,181,181,181,181,181,181,181,
1347   181,181,181,181,181,181,181,181,181,181,
1348   181,181,181,181,181,181,181,181,181,181,
1349   181,181,181,181,181,181,181,181,181,181,
1350   181,181,181,181,181,181,181,181,181,181,
1351   181,181,181,181,181,181,181,181,181,181,
1352   181,181,181,181,181,181,181,181,181,181,
1353   181,181,181,181,181,181,181,181,181,181,
1354   181,181,181,181,181,181,181,181,181,181,
1355   181,181,181,181,181,181,181,181,181,181,
1356   181,181,181,181,181,181,181,181,181,181,
1357   181,181,181,181,181,181,181,181,181,181,
1358   181,181,181,182,182,182,182,182,182,182,
1359   182,182,182,182,182,182,182,182,182,182,
1360   182,182,182,182,182,182,182,182,182,182,
1361   182,182,182,182,182,182,182,182,182,182,
1362   182,182,182,182,182,182,182,182,182,182,
1363   182,182,182,182,182,182,182,182,182,182,
1364   182,182,182,182,182,182,182,182,182,182,
1365   182,182,182,182,182,182,182,182,182,182,
1366   182,182,182,182,182,182,182,182,182,182,
1367   182,182,182,182,182,182,182,182,182,182,
1368   182,182,182,182,182,182,182,182,182,182,
1369   182,182,182,182,182,182,182,182,182,182,
1370   182,182,182,182,182,182,182,182,182,182,
1371   182,183,183,183,183,183,183,183,183,183,
1372   183,183,183,183,183,183,183,183,183,183,
1373   183,183,183,183,183,183,183,183,183,183,
1374   183,183,183,183,183,183,183,183,183,183,
1375   183,183,183,183,183,183,183,183,183,183,
1376   183,183,183,183,183,183,183,183,183,183,
1377   183,183,183,183,183,183,183,183,183,183,
1378   183,183,183,183,183,183,183,183,183,183,
1379   183,183,183,183,183,183,183,183,183,183,
1380   183,183,183,183,183,183,183,183,183,183,
1381   183,183,183,183,183,183,183,183,183,183,
1382   183,183,183,183,183,183,183,183,183,183,
1383   183,183,183,183,183,183,183,183,183,184,
1384   184,184,184,184,184,184,184,184,184,184,
1385   184,184,184,184,184,184,184,184,184,184,
1386   184,184,184,184,184,184,184,184,184,184,
1387   184,184,184,184,184,184,184,184,184,184,
1388   184,184,184,184,184,184,184,184,184,184,
1389   184,184,184,184,184,184,184,184,184,184,
1390   184,184,184,184,184,184,184,184,184,184,
1391   184,184,184,184,184,184,184,184,184,184,
1392   184,184,184,184,184,184,184,184,184,184,
1393   184,184,184,184,184,184,184,184,184,184,
1394   184,184,184,184,184,184,184,184,184,184,
1395   184,184,184,184,184,184,184,184,184,184,
1396   184,184,184,184,184,184,184,184,184,184,
1397   184,184,184,184,184,184,184,184,184,184,
1398   184,184,184,184,184,184,184,184,184,184,
1399   184,184,184,184,184,184,184,184,184,184,
1400   184,184,184,184,184,184,184,184,184,184,
1401   184,184,184,184,184,184,184,184,184,184,
1402   184,184,184,184,184,184,184,184,184,184,
1403   184,184,184,184,184,184,184,184,184,184,
1404   184,184,184,184,184,184,184,184,184,184,
1405   184,184,184,184,184,184,184,184,184,184,
1406   184,184,184,184,184,184,184,184,184,184,
1407   184,184,184,184,184,184,184,184,184,184,
1408   184,184,184,184,184,184,184,184,184,184,
1409   184,184,184,184,184,185,185,185,185,185,
1410   185,185,185,185,185,185,185,185,185,185,
1411   185,185,185,185,185,185,185,185,185,185,
1412   185,185,185,185,185,185,185,185,185,185,
1413   185,185,185,185,185,185,185,185,185,185,
1414   185,185,185,185,185,185,185,185,185,185,
1415   185,185,185,185,185,185,185,185,185,185,
1416   185,185,185,185,185,185,185,185,185,185,
1417   185,185,185,185,185,185,185,185,185,185,
1418   185,185,185,185,185,185,185,185,185,185,
1419   185,185,185,185,185,185,185,185,185,185,
1420   185,185,185,185,185,185,185,185,185,185,
1421   185,185,185,185,185,185,185,185,185,185,
1422   185,185,185,185,185,185,185,185,185,185,
1423   185,185,185,185,185,185,185,185,185,185,
1424   185,185,185,185,185,185,185,185,185,185,
1425   185,185,185,185,185,185,185,185,185,185,
1426   185,185,185,185,185,185,185,185,185,185,
1427   185,185,185,185,185,185,185,185,185,185,
1428   185,185,185,185,185,185,185,185,185,185,
1429   185,185,185,185,185,185,185,185,185,185,
1430   185,185,185,185,185,185,185,185,185,185,
1431   185,185,185,185,185,185,185,185,185,185,
1432   185,185,185,185,185,185,185,185,185,185,
1433   185,185,185,185,185,185,185,185,185,185,
1434   185,185,185,185,185,185,185,185,185,185,
1435   185,186,186,186,186,186,186,186,186,186,
1436   186,186,186,186,186,186,186,186,186,186,
1437   186,186,186,186,186,186,186,186,186,186,
1438   186,186,186,186,186,186,186,186,186,186,
1439   186,186,186,186,186,186,186,186,186,186,
1440   186,186,186,186,186,186,186,186,186,186,
1441   186,186,186,186,186,186,186,186,186,186,
1442   186,186,186,186,186,186,186,186,186,186,
1443   186,186,186,186,186,186,186,186,186,186,
1444   186,186,186,186,186,186,186,186,186,186,
1445   186,186,186,186,186,186,186,186,186,186,
1446   186,186,186,186,186,186,186,186,186,186,
1447   186,186,186,186,186,186,186,186,186,186,
1448   186,186,186,186,186,186,186,186,186,186,
1449   186,186,186,186,186,186,186,186,186,186,
1450   186,186,186,186,186,186,186,186,186,186,
1451   186,186,186,186,186,186,186,186,186,186,
1452   186,186,186,186,186,186,186,186,186,186,
1453   186,186,186,186,186,186,186,186,186,186,
1454   186,186,186,186,186,186,186,186,186,186,
1455   186,186,186,186,186,186,186,186,186,186,
1456   186,186,186,186,186,186,186,186,186,186,
1457   186,186,186,186,186,186,186,186,186,186,
1458   186,186,186,186,186,186,186,186,186,186,
1459   186,186,186,186,186,186,186,186,186,186,
1460   186,186,186,186,186,186,186,187,187,187,
1461   187,187,187,187,187,187,187,187,187,187,
1462   187,187,187,187,187,187,187,187,187,187,
1463   187,187,187,187,187,187,187,187,187,187,
1464   187,187,187,187,187,187,187,187,187,187,
1465   187,187,187,187,187,187,187,187,187,187,
1466   187,187,187,187,187,187,187,187,187,187,
1467   187,187,187,187,187,187,187,187,187,187,
1468   187,187,187,187,187,187,187,187,187,187,
1469   187,187,187,187,187,187,187,187,187,187,
1470   187,187,187,187,187,187,187,187,187,187,
1471   187,187,187,187,187,187,187,187,187,187,
1472   187,187,187,187,187,187,187,187,187,187,
1473   187,187,187,187,187,187,187,187,187,187,
1474   187,187,187,187,187,187,187,187,187,187,
1475   187,187,187,187,187,187,187,187,187,187,
1476   187,187,187,187,187,187,187,187,187,187,
1477   187,187,187,187,187,187,187,187,187,187,
1478   187,187,187,187,187,187,187,187,187,187,
1479   187,187,187,187,187,187,187,187,187,187,
1480   187,187,187,187,187,187,187,187,187,187,
1481   187,187,187,187,187,187,187,187,187,187,
1482   187,187,187,187,187,187,187,187,187,187,
1483   187,187,187,187,187,187,187,187,187,187,
1484   187,187,187,187,187,187,187,187,187,187,
1485   187,187,187,187,187,187,187,187,187,187,
1486   187,187,187,187,187,187,187,187,187,187,
1487   187,187,187,187,187,187,187,187,187,187,
1488   187,187,187,187,187,187,187,187,187,187,
1489   187,187,187,187,187,187,187,187,187,187,
1490   187,187,187,187,187,187,187,187,187,187,
1491   187,187,187,187,187,187,187,187,187,187,
1492   187,187,187,187,187,187,187,187,187,187,
1493   187,187,187,187,187,187,187,187,187,187,
1494   187,187,187,187,187,187,187,187,187,187,
1495   187,187,187,187,187,187,187,187,187,187,
1496   187,187,187,187,187,187,187,187,187,187,
1497   187,187,187,187,187,187,187,187,187,187,
1498   187,187,187,187,187,187,187,187,187,187,
1499   187,187,187,187,187,187,187,187,187,187,
1500   187,187,187,187,187,187,187,187,187,187,
1501   187,187,187,187,187,187,187,187,187,187,
1502   187,187,187,187,187,187,187,187,187,187,
1503   187,187,187,187,187,187,187,187,187,187,
1504   187,187,187,187,187,187,187,187,187,187,
1505   187,187,187,187,187,187,187,187,187,187,
1506   187,187,187,187,187,187,187,187,187,187,
1507   187,187,187,187,187,187,187,187,187,187,
1508   187,187,187,187,187,187,187,187,187,187,
1509   187,187,187,187,187,187,187,187,187,187,
1510   187,187,187,187,187,187,187,187,187,187,
1511   187,187,187,187,187,187,187,187,187,188,
1512   188,188,188,188,188,188,188,188,188,188,
1513   188,188,188,188,188,188,188,188,188,188,
1514   188,188,188,188,188,188,188,188,188,188,
1515   188,188,188,188,188,188,188,188,188,188,
1516   188,188,188,188,188,188,188,188,188,188,
1517   188,188,188,188,188,188,188,188,188,188,
1518   188,188,188,188,188,188,188,188,188,188,
1519   188,188,188,188,188,188,188,188,188,188,
1520   188,188,188,188,188,188,188,188,188,188,
1521   188,188,188,188,188,188,188,188,188,188,
1522   188,188,188,188,188,188,188,188,188,188,
1523   188,188,188,188,188,188,188,188,188,188,
1524   188,188,188,188,188,188,188,188,188,188,
1525   188,188,188,188,188,188,188,188,188,188,
1526   188,188,188,188,188,188,188,188,188,188,
1527   188,188,188,188,188,188,188,188,188,188,
1528   188,188,188,188,188,188,188,188,188,188,
1529   188,188,188,188,188,188,188,188,188,188,
1530   188,188,188,188,188,188,188,188,188,188,
1531   188,188,188,188,188,188,188,188,188,188,
1532   188,188,188,188,188,188,188,188,188,188,
1533   188,188,188,188,188,188,188,188,188,188,
1534   188,188,188,188,188,188,188,188,188,188,
1535   188,188,188,188,188,188,188,188,188,188,
1536   188,188,188,188,188,188,188,188,188,188,
1537   188,188,188,188,188,188,188,188,188,188,
1538   188,188,188,188,188,188,188,188,188,188,
1539   188,188,188,188,188,188,188,188,188,188,
1540   188,188,188,188,188,188,188,188,188,188,
1541   188,188,188,188,188,188,188,188,188,188,
1542   188,188,188,188,188,188,188,188,188,188,
1543   188,188,188,188,188,188,188,188,188,188,
1544   188,188,188,188,188,188,188,188,188,188,
1545   188,188,188,188,188,188,188,188,188,188,
1546   188,188,188,188,188,188,188,188,188,188,
1547   188,188,188,188,188,188,188,188,188,188,
1548   188,188,188,188,188,188,188,188,188,188,
1549   188,188,188,188,188,188,188,188,188,188,
1550   188,188,188,188,188,188,188,188,188,188,
1551   188,188,188,188,188,188,188,188,188,188,
1552   188,188,188,188,188,188,188,188,188,188,
1553   188,188,188,188,188,188,188,188,188,188,
1554   188,188,188,188,188,188,188,188,188,188,
1555   188,188,188,188,188,188,188,188,188,188,
1556   188,188,188,188,188,188,188,188,188,188,
1557   188,188,188,188,188,188,188,188,188,188,
1558   188,188,188,188,188,188,188,188,188,188,
1559   188,188,188,188,188,188,188,188,188,188,
1560   188,188,188,188,188,188,188,188,188,188,
1561   188,188,188,188,188,188,188,188,188,188,
1562   188,188,188,188,188,188,188,188,188,188,
1563   188,189,189,189,189,189,189,189,189,189,
1564   189,189,189,189,189,189,189,189,189,189,
1565   189,189,189,189,189,189,189,189,189,189,
1566   189,189,189,189,189,189,189,189,189,189,
1567   189,189,189,189,189,189,189,189,189,189,
1568   189,189,189,189,189,189,189,189,189,189,
1569   189,189,189,189,189,189,189,189,189,189,
1570   189,189,189,189,189,189,189,189,189,189,
1571   189,189,189,189,189,189,189,189,189,189,
1572   189,189,189,189,189,189,189,189,189,189,
1573   189,189,189,189,189,189,189,189,189,189,
1574   189,189,189,189,189,189,189,189,189,189,
1575   189,189,189,189,189,189,189,189,189,189,
1576   189,189,189,189,189,189,189,189,189,189,
1577   189,189,189,189,189,189,189,189,189,189,
1578   189,189,189,189,189,189,189,189,189,189,
1579   189,189,189,189,189,189,189,189,189,189,
1580   189,189,189,189,189,189,189,189,189,189,
1581   189,189,189,189,189,189,189,189,189,189,
1582   189,189,189,189,189,189,189,189,189,189,
1583   189,189,189,189,189,189,189,189,189,189,
1584   189,189,189,189,189,189,189,189,189,189,
1585   189,189,189,189,189,189,189,189,189,189,
1586   189,189,189,189,189,189,189,189,189,189,
1587   189,189,189,189,189,189,189,189,189,189,
1588   189,189,189,189,189,189,189,189,189,189,
1589   189,189,189,189,189,189,189,189,189,189,
1590   189,189,189,189,189,189,189,189,189,189,
1591   189,189,189,189,189,189,189,189,189,189,
1592   189,189,189,189,189,189,189,189,189,189,
1593   189,189,189,189,189,189,189,189,189,189,
1594   189,189,189,189,189,189,189,189,189,189,
1595   189,189,189,189,189,189,189,189,189,189,
1596   189,189,189,189,189,189,189,189,189,189,
1597   189,189,189,189,189,189,189,189,189,189,
1598   189,189,189,189,189,189,189,189,189,189,
1599   189,189,189,189,189,189,189,189,189,189,
1600   189,189,189,189,189,189,189,189,189,189,
1601   189,189,189,189,189,189,189,189,189,189,
1602   189,189,189,189,189,189,189,189,189,189,
1603   189,189,189,189,189,189,189,189,189,189,
1604   189,189,189,189,189,189,189,189,189,189,
1605   189,189,189,189,189,189,189,189,189,189,
1606   189,189,189,189,189,189,189,189,189,189,
1607   189,189,189,189,189,189,189,189,189,189,
1608   189,189,189,189,189,189,189,189,189,189,
1609   189,189,189,189,189,189,189,189,189,189,
1610   189,189,189,189,189,189,189,189,189,189,
1611   189,189,189,189,189,189,189,189,189,189,
1612   189,189,189,189,189,189,189,189,189,189,
1613   189,189,189,189,189,189,189,189,189,189,
1614   189,189,189,190,190,190,190,190,190,190,
1615   190,190,190,190,190,190,190,190,190,190,
1616   190,190,190,190,190,190,190,190,190,190,
1617   190,190,190,190,190,190,190,190,190,190,
1618   190,190,190,190,190,190,190,190,190,190,
1619   190,190,190,190,190,190,190,190,190,190,
1620   190,190,190,190,190,190,190,190,190,190,
1621   190,190,190,190,190,190,190,190,190,190,
1622   190,190,190,190,190,190,190,190,190,190,
1623   190,190,190,190,190,190,190,190,190,190,
1624   190,190,190,190,190,190,190,190,190,190,
1625   190,190,190,190,190,190,190,190,190,190,
1626   190,190,190,190,190,190,190,190,190,190,
1627   190,190,190,190,190,190,190,190,190,190,
1628   190,190,190,190,190,190,190,190,190,190,
1629   190,190,190,190,190,190,190,190,190,190,
1630   190,190,190,190,190,190,190,190,190,190,
1631   190,190,190,190,190,190,190,190,190,190,
1632   190,190,190,190,190,190,190,190,190,190,
1633   190,190,190,190,190,190,190,190,190,190,
1634   190,190,190,190,190,190,190,190,190,190,
1635   190,190,190,190,190,190,190,190,190,190,
1636   190,190,190,190,190,190,190,190,190,190,
1637   190,190,190,190,190,190,190,190,190,190,
1638   190,190,190,190,190,190,190,190,190,190,
1639   190,190,190,190,190,190,190,190,190,190,
1640   190,190,190,190,190,190,190,190,190,190,
1641   190,190,190,190,190,190,190,190,190,190,
1642   190,190,190,190,190,190,190,190,190,190,
1643   190,190,190,190,190,190,190,190,190,190,
1644   190,190,190,190,190,190,190,190,190,190,
1645   190,190,190,190,190,190,190,190,190,190,
1646   190,190,190,190,190,190,190,190,190,190,
1647   190,190,190,190,190,190,190,190,190,190,
1648   190,190,190,190,190,190,190,190,190,190,
1649   190,190,190,190,190,190,190,190,190,190,
1650   190,190,190,190,190,190,190,190,190,190,
1651   190,190,190,190,190,190,190,190,190,190,
1652   190,190,190,190,190,190,190,190,190,190,
1653   190,190,190,190,190,190,190,190,190,190,
1654   190,190,190,190,190,190,190,190,190,190,
1655   190,190,190,190,190,190,190,190,190,190,
1656   190,190,190,190,190,190,190,190,190,190,
1657   190,190,190,190,190,190,190,190,190,190,
1658   190,190,190,190,190,190,190,190,190,190,
1659   190,190,190,190,190,190,190,190,190,190,
1660   190,190,190,190,190,190,190,190,190,190,
1661   190,190,190,190,190,190,190,190,190,190,
1662   190,190,190,190,190,190,190,190,190,190,
1663   190,190,190,190,190,190,190,190,190,190,
1664   190,190,190,190,190,190,190,190,190,190,
1665   190,190,190,190,190,191,191,191,191,191,
1666   191,191,191,191,191,191,191,191,191,191,
1667   191,191,191,191,191,191,191,191,191,191,
1668   191,191,191,191,191,191,191,191,191,191,
1669   191,191,191,191,191,191,191,191,191,191,
1670   191,191,191,191,191,191,191,191,191,191,
1671   191,191,191,191,191,191,191,191,191,191,
1672   191,191,191,191,191,191,191,191,191,191,
1673   191,191,191,191,191,191,191,191,191,191,
1674   191,191,191,191,191,191,191,191,191,191,
1675   191,191,191,191,191,191,191,191,191,191,
1676   191,191,191,191,191,191,191,191,191,191,
1677   191,191,191,191,191,191,191,191,191,191,
1678   191,191,191,191,191,191,191,191,191,191,
1679   191,191,191,191,191,191,191,191,191,191,
1680   191,191,191,191,191,191,191,191,191,191,
1681   191,191,191,191,191,191,191,191,191,191,
1682   191,191,191,191,191,191,191,191,191,191,
1683   191,191,191,191,191,191,191,191,191,191,
1684   191,191,191,191,191,191,191,191,191,191,
1685   191,191,191,191,191,191,191,191,191,191,
1686   191,191,191,191,191,191,191,191,191,191,
1687   191,191,191,191,191,191,191,191,191,191,
1688   191,191,191,191,191,191,191,191,191,191,
1689   191,191,191,191,191,191,191,191,191,191,
1690   191,191,191,191,191,191,191,191,191,191,
1691   191,191,191,191,191,191,191,191,191,191,
1692   191,191,191,191,191,191,191,191,191,191,
1693   191,191,191,191,191,191,191,191,191,191,
1694   191,191,191,191,191,191,191,191,191,191,
1695   191,191,191,191,191,191,191,191,191,191,
1696   191,191,191,191,191,191,191,191,191,191,
1697   191,191,191,191,191,191,191,191,191,191,
1698   191,191,191,191,191,191,191,191,191,191,
1699   191,191,191,191,191,191,191,191,191,191,
1700   191,191,191,191,191,191,191,191,191,191,
1701   191,191,191,191,191,191,191,191,191,191,
1702   191,191,191,191,191,191,191,191,191,191,
1703   191,191,191,191,191,191,191,191,191,191,
1704   191,191,191,191,191,191,191,191,191,191,
1705   191,191,191,191,191,191,191,191,191,191,
1706   191,191,191,191,191,191,191,191,191,191,
1707   191,191,191,191,191,191,191,191,191,191,
1708   191,191,191,191,191,191,191,191,191,191,
1709   191,191,191,191,191,191,191,191,191,191,
1710   191,191,191,191,191,191,191,191,191,191,
1711   191,191,191,191,191,191,191,191,191,191,
1712   191,191,191,191,191,191,191,191,191,191,
1713   191,191,191,191,191,191,191,191,191,191,
1714   191,191,191,191,191,191,191,191,191,191,
1715   191,191,191,191,191,191,191,191,191,191,
1716   191,191,191,191,191,191,191,191,191,191,
1717   191,191,191,191,191,191,191,191,191,191,
1718   191,191,191,191,191,191,191,191,191,191,
1719   191,191,191,191,191,191,191,191,191,191,
1720   191,191,191,191,191,191,191,191,191,191,
1721   191,191,191,191,191,191,191,191,191,191,
1722   191,191,191,191,191,191,191,191,191,191,
1723   191,191,191,191,191,191,191,191,191,191,
1724   191,191,191,191,191,191,191,191,191,191,
1725   191,191,191,191,191,191,191,191,191,191,
1726   191,191,191,191,191,191,191,191,191,191,
1727   191,191,191,191,191,191,191,191,191,191,
1728   191,191,191,191,191,191,191,191,191,191,
1729   191,191,191,191,191,191,191,191,191,191,
1730   191,191,191,191,191,191,191,191,191,191,
1731   191,191,191,191,191,191,191,191,191,191,
1732   191,191,191,191,191,191,191,191,191,191,
1733   191,191,191,191,191,191,191,191,191,191,
1734   191,191,191,191,191,191,191,191,191,191,
1735   191,191,191,191,191,191,191,191,191,191,
1736   191,191,191,191,191,191,191,191,191,191,
1737   191,191,191,191,191,191,191,191,191,191,
1738   191,191,191,191,191,191,191,191,191,191,
1739   191,191,191,191,191,191,191,191,191,191,
1740   191,191,191,191,191,191,191,191,191,191,
1741   191,191,191,191,191,191,191,191,191,191,
1742   191,191,191,191,191,191,191,191,191,191,
1743   191,191,191,191,191,191,191,191,191,191,
1744   191,191,191,191,191,191,191,191,191,191,
1745   191,191,191,191,191,191,191,191,191,191,
1746   191,191,191,191,191,191,191,191,191,191,
1747   191,191,191,191,191,191,191,191,191,191,
1748   191,191,191,191,191,191,191,191,191,191,
1749   191,191,191,191,191,191,191,191,191,191,
1750   191,191,191,191,191,191,191,191,191,191,
1751   191,191,191,191,191,191,191,191,191,191,
1752   191,191,191,191,191,191,191,191,191,191,
1753   191,191,191,191,191,191,191,191,191,191,
1754   191,191,191,191,191,191,191,191,191,191,
1755   191,191,191,191,191,191,191,191,191,191,
1756   191,191,191,191,191,191,191,191,191,191,
1757   191,191,191,191,191,191,191,191,191,191,
1758   191,191,191,191,191,191,191,191,191,191,
1759   191,191,191,191,191,191,191,191,191,191,
1760   191,191,191,191,191,191,191,191,191,191,
1761   191,191,191,191,191,191,191,191,191,191,
1762   191,191,191,191,191,191,191,191,191,191,
1763   191,191,191,191,191,191,191,191,191,191,
1764   191,191,191,191,191,191,191,191,191,191,
1765   191,191,191,191,191,191,191,191,191,191,
1766   191,191,191,191,191,191,191,191,191,191,
1767   191,191,191,191,191,191,191,191,191,192,
1768   192,192,192,192,192,192,192,192,192,192,
1769   192,192,192,192,192,192,192,192,192,192,
1770   192,192,192,192,192,192,192,192,192,192,
1771   192,192,192,192,192,192,192,192,192,192,
1772   192,192,192,192,192,192,192,192,192,192,
1773   192,192,192,192,192,192,192,192,192,192,
1774   192,192,192,192,192,192,192,192,192,192,
1775   192,192,192,192,192,192,192,192,192,192,
1776   192,192,192,192,192,192,192,192,192,192,
1777   192,192,192,192,192,192,192,192,192,192,
1778   192,192,192,192,192,192,192,192,192,192,
1779   192,192,192,192,192,192,192,192,192,192,
1780   192,192,192,192,192,192,192,192,192,192,
1781   192,192,192,192,192,192,192,192,192,192,
1782   192,192,192,192,192,192,192,192,192,192,
1783   192,192,192,192,192,192,192,192,192,192,
1784   192,192,192,192,192,192,192,192,192,192,
1785   192,192,192,192,192,192,192,192,192,192,
1786   192,192,192,192,192,192,192,192,192,192,
1787   192,192,192,192,192,192,192,192,192,192,
1788   192,192,192,192,192,192,192,192,192,192,
1789   192,192,192,192,192,192,192,192,192,192,
1790   192,192,192,192,192,192,192,192,192,192,
1791   192,192,192,192,192,192,192,192,192,192,
1792   192,192,192,192,192,192,192,192,192,192,
1793   192,192,192,192,192,192,192,192,192,192,
1794   192,192,192,192,192,192,192,192,192,192,
1795   192,192,192,192,192,192,192,192,192,192,
1796   192,192,192,192,192,192,192,192,192,192,
1797   192,192,192,192,192,192,192,192,192,192,
1798   192,192,192,192,192,192,192,192,192,192,
1799   192,192,192,192,192,192,192,192,192,192,
1800   192,192,192,192,192,192,192,192,192,192,
1801   192,192,192,192,192,192,192,192,192,192,
1802   192,192,192,192,192,192,192,192,192,192,
1803   192,192,192,192,192,192,192,192,192,192,
1804   192,192,192,192,192,192,192,192,192,192,
1805   192,192,192,192,192,192,192,192,192,192,
1806   192,192,192,192,192,192,192,192,192,192,
1807   192,192,192,192,192,192,192,192,192,192,
1808   192,192,192,192,192,192,192,192,192,192,
1809   192,192,192,192,192,192,192,192,192,192,
1810   192,192,192,192,192,192,192,192,192,192,
1811   192,192,192,192,192,192,192,192,192,192,
1812   192,192,192,192,192,192,192,192,192,192,
1813   192,192,192,192,192,192,192,192,192,192,
1814   192,192,192,192,192,192,192,192,192,192,
1815   192,192,192,192,192,192,192,192,192,192,
1816   192,192,192,192,192,192,192,192,192,192,
1817   192,192,192,192,192,192,192,192,192,192,
1818   192,192,192,192,192,192,192,192,192,192,
1819   192,192,192,192,192,192,192,192,192,192,
1820   192,192,192,192,192,192,192,192,192,192,
1821   192,192,192,192,192,192,192,192,192,192,
1822   192,192,192,192,192,192,192,192,192,192,
1823   192,192,192,192,192,192,192,192,192,192,
1824   192,192,192,192,192,192,192,192,192,192,
1825   192,192,192,192,192,192,192,192,192,192,
1826   192,192,192,192,192,192,192,192,192,192,
1827   192,192,192,192,192,192,192,192,192,192,
1828   192,192,192,192,192,192,192,192,192,192,
1829   192,192,192,192,192,192,192,192,192,192,
1830   192,192,192,192,192,192,192,192,192,192,
1831   192,192,192,192,192,192,192,192,192,192,
1832   192,192,192,192,192,192,192,192,192,192,
1833   192,192,192,192,192,192,192,192,192,192,
1834   192,192,192,192,192,192,192,192,192,192,
1835   192,192,192,192,192,192,192,192,192,192,
1836   192,192,192,192,192,192,192,192,192,192,
1837   192,192,192,192,192,192,192,192,192,192,
1838   192,192,192,192,192,192,192,192,192,192,
1839   192,192,192,192,192,192,192,192,192,192,
1840   192,192,192,192,192,192,192,192,192,192,
1841   192,192,192,192,192,192,192,192,192,192,
1842   192,192,192,192,192,192,192,192,192,192,
1843   192,192,192,192,192,192,192,192,192,192,
1844   192,192,192,192,192,192,192,192,192,192,
1845   192,192,192,192,192,192,192,192,192,192,
1846   192,192,192,192,192,192,192,192,192,192,
1847   192,192,192,192,192,192,192,192,192,192,
1848   192,192,192,192,192,192,192,192,192,192,
1849   192,192,192,192,192,192,192,192,192,192,
1850   192,192,192,192,192,192,192,192,192,192,
1851   192,192,192,192,192,192,192,192,192,192,
1852   192,192,192,192,192,192,192,192,192,192,
1853   192,192,192,192,192,192,192,192,192,192,
1854   192,192,192,192,192,192,192,192,192,192,
1855   192,192,192,192,192,192,192,192,192,192,
1856   192,192,192,192,192,192,192,192,192,192,
1857   192,192,192,192,192,192,192,192,192,192,
1858   192,192,192,192,192,192,192,192,192,192,
1859   192,192,192,192,192,192,192,192,192,192,
1860   192,192,192,192,192,192,192,192,192,192,
1861   192,192,192,192,192,192,192,192,192,192,
1862   192,192,192,192,192,192,192,192,192,192,
1863   192,192,192,192,192,192,192,192,192,192,
1864   192,192,192,192,192,192,192,192,192,192,
1865   192,192,192,192,192,192,192,192,192,192,
1866   192,192,192,192,192,192,192,192,192,192,
1867   192,192,192,192,192,192,192,192,192,192,
1868   192,192,192,192,192,192,192,192,192,192,
1869   192,192,192,192,192,192,192,192,192,192,
1870   192,192,192,193,193,193,193,193,193,193,
1871   193,193,193,193,193,193,193,193,193,193,
1872   193,193,193,193,193,193,193,193,193,193,
1873   193,193,193,193,193,193,193,193,193,193,
1874   193,193,193,193,193,193,193,193,193,193,
1875   193,193,193,193,193,193,193,193,193,193,
1876   193,193,193,193,193,193,193,193,193,193,
1877   193,193,193,193,193,193,193,193,193,193,
1878   193,193,193,193,193,193,193,193,193,193,
1879   193,193,193,193,193,193,193,193,193,193,
1880   193,193,193,193,193,193,193,193,193,193,
1881   193,193,193,193,193,193,193,193,193,193,
1882   193,193,193,193,193,193,193,193,193,193,
1883   193,193,193,193,193,193,193,193,193,193,
1884   193,193,193,193,193,193,193,193,193,193,
1885   193,193,193,193,193,193,193,193,193,193,
1886   193,193,193,193,193,193,193,193,193,193,
1887   193,193,193,193,193,193,193,193,193,193,
1888   193,193,193,193,193,193,193,193,193,193,
1889   193,193,193,193,193,193,193,193,193,193,
1890   193,193,193,193,193,193,193,193,193,193,
1891   193,193,193,193,193,193,193,193,193,193,
1892   193,193,193,193,193,193,193,193,193,193,
1893   193,193,193,193,193,193,193,193,193,193,
1894   193,193,193,193,193,193,193,193,193,193,
1895   193,193,193,193,193,193,193,193,193,193,
1896   193,193,193,193,193,193,193,193,193,193,
1897   193,193,193,193,193,193,193,193,193,193,
1898   193,193,193,193,193,193,193,193,193,193,
1899   193,193,193,193,193,193,193,193,193,193,
1900   193,193,193,193,193,193,193,193,193,193,
1901   193,193,193,193,193,193,193,193,193,193,
1902   193,193,193,193,193,193,193,193,193,193,
1903   193,193,193,193,193,193,193,193,193,193,
1904   193,193,193,193,193,193,193,193,193,193,
1905   193,193,193,193,193,193,193,193,193,193,
1906   193,193,193,193,193,193,193,193,193,193,
1907   193,193,193,193,193,193,193,193,193,193,
1908   193,193,193,193,193,193,193,193,193,193,
1909   193,193,193,193,193,193,193,193,193,193,
1910   193,193,193,193,193,193,193,193,193,193,
1911   193,193,193,193,193,193,193,193,193,193,
1912   193,193,193,193,193,193,193,193,193,193,
1913   193,193,193,193,193,193,193,193,193,193,
1914   193,193,193,193,193,193,193,193,193,193,
1915   193,193,193,193,193,193,193,193,193,193,
1916   193,193,193,193,193,193,193,193,193,193,
1917   193,193,193,193,193,193,193,193,193,193,
1918   193,193,193,193,193,193,193,193,193,193,
1919   193,193,193,193,193,193,193,193,193,193,
1920   193,193,193,193,193,193,193,193,193,193,
1921   193,193,193,193,193,193,193,193,193,193,
1922   193,193,193,193,193,193,193,193,193,193,
1923   193,193,193,193,193,193,193,193,193,193,
1924   193,193,193,193,193,193,193,193,193,193,
1925   193,193,193,193,193,193,193,193,193,193,
1926   193,193,193,193,193,193,193,193,193,193,
1927   193,193,193,193,193,193,193,193,193,193,
1928   193,193,193,193,193,193,193,193,193,193,
1929   193,193,193,193,193,193,193,193,193,193,
1930   193,193,193,193,193,193,193,193,193,193,
1931   193,193,193,193,193,193,193,193,193,193,
1932   193,193,193,193,193,193,193,193,193,193,
1933   193,193,193,193,193,193,193,193,193,193,
1934   193,193,193,193,193,193,193,193,193,193,
1935   193,193,193,193,193,193,193,193,193,193,
1936   193,193,193,193,193,193,193,193,193,193,
1937   193,193,193,193,193,193,193,193,193,193,
1938   193,193,193,193,193,193,193,193,193,193,
1939   193,193,193,193,193,193,193,193,193,193,
1940   193,193,193,193,193,193,193,193,193,193,
1941   193,193,193,193,193,193,193,193,193,193,
1942   193,193,193,193,193,193,193,193,193,193,
1943   193,193,193,193,193,193,193,193,193,193,
1944   193,193,193,193,193,193,193,193,193,193,
1945   193,193,193,193,193,193,193,193,193,193,
1946   193,193,193,193,193,193,193,193,193,193,
1947   193,193,193,193,193,193,193,193,193,193,
1948   193,193,193,193,193,193,193,193,193,193,
1949   193,193,193,193,193,193,193,193,193,193,
1950   193,193,193,193,193,193,193,193,193,193,
1951   193,193,193,193,193,193,193,193,193,193,
1952   193,193,193,193,193,193,193,193,193,193,
1953   193,193,193,193,193,193,193,193,193,193,
1954   193,193,193,193,193,193,193,193,193,193,
1955   193,193,193,193,193,193,193,193,193,193,
1956   193,193,193,193,193,193,193,193,193,193,
1957   193,193,193,193,193,193,193,193,193,193,
1958   193,193,193,193,193,193,193,193,193,193,
1959   193,193,193,193,193,193,193,193,193,193,
1960   193,193,193,193,193,193,193,193,193,193,
1961   193,193,193,193,193,193,193,193,193,193,
1962   193,193,193,193,193,193,193,193,193,193,
1963   193,193,193,193,193,193,193,193,193,193,
1964   193,193,193,193,193,193,193,193,193,193,
1965   193,193,193,193,193,193,193,193,193,193,
1966   193,193,193,193,193,193,193,193,193,193,
1967   193,193,193,193,193,193,193,193,193,193,
1968   193,193,193,193,193,193,193,193,193,193,
1969   193,193,193,193,193,193,193,193,193,193,
1970   193,193,193,193,193,193,193,193,193,193,
1971   193,193,193,193,193,193,193,193,193,193,
1972   193,193,193,193,193,193,193,193,193,193,
1973   193,193,193,193,193,193,193,193,193,193,
1974   193,193,193,193,193,193,193,193,193,193,
1975   193,193,193,193,193,193,193,193,193,193,
1976   193,193,193,193,193,193,193,193,193,193,
1977   193,193,193,193,193,193,193,193,193,193,
1978   193,193,193,193,193,193,193,193,193,193,
1979   193,193,193,193,193,193,193,193,193,193,
1980   193,193,193,193,193,193,193,193,193,193,
1981   193,193,193,193,193,193,193,193,193,193,
1982   193,193,193,193,193,193,193,193,193,193,
1983   193,193,193,193,193,193,193,193,193,193,
1984   193,193,193,193,193,193,193,193,193,193,
1985   193,193,193,193,193,193,193,193,193,193,
1986   193,193,193,193,193,193,193,193,193,193,
1987   193,193,193,193,193,193,193,193,193,193,
1988   193,193,193,193,193,193,193,193,193,193,
1989   193,193,193,193,193,193,193,193,193,193,
1990   193,193,193,193,193,193,193,193,193,193,
1991   193,193,193,193,193,193,193,193,193,193,
1992   193,193,193,193,193,193,193,193,193,193,
1993   193,193,193,193,193,193,193,193,193,193,
1994   193,193,193,193,193,193,193,193,193,193,
1995   193,193,193,193,193,193,193,193,193,193,
1996   193,193,193,193,193,193,193,193,193,193,
1997   193,193,193,193,193,193,193,193,193,193,
1998   193,193,193,193,193,193,193,193,193,193,
1999   193,193,193,193,193,193,193,193,193,193,
2000   193,193,193,193,193,193,193,193,193,193,
2001   193,193,193,193,193,193,193,193,193,193,
2002   193,193,193,193,193,193,193,193,193,193,
2003   193,193,193,193,193,193,193,193,193,193,
2004   193,193,193,193,193,193,193,193,193,193,
2005   193,193,193,193,193,193,193,193,193,193,
2006   193,193,193,193,193,193,193,193,193,193,
2007   193,193,193,193,193,193,193,193,193,193,
2008   193,193,193,193,193,193,193,193,193,193,
2009   193,193,193,193,193,193,193,193,193,193,
2010   193,193,193,193,193,193,193,193,193,193,
2011   193,193,193,193,193,193,193,193,193,193,
2012   193,193,193,193,193,193,193,193,193,193,
2013   193,193,193,193,193,193,193,193,193,193,
2014   193,193,193,193,193,193,193,193,193,193,
2015   193,193,193,193,193,193,193,193,193,193,
2016   193,193,193,193,193,193,193,193,193,193,
2017   193,193,193,193,193,193,193,193,193,193,
2018   193,193,193,193,193,193,193,193,193,193,
2019   193,193,193,193,193,193,193,193,193,193,
2020   193,193,193,193,193,193,193,193,193,193,
2021   193,193,193,193,193,193,193,193,193,193,
2022   193,193,193,193,193,193,193,193,193,193,
2023   193,193,193,193,193,193,193,193,193,193,
2024   193,193,193,193,193,193,193,193,193,193,
2025   193,193,193,193,193,193,193,193,193,193,
2026   193,193,193,193,193,193,193,193,193,193,
2027   193,193,193,193,193,193,193,193,193,193,
2028   193,193,193,193,193,193,193,193,193,193,
2029   193,193,193,193,193,193,193,193,193,193,
2030   193,193,193,193,193,193,193,193,193,193,
2031   193,193,193,193,193,193,193,193,193,193,
2032   193,193,193,193,193,193,193,193,193,193,
2033   193,193,193,193,193,193,193,193,193,193,
2034   193,193,193,193,193,193,193,193,193,193,
2035   193,193,193,193,193,193,193,193,193,193,
2036   193,193,193,193,193,193,193,193,193,193,
2037   193,193,193,193,193,193,193,193,193,193,
2038   193,193,193,193,193,193,193,193,193,193,
2039   193,193,193,193,193,193,193,193,193,193,
2040   193,193,193,193,193,193,193,193,193,193,
2041   193,193,193,193,193,193,193,193,193,193,
2042   193,193,193,193,193,193,193,193,193,193,
2043   193,193,193,193,193,193,193,193,193,193,
2044   193,193,193,193,193,193,193,193,193,193,
2045   193,193,193,193,193,193,193,193,193,193,
2046   193,193,193,193,193,193,193,193,193,193,
2047   193,193,193,193,193,193,193,193,193,193,
2048   193,193,193,193,193,193,193,193,193,193,
2049   193,193,193,193,193,193,193,193,193,193,
2050   193,193,193,193,193,193,193,193,193,193,
2051   193,193,193,193,193,193,193,193,193,193,
2052   193,193,193,193,193,193,193,193,193,193,
2053   193,193,193,193,193,193,193,193,193,193,
2054   193,193,193,193,193,193,193,193,193,193,
2055   193,193,193,193,193,193,193,193,193,193,
2056   193,193,193,193,193,193,193,193,193,193,
2057   193,193,193,193,193,193,193,193,193,193,
2058   193,193,193,193,193,193,193,193,193,193,
2059   193,193,193,193,193,193,193,193,193,193,
2060   193,193,193,193,193,193,193,193,193,193,
2061   193,193,193,193,193,193,193,193,193,193,
2062   193,193,193,193,193,193,193,193,193,193,
2063   193,193,193,193,193,193,193,193,193,193,
2064   193,193,193,193,193,193,193,193,193,193,
2065   193,193,193,193,193,193,193,193,193,193,
2066   193,193,193,193,193,193,193,193,193,193,
2067   193,193,193,193,193,193,193,193,193,193,
2068   193,193,193,193,193,193,193,193,193,193,
2069   193,193,193,193,193,193,193,193,193,193,
2070   193,193,193,193,193,193,193,193,193,193,
2071   193,193,193,193,193,193,193,193,193,193,
2072   193,193,193,193,193,193,193,193,193,193,
2073   193,193,193,193,193,193,193,193,193,193,
2074   193,193,193,193,193,193,193,193,193,193,
2075   193,194};
2076 treal c0_1[768] = {
2077   4.758132187241876e-10,-1.277407818568957e-07,7.842343643041684e-06,-3.249730423203469e-05,-6.659405609327934e-08,1.636513989427078e-07,1.51730024076664e-05,0.0002928390839064367,1.3652402880314968e-06,-4.934196472261609e-06,
2078   -0.00010655714626325138,-0.00031986944119434904,-8.036914681457448e-05,4.732112257809819e-05,0.00043423711699868344,0.0003528011907137261,0.001031708537008783,-0.0007217221450096626,-0.0017168518954382972,-0.0003887246361204182,
2079   -0.011789414681082473,0.004214428952438226,0.0038533674452996126,-0.0007775134306049452,-0.10092424815904007,-0.052191358272135085,-0.07266093345089891,-0.03173443910946691,-0.18705435381703153,-0.17290794644579432,
2080   -0.16240884029350022,-0.07539774672947357,-0.3823221169606225,-0.3966456884425172,-0.38949193426340206,-0.17949243495638517,-0.5000679827535931,-0.6252955044415826,-0.593217758944445,-0.2759304445750457,
2081   -0.7443466542453533,-0.9243638742042699,-0.9021451581799735,-0.423001208804493,-0.9513162022909202,-1.3695244285706374,-1.3594359391593827,-0.6454778178096151,-1.0673903359450871,-1.6539943362233507,
2082   -1.6608079056117337,-0.7955295374202644,-1.216663740339414,-1.973173626520795,-2.022349151630617,-0.9785620193218263,-1.3536298863545688,-2.3369898014427184,-2.4519685881432873,-1.2009504160162128,
2083   -1.4738143026995427,-2.741762649671241,-2.958197830421928,-1.4699117749153536,-1.562815057862952,-3.1824739689744574,-3.54870147150378,-1.793472544837961,-1.6084985603056616,-3.6497989804878825,
2084   -4.229714454817882,-2.1803590302130664,-1.5923057425051776,-4.130784625227007,-5.00525116016424,-2.639814348749391,-1.5353024599628842,-4.606928168703397,-5.876190582689012,-3.1813346835435867,
2085   -1.4872167535380243,-4.836477159855271,-6.346830564655231,-3.485824828023705,-1.4124784494678153,-5.05883667161364,-6.83999274092102,-3.8143349116087966,-1.324190681413058,-5.270021771328088,
2086   -7.354761892745586,-4.167966237668229,-1.2201526402987273,-5.4680066263894345,-7.889923237157122,-4.547766221100498,-1.1028492821842337,-5.650436352737062,-8.444043665236556,-4.9547164302671085,
2087   -0.9740272918787632,-5.81532760167317,-9.01547385942861,-5.389721468813564,-0.8360551749729735,-5.960958178081245,-9.602379825462982,-5.853599031711619,-0.69144153101802,-6.085960011249016,
2088   -10.202773556549424,-6.347071426983463,-0.5428328314153126,-6.189340100856591,-10.814549374952538,-6.870758796956554,-0.3928779618852645,-6.270501130728513,-11.435522344819686,-7.425174202459737,
2089   -0.24413338870808318,-6.329241829807929,-12.063467730346302,-8.010720655868898,-0.09897088159728572,-6.365743154169634,-12.69615978327045,-8.627690109823265,0.04049532423209753,-6.380540672324211,
2090   -13.331408465448215,-9.27626433328757,0.17246210672753484,-6.374486060242061,-13.967092876159606,-9.956517540185265,0.29546987712551875,-6.348700585624777,-14.601190442156671,-10.668420581708274,
2091   0.40841482060540657,-6.304523744918373,-15.231801229637322,-11.41184647384948,0.5105430853054584,-6.243460070179188,-15.857167045355334,-12.186577007501413,0.6014300835524821,-6.167126804762385,
2092   -16.475685278957762,-12.992310179113149,0.6809486620060904,-6.077204673763392,-17.08591768408543,-13.828668183819053,0.7492295828039622,-5.97539341346391,-17.686594489650922,-14.69520572786125,
2093   0.8066190487374586,-5.8633732093941875,-18.276614372948107,-15.591418440346017,0.8536317621973758,-5.742772484970126,-18.855040905564877,-16.516751193136336,0.8909188387291441,-5.615142708468424,
2094   -19.421096138378747,-17.47060616941952,0.919189347906291,-5.4819379973697275,-19.97415191450633,-18.452350553961754,0.9393216829518062,-5.344506453428517,-20.51371973393187,-19.461323749469692,
2095   0.9517882073269205,-5.204064846441286,-21.03943892458501,-20.496844052518632,0.9586669931621209,-5.061759321321873,-21.551066577225633,-21.558214748292713,0.9568019924633494,-4.918425322406581,
2096   -22.048458540963445,-22.64472960545432,0.9390996294140703,-4.632315011468424,-23.000437218592587,-24.89034807690646,0.9074117420140406,-4.35149819765534,-23.895906922501812,-27.228030826813868,
2097   0.8668130679370982,-4.080156940319346,-24.7363397714617,-29.65221171452345,0.8206147406307873,-3.820955811615341,-25.523890328428188,-32.15750785854976,0.7715526841311134,-3.5755692630382034,
2098   -26.261145652462595,-34.73877432966058,0.7216089208322907,-3.3448536289772783,-26.950945060997334,-37.39113799281977,0.6722170809183882,-3.1290725641996744,-27.59623950739642,-40.11001526963585,
2099   0.624359607369657,-2.928061028318213,-28.199989774501496,-42.89111792041162,0.57867743706858,-2.7413602032688615,-28.76509446149904,-45.730450211511304,0.5355531113256744,-2.568319613097924,
2100   -29.29434159769127,-48.624300136579166,0.4951858346738723,-2.408174391398717,-29.79037813685116,-51.56922674710293,0.45762467013713537,-2.2601001040887962,-30.255692617788498,-54.562045135640396,
2101   0.42288693506746533,-2.1232576458819254,-30.692607764522457,-57.59981020252892,0.39070120887578375,-1.996802733123713,-31.103278507757565,-60.67980001382201,0.361604477451065,-1.8799722444375744,
2102   -31.489699558648727,-63.799499310830555,0.3329489110164922,-1.7718424847850052,-31.85369749339958,-66.95658354589249,0.31387788500953867,-1.67228153360826,-32.196993668774795,-70.14890368197416,
2103   0.2769571725739628,-1.5784233477097496,-32.52101061679124,-73.37447189440188,0.2370414298576837,-1.4127876082655146,-33.11731392958875,-79.91812832962906,0.2053914303716691,-1.2710236952803367,
2104   -33.65233656583274,-86.57439258604857,0.17827157083626777,-1.148188236176871,-34.134610838800846,-93.33193145856792,0.1555294279964258,-1.0415719561833863,-34.57114349268408,-100.18094581409619,
2105   0.13624319417159467,-0.9485567380826627,-34.967879246447495,-107.11292686455853,0.11986609364233064,-0.8670757567412967,-35.32982886732716,-114.12045416837498,0.10588933926891464,-0.795389189210945,
2106   -35.66124426038084,-121.19702838329417,0.09392616261924326,-0.732061495452141,-35.96574431631303,-128.3369326803239,0.08360125461384792,-0.6758884443843154,-36.246421682682126,-135.5351176770351,
2107   0.07481172149803667,-0.6258902605577801,-36.50593362139564,-142.78710563173624,0.06671196217014098,-0.5811487046909998,-36.74655902169238,-150.08891041047778,0.06144571340761554,-0.5412512538283535,
2108   -36.97031148295289,-157.43697038737002,0.05205463381114172,-0.5045033116055148,-37.178784546511196,-164.82809197337897,0.0425475829025917,-0.4422401993511847,-37.55625460814311,-179.72830677001144,
2109   0.035583294235618006,-0.39134857383277627,-37.88860946661102,-194.76972517071823,0.029938266180490333,-0.3487870095461223,-38.183704200338525,-209.93600608474796,0.025448839154870645,-0.3129775245604282,
2110   -38.447552113299224,-225.2135343358435,0.02180602146999261,-0.28253789194691503,-38.68498626348911,-240.59085180326693,0.01882159126876444,-0.25645547308806066,-38.89988486734999,-256.05822718268286,
2111   0.016389229604109032,-0.23394276357167235,-39.095408417787716,-271.6073263844652,0.014251730784279671,-0.21433942823163535,-39.27414014883227,-287.2309569721039,0.01288740242120183,-0.19729277842021803,
2112   -39.438259398255525,-302.92286778557286,0.010593037750441023,-0.1818780165657937,-39.58943616545382,-318.6775901946797,0.008378973144853608,-0.1565371218065303,-39.85929084448825,-350.35677050913574,
2113   0.006851161526608891,-0.13649276043855635,-40.09295499202336,-382.23614429322754,0.005664009912174691,-0.12010326317491435,-40.29756651716601,-414.28987284372425,0.0047596828494130715,-0.10655369576268947,
2114   -40.47830441559222,-446.4969406374878,0.004052674412552565,-0.09516747917251202,-40.639158339498834,-478.8399730620576,0.0034945094504017136,-0.0854725835059901,-40.78320203201602,-511.30439002885726,
2115   0.003053968967146449,-0.07711294217324828,-40.91284890614476,-543.8777869089324,0.002684662635651774,-0.06980717134360194,-41.030004067310074,-576.5494729676333,0.0023932127670595366,-0.06338486313353768,
2116   -41.13621235895637,-609.3101212165715,0.0015596372184436913,-0.051934672112731325,-41.32012562193839,-675.0662553138166,0.0028810043990807857,-0.04447267612134229,-41.4738774554964,-741.0899553833864,
2117   -0.0031306627025035646,-0.030688673647634238,-41.59374586336524,-807.3345221460247,0.008388011487938994,-0.045667152142642144,-41.715519238871714,-873.7595832397402,-0.19930101332082575,0.034596780211041595,
2118   -41.750829617464845,-1007.0090210893836,2.433625142411732,-0.44217542838109075,-42.07583577945931,-1040.380489140858,48.971722589839835,2.4687100074225015,-41.26784911401392,-1057.0723247039582,
2119   -43.20498994073569,17.11261218125022,-39.31606312133157,-1061.1127104170844,-0.7968980419427997,4.193122878976662,-37.192394716630716,-1064.9043421337747,-2.14365943913158,3.716533682126714,
2120   -35.61559037889096,-1072.1583871741286,-0.6441709722819802,2.4345065260242746,-34.389369391051865,-1079.127703293355,-0.5868080515311245,2.049256581670718,-33.49552310796814,-1085.8916396158936,
2121   -0.3875586308209203,1.6983128432440453,-32.74843836673607,-1092.4922418829885,-0.25912851530469183,1.4665313017247528,-32.11752096374823,-1098.9562798141626,-0.16048282422165924,1.1565848732233068,
2122   -31.0716750585307,-1111.5449485499355,-0.11489892294922227,0.9646296260563116,-30.22593916648484,-1123.7596531036963,-0.0846634234717707,0.8271977777516207,-29.511531100602596,-1135.6647846865267,
2123   -0.06545837616447249,0.7259309384038725,-28.8922930647199,-1147.3050096666695,-0.05191907988992061,0.6476354645004063,-28.344647172501556,-1158.7132228313324,-0.04212521232173599,0.5855344897619047,
2124   -27.852977852088003,-1169.914675687671,-0.034826883286433616,0.5351480662776548,-27.4061576641465,-1180.9293493299783,-0.028909545824213956,0.4934912533337983,-26.996035447435045,-1191.7734212375267,
2125   -0.02526236103962193,0.4589122319270726,-26.61630873357926,-1202.4602228522433,-0.019520877469643566,0.428695647810353,-26.262416261973208,-1213.0008917346343,-0.014146475223449013,0.3819973811543961,
2126   -25.615963777078623,-1233.6800405563704,-0.010428608822282597,0.34815587616806454,-25.033734288621403,-1253.870671945005,-0.007361956267790338,0.3232083318585971,-24.498383613283366,-1273.6166626304837,
2127   -0.004745205058638106,0.305596900331639,-23.996969773098773,-1292.9500690089515,-0.002320590723947715,0.29424531782669927,-23.51865124978753,-1311.893515947133,6.998293164097783e-05,0.28869395034361506,
2128   -23.053811261052765,-1330.4615368615189,0.002564141393466003,0.2888613650312088,-22.59326447521829,-1348.661208778152,0.0052742266236749874,0.2949953597105903,-22.12769289997762,-1366.4922662715633,
2129   0.008288885683037095,0.30761247908236716,-21.647169050769094,-1383.946799155879,0.011655771958827514,0.327441331269424,-21.14077254916363,-1401.0086076005714,0.015347815312938098,0.3553245218616905,
2130   -20.596330119553233,-1417.65229633277,0.019208550271511072,0.39203989867733363,-20.00037632506185,-1433.8422409694233,0.02288213382428557,0.4379910094328972,-19.338503675469234,-1449.5316644236761,
2131   0.02575399262336515,0.49273014647453195,-18.596339894008523,-1464.6622247985301,0.02699035030290703,0.5543394064502524,-17.76139905923897,-1479.164715930211,0.02674548419601983,0.5866228572721445,
2132   -17.306493278504565,-1486.1564189985259,0.02610752961738128,0.6186134210869795,-16.82596121569326,-1492.9616330814902,0.02458558314876305,0.6498409205089875,-16.320223882446932,-1499.5702123602714,
2133   0.022238045617284232,0.6792480032479301,-15.790311322013478,-1505.9722847297862,0.019039954330748825,0.7058471708764904,-15.238068867016892,-1512.1585531470448,0.015065685132781413,0.72862106682039,
2134   -14.666141193020682,-1518.120614869245,0.010444388317418436,0.7466412962588302,-14.077948753706217,-1523.8512786050258,0.005364981759812201,0.7591339424388913,-13.477590720535563,-1529.344856206654,
2135   5.626542738983064e-05,0.765551055327737,-12.869693298038676,-1534.5974049326608,-0.00523541868359845,0.7656183550158747,-12.259210516797047,-1539.6068991294126,-0.010272151508455337,0.7593562139281482,
2136   -11.651197641224528,-1544.3733163208788,-0.014847987524013714,0.747069582063925,-11.05058022850793,-1548.8986312654881,-0.018805983820875314,0.7293097430971838,-10.461942452372023,-1553.1867210301098,
2137   -0.02204823059374292,0.7068157018185445,-9.889354043864518,-1557.2431928266783,-0.024531787744151757,0.6804435739989891,-9.336248753696605,-1561.0751528025348,-0.026278125446918002,0.6511008365271409,
2138   -8.805357181808215,-1564.6909373402355,-0.02730153682087663,0.6196692855825904,-8.298696538496241,-1568.0998286265044,-0.027770088184381175,0.5870136211904199,-7.817587699704714,-1571.311773848647,
2139   -0.02682844206244422,0.5205814136674581,-6.934383407871695,-1577.1863978333915,-0.02467025269423413,0.4564018324296692,-6.155329901088271,-1582.3985123476052,-0.022015597233066158,0.3973851186279088,
2140   -5.474514011026212,-1587.0291187958235,-0.019242302436464593,0.3447189292223032,-4.882754875764231,-1591.153017984893,-0.016602655309313468,0.2986870758053675,-4.369698273714283,-1594.8371262269575,
2141   -0.01420543131965738,0.25896984352229346,-3.925018612809365,-1598.1400507581184,-0.012130710582860318,0.22498730248335558,-3.5391076842087386,-1601.1124235593193,-0.010244457455243031,0.19596795340923867,
2142   -3.2034349184656947,-1603.7976243131725,-0.009023080299305116,0.17146093999580522,-2.910444461316857,-1606.2326529675643,-0.006977522343578057,0.14987573151681596,-2.6542082752818588,-1608.4490126154064,
2143   -0.005051171062352146,0.11649217081315302,-2.229400891462962,-1612.3290864112505,-0.0037917873941223728,0.09232512877711892,-1.8963760413998256,-1615.608766235762,-0.002865646205514306,0.0741835366167481,
2144   -1.6308256131747267,-1618.413692025501,-0.0022096286505687637,0.060473014550837936,-1.416073397479023,-1620.8374993681507,-0.001707876074498925,0.04990117134395709,-1.2400470491804012,-1622.9510275607652,
2145   -0.0014083409577640446,0.041729934936546156,-1.0939124353813559,-1624.8086799025677,-0.0009903018095198516,0.03499180734054603,-0.9715554909684919,-1626.4528426366505,-0.0006461640125836153,0.02551572143349606,
2146   -0.7785589266301509,-1629.2278825654937,-0.00045485040217716123,0.019332651146817235,-0.6355092599268627,-1631.472574814074,-0.0003218345015424164,0.01498023914024238,-0.5260638723511945,-1633.3176884022605,
2147   -0.00024912556479836443,0.0119006412286247,-0.440323838628202,-1634.853675668811,-0.00016019485748280127,0.009516786901612763,-0.372010190230245,-1636.1451556128413,-9.450151686048652e-05,0.006451013989189905,
2148   -0.2701474708495888,-1638.1726066976096,-6.24634070532337e-05,0.004642465355817846,-0.19937930551465466,-1639.6579564272442,-4.1724745556267604e-05,0.003447054814115491,-0.1477741703661629,-1640.7571393392832,
2149   -3.099778109578605e-05,0.0026485360806544323,-0.10888882422367227,-1641.570383108307,-1.8922451071226797e-05,0.0020553075643215844,-0.07888179266714404,-1642.1652781348098,-1.0407470208263524e-05,0.0013310403956699026,
2150   -0.03567701896877518,-1642.876428999755,-7.0151441709385675e-06,0.0009326887787365337,-0.006795194699637968,-1643.1365629417298,-3.6965334785274006e-06,0.0006641802970792673,0.013578484515157922,-1643.0860059641059,
2151   -1.7553825060999973e-06,0.0003812066139933353,0.040253655202721984,-1642.3684795110685,-1.0198267500457514e-06,0.00024683016214699296,0.05627928937143526,-1641.1222799119394,-6.51456320227278e-07,0.00016876130838269098,
2152   0.06688394999541464,-1639.5424277680972,-3.360576856798921e-07,0.00011889161414749654,0.07422399866638607,-1637.7366879361261,-1.653971536144579e-07,6.744044693985803e-05,0.08373328079231387,-1633.6837531836497,
2153   -7.256835212030929e-08,4.2117780716443815e-05,0.08932448227380227,-1629.2568407564909,-2.479725332251944e-08,1.989703363624556e-05,0.09565421814668884,-1619.778043861927};
2154 maptype *map_1[2] = {a0_1};
2155 treal *t_1[2] = {t0_1};
2156 treal *c_1[1] = {c0_1};
2157 splinecoeffs<maptype> sc[2] = {
2158 	{x0_0, xe_0, hi_0, k_0, n_0, nmap_0, map_0, t_0, c_0, splinedata<unsigned char>::splev_pp<4>},
2159 	{x0_1, xe_1, hi_1, k_1, n_1, nmap_1, map_1, t_1, c_1, splinedata<unsigned char>::splev_pp<4>},
2160 };
2161 splinedata<maptype> sd = {
2162 	sc,
2163 	2, /* number of calculated values */
2164 	2, /* number of input values */
2165 	2, /* number of output values */
2166 	0, /* number of state values */
2167 	"nonlin_1",
2168 };
2169 }; /* ! namespace nonlin_1 */
2170 } // namespace AmpData
2171 
2172 // nonlin_1: 18904 bytes
2173 // data size sum: 18920 bytes
2174 #ifndef NO_INTPP_INCLUDES
2175 #include "intpp.h"
2176 #endif
2177 namespace AmpData {
2178 namespace nonlin_2 {
2179 typedef unsigned char maptype;
2180 real x0_0[1] = {-4.75089365365};
2181 real xe_0[1] = {11.2145908347};
2182 real hi_0[1] = {28.1858029632};
2183 int k_0[1] = {4};
2184 int nmap_0[1] = {451};
2185 int n_0[1] = {61};
2186 treal t0_0[65] = {
2187   -22.880588261487706,-22.880588261487706,-22.880588261487706,-22.880588261487706,-4.7154147992349715,-4.431583963887272,-4.1477531285395735,-3.863922293191875,-3.7220068755180256,-3.580091457844176,
2188   -3.438176040170326,-3.2962606224964768,-3.1543452048226275,-3.012429787148778,-2.870514369474929,-2.728598951801079,-2.5866835341272294,-2.44476811645338,-2.302852698779531,-2.160937281105681,
2189   -2.0190218634318313,-1.877106445757982,-1.7351910280841325,-1.593275610410283,-1.4513601927364337,-1.3094447750625842,-1.0256139397148851,-0.7417831043671862,-0.4579522690194872,-0.17412143367178823,
2190   -0.13864257925332585,-0.10316372483486348,-0.032206015997938736,0.10970940167591076,0.2516248193497602,0.39354023702360974,0.6773710723713087,0.9612019077190077,1.2450327430667065,1.5288635784144056,
2191   1.8126944137621046,2.0965252491098036,2.3803560844575027,2.6641869198052017,2.9480177551529003,3.2318485905005994,3.5156794258482984,3.799510261195997,4.0833410965436965,4.367171931891395,
2192   4.651002767239094,4.934833602586793,5.218664437934493,5.502495273282191,6.070156943977589,6.637818614672987,7.2054802853683855,7.7731419560637836,8.90846529745458,10.043788638845376,
2193   11.179111980236172,13.449758663017763,13.449758663017763,13.449758663017763,13.449758663017763};
2194 maptype a0_0[450] = {
2195   3,4,4,4,4,4,4,4,4,5,
2196   5,5,5,5,5,5,5,6,6,6,
2197   6,6,6,6,6,7,7,7,7,8,
2198   8,8,8,9,9,9,9,10,10,10,
2199   10,11,11,11,11,12,12,12,12,13,
2200   13,13,13,14,14,14,14,15,15,15,
2201   15,16,16,16,16,17,17,17,17,18,
2202   18,18,18,19,19,19,19,20,20,20,
2203   20,21,21,21,21,22,22,22,22,23,
2204   23,23,23,24,24,24,24,25,25,25,
2205   25,25,25,25,25,26,26,26,26,26,
2206   26,26,26,27,27,27,27,27,27,27,
2207   27,28,28,28,28,28,28,28,28,29,
2208   30,31,31,32,32,32,32,33,33,33,
2209   33,34,34,34,34,35,35,35,35,35,
2210   35,35,35,36,36,36,36,36,36,36,
2211   36,37,37,37,37,37,37,37,37,38,
2212   38,38,38,38,38,38,38,39,39,39,
2213   39,39,39,39,39,40,40,40,40,40,
2214   40,40,40,41,41,41,41,41,41,41,
2215   41,42,42,42,42,42,42,42,42,43,
2216   43,43,43,43,43,43,43,44,44,44,
2217   44,44,44,44,44,45,45,45,45,45,
2218   45,45,45,46,46,46,46,46,46,46,
2219   46,47,47,47,47,47,47,47,47,48,
2220   48,48,48,48,48,48,48,49,49,49,
2221   49,49,49,49,49,50,50,50,50,50,
2222   50,50,50,51,51,51,51,51,51,51,
2223   51,52,52,52,52,52,52,52,52,53,
2224   53,53,53,53,53,53,53,53,53,53,
2225   53,53,53,53,53,54,54,54,54,54,
2226   54,54,54,54,54,54,54,54,54,54,
2227   54,55,55,55,55,55,55,55,55,55,
2228   55,55,55,55,55,55,55,56,56,56,
2229   56,56,56,56,56,56,56,56,56,56,
2230   56,56,56,57,57,57,57,57,57,57,
2231   57,57,57,57,57,57,57,57,57,57,
2232   57,57,57,57,57,57,57,57,57,57,
2233   57,57,57,57,57,58,58,58,58,58,
2234   58,58,58,58,58,58,58,58,58,58,
2235   58,58,58,58,58,58,58,58,58,58,
2236   58,58,58,58,58,58,58,59,59,59,
2237   59,59,59,59,59,59,59,59,59,59,
2238   59,59,59,59,59,59,59,59,59,59,
2239   59,59,59,59,59,59,59,59,59,60,
2240 };
2241 treal c0_0[232] = {
2242   -0.000195288986670558,0.003874285259094822,-0.017419511850232897,0.0036391123722735786,-3.911625052543035,-0.006768089695319922,-0.06998597140009832,-0.20494510361710774,2.588056268956672,-3.3374875083861553,
2243   -1.019188831419784,-0.3147953728737259,-5.798723652671069,-1.1337769901516943,-2.2882715691002904,-0.8137634627107487,0.9229005861632151,-6.071346725015958,-4.333307851959838,-1.687172615767033,
2244   -6.274847934791513,-5.678425258545579,-6.000781650579467,-2.421774835240409,-2.106813393550019,-8.349918255063072,-7.991619879585479,-3.4056762837898646,-3.3440645061788614,-9.246886163182607,
2245   -10.488877728325859,-4.713999232062049,-1.8868443463090936,-10.67060909655061,-13.315477387127812,-6.398322771457918,-1.1830725989690192,-11.473926007026598,-16.45812833554519,-8.508293152161304,
2246   -0.21480164803790938,-11.977614733090123,-19.786263534774147,-11.078421443503954,0.5105725124286403,-12.069065729885116,-23.19885823634687,-14.12824022816317,1.072007089991766,-11.851691395822824,
2247   -26.59358247491643,-17.66212739109876,1.433794036344243,-11.395288394046295,-29.89268732145125,-21.671795668253864,1.6406125018892979,-10.784855955468093,-33.040391770878855,-26.13943178747002,
2248   1.7298676376958875,-10.086371330128417,-36.00234070848012,-31.04089047444895,1.7406621878272723,-9.349886665156154,-38.76064537989763,-36.34837280486629,1.7023663565404792,-8.6088062609124,
2249   -41.30926078737706,-42.03243745141675,1.6376973693433978,-7.884030163345347,-43.649848557152076,-48.06337402537929,1.5564891502040463,-7.186786644764148,-45.788629819161,-54.41206394524746,
2250   1.4834493612964401,-6.524117221196081,-47.73441846798475,-61.05046953394228,1.3631880314284788,-5.8925442140769135,-49.4965341616863,-67.95187513913834,1.3470273913985873,-5.312172017532418,
2251   -51.08665614561209,-75.0909759854829,0.8760266374453151,-4.165188288321739,-53.77662323811381,-89.9880922351998,1.8727369637506195,-3.41925817144292,-55.9293230124387,-105.56707276661317,
2252   -2.5246570414261105,-1.8246366810193646,-57.41770206888857,-121.67417360920557,1327.3238267799318,-3.9743632321226343,-59.0636370584169,-138.17580786122895,-1031.7622219061657,137.3014232173221,
2253   -54.333345707160404,-140.21704384450825,-33.59275323989736,27.484198220887777,-48.48694063389831,-142.01797810730113,-25.732235422049598,20.333203810605884,-45.0939273432094,-145.33211922671052,
2254   -5.3166326970335565,9.377800997799904,-40.87747768631475,-151.39567954363125,-4.471287869217019,7.114264548346018,-38.53699931602895,-157.02315094821859,-1.8985980494629013,5.210630491846168,
2255   -36.78790668861372,-162.3616438361954,-0.8927973101793615,3.593988480740467,-34.28888433070625,-172.4268302225494,-0.49416800307010306,2.833778261707306,-32.464485926777144,-181.8899555617798,
2256   -0.23820800727001548,2.4129979103668315,-30.97528906297494,-190.88738805305897,-0.051887750840627,2.2101655772969537,-29.663092708322345,-199.49018596899734,0.12020831289412044,2.1659835463007284,
2257   -28.421006646965516,-207.73262197222857,0.29540132328420354,2.268340023894156,-27.16240888383511,-215.6221399083563,0.47110162543185874,2.5198720369458694,-25.80336665478496,-223.14217730044857,
2258   0.609185387110233,2.9210115405858192,-24.259076123944563,-230.2521957397629,0.6298654487691794,3.439728332501145,-22.453702012336876,-236.88842379221887,0.44879420002418713,3.9760540419435735,
2259   -20.348874306241484,-242.96997034942552,0.07485206532557996,4.358198940019776,-17.983356320371776,-248.41503579771214,-0.34178558759495653,4.421934912706355,-15.491283594487912,-253.1664590637666,
2260   -0.6264525040894139,4.130907046195713,-13.063723316695883,-257.21494726485275,-0.7208488086061818,3.597487433571645,-10.870166655606972,-260.604373214559,-0.680120091453524,2.9836900750533872,
2261   -9.002225545762442,-263.41633080728263,-0.5699216517440676,2.4045729139713647,-7.472870360514456,-265.7466253164484,-0.47995754073240837,1.9192888984795866,-6.245625050358484,-267.6869755804271,
2262   -0.32092204477696457,1.510608649327067,-5.272114364207498,-269.3160331705012,-0.18618767911248998,0.9640832170238418,-3.867326644898429,-271.8807363082429,-0.11467972561685451,0.6470083900601576,
2263   -2.9527716915777917,-273.79946149622714,-0.07692796338424553,0.45171053614449724,-2.3290710703038036,-275.2881225501753,-0.0411070967008294,0.3207033674908116,-1.8906013032978302,-276.4787597315005,
2264   -0.019208247652961807,0.18069382834703096,-1.3213533635552355,-278.2719855225347,-0.011203512302054344,0.11527111262416341,-0.9853374578372892,-279.5673509539689,-0.006389022384987176,0.07711228555791973,
2265   -0.7669200953850905,-280.5538428762878};
2266 maptype *map_0[1] = {a0_0};
2267 treal *t_0[1] = {t0_0};
2268 treal *c_0[1] = {c0_0};
2269 real x0_1[2] = {-4.78637250807};
2270 real xe_1[2] = {12.3853930305};
2271 real hi_1[2] = {14.0929014816};
2272 int k_1[2] = {4};
2273 int nmap_1[2] = {243};
2274 int n_1[2] = {25};
2275 treal t0_1[29] = {
2276   -22.880588261487706,-22.880588261487706,-22.880588261487706,-22.880588261487706,-4.7154147992349715,-2.44476811645338,-0.17412143367178823,-0.10316372483486348,-0.032206015997938736,0.10970940167591076,
2277   0.39354023702360974,0.6773710723713087,0.9612019077190077,1.5288635784144056,2.0965252491098036,2.6641869198052017,3.2318485905005994,4.367171931891395,5.502495273282191,6.637818614672987,
2278   7.7731419560637836,8.90846529745458,10.043788638845376,11.179111980236172,12.314435321626966,13.449758663017763,13.449758663017763,13.449758663017763,13.449758663017763};
2279 maptype a0_1[242] = {
2280   3,4,4,4,4,4,4,4,4,4,
2281   4,4,4,4,4,4,4,4,4,4,
2282   4,4,4,4,4,4,4,4,4,4,
2283   4,4,4,5,5,5,5,5,5,5,
2284   5,5,5,5,5,5,5,5,5,5,
2285   5,5,5,5,5,5,5,5,5,5,
2286   5,5,5,5,5,6,7,8,8,9,
2287   9,9,9,10,10,10,10,11,11,11,
2288   11,12,12,12,12,12,12,12,12,13,
2289   13,13,13,13,13,13,13,14,14,14,
2290   14,14,14,14,14,15,15,15,15,15,
2291   15,15,15,16,16,16,16,16,16,16,
2292   16,16,16,16,16,16,16,16,16,17,
2293   17,17,17,17,17,17,17,17,17,17,
2294   17,17,17,17,17,18,18,18,18,18,
2295   18,18,18,18,18,18,18,18,18,18,
2296   18,19,19,19,19,19,19,19,19,19,
2297   19,19,19,19,19,19,19,20,20,20,
2298   20,20,20,20,20,20,20,20,20,20,
2299   20,20,20,21,21,21,21,21,21,21,
2300   21,21,21,21,21,21,21,21,21,22,
2301   22,22,22,22,22,22,22,22,22,22,
2302   22,22,22,22,22,23,23,23,23,23,
2303   23,23,23,23,23,23,23,23,23,23,
2304   23,24};
2305 treal c0_1[88] = {
2306   -6.36713549620182e-07,1.5160737693134769e-05,-8.260878166471392e-05,3.0323347755798663e-05,-0.00024411341807896697,-1.953729853071704e-05,-0.00016210976844749798,-0.0002841152100597304,4.079265842363113e-05,-0.0016824232674811633,
2307   -0.004026660881887453,-0.0036107963114564135,-6.657477252583585,-0.0014045461238867815,-0.011036077690245387,-0.020950656511001066,6.877363335753862,-1.418602543555714,-0.11179652730609937,-0.024119352142066425,
2308   -0.543466789153841,0.04540329187677823,-0.20923559998181623,-0.03673774827884677,0.15884805273658337,-0.18597565724712148,-0.22918498592674946,-0.06707040710458527,-0.000158610240520944,-0.05071773074238208,
2309   -0.29636586796108727,-0.14347023785330212,0.020447788838923116,-0.05085278617356736,-0.3251947126240388,-0.23167745391366554,0.0063615717881664625,-0.03344164721207264,-0.349120072067046,-0.32760689162074325,
2310   0.0035234959952906452,-0.02260798580351479,-0.3809373003865383,-0.5354015249270402,0.0020889306817305545,-0.016607524933389094,-0.4031984427286225,-0.7582856924455624,0.0015310232367928712,-0.013050107291114964,
2311   -0.42003394378605413,-0.9921354853038521,0.0008540032791263473,-0.010442797665701014,-0.43336996546332845,-1.234497859565131,0.00044321938261310733,-0.007534088096451751,-0.45377954347461635,-1.7387234999051162,
2312   0.00032202398681367554,-0.006024496165139314,-0.4691729206630146,-2.26297253804347,0.000229710864700529,-0.004927692118987451,-0.4816071956612905,-2.8029295899308724,0.0001731016159887567,-0.00414530379959073,
2313   -0.49190797970399575,-3.355724918582023,0.00013330936859535112,-0.003555724884397225,-0.5006511373216473,-3.9192893424003685,0.00010574464725677569,-0.003101677171020111,-0.5082094412681857,-4.49207836542927,
2314   8.520738916512169e-05,-0.00274151407224685,-0.514843352674877,-5.072903596231896,7.168736855737352e-05,-0.002451300258912455,-0.5207388759925508,-5.66082627992181};
2315 maptype *map_1[2] = {a0_1};
2316 treal *t_1[2] = {t0_1};
2317 treal *c_1[1] = {c0_1};
2318 splinecoeffs<maptype> sc[2] = {
2319 	{x0_0, xe_0, hi_0, k_0, n_0, nmap_0, map_0, t_0, c_0, splinedata<unsigned char>::splev_pp<4>},
2320 	{x0_1, xe_1, hi_1, k_1, n_1, nmap_1, map_1, t_1, c_1, splinedata<unsigned char>::splev_pp<4>},
2321 };
2322 splinedata<maptype> sd = {
2323 	sc,
2324 	2, /* number of calculated values */
2325 	2, /* number of input values */
2326 	2, /* number of output values */
2327 	0, /* number of state values */
2328 	"nonlin_2",
2329 };
2330 }; /* ! namespace nonlin_2 */
2331 } // namespace AmpData
2332 
2333 // nonlin_2: 2416 bytes
2334 // data size sum: 2432 bytes
2335 
2336 
2337 static const creal __attribute__((aligned(16))) mo_data[1*16] = { -0.0102546428492310,-0.0926671566150658,0.00748481645910352,-0.0140923636667521,0.000146229606693146,0.0922823518597244,0.0130923463909865,0,0,0,-6.05681847115581e-5,0.000595161081745525,0,0,-21.3106335449389,0 };
2338 static const Map<const Matrix<creal, 1, 16>, Aligned> Mo(mo_data);
2339 static const creal __attribute__((aligned(16))) moc_data[1*1] = { 0.991243408620221 };
2340 static const Map<const Matrix<creal, 1, 1>, Aligned> Moc(moc_data);
2341 static const creal __attribute__((aligned(16))) mp_data[8*8] = { -1.60878766662268,0.201098738795714,18.3957218365136,-3.91398582031719,-0.0123843269016959,-1.04506003104504,-24.3073622142207,1.77200291622517,-8.88487051956217,1.11060977505219,166.234892997965,-35.3691437462083,-0.000977781651230822,-5.92128424260976,-174.653665466717,3.68076212702878,1.04505825382188,-0.130632444077542,-13.4269526764931,2.85680017523035,-0.0102398010071506,0.397763818919637,17.2035996438699,-1.21549433886385,-1.84036955719718,0.230046482676040,25.2801788968119,-5.37876475830232,0.0273903892012099,-0.172407562001718,-32.6789072654108,2.68046580539187,0.0674042024831012,-0.00842551253086225,-0.262319945235929,0.0558128269821166,0.00219678736800143,-0.0979397222211214,0.718340583633752,0.0276587628679819,4.46885219353691,-0.558606977146733,-165.544595019239,35.2222717021849,0.00120351074120639,-9.02952049284388,173.869107367223,-13.5602699048151,1.81354621649064,-0.226693368766333,-23.4862546943112,4.99707877518569,-0.00778901763100761,-1.57796122950664,32.8564145535054,-2.48722216637614,0,0,0,0,1.00000000000000,0,0,0 };
2342 static const Map<const Matrix<creal, 8, 8>, Aligned> Mp(mp_data);
2343 static const creal __attribute__((aligned(16))) mx_data[7*16] = { 1.05970174364689,-0.108282638352014,-0.00216390308520815,0.0114004550526571,-0.00614983937551424,0.00735634823212811,-0.0373376868458086,0.713522975253478,0.136120723019377,-0.102112632757899,0.113894820137347,-0.0489364044915694,0.206120132777242,-0.416089362653296,-0.0433301281262144,0.0664125136110350,1.00099915170040,-0.00502767212096184,0.00451528271064754,-0.0174164531743976,0.0283669734091872,0.0839522390879246,-0.105966821882551,-0.00316747488536151,1.00956830159365,-0.00857286923940689,0.0523569880167113,-0.0541206842484787,-0.00113061827397934,-0.00185742158800730,0.000224251694312446,-0.000856211240495214,1.00005450259739,-0.00387940275141992,0.000605868723121882,-0.545624721365257,0.306950247693952,0.0301073642157915,-0.0692961838570507,0.0696324581496592,0.257432975682703,0.538969989890965,-0.0830857401055198,0.0447852476649801,0.0103831526772016,-0.0271123453953327,0.00934503192093945,-0.102249000232238,1.01250767475771,0,0,0,0,0,0,0,-0.00211533957944378,0.00141132471136906,0.000931758428019313,-0.00121834618938154,-0.000342312419688939,0.000825499399629477,-0.00246640352687999,-0.00221019875914748,0.00147461751870934,0.000973541761263861,-0.00127298054725860,-0.000357662778471990,0.000862519622708971,-0.00257700485411471,0.000307278441346321,-0.000309004853953255,-2.23695668047990e-5,2.14873885323795e-5,-3.73067441519218e-5,0.000244734225363349,-0.000321720947551207,7.14531190632612e-5,-7.18548354480381e-5,-5.20173748404662e-6,4.99656752844864e-6,-8.67512148539013e-6,5.69095647660407e-5,-7.48114618591209e-5,-0.000185944022067206,-0.0328978757987105,-0.00205975139324839,0.00928258649842950,-0.000657578027217151,-0.0327275668944848,0.00532525400921149,-0.00753019147704296,0.000217644735509446,0.00119267447325060,0.00834739377311968,-0.00139172521333547,0.000380292343123624,0.00128078974223338,-1360.53531039429,169.083565190700,76.3715942748210,-236.747433234904,188.837967496056,-44.3875870949356,1237.07312474557,8676.03975995143,-3217.70398451414,-3777.02751206018,5337.82542445813,1498.14652753079,-3011.78616932036,10648.3974067810 };
2344 static const Map<const Matrix<creal, 7, 16>, Aligned> Mx(mx_data);
2345 static const creal __attribute__((aligned(16))) mxc_data[7*1] = { 0.841296047660765,-6.14125311669919,-0.333988273569845,-0.217191975968813,0.0159661555945044,-6.13970274163824,-0.147713788505921 };
2346 static const Map<const Matrix<creal, 7, 1>, Aligned> Mxc(mxc_data);
2347 
2348 
2349 static Matrix<creal, 0, 1> last_pot;
2350 
2351 struct nonlin_param {
2352     Matrix<creal, 8, 1> *p;
2353     Matrix<creal, 8, 1> *i;
2354     Map<Matrix<creal, 8, 1> >*v;
2355     int *info;
2356     int *nfev;
2357     creal *fnorm;
2358     Array<creal, 8, 1> *p_val;
nonlin_paramnonlin_param2359     inline nonlin_param(Matrix<creal, 8, 1> *p_, Matrix<creal, 8, 1> *i_, Map<Matrix<creal, 8, 1> >*v_, int *info_, int *nfev_, creal *fnorm_, Array<creal, 8, 1> *p_val_): p(p_), i(i_), v(v_), info(info_), nfev(nfev_), fnorm(fnorm_), p_val(p_val_) {}
2360 };
2361 
2362 
2363 
2364 namespace nonlin_0 {
nonlin(nonlin_param & par)2365 static inline int nonlin(nonlin_param& par) {
2366     real t[AmpData::nonlin_0::sd.m];
2367     real m[2+0];
2368     Map<Matrix<real, 2+0, 1> >mp(m);
2369     mp << last_pot.cast<real>(), (*par.p).head<2>().cast<real>();
2370     for (int j = 0; j < AmpData::nonlin_0::sd.m; j++) {
2371         splinecoeffs<AmpData::nonlin_0::maptype> *pc = &AmpData::nonlin_0::sd.sc[j];
2372         check(&AmpData::nonlin_0::sd, m, (*pc->eval)(pc, m, &t[j]));
2373     }
2374     (*par.i).head<2>() = Map<Matrix<real, 2, 1> >(t).cast<creal>();
2375     return 0;
2376 }
2377 
2378 
2379 
2380 
2381 } // end nonlin_0
2382 
2383 namespace nonlin_1 {
nonlin(nonlin_param & par)2384 static inline int nonlin(nonlin_param& par) {
2385     real t[AmpData::nonlin_1::sd.m];
2386     real m[2+0];
2387     Map<Matrix<real, 2+0, 1> >mp(m);
2388     mp << last_pot.cast<real>(), (*par.p).segment<2>(2).cast<real>();
2389     for (int j = 0; j < AmpData::nonlin_1::sd.m; j++) {
2390         splinecoeffs<AmpData::nonlin_1::maptype> *pc = &AmpData::nonlin_1::sd.sc[j];
2391         check(&AmpData::nonlin_1::sd, m, (*pc->eval)(pc, m, &t[j]));
2392     }
2393     (*par.i).segment<2>(2) = Map<Matrix<real, 2, 1> >(t).cast<creal>();
2394     return 0;
2395 }
2396 
2397 
2398 
2399 
2400 } // end nonlin_1
2401 
2402 namespace nonlin_2 {
nonlin(nonlin_param & par)2403 static inline int nonlin(nonlin_param& par) {
2404     real t[AmpData::nonlin_2::sd.m];
2405     real m[2+0];
2406     Map<Matrix<real, 2+0, 1> >mp(m);
2407     mp << last_pot.cast<real>(), (*par.p).segment<2>(4).cast<real>();
2408     for (int j = 0; j < AmpData::nonlin_2::sd.m; j++) {
2409         splinecoeffs<AmpData::nonlin_2::maptype> *pc = &AmpData::nonlin_2::sd.sc[j];
2410         check(&AmpData::nonlin_2::sd, m, (*pc->eval)(pc, m, &t[j]));
2411     }
2412     (*par.i).segment<2>(4) = Map<Matrix<real, 2, 1> >(t).cast<creal>();
2413     return 0;
2414 }
2415 
2416 
2417 
2418 
2419 } // end nonlin_2
2420 
2421 namespace nonlin {
2422 static const creal __attribute__((aligned(16))) kl_data[2*8] = { -0.0219270321823620,0.999759573727441,0.999759573727441,0.0219270321823619,1.00000000000000,0,0,0,0,1.00000000000000,0,0,551772.224409347,-13096.8526917654,-13096.8526917654,777788.180707371 };
2423 static const Map<const Matrix<creal, 2, 8>, Aligned> Kl(kl_data);
2424 static const creal __attribute__((aligned(16))) ku_data[6*2] = { 13096.8531048342,98362.8920522104,-431770.787790270,-8133.82959730492,0,0,-695224.597054545,-13096.8526917654,0,0,-7.46011600940896,51016.6019816278 };
2425 static const Map<const Matrix<creal, 6, 2>, Aligned> Ku(ku_data);
2426 static const creal __attribute__((aligned(16))) mpc_data[8*1] = { 0,0,0,0,0,0,347.381890451386,146.019756212607 };
2427 static const Map<const Matrix<creal, 8, 1>, Aligned> Mpc(mpc_data);
2428 static const creal __attribute__((aligned(16))) sam0_data[3*1] = { 0.984867796815516,0.990325823322304,0.572071777232610 };
2429 static const Map<const Array<creal, 3, 1>, Aligned> Sam0(sam0_data);
2430 static const creal __attribute__((aligned(16))) sam1_data[3*1] = { 0.529599326055711,0.294766829526201,-0.300692171196462 };
2431 static const Map<const Array<creal, 3, 1>, Aligned> Sam1(sam1_data);
2432 static const creal __attribute__((aligned(16))) sam2_data[3*1] = { 1.01047167427495,1.00954543304385,1.54972907825715 };
2433 static const Map<const Array<creal, 3, 1>, Aligned> Sam2(sam2_data);
2434 static const creal __attribute__((aligned(16))) spm0_data[3*1] = { 1.14429961087212e-7,3.70660566459397e-8,2.10374116872319e-7 };
2435 static const Map<const Array<creal, 3, 1>, Aligned> Spm0(spm0_data);
2436 static const creal __attribute__((aligned(16))) spm1_data[3*1] = { 0.000487812975465725,0.000184802678889708,-4.75770783104045e-6 };
2437 static const Map<const Array<creal, 3, 1>, Aligned> Spm1(spm1_data);
2438 static const creal __attribute__((aligned(16))) spm2_data[3*1] = { 9.83498403815797e-6,6.65101858921353e-6,1.00009613179018e-5 };
2439 static const Map<const Array<creal, 3, 1>, Aligned> Spm2(spm2_data);
2440 static const creal __attribute__((aligned(16))) ssm0_data[3*1] = { 0.00264912280520554,0.00263637203310291,0.00300240315205226 };
2441 static const Map<const Array<creal, 3, 1>, Aligned> Ssm0(ssm0_data);
2442 static const creal __attribute__((aligned(16))) ssm1_data[3*1] = { -0.138762806132000,-0.0809751016083964,0.00281682007847420 };
2443 static const Map<const Array<creal, 3, 1>, Aligned> Ssm1(ssm1_data);
2444 static const creal __attribute__((aligned(16))) ssm2_data[3*1] = { -0.00275908822697312,-0.00262552318516037,-0.00534179693076565 };
2445 static const Map<const Array<creal, 3, 1>, Aligned> Ssm2(ssm2_data);
2446 
2447 
2448 
2449 typedef int root_fcn(void*p, const creal *v, creal *fvec, int iflag);
fcn(void * p,const creal * v,creal * fvec,int iflag)2450 static int fcn(void *p, const creal *v, creal *fvec, int iflag) {
2451     nonlin_param& par = *static_cast<nonlin_param *>(p);
2452     const Map<const Matrix<creal, 2, 1> > Mv(v);
2453     Array<creal, 6, 1> pt;
2454     pt = (*par.p).head<6>() + Ku * Mv;
2455     Array<creal, 3, 1> PP1;
2456     PP1 << pt(1), pt(3), pt(5);
2457     Array<creal, 3, 1> PP0;
2458     PP0 << pt(0), pt(2), pt(4);
2459     pt.head<3>() = (Spm1 * PP1 + Ssm1) * PP1 + Sam1 + ((Spm2 * PP1 + Ssm2) * PP1 + Sam2) * PP0;
2460     Array<creal, 6, 1> res;
2461     splinedata<AmpData::nonlin_0::maptype>::splev_pp<4>(&AmpData::nonlin_0::sd.sc[0], &pt(0), &res(0));
2462     splinedata<AmpData::nonlin_0::maptype>::splev_pp<4>(&AmpData::nonlin_0::sd.sc[1], &pt(0), &res(3));
2463     splinedata<AmpData::nonlin_1::maptype>::splev_pp<4>(&AmpData::nonlin_1::sd.sc[0], &pt(1), &res(1));
2464     splinedata<AmpData::nonlin_1::maptype>::splev_pp<4>(&AmpData::nonlin_1::sd.sc[1], &pt(1), &res(4));
2465     splinedata<AmpData::nonlin_2::maptype>::splev_pp<4>(&AmpData::nonlin_2::sd.sc[0], &pt(2), &res(2));
2466     splinedata<AmpData::nonlin_2::maptype>::splev_pp<4>(&AmpData::nonlin_2::sd.sc[1], &pt(2), &res(5));
2467     pt.head<3>() = ((Spm0 * PP1 + Ssm0) * PP1 + Sam0) * res.head<3>();
2468     pt.tail<3>() = ((Spm0 * PP1 + Ssm0) * PP1 + Sam0) * res.tail<3>();
2469     (*par.i).head<6>() << pt(0), pt(3), pt(1), pt(4), pt(2), pt(5);
2470     (*par.i).segment<2>(6) = Mv;
2471     Map<Matrix<creal, 2, 1>, Aligned> Mfvec(fvec);
2472     Mfvec = (*par.p).segment<2>(6) + Kl * (*par.i).head<8>();
2473 
2474     return 0;
2475 }
2476 
2477 
2478 
2479 #if 0
2480 #define real_EPSILON FLT_EPSILON
2481 #define real_MIN FLT_MIN
2482 #define real_MAX FLT_MAX
2483 #else
2484 #define real_EPSILON DBL_EPSILON
2485 #define real_MIN DBL_MIN
2486 #define real_MAX DBL_MAX
2487 #endif
2488 
dpmpar(int i)2489 real inline dpmpar(int i)
2490 {
2491     switch(i) {
2492     case 1:
2493 	return real_EPSILON;
2494     case 2:
2495 	return real_MIN;
2496     default:
2497 	return real_MAX;
2498     }
2499 }
2500 
2501 template<int N>
enorm(const real * fvec)2502 real inline enorm(const real *fvec) {
2503     real s = 0;
2504     for (int i = 0; i < N; i++) {
2505 	s += fvec[i] * fvec[i];
2506     }
2507     return sqrt(s);
2508 }
2509 
enorm(int n,const real * fvec)2510 real inline enorm(int n, const real *fvec) {
2511     real s = 0;
2512     for (int i = 0; i < n; i++) {
2513 	s += fvec[i] * fvec[i];
2514     }
2515     return sqrt(s);
2516 }
2517 
2518 template<int N>
enorm2(const real * fvec)2519 real enorm2(const real *fvec) {
2520     real s = 0;
2521     for (int i = 0; i < N; i++) {
2522 	s += fvec[i] * fvec[i];
2523     }
2524     return s;
2525 }
2526 
2527 template<int N>
qform(real * q,int ldq,real * wa)2528 void qform(real *q, int	ldq, real *wa)
2529 {
2530     /* System generated locals */
2531     int q_dim1, q_offset;
2532 
2533     /* Local variables */
2534     int i, j, k, l;
2535     real sum, temp;
2536 
2537     /* Parameter adjustments */
2538 #pragma GCC diagnostic push
2539 #pragma GCC diagnostic ignored "-Warray-bounds"
2540     --wa;
2541     q_dim1 = ldq;
2542     q_offset = 1 + q_dim1 * 1;
2543     q -= q_offset;
2544 #pragma GCC diagnostic pop
2545 
2546     /* Function Body */
2547 
2548 /*     zero out upper triangle of q in the first min(m,n) columns. */
2549 
2550     if (N >= 2) {
2551         for (j = 2; j <= N; ++j) {
2552             for (i = 1; i <= j-1; ++i) {
2553                 q[i + j * q_dim1] = 0.;
2554             }
2555         }
2556     }
2557 
2558 /*     accumulate q from its factored form. */
2559 
2560     for (l = 1; l <= N; ++l) {
2561 	k = N - l + 1;
2562 	for (i = k; i <= N; ++i) {
2563 	    wa[i] = q[i + k * q_dim1];
2564 	    q[i + k * q_dim1] = 0.;
2565 	}
2566 	q[k + k * q_dim1] = 1.;
2567 	if (wa[k] != 0.) {
2568             for (j = k; j <= N; ++j) {
2569                 sum = 0.;
2570                 for (i = k; i <= N; ++i) {
2571                     sum += q[i + j * q_dim1] * wa[i];
2572                 }
2573                 temp = sum / wa[k];
2574                 for (i = k; i <= N; ++i) {
2575                     q[i + j * q_dim1] -= temp * wa[i];
2576                 }
2577             }
2578         }
2579     }
2580 } /* qform_ */
2581 
2582 template<int N>
r1updt(real * s,int ls,const real * u,real * v,real * w,int * sing)2583 void r1updt(real *s, int ls, const real *u, real *v, real *w, int *sing)
2584 {
2585     /* Initialized data */
2586 
2587 #define p5 .5
2588 #define p25 .25
2589 
2590     /* Local variables */
2591     int i, j, l, jj, nm1;
2592     real tan;
2593     int nmj;
2594     real cos, sin, tau, temp, giant, cotan;
2595 
2596     /* Parameter adjustments */
2597     --w;
2598     --u;
2599     --v;
2600     --s;
2601     (void)ls;
2602 
2603     /* Function Body */
2604 
2605 /*     giant is the largest magnitude. */
2606 
2607     giant = dpmpar(3);
2608 
2609 /*     initialize the diagonal element pointer. */
2610 
2611     jj = N * ((N << 1) - N + 1) / 2 - (N - N);
2612 
2613 /*     move the nontrivial part of the last column of s into w. */
2614 
2615     l = jj;
2616     for (i = N; i <= N; ++i) {
2617 	w[i] = s[l];
2618 	++l;
2619     }
2620 
2621 /*     rotate the vector v into a multiple of the n-th unit vector */
2622 /*     in such a way that a spike is introduced into w. */
2623 
2624     nm1 = N - 1;
2625     if (nm1 >= 1) {
2626         for (nmj = 1; nmj <= nm1; ++nmj) {
2627             j = N - nmj;
2628             jj -= N - j + 1;
2629             w[j] = 0.;
2630             if (v[j] != 0.) {
2631 
2632 /*        determine a givens rotation which eliminates the */
2633 /*        j-th element of v. */
2634 
2635                 if (fabs(v[N]) < fabs(v[j])) {
2636                     cotan = v[N] / v[j];
2637                     sin = p5 / sqrt(p25 + p25 * (cotan * cotan));
2638                     cos = sin * cotan;
2639                     tau = 1.;
2640                     if (fabs(cos) * giant > 1.) {
2641                         tau = 1. / cos;
2642                     }
2643                 } else {
2644                     tan = v[j] / v[N];
2645                     cos = p5 / sqrt(p25 + p25 * (tan * tan));
2646                     sin = cos * tan;
2647                     tau = sin;
2648                 }
2649 
2650 /*        apply the transformation to v and store the information */
2651 /*        necessary to recover the givens rotation. */
2652 
2653                 v[N] = sin * v[j] + cos * v[N];
2654                 v[j] = tau;
2655 
2656 /*        apply the transformation to s and extend the spike in w. */
2657 
2658                 l = jj;
2659                 for (i = j; i <= N; ++i) {
2660                     temp = cos * s[l] - sin * w[i];
2661                     w[i] = sin * s[l] + cos * w[i];
2662                     s[l] = temp;
2663                     ++l;
2664                 }
2665             }
2666         }
2667     }
2668 
2669 /*     add the spike from the rank 1 update to w. */
2670 
2671     for (i = 1; i <= N; ++i) {
2672 	w[i] += v[N] * u[i];
2673     }
2674 
2675 /*     eliminate the spike. */
2676 
2677     *sing = false;
2678     if (nm1 >= 1) {
2679         for (j = 1; j <= nm1; ++j) {
2680             if (w[j] != 0.) {
2681 
2682 /*        determine a givens rotation which eliminates the */
2683 /*        j-th element of the spike. */
2684 
2685                 if (fabs(s[jj]) < fabs(w[j])) {
2686                     cotan = s[jj] / w[j];
2687                     sin = p5 / sqrt(p25 + p25 * (cotan * cotan));
2688                     cos = sin * cotan;
2689                     tau = 1.;
2690                     if (fabs(cos) * giant > 1.) {
2691                         tau = 1. / cos;
2692                     }
2693                 } else {
2694                     tan = w[j] / s[jj];
2695                     cos = p5 / sqrt(p25 + p25 * (tan * tan));
2696                     sin = cos * tan;
2697                     tau = sin;
2698                 }
2699 
2700 /*        apply the transformation to s and reduce the spike in w. */
2701 
2702                 l = jj;
2703                 for (i = j; i <= N; ++i) {
2704                     temp = cos * s[l] + sin * w[i];
2705                     w[i] = -sin * s[l] + cos * w[i];
2706                     s[l] = temp;
2707                     ++l;
2708                 }
2709 
2710 /*        store the information necessary to recover the */
2711 /*        givens rotation. */
2712 
2713                 w[j] = tau;
2714             }
2715 
2716 /*        test for zero diagonal elements in the output s. */
2717 
2718             if (s[jj] == 0.) {
2719                 *sing = true;
2720             }
2721             jj += N - j + 1;
2722         }
2723     }
2724 
2725 /*     move w back into the last column of the output s. */
2726 
2727     l = jj;
2728     for (i = N; i <= N; ++i) {
2729 	s[l] = w[i];
2730 	++l;
2731     }
2732     if (s[jj] == 0.) {
2733 	*sing = true;
2734     }
2735 
2736 /*     last card of subroutine r1updt. */
2737 
2738 } /* __minpack_func__(r1updt) */
2739 
2740 template<int M, int N>
r1mpyq(real * a,int lda,const real * v,const real * w)2741 void r1mpyq(real *a, int lda, const real *v, const real *w)
2742 {
2743     /* System generated locals */
2744     int a_dim1, a_offset;
2745 
2746     /* Local variables */
2747     int i, j, nm1, nmj;
2748     real cos, sin, temp;
2749 
2750     /* Parameter adjustments */
2751     --w;
2752     --v;
2753     a_dim1 = lda;
2754     a_offset = 1 + a_dim1 * 1;
2755     a -= a_offset;
2756 
2757     /* Function Body */
2758 
2759 /*     apply the first set of givens rotations to a. */
2760 
2761     nm1 = N - 1;
2762     if (nm1 < 1) {
2763         return;
2764     }
2765     for (nmj = 1; nmj <= nm1; ++nmj) {
2766 	j = N - nmj;
2767 	if (fabs(v[j]) > 1.) {
2768 	    cos = 1. / v[j];
2769 	    sin = sqrt(1. - cos * cos);
2770 	} else {
2771 	    sin = v[j];
2772 	    cos = sqrt(1. - sin * sin);
2773 	}
2774 	for (i = 1; i <= M; ++i) {
2775 	    temp = cos * a[i + j * a_dim1] - sin * a[i + N * a_dim1];
2776 	    a[i + N * a_dim1] = sin * a[i + j * a_dim1] + cos * a[
2777 		    i + N * a_dim1];
2778 	    a[i + j * a_dim1] = temp;
2779 	}
2780     }
2781 
2782 /*     apply the second set of givens rotations to a. */
2783 
2784     for (j = 1; j <= nm1; ++j) {
2785 	if (fabs(w[j]) > 1.) {
2786 	    cos = 1. / w[j];
2787 	    sin = sqrt(1. - cos * cos);
2788 	} else {
2789 	    sin = w[j];
2790 	    cos = sqrt(1. - sin * sin);
2791 	}
2792 	for (i = 1; i <= M; ++i) {
2793 	    temp = cos * a[i + j * a_dim1] + sin * a[i + N * a_dim1];
2794 	    a[i + N * a_dim1] = -sin * a[i + j * a_dim1] + cos * a[i + N * a_dim1];
2795 	    a[i + j * a_dim1] = temp;
2796 	}
2797     }
2798 
2799 /*     last card of subroutine r1mpyq. */
2800 
2801 } /* r1mpyq_ */
2802 
2803 template<int N>
fdjac1(root_fcn * fcn_nn,void * p,real * x,const real * fvec,real * fjac,int ldfjac,int ml,int mu,real epsfcn,real * wa1,real * wa2)2804 int fdjac1(root_fcn *fcn_nn, void *p, real *x, const real *fvec, real *fjac, int ldfjac, int ml,
2805 	int mu, real epsfcn, real *wa1, real *wa2)
2806 {
2807     /* System generated locals */
2808     int fjac_dim1, fjac_offset;
2809 
2810     /* Local variables */
2811     real h;
2812     int i, j, k;
2813     real eps, temp;
2814     int msum;
2815     real epsmch;
2816     int iflag = 0;
2817 
2818     /* Parameter adjustments */
2819     --wa2;
2820     --wa1;
2821     --fvec;
2822     --x;
2823     fjac_dim1 = ldfjac;
2824     fjac_offset = 1 + fjac_dim1 * 1;
2825     fjac -= fjac_offset;
2826 
2827     /* Function Body */
2828 
2829 /*     epsmch is the machine precision. */
2830 
2831     epsmch = dpmpar(1);
2832 
2833     eps = sqrt((std::max(epsfcn,epsmch)));
2834     msum = ml + mu + 1;
2835     if (msum >= N) {
2836 
2837 /*        computation of dense approximate jacobian. */
2838 
2839         for (j = 1; j <= N; ++j) {
2840             temp = x[j];
2841             h = eps * fabs(temp);
2842             if (h == 0.) {
2843                 h = eps;
2844             }
2845             x[j] = temp + h;
2846             /* the last parameter of fcn_nn() is set to 2 to tell calls
2847                made to compute the function from calls made to compute
2848                the Jacobian (see fcn() in tlmfdrv.c) */
2849             iflag = fcn_nn(p, &x[1], &wa1[1], 2);
2850             if (iflag < 0) {
2851                 return iflag;
2852             }
2853             x[j] = temp;
2854             for (i = 1; i <= N; ++i) {
2855                 fjac[i + j * fjac_dim1] = (wa1[i] - fvec[i]) / h;
2856             }
2857         }
2858         return 0;
2859     }
2860 
2861 /*        computation of banded approximate jacobian. */
2862 
2863     for (k = 1; k <= msum; ++k) {
2864 	for (j = k; msum < 0 ? j >= N : j <= N; j += msum) {
2865 	    wa2[j] = x[j];
2866 	    h = eps * fabs(wa2[j]);
2867 	    if (h == 0.) {
2868 		h = eps;
2869 	    }
2870 	    x[j] = wa2[j] + h;
2871 	}
2872 	iflag = fcn_nn(p, &x[1], &wa1[1], 1);
2873 	if (iflag < 0) {
2874             return iflag;
2875 	}
2876 	for (j = k; msum < 0 ? j >= N : j <= N; j += msum) {
2877 	    x[j] = wa2[j];
2878 	    h = eps * fabs(wa2[j]);
2879 	    if (h == 0.) {
2880 		h = eps;
2881 	    }
2882 	    for (i = 1; i <= N; ++i) {
2883 		fjac[i + j * fjac_dim1] = 0.;
2884 		if (i >= j - mu && i <= j + ml) {
2885 		    fjac[i + j * fjac_dim1] = (wa1[i] - fvec[i]) / h;
2886 		}
2887 	    }
2888 	}
2889     }
2890     return 0;
2891 
2892 } /* fdjac1_ */
2893 
2894 template<int N>
qrfac(real * a,int lda,int pivot,int * ipvt,int lipvt,real * rdiag,real * acnorm,real * wa)2895 void qrfac(real *a, int lda, int pivot, int *ipvt, int lipvt, real *rdiag,
2896 	 real *acnorm, real *wa)
2897 {
2898 #ifdef USE_LAPACK
2899     int i, j, k;
2900     double t;
2901     double* tau = wa;
2902     const int ltau = N;
2903     int lwork = -1;
2904     int info = 0;
2905     double* work;
2906 
2907     if (pivot) {
2908         assert( lipvt >= N );
2909         /* set all columns free */
2910         memset(ipvt, 0, sizeof(int)*N);
2911     }
2912 
2913     /* query optimal size of work */
2914     lwork = -1;
2915     if (pivot) {
2916         dgeqp3_(&m,&n,a,&lda,ipvt,tau,tau,&lwork,&info);
2917         lwork = (int)tau[0];
2918         assert( lwork >= 3*n+1  );
2919     } else {
2920         dgeqrf_(&m,&n,a,&lda,tau,tau,&lwork,&info);
2921         lwork = (int)tau[0];
2922         assert( lwork >= 1 && lwork >= n );
2923     }
2924 
2925     assert( info == 0 );
2926 
2927     /* alloc work area */
2928     work = (double *)malloc(sizeof(double)*lwork);
2929     assert(work != NULL);
2930 
2931     /* set acnorm first (from the doc of qrfac, acnorm may point to the same area as rdiag) */
2932     if (acnorm != rdiag) {
2933         for (j = 0; j < n; ++j) {
2934             acnorm[j] = enorm<N>(&a[j * lda]);
2935         }
2936     }
2937 
2938     /* QR decomposition */
2939     if (pivot) {
2940         dgeqp3_(&m,&n,a,&lda,ipvt,tau,work,&lwork,&info);
2941     } else {
2942         dgeqrf_(&m,&n,a,&lda,tau,work,&lwork,&info);
2943     }
2944     assert(info == 0);
2945 
2946     /* set rdiag, before the diagonal is replaced */
2947     memset(rdiag, 0, sizeof(double)*n);
2948     for(i=0 ; i<n ; ++i) {
2949         rdiag[i] = a[i*lda+i];
2950     }
2951 
2952     /* modify lower trinagular part to look like qrfac's output */
2953     for(i=0 ; i<ltau ; ++i) {
2954         k = i*lda+i;
2955         t = tau[i];
2956         a[k] = t;
2957         for(j=i+1 ; j<m ; j++) {
2958             k++;
2959             a[k] *= t;
2960         }
2961     }
2962 
2963     free(work);
2964 #else /* !USE_LAPACK */
2965     /* Initialized data */
2966 
2967 #define p05 .05
2968 
2969     /* System generated locals */
2970     real d1;
2971 
2972     /* Local variables */
2973     int i, j, k, jp1;
2974     real sum;
2975     real temp;
2976     real epsmch;
2977     real ajnorm;
2978 
2979 /*     ********** */
2980 
2981 /*     subroutine qrfac */
2982 
2983 /*     this subroutine uses householder transformations with column */
2984 /*     pivoting (optional) to compute a qr factorization of the */
2985 /*     m by n matrix a. that is, qrfac determines an orthogonal */
2986 /*     matrix q, a permutation matrix p, and an upper trapezoidal */
2987 /*     matrix r with diagonal elements of nonincreasing magnitude, */
2988 /*     such that a*p = q*r. the householder transformation for */
2989 /*     column k, k = 1,2,...,min(m,n), is of the form */
2990 
2991 /*                           t */
2992 /*           i - (1/u(k))*u*u */
2993 
2994 /*     where u has zeros in the first k-1 positions. the form of */
2995 /*     this transformation and the method of pivoting first */
2996 /*     appeared in the corresponding linpack subroutine. */
2997 
2998 /*     the subroutine statement is */
2999 
3000 /*       subroutine qrfac(m,n,a,lda,pivot,ipvt,lipvt,rdiag,acnorm,wa) */
3001 
3002 /*     where */
3003 
3004 /*       m is a positive integer input variable set to the number */
3005 /*         of rows of a. */
3006 
3007 /*       n is a positive integer input variable set to the number */
3008 /*         of columns of a. */
3009 
3010 /*       a is an m by n array. on input a contains the matrix for */
3011 /*         which the qr factorization is to be computed. on output */
3012 /*         the strict upper trapezoidal part of a contains the strict */
3013 /*         upper trapezoidal part of r, and the lower trapezoidal */
3014 /*         part of a contains a factored form of q (the non-trivial */
3015 /*         elements of the u vectors described above). */
3016 
3017 /*       lda is a positive integer input variable not less than m */
3018 /*         which specifies the leading dimension of the array a. */
3019 
3020 /*       pivot is a logical input variable. if pivot is set true, */
3021 /*         then column pivoting is enforced. if pivot is set false, */
3022 /*         then no column pivoting is done. */
3023 
3024 /*       ipvt is an integer output array of length lipvt. ipvt */
3025 /*         defines the permutation matrix p such that a*p = q*r. */
3026 /*         column j of p is column ipvt(j) of the identity matrix. */
3027 /*         if pivot is false, ipvt is not referenced. */
3028 
3029 /*       lipvt is a positive integer input variable. if pivot is false, */
3030 /*         then lipvt may be as small as 1. if pivot is true, then */
3031 /*         lipvt must be at least n. */
3032 
3033 /*       rdiag is an output array of length n which contains the */
3034 /*         diagonal elements of r. */
3035 
3036 /*       acnorm is an output array of length n which contains the */
3037 /*         norms of the corresponding columns of the input matrix a. */
3038 /*         if this information is not needed, then acnorm can coincide */
3039 /*         with rdiag. */
3040 
3041 /*       wa is a work array of length n. if pivot is false, then wa */
3042 /*         can coincide with rdiag. */
3043 
3044 /*     subprograms called */
3045 
3046 /*       minpack-supplied ... dpmpar,enorm */
3047 
3048 /*       fortran-supplied ... dmax1,dsqrt,min0 */
3049 
3050 /*     argonne national laboratory. minpack project. march 1980. */
3051 /*     burton s. garbow, kenneth e. hillstrom, jorge j. more */
3052 
3053 /*     ********** */
3054     (void)lipvt;
3055 
3056 /*     epsmch is the machine precision. */
3057 
3058     epsmch = dpmpar(1);
3059 
3060 /*     compute the initial column norms and initialize several arrays. */
3061 
3062     for (j = 0; j < N; ++j) {
3063 	acnorm[j] = enorm<N>(&a[j * lda + 0]);
3064 	rdiag[j] = acnorm[j];
3065 	wa[j] = rdiag[j];
3066 	if (pivot) {
3067 	    ipvt[j] = j+1;
3068 	}
3069     }
3070 
3071 /*     reduce a to r with householder transformations. */
3072 
3073     for (j = 0; j < N; ++j) {
3074 	if (pivot) {
3075 
3076 /*        bring the column of largest norm into the pivot position. */
3077 
3078             int kmax = j;
3079             for (k = j; k < N; ++k) {
3080                 if (rdiag[k] > rdiag[kmax]) {
3081                     kmax = k;
3082                 }
3083             }
3084             if (kmax != j) {
3085                 for (i = 0; i < N; ++i) {
3086                     temp = a[i + j * lda];
3087                     a[i + j * lda] = a[i + kmax * lda];
3088                     a[i + kmax * lda] = temp;
3089                 }
3090                 rdiag[kmax] = rdiag[j];
3091                 wa[kmax] = wa[j];
3092                 k = ipvt[j];
3093                 ipvt[j] = ipvt[kmax];
3094                 ipvt[kmax] = k;
3095             }
3096         }
3097 
3098 /*        compute the householder transformation to reduce the */
3099 /*        j-th column of a to a multiple of the j-th unit vector. */
3100 
3101 	ajnorm = enorm(N - (j+1) + 1, &a[j + j * lda]);
3102 	if (ajnorm != 0.) {
3103             if (a[j + j * lda] < 0.) {
3104                 ajnorm = -ajnorm;
3105             }
3106             for (i = j; i < N; ++i) {
3107                 a[i + j * lda] /= ajnorm;
3108             }
3109             a[j + j * lda] += 1.;
3110 
3111 /*        apply the transformation to the remaining columns */
3112 /*        and update the norms. */
3113 
3114             jp1 = j + 1;
3115             if (N > jp1) {
3116                 for (k = jp1; k < N; ++k) {
3117                     sum = 0.;
3118                     for (i = j; i < N; ++i) {
3119                         sum += a[i + j * lda] * a[i + k * lda];
3120                     }
3121                     temp = sum / a[j + j * lda];
3122                     for (i = j; i < N; ++i) {
3123                         a[i + k * lda] -= temp * a[i + j * lda];
3124                     }
3125                     if (pivot && rdiag[k] != 0.) {
3126                         temp = a[j + k * lda] / rdiag[k];
3127                         /* Computing MAX */
3128                         d1 = 1. - temp * temp;
3129                         rdiag[k] *= sqrt((std::max((real)0.,d1)));
3130                         /* Computing 2nd power */
3131                         d1 = rdiag[k] / wa[k];
3132                         if (p05 * (d1 * d1) <= epsmch) {
3133                             rdiag[k] = enorm(N - (j+1), &a[jp1 + k * lda]);
3134                             wa[k] = rdiag[k];
3135                         }
3136                     }
3137                 }
3138             }
3139         }
3140 	rdiag[j] = -ajnorm;
3141     }
3142 
3143 /*     last card of subroutine qrfac. */
3144 #endif /* !USE_LAPACK */
3145 } /* qrfac_ */
3146 
3147 template<int N>
dogleg(const real * r,int lr,const real * diag,const real * qtb,real delta,real * x,real * wa1,real * wa2)3148 void dogleg(const real *r, int lr, const real *diag, const real *qtb, real delta, real *x,
3149 	    real *wa1, real *wa2)
3150 {
3151     /* System generated locals */
3152     real d1, d2, d3, d4;
3153 
3154     /* Local variables */
3155     int i, j, k, l, jj, jp1;
3156     real sum, temp, alpha, bnorm;
3157     real gnorm, qnorm, epsmch;
3158     real sgnorm;
3159 
3160     /* Parameter adjustments */
3161     --wa2;
3162     --wa1;
3163     --x;
3164     --qtb;
3165     --diag;
3166     --r;
3167     (void)lr;
3168 
3169     /* Function Body */
3170 
3171 /*     epsmch is the machine precision. */
3172 
3173     epsmch = dpmpar(1);
3174 
3175 /*     first, calculate the gauss-newton direction. */
3176 
3177     jj = N * (N + 1) / 2 + 1;
3178     for (k = 1; k <= N; ++k) {
3179 	j = N - k + 1;
3180 	jp1 = j + 1;
3181 	jj -= k;
3182 	l = jj + 1;
3183 	sum = 0.;
3184 	if (N >= jp1) {
3185             for (i = jp1; i <= N; ++i) {
3186                 sum += r[l] * x[i];
3187                 ++l;
3188             }
3189         }
3190 	temp = r[jj];
3191 	if (temp == 0.) {
3192             l = j;
3193             for (i = 1; i <= j; ++i) {
3194                 /* Computing MAX */
3195                 d2 = fabs(r[l]);
3196                 temp = std::max(temp,d2);
3197                 l = l + N - i;
3198             }
3199             temp = epsmch * temp;
3200             if (temp == 0.) {
3201                 temp = epsmch;
3202             }
3203         }
3204 	x[j] = (qtb[j] - sum) / temp;
3205     }
3206 
3207 /*     test whether the gauss-newton direction is acceptable. */
3208 
3209     for (j = 1; j <= N; ++j) {
3210 	wa1[j] = 0.;
3211 	wa2[j] = diag[j] * x[j];
3212     }
3213     qnorm = enorm<N>(&wa2[1]);
3214     if (qnorm <= delta) {
3215         return;
3216     }
3217 
3218 /*     the gauss-newton direction is not acceptable. */
3219 /*     next, calculate the scaled gradient direction. */
3220 
3221     l = 1;
3222     for (j = 1; j <= N; ++j) {
3223 	temp = qtb[j];
3224 	for (i = j; i <= N; ++i) {
3225 	    wa1[i] += r[l] * temp;
3226 	    ++l;
3227 	}
3228 	wa1[j] /= diag[j];
3229     }
3230 
3231 /*     calculate the norm of the scaled gradient and test for */
3232 /*     the special case in which the scaled gradient is zero. */
3233 
3234     gnorm = enorm<N>(&wa1[1]);
3235     sgnorm = 0.;
3236     alpha = delta / qnorm;
3237     if (gnorm != 0.) {
3238 
3239 /*     calculate the point along the scaled gradient */
3240 /*     at which the quadratic is minimized. */
3241 
3242         for (j = 1; j <= N; ++j) {
3243             wa1[j] = wa1[j] / gnorm / diag[j];
3244         }
3245         l = 1;
3246         for (j = 1; j <= N; ++j) {
3247             sum = 0.;
3248             for (i = j; i <= N; ++i) {
3249                 sum += r[l] * wa1[i];
3250                 ++l;
3251             }
3252             wa2[j] = sum;
3253         }
3254         temp = enorm<N>(&wa2[1]);
3255         sgnorm = gnorm / temp / temp;
3256 
3257 /*     test whether the scaled gradient direction is acceptable. */
3258 
3259         alpha = 0.;
3260         if (sgnorm < delta) {
3261 
3262 /*     the scaled gradient direction is not acceptable. */
3263 /*     finally, calculate the point along the dogleg */
3264 /*     at which the quadratic is minimized. */
3265 
3266             bnorm = enorm<N>(&qtb[1]);
3267             temp = bnorm / gnorm * (bnorm / qnorm) * (sgnorm / delta);
3268             /* Computing 2nd power */
3269             d1 = sgnorm / delta;
3270             /* Computing 2nd power */
3271             d2 = temp - delta / qnorm;
3272             /* Computing 2nd power */
3273             d3 = delta / qnorm;
3274             /* Computing 2nd power */
3275             d4 = sgnorm / delta;
3276             temp = temp - delta / qnorm * (d1 * d1)
3277                    + sqrt(d2 * d2
3278                           + (1. - d3 * d3) * (1. - d4 * d4));
3279             /* Computing 2nd power */
3280             d1 = sgnorm / delta;
3281             alpha = delta / qnorm * (1. - d1 * d1) / temp;
3282         }
3283     }
3284 
3285 /*     form appropriate convex combination of the gauss-newton */
3286 /*     direction and the scaled gradient direction. */
3287 
3288     temp = (1. - alpha) * std::min(sgnorm,delta);
3289     for (j = 1; j <= N; ++j) {
3290 	x[j] = temp * wa1[j] + alpha * x[j];
3291     }
3292 
3293 } /* dogleg_ */
3294 
3295 template<int N>
hybrdX(root_fcn * fcn_nn,void * p,real * x,real * fvec,real xtol,int maxfev,int ml,int mu,real epsfcn,real * diag,int mode,real factor,int nprint,int * nfev,real * fjac,int ldfjac,real * r,int lr,real * qtf,real * wa1,real * wa2,real * wa3,real * wa4)3296 int hybrdX(root_fcn *fcn_nn, void *p, real *x, real *
3297 	fvec, real xtol, int maxfev, int ml, int mu,
3298 	real epsfcn, real *diag, int mode, real
3299 	factor, int nprint, int *nfev, real *
3300 	fjac, int ldfjac, real *r, int lr, real *qtf,
3301 	real *wa1, real *wa2, real *wa3, real *wa4)
3302 {
3303     /* Initialized data */
3304 
3305 #define p1 .1
3306 #define p5 .5
3307 #define p001 .001
3308 #define p0001 1e-4
3309 
3310     /* System generated locals */
3311     int fjac_dim1, fjac_offset, i1;
3312     real d1, d2;
3313 
3314     /* Local variables */
3315     int i, j, l, jm1, iwa[1];
3316     real sum;
3317     int sing;
3318     int iter;
3319     real temp;
3320     int msum, iflag;
3321     real delta = 0.;
3322     int jeval;
3323     int ncsuc;
3324     real ratio;
3325     real fnorm;
3326     real pnorm, xnorm = 0., fnorm1;
3327     int nslow1, nslow2;
3328     int ncfail;
3329     real actred, epsmch, prered;
3330     int info;
3331 
3332     /* Parameter adjustments */
3333 #pragma GCC diagnostic push
3334 #pragma GCC diagnostic ignored "-Warray-bounds"
3335     --wa4;
3336     --wa3;
3337     --wa2;
3338     --wa1;
3339     --qtf;
3340     --diag;
3341     --fvec;
3342     --x;
3343     fjac_dim1 = ldfjac;
3344     fjac_offset = 1 + fjac_dim1 * 1;
3345     fjac -= fjac_offset;
3346     --r;
3347 #pragma GCC diagnostic pop
3348 
3349     /* Function Body */
3350 
3351 /*     epsmch is the machine precision. */
3352 
3353     epsmch = dpmpar(1);
3354 
3355     info = 0;
3356     iflag = 0;
3357     *nfev = 0;
3358 
3359 /*     check the input parameters for errors. */
3360 
3361     if (N <= 0 || xtol < 0. || maxfev <= 0 || ml < 0 || mu < 0 ||
3362 	    factor <= 0. || ldfjac < N || lr < N * (N + 1) / 2) {
3363 	goto TERMINATE;
3364     }
3365     if (mode == 2) {
3366         for (j = 1; j <= N; ++j) {
3367             if (diag[j] <= 0.) {
3368                 goto TERMINATE;
3369             }
3370         }
3371     }
3372 
3373 /*     evaluate the function at the starting point */
3374 /*     and calculate its norm. */
3375 
3376     iflag = fcn_nn(p, &x[1], &fvec[1], 1);
3377     *nfev = 1;
3378     if (iflag < 0) {
3379 	goto TERMINATE;
3380     }
3381     fnorm = enorm2<N>(&fvec[1]);
3382 
3383 /*     determine the number of calls to fcn needed to compute */
3384 /*     the jacobian matrix. */
3385 
3386 /* Computing MIN */
3387     i1 = ml + mu + 1;
3388     msum = std::min(i1,N);
3389 
3390 /*     initialize iteration counter and monitors. */
3391 
3392     iter = 1;
3393     ncsuc = 0;
3394     ncfail = 0;
3395     nslow1 = 0;
3396     nslow2 = 0;
3397 
3398 /*     beginning of the outer loop. */
3399 
3400     for (;;) {
3401         jeval = true;
3402 
3403 /*        calculate the jacobian matrix. */
3404 
3405         iflag = fdjac1<N>(fcn_nn, p, &x[1], &fvec[1], &fjac[fjac_offset], ldfjac,
3406 			  ml, mu, epsfcn, &wa1[1], &wa2[1]);
3407         *nfev += msum;
3408         if (iflag < 0) {
3409             goto TERMINATE;
3410         }
3411 
3412 /*        compute the qr factorization of the jacobian. */
3413 
3414         qrfac<N>(&fjac[fjac_offset], ldfjac, false, iwa, 1, &wa1[1], &wa2[1], &wa3[1]);
3415 
3416 /*        on the first iteration and if mode is 1, scale according */
3417 /*        to the norms of the columns of the initial jacobian. */
3418 
3419         if (iter == 1) {
3420             if (mode != 2) {
3421                 for (j = 1; j <= N; ++j) {
3422                     diag[j] = wa2[j];
3423                     if (wa2[j] == 0.) {
3424                         diag[j] = 1.;
3425                     }
3426                 }
3427             }
3428 
3429 /*        on the first iteration, calculate the norm of the scaled x */
3430 /*        and initialize the step bound delta. */
3431 
3432             for (j = 1; j <= N; ++j) {
3433                 wa3[j] = diag[j] * x[j];
3434             }
3435             xnorm = enorm<N>(&wa3[1]);
3436             delta = factor * xnorm;
3437             if (delta == 0.) {
3438                 delta = factor;
3439             }
3440         }
3441 
3442 /*        form (q transpose)*fvec and store in qtf. */
3443 
3444         for (i = 1; i <= N; ++i) {
3445             qtf[i] = fvec[i];
3446         }
3447         for (j = 1; j <= N; ++j) {
3448             if (fjac[j + j * fjac_dim1] != 0.) {
3449                 sum = 0.;
3450                 for (i = j; i <= N; ++i) {
3451                     sum += fjac[i + j * fjac_dim1] * qtf[i];
3452                 }
3453                 temp = -sum / fjac[j + j * fjac_dim1];
3454                 for (i = j; i <= N; ++i) {
3455                     qtf[i] += fjac[i + j * fjac_dim1] * temp;
3456                 }
3457             }
3458         }
3459 
3460 /*        copy the triangular factor of the qr factorization into r. */
3461 
3462         sing = false;
3463         for (j = 1; j <= N; ++j) {
3464             l = j;
3465             jm1 = j - 1;
3466             if (jm1 >= 1) {
3467                 for (i = 1; i <= jm1; ++i) {
3468                     r[l] = fjac[i + j * fjac_dim1];
3469                     l = l + N - i;
3470                 }
3471             }
3472             r[l] = wa1[j];
3473             if (wa1[j] == 0.) {
3474                 sing = true;
3475             }
3476         }
3477 
3478 /*        accumulate the orthogonal factor in fjac. */
3479 
3480         qform<N>(&fjac[fjac_offset], ldfjac, &wa1[1]);
3481 
3482 /*        rescale if necessary. */
3483 
3484         if (mode != 2) {
3485             for (j = 1; j <= N; ++j) {
3486                 /* Computing MAX */
3487                 d1 = diag[j], d2 = wa2[j];
3488                 diag[j] = std::max(d1,d2);
3489             }
3490         }
3491 
3492 /*        beginning of the inner loop. */
3493 
3494         for (;;) {
3495 
3496 /*           if requested, call fcn to enable printing of iterates. */
3497 
3498             if (nprint > 0) {
3499                 iflag = 0;
3500                 if ((iter - 1) % nprint == 0) {
3501                     iflag = fcn_nn(p, &x[1], &fvec[1], 0);
3502                 }
3503                 if (iflag < 0) {
3504                     goto TERMINATE;
3505                 }
3506             }
3507 
3508 /*           determine the direction p. */
3509 
3510             dogleg<N>(&r[1], lr, &diag[1], &qtf[1], delta, &wa1[1], &wa2[1], &wa3[1]);
3511 
3512 /*           store the direction p and x + p. calculate the norm of p. */
3513 
3514             for (j = 1; j <= N; ++j) {
3515                 wa1[j] = -wa1[j];
3516                 wa2[j] = x[j] + wa1[j];
3517                 wa3[j] = diag[j] * wa1[j];
3518             }
3519             pnorm = enorm<N>(&wa3[1]);
3520 
3521 /*           on the first iteration, adjust the initial step bound. */
3522 
3523             if (iter == 1) {
3524                 delta = std::min(delta,pnorm);
3525             }
3526 
3527 /*           evaluate the function at x + p and calculate its norm. */
3528 
3529             iflag = fcn_nn(p, &wa2[1], &wa4[1], 1);
3530             ++(*nfev);
3531             if (iflag < 0) {
3532                 goto TERMINATE;
3533             }
3534             fnorm1 = enorm2<N>(&wa4[1]);
3535 
3536 /*           compute the scaled actual reduction. */
3537 
3538             actred = -1.;
3539             if (fnorm1 < fnorm) {
3540                 /* already 2nd power */
3541                 actred = 1. - fnorm1 / fnorm;
3542             }
3543 
3544 /*           compute the scaled predicted reduction. */
3545 
3546             l = 1;
3547             for (i = 1; i <= N; ++i) {
3548                 sum = 0.;
3549                 for (j = i; j <= N; ++j) {
3550                     sum += r[l] * wa1[j];
3551                     ++l;
3552                 }
3553                 wa3[i] = qtf[i] + sum;
3554             }
3555             temp = enorm2<N>(&wa3[1]);
3556             prered = 0.;
3557             if (temp < fnorm) {
3558                 /* already 2nd power */
3559                 prered = 1. - temp / fnorm;
3560             }
3561 
3562 /*           compute the ratio of the actual to the predicted */
3563 /*           reduction. */
3564 
3565             ratio = 0.;
3566             if (prered > 0.) {
3567                 ratio = actred / prered;
3568             }
3569 
3570 /*           update the step bound. */
3571 
3572             if (ratio < p1) {
3573                 ncsuc = 0;
3574                 ++ncfail;
3575                 delta = p5 * delta;
3576             } else {
3577                 ncfail = 0;
3578                 ++ncsuc;
3579                 if (ratio >= p5 || ncsuc > 1) {
3580                     /* Computing MAX */
3581                     d1 = pnorm / p5;
3582                     delta = std::max(delta,d1);
3583                 }
3584                 if (fabs(ratio - 1.) <= p1) {
3585                     delta = pnorm / p5;
3586                 }
3587             }
3588 
3589 /*           test for successful iteration. */
3590 
3591             if (ratio >= p0001) {
3592 
3593 /*           successful iteration. update x, fvec, and their norms. */
3594 
3595                 for (j = 1; j <= N; ++j) {
3596                     x[j] = wa2[j];
3597                     wa2[j] = diag[j] * x[j];
3598                     fvec[j] = wa4[j];
3599                 }
3600                 xnorm = enorm<N>(&wa2[1]);
3601                 fnorm = fnorm1;
3602                 ++iter;
3603             }
3604 
3605 /*           determine the progress of the iteration. */
3606 
3607             ++nslow1;
3608             if (actred >= p001) {
3609                 nslow1 = 0;
3610             }
3611             if (jeval) {
3612                 ++nslow2;
3613             }
3614             if (actred >= p1) {
3615                 nslow2 = 0;
3616             }
3617 
3618 /*           test for convergence. */
3619 
3620             if (delta <= xtol * xnorm || fnorm == 0.) {
3621                 info = 1;
3622             }
3623             if (info != 0) {
3624                 goto TERMINATE;
3625             }
3626 
3627 /*           tests for termination and stringent tolerances. */
3628 
3629             if (*nfev >= maxfev) {
3630                 info = 2;
3631             }
3632             /* Computing MAX */
3633             d1 = p1 * delta;
3634             if (p1 * std::max(d1,pnorm) <= epsmch * xnorm) {
3635                 info = 3;
3636             }
3637             if (nslow2 == 5) {
3638                 info = 4;
3639             }
3640             if (nslow1 == 10) {
3641                 info = 5;
3642             }
3643             if (info != 0) {
3644                 goto TERMINATE;
3645             }
3646 
3647 /*           criterion for recalculating jacobian approximation */
3648 /*           by forward differences. */
3649 
3650             if (ncfail == 2) {
3651                 goto TERMINATE_INNER_LOOP;
3652             }
3653 
3654 /*           calculate the rank one modification to the jacobian */
3655 /*           and update qtf if necessary. */
3656 
3657             for (j = 1; j <= N; ++j) {
3658                 sum = 0.;
3659                 for (i = 1; i <= N; ++i) {
3660                     sum += fjac[i + j * fjac_dim1] * wa4[i];
3661                 }
3662                 wa2[j] = (sum - wa3[j]) / pnorm;
3663                 wa1[j] = diag[j] * (diag[j] * wa1[j] / pnorm);
3664                 if (ratio >= p0001) {
3665                     qtf[j] = sum;
3666                 }
3667             }
3668 
3669 /*           compute the qr factorization of the updated jacobian. */
3670 
3671             r1updt<N>(&r[1], lr, &wa1[1], &wa2[1], &wa3[1], &sing);
3672             r1mpyq<N, N>(&fjac[fjac_offset], ldfjac, &wa2[1], &wa3[1]);
3673             r1mpyq<1, N>(&qtf[1], 1, &wa2[1], &wa3[1]);
3674 
3675 /*           end of the inner loop. */
3676 
3677             jeval = false;
3678         }
3679 TERMINATE_INNER_LOOP:
3680         ;
3681 /*        end of the outer loop. */
3682 
3683     }
3684 TERMINATE:
3685 
3686 /*     termination, either normal or user imposed. */
3687 
3688     if (iflag < 0) {
3689 	info = iflag;
3690     }
3691     if (nprint > 0) {
3692 	fcn_nn(p, &x[1], &fvec[1], 0);
3693     }
3694     return info;
3695 
3696 /*     last card of subroutine hybrd. */
3697 
3698 } /* hybrd_ */
3699 
3700 
nonlin(struct nonlin_param & par)3701 static int nonlin(struct nonlin_param &par) {
3702     int maxfev, mode, nprint, ldfjac;
3703     creal xtol, epsfcn, factor;
3704     creal __attribute__((aligned(16))) fvec[2];
3705     creal __attribute__((aligned(16))) fjac[2*2];
3706     creal __attribute__((aligned(16))) qtf[2];
3707     creal __attribute__((aligned(16))) wa1[2];
3708     creal __attribute__((aligned(16))) wa2[2];
3709     creal __attribute__((aligned(16))) wa3[2];
3710     creal __attribute__((aligned(16))) wa4[2];
3711     creal diag[2] = {};
3712     int ml, mu, lr;
3713     creal r[(2*(2+1))/2];
3714     lr = (2*(2+1))/2;
3715     ml = 2-1; /* unbanded jacobian */
3716     mu = 2-1; /* unbanded jacobian */
3717     ldfjac = 2;
3718 
3719     /* parameter */
3720     xtol = 0.1;
3721     maxfev = 12;
3722     epsfcn = 0.;
3723     //mode = 2;  /* explicit variable scaling with diag */
3724     mode = 1;  /* automatic variable scaling */
3725     factor = 100000.0;
3726     nprint = 0;
3727     /**/
3728 
3729 
3730     (*par.p_val).head<8>() = (*par.p).head<8>();
3731 
3732     Matrix<creal, 8, 1> p2;
3733     Matrix<creal, 8, 1> *p_old;
3734     p2.head<8>() = (*par.p).head<8>() + Mpc;
3735     p_old = par.p;
3736     par.p = &p2;
3737 
3738 
3739     *par.info = hybrdX<2>(fcn, &par, &(*par.v)(6), fvec, xtol, maxfev, ml, mu, epsfcn,
3740                           diag, mode, factor, nprint, par.nfev, fjac, ldfjac, r, lr,
3741                           qtf, wa1, wa2, wa3, wa4);
3742     *par.fnorm = enorm<2>(fvec);
3743 
3744     int ret = 0;
3745     if (*par.info != 1) {
3746         if (!(*par.info == 5 && *par.fnorm < 1e-20)) {
3747             ret = -1;
3748         }
3749     }
3750     par.p = p_old;
3751 
3752     return ret;
3753 }
3754 
3755 
3756 } // end namespace nonlin
3757 
3758 
3759 
3760 
3761 
3762 
3763 #include <zita-resampler/resampler.h>
3764 
3765 class FixedRateResampler {
3766 private:
3767     Resampler r_up, r_down;
3768     int inputRate, outputRate;
3769     int last_in_count;
3770 public:
3771     int setup(int _inputRate, int _outputRate);
3772     int up(int count, float *input, float *output);
3773     void down(float *input, float *output);
max_out_count(int in_count)3774     int max_out_count(int in_count) {
3775 	return static_cast<int>(ceil((in_count*static_cast<double>(outputRate))/inputRate)); }
3776 };
3777 
setup(int _inputRate,int _outputRate)3778 int FixedRateResampler::setup(int _inputRate, int _outputRate)
3779 {
3780     const int qual = 16; // resulting in a total delay of 2*qual (0.7ms @44100)
3781     inputRate = _inputRate;
3782     outputRate = _outputRate;
3783     if (inputRate == outputRate) {
3784 	return 0;
3785     }
3786     // upsampler
3787     int ret = r_up.setup(inputRate, outputRate, 1, qual);
3788     if (ret) {
3789 	return ret;
3790     }
3791     // k == filtlen() == 2 * qual
3792     // pre-fill with k-1 zeros
3793     r_up.inp_count = r_up.filtlen() - 1;
3794     r_up.out_count = 1;
3795     r_up.inp_data = r_up.out_data = 0;
3796     r_up.process();
3797     // downsampler
3798     ret = r_down.setup(outputRate, inputRate, 1, qual);
3799     if (ret) {
3800 	return ret;
3801     }
3802     // k == filtlen() == 2 * qual * fact
3803     // pre-fill with k-2 zeros
3804     r_down.inp_count = r_down.filtlen() - 2;
3805     r_down.out_count = 1;
3806     r_down.inp_data = r_down.out_data = 0;
3807     r_down.process();
3808     return 0;
3809 }
3810 
up(int count,float * input,float * output)3811 int FixedRateResampler::up(int count, float *input, float *output)
3812 {
3813     if (inputRate == outputRate) {
3814 	memcpy(output, input, count*sizeof(float));
3815 	r_down.out_count = count;
3816 	return count;
3817     }
3818     r_up.inp_count = count;
3819     r_down.out_count = count+1; // +1 == trick to drain input
3820     r_up.inp_data = input;
3821     int m = max_out_count(count);
3822     r_up.out_count = m;
3823     r_up.out_data = output;
3824     r_up.process();
3825     assert(r_up.inp_count == 0);
3826     assert(r_up.out_count <= 1);
3827     r_down.inp_count = m - r_up.out_count;
3828     return r_down.inp_count;
3829 }
3830 
down(float * input,float * output)3831 void FixedRateResampler::down(float *input, float *output)
3832 {
3833     if (inputRate == outputRate) {
3834 	memcpy(output, input, r_down.out_count*sizeof(float));
3835 	return;
3836     }
3837     r_down.inp_data = input;
3838     r_down.out_data = output;
3839     r_down.process();
3840     assert(r_down.inp_count == 0);
3841     assert(r_down.out_count == 1);
3842 }
3843 
3844 FixedRateResampler smp;
3845 
3846 class DKPlugin: public PluginDef {
3847 public:
3848     float pots[0+1];
3849 private:
3850     creal pots_last[0+1];
3851     Matrix<creal, 7, 1> x_last;
3852     Array<double, 6, 1> K0;
3853     Array<double, 6, 1> K1;
3854     Array<double, 6, 1> K2;
3855     Array<double, 6, 1> K3;
3856     Array<double, 6, 1> K4;
3857     Array<double, 6, 1> K5;
3858     Array<double, 6, 1> Y;
3859     Array<double, 6, 1> X;
3860     bool resamp;
3861     unsigned int bufsize;
3862 public:
3863     EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
3864     DKPlugin();
3865     static void init(unsigned int samplingFreq, PluginDef *plugin);
3866     static void process(int count, float *input, float *output, PluginDef *plugin);
3867     static int registerparam(const ParamReg& reg);
3868     static int uiloader(const UiBuilder& builder, int form);
3869     static void del_instance(PluginDef *plugin);
3870 };
3871 
DKPlugin()3872 DKPlugin::DKPlugin():
3873     PluginDef(), pots(), pots_last(), x_last(), K0(), K1(), K2(), K3(), K4(), K5(), Y(), X() {
3874     version = PLUGINDEF_VERSION;
3875     flags = 0;
3876     id = "JCM800Pre";
3877     name = N_("JCM 800 Preamp");
3878     groups = 0;
3879     description = N_("Simulation of JCM 800 preamp circuit");
3880     category = N_("Distortion");
3881     shortname = N_("JCM800Pre");
3882     mono_audio = process;
3883     set_samplerate = init;
3884     register_params = registerparam;
3885     load_ui = uiloader;
3886     delete_instance = del_instance;
3887     for (int i = 0; i < 7; i++) {
3888         x_last(i) = x0_data[i];
3889     }
3890 }
3891 
3892 #define PARAM(p) ("JCM800Pre" "." p)
3893 
registerparam(const ParamReg & reg)3894 int DKPlugin::registerparam(const ParamReg& reg) {
3895     DKPlugin& self = *static_cast<DKPlugin*>(reg.plugin);
3896     reg.registerFloatVar(PARAM("P6v"), N_("Volume"), "S", N_(""), &self.pots[0], 0.5, 0, 1, 0.01, 0);
3897     return 0;
3898 }
3899 
init(unsigned int samplingFreq,PluginDef * plugin)3900 void DKPlugin::init(unsigned int samplingFreq, PluginDef *plugin) {
3901     DKPlugin& self = *static_cast<DKPlugin*>(plugin);
3902     if(samplingFreq != 96000) self.resamp = true;
3903     else self.resamp = false;
3904     if( self.resamp) smp.setup(samplingFreq, 96000);
3905     self.X.setZero();
3906     self.Y.setZero();
3907     unsigned int fs = samplingFreq;
3908        self.K5(0) = 1.75171807136529e-7*pow(fs,2);
3909        self.K4(0) = -7.00687228546118e-7*pow(fs,2);
3910        self.K3(0) = 1.05103084281918e-6*pow(fs,2) + 0.000200534456453583*fs;
3911        self.K2(0) = -7.00687228546118e-7*pow(fs,2) - 0.000401068912907166*fs;
3912        self.K1(0) = 1.75171807136529e-7*pow(fs,2) + 0.000200534456453583*fs + 0.0107626291380964;
3913        self.K0(0) = 0.0;
3914        self.K5(1) = -3.50343614273059e-7*pow(fs,2);
3915        self.K4(1) = 1.40137445709224e-6*pow(fs,2);
3916        self.K3(1) = -2.10206168563835e-6*pow(fs,2);
3917        self.K2(1) = 1.40137445709224e-6*pow(fs,2);
3918        self.K1(1) = -3.50343614273059e-7*pow(fs,2) + 0.0215252582761928;
3919        self.K0(1) = 0.0;
3920        self.K5(2) = 1.75171807136529e-7*pow(fs,2);
3921        self.K4(2) = -7.00687228546118e-7*pow(fs,2);
3922        self.K3(2) = 1.05103084281918e-6*pow(fs,2) - 0.000200534456453583*fs;
3923        self.K2(2) = -7.00687228546118e-7*pow(fs,2) + 0.000401068912907166*fs;
3924        self.K1(2) = 1.75171807136529e-7*pow(fs,2) - 0.000200534456453583*fs + 0.0107626291380964;
3925        self.K0(2) = 0.0;
3926        self.K5(3) = 1.70232916580416e-7*pow(fs,2);
3927        self.K4(3) = -6.75992775765549e-7*pow(fs,2);
3928        self.K3(3) = 1.00164193725804e-6*pow(fs,2) + 7.7521112860407e-5*fs;
3929        self.K2(3) = -6.51298322984981e-7*pow(fs,2) - 3.20288821276382e-5*fs;
3930        self.K1(3) = 1.50477354355961e-7*pow(fs,2) - 0.000168505574325945*fs - 0.00752160890512768;
3931        self.K0(3) = 4.93889055611368e-9*pow(fs,2) + 0.000123013343593176*fs + 0.0182842380432241;
3932        self.K5(4) = -3.40465833160831e-7*pow(fs,2);
3933        self.K4(4) = 1.3519855515311e-6*pow(fs,2);
3934        self.K3(4) = -2.00328387451608e-6*pow(fs,2);
3935        self.K2(4) = 1.30259664596996e-6*pow(fs,2);
3936        self.K1(4) = -3.00954708711922e-7*pow(fs,2) - 0.0150432178102554;
3937        self.K0(4) = -9.87778111222735e-9*pow(fs,2) + 0.0365684760864481;
3938        self.K5(5) = 1.70232916580416e-7*pow(fs,2);
3939        self.K4(5) = -6.75992775765549e-7*pow(fs,2);
3940        self.K3(5) = 1.00164193725804e-6*pow(fs,2) - 7.7521112860407e-5*fs;
3941        self.K2(5) = -6.51298322984981e-7*pow(fs,2) + 3.20288821276382e-5*fs;
3942        self.K1(5) = 1.50477354355961e-7*pow(fs,2) + 0.000168505574325945*fs - 0.00752160890512768;
3943        self.K0(5) = 4.93889055611368e-9*pow(fs,2) - 0.000123013343593176*fs + 0.0182842380432241;
3944 }
3945 
process(int n,float * u,float * o,PluginDef * plugin)3946 void DKPlugin::process(int n, float *u, float *o, PluginDef *plugin) {
3947     DKPlugin& self = *static_cast<DKPlugin*>(plugin);
3948     creal t[0+1];
3949     t[0] = (exp(5 * self.pots[0]) - 1) / (exp(5) - 1);
3950         for (int j = 0; j < n; j++) {
3951         self.pots_last[0] = 0.01 * t[0] + (1-0.01) * self.pots_last[0];
3952         double P6v = self.pots_last[0];
3953         Array<double, 6, 1> AB;
3954         AB = (((((self.K5 * P6v + self.K4) * P6v + self.K3) * P6v + self.K2) * P6v + self.K1) * P6v + self.K0);
3955         double out;
3956         out = ((u[j] * AB(0) + self.X(0) * AB(1) + self.X(1) * AB(2)) - (self.Y(0) * AB(4) + self.Y(1) * AB(5))) / AB(3);
3957         self.Y(1) = self.Y(0);
3958         self.Y(0) = out;
3959         self.X(1) = self.X(0);
3960         self.X(0) = u[j];
3961         o[j] = out;
3962     }
3963     u = o;
3964 
3965 // start copied and modified code
3966     Matrix<creal, 8, 1> mi;
3967     creal fnorm;
3968     Matrix<creal, 8, 1> mp;
3969     Array<creal, 8, 1> p_val;
3970     nonlin_param par(&mp, &mi, &g_v, &g_info, &g_nfev, &fnorm, &p_val);
3971 
3972     if( self.resamp) {
3973         self.bufsize = smp.max_out_count(n);
3974     } else {
3975         self.bufsize = n;
3976     }
3977     float buf[self.bufsize];
3978     if( self.resamp) {
3979         n = smp.up(n, u, buf);
3980     } else {
3981         memcpy(buf, u, n * sizeof(float));
3982     }
3983 
3984 #define GET_U (buf+j*1)
3985 #define DTP_U float
3986     for (int j = 0; j < n; j++) {
3987 
3988         Matrix<creal, 8, 1> dp;
3989         dp << self.x_last, Map<Matrix<float,1,1> >(GET_U).cast<creal>();
3990         mp = Mp * dp;
3991         nonlin::nonlin(par);
3992         Matrix<creal, 16, 1> d;
3993         d << self.x_last, Map<Matrix<float,1,1> >(GET_U).cast<creal>(), mi;
3994         Matrix<creal, 7, 1>& xn = self.x_last;
3995         xn = Mx * d + Mxc;
3996         Map<Matrix<float, 1, 1> > xo(buf+1*j);
3997         xo = (Mo * d).cast<float>();
3998         {
3999             static double y;
4000             static double xm1;
4001             y = 0.999345929619 * (buf[j] - xm1) + 0.998691859237 * y;
4002             xm1 = buf[j];
4003             buf[j] = y;
4004         }
4005 
4006     }
4007 #undef GET_U
4008 #undef DTP_U
4009     if (self.resamp) smp.down(buf, o);
4010     else memcpy(o, buf, n * sizeof(float));
4011 // end copied code
4012 }
4013 
uiloader(const UiBuilder & b,int form)4014 int DKPlugin::uiloader(const UiBuilder& b, int form) {
4015     if (!(form & UI_FORM_STACK)) {
4016         return -1;
4017     }
4018 
4019 b.openHorizontalhideBox("");
4020     b.create_master_slider(PARAM("P6v"), "Volume");
4021 b.closeBox();
4022 b.openHorizontalBox("");
4023 
4024     b.create_mid_rackknob(PARAM("P6v"), "Volume");
4025 b.closeBox();
4026 
4027     return 0;
4028 }
4029 
del_instance(PluginDef * p)4030 void DKPlugin::del_instance(PluginDef *p)
4031 {
4032     delete static_cast<DKPlugin*>(p);
4033 }
4034 
4035 
4036 namespace pluginlib { namespace jcm800pre {
plugin()4037 PluginDef *plugin() {
4038     return new DKPlugin;
4039 }
4040 }}
4041 
4042 #ifdef LV2_COMPILE
4043 #include "lv2/lv2plug.in/ns/lv2core/lv2.h"
4044 
4045 #define LV2_PLUGIN_URI "http://guitarix.sourceforge.net/plugins/JCM800Pre#JCM800Pre"
4046 
4047 typedef enum {
4048 	PORT_in0 = 0,
4049 	PORT_out0 = 1,
4050 	PORT_P6v = 2,
4051 } PortIndex;
4052 
4053 class LV2_DKPlugin: public DKPlugin {
4054 public:
4055 	// Port buffers
4056 	float* ports[3];
4057 public:
LV2_DKPlugin()4058     LV2_DKPlugin(): DKPlugin() {}
4059 };
4060 
4061 static LV2_Handle
instantiate(const LV2_Descriptor * descriptor,double rate,const char * bundle_path,const LV2_Feature * const * features)4062 instantiate(const LV2_Descriptor*     descriptor,
4063             double                    rate,
4064             const char*               bundle_path,
4065             const LV2_Feature* const* features)
4066 {
4067     LV2_DKPlugin *p = new LV2_DKPlugin;
4068     p->set_samplerate(rate, p);
4069     return static_cast<LV2_Handle>(p);
4070 }
4071 
4072 static void
connect_port(LV2_Handle instance,uint32_t port,void * data)4073 connect_port(LV2_Handle instance,
4074              uint32_t   port,
4075              void*      data)
4076 {
4077 	static_cast<LV2_DKPlugin*>(instance)->ports[port] = static_cast<float*>(data);
4078 }
4079 
4080 static void
activate(LV2_Handle instance)4081 activate(LV2_Handle instance)
4082 {
4083 }
4084 
4085 static void
run(LV2_Handle instance,uint32_t n_samples)4086 run(LV2_Handle instance, uint32_t n_samples)
4087 {
4088     LV2_DKPlugin* p = static_cast<LV2_DKPlugin*>(instance);
4089 
4090 	p->pots[0] = *(p->ports[2]);
4091 	p->process(n_samples, p->ports[0], p->ports[1], p);
4092 }
4093 
4094 static void
deactivate(LV2_Handle instance)4095 deactivate(LV2_Handle instance)
4096 {
4097 }
4098 
4099 static void
cleanup(LV2_Handle instance)4100 cleanup(LV2_Handle instance)
4101 {
4102     LV2_DKPlugin* p = static_cast<LV2_DKPlugin*>(instance);
4103     p->delete_instance(p);
4104 }
4105 
4106 static const void*
extension_data(const char * uri)4107 extension_data(const char* uri)
4108 {
4109 	return NULL;
4110 }
4111 
4112 static const LV2_Descriptor descriptor = {
4113 	LV2_PLUGIN_URI,
4114 	instantiate,
4115 	connect_port,
4116 	activate,
4117 	run,
4118 	deactivate,
4119 	cleanup,
4120 	extension_data
4121 };
4122 
4123 LV2_SYMBOL_EXPORT
4124 extern "C" __attribute__ ((visibility ("default")))
4125 const LV2_Descriptor*
lv2_descriptor(uint32_t index)4126 lv2_descriptor(uint32_t index)
4127 {
4128 	switch (index) {
4129 	case 0:
4130 		return &descriptor;
4131 	default:
4132 		return NULL;
4133 	}
4134 }
4135 #endif
4136