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>.
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 108 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 135 of file decomp.h.

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

Definition at line 141 of file decomp.h.


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 151 of file decomp.h.

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 156 of file decomp.h.

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 162 of file decomp.h.

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 173 of file decomp.h.

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

Implements Func.

Definition at line 223 of file decomp.h.

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

Implements Func.

Definition at line 224 of file decomp.h.

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 112 of file decomp.h.

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

Definition at line 116 of file decomp.h.

dvector SplitFunc::point [mutable, private]

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

Definition at line 120 of file decomp.h.

Definition at line 122 of file decomp.h.

vector<bool> SplitFunc::ignore

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

Definition at line 127 of file decomp.h.


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

Generated on 10 Mar 2013 for LaGO by  doxygen 1.6.1