Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tradoptest_18.cpp
Go to the documentation of this file.
1 
2 
3 /* Try to test all combinations of types and operations */
4 
5 
6 
7 #define ADT_RAD Sacado::Rad::
8 
9 
10 
11 #include "Sacado_trad.hpp"
12 
13 #include <cstdio>
14 
15 using std::printf;
16 
17 
18 
19 typedef ADT_RAD IndepADvar<double> AI;
20 
21 typedef ADT_RAD ADvar<double> A;
22 
23 typedef ADT_RAD ConstADvar<double> C;
24 
25 typedef ADT_RAD ADvari<double> Ai;
26 
27 typedef const ADT_RAD IndepADvar<double> cAI;
28 
29 typedef const ADT_RAD ADvar<double> cA;
30 
31 typedef const ADT_RAD ConstADvar<double> cC;
32 
33 typedef const ADT_RAD ADvari<double> cAi;
34 
35 static int rc;
36 
37 
38 
39 /* This is to be run through an awk program that changes lines */
40 
41 /* with "BINTEST" or "UNOPTEST" at the beginning of the line into */
42 
43 /* a the desired C++ (which we can then inspect). */
44 
45 
46 
47  void
48 
49 botch(const char *what, double wanted, double got)
50 
51 {
52 
53  printf("%s: expected %g, got %g, diff = %.2g\n", what, wanted, got, wanted-got);
54 
55  rc = 1;
56 
57  }
58 
59 
60 
61  const double tol = 5e-16;
62 
63 
64 
65  int
66 
67 differ(double a, double b)
68 
69 {
70 
71  double d = a - b;
72 
73  if (d < 0.)
74 
75  d = -d;
76 
77  if (a < 0.)
78 
79  a = -a;
80 
81  if (b < 0.)
82 
83  b = -b;
84 
85  if (a < b)
86 
87  a = b;
88 
89  if (a > 0.)
90 
91  d /= a;
92 
93  return d > tol;
94 
95  }
96 
97 
98 
99 #ifndef RAD_EQ_ALIAS
100 
101 #define Plus_dx 1.
102 
103 #else
104 
105 #ifdef RAD_AUTO_AD_Const
106 
107 #define Plus_dx 1.
108 
109 #else
110 
111 #define Plus_dx 0.
112 
113 #endif
114 
115 #endif
116 
117 
118 
119  int
120 
121 main(void)
122 
123 {
124 
125  AI xAI, yAI;
126 
127  A fA, xA, yA;
128 
129  C xC, yC;
130 
131  double dx, dy, f, xd, yd;
132 
133  long xL, yL;
134 
135  int xi, yi;
136 
137 
138 
139  rc = 0;
140 
141 
142  /**** Test of operator!= ****/
143 
144  xd = 4.; yd = 4.; f = 0.; dx = 0.; dy = 0.;
145  xAI = xd;
146  yAI = yd;
147  fA = operator!=(xAI,yAI);
148  A::Gradcomp();
149  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,yAI)", f, fA.val());
150  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,yAI)/dx", dx, xAI.adj());
151  else if (differ(yAI.adj(), dy)) botch("d operator!=(xAI,yAI)/dy", dy, yAI.adj());
152  {
153  A::aval_reset();
154  cAI xcAI(xd);
155  yAI = yd;
156  fA = operator!=(xcAI,yAI);
157  A::Gradcomp();
158  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,yAI)", f, fA.val());
159  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,yAI)/dx", dx, xcAI.adj());
160  else if (differ(yAI.adj(), dy)) botch("d operator!=(xcAI,yAI)/dy", dy, yAI.adj());
161  }
162  {
163  A::aval_reset();
164  xAI = xd;
165  cAI ycAI(yd);
166  fA = operator!=(xAI,ycAI);
167  A::Gradcomp();
168  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,ycAI)", f, fA.val());
169  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,ycAI)/dx", dx, xAI.adj());
170  else if (differ(ycAI.adj(), dy)) botch("d operator!=(xAI,ycAI)/dy", dy, ycAI.adj());
171  }
172  {
173  A::aval_reset();
174  cAI xcAI(xd);
175  cAI ycAI(yd);
176  fA = operator!=(xcAI,ycAI);
177  A::Gradcomp();
178  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,ycAI)", f, fA.val());
179  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,ycAI)/dx", dx, xcAI.adj());
180  else if (differ(ycAI.adj(), dy)) botch("d operator!=(xcAI,ycAI)/dy", dy, ycAI.adj());
181  }
182  xAI = xd;
183  yA = yd;
184  fA = operator!=(xAI,yA);
185  A::Gradcomp();
186  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,yA)", f, fA.val());
187  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,yA)/dx", dx, xAI.adj());
188  else if (differ(yA.adj(), dy)) botch("d operator!=(xAI,yA)/dy", dy, yA.adj());
189  {
190  A::aval_reset();
191  cAI xcAI(xd);
192  yA = yd;
193  fA = operator!=(xcAI,yA);
194  A::Gradcomp();
195  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,yA)", f, fA.val());
196  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,yA)/dx", dx, xcAI.adj());
197  else if (differ(yA.adj(), dy)) botch("d operator!=(xcAI,yA)/dy", dy, yA.adj());
198  }
199  {
200  A::aval_reset();
201  xAI = xd;
202  cA ycA(yd);
203  fA = operator!=(xAI,ycA);
204  A::Gradcomp();
205  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,ycA)", f, fA.val());
206  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,ycA)/dx", dx, xAI.adj());
207  else if (differ(ycA.adj(), dy)) botch("d operator!=(xAI,ycA)/dy", dy, ycA.adj());
208  }
209  {
210  A::aval_reset();
211  cAI xcAI(xd);
212  cA ycA(yd);
213  fA = operator!=(xcAI,ycA);
214  A::Gradcomp();
215  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,ycA)", f, fA.val());
216  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,ycA)/dx", dx, xcAI.adj());
217  else if (differ(ycA.adj(), dy)) botch("d operator!=(xcAI,ycA)/dy", dy, ycA.adj());
218  }
219  xAI = xd;
220  yC = yd;
221  fA = operator!=(xAI,yC);
222  A::Gradcomp();
223  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,yC)", f, fA.val());
224  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,yC)/dx", dx, xAI.adj());
225  else if (differ(yC.adj(), dy)) botch("d operator!=(xAI,yC)/dy", dy, yC.adj());
226  {
227  A::aval_reset();
228  cAI xcAI(xd);
229  yC = yd;
230  fA = operator!=(xcAI,yC);
231  A::Gradcomp();
232  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,yC)", f, fA.val());
233  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,yC)/dx", dx, xcAI.adj());
234  else if (differ(yC.adj(), dy)) botch("d operator!=(xcAI,yC)/dy", dy, yC.adj());
235  }
236  {
237  A::aval_reset();
238  xAI = xd;
239  cC ycC(yd);
240  fA = operator!=(xAI,ycC);
241  A::Gradcomp();
242  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,ycC)", f, fA.val());
243  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,ycC)/dx", dx, xAI.adj());
244  else if (differ(ycC.adj(), dy)) botch("d operator!=(xAI,ycC)/dy", dy, ycC.adj());
245  }
246  {
247  A::aval_reset();
248  cAI xcAI(xd);
249  cC ycC(yd);
250  fA = operator!=(xcAI,ycC);
251  A::Gradcomp();
252  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,ycC)", f, fA.val());
253  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,ycC)/dx", dx, xcAI.adj());
254  else if (differ(ycC.adj(), dy)) botch("d operator!=(xcAI,ycC)/dy", dy, ycC.adj());
255  }
256  {
257  xAI = xd;
258  Ai yAi(yd);
259  fA = operator!=(xAI,yAi);
260  A::Gradcomp();
261  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,yAi)", f, fA.val());
262  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,yAi)/dx", dx, xAI.adj());
263  else if (differ(yAi.aval, dy)) botch("d operator!=(xAI,yAi)/dy", dy, yAi.aval);
264  }
265  {
266  A::aval_reset();
267  cAI xcAI(xd);
268  Ai yAi(yd);
269  fA = operator!=(xcAI,yAi);
270  A::Gradcomp();
271  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,yAi)", f, fA.val());
272  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,yAi)/dx", dx, xcAI.adj());
273  else if (differ(yAi.aval, dy)) botch("d operator!=(xcAI,yAi)/dy", dy, yAi.aval);
274  }
275  {
276  A::aval_reset();
277  xAI = xd;
278  cAi ycAi(yd);
279  fA = operator!=(xAI,ycAi);
280  A::Gradcomp();
281  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,ycAi)", f, fA.val());
282  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,ycAi)/dx", dx, xAI.adj());
283  else if (differ(ycAi.aval, dy)) botch("d operator!=(xAI,ycAi)/dy", dy, ycAi.aval);
284  }
285  {
286  A::aval_reset();
287  cAI xcAI(xd);
288  cAi ycAi(yd);
289  fA = operator!=(xcAI,ycAi);
290  A::Gradcomp();
291  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,ycAi)", f, fA.val());
292  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,ycAi)/dx", dx, xcAI.adj());
293  else if (differ(ycAi.aval, dy)) botch("d operator!=(xcAI,ycAi)/dy", dy, ycAi.aval);
294  }
295  xAI = xd;
296  fA = operator!=(xAI,yd);
297  A::Gradcomp();
298  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,yd)", f, fA.val());
299  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,yd)/dx", dx, xAI.adj());
300  {
301  A::aval_reset();
302  cAI xcAI(xd);
303  fA = operator!=(xcAI,yd);
304  A::Gradcomp();
305  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,yd)", f, fA.val());
306  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,yd)/dx", dx, xcAI.adj());
307  }
308  xAI = xd;
309  yL = (long)yd;
310  fA = operator!=(xAI,yL);
311  A::Gradcomp();
312  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,yL)", f, fA.val());
313  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,yL)/dx", dx, xAI.adj());
314  {
315  A::aval_reset();
316  cAI xcAI(xd);
317  yL = (long)yd;
318  fA = operator!=(xcAI,yL);
319  A::Gradcomp();
320  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,yL)", f, fA.val());
321  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,yL)/dx", dx, xcAI.adj());
322  }
323  xAI = xd;
324  yi = (int)yd;
325  fA = operator!=(xAI,yi);
326  A::Gradcomp();
327  if (differ(fA.val(), f)) botch("fA = operator!=(xAI,yi)", f, fA.val());
328  else if (differ(xAI.adj(), dx)) botch("d operator!=(xAI,yi)/dx", dx, xAI.adj());
329  {
330  A::aval_reset();
331  cAI xcAI(xd);
332  yi = (int)yd;
333  fA = operator!=(xcAI,yi);
334  A::Gradcomp();
335  if (differ(fA.val(), f)) botch("fA = operator!=(xcAI,yi)", f, fA.val());
336  else if (differ(xcAI.adj(), dx)) botch("d operator!=(xcAI,yi)/dx", dx, xcAI.adj());
337  }
338  xA = xd;
339  yAI = yd;
340  fA = operator!=(xA,yAI);
341  A::Gradcomp();
342  if (differ(fA.val(), f)) botch("fA = operator!=(xA,yAI)", f, fA.val());
343  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,yAI)/dx", dx, xA.adj());
344  else if (differ(yAI.adj(), dy)) botch("d operator!=(xA,yAI)/dy", dy, yAI.adj());
345  {
346  A::aval_reset();
347  cA xcA(xd);
348  yAI = yd;
349  fA = operator!=(xcA,yAI);
350  A::Gradcomp();
351  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,yAI)", f, fA.val());
352  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,yAI)/dx", dx, xcA.adj());
353  else if (differ(yAI.adj(), dy)) botch("d operator!=(xcA,yAI)/dy", dy, yAI.adj());
354  }
355  {
356  A::aval_reset();
357  xA = xd;
358  cAI ycAI(yd);
359  fA = operator!=(xA,ycAI);
360  A::Gradcomp();
361  if (differ(fA.val(), f)) botch("fA = operator!=(xA,ycAI)", f, fA.val());
362  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,ycAI)/dx", dx, xA.adj());
363  else if (differ(ycAI.adj(), dy)) botch("d operator!=(xA,ycAI)/dy", dy, ycAI.adj());
364  }
365  {
366  A::aval_reset();
367  cA xcA(xd);
368  cAI ycAI(yd);
369  fA = operator!=(xcA,ycAI);
370  A::Gradcomp();
371  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,ycAI)", f, fA.val());
372  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,ycAI)/dx", dx, xcA.adj());
373  else if (differ(ycAI.adj(), dy)) botch("d operator!=(xcA,ycAI)/dy", dy, ycAI.adj());
374  }
375  xA = xd;
376  yA = yd;
377  fA = operator!=(xA,yA);
378  A::Gradcomp();
379  if (differ(fA.val(), f)) botch("fA = operator!=(xA,yA)", f, fA.val());
380  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,yA)/dx", dx, xA.adj());
381  else if (differ(yA.adj(), dy)) botch("d operator!=(xA,yA)/dy", dy, yA.adj());
382  {
383  A::aval_reset();
384  cA xcA(xd);
385  yA = yd;
386  fA = operator!=(xcA,yA);
387  A::Gradcomp();
388  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,yA)", f, fA.val());
389  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,yA)/dx", dx, xcA.adj());
390  else if (differ(yA.adj(), dy)) botch("d operator!=(xcA,yA)/dy", dy, yA.adj());
391  }
392  {
393  A::aval_reset();
394  xA = xd;
395  cA ycA(yd);
396  fA = operator!=(xA,ycA);
397  A::Gradcomp();
398  if (differ(fA.val(), f)) botch("fA = operator!=(xA,ycA)", f, fA.val());
399  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,ycA)/dx", dx, xA.adj());
400  else if (differ(ycA.adj(), dy)) botch("d operator!=(xA,ycA)/dy", dy, ycA.adj());
401  }
402  {
403  A::aval_reset();
404  cA xcA(xd);
405  cA ycA(yd);
406  fA = operator!=(xcA,ycA);
407  A::Gradcomp();
408  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,ycA)", f, fA.val());
409  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,ycA)/dx", dx, xcA.adj());
410  else if (differ(ycA.adj(), dy)) botch("d operator!=(xcA,ycA)/dy", dy, ycA.adj());
411  }
412  xA = xd;
413  yC = yd;
414  fA = operator!=(xA,yC);
415  A::Gradcomp();
416  if (differ(fA.val(), f)) botch("fA = operator!=(xA,yC)", f, fA.val());
417  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,yC)/dx", dx, xA.adj());
418  else if (differ(yC.adj(), dy)) botch("d operator!=(xA,yC)/dy", dy, yC.adj());
419  {
420  A::aval_reset();
421  cA xcA(xd);
422  yC = yd;
423  fA = operator!=(xcA,yC);
424  A::Gradcomp();
425  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,yC)", f, fA.val());
426  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,yC)/dx", dx, xcA.adj());
427  else if (differ(yC.adj(), dy)) botch("d operator!=(xcA,yC)/dy", dy, yC.adj());
428  }
429  {
430  A::aval_reset();
431  xA = xd;
432  cC ycC(yd);
433  fA = operator!=(xA,ycC);
434  A::Gradcomp();
435  if (differ(fA.val(), f)) botch("fA = operator!=(xA,ycC)", f, fA.val());
436  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,ycC)/dx", dx, xA.adj());
437  else if (differ(ycC.adj(), dy)) botch("d operator!=(xA,ycC)/dy", dy, ycC.adj());
438  }
439  {
440  A::aval_reset();
441  cA xcA(xd);
442  cC ycC(yd);
443  fA = operator!=(xcA,ycC);
444  A::Gradcomp();
445  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,ycC)", f, fA.val());
446  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,ycC)/dx", dx, xcA.adj());
447  else if (differ(ycC.adj(), dy)) botch("d operator!=(xcA,ycC)/dy", dy, ycC.adj());
448  }
449  {
450  xA = xd;
451  Ai yAi(yd);
452  fA = operator!=(xA,yAi);
453  A::Gradcomp();
454  if (differ(fA.val(), f)) botch("fA = operator!=(xA,yAi)", f, fA.val());
455  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,yAi)/dx", dx, xA.adj());
456  else if (differ(yAi.aval, dy)) botch("d operator!=(xA,yAi)/dy", dy, yAi.aval);
457  }
458  {
459  A::aval_reset();
460  cA xcA(xd);
461  Ai yAi(yd);
462  fA = operator!=(xcA,yAi);
463  A::Gradcomp();
464  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,yAi)", f, fA.val());
465  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,yAi)/dx", dx, xcA.adj());
466  else if (differ(yAi.aval, dy)) botch("d operator!=(xcA,yAi)/dy", dy, yAi.aval);
467  }
468  {
469  A::aval_reset();
470  xA = xd;
471  cAi ycAi(yd);
472  fA = operator!=(xA,ycAi);
473  A::Gradcomp();
474  if (differ(fA.val(), f)) botch("fA = operator!=(xA,ycAi)", f, fA.val());
475  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,ycAi)/dx", dx, xA.adj());
476  else if (differ(ycAi.aval, dy)) botch("d operator!=(xA,ycAi)/dy", dy, ycAi.aval);
477  }
478  {
479  A::aval_reset();
480  cA xcA(xd);
481  cAi ycAi(yd);
482  fA = operator!=(xcA,ycAi);
483  A::Gradcomp();
484  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,ycAi)", f, fA.val());
485  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,ycAi)/dx", dx, xcA.adj());
486  else if (differ(ycAi.aval, dy)) botch("d operator!=(xcA,ycAi)/dy", dy, ycAi.aval);
487  }
488  xA = xd;
489  fA = operator!=(xA,yd);
490  A::Gradcomp();
491  if (differ(fA.val(), f)) botch("fA = operator!=(xA,yd)", f, fA.val());
492  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,yd)/dx", dx, xA.adj());
493  {
494  A::aval_reset();
495  cA xcA(xd);
496  fA = operator!=(xcA,yd);
497  A::Gradcomp();
498  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,yd)", f, fA.val());
499  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,yd)/dx", dx, xcA.adj());
500  }
501  xA = xd;
502  yL = (long)yd;
503  fA = operator!=(xA,yL);
504  A::Gradcomp();
505  if (differ(fA.val(), f)) botch("fA = operator!=(xA,yL)", f, fA.val());
506  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,yL)/dx", dx, xA.adj());
507  {
508  A::aval_reset();
509  cA xcA(xd);
510  yL = (long)yd;
511  fA = operator!=(xcA,yL);
512  A::Gradcomp();
513  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,yL)", f, fA.val());
514  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,yL)/dx", dx, xcA.adj());
515  }
516  xA = xd;
517  yi = (int)yd;
518  fA = operator!=(xA,yi);
519  A::Gradcomp();
520  if (differ(fA.val(), f)) botch("fA = operator!=(xA,yi)", f, fA.val());
521  else if (differ(xA.adj(), dx)) botch("d operator!=(xA,yi)/dx", dx, xA.adj());
522  {
523  A::aval_reset();
524  cA xcA(xd);
525  yi = (int)yd;
526  fA = operator!=(xcA,yi);
527  A::Gradcomp();
528  if (differ(fA.val(), f)) botch("fA = operator!=(xcA,yi)", f, fA.val());
529  else if (differ(xcA.adj(), dx)) botch("d operator!=(xcA,yi)/dx", dx, xcA.adj());
530  }
531  xC = xd;
532  yAI = yd;
533  fA = operator!=(xC,yAI);
534  A::Gradcomp();
535  if (differ(fA.val(), f)) botch("fA = operator!=(xC,yAI)", f, fA.val());
536  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,yAI)/dx", dx, xC.adj());
537  else if (differ(yAI.adj(), dy)) botch("d operator!=(xC,yAI)/dy", dy, yAI.adj());
538  {
539  A::aval_reset();
540  cC xcC(xd);
541  yAI = yd;
542  fA = operator!=(xcC,yAI);
543  A::Gradcomp();
544  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,yAI)", f, fA.val());
545  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,yAI)/dx", dx, xcC.adj());
546  else if (differ(yAI.adj(), dy)) botch("d operator!=(xcC,yAI)/dy", dy, yAI.adj());
547  }
548  {
549  A::aval_reset();
550  xC = xd;
551  cAI ycAI(yd);
552  fA = operator!=(xC,ycAI);
553  A::Gradcomp();
554  if (differ(fA.val(), f)) botch("fA = operator!=(xC,ycAI)", f, fA.val());
555  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,ycAI)/dx", dx, xC.adj());
556  else if (differ(ycAI.adj(), dy)) botch("d operator!=(xC,ycAI)/dy", dy, ycAI.adj());
557  }
558  {
559  A::aval_reset();
560  cC xcC(xd);
561  cAI ycAI(yd);
562  fA = operator!=(xcC,ycAI);
563  A::Gradcomp();
564  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,ycAI)", f, fA.val());
565  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,ycAI)/dx", dx, xcC.adj());
566  else if (differ(ycAI.adj(), dy)) botch("d operator!=(xcC,ycAI)/dy", dy, ycAI.adj());
567  }
568  xC = xd;
569  yA = yd;
570  fA = operator!=(xC,yA);
571  A::Gradcomp();
572  if (differ(fA.val(), f)) botch("fA = operator!=(xC,yA)", f, fA.val());
573  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,yA)/dx", dx, xC.adj());
574  else if (differ(yA.adj(), dy)) botch("d operator!=(xC,yA)/dy", dy, yA.adj());
575  {
576  A::aval_reset();
577  cC xcC(xd);
578  yA = yd;
579  fA = operator!=(xcC,yA);
580  A::Gradcomp();
581  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,yA)", f, fA.val());
582  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,yA)/dx", dx, xcC.adj());
583  else if (differ(yA.adj(), dy)) botch("d operator!=(xcC,yA)/dy", dy, yA.adj());
584  }
585  {
586  A::aval_reset();
587  xC = xd;
588  cA ycA(yd);
589  fA = operator!=(xC,ycA);
590  A::Gradcomp();
591  if (differ(fA.val(), f)) botch("fA = operator!=(xC,ycA)", f, fA.val());
592  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,ycA)/dx", dx, xC.adj());
593  else if (differ(ycA.adj(), dy)) botch("d operator!=(xC,ycA)/dy", dy, ycA.adj());
594  }
595  {
596  A::aval_reset();
597  cC xcC(xd);
598  cA ycA(yd);
599  fA = operator!=(xcC,ycA);
600  A::Gradcomp();
601  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,ycA)", f, fA.val());
602  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,ycA)/dx", dx, xcC.adj());
603  else if (differ(ycA.adj(), dy)) botch("d operator!=(xcC,ycA)/dy", dy, ycA.adj());
604  }
605  xC = xd;
606  yC = yd;
607  fA = operator!=(xC,yC);
608  A::Gradcomp();
609  if (differ(fA.val(), f)) botch("fA = operator!=(xC,yC)", f, fA.val());
610  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,yC)/dx", dx, xC.adj());
611  else if (differ(yC.adj(), dy)) botch("d operator!=(xC,yC)/dy", dy, yC.adj());
612  {
613  A::aval_reset();
614  cC xcC(xd);
615  yC = yd;
616  fA = operator!=(xcC,yC);
617  A::Gradcomp();
618  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,yC)", f, fA.val());
619  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,yC)/dx", dx, xcC.adj());
620  else if (differ(yC.adj(), dy)) botch("d operator!=(xcC,yC)/dy", dy, yC.adj());
621  }
622  {
623  A::aval_reset();
624  xC = xd;
625  cC ycC(yd);
626  fA = operator!=(xC,ycC);
627  A::Gradcomp();
628  if (differ(fA.val(), f)) botch("fA = operator!=(xC,ycC)", f, fA.val());
629  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,ycC)/dx", dx, xC.adj());
630  else if (differ(ycC.adj(), dy)) botch("d operator!=(xC,ycC)/dy", dy, ycC.adj());
631  }
632  {
633  A::aval_reset();
634  cC xcC(xd);
635  cC ycC(yd);
636  fA = operator!=(xcC,ycC);
637  A::Gradcomp();
638  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,ycC)", f, fA.val());
639  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,ycC)/dx", dx, xcC.adj());
640  else if (differ(ycC.adj(), dy)) botch("d operator!=(xcC,ycC)/dy", dy, ycC.adj());
641  }
642  {
643  xC = xd;
644  Ai yAi(yd);
645  fA = operator!=(xC,yAi);
646  A::Gradcomp();
647  if (differ(fA.val(), f)) botch("fA = operator!=(xC,yAi)", f, fA.val());
648  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,yAi)/dx", dx, xC.adj());
649  else if (differ(yAi.aval, dy)) botch("d operator!=(xC,yAi)/dy", dy, yAi.aval);
650  }
651  {
652  A::aval_reset();
653  cC xcC(xd);
654  Ai yAi(yd);
655  fA = operator!=(xcC,yAi);
656  A::Gradcomp();
657  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,yAi)", f, fA.val());
658  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,yAi)/dx", dx, xcC.adj());
659  else if (differ(yAi.aval, dy)) botch("d operator!=(xcC,yAi)/dy", dy, yAi.aval);
660  }
661  {
662  A::aval_reset();
663  xC = xd;
664  cAi ycAi(yd);
665  fA = operator!=(xC,ycAi);
666  A::Gradcomp();
667  if (differ(fA.val(), f)) botch("fA = operator!=(xC,ycAi)", f, fA.val());
668  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,ycAi)/dx", dx, xC.adj());
669  else if (differ(ycAi.aval, dy)) botch("d operator!=(xC,ycAi)/dy", dy, ycAi.aval);
670  }
671  {
672  A::aval_reset();
673  cC xcC(xd);
674  cAi ycAi(yd);
675  fA = operator!=(xcC,ycAi);
676  A::Gradcomp();
677  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,ycAi)", f, fA.val());
678  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,ycAi)/dx", dx, xcC.adj());
679  else if (differ(ycAi.aval, dy)) botch("d operator!=(xcC,ycAi)/dy", dy, ycAi.aval);
680  }
681  xC = xd;
682  fA = operator!=(xC,yd);
683  A::Gradcomp();
684  if (differ(fA.val(), f)) botch("fA = operator!=(xC,yd)", f, fA.val());
685  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,yd)/dx", dx, xC.adj());
686  {
687  A::aval_reset();
688  cC xcC(xd);
689  fA = operator!=(xcC,yd);
690  A::Gradcomp();
691  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,yd)", f, fA.val());
692  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,yd)/dx", dx, xcC.adj());
693  }
694  xC = xd;
695  yL = (long)yd;
696  fA = operator!=(xC,yL);
697  A::Gradcomp();
698  if (differ(fA.val(), f)) botch("fA = operator!=(xC,yL)", f, fA.val());
699  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,yL)/dx", dx, xC.adj());
700  {
701  A::aval_reset();
702  cC xcC(xd);
703  yL = (long)yd;
704  fA = operator!=(xcC,yL);
705  A::Gradcomp();
706  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,yL)", f, fA.val());
707  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,yL)/dx", dx, xcC.adj());
708  }
709  xC = xd;
710  yi = (int)yd;
711  fA = operator!=(xC,yi);
712  A::Gradcomp();
713  if (differ(fA.val(), f)) botch("fA = operator!=(xC,yi)", f, fA.val());
714  else if (differ(xC.adj(), dx)) botch("d operator!=(xC,yi)/dx", dx, xC.adj());
715  {
716  A::aval_reset();
717  cC xcC(xd);
718  yi = (int)yd;
719  fA = operator!=(xcC,yi);
720  A::Gradcomp();
721  if (differ(fA.val(), f)) botch("fA = operator!=(xcC,yi)", f, fA.val());
722  else if (differ(xcC.adj(), dx)) botch("d operator!=(xcC,yi)/dx", dx, xcC.adj());
723  }
724  {
725  Ai xAi(xd);
726  yAI = yd;
727  fA = operator!=(xAi,yAI);
728  A::Gradcomp();
729  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,yAI)", f, fA.val());
730  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,yAI)/dx", dx, xAi.aval);
731  else if (differ(yAI.adj(), dy)) botch("d operator!=(xAi,yAI)/dy", dy, yAI.adj());
732  }
733  {
734  A::aval_reset();
735  cAi xcAi(xd);
736  yAI = yd;
737  fA = operator!=(xcAi,yAI);
738  A::Gradcomp();
739  if (differ(fA.val(), f)) botch("fA = operator!=(xcAi,yAI)", f, fA.val());
740  else if (differ(xcAi.aval, dx)) botch("d operator!=(xcAi,yAI)/dx", dx, xcAi.aval);
741  else if (differ(yAI.adj(), dy)) botch("d operator!=(xcAi,yAI)/dy", dy, yAI.adj());
742  }
743  {
744  A::aval_reset();
745  Ai xAi(xd);
746  cAI ycAI(yd);
747  fA = operator!=(xAi,ycAI);
748  A::Gradcomp();
749  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,ycAI)", f, fA.val());
750  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,ycAI)/dx", dx, xAi.aval);
751  else if (differ(ycAI.adj(), dy)) botch("d operator!=(xAi,ycAI)/dy", dy, ycAI.adj());
752  }
753  {
754  Ai xAi(xd);
755  yA = yd;
756  fA = operator!=(xAi,yA);
757  A::Gradcomp();
758  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,yA)", f, fA.val());
759  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,yA)/dx", dx, xAi.aval);
760  else if (differ(yA.adj(), dy)) botch("d operator!=(xAi,yA)/dy", dy, yA.adj());
761  }
762  {
763  A::aval_reset();
764  cAi xcAi(xd);
765  yA = yd;
766  fA = operator!=(xcAi,yA);
767  A::Gradcomp();
768  if (differ(fA.val(), f)) botch("fA = operator!=(xcAi,yA)", f, fA.val());
769  else if (differ(xcAi.aval, dx)) botch("d operator!=(xcAi,yA)/dx", dx, xcAi.aval);
770  else if (differ(yA.adj(), dy)) botch("d operator!=(xcAi,yA)/dy", dy, yA.adj());
771  }
772  {
773  A::aval_reset();
774  Ai xAi(xd);
775  cA ycA(yd);
776  fA = operator!=(xAi,ycA);
777  A::Gradcomp();
778  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,ycA)", f, fA.val());
779  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,ycA)/dx", dx, xAi.aval);
780  else if (differ(ycA.adj(), dy)) botch("d operator!=(xAi,ycA)/dy", dy, ycA.adj());
781  }
782  {
783  Ai xAi(xd);
784  yC = yd;
785  fA = operator!=(xAi,yC);
786  A::Gradcomp();
787  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,yC)", f, fA.val());
788  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,yC)/dx", dx, xAi.aval);
789  else if (differ(yC.adj(), dy)) botch("d operator!=(xAi,yC)/dy", dy, yC.adj());
790  }
791  {
792  A::aval_reset();
793  cAi xcAi(xd);
794  yC = yd;
795  fA = operator!=(xcAi,yC);
796  A::Gradcomp();
797  if (differ(fA.val(), f)) botch("fA = operator!=(xcAi,yC)", f, fA.val());
798  else if (differ(xcAi.aval, dx)) botch("d operator!=(xcAi,yC)/dx", dx, xcAi.aval);
799  else if (differ(yC.adj(), dy)) botch("d operator!=(xcAi,yC)/dy", dy, yC.adj());
800  }
801  {
802  A::aval_reset();
803  Ai xAi(xd);
804  cC ycC(yd);
805  fA = operator!=(xAi,ycC);
806  A::Gradcomp();
807  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,ycC)", f, fA.val());
808  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,ycC)/dx", dx, xAi.aval);
809  else if (differ(ycC.adj(), dy)) botch("d operator!=(xAi,ycC)/dy", dy, ycC.adj());
810  }
811  {
812  Ai xAi(xd);
813  Ai yAi(yd);
814  fA = operator!=(xAi,yAi);
815  A::Gradcomp();
816  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,yAi)", f, fA.val());
817  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,yAi)/dx", dx, xAi.aval);
818  else if (differ(yAi.aval, dy)) botch("d operator!=(xAi,yAi)/dy", dy, yAi.aval);
819  }
820  {
821  A::aval_reset();
822  cAi xcAi(xd);
823  Ai yAi(yd);
824  fA = operator!=(xcAi,yAi);
825  A::Gradcomp();
826  if (differ(fA.val(), f)) botch("fA = operator!=(xcAi,yAi)", f, fA.val());
827  else if (differ(xcAi.aval, dx)) botch("d operator!=(xcAi,yAi)/dx", dx, xcAi.aval);
828  else if (differ(yAi.aval, dy)) botch("d operator!=(xcAi,yAi)/dy", dy, yAi.aval);
829  }
830  {
831  A::aval_reset();
832  Ai xAi(xd);
833  cAi ycAi(yd);
834  fA = operator!=(xAi,ycAi);
835  A::Gradcomp();
836  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,ycAi)", f, fA.val());
837  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,ycAi)/dx", dx, xAi.aval);
838  else if (differ(ycAi.aval, dy)) botch("d operator!=(xAi,ycAi)/dy", dy, ycAi.aval);
839  }
840  {
841  Ai xAi(xd);
842  fA = operator!=(xAi,yd);
843  A::Gradcomp();
844  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,yd)", f, fA.val());
845  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,yd)/dx", dx, xAi.aval);
846  }
847  {
848  A::aval_reset();
849  cAi xcAi(xd);
850  fA = operator!=(xcAi,yd);
851  A::Gradcomp();
852  if (differ(fA.val(), f)) botch("fA = operator!=(xcAi,yd)", f, fA.val());
853  else if (differ(xcAi.aval, dx)) botch("d operator!=(xcAi,yd)/dx", dx, xcAi.aval);
854  }
855  {
856  Ai xAi(xd);
857  yL = (long)yd;
858  fA = operator!=(xAi,yL);
859  A::Gradcomp();
860  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,yL)", f, fA.val());
861  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,yL)/dx", dx, xAi.aval);
862  }
863  {
864  A::aval_reset();
865  cAi xcAi(xd);
866  yL = (long)yd;
867  fA = operator!=(xcAi,yL);
868  A::Gradcomp();
869  if (differ(fA.val(), f)) botch("fA = operator!=(xcAi,yL)", f, fA.val());
870  else if (differ(xcAi.aval, dx)) botch("d operator!=(xcAi,yL)/dx", dx, xcAi.aval);
871  }
872  {
873  Ai xAi(xd);
874  yi = (int)yd;
875  fA = operator!=(xAi,yi);
876  A::Gradcomp();
877  if (differ(fA.val(), f)) botch("fA = operator!=(xAi,yi)", f, fA.val());
878  else if (differ(xAi.aval, dx)) botch("d operator!=(xAi,yi)/dx", dx, xAi.aval);
879  }
880  {
881  A::aval_reset();
882  cAi xcAi(xd);
883  yi = (int)yd;
884  fA = operator!=(xcAi,yi);
885  A::Gradcomp();
886  if (differ(fA.val(), f)) botch("fA = operator!=(xcAi,yi)", f, fA.val());
887  else if (differ(xcAi.aval, dx)) botch("d operator!=(xcAi,yi)/dx", dx, xcAi.aval);
888  }
889  yAI = yd;
890  fA = operator!=(xd,yAI);
891  A::Gradcomp();
892  if (differ(fA.val(), f)) botch("fA = operator!=(xd,yAI)", f, fA.val());
893  else if (differ(yAI.adj(), dy)) botch("d operator!=(xd,yAI)/dy", dy, yAI.adj());
894  {
895  A::aval_reset();
896  cAI ycAI(yd);
897  fA = operator!=(xd,ycAI);
898  A::Gradcomp();
899  if (differ(fA.val(), f)) botch("fA = operator!=(xd,ycAI)", f, fA.val());
900  else if (differ(ycAI.adj(), dy)) botch("d operator!=(xd,ycAI)/dy", dy, ycAI.adj());
901  }
902  yA = yd;
903  fA = operator!=(xd,yA);
904  A::Gradcomp();
905  if (differ(fA.val(), f)) botch("fA = operator!=(xd,yA)", f, fA.val());
906  else if (differ(yA.adj(), dy)) botch("d operator!=(xd,yA)/dy", dy, yA.adj());
907  {
908  A::aval_reset();
909  cA ycA(yd);
910  fA = operator!=(xd,ycA);
911  A::Gradcomp();
912  if (differ(fA.val(), f)) botch("fA = operator!=(xd,ycA)", f, fA.val());
913  else if (differ(ycA.adj(), dy)) botch("d operator!=(xd,ycA)/dy", dy, ycA.adj());
914  }
915  yC = yd;
916  fA = operator!=(xd,yC);
917  A::Gradcomp();
918  if (differ(fA.val(), f)) botch("fA = operator!=(xd,yC)", f, fA.val());
919  else if (differ(yC.adj(), dy)) botch("d operator!=(xd,yC)/dy", dy, yC.adj());
920  {
921  A::aval_reset();
922  cC ycC(yd);
923  fA = operator!=(xd,ycC);
924  A::Gradcomp();
925  if (differ(fA.val(), f)) botch("fA = operator!=(xd,ycC)", f, fA.val());
926  else if (differ(ycC.adj(), dy)) botch("d operator!=(xd,ycC)/dy", dy, ycC.adj());
927  }
928  {
929  Ai yAi(yd);
930  fA = operator!=(xd,yAi);
931  A::Gradcomp();
932  if (differ(fA.val(), f)) botch("fA = operator!=(xd,yAi)", f, fA.val());
933  else if (differ(yAi.aval, dy)) botch("d operator!=(xd,yAi)/dy", dy, yAi.aval);
934  }
935  {
936  A::aval_reset();
937  cAi ycAi(yd);
938  fA = operator!=(xd,ycAi);
939  A::Gradcomp();
940  if (differ(fA.val(), f)) botch("fA = operator!=(xd,ycAi)", f, fA.val());
941  else if (differ(ycAi.aval, dy)) botch("d operator!=(xd,ycAi)/dy", dy, ycAi.aval);
942  }
943  xL = (long)xd;
944  yAI = yd;
945  fA = operator!=(xL,yAI);
946  A::Gradcomp();
947  if (differ(fA.val(), f)) botch("fA = operator!=(xL,yAI)", f, fA.val());
948  else if (differ(yAI.adj(), dy)) botch("d operator!=(xL,yAI)/dy", dy, yAI.adj());
949  {
950  A::aval_reset();
951  xL = (long)xd;
952  cAI ycAI(yd);
953  fA = operator!=(xL,ycAI);
954  A::Gradcomp();
955  if (differ(fA.val(), f)) botch("fA = operator!=(xL,ycAI)", f, fA.val());
956  else if (differ(ycAI.adj(), dy)) botch("d operator!=(xL,ycAI)/dy", dy, ycAI.adj());
957  }
958  xL = (long)xd;
959  yA = yd;
960  fA = operator!=(xL,yA);
961  A::Gradcomp();
962  if (differ(fA.val(), f)) botch("fA = operator!=(xL,yA)", f, fA.val());
963  else if (differ(yA.adj(), dy)) botch("d operator!=(xL,yA)/dy", dy, yA.adj());
964  {
965  A::aval_reset();
966  xL = (long)xd;
967  cA ycA(yd);
968  fA = operator!=(xL,ycA);
969  A::Gradcomp();
970  if (differ(fA.val(), f)) botch("fA = operator!=(xL,ycA)", f, fA.val());
971  else if (differ(ycA.adj(), dy)) botch("d operator!=(xL,ycA)/dy", dy, ycA.adj());
972  }
973  xL = (long)xd;
974  yC = yd;
975  fA = operator!=(xL,yC);
976  A::Gradcomp();
977  if (differ(fA.val(), f)) botch("fA = operator!=(xL,yC)", f, fA.val());
978  else if (differ(yC.adj(), dy)) botch("d operator!=(xL,yC)/dy", dy, yC.adj());
979  {
980  A::aval_reset();
981  xL = (long)xd;
982  cC ycC(yd);
983  fA = operator!=(xL,ycC);
984  A::Gradcomp();
985  if (differ(fA.val(), f)) botch("fA = operator!=(xL,ycC)", f, fA.val());
986  else if (differ(ycC.adj(), dy)) botch("d operator!=(xL,ycC)/dy", dy, ycC.adj());
987  }
988  {
989  xL = (long)xd;
990  Ai yAi(yd);
991  fA = operator!=(xL,yAi);
992  A::Gradcomp();
993  if (differ(fA.val(), f)) botch("fA = operator!=(xL,yAi)", f, fA.val());
994  else if (differ(yAi.aval, dy)) botch("d operator!=(xL,yAi)/dy", dy, yAi.aval);
995  }
996  {
997  A::aval_reset();
998  xL = (long)xd;
999  cAi ycAi(yd);
1000  fA = operator!=(xL,ycAi);
1001  A::Gradcomp();
1002  if (differ(fA.val(), f)) botch("fA = operator!=(xL,ycAi)", f, fA.val());
1003  else if (differ(ycAi.aval, dy)) botch("d operator!=(xL,ycAi)/dy", dy, ycAi.aval);
1004  }
1005  xi = (int)xd;
1006  yAI = yd;
1007  fA = operator!=(xi,yAI);
1008  A::Gradcomp();
1009  if (differ(fA.val(), f)) botch("fA = operator!=(xi,yAI)", f, fA.val());
1010  else if (differ(yAI.adj(), dy)) botch("d operator!=(xi,yAI)/dy", dy, yAI.adj());
1011  {
1012  A::aval_reset();
1013  xi = (int)xd;
1014  cAI ycAI(yd);
1015  fA = operator!=(xi,ycAI);
1016  A::Gradcomp();
1017  if (differ(fA.val(), f)) botch("fA = operator!=(xi,ycAI)", f, fA.val());
1018  else if (differ(ycAI.adj(), dy)) botch("d operator!=(xi,ycAI)/dy", dy, ycAI.adj());
1019  }
1020  xi = (int)xd;
1021  yA = yd;
1022  fA = operator!=(xi,yA);
1023  A::Gradcomp();
1024  if (differ(fA.val(), f)) botch("fA = operator!=(xi,yA)", f, fA.val());
1025  else if (differ(yA.adj(), dy)) botch("d operator!=(xi,yA)/dy", dy, yA.adj());
1026  {
1027  A::aval_reset();
1028  xi = (int)xd;
1029  cA ycA(yd);
1030  fA = operator!=(xi,ycA);
1031  A::Gradcomp();
1032  if (differ(fA.val(), f)) botch("fA = operator!=(xi,ycA)", f, fA.val());
1033  else if (differ(ycA.adj(), dy)) botch("d operator!=(xi,ycA)/dy", dy, ycA.adj());
1034  }
1035  xi = (int)xd;
1036  yC = yd;
1037  fA = operator!=(xi,yC);
1038  A::Gradcomp();
1039  if (differ(fA.val(), f)) botch("fA = operator!=(xi,yC)", f, fA.val());
1040  else if (differ(yC.adj(), dy)) botch("d operator!=(xi,yC)/dy", dy, yC.adj());
1041  {
1042  A::aval_reset();
1043  xi = (int)xd;
1044  cC ycC(yd);
1045  fA = operator!=(xi,ycC);
1046  A::Gradcomp();
1047  if (differ(fA.val(), f)) botch("fA = operator!=(xi,ycC)", f, fA.val());
1048  else if (differ(ycC.adj(), dy)) botch("d operator!=(xi,ycC)/dy", dy, ycC.adj());
1049  }
1050  {
1051  xi = (int)xd;
1052  Ai yAi(yd);
1053  fA = operator!=(xi,yAi);
1054  A::Gradcomp();
1055  if (differ(fA.val(), f)) botch("fA = operator!=(xi,yAi)", f, fA.val());
1056  else if (differ(yAi.aval, dy)) botch("d operator!=(xi,yAi)/dy", dy, yAi.aval);
1057  }
1058  {
1059  A::aval_reset();
1060  xi = (int)xd;
1061  cAi ycAi(yd);
1062  fA = operator!=(xi,ycAi);
1063  A::Gradcomp();
1064  if (differ(fA.val(), f)) botch("fA = operator!=(xi,ycAi)", f, fA.val());
1065  else if (differ(ycAi.aval, dy)) botch("d operator!=(xi,ycAi)/dy", dy, ycAi.aval);
1066  }
1067 
1068 
1069  if (!rc) // chatter for cppunit test, which cannot tolerate silence
1070 
1071  printf("OK\n");
1072 
1073  return rc;
1074 
1075  }
#define ADT_RAD
ADT_RAD ADvari< double > Ai
int botch(ExpectedAnswer *e, const char *partial, double got, double wanted)
void f()
expr expr dx(i)
ADT_RAD IndepADvar< double > AI
const ADT_RAD IndepADvar< double > cAI
#define Ai
Definition: Sacado_rad.hpp:575
bool operator!=(const Allocator< T > &a_t, const Allocator< U > &a_u)
#define C(x)
#define A
Definition: Sacado_rad.hpp:572
static int rc
int main()
Definition: ad_example.cpp:191
const ADT_RAD ADvari< double > cAi
static int differ(double a, double b)
Definition: hesopcheck.cpp:147
const ADT_RAD ConstADvar< double > cC
const double tol
#define AI
Definition: Sacado_rad.hpp:576
const ADT_RAD ADvar< double > cA