Changeset 3520 in Sophya for trunk/SophyaPI/PIext/pihisto2d.cc


Ignore:
Timestamp:
Sep 11, 2008, 2:45:01 PM (17 years ago)
Author:
ansari
Message:

Ajout/codage methode P2DArrayAdapter::MeanVal() pour les classes adapter heritant de P2DArrayAdapter, Reza 11/09/2008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pihisto2d.cc

    r3153 r3520  
    2323P2DHistoWrapper::~P2DHistoWrapper()
    2424{
     25}
     26
     27
     28double P2DHistoWrapper::MeanVal(int ix1, int ix2, int jy1, int jy2)
     29{
     30  int ec;
     31  if (ix1>ix2) { ec=ix1; ix1=ix2; ix2=ec; }
     32  if (jy1>jy2) { ec=jy1; jy1=jy2; jy2=ec; }   
     33  double ss = 0.;
     34  for(int j=jy1; j<=jy2; j++)
     35    for(int i=ix1; i<=ix2; i++)  ss += (double)((*this)(i, j));
     36  ss /= (double)((jy2-jy1+1)*(ix2-ix1+1));
     37  return ss;     
    2538}
    2639
Note: See TracChangeset for help on using the changeset viewer.