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
3
#include "
proxsuite-nlp/modelling/costs/quadratic-residual.hpp
"
4
#include "
proxsuite-nlp/modelling/residuals/state-residual.hpp
"
5
6
namespace
proxsuite
{
7
namespace
nlp {
8
17
template
<
typename
_Scalar>
18
struct
QuadraticDistanceCostTpl
:
QuadraticResidualCostTpl
<_Scalar> {
19
using
Scalar
=
_Scalar
;
20
PROXSUITE_NLP_DYNAMIC_TYPEDEFS
(
Scalar
);
21
using
StateResidual
=
ManifoldDifferenceToPoint<Scalar>
;
22
using
Manifold
=
ManifoldAbstractTpl<Scalar>
;
23
using
Base
=
QuadraticResidualCostTpl<Scalar>
;
24
using
Base::residual_
;
25
using
Base::weights_
;
26
27
QuadraticDistanceCostTpl
(
const
polymorphic<Manifold>
&space,
28
const
ConstVectorRef &target,
29
const
ConstMatrixRef &weights)
30
:
Base
(std::make_shared<
StateResidual
>(space, target), weights) {}
31
32
QuadraticDistanceCostTpl
(
const
polymorphic<Manifold>
&space,
33
const
ConstVectorRef &target)
34
:
QuadraticDistanceCostTpl
(
35
space, target, MatrixXs::Identity(space->
ndx
(), space->
ndx
())) {}
36
37
QuadraticDistanceCostTpl
(
const
polymorphic<Manifold>
&space)
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
xyz::polymorphic
Definition
polymorphic_cxx14.hpp:160
PROXSUITE_NLP_DYNAMIC_TYPEDEFS
#define PROXSUITE_NLP_DYNAMIC_TYPEDEFS(Scalar)
Definition
math.hpp:26
proxsuite
Main package namespace.
Definition
bcl-params.hpp:5
quadratic-residual.hpp
state-residual.hpp
proxsuite::nlp::BaseFunctionTpl< _Scalar >::ndx
int ndx() const
Definition
function-base.hpp:37
proxsuite::nlp::ManifoldAbstractTpl< Scalar >
proxsuite::nlp::ManifoldDifferenceToPoint
Definition
state-residual.hpp:19
proxsuite::nlp::QuadraticDistanceCostTpl
Weighted quadratic distance on a space.
Definition
squared-distance.hpp:18
proxsuite::nlp::QuadraticDistanceCostTpl::QuadraticDistanceCostTpl
QuadraticDistanceCostTpl(const polymorphic< Manifold > &space, const ConstVectorRef &target)
Definition
squared-distance.hpp:32
proxsuite::nlp::QuadraticDistanceCostTpl::Scalar
_Scalar Scalar
Definition
squared-distance.hpp:19
proxsuite::nlp::QuadraticDistanceCostTpl::QuadraticDistanceCostTpl
QuadraticDistanceCostTpl(const polymorphic< Manifold > &space)
Definition
squared-distance.hpp:37
proxsuite::nlp::QuadraticDistanceCostTpl::QuadraticDistanceCostTpl
QuadraticDistanceCostTpl(const polymorphic< Manifold > &space, const ConstVectorRef &target, const ConstMatrixRef &weights)
Definition
squared-distance.hpp:27
proxsuite::nlp::QuadraticDistanceCostTpl::getTarget
ConstVectorRef getTarget() const
Definition
squared-distance.hpp:40
proxsuite::nlp::QuadraticDistanceCostTpl::updateTarget
void updateTarget(const ConstVectorRef &x)
Definition
squared-distance.hpp:44
proxsuite::nlp::QuadraticResidualCostTpl
Quadratic function of a residual.
Definition
quadratic-residual.hpp:22
proxsuite::nlp::QuadraticResidualCostTpl< Scalar >::residual_
FunctionPtr residual_
Definition
quadratic-residual.hpp:34
proxsuite::nlp::QuadraticResidualCostTpl< Scalar >::weights_
MatrixXs weights_
Definition
quadratic-residual.hpp:36
proxsuite::nlp::math_types::_Scalar
_Scalar
Definition
math.hpp:45
include
proxsuite-nlp
modelling
costs
squared-distance.hpp
Generated by
1.11.0