Owned third-order TOPP/COPP profile. More...
#include <interpolation.hpp>
Public Member Functions | |
| Profile3rd ()=default | |
| Profile3rd (std::vector< double > a_values, std::vector< double > b_values) | |
| Profile3rd (std::vector< double > a_values, std::vector< double > b_values, std::pair< std::size_t, std::size_t > num_stationary) | |
| Profile3rd (std::vector< double > a_values, std::vector< double > b_values, std::size_t stationary_start, std::size_t stationary_end) | |
| std::size_t | len () const noexcept |
| std::size_t | size () const noexcept |
| bool | empty () const noexcept |
| std::pair< std::size_t, std::size_t > | num_stationary () const noexcept |
| Profile3rdRef | ref () const |
| Borrow this owned profile without copying arrays. | |
| Profile3rdRef | slice (std::size_t idx_s_start, std::size_t idx_s_final) const |
| Borrow a closed station subrange idx_s_start..=idx_s_final. | |
| Profile3rdRef | segment (std::size_t idx_s) const |
| Borrow one segment as the two-node profile idx_s..=idx_s+1. | |
| bool | force_positive_a (Span< const double > s, double a_min=1.0e-12) |
| Adjust a and b in place so interpolated a(s) stays strictly positive on every interval. | |
| Expected< bool > | force_positive_a (Span< const double > s, double a_min, NoThrowTag) |
| No-throw forms of force_positive_a. | |
| Expected< bool > | force_positive_a (Span< const double > s, NoThrowTag) |
Public Attributes | |
| std::vector< double > | a |
| std::vector< double > | b |
| std::size_t | num_stationary_start = 0 |
| std::size_t | num_stationary_end = 0 |
Owned third-order TOPP/COPP profile.
a and b are both node-based and must have the same length as the station grid s used for interpolation. Public fields intentionally stay writable to match the lightweight Rust/Python storage style; constructors validate the initial shape, while direct later edits are the user's responsibility.
Definition at line 68 of file interpolation.hpp.
|
default |
| copp::Profile3rd::Profile3rd | ( | std::vector< double > | a_values, |
| std::vector< double > | b_values ) |
| copp::Profile3rd::Profile3rd | ( | std::vector< double > | a_values, |
| std::vector< double > | b_values, | ||
| std::pair< std::size_t, std::size_t > | num_stationary ) |
| copp::Profile3rd::Profile3rd | ( | std::vector< double > | a_values, |
| std::vector< double > | b_values, | ||
| std::size_t | stationary_start, | ||
| std::size_t | stationary_end ) |
|
inlinenoexcept |
Definition at line 87 of file interpolation.hpp.
|
inlinenoexcept |
Definition at line 88 of file interpolation.hpp.
|
inlinenoexcept |
Definition at line 89 of file interpolation.hpp.
|
inlinenoexcept |
Definition at line 90 of file interpolation.hpp.
| Profile3rdRef copp::Profile3rd::ref | ( | ) | const |
Borrow this owned profile without copying arrays.
| Profile3rdRef copp::Profile3rd::slice | ( | std::size_t | idx_s_start, |
| std::size_t | idx_s_final ) const |
Borrow a closed station subrange idx_s_start..=idx_s_final.
| Profile3rdRef copp::Profile3rd::segment | ( | std::size_t | idx_s | ) | const |
Borrow one segment as the two-node profile idx_s..=idx_s+1.
| bool copp::Profile3rd::force_positive_a | ( | Span< const double > | s, |
| double | a_min = 1.0e-12 ) |
Adjust a and b in place so interpolated a(s) stays strictly positive on every interval.
A profile whose a touches zero at or between stations can have an interpolated a(s) that dips to or below zero inside an interval. Call this before interpolation::s_to_t_topp3 on such profiles. The adjustment rewrites a and b without knowing the acceleration and jerk limits, so re-check the result with ConstraintsRef::exceed_topp3 afterwards.
| s | Strictly increasing station grid with s.size() == len() and at least four stations. |
| a_min | Nonnegative lower target for interpolated a. |
| copp::Error | on invalid input: length mismatch, fewer than four stations, negative a or a_min, non-finite values, non-increasing s, or stationary counts that leave no motion interval. |
|
inline |
No-throw forms of force_positive_a.
The Expected only reports whether the call itself succeeded (invalid input becomes an error). The repaired flag is its value(), which can be false even when the call succeeded.
Definition at line 135 of file interpolation.hpp.
|
inline |
Definition at line 143 of file interpolation.hpp.
| std::vector<double> copp::Profile3rd::a |
Definition at line 70 of file interpolation.hpp.
| std::vector<double> copp::Profile3rd::b |
Definition at line 71 of file interpolation.hpp.
| std::size_t copp::Profile3rd::num_stationary_start = 0 |
Definition at line 72 of file interpolation.hpp.
| std::size_t copp::Profile3rd::num_stationary_end = 0 |
Definition at line 73 of file interpolation.hpp.