WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
bounds.hpp File Reference
#include <algorithm>
#include <limits>
#include <span>
#include <utility>
#include <Eigen/Core>
#include <Eigen/SparseCore>
#include <gch/small_vector.hpp>
#include "sleipnir/autodiff/expression_type.hpp"
#include "sleipnir/autodiff/variable.hpp"
#include "sleipnir/util/assert.hpp"

Go to the source code of this file.

Classes

struct  slp::Bounds< Scalar >
 Bound constraint metadata. More...

Namespaces

namespace  slp

Functions

template<typename Scalar>
Bounds< Scalar > slp::get_bounds (std::span< Variable< Scalar > > decision_variables, std::span< Variable< Scalar > > inequality_constraints, const Eigen::SparseMatrix< Scalar, Eigen::RowMajor > &A_i)
 A "bound constraint" is any linear constraint in one scalar variable.
template<typename Derived>
requires (static_cast<bool>(Eigen::DenseBase<Derived>::IsVectorAtCompileTime))
void slp::project_onto_bounds (Eigen::DenseBase< Derived > &x, std::span< const std::pair< typename Eigen::DenseBase< Derived >::Scalar, typename Eigen::DenseBase< Derived >::Scalar > > decision_variable_indices_to_bounds, const typename Eigen::DenseBase< Derived >::Scalar κ_1=typename Eigen::DenseBase< Derived >::Scalar(1e-2), const typename Eigen::DenseBase< Derived >::Scalar κ_2=typename Eigen::DenseBase< Derived >::Scalar(1e-2))
 Projects the decision variables onto the given bounds, while ensuring some configurable distance from the boundary if possible.