27 #ifndef G2O_OPTMIZATION_ALGORITHM_PROPERTY_H 28 #define G2O_OPTMIZATION_ALGORITHM_PROPERTY_H 30 #include "g2o/config.h" 78 typedef std::list<AbstractOptimizationAlgorithmCreator*>
CreatorList;
84 static void destroy();
102 void listSolvers(std::ostream& os)
const;
113 CreatorList::const_iterator findSolver(
const std::string& name)
const;
114 CreatorList::iterator findSolver(
const std::string& name);
126 #ifdef G2O_DEBUG_OPTIMIZATION_ALGORITHM_FACTORY 127 std::cout << __FUNCTION__ <<
": Registering " << _creator->
property().
name <<
" of type " <<
typeid(*_creator).name() << std::endl;
134 #ifdef G2O_DEBUG_OPTIMIZATION_ALGORITHM_FACTORY 135 std::cout << __FUNCTION__ <<
": Unregistering " << _creator->property().name << std::endl;
145 #if defined _MSC_VER && defined G2O_SHARED_LIBS 146 # define G2O_OAF_EXPORT __declspec(dllexport) 147 # define G2O_OAF_IMPORT __declspec(dllimport) 149 # define G2O_OAF_EXPORT 150 # define G2O_OAF_IMPORT 163 #define G2O_REGISTER_OPTIMIZATION_LIBRARY(libraryname) \ 164 extern "C" void G2O_OAF_EXPORT g2o_optimization_library_##libraryname(void) {} 173 #define G2O_USE_OPTIMIZATION_LIBRARY(libraryname) \ 174 extern "C" void G2O_OAF_IMPORT g2o_optimization_library_##libraryname(void); \ 175 static g2o::ForceLinker g2o_force_optimization_algorithm_library_##libraryname(g2o_optimization_library_##libraryname); 182 #define G2O_REGISTER_OPTIMIZATION_ALGORITHM(optimizername, instance) \ 183 extern "C" void G2O_OAF_EXPORT g2o_optimization_algorithm_##optimizername(void) {} \ 184 static g2o::RegisterOptimizationAlgorithmProxy g_optimization_algorithm_proxy_##optimizername(instance); 191 #define G2O_USE_OPTIMIZATION_ALGORITHM(optimizername) \ 192 extern "C" void G2O_OAF_IMPORT g2o_optimization_algorithm_##optimizername(void); \ 193 static g2o::ForceLinker g2o_force_optimization_algorithm_link_##optimizername(g2o_optimization_algorithm_##optimizername); some general case utility functions
std::string name
name of the solver, e.g., var
describe the properties of a solver
const OptimizationAlgorithmProperty & property() const
return the properties of the solver
~RegisterOptimizationAlgorithmProxy()
static OptimizationAlgorithmFactory * factoryInstance
create solvers based on their short name
virtual ~AbstractOptimizationAlgorithmCreator()
const CreatorList & creatorList() const
return the underlying list of creators
base for allocating an optimization algorithm
RegisterOptimizationAlgorithmProxy(AbstractOptimizationAlgorithmCreator *c)
void registerSolver(AbstractOptimizationAlgorithmCreator *c)
static OptimizationAlgorithmFactory * instance()
return the instance
AbstractOptimizationAlgorithmCreator * _creator
void unregisterSolver(AbstractOptimizationAlgorithmCreator *c)
std::list< AbstractOptimizationAlgorithmCreator * > CreatorList
Generic interface for a non-linear solver operating on a graph.
OptimizationAlgorithmProperty _property