Solver initialization with a box vector

Hello,
I have some use cases where I'd like to initiliaze a solver search space with a box vector instead of a single box. Is there a way to do that with the current API ?
Something like : std::vector<IntervalVector> Solver::solve(std::vector<IntervalVector> &boxVector);
Best Regards,
Laurent
 

Hello Laurent,

No, all the variable domains have to be written in a single "flat" vector.

A fast way to create this box from a vector is as follows:

// create a vector of boxes
vector<IntervalVector> boxVector;
boxVector.push_back(IntervalVector(1,1.0));
boxVector.push_back(IntervalVector(2,2.0));
boxVector.push_back(IntervalVector(3,3.0));

// the box to give to the solver
IntervalVector box(6);

int j=0;
for (int i=0; i<boxVector.size(); i++) {
    box.put(j,boxVector[i]);
    j+=boxVector[i].size();
}

cout << box << endl;

Display is:

(<1, 1> ; <2, 2> ; <2, 2> ; <3, 3> ; <3, 3> ; <3, 3>)

Regards,

Gilles