C++ Reference
C++ Reference: Routing
RoutingModel::RouteDimensionTravelInfo::TransitionInfo::PiecewiseLinearFormulation
Detailed Description
The following struct defines a piecewise linear formulation, with int64_t values for the "anchor" x and y values, and potential double values for the slope of each linear function.
Public Member Functions | |
| std::string | DebugString (std::string line_prefix="") const |
Public Attributes | |
| absl::InlinedVector< int64_t, 8 > | x_anchors |
| The set of increasing anchor cumul values for the interpolation. More... | |
| absl::InlinedVector< int64_t, 8 > | y_anchors |
| The y values used for the interpolation: For any x anchor value, let i be an index such that x_anchors[i] ≤ x < x_anchors[i+1], then the y value for x is y_anchors[i] * (1-λ) + y_anchors[i+1] * λ, with λ = (x - x_anchors[i]) / (x_anchors[i+1] - x_anchors[i]). More... | |
Member Function Documentation
◆ DebugString()
| std::string DebugString | ( | std::string | line_prefix = "" | ) | const |
Member Data Documentation
◆ x_anchors
| absl::InlinedVector<int64_t, 8> x_anchors |
◆ y_anchors
| absl::InlinedVector<int64_t, 8> y_anchors |
The y values used for the interpolation: For any x anchor value, let i be an index such that x_anchors[i] ≤ x < x_anchors[i+1], then the y value for x is y_anchors[i] * (1-λ) + y_anchors[i+1] * λ, with λ = (x - x_anchors[i]) / (x_anchors[i+1] - x_anchors[i]).
The documentation for this struct was generated from the following file: