Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

NC::Fitter::ConstrainRange Class Reference

This class supports the function flipping in MinFinderSimple. More...

#include <NCFitter.h>

Inheritance diagram for NC::Fitter::ConstrainRange:

NC::Fitter::ICallableND List of all members.

Public Member Functions

 ConstrainRange (const ICallableND *f, int pn, double min, double max)
virtual double EvalAtEx (const CoordNDim &r, CoordNDim *ret) const
 Find the value of the function and return additional information.

Protected Attributes

const ICallableNDfFunc
int fParamNum
double fMin
double fMax

Detailed Description

This class supports the function flipping in MinFinderSimple.

I am aware that a similar penalizing scheme is implemented elsewhere. Hopefully this construct is only temporary.

Definition at line 40 of file NCFitter.h.


Constructor & Destructor Documentation

NC::Fitter::ConstrainRange::ConstrainRange const ICallableND f,
int  pn,
double  min,
double  max
[inline]
 

Definition at line 43 of file NCFitter.h.

References max, and min.

00044       : fFunc(f), fParamNum(pn), fMin(min), fMax(max){}


Member Function Documentation

double NC::Fitter::ConstrainRange::EvalAtEx const CoordNDim r,
CoordNDim ret
const [virtual]
 

Find the value of the function and return additional information.

Parameters:
r Coordinate at which to evaluate the function
[out] ret Return additional information. By convention, the true underlying coordinates evaluated.
Returns:
Value of the function at the point r
Implementations must be prepared for ret to be null

Todo:
Rename to just EvalAt

Implements NC::Fitter::ICallableND.

Definition at line 1403 of file NCFitter.cxx.

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

01404   {
01405     CoordNDim r2 = r;
01406     double pen = 0;
01407     if(r2[fParamNum] > fMax){
01408       // TODO - there should be some scaling based on the width,
01409       // but we happen to know all these variables are approx 0-1
01410       pen += 1e3*(r2[fParamNum]-fMax)*(r2[fParamNum]-fMax);
01411       r2[fParamNum] = fMax;
01412     }
01413     if(r2[fParamNum] < fMin){
01414       pen += 1e3*(r2[fParamNum]-fMin)*(r2[fParamNum]-fMin);
01415       r2[fParamNum] = fMin;
01416     }
01417     return fFunc->EvalAtEx(r2, ret)+pen;
01418   }


Member Data Documentation

const ICallableND* NC::Fitter::ConstrainRange::fFunc [protected]
 

Definition at line 47 of file NCFitter.h.

Referenced by EvalAtEx().

double NC::Fitter::ConstrainRange::fMax [protected]
 

Definition at line 49 of file NCFitter.h.

double NC::Fitter::ConstrainRange::fMin [protected]
 

Definition at line 49 of file NCFitter.h.

int NC::Fitter::ConstrainRange::fParamNum [protected]
 

Definition at line 48 of file NCFitter.h.


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:39 2010 for loon by  doxygen 1.3.9.1