g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
core
optimization_algorithm_dogleg.h
Go to the documentation of this file.
1
// g2o - General Graph Optimization
2
// Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
3
// All rights reserved.
4
//
5
// Redistribution and use in source and binary forms, with or without
6
// modification, are permitted provided that the following conditions are
7
// met:
8
//
9
// * Redistributions of source code must retain the above copyright notice,
10
// this list of conditions and the following disclaimer.
11
// * Redistributions in binary form must reproduce the above copyright
12
// notice, this list of conditions and the following disclaimer in the
13
// documentation and/or other materials provided with the distribution.
14
//
15
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
16
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
#ifndef G2O_OPTIMIZATION_ALGORITHM_DOGLEG_H
28
#define G2O_OPTIMIZATION_ALGORITHM_DOGLEG_H
29
30
#include <memory>
31
32
#include "
g2o_core_api.h
"
33
#include "
optimization_algorithm_with_hessian.h
"
34
35
namespace
g2o
{
36
37
class
BlockSolverBase
;
38
42
class
G2O_CORE_API
OptimizationAlgorithmDogleg
43
:
public
OptimizationAlgorithmWithHessian
{
44
public
:
46
enum
{
STEP_UNDEFINED
,
STEP_SD
,
STEP_GN
,
STEP_DL
};
47
48
public
:
53
explicit
OptimizationAlgorithmDogleg
(std::unique_ptr<BlockSolverBase> solver);
54
virtual
~OptimizationAlgorithmDogleg
();
55
56
virtual
SolverResult solve(
int
iteration,
bool
online =
false
);
57
58
virtual
void
printVerbose(std::ostream& os)
const
;
59
61
int
lastStep
()
const
{
return
_lastStep
; }
63
double
trustRegion
()
const
{
return
_delta
; }
64
66
static
const
char
* stepType2Str(
int
stepType);
67
68
protected
:
69
// parameters
70
Property<int>
*
_maxTrialsAfterFailure
;
71
Property<double>
*
_userDeltaInit
;
72
// damping to enforce positive definite matrix
73
Property<double>
*
_initialLambda
;
74
Property<double>
*
_lamdbaFactor
;
75
76
VectorX
_hsd
;
77
VectorX
_hdl
;
78
VectorX
_auxVector
;
80
81
double
82
_currentLambda
;
83
double
_delta
;
84
int
_lastStep
;
85
bool
_wasPDInAllIterations
;
87
int
_lastNumTries
;
88
89
private
:
90
std::unique_ptr<BlockSolverBase>
m_solver
;
91
};
92
93
}
// namespace g2o
94
95
#endif
g2o::BlockSolverBase
base for the block solvers with some basic function interfaces
Definition
block_solver.h:90
g2o::OptimizationAlgorithmDogleg
Implementation of Powell's Dogleg Algorithm.
Definition
optimization_algorithm_dogleg.h:43
g2o::OptimizationAlgorithmDogleg::lastStep
int lastStep() const
return the type of the last step taken by the algorithm
Definition
optimization_algorithm_dogleg.h:61
g2o::OptimizationAlgorithmDogleg::_hsd
VectorX _hsd
steepest decent step
Definition
optimization_algorithm_dogleg.h:76
g2o::OptimizationAlgorithmDogleg::_delta
double _delta
trust region
Definition
optimization_algorithm_dogleg.h:83
g2o::OptimizationAlgorithmDogleg::_initialLambda
Property< double > * _initialLambda
Definition
optimization_algorithm_dogleg.h:73
g2o::OptimizationAlgorithmDogleg::_lastStep
int _lastStep
type of the step taken by the algorithm
Definition
optimization_algorithm_dogleg.h:84
g2o::OptimizationAlgorithmDogleg::trustRegion
double trustRegion() const
return the diameter of the trust region
Definition
optimization_algorithm_dogleg.h:63
g2o::OptimizationAlgorithmDogleg::_hdl
VectorX _hdl
final dogleg step
Definition
optimization_algorithm_dogleg.h:77
g2o::OptimizationAlgorithmDogleg::_maxTrialsAfterFailure
Property< int > * _maxTrialsAfterFailure
Definition
optimization_algorithm_dogleg.h:70
g2o::OptimizationAlgorithmDogleg::_lamdbaFactor
Property< double > * _lamdbaFactor
Definition
optimization_algorithm_dogleg.h:74
g2o::OptimizationAlgorithmDogleg::STEP_SD
@ STEP_SD
Definition
optimization_algorithm_dogleg.h:46
g2o::OptimizationAlgorithmDogleg::STEP_DL
@ STEP_DL
Definition
optimization_algorithm_dogleg.h:46
g2o::OptimizationAlgorithmDogleg::STEP_GN
@ STEP_GN
Definition
optimization_algorithm_dogleg.h:46
g2o::OptimizationAlgorithmDogleg::STEP_UNDEFINED
@ STEP_UNDEFINED
Definition
optimization_algorithm_dogleg.h:46
g2o::OptimizationAlgorithmDogleg::_auxVector
VectorX _auxVector
Definition
optimization_algorithm_dogleg.h:78
g2o::OptimizationAlgorithmDogleg::_currentLambda
double _currentLambda
the damping factor to force positive definite matrix
Definition
optimization_algorithm_dogleg.h:82
g2o::OptimizationAlgorithmDogleg::m_solver
std::unique_ptr< BlockSolverBase > m_solver
Definition
optimization_algorithm_dogleg.h:90
g2o::OptimizationAlgorithmDogleg::OptimizationAlgorithmDogleg
OptimizationAlgorithmDogleg(std::unique_ptr< BlockSolverBase > solver)
Definition
optimization_algorithm_dogleg.cpp:42
g2o::OptimizationAlgorithmDogleg::_userDeltaInit
Property< double > * _userDeltaInit
Definition
optimization_algorithm_dogleg.h:71
g2o::OptimizationAlgorithmDogleg::_lastNumTries
int _lastNumTries
Definition
optimization_algorithm_dogleg.h:87
g2o::OptimizationAlgorithmDogleg::_wasPDInAllIterations
bool _wasPDInAllIterations
Definition
optimization_algorithm_dogleg.h:85
g2o::OptimizationAlgorithmWithHessian::OptimizationAlgorithmWithHessian
OptimizationAlgorithmWithHessian(Solver &solver)
Definition
optimization_algorithm_with_hessian.cpp:39
g2o::Property
Definition
property.h:52
g2o_core_api.h
G2O_CORE_API
#define G2O_CORE_API
Definition
g2o_core_api.h:29
g2o
Definition
dl_wrapper.cpp:55
g2o::VectorX
VectorN< Eigen::Dynamic > VectorX
Definition
eigen_types.h:55
optimization_algorithm_with_hessian.h
Generated on
for g2o by
1.17.0