![]() |
ReFRACtor
|
We frequently have a double with units associated with it. More...
#include <double_with_unit.h>
Inheritance diagram for FullPhysics::DoubleWithUnit:
Collaboration diagram for FullPhysics::DoubleWithUnit:Public Member Functions | |
| DoubleWithUnit () | |
| DoubleWithUnit (double V, const Unit &U) | |
| DoubleWithUnit (double V, const std::string &U) | |
| DoubleWithUnit (double V) | |
| DoubleWithUnit | convert (const Unit &R) const |
| Convert to the given units. More... | |
| DoubleWithUnit | convert_wave (const Unit &R) const |
| We often need to handle conversion from wavenumber to/from wavelength. More... | |
| DoubleWithUnit | convert_wave (const Unit &R, const SpectralDomain &Pixel_grid) const |
| Variation of convert_wave that also handles the units of sample_index. More... | |
| DoubleWithUnit & | operator*= (const DoubleWithUnit &D) |
| Basic math operators for class. More... | |
| DoubleWithUnit & | operator+= (const DoubleWithUnit &D) |
| DoubleWithUnit & | operator-= (const DoubleWithUnit &D) |
| DoubleWithUnit & | operator/= (const DoubleWithUnit &D) |
| void | print (std::ostream &Os) const |
| std::string | print_to_string () const |
| Print to string. More... | |
Public Attributes | |
| Unit | units |
| double | value |
We frequently have a double with units associated with it.
This is a simple structure that just keeps these two things together.
Definition at line 13 of file double_with_unit.h.
|
inline |
Definition at line 16 of file double_with_unit.h.
|
inline |
Definition at line 17 of file double_with_unit.h.
|
inline |
Definition at line 19 of file double_with_unit.h.
|
inline |
Definition at line 21 of file double_with_unit.h.
|
inline |
Convert to the given units.
Definition at line 42 of file double_with_unit.h.
|
inline |
We often need to handle conversion from wavenumber to/from wavelength.
This is either a normal conversion of the units before and after match in the power of length (so cm^-1 to m^-1), or do an inversion. Since we do this often enough, it is worth having a function that handles this logic.
Definition at line 53 of file double_with_unit.h.
| DoubleWithUnit DoubleWithUnit::convert_wave | ( | const Unit & | R, |
| const SpectralDomain & | Pixel_grid | ||
| ) | const |
Variation of convert_wave that also handles the units of sample_index.
Definition at line 34 of file double_with_unit.cc.
|
inline |
Basic math operators for class.
Definition at line 29 of file double_with_unit.h.
|
inline |
Definition at line 33 of file double_with_unit.h.
|
inline |
Definition at line 35 of file double_with_unit.h.
|
inline |
Definition at line 31 of file double_with_unit.h.
|
inline |
Definition at line 64 of file double_with_unit.h.
|
inlineinherited |
Print to string.
This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.
Definition at line 31 of file printable.h.
| Unit FullPhysics::DoubleWithUnit::units |
Definition at line 24 of file double_with_unit.h.
| double FullPhysics::DoubleWithUnit::value |
Definition at line 23 of file double_with_unit.h.