GEDLIB  1.0
edit_costs.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_EDIT_COSTS_HPP_
28 #define SRC_EDIT_COSTS_EDIT_COSTS_HPP_
29 
30 #include "../env/common_types.hpp"
31 
32 namespace ged {
33 
37 template<class UserNodeLabel, class UserEdgeLabel>
38 class EditCosts {
39 
40 public:
41 
46  virtual ~EditCosts() = 0;
47 
51  EditCosts();
52 
59  virtual double node_ins_cost_fun(const UserNodeLabel & node_label) const;
60 
67  virtual double node_del_cost_fun(const UserNodeLabel & node_label) const;
68 
76  virtual double node_rel_cost_fun(const UserNodeLabel & node_label_1, const UserNodeLabel & node_label_2) const;
77 
84  virtual void vectorize_node_label(const UserNodeLabel & node_label, std::vector<double> & vector_representation) const;
85 
92  virtual double edge_ins_cost_fun(const UserEdgeLabel & edge_label) const;
93 
100  virtual double edge_del_cost_fun(const UserEdgeLabel & edge_label) const;
101 
109  virtual double edge_rel_cost_fun(const UserEdgeLabel & edge_label_1, const UserEdgeLabel & edge_label_2) const;
110 
117  virtual void vectorize_edge_label(const UserEdgeLabel & edge_label, std::vector<double> & vector_representation) const;
118 };
119 
120 }
121 
122 #include "edit_costs.ipp"
123 
124 #endif /* SRC_EDIT_COSTS_EDIT_COSTS_HPP_ */
virtual void vectorize_node_label(const UserNodeLabel &node_label, std::vector< double > &vector_representation) const
Computes a node label&#39;s representation as a real-valued vector.
Definition: edit_costs.ipp:64
virtual double edge_del_cost_fun(const UserEdgeLabel &edge_label) const
Edge deletion cost function.
Definition: edit_costs.ipp:78
EditCosts()
Constructor.
Definition: edit_costs.ipp:38
virtual double edge_rel_cost_fun(const UserEdgeLabel &edge_label_1, const UserEdgeLabel &edge_label_2) const
Edge relabeling cost function.
Definition: edit_costs.ipp:71
virtual ~EditCosts()=0
Virtual destructor.
Definition: edit_costs.ipp:34
virtual double node_ins_cost_fun(const UserNodeLabel &node_label) const
Node insertions cost function.
Definition: edit_costs.ipp:50
virtual void vectorize_edge_label(const UserEdgeLabel &edge_label, std::vector< double > &vector_representation) const
Computes an edge label&#39;s representation as a real-valued vector.
Definition: edit_costs.ipp:92
virtual double node_del_cost_fun(const UserNodeLabel &node_label) const
Node deletion cost function.
Definition: edit_costs.ipp:43
Global namespace for GEDLIB.
virtual double node_rel_cost_fun(const UserNodeLabel &node_label_1, const UserNodeLabel &node_label_2) const
Node relabeling cost function.
Definition: edit_costs.ipp:57
Abstract class for defining edit cost functions.
Definition: edit_costs.hpp:38
virtual double edge_ins_cost_fun(const UserEdgeLabel &edge_label) const
Edge insertion cost function.
Definition: edit_costs.ipp:85
ged::EditCosts class definition.