1 #ifndef AUTO_DERIVATIVE_WITH_UNIT_H 2 #define AUTO_DERIVATIVE_WITH_UNIT_H 16 public Printable<AutoDerivativeWithUnit<T> >,
17 boost::field_operators<AutoDerivativeWithUnit<T> >
40 { value *= D.
value; units *= D.
units;
return *
this;}
43 { value /= D.
value; units /= D.
units;
return *
this;}
58 void print(std::ostream& Os)
const 59 { Os << value <<
" " << units.
name(); }
AutoDerivativeWithUnit< T > & operator/=(const AutoDerivativeWithUnit< T > &D)
AutoDerivativeWithUnit(const T &V)
This is a AutoDerivative that also has units associated with it.
AutoDerivativeWithUnit< T > convert(const Unit &R) const
Convert to the given units.
AutoDerivativeWithUnit(const AutoDerivative< T > &V)
AutoDerivativeWithUnit< T > & operator*=(const AutoDerivativeWithUnit< T > &D)
Basic math operators for class.
void print(std::ostream &Os) const
AutoDerivativeWithUnit(const AutoDerivative< T > &V, const std::string &U)
const Unit dimensionless("dimensionless", 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
double conversion(const Unit &Dunit_from, const Unit &Dunit_to)
Return conversion factor to go from one unit to another.
This is a Mixin for classes that can be printed.
AutoDerivativeWithUnit(const DoubleWithUnit &V)
There are a number of tools that can be used to do "Automatic Differentiation" (see for example http:...
AutoDerivativeWithUnit< T > & operator+=(const AutoDerivativeWithUnit< T > &D)
We frequently have a double with units associated with it.
Libraries such as boost::units allow unit handling where we know the units at compile time...
AutoDerivativeWithUnit(const AutoDerivative< T > &V, const Unit &U)
Contains classes to abstract away details in various Spurr Radiative Transfer software.
AutoDerivative< T > value
const std::string & name() const
Name of unit. May be an empty string if a name wasn't assigned.
AutoDerivativeWithUnit< T > & operator-=(const AutoDerivativeWithUnit< T > &D)