Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __BFL_CONSTANTS_H__
00019 #define __BFL_CONSTANTS_H__
00020
00021 #define NUMERIC_PRECISION 0.000000001
00022
00023 #pragma warning( disable : 4996)
00024
00025 #ifndef M_PI
00026 #define M_PI 3.141592653589793284626433832795
00027 #endif
00028
00029
00030
00031 #include <iostream>
00032 #include <cmath>
00033 #include <cassert>
00034
00035 namespace BFL
00036 {
00037 using namespace std;
00039 class Probability
00040 {
00041 public:
00042 Probability(){};
00043 Probability(double p)
00044 {
00045 #ifndef _MSC_VER
00046 assert(std::isfinite(p) != 0);
00047 #endif
00048 assert( p >= 0 );
00049 _prob = p;
00050 };
00051 virtual ~Probability(){};
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 friend ostream & operator<< (ostream & stream,Probability& prob);
00068
00069 friend istream & operator>> (istream & stream,Probability& prob);
00070
00071 double getValue() const { return _prob;} ;
00072
00073 operator double(){return _prob;};
00074 Probability operator *(Probability p)
00075 { return ((Probability) (this->_prob * (double) p));};
00076 Probability operator /(Probability p)
00077 { return ((Probability) (this->_prob / (double) p));};
00078
00079
00080 private:
00081 double _prob;
00082 };
00083
00084 }
00085
00100 #endif
00101
00102
bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Sun Oct 5 2014 22:29:52