C++ Reference: class ModelCopy

Note: This documentation is automatically generated.

This helper class perform copy with simplification from a model and a partial assignment to another model. The purpose is to miminize the size of the copied model, as well as to reduce the pressure on the memory sub-system.

It is currently used by the LNS part, but could be used with any other scheme that generates partial assignments.
Method
ImportAndSimplifyConstraints

Return type: bool

Arguments: const CpModelProto& in_model, const std::vector<int>& ignored_constraints, bool first_copy = false

Copies all constraints from in_model to working model of the context. During the process, it will read variable domains from the context, and simplify constraints to minimize the size of the copied model. Thus it is important that the context->working_model already have the variables part copied. It returns false iff the model is proven infeasible. It does not clear the constraints part of the working model of the context. Note(user): If first_copy is true, we will reorder the scheduling constraint so that they only use reference to previously defined intervals. This allow to be more efficient later in a few preprocessing steps.

ImportVariablesAndMaybeIgnoreNames

Return type: void

Arguments: const CpModelProto& in_model

Copy variables from the in_model to the working model. It reads the 'ignore_names' parameters from the context, and keeps or deletes names accordingly.

ModelCopy

Return type: explicit

Arguments: PresolveContext* context