コンテンツにスキップ

cpp_robotics::Constraint

数理最適問題に使用する制約クラス

#include <constraint.hpp>

Public Types

Name
enum uint8_t Type
using std::function< double(Eigen::VectorXd)> func_type
using std::function< Eigen::VectorXd(Eigen::VectorXd)> grad_func_type
using std::function< Eigen::MatrixXd(Eigen::VectorXd)> hessian_func_type

Public Functions

Name
Constraint()
Constraint(Type type_, func_type con_)
double eval(const Eigen::VectorXd & x) const
bool satisfy(const Eigen::VectorXd & x, const double tol) const
Eigen::VectorXd grad(Eigen::VectorXd x)
Eigen::MatrixXd hessian(Eigen::VectorXd x)

Public Attributes

Name
Type type
func_type con_f
std::optional< grad_func_type > con_grad_f
std::optional< hessian_func_type > con_hessian_f

Public Types Documentation

enum Type

Enumerator Value Description
Eq
Ineq
None

using func_type

using cpp_robotics::Constraint::func_type =  std::function<double(Eigen::VectorXd)>;

using grad_func_type

using cpp_robotics::Constraint::grad_func_type =  std::function<Eigen::VectorXd(Eigen::VectorXd)>;

using hessian_func_type

using cpp_robotics::Constraint::hessian_func_type =  std::function<Eigen::MatrixXd(Eigen::VectorXd)>;

Public Functions Documentation

function Constraint

inline Constraint()

function Constraint

inline Constraint(
    Type type_,
    func_type con_
)

function eval

inline double eval(
    const Eigen::VectorXd & x
) const

function satisfy

inline bool satisfy(
    const Eigen::VectorXd & x,
    const double tol
) const

function grad

inline Eigen::VectorXd grad(
    Eigen::VectorXd x
)

function hessian

inline Eigen::MatrixXd hessian(
    Eigen::VectorXd x
)

Public Attributes Documentation

variable type

Type type;

variable con_f

func_type con_f;

variable con_grad_f

std::optional< grad_func_type > con_grad_f;

variable con_hessian_f

std::optional< hessian_func_type > con_hessian_f;

Updated on 2024-05-28 at 06:55:39 +0000