Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: lp_utils
Note: This documentation is automatically generated.
Utility functions to interact with an lp solver from the SAT context.
Function |
Type |
Arguments |
Comments |
ComputeTrueObjectiveLowerBound | Return type: double Arguments: const CpModelProto& model_proto_with_floating_point_objective, const CpObjectiveProto& integer_objective, const int64_t inner_integer_objective_lower_bound |
ConvertBinaryMPModelProtoToBooleanProblem | Return type: bool Arguments: const MPModelProto& mp_model, LinearBooleanProblem* problem |
ConvertBooleanProblemToLinearProgram | Return type: void Arguments: const LinearBooleanProblem& problem, glop::LinearProgram* lp |
ConvertCpModelProtoToMPModelProto | Return type: bool Arguments: const CpModelProto& input, MPModelProto* output |
ConvertMPModelProtoToCpModelProto | Return type: bool Arguments: const SatParameters& params, const MPModelProto& mp_model, CpModelProto* cp_model, SolverLogger* logger |
DetectImpliedIntegers | Return type: std::vector<double> Arguments: MPModelProto* mp_model, SolverLogger* logger |
FindBestScalingAndComputeErrors | Return type: double Arguments: const std::vector<double>& coefficients, const std::vector<double>& lower_bounds, const std::vector<double>& upper_bounds, int64_t max_absolute_activity, double wanted_absolute_activity_precision, double* relative_coeff_error, double* scaled_sum_error |
FindRationalFactor | Return type: int Arguments: double x, int limit = 1e4, double tolerance = 1e-6 |
MakeBoundsOfIntegerVariablesInteger | Return type: bool Arguments: const SatParameters& params, MPModelProto* mp_model, SolverLogger* logger |
MPModelProtoValidationBeforeConversion | Return type: bool Arguments: const SatParameters& params, const MPModelProto& mp_model, SolverLogger* logger |
RemoveNearZeroTerms | Return type: void Arguments: const SatParameters& params, MPModelProto* mp_model, SolverLogger* logger |
ScaleAndSetObjective | Return type: bool Arguments: const SatParameters& params, const std::vector<std::pair<int, double>>& objective, double objective_offset, bool maximize, CpModelProto* cp_model, SolverLogger* logger |
ScaleContinuousVariables | Return type: std::vector<double> Arguments: double scaling, double max_bound, MPModelProto* mp_model |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[[["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\u003elp_utils\u003c/code\u003e library provides utility functions for interacting with Linear Programming (LP) solvers within the context of the SAT solver.\u003c/p\u003e\n"],["\u003cp\u003eIt includes functions for converting between different problem representations like CpModelProto, MPModelProto, and LinearBooleanProblem.\u003c/p\u003e\n"],["\u003cp\u003eThe library also offers functionalities for scaling variables, manipulating objective functions, and detecting implied integers in the model.\u003c/p\u003e\n"],["\u003cp\u003eThese utilities aim to improve the efficiency and effectiveness of solving optimization problems by leveraging the strengths of both LP and SAT solvers.\u003c/p\u003e\n"]]],["This documentation details utility functions for interacting with LP solvers within a SAT context. Key actions include: converting between `CpModelProto`, `MPModelProto`, and `LinearProgram` formats; computing lower bounds for objectives; validating, scaling, and modifying `MPModelProto` data such as detecting implied integers, adjusting bounds, and removing near-zero terms. Other functionalities include scaling continuous variables, finding rational factors and scaling, and setting objectives in `CpModelProto`. There are also function for converting `BinaryMPModelProto` to `BooleanProblem`\n"],null,["# lp_utils\n\nC++ Reference: lp_utils\n=======================\n\n\nNote: This documentation is automatically generated.\nUtility functions to interact with an lp solver from the SAT context. \n\n| Function | Type | Arguments | Comments |\n|-------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|----------|\n| [`ComputeTrueObjectiveLowerBound`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L164) | Return type: `double ` Arguments: ` const CpModelProto& model_proto_with_floating_point_objective, const CpObjectiveProto& integer_objective, const int64_t inner_integer_objective_lower_bound` \u003cbr /\u003e |\n| [`ConvertBinaryMPModelProtoToBooleanProblem`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L173) | Return type: `bool ` Arguments: `const MPModelProto& mp_model, LinearBooleanProblem* problem` \u003cbr /\u003e |\n| [`ConvertBooleanProblemToLinearProgram`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L177) | Return type: `void ` Arguments: `const LinearBooleanProblem& problem, glop::LinearProgram* lp` \u003cbr /\u003e |\n| [`ConvertCpModelProtoToMPModelProto`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L136) | Return type: `bool ` Arguments: `const CpModelProto& input, MPModelProto* output` \u003cbr /\u003e |\n| [`ConvertMPModelProtoToCpModelProto`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L124) | Return type: `bool ` Arguments: `const SatParameters& params, const MPModelProto& mp_model, CpModelProto* cp_model, SolverLogger* logger` \u003cbr /\u003e |\n| [`DetectImpliedIntegers`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L116) | Return type: `std::vector\u003cdouble\u003e ` Arguments: `MPModelProto* mp_model, SolverLogger* logger` \u003cbr /\u003e |\n| [`FindBestScalingAndComputeErrors`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L65) | Return type: `double ` Arguments: ` const std::vector\u003cdouble\u003e& coefficients, const std::vector\u003cdouble\u003e& lower_bounds, const std::vector\u003cdouble\u003e& upper_bounds, int64_t max_absolute_activity, double wanted_absolute_activity_precision, double* relative_coeff_error, double* scaled_sum_error` \u003cbr /\u003e |\n| [`FindRationalFactor`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L43) | Return type: `int ` Arguments: `double x, int limit = 1e4, double tolerance = 1e-6` \u003cbr /\u003e |\n| [`MakeBoundsOfIntegerVariablesInteger`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L91) | Return type: `bool ` Arguments: `const SatParameters& params, MPModelProto* mp_model, SolverLogger* logger` \u003cbr /\u003e |\n| [`MPModelProtoValidationBeforeConversion`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L98) | Return type: `bool ` Arguments: `const SatParameters& params, const MPModelProto& mp_model, SolverLogger* logger` \u003cbr /\u003e |\n| [`RemoveNearZeroTerms`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L106) | Return type: `void ` Arguments: `const SatParameters& params, MPModelProto* mp_model, SolverLogger* logger` \u003cbr /\u003e |\n| [`ScaleAndSetObjective`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L150) | Return type: `bool ` Arguments: `const SatParameters& params, const std::vector\u003cstd::pair\u003cint, double\u003e\u003e& objective, double objective_offset, bool maximize, CpModelProto* cp_model, SolverLogger* logger` \u003cbr /\u003e |\n| [`ScaleContinuousVariables`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/lp_utils.h#L86) | Return type: `std::vector\u003cdouble\u003e ` Arguments: `double scaling, double max_bound, MPModelProto* mp_model` \u003cbr /\u003e |"]]