ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::GenericDistribution Class Referenceabstract

A generic class to handle a probability distribution. More...

#include <GenericDistribution.h>

Inheritance diagram for cloudViewer::GenericDistribution:

Public Types

using ScalarContainer = std::vector< ScalarType >
 Scalar values container. More...
 

Public Member Functions

 GenericDistribution ()
 Default constructor. More...
 
virtual ~GenericDistribution ()=default
 Default destructor. More...
 
virtual const char * getName () const =0
 Returns distribution name. More...
 
virtual bool isValid () const
 Indicates if the distribution parameters are valid. More...
 
virtual bool computeParameters (const ScalarContainer &values)=0
 Computes the distribution parameters from a set of values. More...
 
virtual double computeP (ScalarType x) const =0
 Computes the probability of x. More...
 
virtual double computePfromZero (ScalarType x) const =0
 Computes the cumulative probability between 0 and x. More...
 
virtual double computeP (ScalarType x1, ScalarType x2) const =0
 Computes the cumulative probability between x1 and x2. More...
 
virtual double computeChi2Dist (const GenericCloud *Yk, unsigned numberOfClasses, int *histo=nullptr)=0
 Computes the Chi2 distance (related to the Chi2 Test) More...
 

Protected Member Functions

void setValid (bool state)
 Sets distribution current validity. More...
 

Protected Attributes

bool m_isValid
 Whether the distribution is in a valid state or not. More...
 

Detailed Description

A generic class to handle a probability distribution.

Custom parametric distributions can be implemented through this interface and used for filtering data (see StatisticalTestingTools).

Definition at line 25 of file GenericDistribution.h.

Member Typedef Documentation

◆ ScalarContainer

using cloudViewer::GenericDistribution::ScalarContainer = std::vector<ScalarType>

Scalar values container.

Definition at line 46 of file GenericDistribution.h.

Constructor & Destructor Documentation

◆ GenericDistribution()

cloudViewer::GenericDistribution::GenericDistribution ( )
inline

Default constructor.

Definition at line 28 of file GenericDistribution.h.

◆ ~GenericDistribution()

virtual cloudViewer::GenericDistribution::~GenericDistribution ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ computeChi2Dist()

virtual double cloudViewer::GenericDistribution::computeChi2Dist ( const GenericCloud Yk,
unsigned  numberOfClasses,
int *  histo = nullptr 
)
pure virtual

Computes the Chi2 distance (related to the Chi2 Test)

Computes the Chi2 distance from a group of point, accordingly to a certain number of classes (see Chi2 test theory for more information). The result of projecting each point (or more precisely each scalar value associated to each point) in the different classes can be stored in an array (of the same size as the number of classes). To do so, such an array (already allocated in memory) should be passed as an argument. Warning: be sure to activate an OUTPUT scalar field on the input cloud

Parameters
Yka group of points
numberOfClassesthe number of classes for the Chi2 Test
histoan array to store the values projection result (optional)
Returns
the Chi2 distance (or -1.0 if an error occurred)

Implemented in cloudViewer::NormalDistribution, and cloudViewer::WeibullDistribution.

Referenced by define_GenericDistribution().

◆ computeP() [1/2]

virtual double cloudViewer::GenericDistribution::computeP ( ScalarType  x) const
pure virtual

Computes the probability of x.

Parameters
xthe variable
Returns
the probabilty

Implemented in cloudViewer::WeibullDistribution, and cloudViewer::NormalDistribution.

Referenced by define_GenericDistribution().

◆ computeP() [2/2]

virtual double cloudViewer::GenericDistribution::computeP ( ScalarType  x1,
ScalarType  x2 
) const
pure virtual

Computes the cumulative probability between x1 and x2.

x1 should be lower than x2

Parameters
x1the lower boundary
x2the upper boundary
Returns
the cumulative probabilty

Implemented in cloudViewer::WeibullDistribution, and cloudViewer::NormalDistribution.

◆ computeParameters()

virtual bool cloudViewer::GenericDistribution::computeParameters ( const ScalarContainer values)
pure virtual

Computes the distribution parameters from a set of values.

Parameters
valuesa set of scalar values
Returns
true (if the computation succeeded) or false (if not)

Implemented in cloudViewer::WeibullDistribution, and cloudViewer::NormalDistribution.

Referenced by ccEntityAction::computeStatParams(), and define_GenericDistribution().

◆ computePfromZero()

virtual double cloudViewer::GenericDistribution::computePfromZero ( ScalarType  x) const
pure virtual

Computes the cumulative probability between 0 and x.

Parameters
xthe upper boundary
Returns
the cumulative probabilty

Implemented in cloudViewer::WeibullDistribution, and cloudViewer::NormalDistribution.

Referenced by cloudViewer::StatisticalTestingTools::computeAdaptativeChi2Dist(), and define_GenericDistribution().

◆ getName()

◆ isValid()

virtual bool cloudViewer::GenericDistribution::isValid ( ) const
inlinevirtual

◆ setValid()

Member Data Documentation

◆ m_isValid

bool cloudViewer::GenericDistribution::m_isValid
protected

Whether the distribution is in a valid state or not.

Definition at line 96 of file GenericDistribution.h.


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