I just try to count the number of solutions of a single Table constraint in Ilog;
Here the code:
vars = IloIntVarArray(env, n, 1, m);
IloIntTupleSet forbiddenValues(env, n);
tuple = IloArray<IloIntArray>(env, nbForbiddenValues);
for (int i=1; i<=nbForbiddenValues; i++) {
tuple[i-1] = IloIntArray(env, n);
for (int j=0; j<n; j++) {
tuple[i-1][j] = rand() % m + 1 ;
}
forbiddenValues.add(tuple[i-1]);
}
model.add(IloTableConstraint(env, vars, forbiddenValues, IloFalse));
Here is the error:
#0 0x00007ffff7009207 in raise () from /lib64/libc.so.6
#1 0x00007ffff700a8f8 in abort () from /lib64/libc.so.6
#2 0x00007ffff79187d5 in __gnu_cxx::__verbose_terminate_handler() () from /lib64/libstdc++.so.6
#3 0x00007ffff7916746 in ?? () from /lib64/libstdc++.so.6
#4 0x00007ffff7916773 in std::terminate() () from /lib64/libstdc++.so.6
#5 0x00007ffff7916993 in __cxa_throw () from /lib64/libstdc++.so.6
#6 0x00007ffff7916f2d in operator new(unsigned long) () from /lib64/libstdc++.so.6
#7 0x0000000000437579 in std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::vector<int, std::allocator<int> >*, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > >, std::vector<int, std::allocator<int> > const&) ()
#8 0x000000000042fa65 in Problem::enumerateSolutions() ()
#9 0x000000000041d244 in main (argc=5, argv=0x7fffffffd1d8) at main.cpp:21
21 test.enumerateSolutions();
I appreciate your help!
Aucun commentaire:
Enregistrer un commentaire