simple_casadi_mpc
GitHub
Loading...
Searching...
No Matches
casadi_utils Namespace Reference

Small adapters between CasADi DM matrices and Eigen dense matrices. More...

Functions

Eigen::MatrixXd to_eigen (const casadi::DM &dm)
 Convert a CasADi DM (column-major) into an Eigen MatrixXd.
 
casadi::DM to_casadi (const Eigen::MatrixXd &mat)
 Convert an Eigen MatrixXd into a CasADi DM.
 

Detailed Description

Small adapters between CasADi DM matrices and Eigen dense matrices.

Function Documentation

◆ to_casadi()

casadi::DM casadi_utils::to_casadi ( const Eigen::MatrixXd & mat)
inline

Convert an Eigen MatrixXd into a CasADi DM.

Parameters
matEigen matrix to copy.
Returns
CasADi DM holding a deep copy of mat.

◆ to_eigen()

Eigen::MatrixXd casadi_utils::to_eigen ( const casadi::DM & dm)
inline

Convert a CasADi DM (column-major) into an Eigen MatrixXd.

Parameters
dmCasADi DM with the same shape as the returned matrix.
Returns
Eigen MatrixXd holding a deep copy of dm.