00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include "examples/support.hh"
00039
00048 class Eq20 : public Example {
00049 private:
00051 static const int x_n = 7;
00053 static const int e_n = 20;
00055 IntVarArray x;
00056 public:
00058 Eq20(const Options& opt)
00059 : x(this,x_n,0,10) {
00060
00061 int eqs[e_n][x_n+1] = {
00062 {876370, -16105, 62397, -6704, 43340, 95100, -68610, 58301},
00063 {533909, 51637, 67761, 95951, 3834, -96722, 59190, 15280},
00064 {915683, 1671, -34121, 10763, 80609, 42532, 93520, -33488},
00065 {129768, 71202, -11119, 73017, -38875, -14413, -29234, 72370},
00066 {752447, 8874, -58412, 73947, 17147, 62335, 16005, 8632},
00067 {90614, 85268, 54180, -18810, -48219, 6013, 78169, -79785},
00068 {1198280, -45086, 51830, -4578, 96120, 21231, 97919, 65651},
00069 {18465, -64919, 80460, 90840, -59624, -75542, 25145, -47935},
00070 {1503588, -43277, 43525, 92298, 58630, 92590, -9372, -60227},
00071 {1244857, -16835, 47385, 97715, -12640, 69028, 76212, -81102},
00072 {1410723, -60301, 31227, 93951, 73889, 81526, -72702, 68026},
00073 {25334, 94016, -82071, 35961, 66597, -30705, -44404, -38304},
00074 {277271, -67456, 84750, -51553, 21239, 81675, -99395, -4254},
00075 {249912, -85698, 29958, 57308, 48789, -78219, 4657, 34539},
00076 {373854, 85176, -95332, -1268, 57898, 15883, 50547, 83287},
00077 {740061, -10343, 87758, -11782, 19346, 70072, -36991, 44529},
00078 {146074, 49149, 52871, -7132, 56728, -33576, -49530, -62089},
00079 {251591, -60113, 29475, 34421, -76870, 62646, 29278, -15212},
00080 {22167, 87059, -29101, -5513, -21219, 22128, 7276, 57308},
00081 {821228, -76706, 98205, 23445, 67921, 24111, -48614, -41906}
00082 };
00083
00084 for (int i = e_n; i--; ) {
00085 IntArgs c(7,eqs[i][1],eqs[i][2],eqs[i][3],eqs[i][4],
00086 eqs[i][5],eqs[i][6],eqs[i][7]);
00087 linear(this, c, x, IRT_EQ, eqs[i][0], opt.icl());
00088 }
00089 branch(this, x, INT_VAR_NONE, INT_VAL_MIN);
00090 }
00091
00093 Eq20(bool share, Eq20& s) : Example(share,s) {
00094 x.update(this, share, s.x);
00095 }
00097 virtual Space*
00098 copy(bool share) {
00099 return new Eq20(share,*this);
00100 }
00102 virtual void
00103 print(std::ostream& os) {
00104 os << "\tx[] = " << x << std::endl;
00105 }
00106
00107 };
00108
00112 int
00113 main(int argc, char* argv[]) {
00114 Options opt("Eq20");
00115 opt.solutions(0);
00116 opt.iterations(1000);
00117 opt.parse(argc,argv);
00118 Example::run<Eq20,DFS,Options>(opt);
00119 return 0;
00120 }
00121
00122
00123
00124
00125