Changeset 1053 in Sophya for trunk/SophyaLib/HiStats/histos.h
- Timestamp:
- Jun 30, 2000, 3:21:53 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/histos.h
r958 r1053 1 1 // This may look like C code, but it is really -*- C++ -*- 2 2 // 3 // $Id: histos.h,v 1. 6 2000-04-18 13:38:17ansari Exp $3 // $Id: histos.h,v 1.7 2000-06-30 13:21:53 ansari Exp $ 4 4 // 5 5 … … 50 50 Histo& operator += (double b); 51 51 Histo& operator -= (double b); 52 friend Histo operator * (const Histo& a, double b);53 friend Histo operator * (double b, const Histo& a);54 friend Histo operator / (const Histo& a, double b);55 friend Histo operator + (const Histo& a, double b);56 friend Histo operator + (double b, const Histo& a);57 friend Histo operator - (const Histo& a, double b);58 friend Histo operator - (double b, const Histo& a);59 52 Histo& operator += (const Histo& a); 60 53 Histo& operator -= (const Histo& a); 61 54 Histo& operator *= (const Histo& a); 62 55 Histo& operator /= (const Histo& a); 63 friend Histo operator + (const Histo& a, const Histo& b);64 friend Histo operator - (const Histo& a, const Histo& b);65 friend Histo operator * (const Histo& a, const Histo& b);66 friend Histo operator / (const Histo& a, const Histo& b);67 56 68 57 // get/put dans/depuis un vector … … 191 180 // ObjFileIO<Histo> 192 181 182 /*! \ingroup HiStats \fn operator*(const Histo&,double) 183 \brief Operateur H2 = H1 * b */ 184 inline Histo operator * (const Histo& a, double b) 185 { 186 Histo result(a); 187 return (result *= b); 188 } 189 190 /*! \ingroup HiStats \fn operator*(double,const Histo&) 191 \brief Operateur H2 = b * H1 */ 192 inline Histo operator * (double b, const Histo& a) 193 { 194 Histo result(a); 195 return (result *= b); 196 } 197 198 /*! \ingroup HiStats \fn operator/(const Histo&,double) 199 \brief Operateur H2 = H1 / b */ 200 inline Histo operator / (const Histo& a, double b) 201 { 202 Histo result(a); 203 return (result /= b); 204 } 205 206 /*! \ingroup HiStats \fn operator+(const Histo&,double) 207 \brief Operateur H2 = H1 + b */ 208 inline Histo operator + (const Histo& a, double b) 209 { 210 Histo result(a); 211 return (result += b); 212 } 213 214 /*! \ingroup HiStats \fn operator+(double,const Histo&) 215 \brief Operateur H2 = b + H1 */ 216 inline Histo operator + (double b, const Histo& a) 217 { 218 Histo result(a); 219 return (result += b); 220 } 221 222 /*! \ingroup HiStats \fn operator-(const Histo&,double) 223 \brief Operateur H2 = H1 - b */ 224 inline Histo operator - (const Histo& a, double b) 225 { 226 Histo result(a); 227 return (result -= b); 228 } 229 230 /*! \ingroup HiStats \fn operator-(double,const Histo&) 231 \brief Operateur H2 = b - H1 */ 232 inline Histo operator - (double b, const Histo& a) 233 { 234 Histo result(a); 235 result *= -1.; 236 return (result += b); 237 } 238 239 /*! \ingroup HiStats \fn operator+(const Histo&,const Histo&) 240 \brief Operateur H = H1 + H2 */ 241 inline Histo operator + (const Histo& a, const Histo& b) 242 { 243 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr); 244 Histo c(a); 245 return (c += b); 246 } 247 248 /*! \ingroup HiStats \fn operator-(const Histo&,const Histo&) 249 \brief Operateur H = H1 - H2 */ 250 inline Histo operator - (const Histo& a, const Histo& b) 251 { 252 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr); 253 Histo c(a); 254 return (c -= b); 255 } 256 257 /*! \ingroup HiStats \fn operator*(const Histo&,const Histo&) 258 \brief Operateur H = H1 * H2 */ 259 inline Histo operator * (const Histo& a, const Histo& b) 260 { 261 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr); 262 Histo c(a); 263 return (c *= b); 264 } 265 266 /*! \ingroup HiStats \fn operator/(const Histo&,const Histo&) 267 \brief Operateur H = H1 / H2 */ 268 inline Histo operator / (const Histo& a, const Histo& b) 269 { 270 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr); 271 Histo c(a); 272 return (c /= b); 273 } 193 274 194 275 } // Fin du namespace
Note:
See TracChangeset
for help on using the changeset viewer.