58 inline static double convert(
double unitToConvert,
double to,
double from){
60 if (to > 0 && from > 0){
62 return unitToConvert*(to/from);
65 else if (to < 0 && from < 0){
67 return unitToConvert*(from/to);
72 throw std::logic_error(
"Incorrect unit conversion");
85 inline static double convert(
double unitToConvert,
int specificCase){
90 return unitToConvert/1.054;
92 return unitToConvert*1.054;
94 return unitToConvert*1.01325e5;
98 throw std::invalid_argument(
"Specific case not implemented");
static double PER_P_UNIT
Definition: fcst_units.h:113
static double PER_N_UNIT3
Definition: fcst_units.h:126
static double N_UNIT2
Definition: fcst_units.h:142
static double C_UNIT3
Definition: fcst_units.h:146
static double PER_MILLI_UNIT
Definition: fcst_units.h:110
static double C_UNIT
Definition: fcst_units.h:132
static double MILLI_UNIT3
Definition: fcst_units.h:147
static double PER_C_UNIT3
Definition: fcst_units.h:123
static double MICRO_UNIT
Definition: fcst_units.h:134
static double PER_UNIT
Definition: fcst_units.h:108
static double PER_C_UNIT2
Definition: fcst_units.h:116
static double MICRO_UNIT2
Definition: fcst_units.h:141
static double MILLI_UNIT
Definition: fcst_units.h:133
static double UNIT
Definition: fcst_units.h:131
static double PER_N_UNIT2
Definition: fcst_units.h:119
static double MILLI_UNIT2
Definition: fcst_units.h:140
static const unsigned int KJ_to_BTU
Definition: fcst_units.h:102
static double N_UNIT
Definition: fcst_units.h:135
static double PER_P_UNIT3
Definition: fcst_units.h:127
static double C_UNIT2
Definition: fcst_units.h:139
static double MICRO_UNIT3
Definition: fcst_units.h:148
static double PER_MICRO_UNIT3
Definition: fcst_units.h:125
static double PER_MILLI_UNIT2
Definition: fcst_units.h:117
static double PER_P_UNIT2
Definition: fcst_units.h:120
static double UNIT2
Definition: fcst_units.h:138
Class used to convert units using a standard convention.
Definition: fcst_units.h:50
static double PER_N_UNIT
Definition: fcst_units.h:112
static double PER_MILLI_UNIT3
Definition: fcst_units.h:124
static double N_UNIT3
Definition: fcst_units.h:149
static double P_UNIT3
Definition: fcst_units.h:150
static double PER_C_UNIT
Definition: fcst_units.h:109
static double PER_UNIT3
Definition: fcst_units.h:122
static const unsigned int BTU_to_KJ
Definition: fcst_units.h:103
static double convert(double unitToConvert, int specificCase)
Convert using on a case by case basis.
Definition: fcst_units.h:85
static double UNIT3
Definition: fcst_units.h:145
static const unsigned int ATM_to_PA
Definition: fcst_units.h:104
static double P_UNIT
Definition: fcst_units.h:136
static double PER_UNIT2
Definition: fcst_units.h:115
static double P_UNIT2
Definition: fcst_units.h:143
static double PER_MICRO_UNIT2
Definition: fcst_units.h:118
static double PER_MICRO_UNIT
Definition: fcst_units.h:111
static double convert(double unitToConvert, double to, double from)
The converstion routine convert(unitToConvert, X, Y) should be read as:
Definition: fcst_units.h:58