rdbstats  2.0.7
RdbStatsAve.cc
1 // File: RdbStatsAve.cc
2 
3 // --8<--8<--8<--8<--
4 //
5 // Copyright (C) 2006 Smithsonian Astrophysical Observatory
6 //
7 // This file is part of rdbstats
8 //
9 // rdbstats is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License
11 // as published by the Free Software Foundation; either version 2
12 // of the License, or (at your option) any later version.
13 //
14 // rdbstats is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the
21 // Free Software Foundation, Inc.
22 // 51 Franklin Street, Fifth Floor
23 // Boston, MA 02110-1301, USA
24 //
25 // -->8-->8-->8-->8--
26 
27 #include "RdbStatsAve.h"
28 
29 RdbStatsAve::RdbStatsAve( RDB& irdbtable, const std::string& name )
30  : RdbStats( irdbtable, name ) {}
31 
33  if ( 0 == this->RdbStats::calculate_statistics( ) )
34  return 0;
35 
36  // normalize the result wrt the average.
37  double norm_factor = get_absolute_average( );
38  normalize_results( norm_factor );
39 
40  return num_n;
41 }
The base class to calculate : average, maximum, minimum, num, stddev and sum.
Definition: RdbStats.h:39
double get_absolute_average() const
To get the absolute value of the average.
Definition: RdbStats.h:51
virtual int calculate_statistics()
Perform the final statistic for the set.
Definition: RdbStatsAve.cc:32
virtual int calculate_statistics()
Perform the final statistic for the set.
Definition: RdbStats.cc:49