Commit 2bfe8941 authored by Steffen Schotthöfer's avatar Steffen Schotthöfer
Browse files

Merge branch 'PN_CSD' of git.scc.kit.edu:rtsn/rtsn into PN_CSD

parents 5854e0cb 9bc446d3
......@@ -63,7 +63,16 @@ double Interpolation::operator()( double x ) const {
Vector::ConstIterator it = std::lower_bound( _x.begin(), _x.end(), x );
// index of the lower bound to x in _x
unsigned idx = static_cast<unsigned>( std::max( int( it - _x.begin() ) - 1, 0 ) );
unsigned idx = 0;
if( x >= _x[0] && x <= _x[_x.size() - 1u] ) {
idx = static_cast<unsigned>( std::max( int( it - _x.begin() ) - 1, 0 ) );
}
else if( x < _x[0] ) {
idx = 0;
}
else if( x > _x[_x.size() - 1u] ) {
idx = _x.size() - 1u;
}
// linear interpolation
if( _type == linear || _type == loglinear ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment