cubic_spline.cpp
Go to the documentation of this file.
1 
12 /*****************************************************************************
13 ** Includes
14 *****************************************************************************/
15 
17 #include "../../include/ecl/geometry/cubic_spline.hpp"
18 
19 /*****************************************************************************
20 ** Namespaces
21 *****************************************************************************/
22 
23 namespace ecl {
24 
25 /*****************************************************************************
26 ** Implementation
27 *****************************************************************************/
28 
30  ecl_assert_throw( ( ( x >= discretised_domain.front() ) && ( x <= discretised_domain.back() ) ), StandardException(LOC,OutOfRangeError) );
31  int index = 0;
32  while ( x > discretised_domain[index+1] ) {
33  ++index;
34  }
35  return cubic_polynomials[index](x);
36 }
37 
39  ecl_assert_throw( ( ( x >= discretised_domain.front() ) && ( x <= discretised_domain.back() ) ), StandardException(LOC,OutOfRangeError) );
40  int index = 0;
41  while ( x > discretised_domain[index+1] ) {
42  ++index;
43  }
44  return cubic_polynomials[index].derivative()(x);
45 }
46 
48  ecl_assert_throw( ( ( x >= discretised_domain.front() ) && ( x <= discretised_domain.back() ) ), StandardException(LOC,OutOfRangeError) );
49  int index = 0;
50  while ( x > discretised_domain[index+1] ) {
51  ++index;
52  }
53  return cubic_polynomials[index].derivative().derivative()(x);
54 }
55 
56 } // namespace ecl
Embedded control libraries.
#define LOC
#define ecl_assert_throw(expression, exception)
double derivative(double x) const ecl_assert_throw_decl(StandardException)
Spline derivative.
OutOfRangeError
double dderivative(double x) const ecl_assert_throw_decl(StandardException)
Spline second derivative.
double operator()(const double &x) const ecl_assert_throw_decl(StandardException)
Spline function.
#define ecl_assert_throw_decl(exception)


ecl_geometry
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:08:37