#include <func.h>
Inheritance diagram for SumFunc:
Public Member Functions | |
SumFunc (Pointer< Func > f_, Pointer< Func > g_, double a_=1., double b_=1., Pointer< ostream > out_func_p_=out_out_p, Pointer< ostream > out_func_log_p_=out_log_p) | |
Constructor for two functions and optional multiplicators. | |
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) |
double | eval (const UserVector< double > &x) const |
Evaluates the function. | |
void | grad (UserVector< double > &y, const UserVector< double > &x) const |
Computes the gradient. | |
int | valgrad (double &val, UserVector< double > &y, const UserVector< double > &x) const |
Computes the value and the gradient. | |
void | HessMult (UserVector< double > &y, const UserVector< double > &x, const UserVector< double > &z) const |
Computes the product of the Hessian and a UserVector. | |
bool | is_interval_compliant () const |
Indicates, whether the function and it's gradient can be evaluated over an interval. | |
interval< double > | eval (const IntervalVector &x) const |
void | grad (IntervalVector &y, const IntervalVector &x) const |
int | valgrad (interval< double > &val, IntervalVector &y, const IntervalVector &x) const |
Func::CurvatureType | get_curvature () const |
void | set_curvature (Func::CurvatureType ct) |
void | print (ostream &out) const |
Prints some information. | |
Private Member Functions | |
SparsityInfo & | get_sparsity () |
Private Attributes | |
Pointer< Func > | f |
First function in sum. | |
Pointer< Func > | g |
Second function in sum. | |
double | a |
Multiplicators for the functions. | |
double | b |
Func::CurvatureType | curv_type |
this == a * f(x) + b * g(x), where a and b are double's and f and g are Func's. f or g can also be NULL, but not both.
Definition at line 620 of file func.h.
SumFunc::SumFunc | ( | Pointer< Func > | f_, | |
Pointer< Func > | g_, | |||
double | a_ = 1. , |
|||
double | b_ = 1. , |
|||
Pointer< ostream > | out_func_p_ = out_out_p , |
|||
Pointer< ostream > | out_func_log_p_ = out_log_p | |||
) | [inline] |
Constructor for two functions and optional multiplicators.
Asserts, that f_ or g_ is not NULL.
f_ | The first function. | |
g_ | The second function. | |
a_ | The multiplicator for the first function. | |
b_ | The multiplicator for the second function. |
Definition at line 648 of file func.h.
References a, b, f, g, get_sparsity(), and Func::sparsity.
SparsityInfo& SumFunc::get_sparsity | ( | ) | [inline, private, virtual] |
Reimplemented from Func.
Definition at line 634 of file func.h.
References f, Func::sparsity, and sparsity_available().
Referenced by SumFunc().
virtual bool SumFunc::sparsity_available | ( | ) | const [inline, virtual] |
To check, whether the sparsity information is set.
Reimplemented from Func.
Definition at line 657 of file func.h.
References f, g, and Func::sparsity.
Referenced by get_sparsity().
virtual const SparsityInfo& SumFunc::get_sparsity | ( | ) | const [inline, virtual] |
Gives the sparsity information with read-permissions.
Reimplemented from Func.
Definition at line 663 of file func.h.
References f, Func::sparsity, and sparsity_available().
virtual bool SumFunc::compute_sparsity_pattern | ( | const vector< dvector > & | sample_set | ) | [virtual] |
Reimplemented from Func.
double SumFunc::eval | ( | const UserVector< double > & | x | ) | const [inline, virtual] |
void SumFunc::grad | ( | UserVector< double > & | y, | |
const UserVector< double > & | x | |||
) | const [virtual] |
Computes the gradient.
y | The vector to store the gradient in. | |
x | The vector to compute the gradient for. |
Implements Func.
int SumFunc::valgrad | ( | double & | val, | |
UserVector< double > & | y, | |||
const UserVector< double > & | x | |||
) | const [virtual] |
Computes the value and the gradient.
val | A double to store the value in. | |
y | A UserVector to store the gradient in. | |
x | The UserVector to compute. |
grad(UserVector<double>&, UserVector<double>&)
Reimplemented from Func.
void SumFunc::HessMult | ( | UserVector< double > & | y, | |
const UserVector< double > & | x, | |||
const UserVector< double > & | z | |||
) | const [virtual] |
Computes the product of the Hessian and a UserVector.
y | The UserVector<double> to store the result in. | |
x | The UserVector<double> to compute the Hessian for. | |
z | The UserVector<double> to multiply the Hession with. |
Implements Func.
bool SumFunc::is_interval_compliant | ( | ) | const [inline, virtual] |
interval<double> SumFunc::eval | ( | const IntervalVector & | x | ) | const [inline, virtual] |
void SumFunc::grad | ( | IntervalVector & | y, | |
const IntervalVector & | x | |||
) | const [virtual] |
Reimplemented from Func.
int SumFunc::valgrad | ( | interval< double > & | val, | |
IntervalVector & | y, | |||
const IntervalVector & | x | |||
) | const [virtual] |
Reimplemented from Func.
Func::CurvatureType SumFunc::get_curvature | ( | ) | const [inline, virtual] |
void SumFunc::set_curvature | ( | Func::CurvatureType | ct | ) | [inline, virtual] |
void SumFunc::print | ( | ostream & | out | ) | const [inline, virtual] |
Pointer<Func> SumFunc::f [private] |
First function in sum.
Definition at line 624 of file func.h.
Referenced by eval(), get_sparsity(), is_interval_compliant(), print(), sparsity_available(), and SumFunc().
Pointer<Func> SumFunc::g [private] |
Second function in sum.
Definition at line 627 of file func.h.
Referenced by Func::add_grad(), Func::add_valgrad(), eval(), Func::eval(), Func::grad(), is_interval_compliant(), print(), sparsity_available(), SumFunc(), and Func::valgrad().
double SumFunc::a [private] |
double SumFunc::b [private] |
Func::CurvatureType SumFunc::curv_type [private] |