Sync usage with man page.
[netbsd-mini2440.git] / gnu / lib / libg++ / g++-include / NegExp.h
blob21a1a18f233da8ca28f9b1d99f02f97e3b7a2b20
1 // This may look like C code, but it is really -*- C++ -*-
2 /*
3 Copyright (C) 1988 Free Software Foundation
4 written by Dirk Grunwald (grunwald@cs.uiuc.edu)
6 This file is part of GNU CC.
8 GNU CC is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY. No author or distributor
10 accepts responsibility to anyone for the consequences of using it
11 or for whether it serves any particular purpose or works at all,
12 unless he says so in writing. Refer to the GNU CC General Public
13 License for full details.
15 Everyone is granted permission to copy, modify and redistribute
16 GNU CC, but only under the conditions described in the
17 GNU CC General Public License. A copy of this license is
18 supposed to have been given to you along with GNU CC so you
19 can know your rights and responsibilities. It should be in a
20 file named COPYING. Among other things, the copyright notice
21 and this notice must be preserved on all copies.
23 #ifndef _NegativeExpntl_h
24 #ifdef __GNUG__
25 #pragma once
26 #pragma interface
27 #endif
28 #define _NegativeExpntl_h 1
32 // Negative Exponential Random Numbers
34 //
36 #include <Random.h>
38 class NegativeExpntl: public Random {
39 protected:
40 double pMean;
41 public:
42 NegativeExpntl(double xmean, RNG *gen);
43 double mean();
44 double mean(double x);
46 virtual double operator()();
49 #if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
51 inline NegativeExpntl::NegativeExpntl(double xmean, RNG *gen)
52 : (gen) {
53 pMean = xmean;
56 inline double NegativeExpntl::mean() { return pMean; }
57 inline double NegativeExpntl::mean(double x) {
58 double t = pMean; pMean = x;
59 return t;
62 #endif
63 #endif