SplitFunc Class Reference

Represents a function, which relates only to a subset of the variables of another function. More...

#include <decomp.h>

Inheritance diagram for SplitFunc:

Inheritance graph
[legend]
Collaboration diagram for SplitFunc:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SplitFunc (const Pointer< Func > &orig_, const ivector &indices_, const dvector &point_, const vector< int > &ignore_=vector< int >(0))
 Constructor.
 SplitFunc (const Pointer< Func > &orig_, const ivector &indices_, const dvector &point_, const set< int > &ignore_, Pointer< SparsityInfo > si=NULL)
void set_point (const UserVector< double > &x) const
 Sets point to value of x for variables, we represent and don't ignore.
double eval (const UserVector< double > &x) const
 Computes the value of this function for a UserVector<double>.
void grad (UserVector< double > &g, const UserVector< double > &x) const
 Computes the (sub)gradient for a UserVector<double>.
void HessMult (UserVector< double > &y, const UserVector< double > &x, const UserVector< double > &z) const
 Evaluates the product of the Hessian and a UserVector<double>.
bool is_interval_compliant () const
 Indicates, whether the function and it's gradient can be evaluated over an interval.
void set_point (IntervalVector &bigx, const IntervalVector &x) const
interval< double > eval (const IntervalVector &x) const
void grad (IntervalVector &g, const IntervalVector &x) const
int valgrad (interval< double > &val, IntervalVector &y, const IntervalVector &x) const
virtual void set_curvature (CurvatureType ct)
virtual CurvatureType get_curvature () const
void print (ostream &out) const
 Print's out the dimension.

Public Attributes

vector< bool > ignore
 Variables, we relate to, but we ignore at evaluation.

Private Attributes

const Pointer< Funcorig
 Pointer to original function.
ivector indices
 The indices of the variables of original function, this function relates on.
dvector point
 A point, we can use to evaluate the original function.
Func::CurvatureType curv_type

Detailed Description

Represents a function, which relates only to a subset of the variables of another function.

Definition at line 111 of file decomp.h.


Constructor & Destructor Documentation

SplitFunc::SplitFunc ( const Pointer< Func > &  orig_,
const ivector indices_,
const dvector point_,
const vector< int > &  ignore_ = vector<int>(0) 
) [inline]

Constructor.

Parameters:
orig_ The original function.
indices_ The set of indices, for which this function represents the original one.
point_ The point, where we take the other values from.
ignore_ Indices of variables (of this function, not the original one) which should be ignored.

Definition at line 138 of file decomp.h.

References ignore, and orig.

SplitFunc::SplitFunc ( const Pointer< Func > &  orig_,
const ivector indices_,
const dvector point_,
const set< int > &  ignore_,
Pointer< SparsityInfo si = NULL 
) [inline]

Definition at line 144 of file decomp.h.

References ignore, orig, and Func::sparsity.


Member Function Documentation

void SplitFunc::set_point ( const UserVector< double > &  x  )  const [inline]

Sets point to value of x for variables, we represent and don't ignore.

Parameters:
x The UserVector to take to values from.

Definition at line 154 of file decomp.h.

References ignore, indices, point, and UserVector< Type >::size().

Referenced by eval(), grad(), HessMult(), and valgrad().

double SplitFunc::eval ( const UserVector< double > &  x  )  const [inline, virtual]

Computes the value of this function for a UserVector<double>.

Abstract.

Parameters:
x The UserVector<double> to compute the value for.
Returns:
The value this(x) as double.

Implements Func.

Definition at line 159 of file decomp.h.

References orig, point, and set_point().

void SplitFunc::grad ( UserVector< double > &  g,
const UserVector< double > &  x 
) const [inline, virtual]

Computes the (sub)gradient for a UserVector<double>.

Abstract.

Parameters:
g The UserVector<double> to store the result in.
x The UserVector<double> to compute the gradient for.
See also:
grad(const dvector&)

valgrad(double&, UserVector<double>&, const UserVector<double>&)

add_grad(UserVector<double>&, UserVector<double>&)

add_valgrad(double&, UserVector<double>&, UserVector<double>&)

Implements Func.

Definition at line 165 of file decomp.h.

References ignore, indices, orig, point, set_point(), and UserVector< Type >::size().

void SplitFunc::HessMult ( UserVector< double > &  y,
const UserVector< double > &  x,
const UserVector< double > &  z 
) const [inline, virtual]

Evaluates the product of the Hessian and a UserVector<double>.

Abstract.

Parameters:
y The UserVector<double> to store the result in: $ y = \nabla^2 f(x) \cdot z $.
x The UserVector<double> to evaluate the Hessian for.
z The UserVector<double> to multiply with the Hessian.
See also:
HessMult(const UserVector<double>&, const UserVector<double>&)

Implements Func.

Definition at line 176 of file decomp.h.

References ignore, indices, orig, point, set_point(), DenseVector< Type >::SetElement(), and UserVector< Type >::size().

bool SplitFunc::is_interval_compliant (  )  const [inline, virtual]

Indicates, whether the function and it's gradient can be evaluated over an interval.

Reimplemented from Func.

Definition at line 191 of file decomp.h.

References orig.

void SplitFunc::set_point ( IntervalVector &  bigx,
const IntervalVector &  x 
) const [inline]

Definition at line 193 of file decomp.h.

References ignore, indices, and UserVector< Type >::size().

interval<double> SplitFunc::eval ( const IntervalVector &  x  )  const [inline, virtual]

Reimplemented from Func.

Definition at line 198 of file decomp.h.

References orig, point, and set_point().

void SplitFunc::grad ( IntervalVector &  g,
const IntervalVector &  x 
) const [inline, virtual]

Reimplemented from Func.

Definition at line 204 of file decomp.h.

References ignore, indices, orig, point, set_point(), and UserVector< Type >::size().

int SplitFunc::valgrad ( interval< double > &  val,
IntervalVector &  y,
const IntervalVector &  x 
) const [inline, virtual]

Reimplemented from Func.

Definition at line 213 of file decomp.h.

References ignore, indices, orig, point, set_point(), and UserVector< Type >::size().

virtual void SplitFunc::set_curvature ( CurvatureType  ct  )  [inline, virtual]

Definition at line 226 of file decomp.h.

References curv_type.

virtual CurvatureType SplitFunc::get_curvature (  )  const [inline, virtual]

Implements Func.

Definition at line 227 of file decomp.h.

References curv_type.

void SplitFunc::print ( ostream &  out  )  const [virtual]

Print's out the dimension.

Parameters:
out The ostream to print to.
See also:
dim()

Reimplemented from Func.


Member Data Documentation

const Pointer<Func> SplitFunc::orig [private]

Pointer to original function.

Definition at line 115 of file decomp.h.

Referenced by eval(), grad(), HessMult(), is_interval_compliant(), SplitFunc(), and valgrad().

ivector SplitFunc::indices [private]

The indices of the variables of original function, this function relates on.

Definition at line 119 of file decomp.h.

Referenced by grad(), HessMult(), set_point(), and valgrad().

dvector SplitFunc::point [mutable, private]

A point, we can use to evaluate the original function.

Definition at line 123 of file decomp.h.

Referenced by eval(), grad(), HessMult(), set_point(), and valgrad().

Func::CurvatureType SplitFunc::curv_type [private]

Definition at line 125 of file decomp.h.

Referenced by get_curvature(), and set_curvature().

vector<bool> SplitFunc::ignore

Variables, we relate to, but we ignore at evaluation.

Definition at line 130 of file decomp.h.

Referenced by grad(), HessMult(), set_point(), SplitFunc(), and valgrad().


The documentation for this class was generated from the following file:
Generated on Wed Oct 22 03:13:09 2008 for LaGO by  doxygen 1.4.7