SourceXtractorPlusPlus  0.12
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
ModelFitting::AutoSharp Class Reference

#include <AutoSharp.h>

Inheritance diagram for ModelFitting::AutoSharp:
[legend]
Collaboration diagram for ModelFitting::AutoSharp:
[legend]

Public Member Functions

 AutoSharp (double log_incr=1.122, double first_r=1E-4, double tolerance=0.05, double min_sampling_factor=5.)
 
virtual ~AutoSharp ()
 
void updateRasterizationInfo (double scale, double r_max, Profile profile) override
 
bool insideSharpRegion (double r) override
 
std::pair< double, int > nextRadiusAndAngleNo (double prev_r) override
 
- Public Member Functions inherited from ModelFitting::SharpRegionManager
virtual ~SharpRegionManager ()=default
 

Private Attributes

double m_r_sharp {0.}
 
double m_max_step {0.}
 
double m_first_pix_r {0.}
 
double m_log_incr
 
double m_first_r
 
double m_tolerance
 
double m_min_sampling_factor
 

Additional Inherited Members

- Public Types inherited from ModelFitting::SharpRegionManager
using Profile = std::function< double(double)>
 

Detailed Description

AutoSharp decides the sharp region evaluating the function in steps until the relative error for the linear interpolation is below a given threshold

Definition at line 35 of file AutoSharp.h.

Constructor & Destructor Documentation

ModelFitting::AutoSharp::AutoSharp ( double  log_incr = 1.122,
double  first_r = 1E-4,
double  tolerance = 0.05,
double  min_sampling_factor = 5. 
)

Constructor

Parameters
log_incrIncrement multiplicative step
first_rFirst radius
toleranceThe sharp region finishes when the relative error between the function and its linear interpolation is below this limit
min_sampling_factorTake at least this many samples

Definition at line 29 of file AutoSharp.cpp.

ModelFitting::AutoSharp::~AutoSharp ( )
virtualdefault

Member Function Documentation

bool ModelFitting::AutoSharp::insideSharpRegion ( double  r)
overridevirtual
Parameters
rDistance to the origin of the function
Returns
True if the distance falls within the sharp region

Implements ModelFitting::SharpRegionManager.

Definition at line 52 of file AutoSharp.cpp.

References m_r_sharp.

std::pair< double, int > ModelFitting::AutoSharp::nextRadiusAndAngleNo ( double  prev_r)
overridevirtual

Computes the next sampling distance, and how many points around the circumference must be sampled at this distance.

Parameters
prev_rPrevious sampling distance. 0 for the first call.
Returns
A pair, where the first element is the distance from the center (radius), and the second is the number of sample points are to be taken: if, for instance, it were 4, then four samples must be taken at angles 0, pi/4, pi and pi*3/4

Implements ModelFitting::SharpRegionManager.

Definition at line 56 of file AutoSharp.cpp.

References std::ceil(), m_first_pix_r, m_first_r, m_log_incr, m_max_step, std::make_pair(), and std::min().

Here is the call graph for this function:

void ModelFitting::AutoSharp::updateRasterizationInfo ( double  scale,
double  r_max,
Profile  profile 
)
overridevirtual

The profile is used to find the sharp region, but without going further than r_max.

Implements ModelFitting::SharpRegionManager.

Definition at line 36 of file AutoSharp.cpp.

References m_first_pix_r, m_max_step, m_min_sampling_factor, m_r_sharp, m_tolerance, std::max(), and std::min().

Here is the call graph for this function:

Member Data Documentation

double ModelFitting::AutoSharp::m_first_pix_r {0.}
private

Definition at line 72 of file AutoSharp.h.

Referenced by nextRadiusAndAngleNo(), and updateRasterizationInfo().

double ModelFitting::AutoSharp::m_first_r
private

Definition at line 74 of file AutoSharp.h.

Referenced by nextRadiusAndAngleNo().

double ModelFitting::AutoSharp::m_log_incr
private

Definition at line 73 of file AutoSharp.h.

Referenced by nextRadiusAndAngleNo().

double ModelFitting::AutoSharp::m_max_step {0.}
private

Definition at line 71 of file AutoSharp.h.

Referenced by nextRadiusAndAngleNo(), and updateRasterizationInfo().

double ModelFitting::AutoSharp::m_min_sampling_factor
private

Definition at line 76 of file AutoSharp.h.

Referenced by updateRasterizationInfo().

double ModelFitting::AutoSharp::m_r_sharp {0.}
private

Definition at line 70 of file AutoSharp.h.

Referenced by insideSharpRegion(), and updateRasterizationInfo().

double ModelFitting::AutoSharp::m_tolerance
private

Definition at line 75 of file AutoSharp.h.

Referenced by updateRasterizationInfo().


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