Generated on Tue Oct 22 2013 00:48:59 for Gecode by doxygen 1.8.4
arithmetic.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  *
6  * Copyright:
7  * Christian Schulte, 2005
8  *
9  * Last modified:
10  * $Date: 2013-03-12 20:24:37 +0100 (Tue, 12 Mar 2013) $ by $Author: schulte $
11  * $Revision: 13514 $
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #include "test/int.hh"
39 
40 #include <cmath>
41 #include <algorithm>
42 
43 #include <gecode/minimodel.hh>
44 
45 namespace Test { namespace Int {
46 
48  namespace Arithmetic {
49 
55  class MultXYZ : public Test {
57  public:
59  MultXYZ(const std::string& s, const Gecode::IntSet& d,
61  : Test("Arithmetic::Mult::XYZ::"+str(icl)+"::"+s,3,d,false,icl) {}
63  virtual bool solution(const Assignment& x) const {
64  double d0 = static_cast<double>(x[0]);
65  double d1 = static_cast<double>(x[1]);
66  double d2 = static_cast<double>(x[2]);
67  return d0*d1 == d2;
68  }
70  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
71  Gecode::mult(home, x[0], x[1], x[2], icl);
72  }
73  };
74 
76  class MultXXY : public Test {
77  public:
79  MultXXY(const std::string& s, const Gecode::IntSet& d,
81  : Test("Arithmetic::Mult::XXY::"+str(icl)+"::"+s,2,d,false,icl) {}
83  virtual bool solution(const Assignment& x) const {
84  double d0 = static_cast<double>(x[0]);
85  double d1 = static_cast<double>(x[0]);
86  double d2 = static_cast<double>(x[1]);
87  return d0*d1 == d2;
88  }
90  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
91  Gecode::mult(home, x[0], x[0], x[1], icl);
92  }
93  };
94 
96  class MultXYX : public Test {
97  public:
99  MultXYX(const std::string& s, const Gecode::IntSet& d,
101  : Test("Arithmetic::Mult::XYX::"+str(icl)+"::"+s,2,d,false,icl) {}
103  virtual bool solution(const Assignment& x) const {
104  double d0 = static_cast<double>(x[0]);
105  double d1 = static_cast<double>(x[1]);
106  double d2 = static_cast<double>(x[0]);
107  return d0*d1 == d2;
108  }
110  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
111  Gecode::mult(home, x[0], x[1], x[0], icl);
112  }
113  };
114 
116  class MultXYY : public Test {
117  public:
119  MultXYY(const std::string& s, const Gecode::IntSet& d,
121  : Test("Arithmetic::Mult::XYY::"+str(icl)+"::"+s,2,d,false,icl) {}
123  virtual bool solution(const Assignment& x) const {
124  double d0 = static_cast<double>(x[0]);
125  double d1 = static_cast<double>(x[1]);
126  double d2 = static_cast<double>(x[1]);
127  return d0*d1 == d2;
128  }
130  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
131  Gecode::mult(home, x[0], x[1], x[1], icl);
132  }
133  };
134 
136  class MultXXX : public Test {
137  public:
139  MultXXX(const std::string& s, const Gecode::IntSet& d,
141  : Test("Arithmetic::Mult::XXX::"+str(icl)+"::"+s,1,d,false,icl) {}
143  virtual bool solution(const Assignment& x) const {
144  double d0 = static_cast<double>(x[0]);
145  double d1 = static_cast<double>(x[0]);
146  double d2 = static_cast<double>(x[0]);
147  return d0*d1 == d2;
148  }
150  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
151  Gecode::mult(home, x[0], x[0], x[0], icl);
152  }
153  };
154 
156  class SqrXY : public Test {
157  public:
159  SqrXY(const std::string& s, const Gecode::IntSet& d,
161  : Test("Arithmetic::Sqr::XY::"+str(icl)+"::"+s,2,d,false,icl) {}
163  virtual bool solution(const Assignment& x) const {
164  double d0 = static_cast<double>(x[0]);
165  double d1 = static_cast<double>(x[1]);
166  return d0*d0 == d1;
167  }
169  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
170  Gecode::sqr(home, x[0], x[1], icl);
171  }
172  };
173 
175  class SqrXX : public Test {
176  public:
178  SqrXX(const std::string& s, const Gecode::IntSet& d,
180  : Test("Arithmetic::Sqr::XX::"+str(icl)+"::"+s,1,d,false,icl) {}
182  virtual bool solution(const Assignment& x) const {
183  double d0 = static_cast<double>(x[0]);
184  return d0*d0 == d0;
185  }
187  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
188  Gecode::sqr(home, x[0], x[0], icl);
189  }
190  };
191 
193  class SqrtXY : public Test {
194  public:
196  SqrtXY(const std::string& s, const Gecode::IntSet& d,
198  : Test("Arithmetic::Sqrt::XY::"+str(icl)+"::"+s,2,d,false,icl) {}
200  virtual bool solution(const Assignment& x) const {
201  double d0 = static_cast<double>(x[0]);
202  double d1 = static_cast<double>(x[1]);
203  return (d0 >= 0) && (d0 >= d1*d1) && (d0 < (d1+1)*(d1+1));
204  }
206  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
207  Gecode::sqrt(home, x[0], x[1], icl);
208  }
209  };
210 
212  class SqrtXX : public Test {
213  public:
215  SqrtXX(const std::string& s, const Gecode::IntSet& d,
217  : Test("Arithmetic::Sqrt::XX::"+str(icl)+"::"+s,1,d,false,icl) {}
219  virtual bool solution(const Assignment& x) const {
220  double d0 = static_cast<double>(x[0]);
221  return (d0 >= 0) && (d0 >= d0*d0) && (d0 < (d0+1)*(d0+1));
222  }
224  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
225  Gecode::sqrt(home, x[0], x[0], icl);
226  }
227  };
228 
230  class PowXY : public Test {
231  protected:
233  int n;
234  public:
236  PowXY(const std::string& s, int n0, const Gecode::IntSet& d,
238  : Test("Arithmetic::Pow::XY::"+str(n0)+"::"+str(icl)+"::"+s,
239  2,d,false,icl), n(n0) {}
241  virtual bool solution(const Assignment& x) const {
242  long long int p = 1;
243  for (int i=0; i<n; i++) {
244  p *= x[0];
245  if ((p < Gecode::Int::Limits::min) ||
247  return false;
248  }
249  return p == x[1];
250  }
252  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
253  using namespace Gecode;
254  if (n > 4)
255  pow(home, x[0], n, x[1], icl);
256  else
257  rel(home, expr(home, pow(x[0],n), icl), IRT_EQ, x[1], icl);
258  }
259  };
260 
262  class PowXX : public Test {
263  protected:
265  int n;
266  public:
268  PowXX(const std::string& s, int n0, const Gecode::IntSet& d,
270  : Test("Arithmetic::Pow::XX::"+str(n0)+"::"+str(icl)+"::"+s,
271  1,d,false,icl), n(n0) {}
273  virtual bool solution(const Assignment& x) const {
274  long long int p = 1;
275  for (int i=0; i<n; i++) {
276  p *= x[0];
277  if ((p < Gecode::Int::Limits::min) ||
279  return false;
280  }
281  return p == x[0];
282  }
284  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
285  Gecode::pow(home, x[0], n, x[0], icl);
286  }
287  };
288 
290  class NrootXY : public Test {
291  protected:
293  int n;
294  public:
296  NrootXY(const std::string& s, int n0, const Gecode::IntSet& d,
298  : Test("Arithmetic::Nroot::XY::"+str(n0)+"::"+str(icl)+"::"+s,
299  2,d,false,icl), n(n0) {}
301  virtual bool solution(const Assignment& x) const {
302  if ((x[0] < 0) || (x[1] < 0))
303  return false;
304  long long int l = 1;
305  long long int u = 1;
306  for (int i=0; i<n; i++) {
307  l *= x[1]; u *= x[1]+1;
308  if (l > Gecode::Int::Limits::max)
309  return false;
310  }
311  return (x[0] >= l) && (x[0] < u);
312  }
314  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
315  using namespace Gecode;
316  if (n > 4)
317  nroot(home, x[0], n, x[1], icl);
318  else
319  rel(home, expr(home, nroot(x[0],n), icl), IRT_EQ, x[1], icl);
320  }
321  };
322 
324  class NrootXX : public Test {
325  protected:
327  int n;
328  public:
330  NrootXX(const std::string& s, int n0, const Gecode::IntSet& d,
332  : Test("Arithmetic::Nroot::XX::"+str(n0)+"::"+str(icl)+"::"+s,
333  1,d,false,icl), n(n0) {}
335  virtual bool solution(const Assignment& x) const {
336  if (x[0] < 0)
337  return false;
338  long long int l = 1;
339  long long int u = 1;
340  for (int i=0; i<n; i++) {
341  l *= x[0]; u *= x[0]+1;
342  if (l > Gecode::Int::Limits::max)
343  return false;
344  }
345  return (x[0] >= l) && (x[0] < u);
346  }
348  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
349  Gecode::nroot(home, x[0], n, x[0], icl);
350  }
351  };
352 
354  class DivMod : public Test {
355  private:
357  static int abs(int a) { return a<0 ? -a:a; }
359  static int sgn(int a) { return a<0 ? -1:1; }
360  public:
362  DivMod(const std::string& s, const Gecode::IntSet& d)
363  : Test("Arithmetic::DivMod::"+s,4,d) {}
365  virtual bool solution(const Assignment& x) const {
366  return x[0] == x[1]*x[2]+x[3] &&
367  abs(x[3]) < abs(x[1]) &&
368  (x[3] == 0 || sgn(x[3]) == sgn(x[0]));
369  }
371  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
372  Gecode::divmod(home, x[0], x[1], x[2], x[3]);
373  }
374  };
375 
377  class Div : public Test {
378  public:
380  Div(const std::string& s, const Gecode::IntSet& d)
381  : Test("Arithmetic::Div::"+s,3,d) {}
383  virtual bool solution(const Assignment& x) const {
384  if (x[1] == 0)
385  return false;
386  int divsign = (x[0] / x[1] < 0) ? -1 : 1;
387  int divresult =
388  divsign *
389  static_cast<int>(floor(static_cast<double>(std::abs(x[0]))/
390  static_cast<double>(std::abs(x[1]))));
391  return x[2] == divresult;
392  }
394  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
395  Gecode::div(home, x[0], x[1], x[2]);
396  }
397  };
398 
400  class Mod : public Test {
401  public:
403  Mod(const std::string& s, const Gecode::IntSet& d)
404  : Test("Arithmetic::Mod::"+s,3,d) {}
406  virtual bool solution(const Assignment& x) const {
407  if (x[1] == 0)
408  return false;
409  int divsign = (x[0] / x[1] < 0) ? -1 : 1;
410  int divresult =
411  divsign *
412  static_cast<int>(floor(static_cast<double>(std::abs(x[0]))/
413  static_cast<double>(std::abs(x[1]))));
414  return x[0] == x[1]*divresult+x[2];
415  }
417  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
418  Gecode::mod(home, x[0], x[1], x[2]);
419  }
420  };
421 
423  class AbsXY : public Test {
424  public:
426  AbsXY(const std::string& s, const Gecode::IntSet& d,
428  : Test("Arithmetic::Abs::XY::"+str(icl)+"::"+s,2,d,false,icl) {}
430  virtual bool solution(const Assignment& x) const {
431  double d0 = static_cast<double>(x[0]);
432  double d1 = static_cast<double>(x[1]);
433  return (d0<0 ? -d0 : d0) == d1;
434  }
436  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
437  Gecode::abs(home, x[0], x[1], icl);
438  }
439  };
440 
442  class AbsXX : public Test {
443  public:
445  AbsXX(const std::string& s, const Gecode::IntSet& d,
447  : Test("Arithmetic::Abs::XX::"+str(icl)+"::"+s,1,d,false,icl) {}
449  virtual bool solution(const Assignment& x) const {
450  double d0 = static_cast<double>(x[0]);
451  double d1 = static_cast<double>(x[0]);
452  return (d0<0 ? -d0 : d0) == d1;
453  }
455  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
456  Gecode::abs(home, x[0], x[0], icl);
457  }
458  };
459 
461  class MinXYZ : public Test {
462  public:
464  MinXYZ(const std::string& s, const Gecode::IntSet& d,
466  : Test("Arithmetic::Min::Bin::XYZ::"+str(icl)+"::"+s,3,d,false,icl) {}
468  virtual bool solution(const Assignment& x) const {
469  return std::min(x[0],x[1]) == x[2];
470  }
472  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
473  Gecode::min(home, x[0], x[1], x[2], icl);
474  }
475  };
476 
478  class MinXXY : public Test {
479  public:
481  MinXXY(const std::string& s, const Gecode::IntSet& d,
483  : Test("Arithmetic::Min::Bin::XYX::"+str(icl)+"::"+s,2,d) {}
485  virtual bool solution(const Assignment& x) const {
486  return std::min(x[0],x[0]) == x[1];
487  }
489  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
490  Gecode::min(home, x[0], x[0], x[1], icl);
491  }
492  };
493 
495  class MinXYX : public Test {
496  public:
498  MinXYX(const std::string& s, const Gecode::IntSet& d,
500  : Test("Arithmetic::Min::Bin::XYX::"+str(icl)+"::"+s,2,d) {}
502  virtual bool solution(const Assignment& x) const {
503  return std::min(x[0],x[1]) == x[0];
504  }
506  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
507  Gecode::min(home, x[0], x[1], x[0], icl);
508  }
509  };
510 
512  class MinXYY : public Test {
513  public:
515  MinXYY(const std::string& s, const Gecode::IntSet& d,
517  : Test("Arithmetic::Min::Bin::XYY::"+str(icl)+"::"+s,2,d) {}
519  virtual bool solution(const Assignment& x) const {
520  return std::min(x[0],x[1]) == x[1];
521  }
523  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
524  Gecode::min(home, x[0], x[1], x[1], icl);
525  }
526  };
527 
529  class MinXXX : public Test {
530  public:
532  MinXXX(const std::string& s, const Gecode::IntSet& d,
534  : Test("Arithmetic::Min::Bin::XXX::"+str(icl)+"::"+s,1,d) {}
536  virtual bool solution(const Assignment& x) const {
537  return std::min(x[0],x[0]) == x[0];
538  }
540  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
541  Gecode::min(home, x[0], x[0], x[0], icl);
542  }
543  };
544 
546  class MaxXYZ : public Test {
547  public:
549  MaxXYZ(const std::string& s, const Gecode::IntSet& d,
551  : Test("Arithmetic::Max::Bin::XYZ::"+str(icl)+"::"+s,3,d) {
553  }
555  virtual bool solution(const Assignment& x) const {
556  return std::max(x[0],x[1]) == x[2];
557  }
559  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
560  Gecode::max(home, x[0], x[1], x[2], icl);
561  }
562  };
563 
565  class MaxXXY : public Test {
566  public:
568  MaxXXY(const std::string& s, const Gecode::IntSet& d,
570  : Test("Arithmetic::Max::Bin::XXY::"+str(icl)+"::"+s,2,d) {}
572  virtual bool solution(const Assignment& x) const {
573  return std::max(x[0],x[0]) == x[1];
574  }
576  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
577  Gecode::max(home, x[0], x[0], x[1], icl);
578  }
579  };
580 
582  class MaxXYX : public Test {
583  public:
585  MaxXYX(const std::string& s, const Gecode::IntSet& d,
587  : Test("Arithmetic::Max::Bin::XYX::"+str(icl)+"::"+s,2,d) {}
589  virtual bool solution(const Assignment& x) const {
590  return std::max(x[0],x[1]) == x[0];
591  }
593  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
594  Gecode::max(home, x[0], x[1], x[0], icl);
595  }
596  };
597 
599  class MaxXYY : public Test {
600  public:
602  MaxXYY(const std::string& s, const Gecode::IntSet& d,
604  : Test("Arithmetic::Max::Bin::XYY::"+str(icl)+"::"+s,2,d) {}
606  virtual bool solution(const Assignment& x) const {
607  return std::max(x[0],x[1]) == x[1];
608  }
610  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
611  Gecode::max(home, x[0], x[1], x[1], icl);
612  }
613  };
614 
616  class MaxXXX : public Test {
617  public:
619  MaxXXX(const std::string& s, const Gecode::IntSet& d,
621  : Test("Arithmetic::Max::Bin::XXX::"+str(icl)+"::"+s,1,d) {}
623  virtual bool solution(const Assignment& x) const {
624  return std::max(x[0],x[0]) == x[0];
625  }
627  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
628  Gecode::max(home, x[0], x[0], x[0], icl);
629  }
630  };
631 
633  class MinNary : public Test {
634  public:
637  : Test("Arithmetic::Min::Nary::"+str(icl),4,-4,4,false,icl) {}
639  virtual bool solution(const Assignment& x) const {
640  return std::min(std::min(x[0],x[1]), x[2]) == x[3];
641  }
643  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
644  Gecode::IntVarArgs m(3);
645  m[0]=x[0]; m[1]=x[1]; m[2]=x[2];
646  Gecode::min(home, m, x[3], icl);
647  }
648  };
649 
651  class MinNaryShared : public Test {
652  public:
655  : Test("Arithmetic::Min::Nary::Shared::"+str(icl),3,-4,4,false,icl) {}
657  virtual bool solution(const Assignment& x) const {
658  return std::min(std::min(x[0],x[1]), x[2]) == x[1];
659  }
661  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
662  Gecode::IntVarArgs m(3);
663  m[0]=x[0]; m[1]=x[1]; m[2]=x[2];
664  Gecode::min(home, m, x[1], icl);
665  }
666  };
667 
669  class MaxNary : public Test {
670  public:
673  : Test("Arithmetic::Max::Nary::"+str(icl),4,-4,4,false,icl) {}
675  virtual bool solution(const Assignment& x) const {
676  return std::max(std::max(x[0],x[1]), x[2]) == x[3];
677  }
679  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
680  Gecode::IntVarArgs m(3);
681  m[0]=x[0]; m[1]=x[1]; m[2]=x[2];
682  Gecode::max(home, m, x[3], icl);
683  }
684  };
685 
687  class MaxNaryShared : public Test {
688  public:
691  : Test("Arithmetic::Max::Nary::Shared::"+str(icl),3,-4,4,false,icl) {}
693  virtual bool solution(const Assignment& x) const {
694  return std::max(std::max(x[0],x[1]), x[2]) == x[1];
695  }
697  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
698  Gecode::IntVarArgs m(3);
699  m[0]=x[0]; m[1]=x[1]; m[2]=x[2];
700  Gecode::max(home, m, x[1], icl);
701  }
702  };
703 
704 
706  class Create {
707  public:
709  Create(void) {
710 
711  const int va[7] = {
713  -1,0,1,
714  Gecode::Int::Limits::max-1, Gecode::Int::Limits::max
715  };
716  const int vb[9] = {
717  static_cast<int>(-sqrt(static_cast<double>
719  -4,-2,-1,0,1,2,4,
720  static_cast<int>(sqrt(static_cast<double>
722  };
723 
724  Gecode::IntSet a(va,7);
725  Gecode::IntSet b(vb,9);
726  Gecode::IntSet c(-8,8);
727  Gecode::IntSet d(-70,70);
728 
729  (void) new DivMod("A",a);
730  (void) new DivMod("B",b);
731  (void) new DivMod("C",c);
732 
733  (void) new Div("A",a);
734  (void) new Div("B",b);
735  (void) new Div("C",c);
736 
737  (void) new Mod("A",a);
738  (void) new Mod("B",b);
739  (void) new Mod("C",c);
740 
741 
742  for (IntConLevels icls; icls(); ++icls)
743  if (icls.icl() != Gecode::ICL_VAL) {
744  (void) new MultXYZ("A",a,icls.icl());
745  (void) new MultXYZ("B",b,icls.icl());
746  (void) new MultXYZ("C",c,icls.icl());
747 
748  (void) new MultXXY("A",a,icls.icl());
749  (void) new MultXXY("B",b,icls.icl());
750  (void) new MultXXY("C",c,icls.icl());
751 
752  (void) new MultXYX("A",a,icls.icl());
753  (void) new MultXYX("B",b,icls.icl());
754  (void) new MultXYX("C",c,icls.icl());
755 
756  (void) new MultXYY("A",a,icls.icl());
757  (void) new MultXYY("B",b,icls.icl());
758  (void) new MultXYY("C",c,icls.icl());
759 
760  (void) new MultXXX("A",a,icls.icl());
761  (void) new MultXXX("B",b,icls.icl());
762  (void) new MultXXX("C",c,icls.icl());
763 
764  (void) new SqrXY("A",a,icls.icl());
765  (void) new SqrXY("B",b,icls.icl());
766  (void) new SqrXY("C",c,icls.icl());
767 
768  (void) new SqrXX("A",a,icls.icl());
769  (void) new SqrXX("B",b,icls.icl());
770  (void) new SqrXX("C",c,icls.icl());
771 
772  for (int n=0; n<=6; n++) {
773  (void) new PowXY("A",n,a,icls.icl());
774  (void) new PowXY("B",n,b,icls.icl());
775  (void) new PowXY("C",n,c,icls.icl());
776  (void) new PowXY("D",n,d,icls.icl());
777 
778  (void) new PowXX("A",n,a,icls.icl());
779  (void) new PowXX("B",n,b,icls.icl());
780  (void) new PowXX("C",n,c,icls.icl());
781  (void) new PowXX("D",n,d,icls.icl());
782  }
783 
784  for (int n=1; n<=6; n++) {
785  (void) new NrootXY("A",n,a,icls.icl());
786  (void) new NrootXY("B",n,b,icls.icl());
787  (void) new NrootXY("C",n,c,icls.icl());
788  (void) new NrootXY("D",n,d,icls.icl());
789 
790  (void) new NrootXX("A",n,a,icls.icl());
791  (void) new NrootXX("B",n,b,icls.icl());
792  (void) new NrootXX("C",n,c,icls.icl());
793  (void) new NrootXX("D",n,d,icls.icl());
794  }
795 
796  for (int n=30; n<=34; n++) {
797  (void) new PowXY("C",n,c,icls.icl());
798  (void) new PowXX("C",n,c,icls.icl());
799  (void) new NrootXY("C",n,c,icls.icl());
800  (void) new NrootXX("C",n,c,icls.icl());
801  }
802 
803  (void) new SqrtXY("A",a,icls.icl());
804  (void) new SqrtXY("B",b,icls.icl());
805  (void) new SqrtXY("C",c,icls.icl());
806 
807  (void) new SqrtXX("A",a,icls.icl());
808  (void) new SqrtXX("B",b,icls.icl());
809  (void) new SqrtXX("C",c,icls.icl());
810 
811  (void) new AbsXY("A",a,icls.icl());
812  (void) new AbsXY("B",b,icls.icl());
813  (void) new AbsXY("C",c,icls.icl());
814 
815  (void) new AbsXX("A",a,icls.icl());
816  (void) new AbsXX("B",b,icls.icl());
817  (void) new AbsXX("C",c,icls.icl());
818 
819  (void) new MinXYZ("A",a,icls.icl());
820  (void) new MinXYZ("B",b,icls.icl());
821  (void) new MinXYZ("C",c,icls.icl());
822 
823  (void) new MinXXY("A",a,icls.icl());
824  (void) new MinXXY("B",b,icls.icl());
825  (void) new MinXXY("C",c,icls.icl());
826 
827  (void) new MinXYX("A",a,icls.icl());
828  (void) new MinXYX("B",b,icls.icl());
829  (void) new MinXYX("C",c,icls.icl());
830 
831  (void) new MinXYY("A",a,icls.icl());
832  (void) new MinXYY("B",b,icls.icl());
833  (void) new MinXYY("C",c,icls.icl());
834 
835  (void) new MinXXX("A",a,icls.icl());
836  (void) new MinXXX("B",b,icls.icl());
837  (void) new MinXXX("C",c,icls.icl());
838 
839  (void) new MaxXYZ("A",a,icls.icl());
840  (void) new MaxXYZ("B",b,icls.icl());
841  (void) new MaxXYZ("C",c,icls.icl());
842 
843  (void) new MaxXXY("A",a,icls.icl());
844  (void) new MaxXXY("B",b,icls.icl());
845  (void) new MaxXXY("C",c,icls.icl());
846 
847  (void) new MaxXYX("A",a,icls.icl());
848  (void) new MaxXYX("B",b,icls.icl());
849  (void) new MaxXYX("C",c,icls.icl());
850 
851  (void) new MaxXYY("A",a,icls.icl());
852  (void) new MaxXYY("B",b,icls.icl());
853  (void) new MaxXYY("C",c,icls.icl());
854 
855  (void) new MaxXXX("A",a,icls.icl());
856  (void) new MaxXXX("B",b,icls.icl());
857  (void) new MaxXXX("C",c,icls.icl());
858 
859  (void) new MinNary(icls.icl());
860  (void) new MinNaryShared(icls.icl());
861  (void) new MaxNary(icls.icl());
862  (void) new MaxNaryShared(icls.icl());
863  }
864  }
865  };
866 
869 
870  }
871 }}
872 
873 // STATISTICS: test-int