lumix.linearization.config.LXLinearizerConfig¶
- class lumix.linearization.config.LXLinearizerConfig(default_method=LXLinearizationMethod.MCCORMICK, tolerance=1e-06, verbose_logging=True, big_m_value=1000000.0, pwl_num_segments=20, pwl_method='sos2', prefer_sos2=True, adaptive_breakpoints=True, auto_detect_bounds=True, mccormick_tighten_bounds=True, binary_expansion_bits=10)[source]¶
Configuration for automatic linearization engine.
- Parameters:
default_method (LXLinearizationMethod)
tolerance (float)
verbose_logging (bool)
big_m_value (float)
pwl_num_segments (int)
pwl_method (Literal['sos2', 'incremental', 'logarithmic'])
prefer_sos2 (bool)
adaptive_breakpoints (bool)
auto_detect_bounds (bool)
mccormick_tighten_bounds (bool)
binary_expansion_bits (int)
- default_method¶
Default linearization technique
- big_m_value¶
Big-M constant for conditional constraints (default: 1e6)
- pwl_num_segments¶
Number of segments for piecewise-linear approximations
- pwl_method¶
Method for piecewise-linear (“sos2”, “incremental”, “logarithmic”)
- prefer_sos2¶
Use SOS2 formulation when solver supports it
- adaptive_breakpoints¶
Use adaptive breakpoint generation for PWL
- auto_detect_bounds¶
Automatically detect variable bounds for McCormick
- mccormick_tighten_bounds¶
Apply bound tightening for McCormick envelopes
- binary_expansion_bits¶
Number of bits for binary expansion method
- tolerance¶
Numerical tolerance for comparisons
- verbose_logging¶
Enable detailed linearization logging
Example:
config = LXLinearizerConfig( big_m_value=1e5, pwl_num_segments=30, adaptive_breakpoints=True, mccormick_tighten_bounds=True )
- __init__(default_method=LXLinearizationMethod.MCCORMICK, tolerance=1e-06, verbose_logging=True, big_m_value=1000000.0, pwl_num_segments=20, pwl_method='sos2', prefer_sos2=True, adaptive_breakpoints=True, auto_detect_bounds=True, mccormick_tighten_bounds=True, binary_expansion_bits=10)¶
- Parameters:
default_method (LXLinearizationMethod)
tolerance (float)
verbose_logging (bool)
big_m_value (float)
pwl_num_segments (int)
pwl_method (Literal['sos2', 'incremental', 'logarithmic'])
prefer_sos2 (bool)
adaptive_breakpoints (bool)
auto_detect_bounds (bool)
mccormick_tighten_bounds (bool)
binary_expansion_bits (int)
- Return type:
None
Methods
__init__([default_method, tolerance, ...])Attributes
-
default_method:
LXLinearizationMethod= 'mccormick'¶
- __init__(default_method=LXLinearizationMethod.MCCORMICK, tolerance=1e-06, verbose_logging=True, big_m_value=1000000.0, pwl_num_segments=20, pwl_method='sos2', prefer_sos2=True, adaptive_breakpoints=True, auto_detect_bounds=True, mccormick_tighten_bounds=True, binary_expansion_bits=10)¶
- Parameters:
default_method (LXLinearizationMethod)
tolerance (float)
verbose_logging (bool)
big_m_value (float)
pwl_num_segments (int)
pwl_method (Literal['sos2', 'incremental', 'logarithmic'])
prefer_sos2 (bool)
adaptive_breakpoints (bool)
auto_detect_bounds (bool)
mccormick_tighten_bounds (bool)
binary_expansion_bits (int)
- Return type:
None