Ignore:
Timestamp:
Dec 26, 2006, 10:56:26 AM (15 years ago)
Author:
Jari Häkkinen
Message:

Addresses #170.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/Histogram.h

    r683 r718  
    8686    /// @return A const reference to an AveragerWeighted object.
    8787    ///
    88     inline const statistics::AveragerWeighted& averager_all(void) const
    89       { return sum_all_; }
     88    const statistics::AveragerWeighted& averager_all(void) const;
    9089
    9190    ///
     
    9897    /// @return A const reference to an AveragerWeighted object.
    9998    ///
    100     inline const statistics::AveragerWeighted& averager_histogram(void) const
    101       { return sum_histogram_; }
     99    const statistics::AveragerWeighted& averager_histogram(void) const;
    102100
    103101    ///
    104102    /// @return The number of bins in the histogram
    105103    ///
    106     inline size_t nof_bins(void) const { return histogram_.size(); }
     104    size_t nof_bins(void) const;
    107105
    108106    ///
     
    140138    /// histogram.
    141139    ///
    142     inline double observation_value(const size_t k) const
    143       { return xmin_+spacing()*(k+0.5); }
     140    double observation_value(const size_t k) const;
    144141
    145142    ///
     
    152149    /// @return The width of the bins in the histogram.
    153150    ///
    154     inline double spacing(void) const { return (xmax_-xmin_)/nof_bins(); }
     151    double spacing(void) const;
    155152
    156153    ///
     
    159156    /// @note The upper boundary value is outside the histogram.
    160157    ///
    161     inline double xmax(void) const { return xmax_; }
     158    double xmax(void) const;
    162159
    163160    ///
     
    166163    /// @note The lower boundary value is inside the histogram.
    167164    ///
    168     inline double xmin(void) const { return xmin_; }
     165    double xmin(void) const;
    169166
    170167    ///
    171168    /// @return The count of bin \a k in the histogram.
    172169    ///
    173     inline double operator[](size_t k) const { return histogram_[k]; }
     170    double operator[](size_t k) const;
    174171
    175172    ///
     
    180177  private:
    181178    // Returns zero if outside boundaries
    182     inline size_t bin(double d)
    183     { return (((d<xmin_) || (d>xmax_)) ? 0 :
    184               static_cast<size_t>(floor((d-xmin_)/spacing() ))); }
     179    size_t bin(double d);
    185180
    186181    std::vector<double> histogram_;
Note: See TracChangeset for help on using the changeset viewer.