MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes
MFM::MDist< R > Class Template Reference

#include <MDist.h>

Public Member Functions

void FillRandomSingleDir (SPoint &pt, Random &random) const
 
u32 GetTableSize (u32 maxRadius) const
 
u32 GetFirstIndex (const u32 radius) const
 
u32 GetLastIndex (const u32 radius) const
 
const SPointGetPoint (const u32 index) const
 
s32 FromPoint (const Point< s32 > &offset, u32 radius) const
 
void FillFromBits (SPoint &pt, u8 bits, u32 maxRadius)
 

Static Public Member Functions

static MDist< R > & get ()
 

Static Public Attributes

static const u32 EVENT_WINDOW_DIAMETER = R*2+1
 

Detailed Description

template<u32 R>
class MFM::MDist< R >

A singleton class consisting of many utilities used for calculating Manhattan Distances.

Member Function Documentation

template<u32 R>
void MFM::MDist< R >::FillRandomSingleDir ( SPoint pt,
Random random 
) const

Fills a given SPoint with a random Von Neumann unit vector.

Parameters
ptThe SPoint to fill with a random Von Neumann unit vector.
randomThe PRNG used to determine which unit vector to fill pt with.
template<u32 R>
s32 MFM::MDist< R >::FromPoint ( const Point< s32 > &  offset,
u32  radius 
) const

Return the coding of offset as a bond if possible. Returns -1 if the given offset cannot be expressed as a max length radius bond.

template<u32 R>
MDist< R > & MFM::MDist< R >::get ( )
static

Access the singleton MDist of any given size.

template<u32 R>
u32 MFM::MDist< R >::GetFirstIndex ( const u32  radius) const
inline

Get the lowest index corresponding to a distance of radius. Useful for starting an event window iteration at a given distance

Parameters
radiusThe radius to find the lowest index of.
See Also
GetLastIndex
GetPoint
template<u32 R>
u32 MFM::MDist< R >::GetLastIndex ( const u32  radius) const
inline

Get the highest index corresponding to a distance of radius. Useful for ending an event window iteration at a given distance

Parameters
radiusThe radius to find the highest index of.
See Also
GetFirstIndex
GetPointIndex
template<u32 R>
u32 MFM::MDist< R >::GetTableSize ( u32  maxRadius) const

Gets the area of a Manhattan Distance circle of a given radius .

Parameters
maxRadiusThe radius of the Manhattan Distance circle to examine.

Field Documentation

template<u32 R>
const u32 MFM::MDist< R >::EVENT_WINDOW_DIAMETER = R*2+1
static

The diameter of an EventWindow of Radius R .


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