27 #ifndef SRC_EDIT_COSTS_CONSTANT_IPP_ 28 #define SRC_EDIT_COSTS_CONSTANT_IPP_ 32 template<
class UserNodeLabel,
class UserEdgeLabel>
33 Constant<UserNodeLabel, UserEdgeLabel>::
36 template<
class UserNodeLabel,
class UserEdgeLabel>
38 Constant(
double node_ins_cost,
double node_del_cost,
double node_rel_cost,
double edge_ins_cost,
double edge_del_cost,
double edge_rel_cost) :
39 node_ins_cost_{node_ins_cost},
40 node_del_cost_{node_del_cost},
41 node_rel_cost_{node_rel_cost},
42 edge_ins_cost_{edge_ins_cost},
43 edge_del_cost_{edge_del_cost},
44 edge_rel_cost_{edge_rel_cost} {}
46 template<
class UserNodeLabel,
class UserEdgeLabel>
50 return node_ins_cost_;
53 template<
class UserNodeLabel,
class UserEdgeLabel>
57 return node_del_cost_;
60 template<
class UserNodeLabel,
class UserEdgeLabel>
63 node_rel_cost_fun(
const UserNodeLabel & node_label_1,
const UserNodeLabel & node_label_2)
const {
64 if (node_label_1 != node_label_2) {
65 return node_rel_cost_;
70 template<
class UserNodeLabel,
class UserEdgeLabel>
74 return edge_ins_cost_;
77 template<
class UserNodeLabel,
class UserEdgeLabel>
81 return edge_del_cost_;
84 template<
class UserNodeLabel,
class UserEdgeLabel>
87 edge_rel_cost_fun(
const UserEdgeLabel & edge_label_1,
const UserEdgeLabel & edge_label_2)
const {
88 if (edge_label_1 != edge_label_2) {
89 return edge_rel_cost_;
virtual double node_del_cost_fun(const UserNodeLabel &node_label) const final
Node deletion cost function.
virtual double node_rel_cost_fun(const UserNodeLabel &node_label_1, const UserNodeLabel &node_label_2) const final
Node relabeling cost function.
virtual double edge_rel_cost_fun(const UserEdgeLabel &edge_label_1, const UserEdgeLabel &edge_label_2) const final
Edge relabeling cost function.
virtual double edge_ins_cost_fun(const UserEdgeLabel &edge_label) const final
Edge insertion cost function.
Global namespace for GEDLIB.
virtual double node_ins_cost_fun(const UserNodeLabel &node_label) const final
Node insertions cost function.
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.
virtual double edge_del_cost_fun(const UserEdgeLabel &edge_label) const final
Edge deletion cost function.