Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
LogDerivatives.h
Go to the documentation of this file.
1 
9 #ifndef __LOG_ARG_DERIVATIVES_H
10 #define __LOG_ARG_DERIVATIVES_H
11 
12 #include "../Core/SharedLibraryExportMacros.h"
13 #include "Functions.h"
14 #include "Error.h"
15 #include <vector>
16 
17 namespace StellarEvolution {
18 
20  using Core::NaN;
21 
26  class LIB_LOCAL LogDerivatives : public FunctionDerivatives {
27  private:
29  double __x;
30 
31  bool
33  __log_x,
34 
36  __log_y;
37 
38  mutable std::vector<double>
41 
43  __deriv_values;
44 
50  double transform_log_x_deriv(unsigned order) const;
51 
56  double transform_log_y_deriv(
60  double uncorrected_derivative,
61 
63  unsigned order
64  ) const;
65 
66  protected:
69  virtual double calc_deriv(unsigned deriv_order) const =0;
70  public:
81  double x = NaN,
82 
86  bool log_y = false
87  ) : __x(x), __log_x(!std::isnan(x)), __log_y(log_y) {}
88 
90  double order(unsigned deriv_order=1) const;
91  }; //End of LogDerivatives class
92 
93 } //End of StellarEvolution namespace.
94 
95 #endif
A hierarchy of classes representing functions.
Definition: Common.cpp:10
Defines the exception hierarchy used by this code.
Calculate dy/dx given dy/dx, dy/dln(x), dln(y)/dx or dln(y)/dln(x).
LogDerivatives(double x=NaN, bool log_y=false)
Create a derivative for possibly log(functions) of possibly log(arg).
double __x
The value of the argument at which derivatives are calculated.
A class representing arbitrary order derivatives of a function.
Definition: Functions.h:66
std::vector< double > __underlying_deriv_values
Cache for previously computed underlying derivative values.
const double NaN
Not a number.
Definition: Common.h:33
bool __log_y
Is the underlying derivative of log(quantity)