Avoide to reallocate res at each impl_compute call.
Stamp x vector to avoid to recompute constraint twice.