![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <piecewise_linear_function.h>
Public Member Functions | |
FloatSlopePiecewiseLinearFunction ()=default | |
FloatSlopePiecewiseLinearFunction (absl::InlinedVector< int64_t, 8 > x_anchors, absl::InlinedVector< int64_t, 8 > y_anchors) | |
FloatSlopePiecewiseLinearFunction (FloatSlopePiecewiseLinearFunction &&other) noexcept | |
FloatSlopePiecewiseLinearFunction & | operator= (FloatSlopePiecewiseLinearFunction &&other) noexcept |
std::string | DebugString (absl::string_view line_prefix={}) const |
const absl::InlinedVector< int64_t, 8 > & | x_anchors () const |
const absl::InlinedVector< int64_t, 8 > & | y_anchors () const |
int64_t | ComputeInBoundsValue (int64_t x) const |
int64_t | ComputeConvexValue (int64_t x) const |
Static Public Attributes | |
static const int | kNoValue = -1 |
FloatSlopePiecewiseLinearFunction. | |
The following class defines a piecewise linear formulation with potential double values for the slope of each linear function. This formulation is meant to be used with a small number of segments (see InlinedVector sizes below). These segments are determined by int64_t values for the "anchor" x and y values, such that (x_anchors_[i], y_anchors_[i]) and (x_anchors_[i+1], y_anchors_[i+1]) are respectively the start and end point of the i-th segment.
Definition at line 287 of file piecewise_linear_function.h.
|
default |
operations_research::FloatSlopePiecewiseLinearFunction::FloatSlopePiecewiseLinearFunction | ( | absl::InlinedVector< int64_t, 8 > | x_anchors, |
absl::InlinedVector< int64_t, 8 > | y_anchors ) |
Definition at line 815 of file piecewise_linear_function.cc.
|
inlinenoexcept |
Definition at line 294 of file piecewise_linear_function.h.
int64_t operations_research::FloatSlopePiecewiseLinearFunction::ComputeConvexValue | ( | int64_t | x | ) | const |
Computes the y value associated to 'x'. Unlike ComputeInBoundsValue(), if 'x' is outside the bounds of the function, the function will still be defined by its outer segments.
Definition at line 841 of file piecewise_linear_function.cc.
int64_t operations_research::FloatSlopePiecewiseLinearFunction::ComputeInBoundsValue | ( | int64_t | x | ) | const |
Computes the y value associated to 'x'. Returns kNoValue if 'x' is out of bounds, i.e. lower than the first x_anchor and largest than the last.
Definition at line 834 of file piecewise_linear_function.cc.
std::string operations_research::FloatSlopePiecewiseLinearFunction::DebugString | ( | absl::string_view | line_prefix = {} | ) | const |
Definition at line 824 of file piecewise_linear_function.cc.
|
inlinenoexcept |
Definition at line 299 of file piecewise_linear_function.h.
|
inline |
Definition at line 308 of file piecewise_linear_function.h.
|
inline |
Definition at line 311 of file piecewise_linear_function.h.
|
static |
FloatSlopePiecewiseLinearFunction.
Definition at line 289 of file piecewise_linear_function.h.