NC::Fitter::MarginalizeSimple Class Reference

Minimize callable f with respect to all its arguments except xcoord and (optionally) ycoord. More...

#include <NCFitter.h>

Inheritance diagram for NC::Fitter::MarginalizeSimple:
NC::Fitter::ICallable2D

List of all members.

Public Member Functions

 MarginalizeSimple (const ICallableND *f, const std::vector< NCParameter > &params, const bool reuseOld, const int xCoord, const int yCoord)
virtual ~MarginalizeSimple ()
double EvalAtEx (const Coord &r, CoordNDim &ret) const

Private Attributes

MinFinderSimplefMinFinder
FixVarsf2
std::vector< NCParameterfParams
int fXpos
int fYpos
std::vector< int > fVary

Detailed Description

Minimize callable f with respect to all its arguments except xcoord and (optionally) ycoord.

Definition at line 273 of file NCFitter.h.


Constructor & Destructor Documentation

NC::Fitter::MarginalizeSimple::MarginalizeSimple ( const ICallableND f,
const std::vector< NCParameter > &  params,
const bool  reuseOld,
const int  xCoord,
const int  yCoord 
)

Definition at line 1422 of file NCFitter.cxx.

References f2, fMinFinder, fParams, fVary, fXpos, and fYpos.

01427     :fParams(p), fXpos(xcoord), fYpos(ycoord)
01428   {
01429     assert(fXpos < int(fParams.size()) && fYpos < int(fParams.size()));
01430 
01431     vector<NCParameter> shortParams;
01432 
01433     for(int n = 0; n < int(fParams.size()); ++n){
01434       if(n != fXpos && n != fYpos){
01435         fVary.push_back(n);
01436         shortParams.push_back(fParams[n]);
01437       }
01438     }
01439 
01440     CoordNDim fix;
01441     fix.resize(fParams.size());
01442     f2 = new FixVars(f, fix, fVary);
01443 
01444     fMinFinder = new MinFinderSimple(shortParams, true, reuseOld, f2);
01445   }

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

Definition at line 281 of file NCFitter.h.

00281 {}//delete f2;}


Member Function Documentation

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

Implements NC::Fitter::ICallable2D.

Definition at line 1449 of file NCFitter.cxx.

References f2, NC::Fitter::MinFinderSimple::FindMin(), fMinFinder, fParams, fXpos, fYpos, NC::Fitter::FixVars::SetFixed(), NC::Fitter::Coord::x, and NC::Fitter::Coord::y.

01450   {
01451     CoordNDim fix;
01452     fix.resize(fParams.size());
01453     fix[fXpos] = r.x;
01454     if(fYpos > -1) fix[fYpos] = r.y;
01455     f2->SetFixed(fix);
01456 
01457     return fMinFinder->FindMin(ret);
01458   }


Member Data Documentation

Definition at line 285 of file NCFitter.h.

Referenced by EvalAtEx(), and MarginalizeSimple().

Definition at line 284 of file NCFitter.h.

Referenced by EvalAtEx(), and MarginalizeSimple().

Definition at line 286 of file NCFitter.h.

Referenced by EvalAtEx(), and MarginalizeSimple().

std::vector<int> NC::Fitter::MarginalizeSimple::fVary [private]

Definition at line 288 of file NCFitter.h.

Referenced by MarginalizeSimple().

Definition at line 287 of file NCFitter.h.

Referenced by EvalAtEx(), and MarginalizeSimple().

Definition at line 287 of file NCFitter.h.

Referenced by EvalAtEx(), and MarginalizeSimple().


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

Generated on 16 Apr 2018 for loon by  doxygen 1.6.1