Robotics Library  0.7.0
Metric.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2009, Markus Rickert
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 //
8 // * Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright notice,
11 // this list of conditions and the following disclaimer in the documentation
12 // and/or other materials provided with the distribution.
13 //
14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 // POSSIBILITY OF SUCH DAMAGE.
25 //
26 
27 #ifndef RL_PLAN_METRIC_H
28 #define RL_PLAN_METRIC_H
29 
30 #include <rl/math/Real.h>
31 #include <rl/math/Vector.h>
32 
33 namespace rl
34 {
35  namespace plan
36  {
37  class Model;
38 
39  class Metric
40  {
41  public:
43 
44  typedef ::std::size_t Size;
45 
46  struct Value
47  {
49 
50  Value();
51 
53 
55 
56  const ::rl::math::Real* end() const;
57 
58  ::std::size_t size() const;
59 
61 
62  void* second;
63  };
64 
65  Metric(Model* model, const bool& transformed);
66 
67  virtual ~Metric();
68 
69  Distance operator()(const Value& lhs, const Value& rhs) const;
70 
71  Distance operator()(const Distance& lhs, const Distance& rhs, const ::std::size_t& index) const;
72 
73  protected:
74 
75  private:
77 
79  };
80  }
81 }
82 
83 #endif // RL_PLAN_METRIC_H
rl::plan::Metric::Size
::std::size_t Size
Definition: Metric.h:44
rl::plan::Metric::~Metric
virtual ~Metric()
Definition: Metric.cpp:40
rl::plan::Metric::Value
Definition: Metric.h:47
rl::plan::Metric::Value::end
const ::rl::math::Real * end() const
Definition: Metric.cpp:82
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:42
rl::plan::Metric::Value::size
::std::size_t size() const
Definition: Metric.cpp:88
Vector.h
rl::plan::Metric::transformed
bool transformed
Definition: Metric.h:78
rl::plan::Model
Definition: Model.h:42
rl::plan::Metric::Value::first
const ::rl::math::Vector * first
Definition: Metric.h:60
rl::plan::Metric::Value::Value
Value()
Definition: Metric.cpp:63
rl::plan::Metric::operator()
Distance operator()(const Value &lhs, const Value &rhs) const
Definition: Metric.cpp:45
rl::plan::Metric::model
Model * model
Definition: Metric.h:76
rl::plan::Metric::Value::const_iterator
typedefconst ::rl::math::Real * const_iterator
Definition: Metric.h:48
rl::plan::Metric
Definition: Metric.h:40
rl::plan::Metric::Value::begin
const ::rl::math::Real * begin() const
Definition: Metric.cpp:76
rl::plan::Metric::Value::second
void * second
Definition: Metric.h:62
Real.h
rl::math::Real
double Real
Definition: Real.h:42
rl::plan::Metric::Metric
Metric(Model *model, const bool &transformed)
Definition: Metric.cpp:34
rl::plan::Metric::Distance
::rl::math::Real Distance
Definition: Metric.h:42
rl
Robotics Library.
Definition: AnalogInput.cpp:30