CMS 3D CMS Logo

Public Member Functions | Public Attributes

cmsmath::MinimizerContext Struct Reference

Basic struct to call a function. More...

#include <SequentialMinimizer.h>

List of all members.

Public Member Functions

double cleanEval (unsigned int i, double xi) const
double eval () const
 MinimizerContext (const ROOT::Math::IMultiGenFunction *function)
double setAndEval (unsigned int i, double xi) const

Public Attributes

const
ROOT::Math::IMultiGenFunction * 
func
unsigned int nCalls
std::vector< double > x

Detailed Description

Basic struct to call a function.

Definition at line 13 of file SequentialMinimizer.h.


Constructor & Destructor Documentation

cmsmath::MinimizerContext::MinimizerContext ( const ROOT::Math::IMultiGenFunction *  function) [inline]

Definition at line 14 of file SequentialMinimizer.h.

: func(function), x(func->NDim()), nCalls(0) {}

Member Function Documentation

double cmsmath::MinimizerContext::cleanEval ( unsigned int  i,
double  xi 
) const [inline]

Definition at line 18 of file SequentialMinimizer.h.

References eval(), i, x, and detailsBasic3DVector::y.

Referenced by cmsmath::OneDimMinimizer::eval().

{ double x0 = x[i]; x[i] = xi; double y = eval(); x[i] = x0; return y; }
double cmsmath::MinimizerContext::eval ( ) const [inline]

Definition at line 16 of file SequentialMinimizer.h.

References func, nCalls, and x.

Referenced by cleanEval(), cmsmath::OneDimMinimizer::eval(), and setAndEval().

{ nCalls++; return (*func)(&x[0]); }
double cmsmath::MinimizerContext::setAndEval ( unsigned int  i,
double  xi 
) const [inline]

Definition at line 17 of file SequentialMinimizer.h.

References eval(), i, and x.

{ x[i] = xi; return eval(); }

Member Data Documentation

const ROOT::Math::IMultiGenFunction* cmsmath::MinimizerContext::func

Definition at line 20 of file SequentialMinimizer.h.

Referenced by eval().

unsigned int cmsmath::MinimizerContext::nCalls [mutable]

Definition at line 23 of file SequentialMinimizer.h.

Referenced by eval().

std::vector<double> cmsmath::MinimizerContext::x [mutable]

Definition at line 22 of file SequentialMinimizer.h.

Referenced by cleanEval(), eval(), setAndEval(), and cmsmath::OneDimMinimizer::x().