proxsuite-nlp
0.11.0
A primal-dual augmented Lagrangian-type solver for nonlinear programming on manifolds.
Loading...
Searching...
No Matches
state-residual.hpp
1
5
#pragma once
6
7
#include "
proxsuite-nlp/function-base.hpp
"
8
#include "
proxsuite-nlp/manifold-base.hpp
"
9
#include "proxsuite-nlp/third-party/polymorphic_cxx14.hpp"
10
11
namespace
proxsuite
{
12
namespace
nlp {
13
18
template
<
typename
_Scalar>
19
struct
ManifoldDifferenceToPoint : C2FunctionTpl<_Scalar> {
20
public
:
21
using
Scalar = _Scalar;
22
PROXSUITE_NLP_DYNAMIC_TYPEDEFS
(Scalar);
23
24
using
Base = C2FunctionTpl<Scalar>;
25
using
Base::operator();
26
using
Base::computeJacobian
;
27
using
Manifold =
ManifoldAbstractTpl<Scalar>
;
28
30
VectorXs
target_
;
31
polymorphic<Manifold> space_;
32
33
ManifoldDifferenceToPoint(
const
polymorphic<Manifold> &space,
34
const
ConstVectorRef &target)
35
: Base(space->
nx
(), space->
ndx
(), space->
ndx
()),
target_
(target),
36
space_(space) {
37
if
(!space->isNormalized(
target_
)) {
38
PROXSUITE_NLP_RUNTIME_ERROR(
39
"Target parameter is not a valid element of the manifold."
);
40
}
41
}
42
43
VectorXs
operator()
(
const
ConstVectorRef &x)
const
{
44
return
space_->difference(
target_
, x);
45
}
46
47
void
computeJacobian
(
const
ConstVectorRef &x, MatrixRef Jout)
const
{
48
space_->Jdifference(
target_
, x, Jout, 1);
49
}
50
};
51
52
}
// namespace nlp
53
}
// namespace proxsuite
function-base.hpp
Base definitions for function classes.
manifold-base.hpp
PROXSUITE_NLP_DYNAMIC_TYPEDEFS
#define PROXSUITE_NLP_DYNAMIC_TYPEDEFS(Scalar)
Definition
math.hpp:26
proxsuite
Main package namespace.
Definition
bcl-params.hpp:5
proxsuite::nlp::BaseFunctionTpl< Scalar >::nx
int nx() const
Definition
function-base.hpp:35
proxsuite::nlp::BaseFunctionTpl< Scalar >::ndx
int ndx() const
Definition
function-base.hpp:37
proxsuite::nlp::C1FunctionTpl< Scalar >::computeJacobian
virtual void computeJacobian(const ConstVectorRef &x, MatrixRef Jout) const=0
proxsuite::nlp::ManifoldAbstractTpl
Definition
manifold-base.hpp:13
proxsuite::nlp::ManifoldDifferenceToPoint::computeJacobian
void computeJacobian(const ConstVectorRef &x, MatrixRef Jout) const
Jacobian matrix of the constraint function.
Definition
state-residual.hpp:47
proxsuite::nlp::ManifoldDifferenceToPoint< Scalar >::target_
VectorXs target_
Definition
state-residual.hpp:30
proxsuite::nlp::ManifoldDifferenceToPoint::operator()
VectorXs operator()(const ConstVectorRef &x) const
Evaluate the residual at a given point x.
Definition
state-residual.hpp:43
include
proxsuite-nlp
modelling
residuals
state-residual.hpp
Generated by
1.13.2