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

#include <ExpMap.h>

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

Public Member Functions

 EMDRect (const PropVec &lb=PropVec(0.f), const PropVec &ub=PropVec(1.f))
 
virtual ~EMDRect ()
 
virtual EMDistributioncopy () const
 
PropVec getPropVec () const
 
float ratePropVec (const PropVec &prop, Winner *winner=NULL) const
 
PropVecclamp (PropVec &v)
 
const PropVecgetUB () const
 
const PropVecgetLB () const
 
void setUB (const PropVec &ub)
 
void setLB (const PropVec &lb)
 
- 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)
 

Public Attributes

PropVec m_LB
 
PropVec m_UB
 
- Public Attributes inherited from EMDistribution
float m_Integral
 
Winner m_Creator
 
dword m_ShootCount
 
dword m_Flags
 

Additional Inherited Members

- Public Types inherited from EMDistribution
enum  EDFlags { ED_NONE =0, ED_OLD =1 }
 

Detailed Description

Definition at line 73 of file ExpMap.h.

Constructor & Destructor Documentation

EMDRect::EMDRect ( const PropVec lb = PropVec(0.f),
const PropVec ub = PropVec(1.f) 
)
inline

Definition at line 75 of file ExpMap.h.

77  : m_LB(lb), m_UB(ub)
78  {}
PropVec m_UB
Definition: ExpMap.h:90
PropVec m_LB
Definition: ExpMap.h:90
virtual EMDRect::~EMDRect ( )
inlinevirtual

Definition at line 79 of file ExpMap.h.

79 {}

Member Function Documentation

PropVec& EMDRect::clamp ( PropVec v)
inline

Definition at line 84 of file ExpMap.h.

References VVector< T, D >::clamp().

84 { return v.clamp(m_LB, m_UB); }
VT & clamp(const VT &lb, const VT &ub)
Definition: VVector.h:253
PropVec m_UB
Definition: ExpMap.h:90
PropVec m_LB
Definition: ExpMap.h:90
virtual EMDistribution* EMDRect::copy ( ) const
inlinevirtual

Reimplemented from EMDistribution.

Reimplemented in ExpectationMap.

Definition at line 80 of file ExpMap.h.

References NULL.

81  { return (EMDistribution*) (new EMDRect(*this)); }
EMDRect(const PropVec &lb=PropVec(0.f), const PropVec &ub=PropVec(1.f))
Definition: ExpMap.h:75
const PropVec& EMDRect::getLB ( ) const
inline

Definition at line 86 of file ExpMap.h.

Referenced by MStructure::addExpectation(), Searcher::setExpectationMap(), and Brain::setupSearch().

86 { return m_LB; }
PropVec m_LB
Definition: ExpMap.h:90
PropVec EMDRect::getPropVec ( ) const
virtual

Reimplemented from EMDistribution.

Reimplemented in ExpectationMap.

Definition at line 205 of file ExpMap.cpp.

References frand, m_LB, m_UB, and VVector< T, D >::size().

206 {
207  PropVec pv;
208  for(unsigned int i=0; i<PropVec::size(); i++)
209  pv[i] = frand(m_UB[i]-m_LB[i])+m_LB[i];
210  return pv;
211 }
#define frand(max)
Definition: mathutil.h:48
PropVec m_UB
Definition: ExpMap.h:90
PropVec m_LB
Definition: ExpMap.h:90
static unsigned int size()
Definition: VVector.h:41
const PropVec& EMDRect::getUB ( ) const
inline

Definition at line 85 of file ExpMap.h.

Referenced by MStructure::addExpectation(), Searcher::setExpectationMap(), and Brain::setupSearch().

85 { return m_UB; }
PropVec m_UB
Definition: ExpMap.h:90
float EMDRect::ratePropVec ( const PropVec prop,
Winner winner = NULL 
) const
virtual

Reimplemented from EMDistribution.

Reimplemented in ExpectationMap.

Definition at line 213 of file ExpMap.cpp.

References VVector< T, D >::clamp(), m_LB, and m_UB.

Referenced by main(), and ExpectationMap::ratePropVec().

214 {
215  PropVec clampvec(prop);
216  clampvec.clamp(m_LB, m_UB);
217  if((clampvec-prop).norm2() < 0.0001) return 1;
218  else return 0;
219 }
PropVec m_UB
Definition: ExpMap.h:90
PropVec m_LB
Definition: ExpMap.h:90
void EMDRect::setLB ( const PropVec lb)
inline
void EMDRect::setUB ( const PropVec ub)
inline

Member Data Documentation

PropVec EMDRect::m_LB
PropVec EMDRect::m_UB

Definition at line 90 of file ExpMap.h.

Referenced by getPropVec(), ExpectationMap::getPropVec(), and ratePropVec().


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