Ignore:
Timestamp:
Sep 30, 2007, 2:50:10 AM (14 years ago)
Author:
Peter
Message:

Sorry this commit is a bit to big.

Adding a yat_assert. The yat assert are turned on by providing a
'-DYAT_DEBUG' flag to preprocessor if normal cassert is turned
on. This flag is activated for developers running configure with
--enable-debug. The motivation is that we can use these yat_asserts in
header files and the yat_asserts will be invisible to the normal user
also if he uses C-asserts.

added output operator in DataLookup2D and removed output operator in
MatrixLookup?

Removed template function add_values in Averager and weighted version

Added function to AveragerWeighted? taking iterator to four ranges.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/AveragerPairWeighted.cc

    r899 r916  
    4949      return;
    5050    }
     51    assert(!std::isnan(x) && "x is nan");
     52    assert(!std::isnan(y) && "y is nan");
     53    assert(!std::isnan(wx) && "wx is nan");
     54    assert(!std::isnan(wy) && "wy is nan");
    5155    double w=wx*wy;
    5256    x_.add(x,w);
     
    8488  double AveragerPairWeighted::correlation(void) const
    8589  {
    86     return covariance() / ( x_.std()*y_.std() );
     90    return ( x_.variance()>0 && y_.variance()>0 ?
     91             covariance() / sqrt(x_.variance()*y_.variance()) : 0 );
    8792  }
    8893
Note: See TracChangeset for help on using the changeset viewer.