ImFusion SDK 4.3
ErrorFunction Class Referenceabstract

#include <ImFusion/Base/ErrorFunction.h>

Interface for an error function returning one or multiple values. More...

+ Inheritance diagram for ErrorFunction:

Detailed Description

Interface for an error function returning one or multiple values.

Public Member Functions

virtual void evaluateError (std::vector< double > &out)=0
 Evaluate the error function.
 
virtual double penalize (double cost, const std::vector< double > &error)
 Optionally override this method to penalize a cost function based on the error function result.
 

Static penalty tool methods that are useful elsewhere

static double errorToMultPenalty (double value, double range)
 There is a margin of half the range within which the returned penalty value fades from 1 to 0 with a polynomial function, and extents below zero after 1.5x range, and is continuous in the derivative.
 
static double errorsToMultPenalty (const std::vector< double > &error, const std::vector< double > &range)
 Return a number of error values to a combined penalty function, while properly housekeeping values < 0.
 

Member Function Documentation

◆ evaluateError()

virtual void evaluateError ( std::vector< double > & out)
pure virtual

Evaluate the error function.

An implementation of this method shall resize the out array and store some values in there, based on the most recent evaluation of a cost function associated with it.

Implemented in PointCorr, SweepGlobalInitAlgorithm, and SweepPointCorrAlgorithm.

◆ penalize()

virtual double penalize ( double cost,
const std::vector< double > & error )
inlinevirtual

Optionally override this method to penalize a cost function based on the error function result.

Reimplemented in SweepGlobalInitAlgorithm, and SweepPointCorrAlgorithm.

◆ errorToMultPenalty()

static double errorToMultPenalty ( double value,
double range )
static

There is a margin of half the range within which the returned penalty value fades from 1 to 0 with a polynomial function, and extents below zero after 1.5x range, and is continuous in the derivative.

Convert error value to a multiplicative penalty value, returning a value < 1 if the range is exceeded

◆ errorsToMultPenalty()

static double errorsToMultPenalty ( const std::vector< double > & error,
const std::vector< double > & range )
static

Return a number of error values to a combined penalty function, while properly housekeeping values < 0.

If one or more of the error values would result in a negative penalty, those values are added up and the remaining positive ones ignored; all positive ones are multiplied together.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close