Sleipnir C++ API
Loading...
Searching...
No Matches
sleipnir::EqualityConstraints Struct Reference

#include <sleipnir/autodiff/Variable.hpp>

Public Member Functions

 EqualityConstraints (std::initializer_list< EqualityConstraints > equalityConstraints)
 
 EqualityConstraints (const std::vector< EqualityConstraints > &equalityConstraints)
 
template<typename LHS , typename RHS >
requires (ScalarLike<std::decay_t<LHS>> || MatrixLike<std::decay_t<LHS>>) && (ScalarLike<std::decay_t<RHS>> || MatrixLike<std::decay_t<RHS>>) && (!std::same_as<std::decay_t<LHS>, double> || !std::same_as<std::decay_t<RHS>, double>)
 EqualityConstraints (LHS &&lhs, RHS &&rhs)
 
 operator bool ()
 

Public Attributes

small_vector< Variableconstraints
 A vector of scalar equality constraints.
 

Detailed Description

A vector of equality constraints of the form cₑ(x) = 0.

Constructor & Destructor Documentation

◆ EqualityConstraints() [1/3]

sleipnir::EqualityConstraints::EqualityConstraints ( std::initializer_list< EqualityConstraints equalityConstraints)
inline

Concatenates multiple equality constraints.

Parameters
equalityConstraintsThe list of EqualityConstraints to concatenate.

◆ EqualityConstraints() [2/3]

sleipnir::EqualityConstraints::EqualityConstraints ( const std::vector< EqualityConstraints > &  equalityConstraints)
inlineexplicit

Concatenates multiple equality constraints.

This overload is for Python bindings only.

Parameters
equalityConstraintsThe list of EqualityConstraints to concatenate.

◆ EqualityConstraints() [3/3]

template<typename LHS , typename RHS >
requires (ScalarLike<std::decay_t<LHS>> || MatrixLike<std::decay_t<LHS>>) && (ScalarLike<std::decay_t<RHS>> || MatrixLike<std::decay_t<RHS>>) && (!std::same_as<std::decay_t<LHS>, double> || !std::same_as<std::decay_t<RHS>, double>)
sleipnir::EqualityConstraints::EqualityConstraints ( LHS &&  lhs,
RHS &&  rhs 
)
inline

Constructs an equality constraint from a left and right side.

The standard form for equality constraints is c(x) = 0. This function takes a constraint of the form lhs = rhs and converts it to lhs - rhs = 0.

Parameters
lhsLeft-hand side.
rhsRight-hand side.

Member Function Documentation

◆ operator bool()

sleipnir::EqualityConstraints::operator bool ( )
inline

Implicit conversion operator to bool.

Member Data Documentation

◆ constraints

small_vector<Variable> sleipnir::EqualityConstraints::constraints

A vector of scalar equality constraints.


The documentation for this struct was generated from the following file: