\* Quasigroup generator for ILOG Solver Code due to Kostas Stergiou All the usual disclaimers apply *\ #include #include class quasi { public : quasi(IlcManager, IlcInt, IlcInt); void set_constraints(); void print_solution(IlcInt); private : void row_constraints(IlcInt, IlcInt, IlcInt); void column_constraints(IlcInt, IlcInt, IlcInt); void QG1(); void QG2(); void QG3(); void QG4(); void QG5(); void QG6(); void QG7(); IlcManager manager; IlcInt n; IlcInt axiom; IlcIntVarArray square; }; quasi::quasi(IlcManager m, IlcInt order, IlcInt property) : manager(m), n(order), axiom(property), square(m,n*n,0,n-1) { } void quasi::print_solution(IlcInt max) { IncInt i,j; for (i=0; i=i-1); // Symmetry Break switch (axiom) { case 3 : QG3(); break; case 4 : QG4(); break; case 5 : QG5(); break; case 6 : QG6(); break; case 7 : QG7(); break; default : printf("no such condition\n"); exit(1); } IlcGoal goal; goal = IlcGenerate(square, IlcChooseMinSizeInt); manager.add(goal); } void quasi::QG3() { IlcInt i,j; for (i=0; i