|
Boost-Commit : |
From: steven_at_[hidden]
Date: 2008-05-19 14:26:20
Author: steven_watanabe
Date: 2008-05-19 14:26:19 EDT (Mon, 19 May 2008)
New Revision: 45551
URL: http://svn.boost.org/trac/boost/changeset/45551
Log:
Cleared up regressions
Text files modified:
sandbox/units/boost/units/base_units/imperial/pint.hpp | 1
sandbox/units/boost/units/base_units/imperial/pound.hpp | 1
sandbox/units/boost/units/base_units/us/pound.hpp | 1
sandbox/units/boost/units/systems/si/illuminance.hpp | 3 +
sandbox/units/boost/units/systems/si/magnetic_flux.hpp | 3 +
sandbox/units/libs/units/example/conversion.cpp | 8 +++---
sandbox/units/libs/units/example/heterogeneous_unit.cpp | 4 +-
sandbox/units/libs/units/example/kitchen_sink.cpp | 46 ++++++++++++++++++++--------------------
8 files changed, 36 insertions(+), 31 deletions(-)
Modified: sandbox/units/boost/units/base_units/imperial/pint.hpp
==============================================================================
--- sandbox/units/boost/units/base_units/imperial/pint.hpp (original)
+++ sandbox/units/boost/units/base_units/imperial/pint.hpp 2008-05-19 14:26:19 EDT (Mon, 19 May 2008)
@@ -14,6 +14,7 @@
#include <string>
#include <boost/units/systems/si/volume.hpp>
+#include <boost/units/conversion.hpp>
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pint, "pint (imp.)", "pt", 4.54609e-3/8., si::volume, -303); // exact conversion
Modified: sandbox/units/boost/units/base_units/imperial/pound.hpp
==============================================================================
--- sandbox/units/boost/units/base_units/imperial/pound.hpp (original)
+++ sandbox/units/boost/units/base_units/imperial/pound.hpp 2008-05-19 14:26:19 EDT (Mon, 19 May 2008)
@@ -17,6 +17,7 @@
#include <boost/units/base_unit.hpp>
#include <boost/units/physical_dimensions/mass.hpp>
#include <boost/units/base_units/cgs/gram.hpp>
+#include <boost/units/conversion.hpp>
// can't define in terms of kilogram because it is a scaled_base_unit
//BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pound, "pound", "lb", 0.45359237, si::kilogram_base_unit, -302); // exact conversion
Modified: sandbox/units/boost/units/base_units/us/pound.hpp
==============================================================================
--- sandbox/units/boost/units/base_units/us/pound.hpp (original)
+++ sandbox/units/boost/units/base_units/us/pound.hpp 2008-05-19 14:26:19 EDT (Mon, 19 May 2008)
@@ -17,6 +17,7 @@
#include <boost/units/base_unit.hpp>
#include <boost/units/physical_dimensions/mass.hpp>
#include <boost/units/base_units/cgs/gram.hpp>
+#include <boost/units/conversion.hpp>
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pound, "pound", "lb", 453.59237, cgs::gram_base_unit, -502); // exact conversion
Modified: sandbox/units/boost/units/systems/si/illuminance.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/illuminance.hpp (original)
+++ sandbox/units/boost/units/systems/si/illuminance.hpp 2008-05-19 14:26:19 EDT (Mon, 19 May 2008)
@@ -13,6 +13,7 @@
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/illuminance.hpp>
+#include <ostream>
namespace boost {
@@ -26,7 +27,7 @@
} // namespace si
-std::ostream& operator<<(std::ostream& os, const boost::units::si::illuminance&)
+inline std::ostream& operator<<(std::ostream& os, const boost::units::si::illuminance&)
{
return(os << "lx");
}
Modified: sandbox/units/boost/units/systems/si/magnetic_flux.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/magnetic_flux.hpp (original)
+++ sandbox/units/boost/units/systems/si/magnetic_flux.hpp 2008-05-19 14:26:19 EDT (Mon, 19 May 2008)
@@ -13,6 +13,7 @@
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
+#include <ostream>
namespace boost {
@@ -30,7 +31,7 @@
} // namespace si
-std::ostream& operator<<(std::ostream& os, const boost::units::si::magnetic_flux&)
+inline std::ostream& operator<<(std::ostream& os, const boost::units::si::magnetic_flux&)
{
return(os << "Wb");
}
Modified: sandbox/units/libs/units/example/conversion.cpp
==============================================================================
--- sandbox/units/libs/units/example/conversion.cpp (original)
+++ sandbox/units/libs/units/example/conversion.cpp 2008-05-19 14:26:19 EDT (Mon, 19 May 2008)
@@ -34,9 +34,9 @@
volume (cm^3) = 1e+06 cm^3
volume (m^3) = 1 m^3
-energy (joules) = 1 m^2 kg s^-2
+energy (joules) = 1 J
energy (ergs) = 1e+07 cm^2 g s^-2
-energy (joules) = 1 m^2 kg s^-2
+energy (joules) = 1 J
velocity (2 m/s) = 2 m s^-1
velocity (2 cm/s) = 0.02 m s^-1
@@ -135,9 +135,9 @@
sstream2 << "volume (cm^3) = " << 1e6 << " cm^3" << std::endl;
sstream2 << "volume (m^3) = 1 m^3" << std::endl;
sstream2 << std::endl;
- sstream2 << "energy (joules) = 1 m^2 kg s^-2" << std::endl;
+ sstream2 << "energy (joules) = 1 J" << std::endl;
sstream2 << "energy (ergs) = " << 1e7 << " cm^2 g s^-2" << std::endl;
- sstream2 << "energy (joules) = 1 m^2 kg s^-2" << std::endl;
+ sstream2 << "energy (joules) = 1 J" << std::endl;
sstream2 << std::endl;
sstream2 << "velocity (2 m/s) = 2 m s^-1" << std::endl;
sstream2 << "velocity (2 cm/s) = 0.02 m s^-1" << std::endl;
Modified: sandbox/units/libs/units/example/heterogeneous_unit.cpp
==============================================================================
--- sandbox/units/libs/units/example/heterogeneous_unit.cpp (original)
+++ sandbox/units/libs/units/example/heterogeneous_unit.cpp 2008-05-19 14:26:19 EDT (Mon, 19 May 2008)
@@ -25,7 +25,7 @@
1.5 m g
1.5 m g^-1
-1 m kg s^-2
+1 N
1 kg s^-2
1 cm kg s^-2
@@ -89,7 +89,7 @@
<< "1.5 m g" << std::endl
<< "1.5 m g^-1" << std::endl
<< std::endl
- << "1 m kg s^-2" << std::endl
+ << "1 N" << std::endl
<< "1 kg s^-2" << std::endl
<< std::endl
<< "1 cm kg s^-2" << std::endl
Modified: sandbox/units/libs/units/example/kitchen_sink.cpp
==============================================================================
--- sandbox/units/libs/units/example/kitchen_sink.cpp (original)
+++ sandbox/units/libs/units/example/kitchen_sink.cpp 2008-05-19 14:26:19 EDT (Mon, 19 May 2008)
@@ -450,18 +450,18 @@
sstream2 << "S1 : 2" << std::endl;
sstream2 << "X1 : 2" << std::endl;
sstream2 << "X2 : (4/3)" << std::endl;
- sstream2 << "U1 : m kg s^-2" << std::endl;
- sstream2 << "U2 : m^2 kg s^-2" << std::endl;
- sstream2 << "Q1 : 1 m kg s^-2" << std::endl;
- sstream2 << "Q2 : 2 m^2 kg s^-2" << std::endl;
- sstream2 << std::endl;
- sstream2 << "U1*S1 : 2 m kg s^-2" << std::endl;
- sstream2 << "S1*U1 : 2 m kg s^-2" << std::endl;
- sstream2 << "U1/S1 : 0.5 m kg s^-2" << std::endl;
+ sstream2 << "U1 : N" << std::endl;
+ sstream2 << "U2 : J" << std::endl;
+ sstream2 << "Q1 : 1 N" << std::endl;
+ sstream2 << "Q2 : 2 J" << std::endl;
+ sstream2 << std::endl;
+ sstream2 << "U1*S1 : 2 N" << std::endl;
+ sstream2 << "S1*U1 : 2 N" << std::endl;
+ sstream2 << "U1/S1 : 0.5 N" << std::endl;
sstream2 << "S1/U1 : 2 m^-1 kg^-1 s^2" << std::endl;
sstream2 << std::endl;
- sstream2 << "U1+U1 : m kg s^-2" << std::endl;
- sstream2 << "U1-U1 : m kg s^-2" << std::endl;
+ sstream2 << "U1+U1 : N" << std::endl;
+ sstream2 << "U1-U1 : N" << std::endl;
sstream2 << "U1*U1 : m^2 kg^2 s^-4" << std::endl;
sstream2 << "U1/U1 : dimensionless" << std::endl;
sstream2 << "U1*U2 : m^3 kg^2 s^-4" << std::endl;
@@ -471,9 +471,9 @@
sstream2 << "U1^X2 : m^(4/3) kg^(4/3) s^(-8/3)" << std::endl;
sstream2 << "X2vU1 : m^(3/4) kg^(3/4) s^(-3/2)" << std::endl;
sstream2 << std::endl;
- sstream2 << "Q1*S1 : 2 m kg s^-2" << std::endl;
- sstream2 << "S1*Q1 : 2 m kg s^-2" << std::endl;
- sstream2 << "Q1/S1 : 0.5 m kg s^-2" << std::endl;
+ sstream2 << "Q1*S1 : 2 N" << std::endl;
+ sstream2 << "S1*Q1 : 2 N" << std::endl;
+ sstream2 << "Q1/S1 : 0.5 N" << std::endl;
sstream2 << "S1/Q1 : 2 m^-1 kg^-1 s^2" << std::endl;
sstream2 << std::endl;
sstream2 << "U1*Q1 : 1 m^2 kg^2 s^-4" << std::endl;
@@ -481,10 +481,10 @@
sstream2 << "U1/Q1 : 1 dimensionless" << std::endl;
sstream2 << "Q1/U1 : 1 dimensionless" << std::endl;
sstream2 << std::endl;
- sstream2 << "+Q1 : 1 m kg s^-2" << std::endl;
- sstream2 << "-Q1 : -1 m kg s^-2" << std::endl;
- sstream2 << "Q1+Q1 : 2 m kg s^-2" << std::endl;
- sstream2 << "Q1-Q1 : 0 m kg s^-2" << std::endl;
+ sstream2 << "+Q1 : 1 N" << std::endl;
+ sstream2 << "-Q1 : -1 N" << std::endl;
+ sstream2 << "Q1+Q1 : 2 N" << std::endl;
+ sstream2 << "Q1-Q1 : 0 N" << std::endl;
sstream2 << "Q1*Q1 : 1 m^2 kg^2 s^-4" << std::endl;
sstream2 << "Q1/Q1 : 1 dimensionless" << std::endl;
sstream2 << "Q1*Q2 : 2 m^3 kg^2 s^-4" << std::endl;
@@ -505,12 +505,12 @@
sstream2 << std::endl;
sstream2 << "v1 = 2 m s^-1" << std::endl;
sstream2 << std::endl;
- sstream2 << "F = 1 m kg s^-2" << std::endl;
+ sstream2 << "F = 1 N" << std::endl;
sstream2 << "dx = 1 m" << std::endl;
- sstream2 << "E = 1 m^2 kg s^-2" << std::endl;
+ sstream2 << "E = 1 J" << std::endl;
sstream2 << std::endl;
sstream2 << "r = " << 5e-7 << " m" << std::endl;
- sstream2 << "P = 101325 m^-1 kg s^-2" << std::endl;
+ sstream2 << "P = 101325 Pa" << std::endl;
sstream2 << "V = " << 5.23598666666667e-019 << " m^3" << std::endl;
sstream2 << "T = 310 K" << std::endl;
sstream2 << "n = " << 2.05834787514993e-017 << " mol" << std::endl;
@@ -526,10 +526,10 @@
<< std::endl;
sstream2 << "asin(sin(theta)) = " << 0.375 << " rad" << std::endl;
sstream2 << std::endl;
- sstream2 << "V = (12.5,0) m^2 kg s^-3 A^-1" << std::endl;
+ sstream2 << "V = (12.5,0) V" << std::endl;
sstream2 << "I = (3,4) A" << std::endl;
- sstream2 << "Z = (1.5,-2) m^2 kg s^-3 A^-2" << std::endl;
- sstream2 << "I*Z = (12.5,0) m^2 kg s^-3 A^-1" << std::endl;
+ sstream2 << "Z = (1.5,-2) ohm" << std::endl;
+ sstream2 << "I*Z = (12.5,0) V" << std::endl;
sstream2 << std::endl;
sstream2 << "x+y-w = 0.48(+/-" << 0.632771680782255 << ") m" << std::endl;
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