]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/units/example/systems.cpp
1 // Boost.Units - A C++ library for zero-overhead dimensional analysis and
2 // unit/quantity manipulation and conversion
4 // Copyright (C) 2003-2008 Matthias Christian Schabel
5 // Copyright (C) 2008 Steven Watanabe
7 // Distributed under the Boost Software License, Version 1.0. (See
8 // accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
17 Test various non-si units
25 #define BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(namespace_,unit_name_,dimension_) \
28 namespace namespace_ { \
29 typedef make_system<unit_name_ ## _base_unit>::type unit_name_ ## system_; \
30 typedef unit<dimension_ ## _dimension,unit_name_ ## system_> unit_name_ ## _ ## dimension_; \
31 static const unit_name_ ## _ ## dimension_ unit_name_ ## s; \
40 #include <boost/units/conversion.hpp>
41 #include <boost/units/io.hpp>
42 #include <boost/units/pow.hpp>
44 #include <boost/units/systems/cgs.hpp>
45 #include <boost/units/systems/si.hpp>
48 #include <boost/units/base_units/angle/arcminute.hpp>
49 #include <boost/units/base_units/angle/arcsecond.hpp>
50 #include <boost/units/base_units/angle/degree.hpp>
51 #include <boost/units/base_units/angle/gradian.hpp>
52 #include <boost/units/base_units/angle/revolution.hpp>
53 #include <boost/units/base_units/angle/radian.hpp>
54 #include <boost/units/base_units/angle/steradian.hpp>
56 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle
,arcminute
,plane_angle
)
57 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle
,arcsecond
,plane_angle
)
58 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle
,degree
,plane_angle
)
59 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle
,gradian
,plane_angle
)
60 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle
,radian
,plane_angle
)
61 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle
,revolution
,plane_angle
)
63 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle
,steradian
,solid_angle
)
65 // astronomical base units
66 #include <boost/units/base_units/astronomical/astronomical_unit.hpp>
67 #include <boost/units/base_units/astronomical/light_second.hpp>
68 #include <boost/units/base_units/astronomical/light_minute.hpp>
69 #include <boost/units/base_units/astronomical/light_hour.hpp>
70 #include <boost/units/base_units/astronomical/light_day.hpp>
71 #include <boost/units/base_units/astronomical/light_year.hpp>
72 #include <boost/units/base_units/astronomical/parsec.hpp>
74 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical
,astronomical_unit
,length
)
75 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical
,light_second
,length
)
76 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical
,light_minute
,length
)
77 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical
,light_hour
,length
)
78 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical
,light_day
,length
)
79 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical
,light_year
,length
)
80 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical
,parsec
,length
)
82 // imperial base units
83 #include <boost/units/base_units/imperial/thou.hpp>
84 #include <boost/units/base_units/imperial/inch.hpp>
85 #include <boost/units/base_units/imperial/foot.hpp>
86 #include <boost/units/base_units/imperial/yard.hpp>
87 #include <boost/units/base_units/imperial/furlong.hpp>
88 #include <boost/units/base_units/imperial/mile.hpp>
89 #include <boost/units/base_units/imperial/league.hpp>
91 #include <boost/units/base_units/imperial/grain.hpp>
92 #include <boost/units/base_units/imperial/drachm.hpp>
93 #include <boost/units/base_units/imperial/ounce.hpp>
94 #include <boost/units/base_units/imperial/pound.hpp>
95 #include <boost/units/base_units/imperial/stone.hpp>
96 #include <boost/units/base_units/imperial/quarter.hpp>
97 #include <boost/units/base_units/imperial/hundredweight.hpp>
98 #include <boost/units/base_units/imperial/ton.hpp>
100 #include <boost/units/base_units/imperial/fluid_ounce.hpp>
101 #include <boost/units/base_units/imperial/gill.hpp>
102 #include <boost/units/base_units/imperial/pint.hpp>
103 #include <boost/units/base_units/imperial/quart.hpp>
104 #include <boost/units/base_units/imperial/gallon.hpp>
106 #include <boost/units/base_units/imperial/conversions.hpp>
108 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,thou
,length
)
109 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,inch
,length
)
110 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,foot
,length
)
111 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,yard
,length
)
112 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,furlong
,length
)
113 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,mile
,length
)
114 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,league
,length
)
116 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,grain
,mass
)
117 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,drachm
,mass
)
118 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,ounce
,mass
)
119 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,pound
,mass
)
120 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,stone
,mass
)
121 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,quarter
,mass
)
122 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,hundredweight
,mass
)
123 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,ton
,mass
)
125 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,fluid_ounce
,volume
)
126 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,gill
,volume
)
127 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,pint
,volume
)
128 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,quart
,volume
)
129 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial
,gallon
,volume
)
132 #include <boost/units/base_units/metric/angstrom.hpp>
133 #include <boost/units/base_units/metric/fermi.hpp>
134 #include <boost/units/base_units/metric/micron.hpp>
135 #include <boost/units/base_units/metric/nautical_mile.hpp>
137 #include <boost/units/base_units/metric/ton.hpp>
139 #include <boost/units/base_units/metric/day.hpp>
140 #include <boost/units/base_units/metric/hour.hpp>
141 #include <boost/units/base_units/metric/minute.hpp>
142 #include <boost/units/base_units/metric/year.hpp>
144 #include <boost/units/base_units/metric/knot.hpp>
146 #include <boost/units/base_units/metric/are.hpp>
147 #include <boost/units/base_units/metric/barn.hpp>
148 #include <boost/units/base_units/metric/hectare.hpp>
150 #include <boost/units/base_units/metric/liter.hpp>
152 #include <boost/units/base_units/metric/atmosphere.hpp>
153 #include <boost/units/base_units/metric/bar.hpp>
154 #include <boost/units/base_units/metric/mmHg.hpp>
155 #include <boost/units/base_units/metric/torr.hpp>
157 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,angstrom
,length
)
158 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,fermi
,length
)
159 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,micron
,length
)
160 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,nautical_mile
,length
)
162 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,ton
,mass
)
164 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,day
,time
)
165 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,hour
,time
)
166 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,minute
,time
)
167 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,year
,time
)
169 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,knot
,velocity
)
171 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,are
,area
)
172 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,barn
,area
)
173 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,hectare
,area
)
175 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,liter
,volume
)
177 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,atmosphere
,pressure
)
178 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,bar
,pressure
)
179 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,mmHg
,pressure
)
180 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric
,torr
,pressure
)
184 #include <boost/units/base_units/us/mil.hpp>
185 #include <boost/units/base_units/us/inch.hpp>
186 #include <boost/units/base_units/us/foot.hpp>
187 #include <boost/units/base_units/us/yard.hpp>
188 #include <boost/units/base_units/us/mile.hpp>
190 #include <boost/units/base_units/us/grain.hpp>
191 #include <boost/units/base_units/us/dram.hpp>
192 #include <boost/units/base_units/us/ounce.hpp>
193 #include <boost/units/base_units/us/pound.hpp>
194 #include <boost/units/base_units/us/hundredweight.hpp>
195 #include <boost/units/base_units/us/ton.hpp>
197 #include <boost/units/base_units/us/minim.hpp>
198 #include <boost/units/base_units/us/fluid_dram.hpp>
199 #include <boost/units/base_units/us/teaspoon.hpp>
200 #include <boost/units/base_units/us/tablespoon.hpp>
201 #include <boost/units/base_units/us/fluid_ounce.hpp>
202 #include <boost/units/base_units/us/gill.hpp>
203 #include <boost/units/base_units/us/cup.hpp>
204 #include <boost/units/base_units/us/pint.hpp>
205 #include <boost/units/base_units/us/quart.hpp>
206 #include <boost/units/base_units/us/gallon.hpp>
208 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,mil
,length
)
209 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,inch
,length
)
210 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,foot
,length
)
211 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,yard
,length
)
212 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,mile
,length
)
214 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,grain
,mass
)
215 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,dram
,mass
)
216 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,ounce
,mass
)
217 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,pound
,mass
)
218 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,hundredweight
,mass
)
219 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,ton
,mass
)
221 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,minim
,volume
)
222 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,fluid_dram
,volume
)
223 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,teaspoon
,volume
)
224 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,tablespoon
,volume
)
225 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,fluid_ounce
,volume
)
226 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,gill
,volume
)
227 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,cup
,volume
)
228 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,pint
,volume
)
229 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,quart
,volume
)
230 BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us
,gallon
,volume
)
234 using namespace boost::units
;
237 using namespace boost::units::angle
;
239 std::cout
<< "Testing angle base units..." << std::endl
;
241 quantity
<arcsecond_plane_angle
> as(1.0*arcseconds
);
242 quantity
<arcminute_plane_angle
> am(1.0*arcminutes
);
243 quantity
<degree_plane_angle
> d(1.0*degrees
);
244 quantity
<gradian_plane_angle
> g(1.0*gradians
);
245 quantity
<radian_plane_angle
> r(1.0*radians
);
246 quantity
<revolution_plane_angle
> rev(1.0*revolutions
);
248 std::cout
<< as
<< " = " << quantity
<si::plane_angle
>(as
) << std::endl
249 << am
<< " = " << quantity
<si::plane_angle
>(am
) << std::endl
250 << d
<< " = " << quantity
<si::plane_angle
>(d
) << std::endl
251 << g
<< " = " << quantity
<si::plane_angle
>(g
) << std::endl
252 << r
<< " = " << quantity
<si::plane_angle
>(r
) << std::endl
253 << rev
<< " = " << quantity
<si::plane_angle
>(rev
) << std::endl
256 std::cout
<< rev
<< "/" << as
<< " = " << quantity
<si::dimensionless
>(rev
/as
) << std::endl
257 << rev
<< "/" << am
<< " = " << quantity
<si::dimensionless
>(rev
/am
) << std::endl
258 << rev
<< "/" << d
<< " = " << quantity
<si::dimensionless
>(rev
/d
) << std::endl
259 << rev
<< "/" << g
<< " = " << quantity
<si::dimensionless
>(rev
/g
) << std::endl
260 << rev
<< "/" << r
<< " = " << quantity
<si::dimensionless
>(rev
/r
) << std::endl
263 // conversions only work with exponent of +/- 1 in scaled_base_unit?
264 std::cout
<< as
<< " = " << quantity
<arcsecond_plane_angle
>(as
) << std::endl
265 << am
<< " = " << quantity
<arcsecond_plane_angle
>(am
) << std::endl
266 << d
<< " = " << quantity
<arcsecond_plane_angle
>(d
) << std::endl
267 << rev
<< " = " << quantity
<arcsecond_plane_angle
>(rev
) << std::endl
270 // conversions only work with exponent of +/- 1 in scaled_base_unit? see arcsecond.hpp
271 std::cout
<< as
<< " = " << quantity
<arcminute_plane_angle
>(as
) << std::endl
272 << am
<< " = " << quantity
<arcminute_plane_angle
>(am
) << std::endl
273 << d
<< " = " << quantity
<arcminute_plane_angle
>(d
) << std::endl
274 << rev
<< " = " << quantity
<arcminute_plane_angle
>(rev
) << std::endl
277 std::cout
<< as
<< " = " << quantity
<degree_plane_angle
>(as
) << std::endl
278 << am
<< " = " << quantity
<degree_plane_angle
>(am
) << std::endl
279 << d
<< " = " << quantity
<degree_plane_angle
>(d
) << std::endl
280 << rev
<< " = " << quantity
<degree_plane_angle
>(rev
) << std::endl
283 std::cout
<< as
<< " = " << quantity
<revolution_plane_angle
>(as
) << std::endl
284 << am
<< " = " << quantity
<revolution_plane_angle
>(am
) << std::endl
285 << d
<< " = " << quantity
<revolution_plane_angle
>(d
) << std::endl
286 << rev
<< " = " << quantity
<revolution_plane_angle
>(rev
) << std::endl
289 quantity
<steradian_solid_angle
> sa1(1.0*steradians
);
291 std::cout
<< sa1
<< std::endl
296 using namespace boost::units::astronomical
;
298 std::cout
<< "Testing astronomical base units..." << std::endl
;
300 quantity
<light_second_length
> ls(1.0*light_seconds
);
301 quantity
<light_minute_length
> lm(1.0*light_minutes
);
302 quantity
<astronomical_unit_length
> au(1.0*astronomical_units
);
303 quantity
<light_hour_length
> lh(1.0*light_hours
);
304 quantity
<light_day_length
> ld(1.0*light_days
);
305 quantity
<light_year_length
> ly(1.0*light_years
);
306 quantity
<parsec_length
> ps(1.0*parsecs
);
308 std::cout
<< ls
<< " = " << quantity
<si::length
>(ls
) << std::endl
309 << lm
<< " = " << quantity
<si::length
>(lm
) << std::endl
310 << au
<< " = " << quantity
<si::length
>(au
) << std::endl
311 << lh
<< " = " << quantity
<si::length
>(lh
) << std::endl
312 << ld
<< " = " << quantity
<si::length
>(ld
) << std::endl
313 << ly
<< " = " << quantity
<si::length
>(ly
) << std::endl
314 << ps
<< " = " << quantity
<si::length
>(ps
) << std::endl
317 std::cout
<< ly
<< "/" << ls
<< " = " << quantity
<si::dimensionless
>(ly
/ls
) << std::endl
318 << ly
<< "/" << lm
<< " = " << quantity
<si::dimensionless
>(ly
/lm
) << std::endl
319 << ly
<< "/" << au
<< " = " << quantity
<si::dimensionless
>(ly
/au
) << std::endl
320 << ly
<< "/" << lh
<< " = " << quantity
<si::dimensionless
>(ly
/ld
) << std::endl
321 << ly
<< "/" << ld
<< " = " << quantity
<si::dimensionless
>(ly
/lh
) << std::endl
322 << ly
<< "/" << ps
<< " = " << quantity
<si::dimensionless
>(ly
/ps
) << std::endl
325 std::cout
<< ls
<< " = " << quantity
<light_second_length
>(ls
) << std::endl
326 << lm
<< " = " << quantity
<light_second_length
>(lm
) << std::endl
327 << lh
<< " = " << quantity
<light_second_length
>(lh
) << std::endl
328 << ld
<< " = " << quantity
<light_second_length
>(ld
) << std::endl
329 << ly
<< " = " << quantity
<light_second_length
>(ly
) << std::endl
332 std::cout
<< ls
<< " = " << quantity
<light_minute_length
>(ls
) << std::endl
333 << lm
<< " = " << quantity
<light_minute_length
>(lm
) << std::endl
334 << lh
<< " = " << quantity
<light_minute_length
>(lh
) << std::endl
335 << ld
<< " = " << quantity
<light_minute_length
>(ld
) << std::endl
336 << ly
<< " = " << quantity
<light_minute_length
>(ly
) << std::endl
339 std::cout
<< ls
<< " = " << quantity
<light_hour_length
>(ls
) << std::endl
340 << lm
<< " = " << quantity
<light_hour_length
>(lm
) << std::endl
341 << lh
<< " = " << quantity
<light_hour_length
>(lh
) << std::endl
342 << ld
<< " = " << quantity
<light_hour_length
>(ld
) << std::endl
343 << ly
<< " = " << quantity
<light_hour_length
>(ly
) << std::endl
346 std::cout
<< ls
<< " = " << quantity
<light_day_length
>(ls
) << std::endl
347 << lm
<< " = " << quantity
<light_day_length
>(lm
) << std::endl
348 << lh
<< " = " << quantity
<light_day_length
>(lh
) << std::endl
349 << ld
<< " = " << quantity
<light_day_length
>(ld
) << std::endl
350 << ly
<< " = " << quantity
<light_day_length
>(ly
) << std::endl
353 std::cout
<< ls
<< " = " << quantity
<light_year_length
>(ls
) << std::endl
354 << lm
<< " = " << quantity
<light_year_length
>(lm
) << std::endl
355 << lh
<< " = " << quantity
<light_year_length
>(ld
) << std::endl
356 << ld
<< " = " << quantity
<light_year_length
>(lh
) << std::endl
357 << ly
<< " = " << quantity
<light_year_length
>(ly
) << std::endl
362 using namespace boost::units::imperial
;
364 std::cout
<< "Testing imperial base units..." << std::endl
;
366 quantity
<thou_length
> iml1(1.0*thous
);
367 quantity
<inch_length
> iml2(1.0*inchs
);
368 quantity
<foot_length
> iml3(1.0*foots
);
369 quantity
<yard_length
> iml4(1.0*yards
);
370 quantity
<furlong_length
> iml5(1.0*furlongs
);
371 quantity
<mile_length
> iml6(1.0*miles
);
372 quantity
<league_length
> iml7(1.0*leagues
);
374 std::cout
<< iml1
<< " = " << quantity
<si::length
>(iml1
) << std::endl
375 << iml2
<< " = " << quantity
<si::length
>(iml2
) << std::endl
376 << iml3
<< " = " << quantity
<si::length
>(iml3
) << std::endl
377 << iml4
<< " = " << quantity
<si::length
>(iml4
) << std::endl
378 << iml5
<< " = " << quantity
<si::length
>(iml5
) << std::endl
379 << iml6
<< " = " << quantity
<si::length
>(iml6
) << std::endl
380 << iml7
<< " = " << quantity
<si::length
>(iml7
) << std::endl
383 std::cout
<< iml7
<< "/" << iml1
<< " = " << quantity
<si::dimensionless
>(iml7
/iml1
) << std::endl
384 << iml7
<< "/" << iml2
<< " = " << quantity
<si::dimensionless
>(iml7
/iml2
) << std::endl
385 << iml7
<< "/" << iml3
<< " = " << quantity
<si::dimensionless
>(iml7
/iml3
) << std::endl
386 << iml7
<< "/" << iml4
<< " = " << quantity
<si::dimensionless
>(iml7
/iml4
) << std::endl
387 << iml7
<< "/" << iml5
<< " = " << quantity
<si::dimensionless
>(iml7
/iml5
) << std::endl
388 << iml7
<< "/" << iml6
<< " = " << quantity
<si::dimensionless
>(iml7
/iml6
) << std::endl
391 std::cout
<< iml1
<< " = " << quantity
<thou_length
>(iml1
) << std::endl
392 << iml2
<< " = " << quantity
<thou_length
>(iml2
) << std::endl
393 << iml3
<< " = " << quantity
<thou_length
>(iml3
) << std::endl
394 << iml4
<< " = " << quantity
<thou_length
>(iml4
) << std::endl
395 << iml5
<< " = " << quantity
<thou_length
>(iml5
) << std::endl
396 << iml6
<< " = " << quantity
<thou_length
>(iml6
) << std::endl
397 << iml7
<< " = " << quantity
<thou_length
>(iml7
) << std::endl
400 std::cout
<< iml1
<< " = " << quantity
<inch_length
>(iml1
) << std::endl
401 << iml2
<< " = " << quantity
<inch_length
>(iml2
) << std::endl
402 << iml3
<< " = " << quantity
<inch_length
>(iml3
) << std::endl
403 << iml4
<< " = " << quantity
<inch_length
>(iml4
) << std::endl
404 << iml5
<< " = " << quantity
<inch_length
>(iml5
) << std::endl
405 << iml6
<< " = " << quantity
<inch_length
>(iml6
) << std::endl
406 << iml7
<< " = " << quantity
<inch_length
>(iml7
) << std::endl
409 std::cout
<< iml1
<< " = " << quantity
<foot_length
>(iml1
) << std::endl
410 << iml2
<< " = " << quantity
<foot_length
>(iml2
) << std::endl
411 << iml3
<< " = " << quantity
<foot_length
>(iml3
) << std::endl
412 << iml4
<< " = " << quantity
<foot_length
>(iml4
) << std::endl
413 << iml5
<< " = " << quantity
<foot_length
>(iml5
) << std::endl
414 << iml6
<< " = " << quantity
<foot_length
>(iml6
) << std::endl
415 << iml7
<< " = " << quantity
<foot_length
>(iml7
) << std::endl
418 std::cout
<< iml1
<< " = " << quantity
<yard_length
>(iml1
) << std::endl
419 << iml2
<< " = " << quantity
<yard_length
>(iml2
) << std::endl
420 << iml3
<< " = " << quantity
<yard_length
>(iml3
) << std::endl
421 << iml4
<< " = " << quantity
<yard_length
>(iml4
) << std::endl
422 << iml5
<< " = " << quantity
<yard_length
>(iml5
) << std::endl
423 << iml6
<< " = " << quantity
<yard_length
>(iml6
) << std::endl
424 << iml7
<< " = " << quantity
<yard_length
>(iml7
) << std::endl
427 std::cout
<< iml1
<< " = " << quantity
<furlong_length
>(iml1
) << std::endl
428 << iml2
<< " = " << quantity
<furlong_length
>(iml2
) << std::endl
429 << iml3
<< " = " << quantity
<furlong_length
>(iml3
) << std::endl
430 << iml4
<< " = " << quantity
<furlong_length
>(iml4
) << std::endl
431 << iml5
<< " = " << quantity
<furlong_length
>(iml5
) << std::endl
432 << iml6
<< " = " << quantity
<furlong_length
>(iml6
) << std::endl
433 << iml7
<< " = " << quantity
<furlong_length
>(iml7
) << std::endl
436 std::cout
<< iml1
<< " = " << quantity
<mile_length
>(iml1
) << std::endl
437 << iml2
<< " = " << quantity
<mile_length
>(iml2
) << std::endl
438 << iml3
<< " = " << quantity
<mile_length
>(iml3
) << std::endl
439 << iml4
<< " = " << quantity
<mile_length
>(iml4
) << std::endl
440 << iml5
<< " = " << quantity
<mile_length
>(iml5
) << std::endl
441 << iml6
<< " = " << quantity
<mile_length
>(iml6
) << std::endl
442 << iml7
<< " = " << quantity
<mile_length
>(iml7
) << std::endl
445 std::cout
<< iml1
<< " = " << quantity
<league_length
>(iml1
) << std::endl
446 << iml2
<< " = " << quantity
<league_length
>(iml2
) << std::endl
447 << iml3
<< " = " << quantity
<league_length
>(iml3
) << std::endl
448 << iml4
<< " = " << quantity
<league_length
>(iml4
) << std::endl
449 << iml5
<< " = " << quantity
<league_length
>(iml5
) << std::endl
450 << iml6
<< " = " << quantity
<league_length
>(iml6
) << std::endl
451 << iml7
<< " = " << quantity
<league_length
>(iml7
) << std::endl
454 quantity
<grain_mass
> imm1(1.0*grains
);
455 quantity
<drachm_mass
> imm2(1.0*drachms
);
456 quantity
<ounce_mass
> imm3(1.0*ounces
);
457 quantity
<pound_mass
> imm4(1.0*pounds
);
458 quantity
<stone_mass
> imm5(1.0*stones
);
459 quantity
<quarter_mass
> imm6(1.0*quarters
);
460 quantity
<hundredweight_mass
> imm7(1.0*hundredweights
);
461 quantity
<ton_mass
> imm8(1.0*tons
);
463 std::cout
<< imm1
<< " = " << quantity
<si::mass
>(imm1
) << std::endl
464 << imm2
<< " = " << quantity
<si::mass
>(imm2
) << std::endl
465 << imm3
<< " = " << quantity
<si::mass
>(imm3
) << std::endl
466 << imm4
<< " = " << quantity
<si::mass
>(imm4
) << std::endl
467 << imm5
<< " = " << quantity
<si::mass
>(imm5
) << std::endl
468 << imm6
<< " = " << quantity
<si::mass
>(imm6
) << std::endl
469 << imm7
<< " = " << quantity
<si::mass
>(imm7
) << std::endl
470 << imm8
<< " = " << quantity
<si::mass
>(imm8
) << std::endl
473 std::cout
<< imm8
<< "/" << imm1
<< " = " << quantity
<si::dimensionless
>(imm8
/imm1
) << std::endl
474 << imm8
<< "/" << imm2
<< " = " << quantity
<si::dimensionless
>(imm8
/imm2
) << std::endl
475 << imm8
<< "/" << imm3
<< " = " << quantity
<si::dimensionless
>(imm8
/imm3
) << std::endl
476 << imm8
<< "/" << imm4
<< " = " << quantity
<si::dimensionless
>(imm8
/imm4
) << std::endl
477 << imm8
<< "/" << imm5
<< " = " << quantity
<si::dimensionless
>(imm8
/imm5
) << std::endl
478 << imm8
<< "/" << imm6
<< " = " << quantity
<si::dimensionless
>(imm8
/imm6
) << std::endl
479 << imm8
<< "/" << imm7
<< " = " << quantity
<si::dimensionless
>(imm8
/imm7
) << std::endl
482 std::cout
<< imm1
<< " = " << quantity
<grain_mass
>(imm1
) << std::endl
483 << imm2
<< " = " << quantity
<grain_mass
>(imm2
) << std::endl
484 << imm3
<< " = " << quantity
<grain_mass
>(imm3
) << std::endl
485 << imm4
<< " = " << quantity
<grain_mass
>(imm4
) << std::endl
486 << imm5
<< " = " << quantity
<grain_mass
>(imm5
) << std::endl
487 << imm6
<< " = " << quantity
<grain_mass
>(imm6
) << std::endl
488 << imm7
<< " = " << quantity
<grain_mass
>(imm7
) << std::endl
489 << imm8
<< " = " << quantity
<grain_mass
>(imm8
) << std::endl
492 std::cout
<< imm1
<< " = " << quantity
<drachm_mass
>(imm1
) << std::endl
493 << imm2
<< " = " << quantity
<drachm_mass
>(imm2
) << std::endl
494 << imm3
<< " = " << quantity
<drachm_mass
>(imm3
) << std::endl
495 << imm4
<< " = " << quantity
<drachm_mass
>(imm4
) << std::endl
496 << imm5
<< " = " << quantity
<drachm_mass
>(imm5
) << std::endl
497 << imm6
<< " = " << quantity
<drachm_mass
>(imm6
) << std::endl
498 << imm7
<< " = " << quantity
<drachm_mass
>(imm7
) << std::endl
499 << imm8
<< " = " << quantity
<drachm_mass
>(imm8
) << std::endl
502 std::cout
<< imm1
<< " = " << quantity
<ounce_mass
>(imm1
) << std::endl
503 << imm2
<< " = " << quantity
<ounce_mass
>(imm2
) << std::endl
504 << imm3
<< " = " << quantity
<ounce_mass
>(imm3
) << std::endl
505 << imm4
<< " = " << quantity
<ounce_mass
>(imm4
) << std::endl
506 << imm5
<< " = " << quantity
<ounce_mass
>(imm5
) << std::endl
507 << imm6
<< " = " << quantity
<ounce_mass
>(imm6
) << std::endl
508 << imm7
<< " = " << quantity
<ounce_mass
>(imm7
) << std::endl
509 << imm8
<< " = " << quantity
<ounce_mass
>(imm8
) << std::endl
512 std::cout
<< imm1
<< " = " << quantity
<pound_mass
>(imm1
) << std::endl
513 << imm2
<< " = " << quantity
<pound_mass
>(imm2
) << std::endl
514 << imm3
<< " = " << quantity
<pound_mass
>(imm3
) << std::endl
515 << imm4
<< " = " << quantity
<pound_mass
>(imm4
) << std::endl
516 << imm5
<< " = " << quantity
<pound_mass
>(imm5
) << std::endl
517 << imm6
<< " = " << quantity
<pound_mass
>(imm6
) << std::endl
518 << imm7
<< " = " << quantity
<pound_mass
>(imm7
) << std::endl
519 << imm8
<< " = " << quantity
<pound_mass
>(imm8
) << std::endl
522 std::cout
<< imm1
<< " = " << quantity
<stone_mass
>(imm1
) << std::endl
523 << imm2
<< " = " << quantity
<stone_mass
>(imm2
) << std::endl
524 << imm3
<< " = " << quantity
<stone_mass
>(imm3
) << std::endl
525 << imm4
<< " = " << quantity
<stone_mass
>(imm4
) << std::endl
526 << imm5
<< " = " << quantity
<stone_mass
>(imm5
) << std::endl
527 << imm6
<< " = " << quantity
<stone_mass
>(imm6
) << std::endl
528 << imm7
<< " = " << quantity
<stone_mass
>(imm7
) << std::endl
529 << imm8
<< " = " << quantity
<stone_mass
>(imm8
) << std::endl
532 std::cout
<< imm1
<< " = " << quantity
<quarter_mass
>(imm1
) << std::endl
533 << imm2
<< " = " << quantity
<quarter_mass
>(imm2
) << std::endl
534 << imm3
<< " = " << quantity
<quarter_mass
>(imm3
) << std::endl
535 << imm4
<< " = " << quantity
<quarter_mass
>(imm4
) << std::endl
536 << imm5
<< " = " << quantity
<quarter_mass
>(imm5
) << std::endl
537 << imm6
<< " = " << quantity
<quarter_mass
>(imm6
) << std::endl
538 << imm7
<< " = " << quantity
<quarter_mass
>(imm7
) << std::endl
539 << imm8
<< " = " << quantity
<quarter_mass
>(imm8
) << std::endl
542 std::cout
<< imm1
<< " = " << quantity
<hundredweight_mass
>(imm1
) << std::endl
543 << imm2
<< " = " << quantity
<hundredweight_mass
>(imm2
) << std::endl
544 << imm3
<< " = " << quantity
<hundredweight_mass
>(imm3
) << std::endl
545 << imm4
<< " = " << quantity
<hundredweight_mass
>(imm4
) << std::endl
546 << imm5
<< " = " << quantity
<hundredweight_mass
>(imm5
) << std::endl
547 << imm6
<< " = " << quantity
<hundredweight_mass
>(imm6
) << std::endl
548 << imm7
<< " = " << quantity
<hundredweight_mass
>(imm7
) << std::endl
549 << imm8
<< " = " << quantity
<hundredweight_mass
>(imm8
) << std::endl
552 std::cout
<< imm1
<< " = " << quantity
<ton_mass
>(imm1
) << std::endl
553 << imm2
<< " = " << quantity
<ton_mass
>(imm2
) << std::endl
554 << imm3
<< " = " << quantity
<ton_mass
>(imm3
) << std::endl
555 << imm4
<< " = " << quantity
<ton_mass
>(imm4
) << std::endl
556 << imm5
<< " = " << quantity
<ton_mass
>(imm5
) << std::endl
557 << imm6
<< " = " << quantity
<ton_mass
>(imm6
) << std::endl
558 << imm7
<< " = " << quantity
<ton_mass
>(imm7
) << std::endl
559 << imm8
<< " = " << quantity
<ton_mass
>(imm8
) << std::endl
562 quantity
<fluid_ounce_volume
> imv1(1.0*fluid_ounces
);
563 quantity
<gill_volume
> imv2(1.0*gills
);
564 quantity
<pint_volume
> imv3(1.0*pints
);
565 quantity
<quart_volume
> imv4(1.0*quarts
);
566 quantity
<gallon_volume
> imv5(1.0*gallons
);
568 std::cout
<< imv1
<< " = " << quantity
<si::volume
>(imv1
) << std::endl
569 << imv2
<< " = " << quantity
<si::volume
>(imv2
) << std::endl
570 << imv3
<< " = " << quantity
<si::volume
>(imv3
) << std::endl
571 << imv4
<< " = " << quantity
<si::volume
>(imv4
) << std::endl
572 << imv5
<< " = " << quantity
<si::volume
>(imv5
) << std::endl
575 std::cout
<< imv5
<< "/" << imv1
<< " = " << quantity
<si::dimensionless
>(imv5
/imv1
) << std::endl
576 << imv5
<< "/" << imv2
<< " = " << quantity
<si::dimensionless
>(imv5
/imv2
) << std::endl
577 << imv5
<< "/" << imv3
<< " = " << quantity
<si::dimensionless
>(imv5
/imv3
) << std::endl
578 << imv5
<< "/" << imv4
<< " = " << quantity
<si::dimensionless
>(imv5
/imv4
) << std::endl
581 std::cout
<< imv1
<< " = " << quantity
<fluid_ounce_volume
>(imv1
) << std::endl
582 << imv2
<< " = " << quantity
<fluid_ounce_volume
>(imv2
) << std::endl
583 << imv3
<< " = " << quantity
<fluid_ounce_volume
>(imv3
) << std::endl
584 << imv4
<< " = " << quantity
<fluid_ounce_volume
>(imv4
) << std::endl
585 << imv5
<< " = " << quantity
<fluid_ounce_volume
>(imv5
) << std::endl
588 std::cout
<< imv1
<< " = " << quantity
<gill_volume
>(imv1
) << std::endl
589 << imv2
<< " = " << quantity
<gill_volume
>(imv2
) << std::endl
590 << imv3
<< " = " << quantity
<gill_volume
>(imv3
) << std::endl
591 << imv4
<< " = " << quantity
<gill_volume
>(imv4
) << std::endl
592 << imv5
<< " = " << quantity
<gill_volume
>(imv5
) << std::endl
595 std::cout
<< imv1
<< " = " << quantity
<pint_volume
>(imv1
) << std::endl
596 << imv2
<< " = " << quantity
<pint_volume
>(imv2
) << std::endl
597 << imv3
<< " = " << quantity
<pint_volume
>(imv3
) << std::endl
598 << imv4
<< " = " << quantity
<pint_volume
>(imv4
) << std::endl
599 << imv5
<< " = " << quantity
<pint_volume
>(imv5
) << std::endl
602 std::cout
<< imv1
<< " = " << quantity
<quart_volume
>(imv1
) << std::endl
603 << imv2
<< " = " << quantity
<quart_volume
>(imv2
) << std::endl
604 << imv3
<< " = " << quantity
<quart_volume
>(imv3
) << std::endl
605 << imv4
<< " = " << quantity
<quart_volume
>(imv4
) << std::endl
606 << imv5
<< " = " << quantity
<quart_volume
>(imv5
) << std::endl
609 std::cout
<< imv1
<< " = " << quantity
<gallon_volume
>(imv1
) << std::endl
610 << imv2
<< " = " << quantity
<gallon_volume
>(imv2
) << std::endl
611 << imv3
<< " = " << quantity
<gallon_volume
>(imv3
) << std::endl
612 << imv4
<< " = " << quantity
<gallon_volume
>(imv4
) << std::endl
613 << imv5
<< " = " << quantity
<gallon_volume
>(imv5
) << std::endl
618 using namespace boost::units::metric
;
620 std::cout
<< "Testing metric base units..." << std::endl
;
622 quantity
<fermi_length
> ml1(1.0*fermis
);
623 quantity
<angstrom_length
> ml2(1.0*angstroms
);
624 quantity
<micron_length
> ml3(1.0*microns
);
625 quantity
<nautical_mile_length
> ml4(1.0*nautical_miles
);
627 std::cout
<< ml1
<< " = " << quantity
<si::length
>(ml1
) << std::endl
628 << ml2
<< " = " << quantity
<si::length
>(ml2
) << std::endl
629 << ml3
<< " = " << quantity
<si::length
>(ml3
) << std::endl
630 << ml4
<< " = " << quantity
<si::length
>(ml4
) << std::endl
633 std::cout
<< ml4
<< "/" << ml1
<< " = " << quantity
<si::dimensionless
>(ml4
/ml1
) << std::endl
634 << ml4
<< "/" << ml2
<< " = " << quantity
<si::dimensionless
>(ml4
/ml2
) << std::endl
635 << ml4
<< "/" << ml3
<< " = " << quantity
<si::dimensionless
>(ml4
/ml3
) << std::endl
638 std::cout
<< ml1
<< " = " << quantity
<fermi_length
>(ml1
) << std::endl
639 << ml2
<< " = " << quantity
<fermi_length
>(ml2
) << std::endl
640 << ml3
<< " = " << quantity
<fermi_length
>(ml3
) << std::endl
641 << ml4
<< " = " << quantity
<fermi_length
>(ml4
) << std::endl
644 std::cout
<< ml1
<< " = " << quantity
<angstrom_length
>(ml1
) << std::endl
645 << ml2
<< " = " << quantity
<angstrom_length
>(ml2
) << std::endl
646 << ml3
<< " = " << quantity
<angstrom_length
>(ml3
) << std::endl
647 << ml4
<< " = " << quantity
<angstrom_length
>(ml4
) << std::endl
650 std::cout
<< ml1
<< " = " << quantity
<micron_length
>(ml1
) << std::endl
651 << ml2
<< " = " << quantity
<micron_length
>(ml2
) << std::endl
652 << ml3
<< " = " << quantity
<micron_length
>(ml3
) << std::endl
653 << ml4
<< " = " << quantity
<micron_length
>(ml4
) << std::endl
656 std::cout
<< ml1
<< " = " << quantity
<nautical_mile_length
>(ml1
) << std::endl
657 << ml2
<< " = " << quantity
<nautical_mile_length
>(ml2
) << std::endl
658 << ml3
<< " = " << quantity
<nautical_mile_length
>(ml3
) << std::endl
659 << ml4
<< " = " << quantity
<nautical_mile_length
>(ml4
) << std::endl
662 quantity
<ton_mass
> mm1(1.0*tons
);
664 std::cout
<< mm1
<< " = " << quantity
<cgs::mass
>(mm1
) << std::endl
665 //<< quantity<si::mass>(mm1) << std::endl // this should work...
668 quantity
<minute_time
> mt1(1.0*minutes
);
669 quantity
<hour_time
> mt2(1.0*hours
);
670 quantity
<day_time
> mt3(1.0*days
);
671 quantity
<year_time
> mt4(1.0*years
);
673 std::cout
<< mt1
<< " = " << quantity
<si::time
>(mt1
) << std::endl
674 << mt2
<< " = " << quantity
<si::time
>(mt2
) << std::endl
675 << mt3
<< " = " << quantity
<si::time
>(mt3
) << std::endl
676 << mt4
<< " = " << quantity
<si::time
>(mt4
) << std::endl
679 std::cout
<< mt4
<< "/" << mt1
<< " = " << quantity
<si::dimensionless
>(mt4
/mt1
) << std::endl
680 << mt4
<< "/" << mt2
<< " = " << quantity
<si::dimensionless
>(mt4
/mt2
) << std::endl
681 << mt4
<< "/" << mt3
<< " = " << quantity
<si::dimensionless
>(mt4
/mt3
) << std::endl
684 std::cout
<< mt1
<< " = " << quantity
<minute_time
>(mt1
) << std::endl
685 << mt2
<< " = " << quantity
<minute_time
>(mt2
) << std::endl
686 << mt3
<< " = " << quantity
<minute_time
>(mt3
) << std::endl
687 << mt4
<< " = " << quantity
<minute_time
>(mt4
) << std::endl
690 std::cout
<< mt1
<< " = " << quantity
<hour_time
>(mt1
) << std::endl
691 << mt2
<< " = " << quantity
<hour_time
>(mt2
) << std::endl
692 << mt3
<< " = " << quantity
<hour_time
>(mt3
) << std::endl
693 << mt4
<< " = " << quantity
<hour_time
>(mt4
) << std::endl
696 std::cout
<< mt1
<< " = " << quantity
<day_time
>(mt1
) << std::endl
697 << mt2
<< " = " << quantity
<day_time
>(mt2
) << std::endl
698 << mt3
<< " = " << quantity
<day_time
>(mt3
) << std::endl
699 << mt4
<< " = " << quantity
<day_time
>(mt4
) << std::endl
702 std::cout
<< mt1
<< " = " << quantity
<year_time
>(mt1
) << std::endl
703 << mt2
<< " = " << quantity
<year_time
>(mt2
) << std::endl
704 << mt3
<< " = " << quantity
<year_time
>(mt3
) << std::endl
705 << mt4
<< " = " << quantity
<year_time
>(mt4
) << std::endl
708 quantity
<knot_velocity
> ms1(1.0*knots
);
710 std::cout
<< ms1
<< " = " << quantity
<si::velocity
>(ms1
) << std::endl
713 quantity
<barn_area
> ma1(1.0*barns
);
714 quantity
<are_area
> ma2(1.0*ares
);
715 quantity
<hectare_area
> ma3(1.0*hectares
);
717 std::cout
<< ma1
<< " = " << quantity
<si::area
>(ma1
) << std::endl
718 << ma2
<< " = " << quantity
<si::area
>(ma2
) << std::endl
719 << ma3
<< " = " << quantity
<si::area
>(ma3
) << std::endl
722 std::cout
<< ma3
<< "/" << ma1
<< " = " << quantity
<si::dimensionless
>(ma3
/ma1
) << std::endl
723 << ma3
<< "/" << ma2
<< " = " << quantity
<si::dimensionless
>(ma3
/ma2
) << std::endl
726 std::cout
<< ma1
<< " = " << quantity
<barn_area
>(ma1
) << std::endl
727 << ma2
<< " = " << quantity
<barn_area
>(ma2
) << std::endl
728 << ma3
<< " = " << quantity
<barn_area
>(ma3
) << std::endl
731 std::cout
<< ma1
<< " = " << quantity
<are_area
>(ma1
) << std::endl
732 << ma2
<< " = " << quantity
<are_area
>(ma2
) << std::endl
733 << ma3
<< " = " << quantity
<are_area
>(ma3
) << std::endl
736 std::cout
<< ma1
<< " = " << quantity
<hectare_area
>(ma1
) << std::endl
737 << ma2
<< " = " << quantity
<hectare_area
>(ma2
) << std::endl
738 << ma3
<< " = " << quantity
<hectare_area
>(ma3
) << std::endl
741 quantity
<liter_volume
> mv1(1.0*liters
);
743 std::cout
<< mv1
<< " = " << quantity
<si::volume
>(mv1
) << std::endl
746 quantity
<mmHg_pressure
> mp1(1.0*mmHgs
);
747 quantity
<torr_pressure
> mp2(1.0*torrs
);
748 quantity
<bar_pressure
> mp3(1.0*bars
);
749 quantity
<atmosphere_pressure
> mp4(1.0*atmospheres
);
751 std::cout
<< mp1
<< " = " << quantity
<si::pressure
>(mp1
) << std::endl
752 << mp2
<< " = " << quantity
<si::pressure
>(mp2
) << std::endl
753 << mp3
<< " = " << quantity
<si::pressure
>(mp3
) << std::endl
754 << mp4
<< " = " << quantity
<si::pressure
>(mp4
) << std::endl
757 std::cout
<< mp4
<< "/" << mp1
<< " = " << quantity
<si::dimensionless
>(mp4
/mp1
) << std::endl
758 << mp4
<< "/" << mp2
<< " = " << quantity
<si::dimensionless
>(mp4
/mp2
) << std::endl
759 << mp4
<< "/" << mp3
<< " = " << quantity
<si::dimensionless
>(mp4
/mp3
) << std::endl
762 std::cout
<< mp1
<< " = " << quantity
<mmHg_pressure
>(mp1
) << std::endl
763 << mp2
<< " = " << quantity
<mmHg_pressure
>(mp2
) << std::endl
764 << mp3
<< " = " << quantity
<mmHg_pressure
>(mp3
) << std::endl
765 << mp4
<< " = " << quantity
<mmHg_pressure
>(mp4
) << std::endl
768 std::cout
<< mp1
<< " = " << quantity
<torr_pressure
>(mp1
) << std::endl
769 << mp2
<< " = " << quantity
<torr_pressure
>(mp2
) << std::endl
770 << mp3
<< " = " << quantity
<torr_pressure
>(mp3
) << std::endl
771 << mp4
<< " = " << quantity
<torr_pressure
>(mp4
) << std::endl
774 std::cout
<< mp1
<< " = " << quantity
<bar_pressure
>(mp1
) << std::endl
775 << mp2
<< " = " << quantity
<bar_pressure
>(mp2
) << std::endl
776 << mp3
<< " = " << quantity
<bar_pressure
>(mp3
) << std::endl
777 << mp4
<< " = " << quantity
<bar_pressure
>(mp4
) << std::endl
780 std::cout
<< mp1
<< " = " << quantity
<atmosphere_pressure
>(mp1
) << std::endl
781 << mp2
<< " = " << quantity
<atmosphere_pressure
>(mp2
) << std::endl
782 << mp3
<< " = " << quantity
<atmosphere_pressure
>(mp3
) << std::endl
783 << mp4
<< " = " << quantity
<atmosphere_pressure
>(mp4
) << std::endl
788 using namespace boost::units::us
;
790 std::cout
<< "Testing U.S. customary base units..." << std::endl
;
792 quantity
<mil_length
> iml1(1.0*mils
);
793 quantity
<inch_length
> iml2(1.0*inchs
);
794 quantity
<foot_length
> iml3(1.0*foots
);
795 quantity
<yard_length
> iml4(1.0*yards
);
796 quantity
<mile_length
> iml5(1.0*miles
);
798 std::cout
<< iml1
<< " = " << quantity
<si::length
>(iml1
) << std::endl
799 << iml2
<< " = " << quantity
<si::length
>(iml2
) << std::endl
800 << iml3
<< " = " << quantity
<si::length
>(iml3
) << std::endl
801 << iml4
<< " = " << quantity
<si::length
>(iml4
) << std::endl
802 << iml5
<< " = " << quantity
<si::length
>(iml5
) << std::endl
805 std::cout
<< iml5
<< "/" << iml1
<< " = " << quantity
<si::dimensionless
>(iml5
/iml1
) << std::endl
806 << iml5
<< "/" << iml2
<< " = " << quantity
<si::dimensionless
>(iml5
/iml2
) << std::endl
807 << iml5
<< "/" << iml3
<< " = " << quantity
<si::dimensionless
>(iml5
/iml3
) << std::endl
808 << iml5
<< "/" << iml4
<< " = " << quantity
<si::dimensionless
>(iml5
/iml4
) << std::endl
811 std::cout
<< iml1
<< " = " << quantity
<mil_length
>(iml1
) << std::endl
812 << iml2
<< " = " << quantity
<mil_length
>(iml2
) << std::endl
813 << iml3
<< " = " << quantity
<mil_length
>(iml3
) << std::endl
814 << iml4
<< " = " << quantity
<mil_length
>(iml4
) << std::endl
815 << iml5
<< " = " << quantity
<mil_length
>(iml5
) << std::endl
818 std::cout
<< iml1
<< " = " << quantity
<inch_length
>(iml1
) << std::endl
819 << iml2
<< " = " << quantity
<inch_length
>(iml2
) << std::endl
820 << iml3
<< " = " << quantity
<inch_length
>(iml3
) << std::endl
821 << iml4
<< " = " << quantity
<inch_length
>(iml4
) << std::endl
822 << iml5
<< " = " << quantity
<inch_length
>(iml5
) << std::endl
825 std::cout
<< iml1
<< " = " << quantity
<foot_length
>(iml1
) << std::endl
826 << iml2
<< " = " << quantity
<foot_length
>(iml2
) << std::endl
827 << iml3
<< " = " << quantity
<foot_length
>(iml3
) << std::endl
828 << iml4
<< " = " << quantity
<foot_length
>(iml4
) << std::endl
829 << iml5
<< " = " << quantity
<foot_length
>(iml5
) << std::endl
832 std::cout
<< iml1
<< " = " << quantity
<yard_length
>(iml1
) << std::endl
833 << iml2
<< " = " << quantity
<yard_length
>(iml2
) << std::endl
834 << iml3
<< " = " << quantity
<yard_length
>(iml3
) << std::endl
835 << iml4
<< " = " << quantity
<yard_length
>(iml4
) << std::endl
836 << iml5
<< " = " << quantity
<yard_length
>(iml5
) << std::endl
839 std::cout
<< iml1
<< " = " << quantity
<mile_length
>(iml1
) << std::endl
840 << iml2
<< " = " << quantity
<mile_length
>(iml2
) << std::endl
841 << iml3
<< " = " << quantity
<mile_length
>(iml3
) << std::endl
842 << iml4
<< " = " << quantity
<mile_length
>(iml4
) << std::endl
843 << iml5
<< " = " << quantity
<mile_length
>(iml5
) << std::endl
846 quantity
<grain_mass
> imm1(1.0*grains
);
847 quantity
<dram_mass
> imm2(1.0*drams
);
848 quantity
<ounce_mass
> imm3(1.0*ounces
);
849 quantity
<pound_mass
> imm4(1.0*pounds
);
850 quantity
<hundredweight_mass
> imm5(1.0*hundredweights
);
851 quantity
<ton_mass
> imm6(1.0*tons
);
853 std::cout
<< imm1
<< " = " << quantity
<si::mass
>(imm1
) << std::endl
854 << imm2
<< " = " << quantity
<si::mass
>(imm2
) << std::endl
855 << imm3
<< " = " << quantity
<si::mass
>(imm3
) << std::endl
856 << imm4
<< " = " << quantity
<si::mass
>(imm4
) << std::endl
857 << imm5
<< " = " << quantity
<si::mass
>(imm5
) << std::endl
858 << imm6
<< " = " << quantity
<si::mass
>(imm6
) << std::endl
861 std::cout
<< imm6
<< "/" << imm1
<< " = " << quantity
<si::dimensionless
>(imm6
/imm1
) << std::endl
862 << imm6
<< "/" << imm2
<< " = " << quantity
<si::dimensionless
>(imm6
/imm2
) << std::endl
863 << imm6
<< "/" << imm3
<< " = " << quantity
<si::dimensionless
>(imm6
/imm3
) << std::endl
864 << imm6
<< "/" << imm4
<< " = " << quantity
<si::dimensionless
>(imm6
/imm4
) << std::endl
865 << imm6
<< "/" << imm5
<< " = " << quantity
<si::dimensionless
>(imm6
/imm5
) << std::endl
868 std::cout
<< imm1
<< " = " << quantity
<grain_mass
>(imm1
) << std::endl
869 << imm2
<< " = " << quantity
<grain_mass
>(imm2
) << std::endl
870 << imm3
<< " = " << quantity
<grain_mass
>(imm3
) << std::endl
871 << imm4
<< " = " << quantity
<grain_mass
>(imm4
) << std::endl
872 << imm5
<< " = " << quantity
<grain_mass
>(imm5
) << std::endl
873 << imm6
<< " = " << quantity
<grain_mass
>(imm6
) << std::endl
876 std::cout
<< imm1
<< " = " << quantity
<dram_mass
>(imm1
) << std::endl
877 << imm2
<< " = " << quantity
<dram_mass
>(imm2
) << std::endl
878 << imm3
<< " = " << quantity
<dram_mass
>(imm3
) << std::endl
879 << imm4
<< " = " << quantity
<dram_mass
>(imm4
) << std::endl
880 << imm5
<< " = " << quantity
<dram_mass
>(imm5
) << std::endl
881 << imm6
<< " = " << quantity
<dram_mass
>(imm6
) << std::endl
884 std::cout
<< imm1
<< " = " << quantity
<ounce_mass
>(imm1
) << std::endl
885 << imm2
<< " = " << quantity
<ounce_mass
>(imm2
) << std::endl
886 << imm3
<< " = " << quantity
<ounce_mass
>(imm3
) << std::endl
887 << imm4
<< " = " << quantity
<ounce_mass
>(imm4
) << std::endl
888 << imm5
<< " = " << quantity
<ounce_mass
>(imm5
) << std::endl
889 << imm6
<< " = " << quantity
<ounce_mass
>(imm6
) << std::endl
892 std::cout
<< imm1
<< " = " << quantity
<pound_mass
>(imm1
) << std::endl
893 << imm2
<< " = " << quantity
<pound_mass
>(imm2
) << std::endl
894 << imm3
<< " = " << quantity
<pound_mass
>(imm3
) << std::endl
895 << imm4
<< " = " << quantity
<pound_mass
>(imm4
) << std::endl
896 << imm5
<< " = " << quantity
<pound_mass
>(imm5
) << std::endl
897 << imm6
<< " = " << quantity
<pound_mass
>(imm6
) << std::endl
900 std::cout
<< imm1
<< " = " << quantity
<hundredweight_mass
>(imm1
) << std::endl
901 << imm2
<< " = " << quantity
<hundredweight_mass
>(imm2
) << std::endl
902 << imm3
<< " = " << quantity
<hundredweight_mass
>(imm3
) << std::endl
903 << imm4
<< " = " << quantity
<hundredweight_mass
>(imm4
) << std::endl
904 << imm5
<< " = " << quantity
<hundredweight_mass
>(imm5
) << std::endl
905 << imm6
<< " = " << quantity
<hundredweight_mass
>(imm6
) << std::endl
908 std::cout
<< imm1
<< " = " << quantity
<ton_mass
>(imm1
) << std::endl
909 << imm2
<< " = " << quantity
<ton_mass
>(imm2
) << std::endl
910 << imm3
<< " = " << quantity
<ton_mass
>(imm3
) << std::endl
911 << imm4
<< " = " << quantity
<ton_mass
>(imm4
) << std::endl
912 << imm5
<< " = " << quantity
<ton_mass
>(imm5
) << std::endl
913 << imm6
<< " = " << quantity
<ton_mass
>(imm6
) << std::endl
916 quantity
<minim_volume
> imv1(1.0*minims
);
917 quantity
<fluid_dram_volume
> imv2(1.0*fluid_drams
);
918 quantity
<teaspoon_volume
> imv3(1.0*teaspoons
);
919 quantity
<tablespoon_volume
> imv4(1.0*tablespoons
);
920 quantity
<fluid_ounce_volume
> imv5(1.0*fluid_ounces
);
921 quantity
<gill_volume
> imv6(1.0*gills
);
922 quantity
<cup_volume
> imv7(1.0*cups
);
923 quantity
<pint_volume
> imv8(1.0*pints
);
924 quantity
<quart_volume
> imv9(1.0*quarts
);
925 quantity
<gallon_volume
> imv10(1.0*gallons
);
927 std::cout
<< imv1
<< " = " << quantity
<si::volume
>(imv1
) << std::endl
928 << imv2
<< " = " << quantity
<si::volume
>(imv2
) << std::endl
929 << imv3
<< " = " << quantity
<si::volume
>(imv3
) << std::endl
930 << imv4
<< " = " << quantity
<si::volume
>(imv4
) << std::endl
931 << imv5
<< " = " << quantity
<si::volume
>(imv5
) << std::endl
932 << imv6
<< " = " << quantity
<si::volume
>(imv6
) << std::endl
933 << imv7
<< " = " << quantity
<si::volume
>(imv7
) << std::endl
934 << imv8
<< " = " << quantity
<si::volume
>(imv8
) << std::endl
935 << imv9
<< " = " << quantity
<si::volume
>(imv9
) << std::endl
936 << imv10
<< " = " << quantity
<si::volume
>(imv10
) << std::endl
939 std::cout
<< imv10
<< "/" << imv1
<< " = " << quantity
<si::dimensionless
>(imv10
/imv1
) << std::endl
940 << imv10
<< "/" << imv2
<< " = " << quantity
<si::dimensionless
>(imv10
/imv2
) << std::endl
941 << imv10
<< "/" << imv3
<< " = " << quantity
<si::dimensionless
>(imv10
/imv3
) << std::endl
942 << imv10
<< "/" << imv4
<< " = " << quantity
<si::dimensionless
>(imv10
/imv4
) << std::endl
943 << imv10
<< "/" << imv5
<< " = " << quantity
<si::dimensionless
>(imv10
/imv5
) << std::endl
944 << imv10
<< "/" << imv6
<< " = " << quantity
<si::dimensionless
>(imv10
/imv6
) << std::endl
945 << imv10
<< "/" << imv7
<< " = " << quantity
<si::dimensionless
>(imv10
/imv7
) << std::endl
946 << imv10
<< "/" << imv8
<< " = " << quantity
<si::dimensionless
>(imv10
/imv8
) << std::endl
947 << imv10
<< "/" << imv9
<< " = " << quantity
<si::dimensionless
>(imv10
/imv9
) << std::endl
950 std::cout
<< imv1
<< " = " << quantity
<minim_volume
>(imv1
) << std::endl
951 << imv2
<< " = " << quantity
<minim_volume
>(imv2
) << std::endl
952 << imv3
<< " = " << quantity
<minim_volume
>(imv3
) << std::endl
953 << imv4
<< " = " << quantity
<minim_volume
>(imv4
) << std::endl
954 << imv5
<< " = " << quantity
<minim_volume
>(imv5
) << std::endl
955 << imv6
<< " = " << quantity
<minim_volume
>(imv6
) << std::endl
956 << imv7
<< " = " << quantity
<minim_volume
>(imv7
) << std::endl
957 << imv8
<< " = " << quantity
<minim_volume
>(imv8
) << std::endl
958 << imv9
<< " = " << quantity
<minim_volume
>(imv9
) << std::endl
959 << imv10
<< " = " << quantity
<minim_volume
>(imv10
) << std::endl
962 std::cout
<< imv1
<< " = " << quantity
<fluid_dram_volume
>(imv1
) << std::endl
963 << imv2
<< " = " << quantity
<fluid_dram_volume
>(imv2
) << std::endl
964 << imv3
<< " = " << quantity
<fluid_dram_volume
>(imv3
) << std::endl
965 << imv4
<< " = " << quantity
<fluid_dram_volume
>(imv4
) << std::endl
966 << imv5
<< " = " << quantity
<fluid_dram_volume
>(imv5
) << std::endl
967 << imv6
<< " = " << quantity
<fluid_dram_volume
>(imv6
) << std::endl
968 << imv7
<< " = " << quantity
<fluid_dram_volume
>(imv7
) << std::endl
969 << imv8
<< " = " << quantity
<fluid_dram_volume
>(imv8
) << std::endl
970 << imv9
<< " = " << quantity
<fluid_dram_volume
>(imv9
) << std::endl
971 << imv10
<< " = " << quantity
<fluid_dram_volume
>(imv10
) << std::endl
974 std::cout
<< imv1
<< " = " << quantity
<teaspoon_volume
>(imv1
) << std::endl
975 << imv2
<< " = " << quantity
<teaspoon_volume
>(imv2
) << std::endl
976 << imv3
<< " = " << quantity
<teaspoon_volume
>(imv3
) << std::endl
977 << imv4
<< " = " << quantity
<teaspoon_volume
>(imv4
) << std::endl
978 << imv5
<< " = " << quantity
<teaspoon_volume
>(imv5
) << std::endl
979 << imv6
<< " = " << quantity
<teaspoon_volume
>(imv6
) << std::endl
980 << imv7
<< " = " << quantity
<teaspoon_volume
>(imv7
) << std::endl
981 << imv8
<< " = " << quantity
<teaspoon_volume
>(imv8
) << std::endl
982 << imv9
<< " = " << quantity
<teaspoon_volume
>(imv9
) << std::endl
983 << imv10
<< " = " << quantity
<teaspoon_volume
>(imv10
) << std::endl
986 std::cout
<< imv1
<< " = " << quantity
<tablespoon_volume
>(imv1
) << std::endl
987 << imv2
<< " = " << quantity
<tablespoon_volume
>(imv2
) << std::endl
988 << imv3
<< " = " << quantity
<tablespoon_volume
>(imv3
) << std::endl
989 << imv4
<< " = " << quantity
<tablespoon_volume
>(imv4
) << std::endl
990 << imv5
<< " = " << quantity
<tablespoon_volume
>(imv5
) << std::endl
991 << imv6
<< " = " << quantity
<tablespoon_volume
>(imv6
) << std::endl
992 << imv7
<< " = " << quantity
<tablespoon_volume
>(imv7
) << std::endl
993 << imv8
<< " = " << quantity
<tablespoon_volume
>(imv8
) << std::endl
994 << imv9
<< " = " << quantity
<tablespoon_volume
>(imv9
) << std::endl
995 << imv10
<< " = " << quantity
<tablespoon_volume
>(imv10
) << std::endl
998 std::cout
<< imv1
<< " = " << quantity
<fluid_ounce_volume
>(imv1
) << std::endl
999 << imv2
<< " = " << quantity
<fluid_ounce_volume
>(imv2
) << std::endl
1000 << imv3
<< " = " << quantity
<fluid_ounce_volume
>(imv3
) << std::endl
1001 << imv4
<< " = " << quantity
<fluid_ounce_volume
>(imv4
) << std::endl
1002 << imv5
<< " = " << quantity
<fluid_ounce_volume
>(imv5
) << std::endl
1003 << imv6
<< " = " << quantity
<fluid_ounce_volume
>(imv6
) << std::endl
1004 << imv7
<< " = " << quantity
<fluid_ounce_volume
>(imv7
) << std::endl
1005 << imv8
<< " = " << quantity
<fluid_ounce_volume
>(imv8
) << std::endl
1006 << imv9
<< " = " << quantity
<fluid_ounce_volume
>(imv9
) << std::endl
1007 << imv10
<< " = " << quantity
<fluid_ounce_volume
>(imv10
) << std::endl
1010 std::cout
<< imv1
<< " = " << quantity
<gill_volume
>(imv1
) << std::endl
1011 << imv2
<< " = " << quantity
<gill_volume
>(imv2
) << std::endl
1012 << imv3
<< " = " << quantity
<gill_volume
>(imv3
) << std::endl
1013 << imv4
<< " = " << quantity
<gill_volume
>(imv4
) << std::endl
1014 << imv5
<< " = " << quantity
<gill_volume
>(imv5
) << std::endl
1015 << imv6
<< " = " << quantity
<gill_volume
>(imv6
) << std::endl
1016 << imv7
<< " = " << quantity
<gill_volume
>(imv7
) << std::endl
1017 << imv8
<< " = " << quantity
<gill_volume
>(imv8
) << std::endl
1018 << imv9
<< " = " << quantity
<gill_volume
>(imv9
) << std::endl
1019 << imv10
<< " = " << quantity
<gill_volume
>(imv10
) << std::endl
1022 std::cout
<< imv1
<< " = " << quantity
<cup_volume
>(imv1
) << std::endl
1023 << imv2
<< " = " << quantity
<cup_volume
>(imv2
) << std::endl
1024 << imv3
<< " = " << quantity
<cup_volume
>(imv3
) << std::endl
1025 << imv4
<< " = " << quantity
<cup_volume
>(imv4
) << std::endl
1026 << imv5
<< " = " << quantity
<cup_volume
>(imv5
) << std::endl
1027 << imv6
<< " = " << quantity
<cup_volume
>(imv6
) << std::endl
1028 << imv7
<< " = " << quantity
<cup_volume
>(imv7
) << std::endl
1029 << imv8
<< " = " << quantity
<cup_volume
>(imv8
) << std::endl
1030 << imv9
<< " = " << quantity
<cup_volume
>(imv9
) << std::endl
1031 << imv10
<< " = " << quantity
<cup_volume
>(imv10
) << std::endl
1034 std::cout
<< imv1
<< " = " << quantity
<pint_volume
>(imv1
) << std::endl
1035 << imv2
<< " = " << quantity
<pint_volume
>(imv2
) << std::endl
1036 << imv3
<< " = " << quantity
<pint_volume
>(imv3
) << std::endl
1037 << imv4
<< " = " << quantity
<pint_volume
>(imv4
) << std::endl
1038 << imv5
<< " = " << quantity
<pint_volume
>(imv5
) << std::endl
1039 << imv6
<< " = " << quantity
<pint_volume
>(imv6
) << std::endl
1040 << imv7
<< " = " << quantity
<pint_volume
>(imv7
) << std::endl
1041 << imv8
<< " = " << quantity
<pint_volume
>(imv8
) << std::endl
1042 << imv9
<< " = " << quantity
<pint_volume
>(imv9
) << std::endl
1043 << imv10
<< " = " << quantity
<pint_volume
>(imv10
) << std::endl
1046 std::cout
<< imv1
<< " = " << quantity
<quart_volume
>(imv1
) << std::endl
1047 << imv2
<< " = " << quantity
<quart_volume
>(imv2
) << std::endl
1048 << imv3
<< " = " << quantity
<quart_volume
>(imv3
) << std::endl
1049 << imv4
<< " = " << quantity
<quart_volume
>(imv4
) << std::endl
1050 << imv5
<< " = " << quantity
<quart_volume
>(imv5
) << std::endl
1051 << imv6
<< " = " << quantity
<quart_volume
>(imv6
) << std::endl
1052 << imv7
<< " = " << quantity
<quart_volume
>(imv7
) << std::endl
1053 << imv8
<< " = " << quantity
<quart_volume
>(imv8
) << std::endl
1054 << imv9
<< " = " << quantity
<quart_volume
>(imv9
) << std::endl
1055 << imv10
<< " = " << quantity
<quart_volume
>(imv10
) << std::endl
1058 std::cout
<< imv1
<< " = " << quantity
<gallon_volume
>(imv1
) << std::endl
1059 << imv2
<< " = " << quantity
<gallon_volume
>(imv2
) << std::endl
1060 << imv3
<< " = " << quantity
<gallon_volume
>(imv3
) << std::endl
1061 << imv4
<< " = " << quantity
<gallon_volume
>(imv4
) << std::endl
1062 << imv5
<< " = " << quantity
<gallon_volume
>(imv5
) << std::endl
1063 << imv6
<< " = " << quantity
<gallon_volume
>(imv6
) << std::endl
1064 << imv7
<< " = " << quantity
<gallon_volume
>(imv7
) << std::endl
1065 << imv8
<< " = " << quantity
<gallon_volume
>(imv8
) << std::endl
1066 << imv9
<< " = " << quantity
<gallon_volume
>(imv9
) << std::endl
1067 << imv10
<< " = " << quantity
<gallon_volume
>(imv10
) << std::endl