59 std::cout <<
"Homogeneity done" << std::endl;
72 const T tol = std::numeric_limits<T>::epsilon() * 2.;
79 std::cerr << std::scientific << std::setprecision(16)
80 <<
"mismatch in unit SI description, unity is not found" << std::endl
81 <<
"unit is " << test << std::endl;
87 std::cerr << std::scientific << std::setprecision(16)
88 <<
"mismatch in unit SI description, unity is not found" << std::endl
89 <<
"unit is " << test << std::endl;
95 std::cerr << std::scientific << std::setprecision(16)
96 <<
"mismatch in unit SI description, unity is not found" << std::endl
97 <<
"unit is " << test << std::endl;
103 std::cerr << std::scientific << std::setprecision(16)
104 <<
"mismatch in unit SI description, unity is not found" << std::endl
105 <<
"unit is " << test << std::endl;
111 std::cerr << std::scientific << std::setprecision(16)
112 <<
"mismatch in unit SI description, unity is not found" << std::endl
113 <<
"unit is " << test << std::endl;
119 std::cerr << std::scientific << std::setprecision(16)
120 <<
"mismatch in unit SI description, unity is not found" << std::endl
121 <<
"unit is " << test << std::endl;
127 std::cerr << std::scientific << std::setprecision(16)
128 <<
"mismatch in unit SI description, unity is not found" << std::endl
129 <<
"unit is " << test << std::endl;
135 std::cerr << std::scientific << std::setprecision(16)
136 <<
"mismatch in unit SI description, unity is not found" << std::endl
137 <<
"unit is " << test << std::endl;
144 std::cerr << std::scientific << std::setprecision(16)
145 <<
"mismatch in unit SI description, unity is not found" << std::endl
146 <<
"unit is " << test << std::endl;
156 std::vector<std::string> add;
157 for(
int i = 0; i < nAddition; i++)
164 for(
int i = 0; i < nAddition; i++)
167 if(ndot > 0)indice = rand() % ndot;
169 for(
int j = 0; j < indice; j++)
171 where = uu.find(
".",where);
173 if(where == 0)where = uu.size();
174 std::string ad =
"." + add[i];
177 if(ndot > 0)indice = rand() % ndot;
179 for(
int j = 0; j < indice; j++)
181 where = uu.find(
".",where);
183 if(where == 0)where = uu.size();
192 std::cerr << std::scientific << std::setprecision(16)
193 <<
"mismatch in unit combination, unity is not found" << std::endl
194 <<
"unit is " << test << std::endl;
198 std::cout <<
"Combination done at ";
199 (nAddition < 100)?std::cout <<
"low":std::cout <<
"high";
200 std::cout <<
" level" << std::endl;
208 if(abs((Rcalc - Rcal)/Rcal) > tol && abs((Rcalc - Rcal)/Rcal) > abs(Runc/Rcal))
210 std::cerr << std::scientific << std::setprecision(16)
211 <<
"mismatch in R calculation" << std::endl
212 <<
"Rtheo = " << Rcal <<
" cal/mol/K" << std::endl
213 <<
"Rcal = " << Rcalc <<
" cal/mol/K" << std::endl
214 <<
"relative error = " << abs((Rcalc - Rcal)/Rcal) << std::endl
215 <<
"uncertainty in calorie = " << Runc << std::endl
216 <<
"tol = " << tol << std::endl;
226 std::cerr <<
"E = m * c *c failed, output unit is " << E.
get_symbol() << std::endl;
233 template <
typename T>
237 test_homogeneity<T>() ||
238 test_factor<T>(10) ||
249 tester<long double>()
const std::string get_symbol() const
String symbol getter.
void set_unit(const std::string &sym, std::string na)
Units setter, sets the unit to the given symbol and name.
T get_SI_factor() const
Multiplicative coefficient getter.
T factor_to_some_unit(const Units< T > &target) const
Calculates the factor to any given unit.
int test_factor(int nAddition)
const UnitBaseConstant::UnitBaseStore< long double > known_units()
bool is_homogeneous(const Units< T > &rhs) const
Homogenity testing with another Units.