Boost logo

Boost-Commit :

From: steven_at_[hidden]
Date: 2007-08-27 14:08:22


Author: steven_watanabe
Date: 2007-08-27 14:08:21 EDT (Mon, 27 Aug 2007)
New Revision: 39010
URL: http://svn.boost.org/trac/boost/changeset/39010

Log:
Convert to base_unit
Text files modified:
   sandbox/units/boost/units/systems/other/non_si_units.hpp | 324 ++++++++++++++-------------------------
   1 files changed, 119 insertions(+), 205 deletions(-)

Modified: sandbox/units/boost/units/systems/other/non_si_units.hpp
==============================================================================
--- sandbox/units/boost/units/systems/other/non_si_units.hpp (original)
+++ sandbox/units/boost/units/systems/other/non_si_units.hpp 2007-08-27 14:08:21 EDT (Mon, 27 Aug 2007)
@@ -13,6 +13,7 @@
 
 // SI conversion factors for various non-SI units
 
+#include <boost/units/conversion.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/length.hpp>
 #include <boost/units/systems/si/mass.hpp>
@@ -22,281 +23,194 @@
 #include <boost/units/systems/si/velocity.hpp>
 #include <boost/units/systems/si/volume.hpp>
 
-namespace boost {
-
-namespace units {
-
-namespace SI {
-
-namespace constants {
+#define BOOST_UNITS_NON_SI_UNIT(name, factor, unit, id) \
+namespace boost { \
+namespace units { \
+namespace BOOST_UNITS_NAMESPACE { \
+struct name : base_unit<name, unit::dimension_type, id - 100> {}; \
+} \
+} \
+} \
+BOOST_UNITS_DEFINE_CONVERSION(BOOST_UNITS_NAMESPACE::name, unit, double, factor); \
+BOOST_UNITS_DEFAULT_CONVERSION(BOOST_UNITS_NAMESPACE::name, unit)
+
+#define BOOST_UNITS_NAMESPACE astronomical
+
+BOOST_UNITS_NON_SI_UNIT(astronomical_unit_base_unit, 149597870691.0, meter_base_unit::unit_type, 0);
+BOOST_UNITS_NON_SI_UNIT(light_day_base_unit, 2.59020683712e13, meter_base_unit::unit_type, 1);
+BOOST_UNITS_NON_SI_UNIT(light_hour_base_unit,1.0792528488e12, meter_base_unit::unit_type, 2);
+BOOST_UNITS_NON_SI_UNIT(light_minute_base_unit,1.798754748e10, meter_base_unit::unit_type, 3);
+BOOST_UNITS_NON_SI_UNIT(light_second_base_unit,2.99792458e8, meter_base_unit::unit_type, 4);
+BOOST_UNITS_NON_SI_UNIT(light_year_base_unit,9.460730472580e15, meter_base_unit::unit_type, 5);
+BOOST_UNITS_NON_SI_UNIT(parsec_base_unit,3.0856775813e16, meter_base_unit::unit_type, 6);
 
-// common astronomical units
-namespace astronomical {
+#undef BOOST_UNITS_NAMESPACE
 
-// units of length
-BOOST_UNITS_AUTO_STATIC_CONSTANT(astronomical_unit,149597870691.0*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(light_day,2.59020683712e13*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(light_hour,1.0792528488e12*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(light_minute,1.798754748e10*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(light_second,2.99792458e8*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(light_year,9.460730472580e15*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(parsec,3.0856775813e16*meters);
-
-} // namespace astronomical
-
-// British imperial units
-namespace imperial {
+#define BOOST_UNITS_NAMESPACE metric
 
-} // namespace imperial
-
-// non-SI metric units
+namespace boost {
+namespace units {
 namespace metric {
 
 // units of length
-BOOST_UNITS_AUTO_STATIC_CONSTANT(angstrom,1.0e-10*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(angstroms,1.0e-10*meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(fermi,1.0e-15*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(fermis,1.0e-15*meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(micron,1.0e-6*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(microns,1.0e-6*meters);
+typedef scaled_base_unit<meter_base_unit, scale<10, static_rational<10> > > angstrom_base_unit;
+typedef scaled_base_unit<meter_base_unit, scale<10, static_rational<15> > > fermi_base_unit;
+typedef scaled_base_unit<meter_base_unit, scale<10, static_rational<6> > > micron_base_unit;
 
 // units of mass
-BOOST_UNITS_AUTO_STATIC_CONSTANT(ton,1.0e3*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(tons,1.0e3*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(tonne,1.0e3*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(tonnes,1.0e3*kilograms);
+typedef scaled_base_unit<kilogram_base_unit, scale<10, static_rational<3> > > ton_base_unit;
 
 // units of time
-BOOST_UNITS_AUTO_STATIC_CONSTANT(day,86400.0*seconds);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(days,86400.0*seconds);
+typedef scaled_base_unit<second_base_unit, scale<60, static_rational<1> > > minute_base_unit;
+typedef scaled_base_unit<second_base_unit, scale<60, static_rational<2> > > hour_base_unit;
+typedef scaled_base_unit<hour_base_unit, scale<24, static_rational<1> > > day_base_unit;
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(hour,3600.0*seconds);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(hours,3600.0*seconds);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(minute,60.0*seconds);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(minutes,60.0*seconds);
+} // namespace metric
+} // namespace units
+} // namespace boost
 
 // units of planar angle
-BOOST_UNITS_AUTO_STATIC_CONSTANT(arcdegree,(3.14159265358979323846264338328/180)*radians);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(arcdegrees,(3.14159265358979323846264338328/180)*radians);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(arcminute,(3.14159265358979323846264338328/10800)*radians);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(arcminutes,(3.14159265358979323846264338328/10800)*radians);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(arcsecond,(3.14159265358979323846264338328/648000)*radians);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(arcseconds,(3.14159265358979323846264338328/648000)*radians);
+BOOST_UNITS_NON_SI_UNIT(arcdegree_base_unit,(3.14159265358979323846264338328/180), radian_base_unit::unit_type, 7);
+BOOST_UNITS_NON_SI_UNIT(arcminute_base_unit,(3.14159265358979323846264338328/10800), radian_base_unit::unit_type, 8);
+BOOST_UNITS_NON_SI_UNIT(arcsecond_base_unit,(3.14159265358979323846264338328/648000), radian_base_unit::unit_type, 9);
 
 // units of area
-BOOST_UNITS_AUTO_STATIC_CONSTANT(are,1.0e2*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(ares,1.0e2*square_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(barn,1.0e-28*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(barns,1.0e-28*square_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(hectare,1.0e4*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(hectares,1.0e4*square_meters);
+BOOST_UNITS_NON_SI_UNIT(are_base_unit,1.0e2, reduce_unit<SI::area>::type, 10);
+BOOST_UNITS_NON_SI_UNIT(barn_base_unit,1.0e-28, reduce_unit<SI::area>::type, 11);
+BOOST_UNITS_NON_SI_UNIT(hectare_base_unit,1.0e4, reduce_unit<SI::area>::type, 12);
 
 // units of volume
-BOOST_UNITS_AUTO_STATIC_CONSTANT(liter,1.0e-3*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(liters,1.0e-3*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(litre,1.0e-3*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(litres,1.0e-3*cubic_meters);
+BOOST_UNITS_NON_SI_UNIT(liter_base_unit,1.0e-3, reduce_unit<SI::volume>::type, 13);
 
 // units of pressure
-BOOST_UNITS_AUTO_STATIC_CONSTANT(bar,1.0e5*pascals);
+BOOST_UNITS_NON_SI_UNIT(bar_base_unit,1.0e5, reduce_unit<SI::force>::type, 14);
 
-} // namespace metric
+#undef BOOST_UNITS_NAMESPACE
 
-// nautical units
-namespace nautical {
+#define BOOST_UNITS_NAMESPACE nautical
 
 // units of length
-BOOST_UNITS_AUTO_STATIC_CONSTANT(fathom,1.852*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(fathoms,1.852*meters);
+BOOST_UNITS_NON_SI_UNIT(fathom_base_unit,1.852,meter_base_unit::unit_type, 15);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(knot,(1852.0/3600.0)*meters_per_second);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(knots,(1852.0/3600.0)*meters_per_second);
+BOOST_UNITS_NON_SI_UNIT(knot_base_unit,(1852.0/3600.0), reduce_unit<SI::velocity>::type, 16);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(league,5556.0*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(leagues,5556.0*meters);
+BOOST_UNITS_NON_SI_UNIT(league_base_unit,5556.0, meter_base_unit::unit_type, 17);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(mile,1852.0*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(miles,1852.0*meters);
+BOOST_UNITS_NON_SI_UNIT(nautical_mile_base_unit,1852.0, meter_base_unit::unit_type, 18);
 
-} // namespace nautical
+#undef BOOST_UNITS_NAMESPACE
 
-// US customary units
-namespace us {
+// US customary units
 
 // conversions from http://ts.nist.gov/WeightsAndMeasures/Publications/appxc.cfm#2
 
-// units of length
-BOOST_UNITS_AUTO_STATIC_CONSTANT(inch,25.4e-3*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(inches,25.4e-3*meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(foot,0.3048*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(feet,0.3048*meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(yard,0.9144*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(yards,0.9144*meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(mile,1609.344*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(miles,1609.344*meters);
-
-// units of area
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_inch,645.16e-6*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_inches,645.16e-6*square_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_foot,9.290304e-2*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_feet,9.290304e-2*square_meters);
+#define BOOST_UNITS_NAMESPACE us
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_yard,0.83612736*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_yards,0.83612736*square_meters);
+// units of length
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_mile,2589988.110336*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_miles,2589988.110336*square_meters);
+// inch, foot, yard, mile and elsewhere
 
 // units of volume
-BOOST_UNITS_AUTO_STATIC_CONSTANT(cubic_inch,16.387064e-6*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(cubic_inches,16.387064e-6*cubic_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(cubic_foot,2.8316846592e-2*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(cubic_feet,2.8316846592e-2*cubic_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(cubic_yard,0.764554857984*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(cubic_yards,0.764554857984*cubic_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(minim,6.161152e-8*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(minims,6.161152e-8*cubic_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(fluid_dram,3.696691e-6*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(fluid_drams,3.696691e-6*cubic_meters);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(fluid_ounce,2.957353e-5*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(fluid_ounces,2.957353e-5*cubic_meters);
+BOOST_UNITS_NON_SI_UNIT(minim_base_unit,6.161152e-8, reduce_unit<SI::volume>::type, 19);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(gill,1.182941e-4*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(gills,1.182941e-4*cubic_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(liquid_pint,4.731765e-4*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(liquid_pints,4.731765e-4*cubic_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(liquid_quart,9.463529e-4*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(liquid_quarts,9.463529e-4*cubic_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(gallon,3.785412e-3*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(gallons,3.785412e-3*cubic_meters);
+namespace boost {
+namespace units {
+namespace us {
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(dry_pint,5.506105e-4*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(dry_pints,5.506105e-4*cubic_meters);
+typedef scaled_base_unit<minim_base_unit, scale<60, static_rational<1> > > fluid_dram_base_unit; //3.696691e-6*cubic_meters
+typedef scaled_base_unit<fluid_dram_base_unit, scale<2, static_rational<3> > > fluid_once_base_unit; //2.957353e-5*cubic_meters
+typedef scaled_base_unit<fluid_dram_base_unit, scale<2, static_rational<5> > > gill_base_unit; //1.182941e-4*cubic_meters
+typedef scaled_base_unit<fluid_dram_base_unit, scale<2, static_rational<7> > > liquid_pint_base_unit; //4.731765e-4*cubic_meters
+typedef scaled_base_unit<fluid_dram_base_unit, scale<2, static_rational<8> > > liquid_quart_base_unit; //9.463529e-4*cubic_meters
+typedef scaled_base_unit<fluid_dram_base_unit, scale<2, static_rational<10> > > gallon_base_unit; //3.785412e-3*cubic_meters
+
+}
+}
+}
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(dry_quart,1.101221e-3*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(dry_quarts,1.101221e-3*cubic_meters);
+BOOST_UNITS_NON_SI_UNIT(dry_pint_base_unit,5.506105e-4, reduce_unit<SI::volume>::type, 20);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(peck,8.809768e-3*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(pecks,8.809768e-3*cubic_meters);
+namespace boost {
+namespace units {
+namespace us {
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(bushel,3.523907e-2*cubic_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(bushels,3.523907e-2*cubic_meters);
+typedef scaled_base_unit<dry_pint_base_unit, scale<2, static_rational<1> > > dry_quart_base_unit; //1.101221e-3*cubic_meters
+typedef scaled_base_unit<dry_pint_base_unit, scale<2, static_rational<4> > > peck_base_unit; //8.809768e-3*cubic_meters
+typedef scaled_base_unit<dry_pint_base_unit, scale<2, static_rational<6> > > bushel_base_unit; //3.523907e-2*cubic_meters
+
+}
+}
+}
 
 // units of mass
-BOOST_UNITS_AUTO_STATIC_CONSTANT(avoirdupois_dram,1.7718451953125e-3*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(avoirdupois_drams,1.7718451953125e-3*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(dram,1.7718451953125e-3*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(drams,1.7718451953125e-3*kilograms);
+BOOST_UNITS_NON_SI_UNIT(avoirdupois_dram_base_unit,1.7718451953125e-3, kilogram_base_unit::unit_type, 21);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(avoirdupois_ounce,2.8349523125e-2*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(avoirdupois_ounces,2.8349523125e-2*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(ounce,2.8349523125e-2*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(ounces,2.8349523125e-2*kilograms);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(avoirdupois_pound,4.5359237e-1*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(avoirdupois_pounds,4.5359237e-1*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(pound,4.5359237e-1*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(pounds,4.5359237e-1*kilograms);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(short_hundredweight,4.5359237e1*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(short_hundredweights,4.5359237e1*kilograms);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(short_ton,9.0718474e2*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(short_tons,9.0718474e2*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(ton,9.0718474e2*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(tons,9.0718474e2*kilograms);
+namespace boost {
+namespace units {
+namespace us {
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(long_ton,1.0160469088e3*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(long_tons,1.0160469088e3*kilograms);
+typedef scaled_base_unit<avoirdupois_dram_base_unit, scale<2, static_rational<4> > > avoirdupois_ounce_base_unit; //2.8349523125e-2*kilograms
+typedef scaled_base_unit<avoirdupois_dram_base_unit, scale<2, static_rational<8> > > avoirdupois_pound_base_unit; //4.5359237e-1*kilograms
+typedef scaled_base_unit<avoirdupois_pound_base_unit, scale<10, static_rational<2> > > short_hundredweight_base_unit; //4.5359237e1*kilograms
+typedef scaled_base_unit<avoirdupois_pound_base_unit, scale<2000, static_rational<1> > > short_ton_base_unit; //9.0718474e2*kilograms
+
+}
+}
+}
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(grain,6.479891e-5*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(grains,6.479891e-5*kilograms);
+BOOST_UNITS_NON_SI_UNIT(long_ton_base_unit,1.0160469088e3,kilogram_base_unit::unit_type, 22);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(apothecaries_scruple,1.2959782e-3*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(apothecaries_scruples,1.2959782e-3*kilograms);
+BOOST_UNITS_NON_SI_UNIT(grain_base_unit,6.479891e-5,kilogram_base_unit::unit_type, 23);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(pennyweight,1.55517384e-3*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(pennyweights,1.55517384e-3*kilograms);
+namespace boost {
+namespace units {
+namespace us {
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(apothecaries_dram,3.8879346e-3*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(apothecaries_drams,3.8879346e-3*kilograms);
+typedef scaled_base_unit<grain_base_unit, scale<20, static_rational<1> > > apothecaries_scruple_base_unit; //1.2959782e-3
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(apothecaries_ounce,3.11034768e-2*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(apothecaries_ounces,3.11034768e-2*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(troy_ounce,3.11034768e-2*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(troy_ounces,3.11034768e-2*kilograms);
+typedef scaled_base_unit<grain_base_unit, scale<24, static_rational<1> > > pennyweight_base_unit; //1.55517384e-3*kilograms
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(apothecaries_pound,3.732417216e-1*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(apothecaries_pounds,3.732417216e-1*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(troy_pound,3.732417216e-1*kilograms);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(troy_pounds,3.732417216e-1*kilograms);
+typedef scaled_base_unit<grain_base_unit, scale<60, static_rational<1> > > apothecaries_dram_base_unit; //3.8879346e-3*kilograms
 
-// units of velocity
-BOOST_UNITS_AUTO_STATIC_CONSTANT(miles_per_hour,(1609.344/3600.0)*meters_per_second);
+typedef scaled_base_unit<apothecaries_dram_base_unit, scale<2, static_rational<3> > > apothecaries_ounce_base_unit; //3.11034768e-2*kilograms
+typedef scaled_base_unit<apothecaries_ounce_base_unit, scale<12, static_rational<1> > > apothecaries_pound_base_unit;//3.732417216e-1*kilograms
 
-} // namespace us
+}
+}
+}
 
-// US survey units
-namespace us {
+#undef BOOST_UNITS_NAMESPACE
 
-namespace survey {
+#define BOOST_UNITS_NAMESPACE survey
 
 // conversions from http://ts.nist.gov/WeightsAndMeasures/Publications/appxc.cfm#2
 
 // units of length
-BOOST_UNITS_AUTO_STATIC_CONSTANT(link,0.2011684*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(links,0.2011684*meters);
+BOOST_UNITS_NON_SI_UNIT(link_base_unit,0.2011684,meter_base_unit::unit_type, 24);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(foot,0.3048006*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(feet,0.3048006*meters);
+BOOST_UNITS_NON_SI_UNIT(foot_base_unit,0.3048006,meter_base_unit::unit_type, 25);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(rod,5.029210*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(rods,5.029210*meters);
+BOOST_UNITS_NON_SI_UNIT(rod_base_unit,5.029210,meter_base_unit::unit_type, 26);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(chain,20.11684*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(chains,20.11684*meters);
+BOOST_UNITS_NON_SI_UNIT(chain_base_unit,20.11684,meter_base_unit::unit_type, 27);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(mile,1609.347*meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(miles,1609.347*meters);
+BOOST_UNITS_NON_SI_UNIT(mile_base_unit,1609.347,meter_base_unit::unit_type, 28);
 
 // units of area
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_foot,0.09290341*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_feet,0.09290341*square_meters);
-
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_rod,25.29295*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_rods,25.29295*square_meters);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_chain,404.6873*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_chains,404.6873*square_meters);
+BOOST_UNITS_NON_SI_UNIT(acre_base_unit,4046.873,reduce_unit<SI::area>::type, 29);
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(acre,4046.873*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(acres,4046.873*square_meters);
+#undef BOOST_UNITS_NAMESPACE
+#undef BOOST_UNITS_END_NAMESPACE
 
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_mile,2589998.0*square_meters);
-BOOST_UNITS_AUTO_STATIC_CONSTANT(square_miles,2589998.0*square_meters);
+namespace boost {
 
-} // namespace survey
+namespace units {
 
-} // namespace us
+namespace SI {
+
+namespace constants {
 
 /*
 namespace english {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk