00001 00013 /***************************************************************************** 00014 ** Includes 00015 *****************************************************************************/ 00016 00017 #include "../../include/ecl/geometry/tension_spline.hpp" 00018 00019 /***************************************************************************** 00020 ** Namespaces 00021 *****************************************************************************/ 00022 00023 namespace ecl { 00024 00025 /***************************************************************************** 00026 ** Implementation 00027 *****************************************************************************/ 00028 00029 double TensionSpline::operator()(const double &x) const ecl_assert_throw_decl(StandardException) { 00030 ecl_assert_throw( ( ( x >= discretised_domain.front() ) && ( x <= discretised_domain.back() ) ), StandardException(LOC,OutOfRangeError) ); 00031 int index = 0; 00032 while ( x > discretised_domain[index+1] ) { 00033 ++index; 00034 } 00035 return functions[index](tension,x); 00036 } 00037 00038 double TensionSpline::derivative(const double &x) const ecl_assert_throw_decl(StandardException) { 00039 ecl_assert_throw( ( ( x >= discretised_domain.front() ) && ( x <= discretised_domain.back() ) ), StandardException(LOC,OutOfRangeError) ); 00040 int index = 0; 00041 while ( x > discretised_domain[index+1] ) { 00042 ++index; 00043 } 00044 return functions[index].derivative(tension,x); 00045 } 00046 00047 double TensionSpline::dderivative(const double &x) const ecl_assert_throw_decl(StandardException) { 00048 ecl_assert_throw( ( ( x >= discretised_domain.front() ) && ( x <= discretised_domain.back() ) ), StandardException(LOC,OutOfRangeError) ); 00049 int index = 0; 00050 while ( x > discretised_domain[index+1] ) { 00051 ++index; 00052 } 00053 return functions[index].dderivative(tension,x); 00054 } 00055 00056 } // namespace ecl