proxsuite-nlp
0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear programming on manifolds.
Loading...
Searching...
No Matches
expose-residual.cpp
Go to the documentation of this file.
1
#include "
proxsuite-nlp/python/residuals.hpp
"
2
3
#include "
proxsuite-nlp/modelling/residuals/linear.hpp
"
4
#include "
proxsuite-nlp/modelling/residuals/state-residual.hpp
"
5
6
namespace
proxsuite
{
7
namespace
nlp {
8
namespace
python {
9
using
context::C2Function
;
10
using
context::ConstMatrixRef;
11
using
context::ConstVectorRef;
12
using
context::Manifold
;
13
using
context::MatrixXs;
14
using
context::Scalar
;
15
using
context::Vector3s;
16
using
context::VectorXs;
17
19
void
exposeResiduals
() {
20
21
using
LinearFunction =
LinearFunctionTpl<Scalar>
;
22
23
expose_function<LinearFunction>
(
24
"LinearFunction"
,
"Residual f(x) = Ax + b."
,
25
bp::init<MatrixXs, VectorXs>(bp::args(
"self"
,
"A"
,
"b"
)))
26
.def(bp::init<MatrixXs>(bp::args(
"self"
,
"A"
)))
27
.def_readwrite(
"A"
, &LinearFunction::mat,
"Matrix :math:`A`."
)
28
.def_readwrite(
"b"
, &LinearFunction::b,
"Intercept :math:`b`."
);
29
30
expose_function<ManifoldDifferenceToPoint<Scalar>
>(
31
"ManifoldDifferenceToPoint"
,
"Difference vector x (-) x0."
,
32
bp::init<const polymorphic<Manifold> &,
const
ConstVectorRef &>(
33
(
"self"
_a,
"space"
,
"target"
)))
34
.add_property(
"target"
, &
ManifoldDifferenceToPoint<Scalar>::target_
);
35
36
expose_function<LinearFunctionDifferenceToPoint<Scalar>
>(
37
"LinearFunctionDifferenceToPoint"
,
38
"Linear function of the vector difference to a reference point."
,
39
bp::init<const polymorphic<Manifold> &, VectorXs, MatrixXs, VectorXs>(
40
(
"self"
_a,
"space"
,
"target"
,
"A"
,
"b"
)));
41
}
42
43
}
// namespace python
44
}
// namespace nlp
45
}
// namespace proxsuite
linear.hpp
proxsuite::nlp::context::Scalar
double Scalar
Definition
context.hpp:9
proxsuite::nlp::python::exposeResiduals
void exposeResiduals()
Expose some residual functions.
Definition
expose-residual.cpp:19
proxsuite::nlp::python::expose_function
auto expose_function(const char *name, const char *docstring, Init init)
Expose a differentiable residual (subclass of C2FunctionTpl).
Definition
residuals.hpp:9
proxsuite
Main package namespace.
Definition
bcl-params.hpp:5
residuals.hpp
state-residual.hpp
proxsuite::nlp::C2FunctionTpl
Twice-differentiable function, with method Jacobian and vector-hessian product evaluation.
Definition
fwd.hpp:76
proxsuite::nlp::LinearFunctionTpl
Linear residuals .
Definition
linear.hpp:14
proxsuite::nlp::ManifoldAbstractTpl< Scalar >
proxsuite::nlp::ManifoldDifferenceToPoint
Definition
state-residual.hpp:19
bindings
python
expose-residual.cpp
Generated by
1.11.0