GEDLIB  1.0
constant.hpp
Go to the documentation of this file.
1 /***************************************************************************
2 * *
3 * Copyright (C) 2018 by David B. Blumenthal *
4 * *
5 * This file is part of GEDLIB. *
6 * *
7 * GEDLIB is free software: you can redistribute it and/or modify it *
8 * under the terms of the GNU Lesser General Public License as published *
9 * by the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * GEDLIB is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU Lesser General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License along with GEDLIB. If not, see <http://www.gnu.org/licenses/>. *
19 * *
20 ***************************************************************************/
21 
27 #ifndef SRC_EDIT_COSTS_CONSTANT_HPP_
28 #define SRC_EDIT_COSTS_CONSTANT_HPP_
29 
30 #include "edit_costs.hpp"
31 
32 namespace ged {
33 
37 template<class UserNodeLabel, class UserEdgeLabel>
38 class Constant : public EditCosts<UserNodeLabel, UserEdgeLabel> {
39 
40 public:
41 
42  virtual ~Constant();
43 
54  Constant(double node_ins_cost = 1, double node_del_cost = 1, double node_rel_cost = 1, double edge_ins_cost = 1, double edge_del_cost = 1, double edge_rel_cost = 1);
55 
56  virtual double node_ins_cost_fun(const UserNodeLabel & node_label) const final;
57 
58  virtual double node_del_cost_fun(const UserNodeLabel & node_label) const final;
59 
60  virtual double node_rel_cost_fun(const UserNodeLabel & node_label_1, const UserNodeLabel & node_label_2) const final;
61 
62  virtual double edge_ins_cost_fun(const UserEdgeLabel & edge_label) const final;
63 
64  virtual double edge_del_cost_fun(const UserEdgeLabel & edge_label) const final;
65 
66  virtual double edge_rel_cost_fun(const UserEdgeLabel & edge_label_1, const UserEdgeLabel & edge_label_2) const final;
67 
68 private:
69 
70  double node_ins_cost_;
71 
72  double node_del_cost_;
73 
74  double node_rel_cost_;
75 
76  double edge_ins_cost_;
77 
78  double edge_del_cost_;
79 
80  double edge_rel_cost_;
81 };
82 
83 }
84 
85 #include "constant.ipp"
86 
87 #endif /* SRC_EDIT_COSTS_CONSTANT_HPP_ */
ged::EditCosts class declaration.
virtual double node_del_cost_fun(const UserNodeLabel &node_label) const final
Node deletion cost function.
Definition: constant.ipp:56
ged::Constant class definition.
virtual double node_rel_cost_fun(const UserNodeLabel &node_label_1, const UserNodeLabel &node_label_2) const final
Node relabeling cost function.
Definition: constant.ipp:63
virtual double edge_rel_cost_fun(const UserEdgeLabel &edge_label_1, const UserEdgeLabel &edge_label_2) const final
Edge relabeling cost function.
Definition: constant.ipp:87
virtual double edge_ins_cost_fun(const UserEdgeLabel &edge_label) const final
Edge insertion cost function.
Definition: constant.ipp:73
Global namespace for GEDLIB.
virtual double node_ins_cost_fun(const UserNodeLabel &node_label) const final
Node insertions cost function.
Definition: constant.ipp:49
Constant(double node_ins_cost=1, double node_del_cost=1, double node_rel_cost=1, double edge_ins_cost=1, double edge_del_cost=1, double edge_rel_cost=1)
Constructor.
Definition: constant.ipp:38
Implements constant edit cost functions.
Definition: constant.hpp:38
Abstract class for defining edit cost functions.
Definition: edit_costs.hpp:38
virtual double edge_del_cost_fun(const UserEdgeLabel &edge_label) const final
Edge deletion cost function.
Definition: constant.ipp:80