I managed for CPLEX: in the file interface_cplex.cc, you can add in function CplexInterface::Solve (before the solve function CPXXmipopt) the following:
// Set solution hints if any.
const CPXNNZ beg[1]={0};
CPXDIM varindices[solver_->solution_hint_.size()];
double values[solver_->solution_hint_.size()];
int i=0;
for (const std::pair<MPVariable*, double>& p : solver_->solution_hint_) {
varindices[i] = p.first->index();
values[i++] = p.second;
}
CPXXaddmipstarts(mEnv, mLp, 1, (CPXNNZ)solver_->solution_hint_.size(), beg, (const CPXDIM *) varindices, (const double *) values, NULL, NULL);
to use a single starting solution with CPLEX. You can use it in conjunction with the WarmStartSolution I described in a previous message above, it compiles and works, I tried it on the IntegerProgramming example file provided by ortools, it changes the starting heuristic solution that CPLEX uses. If you decide to use LinearExpr for the variables as I did since it's much less of a headache for models that are a little involved, then you can't just provide the LinearExpr to the function, it has to be converted back to MPVariable* before. If you take the Integer Prorgamming example of OR-tools and define x1 and x2 as LinearExpr, you can do something like:
std::vector<std::pair<MPVariable*, double> > starting_solution;
starting_solution.push_back(std::make_pair((MPVariable*)x1.terms().begin()->first, 9.0));
starting_solution.push_back(std::make_pair((MPVariable*)x2.terms().begin()->first, 0.0));
solver.WarmStartSolution(starting_solution);
for example. Hope it might be of some help to people trying to use warm starting! I didn't find yet the function in the CBC and GLPK callable library to initialize the solution. When and if I find it I will post here the modifications I will have made to make it work.
Any comment is welcome :-)