ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/math/CubicSpline.cpp
(Generate patch)

Comparing trunk/src/math/CubicSpline.cpp (file contents):
Revision 1927 by gezelter, Sun Jun 16 15:15:42 2013 UTC vs.
Revision 1928 by gezelter, Sat Aug 17 13:03:17 2013 UTC

# Line 198 | Line 198 | RealType CubicSpline::getValueAt(const RealType& t) {
198    
199    if (!generated) generate();
200    
201 <  assert(t > data_.front().first);
202 <  assert(t < data_.back().first);
201 >  assert(t >= data_.front().first);
202 >  assert(t <= data_.back().first);
203  
204    //  Find the interval ( x[j], x[j+1] ) that contains or is nearest
205    //  to t.
# Line 237 | Line 237 | void CubicSpline::getValueAt(const RealType& t, RealTy
237    
238    if (!generated) generate();
239    
240 <  assert(t > data_.front().first);
241 <  assert(t < data_.back().first);
240 >  assert(t >= data_.front().first);
241 >  assert(t <= data_.back().first);
242  
243    //  Find the interval ( x[j], x[j+1] ) that contains or is nearest
244    //  to t.
# Line 276 | Line 276 | pair<RealType, RealType> CubicSpline::getValueAndDeriv
276  
277    if (!generated) generate();
278    
279 <  assert(t > data_.front().first);
280 <  assert(t < data_.back().first);
279 >  assert(t >= data_.front().first);
280 >  assert(t <= data_.back().first);
281  
282    //  Find the interval ( x[j], x[j+1] ) that contains or is nearest
283    //  to t.
# Line 308 | Line 308 | pair<RealType, RealType> CubicSpline::getValueAndDeriv
308    return make_pair(yval, dydx);
309   }
310  
311 + pair<RealType, RealType> CubicSpline::getLimits(){
312 +  if (!generated) generate();
313 +  return make_pair( data_.front().first, data_.back().first );
314 + }
315 +
316   void CubicSpline::getValueAndDerivativeAt(const RealType& t, RealType& v,
317                                            RealType &dv) {
318    // Evaluate the spline and first derivative at t using coefficients
# Line 317 | Line 322 | void CubicSpline::getValueAndDerivativeAt(const RealTy
322  
323    if (!generated) generate();
324    
325 <  assert(t > data_.front().first);
326 <  assert(t < data_.back().first);
325 >  assert(t >= data_.front().first);
326 >  assert(t <= data_.back().first);
327  
328    //  Find the interval ( x[j], x[j+1] ) that contains or is nearest
329    //  to t.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines