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

NC::Fitter::PenalizerInt Class Reference

#include <NCFitter.h>

Inheritance diagram for NC::Fitter::PenalizerInt:

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

Public Member Functions

 PenalizerInt (ICallableInt *g, std::vector< NCParameter > ps)
virtual double EvalAt (const CoordInt &r) const

Protected Attributes

ICallableIntfFunc
std::vector< NCParameterfParams

Constructor & Destructor Documentation

NC::Fitter::PenalizerInt::PenalizerInt ICallableInt g,
std::vector< NCParameter ps
[inline]
 

Definition at line 83 of file NCFitter.h.

00084       : fFunc(g), fParams(ps){}


Member Function Documentation

double NC::Fitter::PenalizerInt::EvalAt const CoordInt r  )  const [virtual]
 

Reimplemented from NC::Fitter::ICallableInt.

Definition at line 110 of file NCFitter.cxx.

References NC::Fitter::CoordInt, NC::Fitter::ICallableInt::EvalAt(), fFunc, fParams, and SQR().

00111   {
00112     CoordInt reval = r;
00113 
00114     // If the point is outside the physical region - move it to the boundary
00115     for(unsigned int n = 0; n < fParams.size(); ++n){
00116       if(r[n] < 0) reval[n] = 0;
00117       if(r[n] > fParams[n].Steps()) reval[n] = fParams[n].Steps();
00118     }
00119 
00120     double ret = fFunc->EvalAt(reval);
00121 
00122     // If we had to move the point then apply a quadratic penalty term.
00123     // The factor of 1000 is fairly arbitrary.
00124     const double amplitude = 1e3;
00125     for(unsigned int n = 0; n < fParams.size(); ++n){
00126       const double wsqr = SQR(fParams[n].Steps());
00127       assert(wsqr);
00128       if(r[n] < 0)
00129         ret += amplitude*SQR(r[n])/wsqr;
00130       if(r[n] > fParams[n].Steps())
00131         ret += amplitude*SQR(r[n]-fParams[n].Steps())/wsqr;
00132     }
00133 
00134     return ret;
00135   }


Member Data Documentation

ICallableInt* NC::Fitter::PenalizerInt::fFunc [protected]
 

Definition at line 87 of file NCFitter.h.

Referenced by EvalAt().

std::vector<NCParameter> NC::Fitter::PenalizerInt::fParams [protected]
 

Definition at line 88 of file NCFitter.h.

Referenced by EvalAt().


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