Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::SpiralDistribution Class Reference

#include <SpiralDistribution.h>

Inheritance diagram for PLearn::SpiralDistribution:

Inheritance graph
[legend]
Collaboration diagram for PLearn::SpiralDistribution:

Collaboration graph
[legend]
List of all members.

Public Types

typedef UnconditionalDistribution inherited

Public Member Functions

 SpiralDistribution ()
virtual void build ()
 simply calls inherited::build() then build_()

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Transforms a shallow copy into a deep copy.

 PLEARN_DECLARE_OBJECT (SpiralDistribution)
void curve (real t, real &x, real &y) const
 computes (x,y) = ( lambda*sin(alpha*t), lambda*cos(alpha*t) )

virtual real log_density (const Vec &x) const
 return log of probability density log(p(x))

virtual real survival_fn (const Vec &x) const
 return survival fn = P(X>x)

virtual real cdf (const Vec &x) const
 return survival fn = P(X<x)

virtual void expectation (Vec &mu) const
 return E[X]

virtual void variance (Mat &cov) const
 return Var[X]

virtual void generate (Vec &x) const
 return a pseudo-random sample generated from the distribution.

virtual int inputsize () const
 inputsize is 2 (or 3 if include_t is set to true)

virtual void resetGenerator (long g_seed) const
 Resets the random number generator used by generate using the given seed.


Public Attributes

real lambda
real alpha
real tmin
real tmax
real sigma
real uniformity
bool include_t

Static Protected Member Functions

void declareOptions (OptionList &ol)
 Declares this class' options.


Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

typedef UnconditionalDistribution PLearn::SpiralDistribution::inherited
 

Reimplemented from PLearn::UnconditionalDistribution.

Definition at line 53 of file SpiralDistribution.h.


Constructor & Destructor Documentation

PLearn::SpiralDistribution::SpiralDistribution  ) 
 

Definition at line 47 of file SpiralDistribution.cc.


Member Function Documentation

void PLearn::SpiralDistribution::build  )  [virtual]
 

simply calls inherited::build() then build_()

Reimplemented from PLearn::UnconditionalDistribution.

Definition at line 91 of file SpiralDistribution.cc.

References build_().

void PLearn::SpiralDistribution::build_  )  [private]
 

This does the actual building.

Reimplemented from PLearn::UnconditionalDistribution.

Definition at line 79 of file SpiralDistribution.cc.

Referenced by build().

real PLearn::SpiralDistribution::cdf const Vec x  )  const [virtual]
 

return survival fn = P(X<x)

Reimplemented from PLearn::PDistribution.

Definition at line 117 of file SpiralDistribution.cc.

References PLERROR.

void PLearn::SpiralDistribution::curve real  t,
real x,
real y
const
 

computes (x,y) = ( lambda*sin(alpha*t), lambda*cos(alpha*t) )

Definition at line 126 of file SpiralDistribution.cc.

References alpha, lambda, and x.

Referenced by generate().

void PLearn::SpiralDistribution::declareOptions OptionList ol  )  [static, protected]
 

Declares this class' options.

Reimplemented from PLearn::UnconditionalDistribution.

Definition at line 65 of file SpiralDistribution.cc.

References PLearn::declareOption(), and PLearn::OptionList.

void PLearn::SpiralDistribution::expectation Vec mu  )  const [virtual]
 

return E[X]

Reimplemented from PLearn::PDistribution.

Definition at line 120 of file SpiralDistribution.cc.

References PLERROR.

void PLearn::SpiralDistribution::generate Vec x  )  const [virtual]
 

return a pseudo-random sample generated from the distribution.

Reimplemented from PLearn::PDistribution.

Definition at line 132 of file SpiralDistribution.cc.

References PLearn::bounded_uniform(), curve(), PLearn::gaussian_mu_sigma(), inputsize(), PLearn::pow(), PLearn::TVec< T >::resize(), sigma, tmax, tmin, uniformity, and x.

int PLearn::SpiralDistribution::inputsize  )  const [virtual]
 

inputsize is 2 (or 3 if include_t is set to true)

Reimplemented from PLearn::PLearner.

Definition at line 154 of file SpiralDistribution.cc.

References include_t.

Referenced by generate().

real PLearn::SpiralDistribution::log_density const Vec x  )  const [virtual]
 

return log of probability density log(p(x))

Reimplemented from PLearn::PDistribution.

Definition at line 111 of file SpiralDistribution.cc.

References PLERROR, and PLearn::Vec.

void PLearn::SpiralDistribution::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::UnconditionalDistribution.

Definition at line 97 of file SpiralDistribution.cc.

References PLERROR.

PLearn::SpiralDistribution::PLEARN_DECLARE_OBJECT SpiralDistribution   ) 
 

void PLearn::SpiralDistribution::resetGenerator long  g_seed  )  const [virtual]
 

Resets the random number generator used by generate using the given seed.

Reimplemented from PLearn::PDistribution.

Definition at line 157 of file SpiralDistribution.cc.

References PLearn::manual_seed().

real PLearn::SpiralDistribution::survival_fn const Vec x  )  const [virtual]
 

return survival fn = P(X>x)

Reimplemented from PLearn::PDistribution.

Definition at line 114 of file SpiralDistribution.cc.

References PLERROR.

void PLearn::SpiralDistribution::variance Mat cov  )  const [virtual]
 

return Var[X]

Reimplemented from PLearn::PDistribution.

Definition at line 123 of file SpiralDistribution.cc.

References PLearn::Mat, and PLERROR.


Member Data Documentation

real PLearn::SpiralDistribution::alpha
 

Definition at line 62 of file SpiralDistribution.h.

Referenced by curve().

bool PLearn::SpiralDistribution::include_t
 

Definition at line 67 of file SpiralDistribution.h.

Referenced by inputsize().

real PLearn::SpiralDistribution::lambda
 

Definition at line 61 of file SpiralDistribution.h.

Referenced by curve().

real PLearn::SpiralDistribution::sigma
 

Definition at line 65 of file SpiralDistribution.h.

Referenced by generate().

real PLearn::SpiralDistribution::tmax
 

Definition at line 64 of file SpiralDistribution.h.

Referenced by generate().

real PLearn::SpiralDistribution::tmin
 

Definition at line 63 of file SpiralDistribution.h.

Referenced by generate().

real PLearn::SpiralDistribution::uniformity
 

Definition at line 66 of file SpiralDistribution.h.

Referenced by generate().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:27:20 2004 for PLearn by doxygen 1.3.7