00001 // This is gel/pop/pop_geometric_cost_function.cxx 00002 #include "pop_geometric_cost_function.h" 00003 //: 00004 // \file 00005 #include<vcl_iostream.h> 00006 00007 //: constructor 00008 pop_geometric_cost_function::pop_geometric_cost_function(pop_geometric_object *observable, 00009 pop_geometric_object *observation) 00010 { 00011 observable_ = observable; 00012 observation_ = observation; 00013 } 00014 00015 //: destructor 00016 pop_geometric_cost_function::~pop_geometric_cost_function() 00017 { 00018 } 00019 00020 //: this is the cost between two objects 00021 00022 double pop_geometric_cost_function::cost() 00023 { 00024 // we assume that there is a path from the observable to the observation 00025 pop_geometric_object *expected_obj = observable_->transform(observation_->coordinate_system_); 00026 00027 if (expected_obj) { 00028 double co = observation_->cost(expected_obj); 00029 delete expected_obj; 00030 return co; 00031 } 00032 else { 00033 vcl_cout << "Warning: there is no mapping from the observable to the observation\n"; 00034 return 0; 00035 } 00036 } 00037
1.5.1