LocalGuidance
A library that generates velocity references to follow a path.
robot_utils::optimization::OptimizationNelderMead Class Reference

#include <OptimizationNelderMead.hpp>

Public Member Functions

 OptimizationNelderMead ()
 
virtual ~OptimizationNelderMead ()
 
bool optimize (double &fOpt, Eigen::VectorXd &xOpt, const Eigen::VectorXd &x0, const Fcn &fcn, bool minimize=true, long int maxIterations=-1, double maxFValueDiff=1e-4, double maxVertexDiff=1e-4)
 

Private Types

using Fcn = std::function< double(const Eigen::VectorXd &)>
 

Private Member Functions

int getIterations ()
 
void setupSimplex ()
 
double evalFcn (const Eigen::VectorXd &x)
 
void runMinimizationStep ()
 
bool terminateOptimization ()
 
void sortSimplex ()
 
void shrinkSimplex ()
 
void printSimplex () const
 

Static Private Member Functions

template<typename T >
static std::vector< int > getSortedIndexes (const std::vector< T > &v)
 

Private Attributes

const double rho_ = 1.0
 
const double chi_ = 2.0
 
const double psi_ = 0.5
 
const double sigma_ = 0.5
 
long int numCoordinates_ = 0
 
long int numVertices_ = 0
 
long int s_ = 0
 
long int h_ = 0
 
Eigen::MatrixXd simplex_
 
std::vector< double > fValues_
 
unsigned int currentIteration_ = 0
 
Eigen::VectorXd x0_
 
Fcn fcn_
 
bool minimize_ = true
 
unsigned int maxIterations_ = 0
 
double maxFValueDiff_ = 0.0
 
double maxVertexDiff_ = 0.0
 

Member Typedef Documentation

using robot_utils::optimization::OptimizationNelderMead::Fcn = std::function<double(const Eigen::VectorXd&)>
private

Constructor & Destructor Documentation

robot_utils::optimization::OptimizationNelderMead::OptimizationNelderMead ( )
inline
virtual robot_utils::optimization::OptimizationNelderMead::~OptimizationNelderMead ( )
inlinevirtual

Member Function Documentation

double robot_utils::optimization::OptimizationNelderMead::evalFcn ( const Eigen::VectorXd &  x)
inlineprivate
int robot_utils::optimization::OptimizationNelderMead::getIterations ( )
inlineprivate
template<typename T >
static std::vector<int> robot_utils::optimization::OptimizationNelderMead::getSortedIndexes ( const std::vector< T > &  v)
inlinestaticprivate
bool robot_utils::optimization::OptimizationNelderMead::optimize ( double &  fOpt,
Eigen::VectorXd &  xOpt,
const Eigen::VectorXd &  x0,
const Fcn fcn,
bool  minimize = true,
long int  maxIterations = -1,
double  maxFValueDiff = 1e-4,
double  maxVertexDiff = 1e-4 
)
inline
void robot_utils::optimization::OptimizationNelderMead::printSimplex ( ) const
inlineprivate
void robot_utils::optimization::OptimizationNelderMead::runMinimizationStep ( )
inlineprivate
void robot_utils::optimization::OptimizationNelderMead::setupSimplex ( )
inlineprivate
void robot_utils::optimization::OptimizationNelderMead::shrinkSimplex ( )
inlineprivate
void robot_utils::optimization::OptimizationNelderMead::sortSimplex ( )
inlineprivate
bool robot_utils::optimization::OptimizationNelderMead::terminateOptimization ( )
inlineprivate

Member Data Documentation

const double robot_utils::optimization::OptimizationNelderMead::chi_ = 2.0
private
unsigned int robot_utils::optimization::OptimizationNelderMead::currentIteration_ = 0
private
Fcn robot_utils::optimization::OptimizationNelderMead::fcn_
private
std::vector<double> robot_utils::optimization::OptimizationNelderMead::fValues_
private
long int robot_utils::optimization::OptimizationNelderMead::h_ = 0
private
double robot_utils::optimization::OptimizationNelderMead::maxFValueDiff_ = 0.0
private
unsigned int robot_utils::optimization::OptimizationNelderMead::maxIterations_ = 0
private
double robot_utils::optimization::OptimizationNelderMead::maxVertexDiff_ = 0.0
private
bool robot_utils::optimization::OptimizationNelderMead::minimize_ = true
private
long int robot_utils::optimization::OptimizationNelderMead::numCoordinates_ = 0
private
long int robot_utils::optimization::OptimizationNelderMead::numVertices_ = 0
private
const double robot_utils::optimization::OptimizationNelderMead::psi_ = 0.5
private
const double robot_utils::optimization::OptimizationNelderMead::rho_ = 1.0
private
long int robot_utils::optimization::OptimizationNelderMead::s_ = 0
private
const double robot_utils::optimization::OptimizationNelderMead::sigma_ = 0.5
private
Eigen::MatrixXd robot_utils::optimization::OptimizationNelderMead::simplex_
private
Eigen::VectorXd robot_utils::optimization::OptimizationNelderMead::x0_
private

The documentation for this class was generated from the following file: