Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
Functions.cpp
Go to the documentation of this file.
1 
9 #include "Functions.h"
10 #include "Common.h"
11 #include "InterpSolutionIterator.h"
12 #include <iostream>
13 
14 #ifndef NO_SERIALIZE
15  BOOST_CLASS_EXPORT_IMPLEMENT(Core::ZeroFunction)
16 #endif
17 
18 namespace Core {
19 
21  double first_deriv,
22  double second_deriv) :
23  zeroth(func_value), first(first_deriv), second(second_deriv)
24  {}
25 
26  double CubicSplineDerivatives::order(unsigned deriv_order) const
27  {
28  if(deriv_order==0) return zeroth;
29  else if(deriv_order==1) return first;
30  else if(deriv_order==2) return second;
31  else if(deriv_order==3) return NaN;
32  else return 0.0;
33  }
34 
36  {
37  throw Error::Runtime("Called ZeroQuantity::crossings, "
38  "which are ill defined.");
39  }
40 
41 
42 } //End Core namespace.
A hierarchy of classes representing functions.
double zeroth
The value of the function.
Definition: Functions.h:79
Any runtime error.
Definition: Error.h:61
An iterator over a set of solutions to an interpolating function.
A class representing a function that is identically zero.
Definition: Functions.h:143
CubicSplineDerivatives(double func_value, double first_deriv, double second_deriv)
Constuct a spline derivative.
Definition: Functions.cpp:20
InterpSolutionIterator crossings(double=0) const
An iterator over the ages where the quantity takes the given y value.
Definition: Functions.cpp:35
const double NaN
Not a number.
Definition: Common.h:33
Declaration of some general purpose utilities.
double second
The second derivative.
Definition: Functions.h:79
double first
The first derivative.
Definition: Functions.h:79
double order(unsigned deriv_order=1) const
Returns the derivative of the given order (zero is allowed).
Definition: Functions.cpp:26