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 double& getValue() { return _prob;} ;
00073
00074 operator double(){return _prob;};
00075 Probability operator *(Probability p)
00076 { return ((Probability) (this->_prob * (double) p));};
00077 Probability operator /(Probability p)
00078 { return ((Probability) (this->_prob / (double) p));};
00079
00080
00081 private:
00082 double _prob;
00083 };
00084
00085 }
00086
00101 #endif
00102
00103
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 Mon Feb 11 2019 03:45:12