GEDLIB  1.0
protein.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_PROTEIN_HPP_
28 #define SRC_EDIT_COSTS_PROTEIN_HPP_
29 
30 #include "edit_costs.hpp"
31 #include "../util/lsape_solver.hpp"
32 
33 namespace ged {
34 
53 template<class UserNodeLabel, class UserEdgeLabel>
54 class Protein : public EditCosts<UserNodeLabel, UserEdgeLabel> {
55 public:
56 
57  virtual ~Protein();
58 
66  Protein(double node_ins_del_cost = 11, double edge_ins_del_cost = 1, double alpha = 0.75);
67 
68  virtual double node_ins_cost_fun(const UserNodeLabel & node_label) const final;
69 
70  virtual double node_del_cost_fun(const UserNodeLabel & node_label) const final;
71 
72  virtual double node_rel_cost_fun(const UserNodeLabel & node_label_1, const UserNodeLabel & node_label_2) const final;
73 
74  virtual double edge_ins_cost_fun(const UserEdgeLabel & edge_label) const final;
75 
76  virtual double edge_del_cost_fun(const UserEdgeLabel & edge_label) const final;
77 
78  virtual double edge_rel_cost_fun(const UserEdgeLabel & edge_label_1, const UserEdgeLabel & edge_label_2) const final;
79 
80 private:
81 
82  double levenshtein_distance_(const std::string & string_1, const std::string & string_2) const;
83 
84  double node_ins_del_cost_;
85 
86  double edge_ins_del_cost_;
87 
88  double alpha_;
89 };
90 
91 }
92 
93 #include "protein.ipp"
94 
95 #endif /* SRC_EDIT_COSTS_PROTEIN_HPP_ */
ged::EditCosts class declaration.
virtual double edge_ins_cost_fun(const UserEdgeLabel &edge_label) const final
Edge insertion cost function.
virtual double node_rel_cost_fun(const UserNodeLabel &node_label_1, const UserNodeLabel &node_label_2) const final
Node relabeling cost function.
ged::Protein class definition.
virtual double node_ins_cost_fun(const UserNodeLabel &node_label) const final
Node insertions cost function.
virtual double node_del_cost_fun(const UserNodeLabel &node_label) const final
Node deletion cost function.
Global namespace for GEDLIB.
virtual double edge_del_cost_fun(const UserEdgeLabel &edge_label) const final
Edge deletion cost function.
Protein(double node_ins_del_cost=11, double edge_ins_del_cost=1, double alpha=0.75)
Constructor.
virtual double edge_rel_cost_fun(const UserEdgeLabel &edge_label_1, const UserEdgeLabel &edge_label_2) const final
Edge relabeling cost function.
Abstract class for defining edit cost functions.
Definition: edit_costs.hpp:38
Edit costs for graphs contained in Protein dataset.
Definition: protein.hpp:54