bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
lp_metric.h
Go to the documentation of this file.
1#ifndef LP_METRIC_H
2#define LP_METRIC_H
3
5#include <vector>
6
7namespace bitrl
8{
9namespace maths
10{
11
14
15template <int P, bool TTakeRoot = true> class LpMetric
16{
17
18 public:
19 static const int Power = P;
20 static const bool TakeRoot = TTakeRoot;
24
28 static real_t tolerance() { return tolerance_value; }
29
34 LpMetric() = default;
35
39 real_t operator()(const DynVec<real_t> &v1, const DynVec<real_t> &v2) const;
40
44 static real_t evaluate(const DynVec<real_t> &v1, const DynVec<real_t> &v2);
45
49 static real_t evaluate(const std::vector<real_t> &v1, const std::vector<real_t> &v2);
50};
51
56
57} // namespace maths
58} // namespace bitrl
59
61
62#endif // LP_METRIC_H
The LpMetric class It conforms to the metric policy.
Definition lp_metric.h:16
static const int Power
Definition lp_metric.h:19
static real_t evaluate(const std::vector< real_t > &v1, const std::vector< real_t > &v2)
evaluate
Definition lp_metric_impl.h:46
static real_t tolerance_value
Definition lp_metric.h:21
real_t operator()(const DynVec< real_t > &v1, const DynVec< real_t > &v2) const
Overload operator().
Definition lp_metric_impl.h:55
static real_t tolerance()
Tolerance used by the class.
Definition lp_metric.h:28
static real_t evaluate(const DynVec< real_t > &v1, const DynVec< real_t > &v2)
evaluate
Definition lp_metric_impl.h:16
LpMetric()=default
Default constructor. It is required to satisfy the metric policy.
real_t cost_type
Definition lp_metric.h:22
real_t value_type
Definition lp_metric.h:23
static const bool TakeRoot
Definition lp_metric.h:20
Definition lp_metric.h:10
LpMetric< 2, true > EuclideanMetric
Definition lp_metric.h:55
LpMetric< 1, false > ManhattanMetric
some useful shortcuts
Definition lp_metric.h:53
LpMetric< 2, false > SqrEuclidean_metric
Definition lp_metric.h:54
Various utilities used when working with RL problems.
Definition bitrl_log.h:25
double real_t
real_t
Definition bitsim_types.h:20
Eigen::RowVectorX< T > DynVec
Dynamically sized row vector.
Definition bitsim_types.h:101