Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

Pareto Class Reference

#include <newran.h>

Inheritance diagram for Pareto:

Inheritance graph
[legend]
Collaboration diagram for Pareto:

Collaboration graph
[legend]

Public Member Functions

char * Name ()
 Pareto (Real shape)
virtual ~Pareto ()
Real Next ()
ExtReal Mean () const
ExtReal Variance () const

Private Member Functions

void operator= (const Pareto &)

Private Attributes

Real Shape
Real RS

Constructor & Destructor Documentation

Pareto::Pareto Real  shape  ) 
 

Definition at line 392 of file newran.cpp.

References RS, and Shape.

00392                          : Shape(shape)
00393 {
00394    if (Shape <= 0) Throw(Logic_error("Newran: illegal parameter"));
00395    RS = -1.0 / Shape;
00396 }

virtual Pareto::~Pareto  )  [inline, virtual]
 

Definition at line 276 of file newran.h.

00276 {}


Member Function Documentation

ExtReal Pareto::Mean  )  const [virtual]
 

Reimplemented from Random.

Definition at line 401 of file newran.cpp.

References PlusInfinity, and Shape.

00402 {
00403    if (Shape > 1) return Shape/(Shape-1.0);
00404    else return PlusInfinity;
00405 }

char * Pareto::Name  )  [virtual]
 

Reimplemented from Random.

Definition at line 919 of file newran.cpp.

00919 { return "Pareto";           }

Real Pareto::Next  )  [virtual]
 

Reimplemented from Random.

Definition at line 398 of file newran.cpp.

References Random::Next(), Real, and RS.

00399 { return pow(Random::Next(), RS); }

void Pareto::operator= const Pareto  )  [inline, private]
 

Definition at line 270 of file newran.h.

00270 {}       // private so can't access

ExtReal Pareto::Variance  )  const [virtual]
 

Reimplemented from Random.

Definition at line 407 of file newran.cpp.

References PlusInfinity, Shape, and square().

00408 {
00409    if (Shape > 2) return Shape/(square(Shape-1.0))/(Shape-2.0);
00410    else return PlusInfinity;
00411 }


Field Documentation

Real Pareto::RS [private]
 

Definition at line 271 of file newran.h.

Referenced by Next(), and Pareto().

Real Pareto::Shape [private]
 

Definition at line 271 of file newran.h.

Referenced by Mean(), Pareto(), and Variance().


The documentation for this class was generated from the following files:
Generated on Fri Dec 5 04:06:29 2003 for Borqueror by doxygen 1.3.3