NC::Fitter::FixVars Class Reference

Effectively reduce the number of arguments taken by fun. More...

#include <NCFitter.h>

Inheritance diagram for NC::Fitter::FixVars:

List of all members.

Public Member Functions

 FixVars (const ICallableND *fun, const CoordNDim &fix, const std::vector< int > &vary)
virtual ~FixVars ()
virtual double EvalAtEx (const CoordNDim &r, CoordNDim *ret) const
 Find the value of the function and return additional information.
void SetFixed (CoordNDim c)

Private Attributes

const ICallableNDfFunc
CoordNDim fFixed
std::vector< int > fToVary

Detailed Description

Effectively reduce the number of arguments taken by fun.

For each position not listed in vary the value from the corresponding position in fix will be substituted in at call time.

Definition at line 231 of file NCFitter.h.

Constructor & Destructor Documentation

NC::Fitter::FixVars::FixVars ( const ICallableND fun,
const CoordNDim fix,
const std::vector< int > &  vary 

Definition at line 1365 of file NCFitter.cxx.

01368     :fFunc(fun), fFixed(fix), fToVary(vary){}

virtual NC::Fitter::FixVars::~FixVars (  )  [inline, virtual]

Definition at line 237 of file NCFitter.h.

00237 { } // shut gcc up

Member Function Documentation

double NC::Fitter::FixVars::EvalAtEx ( const CoordNDim r,
CoordNDim ret 
) const [virtual]

Find the value of the function and return additional information.

r Coordinate at which to evaluate the function
[out] ret Return additional information. By convention, the true underlying coordinates evaluated.
Value of the function at the point r

Implementations must be prepared for ret to be null

Rename to just EvalAt

Implements NC::Fitter::ICallableND.

Definition at line 1371 of file NCFitter.cxx.

References NC::Fitter::ICallableND::EvalAtEx(), fFixed, fFunc, and fToVary.

01372   {
01373     assert(fToVary.size() == r.size());
01374     // For every parameter in the list of what we are to vary - substitute
01375     // in, in order, from the parameters we were passed.
01376     CoordNDim fixed = fFixed;
01377     for(unsigned int n = 0; n < fToVary.size(); ++n)
01378       fixed[fToVary[n]] = r[n];
01379     return fFunc->EvalAtEx(fixed, ret);
01380   }

void NC::Fitter::FixVars::SetFixed ( CoordNDim  c  )  [inline]

Definition at line 239 of file NCFitter.h.

References fFixed.

Referenced by NC::Fitter::MarginalizeSimple::EvalAtEx().

00239 {fFixed = c;}

Member Data Documentation

Definition at line 242 of file NCFitter.h.

Referenced by EvalAtEx(), and SetFixed().

Definition at line 241 of file NCFitter.h.

Referenced by EvalAtEx().

std::vector<int> NC::Fitter::FixVars::fToVary [private]

Definition at line 243 of file NCFitter.h.

Referenced by EvalAtEx().

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

Generated on 8 Jul 2019 for loon by  doxygen 1.6.1