An interface class that computes the maximum/minimum of a function represented as an ElementFormula on an space on hp2D::Quad<Real> only. More...

#include <extrema.hh>

Inheritance diagram for hp2D::Extrema< T >:
concepts::OutputOperator

Public Member Functions

 Extrema (const concepts::SpaceOnCells< Real > &spc, const concepts::ElementFormula< Real > &formula, const concepts::ElementFormula< Real2d > *formulaGrad=0, uint np=2, bool report=false)
 http://www.alglib.net/translator/man/manual.cpp.html#unit_minbleic More...
 
Real get () const
 

Static Public Attributes

static Extrema< T > * pt2Object
 Inner static pointer to object, used by the wrapper. More...
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const override
 Returns information in an output stream. More...
 

Private Member Functions

Real compute_ (const hp2D::Quad< concepts::Real > &quad)
 
void evalsF_ (const alglib::real_1d_array &x, double &func, void *ptr)
 
void evalsG_ (const alglib::real_1d_array &x, double &func, alglib::real_1d_array &grad, void *ptr)
 
Real get_ (const concepts::Set< Real > &vals) const
 
void reportOutput_ (uint K, const std::string &point, int terminationType) const
 Can report the current convergence behaviour if requested via setReport() More...
 
Real sign_ () const
 

Static Private Member Functions

static void Wrapper_To_Call_Fun_ (const alglib::real_1d_array &x, double &func, void *ptr)
 
static void Wrapper_To_Call_Grad_ (const alglib::real_1d_array &x, double &func, alglib::real_1d_array &grad, void *ptr)
 

Private Attributes

Real curFunc_
 
const hp2D::Quad< Real > * elm_
 
std::set< Real > extrema_
 
const concepts::ElementFormula< Real > & frm_
 
const concepts::ElementFormula< Real2d > * frmGrad_
 
uint np_
 
std::vector< std::string > points_
 
bool report_
 
const concepts::SpaceOnCells< Real > & spc_
 
concepts::Sequence< Real > vals_
 

Detailed Description

template<concepts::Optimize T>
class hp2D::Extrema< T >

An interface class that computes the maximum/minimum of a function represented as an ElementFormula on an space on hp2D::Quad<Real> only.

Author
Robert Gruhlke, 2015

Definition at line 42 of file extrema.hh.

Constructor & Destructor Documentation

◆ Extrema()

template<concepts::Optimize T>
hp2D::Extrema< T >::Extrema ( const concepts::SpaceOnCells< Real > &  spc,
const concepts::ElementFormula< Real > &  formula,
const concepts::ElementFormula< Real2d > *  formulaGrad = 0,
uint  np = 2,
bool  report = false 
)

http://www.alglib.net/translator/man/manual.cpp.html#unit_minbleic

There are two modi implemented. We apply an gradient approximation active set strategy, that is numerical unstable and expensive in the sense of function evaluations, if the gradient of the function is not given.

Therefore with $ mode = 1 $ the alternative uses the analytical gradient of local solution, that should be the choice.

The number $ np $ controls the number of startpoints that are equidistant distributed on the inner of $ [0,1]^2 $. For local solution where more that a local maximum is supposed this might be usefull.

Parameters
spcspace on which the formula is given
formulafunction
formulaGradgradient of the function (default = 0)
npnp^2 = number of equidistant start points in one direction (defualt np=2)
reportset 'true' for detailed report

Member Function Documentation

◆ compute_()

template<concepts::Optimize T>
Real hp2D::Extrema< T >::compute_ ( const hp2D::Quad< concepts::Real > &  quad)
private

◆ evalsF_()

template<concepts::Optimize T>
void hp2D::Extrema< T >::evalsF_ ( const alglib::real_1d_array x,
double &  func,
void *  ptr 
)
private

◆ evalsG_()

template<concepts::Optimize T>
void hp2D::Extrema< T >::evalsG_ ( const alglib::real_1d_array x,
double &  func,
alglib::real_1d_array grad,
void *  ptr 
)
private

◆ get()

template<concepts::Optimize T>
Real hp2D::Extrema< T >::get ( ) const

◆ get_()

template<concepts::Optimize T>
Real hp2D::Extrema< T >::get_ ( const concepts::Set< Real > &  vals) const
private

◆ info()

template<concepts::Optimize T>
virtual std::ostream& hp2D::Extrema< T >::info ( std::ostream &  os) const
overrideprotectedvirtual

Returns information in an output stream.

Reimplemented from concepts::OutputOperator.

◆ reportOutput_()

template<concepts::Optimize T>
void hp2D::Extrema< T >::reportOutput_ ( uint  K,
const std::string &  point,
int  terminationType 
) const
private

Can report the current convergence behaviour if requested via setReport()

Parameters
Kkey of current cell
inttermination type coming from alglib report system

◆ sign_()

template<concepts::Optimize T>
Real hp2D::Extrema< T >::sign_ ( ) const
private

◆ Wrapper_To_Call_Fun_()

template<concepts::Optimize T>
static void hp2D::Extrema< T >::Wrapper_To_Call_Fun_ ( const alglib::real_1d_array x,
double &  func,
void *  ptr 
)
staticprivate

◆ Wrapper_To_Call_Grad_()

template<concepts::Optimize T>
static void hp2D::Extrema< T >::Wrapper_To_Call_Grad_ ( const alglib::real_1d_array x,
double &  func,
alglib::real_1d_array grad,
void *  ptr 
)
staticprivate

Member Data Documentation

◆ curFunc_

template<concepts::Optimize T>
Real hp2D::Extrema< T >::curFunc_
private

Definition at line 101 of file extrema.hh.

◆ elm_

template<concepts::Optimize T>
const hp2D::Quad<Real>* hp2D::Extrema< T >::elm_
private

Definition at line 95 of file extrema.hh.

◆ extrema_

template<concepts::Optimize T>
std::set<Real> hp2D::Extrema< T >::extrema_
private

Definition at line 87 of file extrema.hh.

◆ frm_

template<concepts::Optimize T>
const concepts::ElementFormula<Real>& hp2D::Extrema< T >::frm_
private

Definition at line 91 of file extrema.hh.

◆ frmGrad_

template<concepts::Optimize T>
const concepts::ElementFormula<Real2d>* hp2D::Extrema< T >::frmGrad_
private

Definition at line 93 of file extrema.hh.

◆ np_

template<concepts::Optimize T>
uint hp2D::Extrema< T >::np_
private

Definition at line 97 of file extrema.hh.

◆ points_

template<concepts::Optimize T>
std::vector<std::string> hp2D::Extrema< T >::points_
private

Definition at line 85 of file extrema.hh.

◆ pt2Object

template<concepts::Optimize T>
Extrema<T>* hp2D::Extrema< T >::pt2Object
static

Inner static pointer to object, used by the wrapper.

Definition at line 76 of file extrema.hh.

◆ report_

template<concepts::Optimize T>
bool hp2D::Extrema< T >::report_
private

Definition at line 99 of file extrema.hh.

◆ spc_

template<concepts::Optimize T>
const concepts::SpaceOnCells<Real>& hp2D::Extrema< T >::spc_
private

Definition at line 89 of file extrema.hh.

◆ vals_

template<concepts::Optimize T>
concepts::Sequence<Real> hp2D::Extrema< T >::vals_
private

Definition at line 103 of file extrema.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich