Changeset 1053 in Sophya for trunk/SophyaLib/HiStats/histos2.h


Ignore:
Timestamp:
Jun 30, 2000, 3:21:53 PM (25 years ago)
Author:
ansari
Message:

les friend operator ne marche plus ? passage en inline cmv 30/06/00

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/HiStats/histos2.h

    r958 r1053  
    4747  Histo2D& operator += (double b);
    4848  Histo2D& operator -= (double b);
    49   friend Histo2D operator * (const Histo2D& a, double b);
    50   friend Histo2D operator * (double b, const Histo2D& a);
    51   friend Histo2D operator / (const Histo2D& a, double b);
    52   friend Histo2D operator + (const Histo2D& a, double b);
    53   friend Histo2D operator + (double b, const Histo2D& a);
    54   friend Histo2D operator - (const Histo2D& a, double b);
    55   friend Histo2D operator - (double b, const Histo2D& a);
    5649  Histo2D& operator += (const Histo2D& a);
    5750  Histo2D& operator -= (const Histo2D& a);
    5851  Histo2D& operator *= (const Histo2D& a);
    5952  Histo2D& operator /= (const Histo2D& a);
    60   friend Histo2D operator + (const Histo2D& a, const Histo2D& b);
    61   friend Histo2D operator - (const Histo2D& a, const Histo2D& b);
    62   friend Histo2D operator * (const Histo2D& a, const Histo2D& b);
    63   friend Histo2D operator / (const Histo2D& a, const Histo2D& b);
    6453
    6554  // get/put dans/depuis une matrice / vector
     
    261250// ObjFileIO<Histo2D>
    262251
     252/*! \ingroup HiStats \fn operator*(const Histo2D&,double)
     253  \brief Operateur H2 = H1 * b */
     254inline Histo2D operator * (const Histo2D& a, double b)
     255{
     256  Histo2D result(a);
     257  return (result *= b);
     258}
     259
     260/*! \ingroup HiStats \fn operator*(double,const Histo2D&)
     261  \brief Operateur H2 = b * H1 */
     262inline Histo2D operator * (double b, const Histo2D& a)
     263{
     264  Histo2D result(a);
     265  return (result *= b);
     266}
     267
     268/*! \ingroup HiStats \fn operator/(const Histo2D&,double)
     269  \brief Operateur H2 = H1 / b */
     270inline Histo2D operator / (const Histo2D& a, double b)
     271{
     272  Histo2D result(a);
     273  return (result /= b);
     274}
     275
     276/*! \ingroup HiStats \fn operator+(const Histo2D&,double)
     277  \brief Operateur H2 = H1 + b */
     278inline Histo2D operator + (const Histo2D& a, double b)
     279{
     280  Histo2D result(a);
     281  return (result += b);
     282}
     283
     284/*! \ingroup HiStats \fn operator+(double,const Histo2D&)
     285  \brief Operateur H2 = b + H1 */
     286inline Histo2D operator + (double b, const Histo2D& a)
     287{
     288  Histo2D result(a);
     289  return (result += b);
     290}
     291
     292/*! \ingroup HiStats \fn operator-(const Histo2D&,double)
     293  \brief Operateur H2 = H1 - b */
     294inline Histo2D operator - (const Histo2D& a, double b)
     295{
     296  Histo2D result(a);
     297  return (result -= b);
     298}
     299
     300/*! \ingroup HiStats \fn operator-(double,const Histo2D&)
     301  \brief Operateur H2 = b - H1 */
     302inline Histo2D operator - (double b, const Histo2D& a)
     303{
     304  Histo2D result(a);
     305  result *= -1.;
     306  return (result += b);
     307}
     308
     309/*! \ingroup HiStats \fn operator+(const Histo2D&,const Histo2D&)
     310  \brief Operateur H = H1 + H2 */
     311
     312inline Histo2D operator + (const Histo2D& a, const Histo2D& b)
     313{
     314if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);
     315Histo2D c(a);
     316return (c += b);
     317}
     318
     319/*! \ingroup HiStats \fn operator-(const Histo2D&,const Histo2D&)
     320  \brief Operateur H = H1 - H2 */
     321inline Histo2D operator - (const Histo2D& a, const Histo2D& b)
     322{
     323if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);
     324Histo2D c(a);
     325return (c -= b);
     326}
     327
     328/*! \ingroup HiStats \fn operator*(const Histo2D&,const Histo2D&)
     329  \brief Operateur H = H1 * H2 */
     330inline Histo2D operator * (const Histo2D& a, const Histo2D& b)
     331{
     332if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);
     333Histo2D c(a);
     334return (c *= b);
     335}
     336
     337/*! \ingroup HiStats \fn operator/(const Histo2D&,const Histo2D&)
     338  \brief Operateur H = H1 / H2 */
     339inline Histo2D operator / (const Histo2D& a, const Histo2D& b)
     340{
     341if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);
     342Histo2D c(a);
     343return (c /= b);
     344}
     345
    263346} // Fin du namespace
    264347
Note: See TracChangeset for help on using the changeset viewer.