PDBlob Class Reference

#include <pDomain.h>

Inheritance diagram for PDBlob:

Inheritance graph
[legend]
Collaboration diagram for PDBlob:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 PDBlob (const pVec &ctr0, const float stdev0)
 ~PDBlob ()
bool Within (const pVec &pos) const
pVec Generate () const
pDomaincopy () const

Public Attributes

pVec ctr
float stdev
float Scale1
float Scale2


Detailed Description

Definition at line 530 of file pDomain.h.


Constructor & Destructor Documentation

PDBlob::PDBlob ( const pVec ctr0,
const float  stdev0 
) [inline]

Definition at line 537 of file pDomain.h.

References ctr, fsqr(), P_ONEOVERSQRT2PI, Scale1, Scale2, and stdev.

Referenced by copy().

00538     {
00539         ctr = ctr0;
00540         stdev = stdev0;
00541         float oneOverSigma = 1.0f/(stdev+0.000000000001f);
00542         Scale1 = -0.5f*fsqr(oneOverSigma);
00543         Scale2 = P_ONEOVERSQRT2PI * oneOverSigma;
00544     }

Here is the call graph for this function:

Here is the caller graph for this function:

PDBlob::~PDBlob (  )  [inline]

Definition at line 546 of file pDomain.h.

00547     {
00548     }


Member Function Documentation

bool PDBlob::Within ( const pVec pos  )  const [inline, virtual]

Implements pDomain.

Definition at line 550 of file pDomain.h.

References ctr, expf(), pVec::length2(), pRandf, Scale1, Scale2, and x.

00551     {
00552         pVec x = pos - ctr;
00553         // return exp(-0.5 * xSq * Sqr(oneOverSigma)) * P_ONEOVERSQRT2PI * oneOverSigma;
00554         float Gx = expf(x.length2() * Scale1) * Scale2;
00555         return (pRandf() < Gx);
00556     }

Here is the call graph for this function:

pVec PDBlob::Generate (  )  const [inline, virtual]

Implements pDomain.

Definition at line 558 of file pDomain.h.

References ctr, pNRandVec(), and stdev.

00559     {
00560         return ctr + pNRandVec(stdev);
00561     }

Here is the call graph for this function:

pDomain* PDBlob::copy (  )  const [inline, virtual]

Implements pDomain.

Definition at line 563 of file pDomain.h.

References PDBlob().

00564     {
00565         PDBlob *P = new PDBlob(*this);
00566         return P;
00567     }

Here is the call graph for this function:


Member Data Documentation

pVec PDBlob::ctr

Definition at line 533 of file pDomain.h.

Referenced by Generate(), PDBlob(), and Within().

float PDBlob::stdev

Definition at line 534 of file pDomain.h.

Referenced by Generate(), and PDBlob().

float PDBlob::Scale1

Definition at line 534 of file pDomain.h.

Referenced by PDBlob(), and Within().

float PDBlob::Scale2

Definition at line 534 of file pDomain.h.

Referenced by PDBlob(), and Within().


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:51:37 2008 for Armagetron Advanced by  doxygen 1.5.4