Structural deformable models
Public Member Functions | Protected Attributes | List of all members
EMDGauss Class Reference

#include <ExpMap.h>

Inheritance diagram for EMDGauss:
Inheritance graph
[legend]
Collaboration diagram for EMDGauss:
Collaboration graph
[legend]

Public Member Functions

 EMDGauss (const PropVec &avg=PropVec(0.f), const PropVec &stdev=PropVec(1.f))
 
virtual ~EMDGauss ()
 
virtual EMDistributioncopy () const
 
PropVec getPropVec () const
 
float ratePropVec (const PropVec &prop, Winner *winner=NULL) const
 
void setAvg (const PropVec &avg)
 
void setStdev (const PropVec &stdev)
 
- Public Member Functions inherited from EMDistribution
 EMDistribution ()
 
virtual ~EMDistribution ()
 
virtual void setIntegral (float integral)
 
void setCreator (const Winner &creator)
 
void setShootCount (dword scount)
 
dword getShootCount () const
 
bool hasFlags (dword flags) const
 
void setFlags (dword flags)
 
void unsetFlags (dword flags=0xffffffff)
 

Protected Attributes

PropVec m_Avg
 
PropVec m_Stdev
 
PropVec m_StdevRate
 

Additional Inherited Members

- Public Types inherited from EMDistribution
enum  EDFlags { ED_NONE =0, ED_OLD =1 }
 
- Public Attributes inherited from EMDistribution
float m_Integral
 
Winner m_Creator
 
dword m_ShootCount
 
dword m_Flags
 

Detailed Description

Definition at line 93 of file ExpMap.h.

Constructor & Destructor Documentation

EMDGauss::EMDGauss ( const PropVec avg = PropVec(0.f),
const PropVec stdev = PropVec(1.f) 
)
inline

Definition at line 95 of file ExpMap.h.

References dmutil::stdev().

97  : m_Avg(avg) { setStdev(stdev); }
void setStdev(const PropVec &stdev)
Definition: ExpMap.cpp:235
PropVec m_Avg
Definition: ExpMap.h:106
virtual EMDGauss::~EMDGauss ( )
inlinevirtual

Definition at line 98 of file ExpMap.h.

98 {};

Member Function Documentation

virtual EMDistribution* EMDGauss::copy ( ) const
inlinevirtual

Reimplemented from EMDistribution.

Definition at line 99 of file ExpMap.h.

References NULL.

100  { return (EMDistribution*) (new EMDGauss(*this)); }
EMDGauss(const PropVec &avg=PropVec(0.f), const PropVec &stdev=PropVec(1.f))
Definition: ExpMap.h:95
PropVec EMDGauss::getPropVec ( ) const
virtual

Reimplemented from EMDistribution.

Definition at line 222 of file ExpMap.cpp.

References fgauss01(), and VVector< T, D >::size().

223 {
224  PropVec pv;
225  for(unsigned int i=0; i<PropVec::size(); i++)
226  pv[i] = fgauss01()*m_Stdev[i] + m_Avg[i];
227  return pv;
228 }
PropVec m_Stdev
Definition: ExpMap.h:106
PropVec m_Avg
Definition: ExpMap.h:106
float fgauss01()
Definition: mathutil.h:53
static unsigned int size()
Definition: VVector.h:41
float EMDGauss::ratePropVec ( const PropVec prop,
Winner winner = NULL 
) const
virtual

Reimplemented from EMDistribution.

Definition at line 230 of file ExpMap.cpp.

References gauss2(), and M_SQRT2PI.

Referenced by main().

231 {
232  return gauss2(((prop-m_Avg)/=m_StdevRate).norm2(),1)*M_SQRT2PI;
233 }
PropVec m_StdevRate
Definition: ExpMap.h:106
float gauss2(float x2, float stdev)
Definition: mathutil.h:71
PropVec m_Avg
Definition: ExpMap.h:106
#define M_SQRT2PI
Definition: mathutil.h:18
void EMDGauss::setAvg ( const PropVec avg)
inline

Definition at line 103 of file ExpMap.h.

References dmutil::avg(), and dmutil::stdev().

103 { m_Avg = avg; }
PropVec m_Avg
Definition: ExpMap.h:106
DMatrix< T > avg(const DMatrix< T > &mat)
Definition: DMatrixUtil.h:90
void EMDGauss::setStdev ( const PropVec stdev)

Definition at line 235 of file ExpMap.cpp.

References VVector< T, D >::size(), and dmutil::stdev().

236 {
237  m_Stdev = stdev;
238  for(dword i = 0; i<stdev.size(); i++) {
239  if(stdev[i]>0.0001) m_StdevRate[i] = stdev[i];
240  else m_StdevRate[i] = std::numeric_limits<float>::max();
241  }
242 }
PropVec m_StdevRate
Definition: ExpMap.h:106
PropVec m_Stdev
Definition: ExpMap.h:106
unsigned long dword
Definition: simpletypes.h:6
DMatrix< T > stdev(const DMatrix< T > &mat)
Definition: DMatrixUtil.h:106
static unsigned int size()
Definition: VVector.h:41

Member Data Documentation

PropVec EMDGauss::m_Avg
protected

Definition at line 106 of file ExpMap.h.

PropVec EMDGauss::m_Stdev
protected

Definition at line 106 of file ExpMap.h.

PropVec EMDGauss::m_StdevRate
protected

Definition at line 106 of file ExpMap.h.


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