aligator
0.19.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Toggle main menu visibility
Loading...
Searching...
No Matches
relaxed-log-barrier.hpp
Go to the documentation of this file.
1
3
#pragma once
4
5
#include "
./composite-costs.hpp
"
6
7
namespace
aligator
{
8
10
template
<
typename
Scalar>
11
struct
RelaxedLogBarrierCostTpl
:
CostAbstractTpl
<Scalar> {
12
ALIGATOR_DYNAMIC_TYPEDEFS
(
Scalar
);
13
using
CostDataAbstract
=
CostDataAbstractTpl<Scalar>
;
14
using
Data
=
CompositeCostDataTpl<Scalar>
;
15
using
StageFunction
=
StageFunctionTpl<Scalar>
;
16
using
Base
=
CostAbstractTpl<Scalar>
;
17
using
Manifold
=
ManifoldAbstractTpl<Scalar>
;
18
19
VectorXs
barrier_weights_
;
20
xyz::polymorphic<StageFunction>
residual_
;
21
Scalar
threshold_
;
22
23
RelaxedLogBarrierCostTpl
(xyz::polymorphic<Manifold>
space
,
24
xyz::polymorphic<StageFunction> function,
25
const
ConstVectorRef &weight,
26
const
Scalar
threshold);
27
28
RelaxedLogBarrierCostTpl
(xyz::polymorphic<Manifold>
space
,
29
xyz::polymorphic<StageFunction> function,
30
const
Scalar
weight,
const
Scalar
threshold);
31
32
void
evaluate
(
const
ConstVectorRef &x,
const
ConstVectorRef &u,
33
CostDataAbstract
&data)
const
;
34
35
void
computeGradients
(
const
ConstVectorRef &x,
const
ConstVectorRef &u,
36
CostDataAbstract
&data)
const
;
37
38
void
computeHessians
(
const
ConstVectorRef &,
const
ConstVectorRef &,
39
CostDataAbstract
&data)
const
;
40
41
shared_ptr<CostDataAbstract>
createData
()
const
{
42
return
std::make_shared<Data>(this->
ndx
(), this->
nu
,
43
residual_
->createData());
44
}
45
48
template
<
typename
Derived> Derived *
getResidual
() {
49
return
dynamic_cast<
Derived *
>
(&*
residual_
);
50
}
51
53
template
<
typename
Derived>
const
Derived *
getResidual
()
const
{
54
return
dynamic_cast<
const
Derived *
>
(&*
residual_
);
55
}
56
};
57
58
extern
template
struct
RelaxedLogBarrierCostTpl<context::Scalar>;
59
60
}
// namespace aligator
61
62
#include "./relaxed-log-barrier.hxx"
composite-costs.hpp
aligator
Main package namespace.
Definition
action-model-wrap.hpp:14
aligator::CompositeCostDataTpl
Data struct for composite costs.
Definition
composite-costs.hpp:15
aligator::CostAbstractTpl< Scalar >::space
xyz::polymorphic< Manifold > space
Definition
cost-abstract.hpp:20
aligator::CostAbstractTpl< Scalar >::CostAbstractTpl
CostAbstractTpl(U &&space, const int nu)
Definition
cost-abstract.hpp:28
aligator::CostAbstractTpl< Scalar >::nu
int nu
Definition
cost-abstract.hpp:22
aligator::CostAbstractTpl< Scalar >::ndx
int ndx() const
Definition
cost-abstract.hpp:25
aligator::CostAbstractTpl< Scalar >::Scalar
Scalar Scalar
Definition
cost-abstract.hpp:14
aligator::CostDataAbstractTpl
Data struct for CostAbstractTpl.
Definition
cost-abstract.hpp:73
aligator::ManifoldAbstractTpl
Base class for manifolds, to use in cost funcs, solvers...
Definition
manifold-base.hpp:11
aligator::RelaxedLogBarrierCostTpl::computeHessians
void computeHessians(const ConstVectorRef &, const ConstVectorRef &, CostDataAbstract &data) const
Compute the cost Hessians .
aligator::RelaxedLogBarrierCostTpl::barrier_weights_
VectorXs barrier_weights_
Definition
relaxed-log-barrier.hpp:19
aligator::RelaxedLogBarrierCostTpl::threshold_
Scalar threshold_
Definition
relaxed-log-barrier.hpp:21
aligator::RelaxedLogBarrierCostTpl::getResidual
Derived * getResidual()
Get a pointer to the underlying type of the residual, by attempting to cast.
Definition
relaxed-log-barrier.hpp:48
aligator::RelaxedLogBarrierCostTpl::RelaxedLogBarrierCostTpl
RelaxedLogBarrierCostTpl(xyz::polymorphic< Manifold > space, xyz::polymorphic< StageFunction > function, const ConstVectorRef &weight, const Scalar threshold)
aligator::RelaxedLogBarrierCostTpl::computeGradients
void computeGradients(const ConstVectorRef &x, const ConstVectorRef &u, CostDataAbstract &data) const
Compute the cost gradients .
aligator::RelaxedLogBarrierCostTpl::Data
CompositeCostDataTpl< Scalar > Data
Definition
relaxed-log-barrier.hpp:14
aligator::RelaxedLogBarrierCostTpl::evaluate
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, CostDataAbstract &data) const
Evaluate the cost function.
aligator::RelaxedLogBarrierCostTpl::Base
CostAbstractTpl< Scalar > Base
Definition
relaxed-log-barrier.hpp:16
aligator::RelaxedLogBarrierCostTpl::residual_
xyz::polymorphic< StageFunction > residual_
Definition
relaxed-log-barrier.hpp:20
aligator::RelaxedLogBarrierCostTpl::createData
shared_ptr< CostDataAbstract > createData() const
Definition
relaxed-log-barrier.hpp:41
aligator::RelaxedLogBarrierCostTpl::Manifold
ManifoldAbstractTpl< Scalar > Manifold
Definition
relaxed-log-barrier.hpp:17
aligator::RelaxedLogBarrierCostTpl::ALIGATOR_DYNAMIC_TYPEDEFS
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
aligator::RelaxedLogBarrierCostTpl::CostDataAbstract
CostDataAbstractTpl< Scalar > CostDataAbstract
Definition
relaxed-log-barrier.hpp:13
aligator::RelaxedLogBarrierCostTpl::StageFunction
StageFunctionTpl< Scalar > StageFunction
Definition
relaxed-log-barrier.hpp:15
aligator::RelaxedLogBarrierCostTpl::getResidual
const Derived * getResidual() const
Get a pointer to the underlying type of the residual, by attempting to cast.
Definition
relaxed-log-barrier.hpp:53
aligator::RelaxedLogBarrierCostTpl::RelaxedLogBarrierCostTpl
RelaxedLogBarrierCostTpl(xyz::polymorphic< Manifold > space, xyz::polymorphic< StageFunction > function, const Scalar weight, const Scalar threshold)
aligator::StageFunctionTpl
Class representing ternary functions .
Definition
function-abstract.hpp:12
include
aligator
modelling
costs
relaxed-log-barrier.hpp
Generated by
1.17.0