#include <func.h>
Inheritance diagram for Func:


Public Types | |
| CONVEX = 1 | |
| CONCAVE = 2 | |
| LINEAR = CONVEX | CONCAVE | |
| UNKNOWN = 4 | |
| INDEFINITE = 12 | |
| enum | CurvatureType { CONVEX = 1, CONCAVE = 2, LINEAR = CONVEX | CONCAVE, UNKNOWN = 4, INDEFINITE = 12 } |
Public Member Functions | |
| Func (int n=0, Pointer< ostream > out_func_p_=out_out_p, Pointer< ostream > out_func_log_p_=out_log_p) | |
| (Standard-)Constructor for optional dimension. | |
| virtual | ~Func () |
| Virtual Destructor. | |
| int | dim () const |
| Gives the dimension. | |
| virtual bool | sparsity_available () const |
| To check, whether the sparsity information is set. | |
| virtual const SparsityInfo & | get_sparsity () const |
| Gives the sparsity information with read-permissions. | |
| virtual bool | compute_sparsity_pattern (const vector< dvector > &sample_set) |
| virtual double | eval (const UserVector< double > &x) const =0 |
| Computes the value of this function for a UserVector<double>. | |
| virtual void | grad (UserVector< double > &g, const UserVector< double > &x) const =0 |
| Computes the (sub)gradient for a UserVector<double>. | |
| virtual dvector | grad (const dvector &x) const |
| Computes the (sub)gradient for a UserVector<double>. | |
| virtual void | HessMult (UserVector< double > &y, const UserVector< double > &x, const UserVector< double > &z) const =0 |
| Evaluates the product of the Hessian and a UserVector<double>. | |
| virtual dvector | HessMult (const dvector &x, const dvector &z) const |
| Evaluates the product of the Hessian and a dvector. | |
| virtual int | valgrad (double &val, UserVector< double > &g, const UserVector< double > &x) const |
| Computes the (sub)gradient and the value of this function for a UserVector<double>. | |
| virtual void | add_grad (UserVector< double > &g, const UserVector< double > &x) const |
| Add's the (sub)gradient of this function to a UserVector<double>. | |
| virtual void | add_valgrad (double &val, UserVector< double > &g, const UserVector< double > &x) const |
| Add's the (sub)gradient and the value of this function to a UserVector<double> and a double. | |
| virtual double | min_eig_hess (const UserVector< double > &x, Param *param=NULL) const |
| Gives the minimum eigenvector of the Hessian in point x. | |
| virtual bool | is_interval_compliant () const |
| Indicates, whether the function and it's gradient can be evaluated over an interval. | |
| virtual interval< double > | eval (const IntervalVector &x) const |
| virtual void | grad (IntervalVector &g, const IntervalVector &x) const |
| virtual int | valgrad (interval< double > &val, IntervalVector &g, const IntervalVector &x) const |
| virtual void | set_curvature (CurvatureType ct)=0 |
| virtual CurvatureType | get_curvature () const =0 |
| virtual void | print (ostream &out) const |
| Print's out the dimension. | |
Static Public Member Functions | |
| static CurvatureType | add_curvatures (double a1, CurvatureType ct1, double a2, CurvatureType ct2) |
| static CurvatureType | mult_curvature (double a, CurvatureType ct) |
Public Attributes | |
| Pointer< ostream > | out_func_p |
| A Pointer to an output-stream for function-relevant output. | |
| Pointer< ostream > | out_func_log_p |
| A Pointer to an ostream to print function-relevant logging-information. | |
Protected Member Functions | |
| virtual SparsityInfo & | get_sparsity () |
Protected Attributes | |
| int | dim_ |
| The dimension. | |
| Pointer< SparsityInfo > | sparsity |
Friends | |
| class | VariableIterator |
| class | MinusFunc |
| class | SumFunc |
| ostream & | operator<< (ostream &out, const Func &a) |
| Prints some status information. | |
| ostream & | operator<< (ostream &out, const CurvatureType &ct) |
You need to implement the following methods:
Definition at line 221 of file func.h.
| enum Func::CurvatureType |
| Func::Func | ( | int | n = 0, |
|
| Pointer< ostream > | out_func_p_ = out_out_p, |
|||
| Pointer< ostream > | out_func_log_p_ = out_log_p | |||
| ) | [inline] |
(Standard-)Constructor for optional dimension.
| n | The dimension, default is 0. | |
| out_func_p_ | An ostream to print function-related output to, default is out_out_p. | |
| out_func_log_p_ | An ostream to print function-related logging-output to, default is out_func_p. |
| virtual Func::~Func | ( | ) | [inline, virtual] |
| virtual SparsityInfo& Func::get_sparsity | ( | ) | [inline, protected, virtual] |
| int Func::dim | ( | ) | const [inline] |
Gives the dimension.
Definition at line 288 of file func.h.
References dim_.
Referenced by QqpDualFunc::eval(), MinlpPenaltyFunc::print(), SepFunc::print(), print(), amplCon::print(), and amplObj::print().
| virtual bool Func::sparsity_available | ( | ) | const [inline, virtual] |
| virtual const SparsityInfo& Func::get_sparsity | ( | ) | const [inline, virtual] |
| virtual bool Func::compute_sparsity_pattern | ( | const vector< dvector > & | sample_set | ) | [inline, virtual] |
Reimplemented in MinusFunc, and SumFunc.
Definition at line 299 of file func.h.
References SparsityInfo::compute_sparsity_pattern(), and get_sparsity().
| virtual double Func::eval | ( | const UserVector< double > & | x | ) | const [pure virtual] |
Computes the value of this function for a UserVector<double>.
Abstract.
| x | The UserVector<double> to compute the value for. |
Implemented in amplObj, amplCon, SplitFunc, QqpDualFunc, MinusFunc, SumFunc, SepQcFunc, gamsFunc, Monom, and MinlpPenaltyFunc.
Referenced by add_valgrad(), and valgrad().
| virtual void Func::grad | ( | UserVector< double > & | g, | |
| const UserVector< double > & | x | |||
| ) | const [pure virtual] |
Computes the (sub)gradient for a UserVector<double>.
Abstract.
| g | The UserVector<double> to store the result in. | |
| x | The UserVector<double> to compute the gradient for. |
valgrad(double&, UserVector<double>&, const UserVector<double>&)
add_grad(UserVector<double>&, UserVector<double>&)
add_valgrad(double&, UserVector<double>&, UserVector<double>&)
Implemented in amplObj, amplCon, SplitFunc, QqpDualFunc, MinusFunc, SumFunc, SepQcFunc, gamsFunc, Monom, and MinlpPenaltyFunc.
Referenced by add_grad(), grad(), and valgrad().
Computes the (sub)gradient for a UserVector<double>.
| x | The UserVector<double> to compute. |
add_grad(UserVector<double>&, const UserVector<double>&)
add_valgrad(UserVector<double>&, UserVector<double>&, const UserVector<double>&)
Reimplemented in MinusFunc.
Definition at line 326 of file func.h.
References DenseVector< Type >::dim(), SumFunc::g, and grad().
| virtual void Func::HessMult | ( | UserVector< double > & | y, | |
| const UserVector< double > & | x, | |||
| const UserVector< double > & | z | |||
| ) | const [pure virtual] |
Evaluates the product of the Hessian and a UserVector<double>.
Abstract.
| y | The UserVector<double> to store the result in: . | |
| x | The UserVector<double> to evaluate the Hessian for. | |
| z | The UserVector<double> to multiply with the Hessian. |
Implemented in amplObj, amplCon, SplitFunc, QqpDualFunc, MinusFunc, SumFunc, SepQcFunc, gamsFunc, Monom, and MinlpPenaltyFunc.
Referenced by HessMult().
Evaluates the product of the Hessian and a dvector.
| x | The dvector to evaluate the Hessian for. | |
| z | The dvector to multiply with the Hessian. |
. Reimplemented in MinusFunc.
Definition at line 347 of file func.h.
References HessMult(), and UserVector< Type >::size().
| virtual int Func::valgrad | ( | double & | val, | |
| UserVector< double > & | g, | |||
| const UserVector< double > & | x | |||
| ) | const [inline, virtual] |
Computes the (sub)gradient and the value of this function for a UserVector<double>.
| val | The double to store the value this(x). | |
| g | The UserVector<double> to store the gradient. | |
| x | The UserVector<double> to compute the gradient and value for. |
add_grad(UserVector<double>&, const UserVector<double>&)
add_valgrad(UserVector<double>&, UserVector<double>&, const UserVector<double>&)
Reimplemented in QqpDualFunc, SumFunc, SepQcFunc, gamsFunc, and MinlpPenaltyFunc.
Definition at line 362 of file func.h.
References eval(), SumFunc::g, and grad().
| virtual void Func::add_grad | ( | UserVector< double > & | g, | |
| const UserVector< double > & | x | |||
| ) | const [inline, virtual] |
Add's the (sub)gradient of this function to a UserVector<double>.
| g | The UserVector<double> to add the gradient to. | |
| x | The UserVector<double> to compute the gradient for. |
valgrad(double&, dvector&, const dvector&)
add_valgrad(double&, dvector&, const dvector&)
Definition at line 375 of file func.h.
References SumFunc::g, and grad().
Referenced by add_valgrad().
| virtual void Func::add_valgrad | ( | double & | val, | |
| UserVector< double > & | g, | |||
| const UserVector< double > & | x | |||
| ) | const [inline, virtual] |
Add's the (sub)gradient and the value of this function to a UserVector<double> and a double.
| val | The double to add the value to. | |
| g | The UserVector<double> to add the gradient to. | |
| x | The UserVector<double> to compute the value and the gradient for. |
add_grad(UserVector<double>&, const UserVector<double>&)
Definition at line 388 of file func.h.
References add_grad(), eval(), and SumFunc::g.
| virtual double Func::min_eig_hess | ( | const UserVector< double > & | x, | |
| Param * | param = NULL | |||
| ) | const [virtual] |
Gives the minimum eigenvector of the Hessian in point x.
| x | The dvector to compute the Hessian for. | |
| param | Optional parameters for eigenvalue computation. |
| virtual bool Func::is_interval_compliant | ( | ) | const [inline, virtual] |
| virtual interval<double> Func::eval | ( | const IntervalVector & | x | ) | const [inline, virtual] |
| virtual void Func::grad | ( | IntervalVector & | g, | |
| const IntervalVector & | x | |||
| ) | const [inline, virtual] |
| virtual int Func::valgrad | ( | interval< double > & | val, | |
| IntervalVector & | g, | |||
| const IntervalVector & | x | |||
| ) | const [inline, virtual] |
| virtual void Func::set_curvature | ( | CurvatureType | ct | ) | [pure virtual] |
| virtual CurvatureType Func::get_curvature | ( | ) | const [pure virtual] |
| static CurvatureType Func::add_curvatures | ( | double | a1, | |
| CurvatureType | ct1, | |||
| double | a2, | |||
| CurvatureType | ct2 | |||
| ) | [static] |
| static CurvatureType Func::mult_curvature | ( | double | a, | |
| CurvatureType | ct | |||
| ) | [static] |
| virtual void Func::print | ( | ostream & | out | ) | const [inline, virtual] |
friend class VariableIterator [friend] |
| ostream& operator<< | ( | ostream & | out, | |
| const Func & | a | |||
| ) | [friend] |
| ostream& operator<< | ( | ostream & | out, | |
| const CurvatureType & | ct | |||
| ) | [friend] |
int Func::dim_ [protected] |
Pointer<SparsityInfo> Func::sparsity [protected] |
Definition at line 241 of file func.h.
Referenced by amplCon::amplCon(), amplObj::amplObj(), gamsFunc::gamsFunc(), SepQcFunc::get_sparsity(), SumFunc::get_sparsity(), MinusFunc::get_sparsity(), get_sparsity(), SepQcFunc::SepQcFunc(), SepQcFunc::sparsity_available(), SumFunc::sparsity_available(), MinusFunc::sparsity_available(), sparsity_available(), SplitFunc::SplitFunc(), and SumFunc::SumFunc().
| Pointer<ostream> Func::out_func_p |
| Pointer<ostream> Func::out_func_log_p |
A Pointer to an ostream to print function-relevant logging-information.
Set in the constructor, default is out_log_p.
1.4.7