C++ Reference: class ScatteredIntegerVector
Note: This documentation is automatically generated.
Simple class to combine linear expression efficiently. First in a sparse way that switch to dense when the number of non-zeros grows.Method | |
---|---|
Add | Return type: Arguments: Does vector[col] += value and return false in case of overflow. |
AddLinearExpressionMultiple | Return type: Arguments: Similar to Add() but for multiplier * terms. Returns false in case of overflow. |
ClearAndResize | Return type: Arguments: This must be called with the correct size before any other functions are used. |
ConvertToLinearConstraint | Return type: Arguments: This is not const only because non_zeros is sorted. Note that sorting the non-zeros make the result deterministic whether or not we were in sparse mode. TODO(user): Ideally we should convert to IntegerVariable as late as possible. Prefer to use GetTerms(). |
IsSparse | Return type: |