contrib/gel/pop/pop_graph_cost_function.h

Go to the documentation of this file.
00001 // This is gel/pop/pop_graph_cost_function.h
00002 #ifndef pop_graph_cost_function_h_
00003 #define pop_graph_cost_function_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief this is a vertex/coordinate system in a coordinate system graph
00010 //
00011 // \author
00012 //            Peter Tu April 2003
00013 //            General Electric
00014 //
00015 //-------------------------------------------------------------------------------
00016 #include <vnl/vnl_least_squares_function.h>
00017 #include <vcl_vector.h>
00018 #include <pop/pop_parameter.h>
00019 #include <pop/pop_geometric_cost_function.h>
00020 #include <pop/pop_manager.h>
00021 
00022 //: A parameter that can be optimized
00023 class pop_graph_cost_function : public vnl_least_squares_function
00024 {
00025  public:
00026   //: constructor
00027   //  We send in the parameters that can change,
00028   //  the residuals that would be evaluated and the pop manager
00029   //  that is responsible for updating the graph based on the
00030   //  current parameter values.
00031   pop_graph_cost_function(vcl_vector<pop_parameter*> &params,
00032                           vcl_vector<pop_geometric_cost_function*> &cfs,
00033                           pop_manager *manager);
00034 
00035   //: destructor
00036   ~pop_graph_cost_function();
00037 
00038   //: the method for evaluating the cost of the parameter values (x) and getting the residuals (fx)
00039   virtual void f(vnl_vector<double> const &x, vnl_vector<double> &fx);
00040 
00041   //: get the current parameter values
00042   vnl_vector<double> get_parameter_values();
00043 
00044   //: get the current costs
00045   vnl_vector<double> get_current_costs();
00046 
00047  private:
00048   vcl_vector<pop_parameter*> params_;
00049   vcl_vector<pop_geometric_cost_function*> cfs_;
00050   pop_manager *manager_;
00051 };
00052 
00053 #endif // pop_graph_cost_function_h_

Generated on Thu Aug 28 05:14:56 2008 for contrib/gel/pop by  doxygen 1.5.1