00001 /// 00002 /// \file ratio.h 00003 /// \brief Provides a simple ratio class. 00004 /// 00005 /// \author Kent Holsinger 00006 /// \date 2004-06-26 00007 /// 00008 00009 // This file is part of MCMC++, a library for constructing C++ programs 00010 // that implement MCMC analyses of Bayesian statistical models. 00011 // Copyright (c) 2004-2006 Kent E. Holsinger 00012 // 00013 // MCMC++ is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU General Public License as published by 00015 // the Free Software Foundation; either version 2 of the License, or 00016 // (at your option) any later version. 00017 // 00018 // MCMC++ is distributed in the hope that it will be useful, 00019 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 // GNU General Public License for more details. 00022 // 00023 // You should have received a copy of the GNU General Public License 00024 // along with MCMC++; if not, write to the Free Software 00025 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00026 // 00027 00028 #if !defined(__RATIO_H) 00029 #define __RATIO_H 00030 00031 // local includes 00032 #include "mcmc++/util.h" 00033 00034 class ratio { 00035 public: 00036 ratio(void); 00037 ratio(const ratio& r); 00038 00039 ratio& operator +=(const ratio& r); 00040 ratio& operator +=(const double d); 00041 ratio& operator /=(const ratio& r); 00042 ratio& operator /=(double d); 00043 ratio& operator =(const ratio& r); 00044 bool operator ==(const ratio& r) const; 00045 bool operator !=(const ratio& r) const; 00046 00047 double make_double(void) const; 00048 double Top(void) const; 00049 double Bottom(void) const; 00050 00051 private: 00052 double top_; 00053 double bottom_; 00054 00055 }; 00056 00057 00058 #endif 00059 00060 // Local Variables: // 00061 // mode: c++ // 00062 // End: //
1.5.1