aug_lagrangian_function.hpp
Go to the documentation of this file.00001
00022 #ifndef __MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
00023 #define __MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP
00024
00025 #include <mlpack/core.hpp>
00026
00027 namespace mlpack {
00028 namespace optimization {
00029
00047 template<typename LagrangianFunction>
00048 class AugLagrangianFunction
00049 {
00050 public:
00058 AugLagrangianFunction(LagrangianFunction& function);
00059
00068 AugLagrangianFunction(LagrangianFunction& function,
00069 const arma::vec& lambda,
00070 const double sigma);
00079 double Evaluate(const arma::mat& coordinates) const;
00080
00087 void Gradient(const arma::mat& coordinates, arma::mat& gradient) const;
00088
00095 const arma::mat& GetInitialPoint() const;
00096
00098 const arma::vec& Lambda() const { return lambda; }
00100 arma::vec& Lambda() { return lambda; }
00101
00103 double Sigma() const { return sigma; }
00105 double& Sigma() { return sigma; }
00106
00108 const LagrangianFunction& Function() const { return function; }
00110 LagrangianFunction& Function() { return function; }
00111
00112 private:
00114 LagrangianFunction& function;
00115
00117 arma::vec lambda;
00119 double sigma;
00120 };
00121
00122 };
00123 };
00124
00125
00126 #include "aug_lagrangian_function_impl.hpp"
00127
00128 #endif // __MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_FUNCTION_HPP