proxsuite-nlp  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear programming on manifolds.
Loading...
Searching...
No Matches
squared-distance.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace proxsuite {
7namespace nlp {
8
17template <typename _Scalar>
19 using Scalar = _Scalar;
24 using Base::residual_;
25 using Base::weights_;
26
28 const ConstVectorRef &target,
29 const ConstMatrixRef &weights)
30 : Base(std::make_shared<StateResidual>(space, target), weights) {}
31
33 const ConstVectorRef &target)
35 space, target, MatrixXs::Identity(space->ndx(), space->ndx())) {}
36
38 : QuadraticDistanceCostTpl(space, space->neutral()) {}
39
40 ConstVectorRef getTarget() const {
41 return static_cast<StateResidual *>(residual_.get())->target_;
42 }
43
44 void updateTarget(const ConstVectorRef &x) {
45 static_cast<StateResidual *>(residual_.get())->target_ = x;
46 }
47};
48
49} // namespace nlp
50} // namespace proxsuite
51
52#ifdef PROXSUITE_NLP_ENABLE_TEMPLATE_INSTANTIATION
53#include "proxsuite-nlp/modelling/costs/squared-distance.txx"
54#endif
#define PROXSUITE_NLP_DYNAMIC_TYPEDEFS(Scalar)
Definition math.hpp:26
Main package namespace.
Definition bcl-params.hpp:5
Weighted quadratic distance on a space.
QuadraticDistanceCostTpl(const polymorphic< Manifold > &space, const ConstVectorRef &target)
QuadraticDistanceCostTpl(const polymorphic< Manifold > &space)
QuadraticDistanceCostTpl(const polymorphic< Manifold > &space, const ConstVectorRef &target, const ConstMatrixRef &weights)
void updateTarget(const ConstVectorRef &x)
Quadratic function of a residual.