SG++-Doxygen-Documentation
sgpp::optimization::optimizer::SquaredPenalty Class Reference

Squared Penalty method for constrained optimization. More...

#include <SquaredPenalty.hpp>

Inheritance diagram for sgpp::optimization::optimizer::SquaredPenalty:
sgpp::optimization::optimizer::ConstrainedOptimizer sgpp::optimization::optimizer::UnconstrainedOptimizer

Public Member Functions

void clone (std::unique_ptr< UnconstrainedOptimizer > &clone) const override
 
double getConstraintTolerance () const
 
VectorFunctionGradientgetEqualityConstraintGradient () const
 
const std::vector< size_t > & getHistoryOfInnerIterationNumbers () const
 
const base::DataMatrixgetHistoryOfInnerIterationPoints () const
 
VectorFunctionGradientgetInequalityConstraintGradient () const
 
ScalarFunctionGradientgetObjectiveGradient () const
 
double getPenaltyIncreaseFactor () const
 
double getPenaltyStartValue () const
 
double getXTolerance () const
 
void optimize () override
 Pure virtual method for optimization of the objective function. More...
 
void setConstraintTolerance (double constraintTolerance)
 
void setPenaltyIncreaseFactor (double penaltyIncreaseFactor)
 
void setPenaltyStartValue (double penaltyStartValue)
 
void setXTolerance (double xTolerance)
 
 SquaredPenalty (const ScalarFunction &f, const ScalarFunctionGradient &fGradient, const VectorFunction &g, const VectorFunctionGradient &gGradient, const VectorFunction &h, const VectorFunctionGradient &hGradient, size_t maxItCount=DEFAULT_N, double xTolerance=DEFAULT_X_TOLERANCE, double constraintTolerance=DEFAULT_CONSTRAINT_TOLERANCE, double penaltyStartValue=DEFAULT_PENALTY_START_VALUE, double penaltyIncreaseFactor=DEFAULT_PENALTY_INCREASE_FACTOR)
 Constructor. More...
 
 SquaredPenalty (const SquaredPenalty &other)
 Copy constructor. More...
 
 ~SquaredPenalty () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::optimization::optimizer::ConstrainedOptimizer
 ConstrainedOptimizer (const ScalarFunction &f, const VectorFunction &g, const VectorFunction &h, size_t N=DEFAULT_N)
 Constructor. More...
 
 ConstrainedOptimizer (const ConstrainedOptimizer &other)
 Copy constructor. More...
 
VectorFunctiongetEqualityConstraintFunction () const
 
VectorFunctiongetInequalityConstraintFunction () const
 
 ~ConstrainedOptimizer () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::optimization::optimizer::UnconstrainedOptimizer
const base::DataMatrixgetHistoryOfOptimalPoints () const
 
const base::DataVectorgetHistoryOfOptimalValues () const
 
size_t getN () const
 
ScalarFunctiongetObjectiveFunction () const
 
const base::DataVectorgetOptimalPoint () const
 
double getOptimalValue () const
 
const base::DataVectorgetStartingPoint () const
 
void setN (size_t N)
 
void setStartingPoint (const base::DataVector &startingPoint)
 
 UnconstrainedOptimizer (const ScalarFunction &f, size_t N=DEFAULT_N)
 Constructor. More...
 
 UnconstrainedOptimizer (const UnconstrainedOptimizer &other)
 Copy constructor. More...
 
virtual ~UnconstrainedOptimizer ()
 Destructor. More...
 

Static Public Attributes

static constexpr double DEFAULT_CONSTRAINT_TOLERANCE = 1e-6
 default constraint tolerance More...
 
static constexpr double DEFAULT_PENALTY_INCREASE_FACTOR = 10.0
 default penalty increase factor More...
 
static constexpr double DEFAULT_PENALTY_START_VALUE = 1.0
 default penalty start value More...
 
static constexpr double DEFAULT_X_TOLERANCE = 1e-6
 default point tolerance More...
 
- Static Public Attributes inherited from sgpp::optimization::optimizer::UnconstrainedOptimizer
static const size_t DEFAULT_N = 1000
 default maximal number of iterations or function evaluations More...
 

Protected Attributes

double epsilon
 constraint tolerance More...
 
std::unique_ptr< ScalarFunctionGradientfGradient
 objective function gradient More...
 
std::unique_ptr< VectorFunctionGradientgGradient
 inequality constraint function gradient More...
 
std::unique_ptr< VectorFunctionGradienthGradient
 equality constraint function gradient More...
 
std::vector< size_t > kHistInner
 search history (number of inner iterations) More...
 
double mu0
 penalty start value More...
 
double rhoMuPlus
 penalty increase factor More...
 
double theta
 point tolerance More...
 
base::DataMatrix xHistInner
 search history (inner iterations) More...
 
- Protected Attributes inherited from sgpp::optimization::optimizer::ConstrainedOptimizer
std::unique_ptr< VectorFunctiong
 inequality constraint function More...
 
std::unique_ptr< VectorFunctionh
 equality constraint function More...
 
- Protected Attributes inherited from sgpp::optimization::optimizer::UnconstrainedOptimizer
std::unique_ptr< ScalarFunctionf
 objective function More...
 
base::DataVector fHist
 search history vector (optimal values) More...
 
double fOpt
 result of optimization (optimal function value) More...
 
size_t N
 maximal number of iterations or function evaluations More...
 
base::DataVector x0
 starting point More...
 
base::DataMatrix xHist
 search history matrix (optimal points) More...
 
base::DataVector xOpt
 result of optimization (location of optimum) More...
 

Detailed Description

Squared Penalty method for constrained optimization.

Constructor & Destructor Documentation

◆ SquaredPenalty() [1/2]

sgpp::optimization::optimizer::SquaredPenalty::SquaredPenalty ( const ScalarFunction f,
const ScalarFunctionGradient fGradient,
const VectorFunction g,
const VectorFunctionGradient gGradient,
const VectorFunction h,
const VectorFunctionGradient hGradient,
size_t  maxItCount = DEFAULT_N,
double  xTolerance = DEFAULT_X_TOLERANCE,
double  constraintTolerance = DEFAULT_CONSTRAINT_TOLERANCE,
double  penaltyStartValue = DEFAULT_PENALTY_START_VALUE,
double  penaltyIncreaseFactor = DEFAULT_PENALTY_INCREASE_FACTOR 
)

Constructor.

Parameters
fobjective function
fGradientobjective function gradient
ginequality constraint
gGradientinequality constraint gradient
hequality constraint
hGradientequality constraint gradient
maxItCountmaximal number of function evaluations
xTolerancepoint tolerance
constraintToleranceconstraint tolerance
penaltyStartValuepenalty start value
penaltyIncreaseFactorpenalty increase factor

References sgpp::optimization::ScalarFunctionGradient::clone(), and sgpp::optimization::VectorFunctionGradient::clone().

Referenced by clone().

◆ SquaredPenalty() [2/2]

sgpp::optimization::optimizer::SquaredPenalty::SquaredPenalty ( const SquaredPenalty other)

Copy constructor.

Parameters
otheroptimizer to be copied

References fGradient, gGradient, and hGradient.

◆ ~SquaredPenalty()

sgpp::optimization::optimizer::SquaredPenalty::~SquaredPenalty ( )
override

Destructor.

Member Function Documentation

◆ clone()

void sgpp::optimization::optimizer::SquaredPenalty::clone ( std::unique_ptr< UnconstrainedOptimizer > &  clone) const
overridevirtual
Parameters
[out]clonepointer to cloned object

Implements sgpp::optimization::optimizer::UnconstrainedOptimizer.

References SquaredPenalty().

◆ getConstraintTolerance()

double sgpp::optimization::optimizer::SquaredPenalty::getConstraintTolerance ( ) const
Returns
constraint tolerance

References epsilon.

◆ getEqualityConstraintGradient()

VectorFunctionGradient & sgpp::optimization::optimizer::SquaredPenalty::getEqualityConstraintGradient ( ) const
Returns
equality constraint function gradient

References hGradient.

◆ getHistoryOfInnerIterationNumbers()

const std::vector< size_t > & sgpp::optimization::optimizer::SquaredPenalty::getHistoryOfInnerIterationNumbers ( ) const
Returns
vector in which the k-th entry indicates the number of inner iterations in the k-th (outer) iteration, empty vector on error

References kHistInner.

◆ getHistoryOfInnerIterationPoints()

const base::DataMatrix & sgpp::optimization::optimizer::SquaredPenalty::getHistoryOfInnerIterationPoints ( ) const
Returns
tall matrix (d columns) in which the history of optimal points of the iterations are concatenated

References xHistInner.

◆ getInequalityConstraintGradient()

VectorFunctionGradient & sgpp::optimization::optimizer::SquaredPenalty::getInequalityConstraintGradient ( ) const
Returns
inequality constraint function gradient

References gGradient.

◆ getObjectiveGradient()

ScalarFunctionGradient & sgpp::optimization::optimizer::SquaredPenalty::getObjectiveGradient ( ) const
Returns
objective function gradient

References fGradient.

◆ getPenaltyIncreaseFactor()

double sgpp::optimization::optimizer::SquaredPenalty::getPenaltyIncreaseFactor ( ) const
Returns
penalty increase factor

References rhoMuPlus.

◆ getPenaltyStartValue()

double sgpp::optimization::optimizer::SquaredPenalty::getPenaltyStartValue ( ) const
Returns
penalty start value

References mu0.

◆ getXTolerance()

double sgpp::optimization::optimizer::SquaredPenalty::getXTolerance ( ) const
Returns
point tolerance

References theta.

◆ optimize()

void sgpp::optimization::optimizer::SquaredPenalty::optimize ( )
overridevirtual

Pure virtual method for optimization of the objective function.

The result of the optimization process can be obtained by member functions, e.g., getOptimalPoint() and getOptimalValue().

Implements sgpp::optimization::optimizer::UnconstrainedOptimizer.

References sgpp::base::DataVector::append(), sgpp::base::DataMatrix::appendRow(), epsilon, sgpp::optimization::optimizer::UnconstrainedOptimizer::f, fGradient, sgpp::optimization::optimizer::UnconstrainedOptimizer::fHist, sgpp::optimization::optimizer::UnconstrainedOptimizer::fOpt, sgpp::optimization::optimizer::ConstrainedOptimizer::g, sgpp::optimization::optimizer::UnconstrainedOptimizer::getHistoryOfOptimalPoints(), sgpp::optimization::Printer::getInstance(), sgpp::base::DataMatrix::getNrows(), sgpp::optimization::optimizer::UnconstrainedOptimizer::getOptimalPoint(), gGradient, sgpp::optimization::optimizer::ConstrainedOptimizer::h, hGradient, python.statsfileInfo::i, kHistInner, sgpp::base::DataVector::l2Norm(), sgpp::base::DataVector::max(), sgpp::base::DataVector::maxNorm(), mG, mH, mu, mu0, sgpp::optimization::optimizer::UnconstrainedOptimizer::N, sgpp::optimization::optimizer::AdaptiveGradientDescent::optimize(), sgpp::optimization::Printer::printStatusBegin(), sgpp::optimization::Printer::printStatusEnd(), sgpp::optimization::Printer::printStatusUpdate(), sgpp::base::DataMatrix::resize(), rhoMuPlus, sgpp::optimization::optimizer::UnconstrainedOptimizer::setStartingPoint(), sgpp::base::DataVector::sub(), theta, sgpp::base::DataVector::toString(), sgpp::optimization::optimizer::UnconstrainedOptimizer::x0, sgpp::optimization::optimizer::UnconstrainedOptimizer::xHist, xHistInner, and sgpp::optimization::optimizer::UnconstrainedOptimizer::xOpt.

◆ setConstraintTolerance()

void sgpp::optimization::optimizer::SquaredPenalty::setConstraintTolerance ( double  constraintTolerance)
Parameters
constraintToleranceconstraint tolerance

References epsilon.

◆ setPenaltyIncreaseFactor()

void sgpp::optimization::optimizer::SquaredPenalty::setPenaltyIncreaseFactor ( double  penaltyIncreaseFactor)
Parameters
penaltyIncreaseFactorpenalty increase factor

References rhoMuPlus.

◆ setPenaltyStartValue()

void sgpp::optimization::optimizer::SquaredPenalty::setPenaltyStartValue ( double  penaltyStartValue)
Parameters
penaltyStartValuepenalty start value

References mu0.

◆ setXTolerance()

void sgpp::optimization::optimizer::SquaredPenalty::setXTolerance ( double  xTolerance)
Parameters
xTolerancepoint tolerance

References theta.

Member Data Documentation

◆ DEFAULT_CONSTRAINT_TOLERANCE

constexpr double sgpp::optimization::optimizer::SquaredPenalty::DEFAULT_CONSTRAINT_TOLERANCE = 1e-6
static

default constraint tolerance

◆ DEFAULT_PENALTY_INCREASE_FACTOR

constexpr double sgpp::optimization::optimizer::SquaredPenalty::DEFAULT_PENALTY_INCREASE_FACTOR = 10.0
static

default penalty increase factor

◆ DEFAULT_PENALTY_START_VALUE

constexpr double sgpp::optimization::optimizer::SquaredPenalty::DEFAULT_PENALTY_START_VALUE = 1.0
static

default penalty start value

◆ DEFAULT_X_TOLERANCE

constexpr double sgpp::optimization::optimizer::SquaredPenalty::DEFAULT_X_TOLERANCE = 1e-6
static

default point tolerance

◆ epsilon

double sgpp::optimization::optimizer::SquaredPenalty::epsilon
protected

constraint tolerance

Referenced by getConstraintTolerance(), optimize(), and setConstraintTolerance().

◆ fGradient

std::unique_ptr<ScalarFunctionGradient> sgpp::optimization::optimizer::SquaredPenalty::fGradient
protected

objective function gradient

Referenced by getObjectiveGradient(), optimize(), and SquaredPenalty().

◆ gGradient

std::unique_ptr<VectorFunctionGradient> sgpp::optimization::optimizer::SquaredPenalty::gGradient
protected

inequality constraint function gradient

Referenced by getInequalityConstraintGradient(), optimize(), and SquaredPenalty().

◆ hGradient

std::unique_ptr<VectorFunctionGradient> sgpp::optimization::optimizer::SquaredPenalty::hGradient
protected

equality constraint function gradient

Referenced by getEqualityConstraintGradient(), optimize(), and SquaredPenalty().

◆ kHistInner

std::vector<size_t> sgpp::optimization::optimizer::SquaredPenalty::kHistInner
protected

search history (number of inner iterations)

Referenced by getHistoryOfInnerIterationNumbers(), and optimize().

◆ mu0

double sgpp::optimization::optimizer::SquaredPenalty::mu0
protected

penalty start value

Referenced by getPenaltyStartValue(), optimize(), and setPenaltyStartValue().

◆ rhoMuPlus

double sgpp::optimization::optimizer::SquaredPenalty::rhoMuPlus
protected

penalty increase factor

Referenced by getPenaltyIncreaseFactor(), optimize(), and setPenaltyIncreaseFactor().

◆ theta

double sgpp::optimization::optimizer::SquaredPenalty::theta
protected

point tolerance

Referenced by getXTolerance(), optimize(), and setXTolerance().

◆ xHistInner

base::DataMatrix sgpp::optimization::optimizer::SquaredPenalty::xHistInner
protected

search history (inner iterations)

Referenced by getHistoryOfInnerIterationPoints(), and optimize().


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