# ifopt
**Repository Path**: nudtexplorer/ifopt
## Basic Information
- **Project Name**: ifopt
- **Description**: An Eigen-based, light-weight C++ Interface to Nonlinear Programming Solvers (Ipopt, Snopt)
- **Primary Language**: Unknown
- **License**: BSD-3-Clause
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-04-05
- **Last Updated**: 2021-04-05
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
###
[](http://build.ros.org/view/Kdev/job/Kdev__ifopt__ubuntu_xenial_amd64/)
[](http://docs.ros.org/api/ifopt/html/)
[](http://wiki.ros.org/ifopt)

[](https://www.codefactor.io/repository/github/ethz-adrl/ifopt)
[](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29#fulltext)
[](https://doi.org/10.5281/zenodo.1135046)
*A modern, light-weight, [Eigen]-based C++ interface to Nonlinear Programming solvers, such as [Ipopt] and [Snopt].*
An example nonlinear optimization problem to solve is defined as:
* To see how this problem is formulated, see [*test_vars_constr_cost.h*](ifopt_core/test/ifopt/test_vars_constr_cost.h).
* Afterwards the problem can be solved using e.g. Ipopt as shown in [*ex_test_ipopt.cc*](ifopt_ipopt/test/ex_test_ipopt.cc).
Features • Install • Examples • Contribute • Publications • Authors
## Features *Combines* the advantages of [Ipopt] / [Snopt] and [Eigen]: [Ipopt] / [Snopt] | [Eigen] ----------|--------- :heavy_check_mark: high-quality solvers for nonlinear optimization | :heavy_check_mark: modern, intuitive formulations of vectors and matrices :x: C++ API inconvenient and error-prone (raw pointers, index management, jacobian construction) | :heavy_check_mark: highly efficient implementations :x: linking and exporting difficult | * Solver independent formulation of variables and constraints with Eigen (highly efficient) * Automatic index management by formulation of [variable- and constraint-sets](http://docs.ros.org/api/ifopt/html/group__ProblemFormulation.html) * Integration: pure cmake `find_package(ifopt)` or [catkin]/[ROS] (optional) * light-weight (~[2k lines of code](https://i.imgur.com/NCPJsSw.png)) makes it easy to use and extend An optimization problem consists of multiple *independent variable- and constraint-sets*. Each set represents a common concept, e.g. a set of variables might represents spline coefficients, another footstep positions. Similarly, a constraint-set groups similar constraints together. `ifopt` allows users to define each of these sets independently in separate classes and then builds the overall problem from these sets. (No more worrying adapting indices when adding or removing sets). ``` find x0, x1 (variable-sets 0 & 1) s.t x0_lower <= x0 <= x0_upper (bounds on variable-set x0 \in R^2) {x0,x1} = arg min c0(x0,x1)+c1(x0,x1) (cost-terms 0 and 1) g0_lower < g0(x0,x1) < g0_upper (constraint-set 0 \in R^2) g1_lower < g1(x0,x1) < g0_upper (constraint-set 1 \in R^1) ``` Supplying derivative information greatly increases solution speed. `ifopt` allows to define the derivative of each cost-term/constraint-set with respect to each variable-set *independently*. This ensures that when the order of variable-sets changes in the overall vector, this derivative information is still valid. These "Jacobian blocks" must be supplied through ``ConstraintSet::FillJacobianBlock()`` and are then used to build the complete Jacobian for the cost and constraints.
A graphical overview as UML can be seen [here](http://docs.ros.org/api/ifopt/html/inherits.html).
## Install
The easiest way to install is through the [ROS binaries](http://wiki.ros.org/ifopt) and you're all set!
```
sudo apt-get install ros-
## Contribute
We love pull request, whether its interfaces to additional solvers, bug fixes, unit tests or updating the documentation. Please have a look at [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
See here the list of [contributors](https://github.com/ethz-adrl/ifopt/graphs/contributors) who participated in this project.
## Publications
If you use this work, please consider citing as follows:
@misc{ifopt,
author = {Alexander W Winkler},
title = {{Ifopt - A modern, light-weight, Eigen-based C++ interface to
Nonlinear Programming solvers Ipopt and Snopt.}},
year = 2018,
doi = {10.5281/zenodo.1135046},
url = {https://doi.org/10.5281/zenodo.1135046}
}
The research project within which this code was developed:
* A. W. Winkler, D. Bellicoso, M. Hutter, J. Buchli, [Gait and Trajectory Optimization for Legged Systems through Phase-based End-Effector Parameterization](http://awinkler.me), IEEE Robotics and Automation Letters (RA-L), 2018:
## Authors
[Alexander W. Winkler](https://www.alex-winkler.com) - Initial Work/Maintainer
This was has been carried out at the following institutions:
[