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

Optional Eigen adapters that convert Eigen objects to COPP matrix views or map COPP-owned matrices without changing the core API types. More...

Typedefs

using ColMajorMatrix = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>
 Dynamic column-major Eigen matrix type matching copp::Matrix storage.
using RowMajorMatrix = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>
 Dynamic row-major Eigen matrix accepted by input adapters.
using Vector = Eigen::Matrix<double, Eigen::Dynamic, 1>
 Dynamic Eigen vector accepted by Span adapters.

Functions

MatrixView matrix_view (const Eigen::Ref< const ColMajorMatrix > &matrix)
 Borrow a column-major Eigen matrix as a COPP matrix view.
MatrixView matrix_view (const Eigen::Ref< const RowMajorMatrix > &matrix)
 Borrow a row-major Eigen matrix as a COPP matrix view.
Span< const double > span (const Eigen::Ref< const Vector > &vector)
 Borrow a contiguous Eigen vector as Span<const double>.
Eigen::Map< ColMajorMatrixmap (Matrix &matrix)
 Map a mutable COPP matrix into Eigen without copying.
Eigen::Map< const ColMajorMatrixmap (const Matrix &matrix)
 Map a const COPP matrix into Eigen without copying.
ColMajorMatrix copy (const Matrix &matrix)
 Copy a COPP matrix into an owning Eigen column-major matrix.

Detailed Description

Optional Eigen adapters that convert Eigen objects to COPP matrix views or map COPP-owned matrices without changing the core API types.

Typedef Documentation

◆ ColMajorMatrix

using copp::eigen::ColMajorMatrix = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>

Dynamic column-major Eigen matrix type matching copp::Matrix storage.

Definition at line 19 of file eigen.hpp.

◆ RowMajorMatrix

using copp::eigen::RowMajorMatrix = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>

Dynamic row-major Eigen matrix accepted by input adapters.

Definition at line 21 of file eigen.hpp.

◆ Vector

using copp::eigen::Vector = Eigen::Matrix<double, Eigen::Dynamic, 1>

Dynamic Eigen vector accepted by Span adapters.

Definition at line 23 of file eigen.hpp.

Function Documentation

◆ matrix_view() [1/2]

MatrixView copp::eigen::matrix_view ( const Eigen::Ref< const ColMajorMatrix > & matrix)
inline

Borrow a column-major Eigen matrix as a COPP matrix view.

Parameters
matrixEigen reference whose inner stride must be one.
Returns
Non-owning MatrixView; the Eigen object must outlive the COPP call.
Exceptions
copp::Errorwhen the view is not contiguous along the inner dimension.
Eigen::MatrixXd waypoints(2, 3);
static Path from_waypoints(MatrixView waypoints, SplineConfig config={})
Build a spline path from waypoint positions.
MatrixView matrix_view(const Eigen::Ref< const ColMajorMatrix > &matrix)
Borrow a column-major Eigen matrix as a COPP matrix view.
Definition eigen.hpp:35

Definition at line 35 of file eigen.hpp.

◆ matrix_view() [2/2]

MatrixView copp::eigen::matrix_view ( const Eigen::Ref< const RowMajorMatrix > & matrix)
inline

Borrow a row-major Eigen matrix as a COPP matrix view.

Row-major views are useful for user-owned data tables. Public COPP functions either interpret the row-major descriptor directly or copy once before entering Rust, depending on the operation.

Definition at line 53 of file eigen.hpp.

◆ span()

Span< const double > copp::eigen::span ( const Eigen::Ref< const Vector > & vector)
inline

Borrow a contiguous Eigen vector as Span<const double>.

Definition at line 68 of file eigen.hpp.

◆ map() [1/2]

Eigen::Map< ColMajorMatrix > copp::eigen::map ( Matrix & matrix)
inline

Map a mutable COPP matrix into Eigen without copying.

The returned Eigen::Map borrows matrix; do not use it after the matrix is destroyed or reallocated.

Definition at line 81 of file eigen.hpp.

◆ map() [2/2]

Eigen::Map< const ColMajorMatrix > copp::eigen::map ( const Matrix & matrix)
inline

Map a const COPP matrix into Eigen without copying.

Definition at line 90 of file eigen.hpp.

◆ copy()

ColMajorMatrix copp::eigen::copy ( const Matrix & matrix)
inline

Copy a COPP matrix into an owning Eigen column-major matrix.

Definition at line 99 of file eigen.hpp.