If we solved a small independent component of the full problem, then we can
in most situation fix the solution on this subspace.
Note that because there can be more than one optimal solution on an
independent subproblem, it is important to do that in a locked fashion, and
reject future incompatible fixing.
Returns a new id to be used in GetChangedBounds(). This is just an ever
increasing sequence starting from zero. Note that the class is not designed
to have too many of these.
Reports a set of locally improved variable bounds to the shared bounds
manager. The manager will compare these bounds changes against its
global state, and incorporate the improving ones.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eSharedBoundsManager\u003c/code\u003e class in C++ manages variable bounds in a parallel processing environment for constraint programming.\u003c/p\u003e\n"],["\u003cp\u003eIt allows workers to share and update bounds on a set of variables, facilitating the exchange of information between them.\u003c/p\u003e\n"],["\u003cp\u003eWorkers can report improved bounds, retrieve changes, and synchronize their knowledge of the global bound state.\u003c/p\u003e\n"],["\u003cp\u003eIt provides mechanisms to fix variables based on solutions of subproblems, ensuring consistency across parallel tasks.\u003c/p\u003e\n"],["\u003cp\u003eThe class utilizes methods like \u003ccode\u003eReportPotentialNewBounds\u003c/code\u003e, \u003ccode\u003eGetChangedBounds\u003c/code\u003e, and \u003ccode\u003eSynchronize\u003c/code\u003e for these functionalities.\u003c/p\u003e\n"]]],["The `SharedBoundsManager` class manages variable bounds in a parallel context. Key actions include: `ReportPotentialNewBounds` to share improved bounds; `GetChangedBounds` to retrieve updated bounds using a unique ID obtained from `RegisterNewId`; `FixVariablesFromPartialSolution` to fix variables based on a partial solution; and `Synchronize` to update and publish bounds. It tracks bounds improvements against its global state, logs statistics, and counts the number of bounds exported for each worker.\n"],null,["# SharedBoundsManager\n\nC++ Reference: class SharedBoundsManager\n========================================\n\n\nNote: This documentation is automatically generated.\nThis class manages a pool of lower and upper bounds on a set of variables in a parallel context.\n\n| Method ||\n|----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`FixVariablesFromPartialSolution`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/synchronization.h#L443) | Return type: `void ` Arguments: ` const std::vector\u003cint64_t\u003e& solution, const std::vector\u003cint\u003e& variables_to_fix` If we solved a small independent component of the full problem, then we can in most situation fix the solution on this subspace. Note that because there can be more than one optimal solution on an independent subproblem, it is important to do that in a locked fashion, and reject future incompatible fixing. |\n| [`GetChangedBounds`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/synchronization.h#L454) | Return type: `void ` Arguments: `int id, std::vector\u003cint\u003e* variables, std::vector\u003cint64_t\u003e* new_lower_bounds, std::vector\u003cint64_t\u003e* new_upper_bounds` When called, returns the set of bounds improvements since the last time this method was called with the same id. |\n| [`LogStatistics`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/synchronization.h#L462) | Return type: `void ` Arguments: `SolverLogger* logger` \u003cbr /\u003e |\n| [`NumBoundsExported`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/synchronization.h#L463) | Return type: `int ` Arguments: `const std::string& worker_name` \u003cbr /\u003e |\n| [`RegisterNewId`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/synchronization.h#L450) | Return type: `int ` Returns a new id to be used in GetChangedBounds(). This is just an ever increasing sequence starting from zero. Note that the class is not designed to have too many of these. |\n| [`ReportPotentialNewBounds`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/synchronization.h#L431) | Return type: `void ` Arguments: `const CpModelProto& model_proto, const std::string& worker_name, const std::vector\u003cint\u003e& variables, const std::vector\u003cint64_t\u003e& new_lower_bounds, const std::vector\u003cint64_t\u003e& new_upper_bounds` Reports a set of locally improved variable bounds to the shared bounds manager. The manager will compare these bounds changes against its global state, and incorporate the improving ones. |\n| [`SharedBoundsManager`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/synchronization.h#L426) | Return type: `explicit ` Arguments: `const CpModelProto& model_proto` \u003cbr /\u003e |\n| [`Synchronize`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/synchronization.h#L460) | Return type: `void ` Publishes any new bounds so that GetChangedBounds() will reflect the latest state. |"]]