COPP C++ API
C++ interface for COPP trajectory optimization
Loading...
Searching...
No Matches
copp::Profile3rdRef Struct Reference

Borrowed third-order TOPP/COPP profile view. More...

#include <interpolation.hpp>

Public Member Functions

 Profile3rdRef ()=default
 Profile3rdRef (Span< const double > a_values, Span< const double > b_values)
 Profile3rdRef (Span< const double > a_values, Span< const double > b_values, std::pair< std::size_t, std::size_t > num_stationary)
 Profile3rdRef (Span< const double > a_values, Span< const 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 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.

Public Attributes

Span< const double > a
Span< const double > b
std::size_t num_stationary_start = 0
std::size_t num_stationary_end = 0

Detailed Description

Borrowed third-order TOPP/COPP profile view.

Profile3rdRef mirrors Rust's Topp3ProfileRef: it borrows node-based a(s) = dot{s}^2 and b(s) = ddot{s} arrays plus the effective stationary interval counts at the beginning and end. The referenced arrays are not copied and must outlive the call that consumes this view.

The slice helpers use inclusive station indices, matching IndexInterval: slice(i, j) borrows nodes i..=j and adjusts stationary counts for the local profile.

Definition at line 21 of file interpolation.hpp.

Constructor & Destructor Documentation

◆ Profile3rdRef() [1/4]

copp::Profile3rdRef::Profile3rdRef ( )
default

◆ Profile3rdRef() [2/4]

copp::Profile3rdRef::Profile3rdRef ( Span< const double > a_values,
Span< const double > b_values )

◆ Profile3rdRef() [3/4]

copp::Profile3rdRef::Profile3rdRef ( Span< const double > a_values,
Span< const double > b_values,
std::pair< std::size_t, std::size_t > num_stationary )

◆ Profile3rdRef() [4/4]

copp::Profile3rdRef::Profile3rdRef ( Span< const double > a_values,
Span< const double > b_values,
std::size_t stationary_start,
std::size_t stationary_end )

Member Function Documentation

◆ len()

std::size_t copp::Profile3rdRef::len ( ) const
inlinenoexcept

Definition at line 40 of file interpolation.hpp.

◆ size()

std::size_t copp::Profile3rdRef::size ( ) const
inlinenoexcept

Definition at line 41 of file interpolation.hpp.

◆ empty()

bool copp::Profile3rdRef::empty ( ) const
inlinenoexcept

Definition at line 42 of file interpolation.hpp.

◆ num_stationary()

std::pair< std::size_t, std::size_t > copp::Profile3rdRef::num_stationary ( ) const
inlinenoexcept

Definition at line 43 of file interpolation.hpp.

◆ slice()

Profile3rdRef copp::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.

Returns
A new non-owning profile view whose a/b spans point into the original arrays. Stationary-boundary counts are clipped to the local subrange.
Exceptions
copp::Errorif the interval is empty, out of range, or would be entirely stationary.

◆ segment()

Profile3rdRef copp::Profile3rdRef::segment ( std::size_t idx_s) const

Borrow one segment as the two-node profile idx_s..=idx_s+1.

Member Data Documentation

◆ a

Span<const double> copp::Profile3rdRef::a

Definition at line 23 of file interpolation.hpp.

◆ b

Span<const double> copp::Profile3rdRef::b

Definition at line 24 of file interpolation.hpp.

◆ num_stationary_start

std::size_t copp::Profile3rdRef::num_stationary_start = 0

Definition at line 25 of file interpolation.hpp.

◆ num_stationary_end

std::size_t copp::Profile3rdRef::num_stationary_end = 0

Definition at line 26 of file interpolation.hpp.


The documentation for this struct was generated from the following file: