NC::Fitter::MarginalizeSimpleInt 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::MarginalizeSimpleInt:
NC::Fitter::ICallableInt

List of all members.

Public Member Functions

 MarginalizeSimpleInt (const ICallableInt *f, const std::vector< NCParameter > &params, const int xCoord, const int yCoord=-1)
virtual ~MarginalizeSimpleInt ()
virtual double EvalAtEx (const CoordInt &r, CoordInt *ret) const

Private Attributes

MinFinderSimpleIntminFinder
FixVarsIntf2
std::vector< int > fToMin
std::vector< NCParameterfParams
int fXpos
int fYpos
std::vector< int > fVary
std::vector< NCParameterfShortParams

Detailed Description

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

Definition at line 296 of file NCFitter.h.


Constructor & Destructor Documentation

NC::Fitter::MarginalizeSimpleInt::MarginalizeSimpleInt ( const ICallableInt f,
const std::vector< NCParameter > &  params,
const int  xCoord,
const int  yCoord = -1 
)

Definition at line 1462 of file NCFitter.cxx.

References f2, fParams, fShortParams, fVary, fXpos, fYpos, and minFinder.

01466     :fParams(p), fXpos(xcoord), fYpos(ycoord)
01467   {
01468     assert(fXpos < int(fParams.size()) && fYpos < int(fParams.size()));
01469 
01470     for(int n = 0; n < int(fParams.size()); ++n){
01471       if(n != fXpos && n != fYpos){
01472         fVary.push_back(n);
01473         fShortParams.push_back(fParams[n]);
01474       }
01475     }
01476 
01477     CoordInt fix;
01478     fix.resize(fParams.size());
01479     f2 = new FixVarsInt(f, fix, fVary);
01480 
01481     minFinder = new MinFinderSimpleInt(fShortParams, true, f2);
01482   }

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

Definition at line 303 of file NCFitter.h.

References f2, and minFinder.

00304     {
00305       delete minFinder;
00306       delete f2;
00307     }


Member Function Documentation

double NC::Fitter::MarginalizeSimpleInt::EvalAtEx ( const CoordInt r,
CoordInt ret 
) const [virtual]

Reimplemented from NC::Fitter::ICallableInt.

Definition at line 1486 of file NCFitter.cxx.

References f2, NC::Fitter::MinFinderSimpleInt::FindMin(), fParams, fXpos, fYpos, minFinder, NC::Fitter::FixVarsInt::SetFixed(), NC::Fitter::CoordBase< T >::x(), and NC::Fitter::CoordBase< T >::y().

01487   {
01488     CoordInt fix;
01489     fix.resize(fParams.size());
01490     fix[fXpos] = r.x();
01491     if(fYpos > -1) fix[fYpos] = r.y();
01492     f2->SetFixed(fix);
01493 
01494     return minFinder->FindMin(ret);
01495   }


Member Data Documentation

Definition at line 312 of file NCFitter.h.

Referenced by EvalAtEx(), MarginalizeSimpleInt(), and ~MarginalizeSimpleInt().

Definition at line 314 of file NCFitter.h.

Referenced by EvalAtEx(), and MarginalizeSimpleInt().

Definition at line 317 of file NCFitter.h.

Referenced by MarginalizeSimpleInt().

std::vector<int> NC::Fitter::MarginalizeSimpleInt::fToMin [private]

Definition at line 313 of file NCFitter.h.

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

Definition at line 316 of file NCFitter.h.

Referenced by MarginalizeSimpleInt().

Definition at line 315 of file NCFitter.h.

Referenced by EvalAtEx(), and MarginalizeSimpleInt().

Definition at line 315 of file NCFitter.h.

Referenced by EvalAtEx(), and MarginalizeSimpleInt().

Definition at line 311 of file NCFitter.h.

Referenced by EvalAtEx(), MarginalizeSimpleInt(), and ~MarginalizeSimpleInt().


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

Generated on 3 Dec 2018 for loon by  doxygen 1.6.1