Boost logo

Boost-Commit :

From: steven_at_[hidden]
Date: 2007-08-29 13:17:45


Author: steven_watanabe
Date: 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
New Revision: 39056
URL: http://svn.boost.org/trac/boost/changeset/39056

Log:
Updated constants
Added:
   sandbox/units/boost/units/systems/detail/
   sandbox/units/boost/units/systems/detail/constants.hpp
      - copied unchanged from r39044, /sandbox/units/boost/units/systems/constants.hpp
Removed:
   sandbox/units/boost/units/systems/constants.hpp
Text files modified:
   sandbox/units/boost/units/systems/si/codata/alpha_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/deuteron_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/electromagnetic_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/electron_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/helion_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/muon_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/neutron_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/physico-chemical_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/proton_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/tau_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/triton_constants.hpp | 2 +-
   sandbox/units/boost/units/systems/si/codata/universal_constants.hpp | 2 +-
   sandbox/units/libs/units/doc/Jamfile.v2 | 2 +-
   sandbox/units/libs/units/test_headers/Jamfile.v2 | 2 +-
   14 files changed, 14 insertions(+), 14 deletions(-)

Deleted: sandbox/units/boost/units/systems/constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
+++ (empty file)
@@ -1,201 +0,0 @@
-// mcs::units - A C++ library for zero-overhead dimensional analysis and
-// unit/quantity manipulation and conversion
-//
-// Copyright (C) 2003-2007 Matthias Christian Schabel
-// Copyright (C) 2007 Steven Watanabe
-//
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_UNITS_CONSTANTS_HPP
-#define BOOST_UNITS_CONSTANTS_HPP
-
-#include <cmath>
-#include <iosfwd>
-#include <iomanip>
-
-#include <boost/io/ios_state.hpp>
-
-#include <boost/units/static_constant.hpp>
-#include <boost/units/units_fwd.hpp>
-#include <boost/units/operators.hpp>
-
-namespace boost {
-
-namespace units {
-
-template<class Base>
-struct constant
-{
- typedef typename Base::value_type value_type;
- operator value_type() const { return Base().value(); }
- value_type value() const { return Base().value(); }
- value_type uncertainty() const { return Base().uncertainty(); }
- value_type lower_bound() const { return Base().lower_bound(); }
- value_type upper_bound() const { return Base().upper_bound(); }
-};
-
-template<class Base>
-struct physical_constant
-{
- typedef typename Base::value_type value_type;
- operator value_type() const { return Base().value(); }
- value_type value() const { return Base().value(); }
- value_type uncertainty() const { return Base().uncertainty(); }
- value_type lower_bound() const { return Base().lower_bound(); }
- value_type upper_bound() const { return Base().upper_bound(); }
-};
-
-#define BOOST_UNITS_DEFINE_HELPER(name, symbol, template_name) \
- \
-template<class T, class Arg1, class Arg2> \
-struct name ## _typeof_helper<constant<T>, template_name<Arg1, Arg2> >\
-{ \
- typedef typename name ## _typeof_helper<typename T::value_type, template_name<Arg1, Arg2> >::type type;\
-}; \
- \
-template<class T, class Arg1, class Arg2> \
-struct name ## _typeof_helper<template_name<Arg1, Arg2>, constant<T> >\
-{ \
- typedef typename name ## _typeof_helper<template_name<Arg1, Arg2>, typename T::value_type>::type type;\
-}; \
- \
-template<class T, class Arg1, class Arg2> \
-typename name ## _typeof_helper<typename T::value_type, template_name<Arg1, Arg2> >::type \
-operator symbol(const constant<T>& t, const template_name<Arg1, Arg2>& u)\
-{ \
- return(t.value() symbol u); \
-} \
- \
-template<class T, class Arg1, class Arg2> \
-typename name ## _typeof_helper<typename T::value_type, template_name<Arg1, Arg2> >::type \
-operator symbol(const template_name<Arg1, Arg2>& u, const constant<T>& t)\
-{ \
- return(u symbol t.value()); \
-}
-
-BOOST_UNITS_DEFINE_HELPER(add, +, unit)
-BOOST_UNITS_DEFINE_HELPER(add, +, quantity)
-BOOST_UNITS_DEFINE_HELPER(subtract, -, unit)
-BOOST_UNITS_DEFINE_HELPER(subtract, -, quantity)
-BOOST_UNITS_DEFINE_HELPER(multiply, *, unit)
-BOOST_UNITS_DEFINE_HELPER(multiply, *, quantity)
-BOOST_UNITS_DEFINE_HELPER(divide, /, unit)
-BOOST_UNITS_DEFINE_HELPER(divide, /, quantity)
-
-#undef BOOST_UNITS_DEFINE_HELPER
-
-#define BOOST_UNITS_DEFINE_HELPER(name, symbol) \
- \
-template<class T1, class T2> \
-struct name ## _typeof_helper<constant<T1>, constant<T2> > \
-{ \
- typedef typename name ## _typeof_helper<typename T1::value_type, typename T2::value_type>::type type;\
-}; \
- \
-template<class T1, class T2> \
-typename name ## _typeof_helper<typename T1::value_type, typename T2::value_type>::type \
-operator symbol(const constant<T1>& t, const constant<T2>& u) \
-{ \
- return(t.value() symbol u.value()); \
-} \
- \
-template<class T1, class T2> \
-struct name ## _typeof_helper<constant<T1>, T2> \
-{ \
- typedef typename name ## _typeof_helper<typename T1::value_type, T2>::type type;\
-}; \
- \
-template<class T1, class T2> \
-struct name ## _typeof_helper<T1, constant<T2> > \
-{ \
- typedef typename name ## _typeof_helper<T1, typename T2::value_type>::type type;\
-}; \
- \
-template<class T1, class T2> \
-typename name ## _typeof_helper<typename T1::value_type, T2>::type \
-operator symbol(const constant<T1>& t, const T2& u) \
-{ \
- return(t.value() symbol u); \
-} \
- \
-template<class T1, class T2> \
-typename name ## _typeof_helper<T1, typename T2::value_type>::type \
-operator symbol(const T1& t, const constant<T2>& u) \
-{ \
- return(t symbol u.value()); \
-}
-
-BOOST_UNITS_DEFINE_HELPER(add, +)
-BOOST_UNITS_DEFINE_HELPER(subtract, -)
-BOOST_UNITS_DEFINE_HELPER(multiply, *)
-BOOST_UNITS_DEFINE_HELPER(divide, /)
-
-#undef BOOST_UNITS_DEFINE_HELPER
-
-#define BOOST_UNITS_PHYSICAL_CONSTANT(name, type, value_, uncertainty_) \
-struct name ## _t { \
- typedef type value_type; \
- operator value_type() const { return value_; } \
- value_type value() const { return value_; } \
- value_type uncertainty() const { return uncertainty_; } \
- value_type lower_bound() const { return value_-uncertainty_; } \
- value_type upper_bound() const { return value_+uncertainty_; } \
-}; \
-BOOST_UNITS_STATIC_CONSTANT(name, boost::units::constant<boost::units::physical_constant<name ## _t> >) = { }
-
-// stream output
-template<class Char, class Traits, class Y>
-inline
-std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>& os,const physical_constant<Y>& val)
-{
- boost::io::ios_precision_saver precision_saver(os);
- //boost::io::ios_width_saver width_saver(os);
- boost::io::ios_flags_saver flags_saver(os);
-
- //os << std::setw(21);
- typedef typename Y::value_type value_type;
-
- if (val.uncertainty() > value_type())
- {
- const double relative_uncertainty = std::abs(val.uncertainty()/val.value());
-
- const double exponent = std::log10(relative_uncertainty);
- const long digits_of_precision = static_cast<long>(std::ceil(std::abs(exponent)))+3;
-
- // should try to replicate NIST CODATA syntax
- os << std::setprecision(digits_of_precision)
- //<< std::setw(digits_of_precision+8)
- //<< std::scientific
- << val.value();
-// << long(10*(relative_uncertainty/std::pow(Y(10),Y(exponent))));
-
- os << " (rel. unc. = "
- << std::setprecision(1)
- //<< std::setw(7)
- << std::scientific
- << relative_uncertainty << ")";
- }
- else
- {
- os << val.value() << " (exact)";
- }
-
- return os;
-}
-
-// stream output
-template<class Char, class Traits, class Y>
-inline
-std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>& os,const constant<Y>&)
-{
- os << Y();
- return os;
-}
-
-} // namespace units
-
-} // namespace boost
-
-#endif // BOOST_UNITS_CONSTANTS_HPP

Modified: sandbox/units/boost/units/systems/si/codata/alpha_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/alpha_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/alpha_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/amount.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/deuteron_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/deuteron_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/deuteron_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/amount.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/electromagnetic_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/electromagnetic_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/electromagnetic_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/conductance.hpp>
 #include <boost/units/systems/si/current.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/electron_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/electron_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/electron_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/amount.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/helion_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/helion_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/helion_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/amount.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/muon_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/muon_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/muon_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/amount.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/neutron_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/neutron_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/neutron_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/amount.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/physico-chemical_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/physico-chemical_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/physico-chemical_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/amount.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/proton_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/proton_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/proton_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/amount.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/tau_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/tau_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/tau_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/amount.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/triton_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/triton_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/triton_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/amount.hpp>
 #include <boost/units/systems/si/area.hpp>
 #include <boost/units/systems/si/electric_charge.hpp>

Modified: sandbox/units/boost/units/systems/si/codata/universal_constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/codata/universal_constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/codata/universal_constants.hpp 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -13,7 +13,7 @@
 
 #include <boost/units/static_constant.hpp>
 
-#include <boost/units/systems/constants.hpp>
+#include <boost/units/systems/detail/constants.hpp>
 #include <boost/units/systems/si/capacitance.hpp>
 #include <boost/units/systems/si/current.hpp>
 #include <boost/units/systems/si/energy.hpp>

Modified: sandbox/units/libs/units/doc/Jamfile.v2
==============================================================================
--- sandbox/units/libs/units/doc/Jamfile.v2 (original)
+++ sandbox/units/libs/units/doc/Jamfile.v2 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -48,7 +48,7 @@
 
 run_doxygen systems_reference
   :
- [ path.glob-tree ../../../boost/units/systems : *.hpp ]
+ [ path.glob-tree ../../../boost/units/systems : *.hpp : detail ]
   :
     "Systems Reference"
   ;

Modified: sandbox/units/libs/units/test_headers/Jamfile.v2
==============================================================================
--- sandbox/units/libs/units/test_headers/Jamfile.v2 (original)
+++ sandbox/units/libs/units/test_headers/Jamfile.v2 2007-08-29 13:17:44 EDT (Wed, 29 Aug 2007)
@@ -19,7 +19,7 @@
 
   for local file in [ path.glob-tree ../../../boost/units : *.hpp ] {
 
- result += [ compile test.cpp : <define>BOOST_UNITS_HEADER_NAME=$(file) : [ regex.replace [ path.relative-to ../../.. $(file) ] "/" "_" ] ] ;
+ result += [ compile test.cpp : <define>BOOST_UNITS_HEADER_NAME=$(file) <dependency>$(file) : [ regex.replace [ path.relative-to ../../.. $(file) ] "/" "_" ] ] ;
 
   }
 


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