Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

probability/SUniformDist.h

Go to the documentation of this file.
00001 /* #start# ***********************************************************
00002 
00003            Scheduling Simulator
00004         Lehrstuhl f"ur Effiziente Algorithmen
00005            Technische Universit"at M"unchen
00006 
00007  File    : $Id: SUniformDist.h,v 1.2 2003/03/12 17:19:59 taeubig Exp $
00008 
00009  Purpose : uniform probability distributions on an interval
00010 
00011  * #end# ************************************************************* */
00012 
00013 #ifndef SUNIFORMDIST_H
00014 #define SUNIFORMDIST_H
00015 
00016 #include <cassert>
00017 
00018 #include "SProbabilityDist.h"
00019 
00022 class SUniformDist : public SProbabilityDist {
00023 public:
00029   SUniformDist(double left, double right) : _l(left), _r(right)
00030     { assert(_l <= _r); };
00031 
00034   SUniformDist(const SUniformDist& rU) { _l = rU._l; _r = rU._r; }
00035   
00040   virtual double getValue();
00041   
00045   virtual Type getType() const {
00046     if (_r == _l )
00047       return CONST;
00048     else
00049       return UNIFORM;
00050   };
00051 
00052   virtual double getExpectation() const;
00053 
00054   double getLower() const { return _l; };
00055   double getUpper() const { return _r; };
00056   void setBounds(const double &left, const double &right);
00057 
00058 protected:
00060   double _l;
00061   double _r;
00062 };
00063 
00064 #endif // SUNIFORMDIST_H

Generated on Thu May 22 16:48:09 2003 for Sketch-it! by doxygen1.2.18