You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(89) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(208) |
Feb
(76) |
Mar
(55) |
Apr
(74) |
May
(43) |
Jun
(116) |
Jul
(109) |
Aug
(46) |
Sep
(36) |
Oct
(106) |
Nov
(159) |
Dec
(128) |
| 2007 |
Jan
(54) |
Feb
(225) |
Mar
(200) |
Apr
(229) |
May
(7) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Matthias S. <mat...@us...> - 2007-04-04 19:53:00
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angle In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31549/angle Added Files: degrees.hpp gradians.hpp Log Message: more rational angle syntax --- NEW FILE: gradians.hpp --- // 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_GRADIANS_HPP #define BOOST_UNITS_GRADIANS_HPP #include <cmath> #include <boost/units/conversion.hpp> #include <boost/units/io.hpp> #include <boost/units/quantity.hpp> #include <boost/units/static_constant.hpp> #include <boost/units/system.hpp> #include <boost/units/systems/physical_units.hpp> namespace boost { namespace units { namespace gradian { struct system_tag : public ordinal<-2> { }; ///< unit system tag for angles in gradians } // namespace gradian } // namespace units } // namespace boost #if BOOST_UNITS_HAS_BOOST_TYPEOF #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() BOOST_TYPEOF_REGISTER_TYPE(boost::units::gradian::system_tag) #endif namespace boost { namespace units { namespace gradian { typedef homogeneous_system<system_tag> system; ///< gradian unit system typedef unit<dimensionless_type,system> dimensionless; typedef unit<plane_angle_type,system> plane_angle; ///< angle gradian unit constant BOOST_UNITS_STATIC_CONSTANT(gradian,plane_angle); BOOST_UNITS_STATIC_CONSTANT(gradians,plane_angle); } // namespace gradian template<> struct base_unit_info<plane_angle_tag,gradian::system_tag> { static std::string name() { return "gradian"; } static std::string symbol() { return "grad"; } }; } // namespace units } // namespace boost #include <boost/units/systems/conversions/conversion_headers.hpp> #endif // BOOST_UNITS_GRADIANS_HPP --- NEW FILE: degrees.hpp --- // 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_DEGREE_HPP #define BOOST_UNITS_DEGREE_HPP #include <cmath> #include <boost/units/conversion.hpp> #include <boost/units/io.hpp> #include <boost/units/quantity.hpp> #include <boost/units/static_constant.hpp> #include <boost/units/system.hpp> #include <boost/units/systems/physical_units.hpp> namespace boost { namespace units { namespace degree { struct system_tag : public ordinal<-3> { }; ///< unit system tag for angles in degrees } // namespace degree } // namespace units } // namespace boost #if BOOST_UNITS_HAS_BOOST_TYPEOF #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() BOOST_TYPEOF_REGISTER_TYPE(boost::units::degree::system_tag) #endif namespace boost { namespace units { namespace degree { typedef homogeneous_system<system_tag> system; ///< degree unit system typedef unit<dimensionless_type,system> dimensionless; typedef unit<plane_angle_type,system> plane_angle; ///< angle degree unit constant BOOST_UNITS_STATIC_CONSTANT(degree,plane_angle); BOOST_UNITS_STATIC_CONSTANT(degrees,plane_angle); } // namespace degree template<> struct base_unit_info<plane_angle_tag,degree::system_tag> { static std::string name() { return "degree"; } static std::string symbol() { return "deg"; } }; } // namespace units } // namespace boost #include <boost/units/systems/conversions/conversion_headers.hpp> #endif // BOOST_UNITS_DEGREE_HPP |
|
From: Matthias S. <mat...@us...> - 2007-04-04 19:52:21
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angle In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31507/angle Log Message: Directory /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angle added to the repository |
|
From: Steven W. <ste...@us...> - 2007-04-04 19:39:14
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25761/boost-sandbox/boost/units Modified Files: measurement.hpp Log Message: Added new line at end of file Index: measurement.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/measurement.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- measurement.hpp 4 Apr 2007 19:29:50 -0000 1.8 +++ measurement.hpp 4 Apr 2007 19:39:14 -0000 1.9 @@ -342,4 +342,4 @@ } // namespace boost -#endif // BOOST_UNITS_MEASUREMENT_HPP \ No newline at end of file +#endif // BOOST_UNITS_MEASUREMENT_HPP |
|
From: Steven W. <ste...@us...> - 2007-04-04 19:29:56
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21505/boost-sandbox/boost/units Modified Files: measurement.hpp Log Message: Restore stream state in output operator Index: measurement.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/measurement.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- measurement.hpp 3 Apr 2007 23:14:00 -0000 1.7 +++ measurement.hpp 4 Apr 2007 19:29:50 -0000 1.8 @@ -16,6 +16,7 @@ #include <iomanip> #include <iostream> +#include <boost/io/ios_state.hpp> #include <boost/numeric/interval.hpp> #include <boost/units/static_rational.hpp> @@ -311,6 +312,10 @@ inline std::ostream& operator<<(std::ostream& os,const measurement<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 << val.value(); // // if (val.uncertainty() > Y(0)) |
|
From: Steven W. <ste...@us...> - 2007-04-04 19:20:11
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17296/boost-sandbox/libs/units/example Modified Files: unit_example_4.cpp Log Message: qualified radians to avoid ambiguity with SI::radians Index: unit_example_4.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_4.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- unit_example_4.cpp 3 Apr 2007 17:12:57 -0000 1.6 +++ unit_example_4.cpp 4 Apr 2007 19:20:10 -0000 1.7 @@ -372,7 +372,7 @@ //[unit_example_4_snippet_6 /// test trig stuff - quantity<angles::radians::radian> theta = 0.375*radians; + quantity<angles::radians::radian> theta = 0.375*boost::units::radians; quantity<angles::radians::dimensionless> sin_theta = sin(theta); quantity<angles::radians::radian> thetap = asin(sin_theta); //] @@ -497,9 +497,9 @@ sstream2 << "no typeof" << std::endl; #endif // BOOST_UNITS_HAS_TYPEOF sstream2 << std::endl; - sstream2 << "theta = 0.375 rad" << std::endl; - sstream2 << "sin(theta) = 0.366273 dimensionless" << std::endl; - sstream2 << "asin(sin(theta)) = 0.375 rad" << std::endl; + sstream2 << "theta = " << 0.375 << " rad" << std::endl; + sstream2 << "sin(theta) = " << 0.366273 << " dimensionless" << 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 << "I = (3,4) A" << std::endl; |
|
From: Steven W. <ste...@us...> - 2007-04-04 19:17:46
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16375/boost-sandbox/boost/units Modified Files: static_constant.hpp Log Message: Changed AUTO_STATIC_CONSTANT to use auto x = v instead of auto x(v) so it will never be parsed as a function declaration Index: static_constant.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/static_constant.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- static_constant.hpp 3 Apr 2007 20:54:15 -0000 1.3 +++ static_constant.hpp 4 Apr 2007 19:17:46 -0000 1.4 @@ -26,7 +26,7 @@ } \ \ template<bool b> \ -const type name##_instance_t<b>::instance \ +const type name##_instance_t<b>::instance /// A convenience macro for static constants with auto /// type deduction. @@ -36,17 +36,17 @@ #define BOOST_UNITS_AUTO_STATIC_CONSTANT(name, value) \ BOOST_TYPEOF_NESTED_TYPEDEF(name##_nested_t, value) \ -BOOST_UNITS_STATIC_CONSTANT(name, name##_nested_t::type)(value) \ +BOOST_UNITS_STATIC_CONSTANT(name, name##_nested_t::type) = (value) #elif BOOST_UNITS_HAS_MWERKS_TYPEOF #define BOOST_UNITS_AUTO_STATIC_CONSTANT(name, value) \ -BOOST_UNITS_STATIC_CONSTANT(name, __typeof__(value))(value) \ +BOOST_UNITS_STATIC_CONSTANT(name, __typeof__(value)) = (value) #elif BOOST_UNITS_HAS_GNU_TYPEOF #define BOOST_UNITS_AUTO_STATIC_CONSTANT(name, value) \ -BOOST_UNITS_STATIC_CONSTANT(name, typeof(value))(value) \ +BOOST_UNITS_STATIC_CONSTANT(name, typeof(value)) = (value) #endif // BOOST_UNITS_HAS_BOOST_TYPEOF |
|
From: Matthias S. <mat...@us...> - 2007-04-04 19:14:45
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14993 Modified Files: physical_units.hpp Log Message: base dimension tags are now typedefs of base_dimension<N> class Index: physical_units.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/physical_units.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- physical_units.hpp 3 Apr 2007 21:38:26 -0000 1.8 +++ physical_units.hpp 4 Apr 2007 19:14:45 -0000 1.9 @@ -27,32 +27,66 @@ namespace units { +template<long N> +struct base_dimension : + public mpl::int_<N> +{ + typedef mpl::int_<N> value; +}; + /// tag representing length -struct length_tag : public ordinal<-9> { }; +typedef base_dimension<-9> length_tag; /// tag representing mass -struct mass_tag : public ordinal<-8> { }; +typedef base_dimension<-8> mass_tag; /// tag representing time -struct time_tag : public ordinal<-7> { }; +typedef base_dimension<-7> time_tag; /// tag representing electrical current -struct current_tag : public ordinal<-6> { }; +typedef base_dimension<-6> current_tag; /// tag representing temperature -struct temperature_tag : public ordinal<-5> { }; +typedef base_dimension<-5> temperature_tag; /// tag representing amount of substance -struct amount_tag : public ordinal<-4> { }; +typedef base_dimension<-4> amount_tag; -/// tag representing luminous intensity - demoted from status as a fundamental SI unit in 1979 -struct luminous_intensity_tag : public ordinal<-3> { }; +/// tag representing luminous intensity +typedef base_dimension<-3> luminous_intensity_tag; /// tag representing plane angle -struct plane_angle_tag : public ordinal<-2> { }; +typedef base_dimension<-2> plane_angle_tag; /// tag representing solid angle -struct solid_angle_tag : public ordinal<-1> { }; +typedef base_dimension<-1> solid_angle_tag; + +///// tag representing length +////struct length_tag : public ordinal<-9> { }; +// +///// tag representing mass +//struct mass_tag : public ordinal<-8> { }; +// +///// tag representing time +//struct time_tag : public ordinal<-7> { }; +// +///// tag representing electrical current +//struct current_tag : public ordinal<-6> { }; +// +///// tag representing temperature +//struct temperature_tag : public ordinal<-5> { }; +// +///// tag representing amount of substance +//struct amount_tag : public ordinal<-4> { }; +// +///// tag representing luminous intensity - demoted from status as a fundamental SI unit in 1979 +//struct luminous_intensity_tag : public ordinal<-3> { }; +// +///// tag representing plane angle +//struct plane_angle_tag : public ordinal<-2> { }; +// +///// tag representing solid angle +//struct solid_angle_tag : public ordinal<-1> { }; } |
|
From: Steven W. <ste...@us...> - 2007-04-04 19:14:45
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15003/boost-sandbox/boost/units Modified Files: static_rational.hpp Log Message: Added mpl arithmetic Index: static_rational.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/static_rational.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- static_rational.hpp 16 Mar 2007 18:12:42 -0000 1.1.1.1 +++ static_rational.hpp 4 Apr 2007 19:14:27 -0000 1.2 @@ -16,6 +16,8 @@ #include <boost/math/common_factor.hpp> +#include <boost/mpl/arithmetic.hpp> + #include <boost/units/operators.hpp> /// \file @@ -25,6 +27,12 @@ namespace units { +namespace detail { + +struct static_rational_tag {}; + +} + typedef long integer_type; /// Compile time absolute value. @@ -66,6 +74,7 @@ static_cast<integer_type>(boost::math::static_gcd<nabs,dabs>::value); public: + typedef detail::static_rational_tag tag; static const integer_type Numerator = N/den, Denominator = D/den; @@ -323,6 +332,57 @@ } // namespace units +namespace mpl { + +template<> +struct plus_impl<boost::units::detail::static_rational_tag, boost::units::detail::static_rational_tag> +{ + template<class T0, class T1> + struct apply { + typedef typename boost::units::static_add<T0, T1>::type type; + }; +}; + +template<> +struct minus_impl<boost::units::detail::static_rational_tag, boost::units::detail::static_rational_tag> +{ + template<class T0, class T1> + struct apply { + typedef typename boost::units::static_subtract<T0, T1>::type type; + }; +}; + +template<> +struct times_impl<boost::units::detail::static_rational_tag, boost::units::detail::static_rational_tag> +{ + template<class T0, class T1> + struct apply { + typedef typename boost::units::static_multiply<T0, T1>::type type; + }; +}; + +template<> +struct divides_impl<boost::units::detail::static_rational_tag, boost::units::detail::static_rational_tag> +{ + template<class T0, class T1> + struct apply { + typedef typename boost::units::static_divide<T0, T1>::type type; + }; +}; + +template<> +struct negate_impl<boost::units::detail::static_rational_tag> +{ + template<class T0> + struct apply { + typedef typename boost::units::static_negate<T0>::type type; + }; +}; + + + +} + } // namespace boost #endif // BOOST_UNITS_STATIC_RATIONAL_HPP |
|
From: Matthias S. <mat...@us...> - 2007-04-04 05:49:19
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17444/example Modified Files: unit_example_14.cpp unit_example_22.cpp Log Message: include difeq solution in performance test, demonstrate specializing operator>> for ostreams Index: unit_example_22.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_22.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- unit_example_22.cpp 3 Apr 2007 22:43:41 -0000 1.7 +++ unit_example_22.cpp 4 Apr 2007 05:49:18 -0000 1.8 @@ -121,7 +121,7 @@ return 0; } */ - +/* #include <iostream> #include <boost/units/io.hpp> #include <boost/units/systems/si.hpp> @@ -179,7 +179,7 @@ return 0; } - +*/ /* //// main.cpp //// @@ -348,6 +348,45 @@ return 0; } */ +#include <iostream> + +#include <boost/units/io.hpp> +#include <boost/units/systems/si/energy.hpp> +#include <boost/units/systems/si/power.hpp> + +namespace boost { +namespace units { + +template<class Char, class Traits> +std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os, + const SI::energy& u) +{ + os << "J"; + return os; +} + +template<class Char, class Traits> +std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os, + const SI::power& u) +{ + os << "W"; + return os; +} + +} + +} + +int main() +{ + using namespace boost::units; + + std::cout << quantity<SI::energy>(1.0*SI::joules) << std::endl + << quantity<SI::power>(2.0*SI::watts) << std::endl + << std::endl; + + return 0; +} Index: unit_example_14.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_14.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- unit_example_14.cpp 2 Apr 2007 21:28:40 -0000 1.2 +++ unit_example_14.cpp 4 Apr 2007 05:49:18 -0000 1.3 @@ -201,14 +201,18 @@ #include <cstdlib> #include <ctime> #include <algorithm> +#include <iostream> +#include <iomanip> #include <boost/timer.hpp> +#include <boost/utility/result_of.hpp> #include <boost/numeric/ublas/matrix.hpp> #include <boost/units/quantity.hpp> #include <boost/units/systems/si.hpp> +#include <boost/units/cmath.hpp> enum { - tile_block_size = 16 + tile_block_size = 24 }; template<class T0, class T1, class Out> @@ -260,6 +264,69 @@ enum { max_value = 1000}; +template<class F, class T, class N, class R> +R solve_differential_equation(F f, T lower, T upper, N steps, R start) { + T h = (upper - lower) / steps; + for(N i = N(); i < steps; ++i) { + R y = start; + T x = lower + h * i; + typename F::template result<T, R>::type k1 = f(x, y); + typename F::template result<T, R>::type k2 = f(x + h/2, y + h * k1 / 2); + typename F::template result<T, R>::type k3 = f(x + h/2, y + h * k2 / 2); + typename F::template result<T, R>::type k4 = f(x + h, y + h * k3); + start = y + h * (k1 + 2 * k2 + 2 * k3 + k4) / 6; + } + return(start); +} + +using namespace boost::units; + +//y' = 1 - x + 4 * y +struct f { + template<class Arg1, class Arg2> struct result; + + double operator()(const double& x, const double& y) const { + return(1 - x + 4 * y); + } + + boost::units::quantity<boost::units::SI::velocity> + operator()(const quantity<SI::time>& x, const quantity<SI::length>& y) const { + using namespace boost::units; + using namespace SI; + return(1 * meters / second - x * meters / pow<2>(seconds) + 4 * y / seconds ); + } +}; + +template<> +struct f::result<double,double> { + typedef double type; +}; + +template<> +struct f::result<quantity<SI::time>, quantity<SI::length> > { + typedef quantity<SI::velocity> type; +}; + + + +//y' = 1 - x + 4 * y +//y' - 4 * y = 1 - x +//e^(-4 * x) * (dy - 4 * y * dx) = e^(-4 * x) * (1 - x) * dx +//d/dx(y * e ^ (-4 * x)) = e ^ (-4 * x) (1 - x) * dx + +//d/dx(y * e ^ (-4 * x)) = e ^ (-4 * x) * dx - x * e ^ (-4 * x) * dx +//d/dx(y * e ^ (-4 * x)) = d/dx((-3/16 + 1/4 * x) * e ^ (-4 * x)) +//y * e ^ (-4 * x) = (-3/16 + 1/4 * x) * e ^ (-4 * x) + C +//y = (-3/16 + 1/4 * x) + C/e ^ (-4 * x) +//y = 1/4 * x - 3/16 + C * e ^ (4 * x) + +//y(0) = 1 +//1 = - 3/16 + C +//C = 19/16 +//y(x) = 1/4 * x - 3/16 + 19/16 * e ^ (4 * x) + + + int main() { boost::numeric::ublas::matrix<double> ublas_result; { @@ -272,6 +339,7 @@ m2(i,j) = std::rand(); } } + std::cout << "multiplying ublas::matrix<double>(" << max_value << ", " << max_value << ") : "; boost::timer timer; ublas_result = (prod(m1, m2)); std::cout << timer.elapsed() << " seconds" << std::endl; @@ -287,6 +355,7 @@ m2(i,j) = std::rand(); } } + std::cout << "multiplying ublas::matrix<quantity>(" << max_value << ", " << max_value << ") : "; boost::timer timer; ublas_resultq = (prod(m1, m2)); std::cout << timer.elapsed() << " seconds" << std::endl; @@ -300,10 +369,9 @@ m1[i] = std::rand(); m2[i] = std::rand(); } - //std::vector<double> m3(max_value * max_value); + std::cout << "tiled_matrix_multiply<double>(" << max_value << ", " << max_value << ") : "; boost::timer timer; tiled_multiply_carray_outer(&m1[0], &m2[0], &cresult[0], max_value, max_value, max_value); - //multiply_carray(&m1[0], &m2[0], &cresult[0], max_value, max_value, max_value); std::cout << timer.elapsed() << " seconds" << std::endl; } std::vector<boost::units::quantity<boost::units::SI::energy> > cresultq(max_value * max_value); @@ -315,17 +383,56 @@ m1[i] = std::rand() * boost::units::SI::newtons; m2[i] = std::rand() * boost::units::SI::meters; } + std::cout << "tiled_matrix_multiply<quantity>(" << max_value << ", " << max_value << ") : "; boost::timer timer; tiled_multiply_carray_outer(&m1[0], &m2[0], &cresultq[0], max_value, max_value, max_value); std::cout << timer.elapsed() << " seconds" << std::endl; } for(int i = 0; i < max_value; ++i) { for(int j = 0; j < max_value; ++j) { - if(std::abs(ublas_result(i,j) - cresult[i * max_value + j]) > .000001) { - std::cout << "i = " << i << ", j = " << j << std::endl; - std::cout << "ublas = " << ublas_result(i,j) << ", c = " << cresult[i * max_value + j] << std::endl; + if(std::abs(ublas_result(i,j) - cresult[i * max_value + j]) > ublas_result(i,j) /1e14) { + std::cout << std::setprecision(15) << "Uh Oh. ublas_result(" << i << "," << j << ") = " << ublas_result(i,j) << std::endl + << "cresult[" << i << " * " << max_value << " + " << j << "] = " << cresult[i * max_value + j] << std::endl; return(EXIT_FAILURE); } } } -} \ No newline at end of file + { + std::vector<double> values(1000); + std::cout << "solving y' = 1 - x + 4 * y with double: "; + boost::timer timer; + for(int i = 0; i < 1000; ++i) { + double x = .1 * i; + values[i] = solve_differential_equation(f(), 0.0, x, i * 100, 1.0); + } + std::cout << timer.elapsed() << " seconds" << std::endl; + for(int i = 0; i < 1000; ++i) { + double x = .1 * i; + double value = 1.0/4.0 * x - 3.0/16.0 + 19.0/16.0 * std::exp(4 * x); + if(std::abs(values[i] - value) > value / 1e9) { + std::cout << std::setprecision(15) << "i = : " << i << ", value = " << value << " approx = " << values[i] << std::endl; + return(EXIT_FAILURE); + } + } + } + { + using namespace boost::units; + using namespace SI; + std::vector<quantity<length> > values(1000); + std::cout << "solving y' = 1 - x + 4 * y with quantity: "; + boost::timer timer; + for(int i = 0; i < 1000; ++i) { + quantity<SI::time> x = .1 * i * seconds; + values[i] = solve_differential_equation(f(), 0.0 * seconds, x, i * 100, 1.0 * meters); + } + std::cout << timer.elapsed() << " seconds" << std::endl; + for(int i = 0; i < 1000; ++i) { + double x = .1 * i; + quantity<SI::length> value = (1.0/4.0 * x - 3.0/16.0 + 19.0/16.0 * std::exp(4 * x)) * meters; + if(abs(values[i] - value) > value / 1e9) { + std::cout << std::setprecision(15) << "i = : " << i << ", value = " << value << " approx = " << values[i] << std::endl; + return(EXIT_FAILURE); + } + } + } +} |
|
From: Matthias S. <mat...@us...> - 2007-04-03 23:14:11
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25425/systems/si Modified Files: codata_constants.hpp Log Message: use granular SI headers Index: codata_constants.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata_constants.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- codata_constants.hpp 26 Mar 2007 18:32:33 -0000 1.2 +++ codata_constants.hpp 3 Apr 2007 23:14:00 -0000 1.3 @@ -11,6 +11,8 @@ #ifndef BOOST_UNITS_CODATA_CONSTANTS_HPP #define BOOST_UNITS_CODATA_CONSTANTS_HPP +#include <boost/units/systems/si/base.hpp> + /// \file includes all the files boost/units/systems/si/codata/*.hpp namespace boost { |
|
From: Matthias S. <mat...@us...> - 2007-04-03 23:14:11
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25425 Modified Files: measurement.hpp Log Message: use granular SI headers Index: measurement.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/measurement.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- measurement.hpp 3 Apr 2007 14:54:27 -0000 1.6 +++ measurement.hpp 3 Apr 2007 23:14:00 -0000 1.7 @@ -311,24 +311,24 @@ inline std::ostream& operator<<(std::ostream& os,const measurement<Y>& val) { - os << val.value(); - - if (val.uncertainty() > Y(0)) - os << "(+/-" << val.uncertainty() << ")"; - -// os << std::setprecision(13) -// << std::setw(21) -// << std::scientific -// << val.value(); +// os << val.value(); // // if (val.uncertainty() > Y(0)) -// os << " (rel. unc. = " -// << std::setprecision(1) -// << std::setw(7) -// << std::scientific -// << std::abs(val.uncertainty()/val.value()) << ")"; -// else -// os << " (exact)"; +// os << "(+/-" << val.uncertainty() << ")"; + + os << std::setprecision(13) + << std::setw(21) + << std::scientific + << val.value(); + + if (val.uncertainty() > Y(0)) + os << " (rel. unc. = " + << std::setprecision(1) + << std::setw(7) + << std::scientific + << std::abs(val.uncertainty()/val.value()) << ")"; + else + os << " (exact)"; return os; } |
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25425/systems/si/codata Modified Files: atomic_and_nuclear_constants.hpp electromagnetic_constants.hpp physico-chemical_constants.hpp universal_constants.hpp Log Message: use granular SI headers Index: universal_constants.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata/universal_constants.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- universal_constants.hpp 3 Apr 2007 20:54:15 -0000 1.3 +++ universal_constants.hpp 3 Apr 2007 23:14:00 -0000 1.4 @@ -15,7 +15,18 @@ #include <boost/units/measurement.hpp> #include <boost/units/static_constant.hpp> -#include <boost/units/systems/si.hpp> +//#include <boost/units/systems/si.hpp> + +#include <boost/units/systems/si/capacitance.hpp> +#include <boost/units/systems/si/current.hpp> +#include <boost/units/systems/si/energy.hpp> +#include <boost/units/systems/si/force.hpp> +#include <boost/units/systems/si/length.hpp> +#include <boost/units/systems/si/mass.hpp> +#include <boost/units/systems/si/resistance.hpp> +#include <boost/units/systems/si/temperature.hpp> +#include <boost/units/systems/si/time.hpp> +#include <boost/units/systems/si/volume.hpp> /// \file /// CODATA recommended values of fundamental universal constants Index: physico-chemical_constants.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata/physico-chemical_constants.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- physico-chemical_constants.hpp 3 Apr 2007 22:43:11 -0000 1.4 +++ physico-chemical_constants.hpp 3 Apr 2007 23:14:00 -0000 1.5 @@ -15,7 +15,17 @@ #include <boost/units/measurement.hpp> #include <boost/units/static_constant.hpp> -#include <boost/units/systems/si.hpp> +//#include <boost/units/systems/si.hpp> + +#include <boost/units/systems/si/amount.hpp> +#include <boost/units/systems/si/area.hpp> +#include <boost/units/systems/si/electric_charge.hpp> +#include <boost/units/systems/si/energy.hpp> +#include <boost/units/systems/si/frequency.hpp> +#include <boost/units/systems/si/mass.hpp> +#include <boost/units/systems/si/power.hpp> +#include <boost/units/systems/si/solid_angle.hpp> +#include <boost/units/systems/si/temperature.hpp> /// \file /// CODATA recommended values of fundamental physico-chemical constants Index: atomic_and_nuclear_constants.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata/atomic_and_nuclear_constants.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- atomic_and_nuclear_constants.hpp 3 Apr 2007 22:43:11 -0000 1.5 +++ atomic_and_nuclear_constants.hpp 3 Apr 2007 23:14:00 -0000 1.6 @@ -15,7 +15,16 @@ #include <boost/units/measurement.hpp> #include <boost/units/static_constant.hpp> -#include <boost/units/systems/si.hpp> +//#include <boost/units/systems/si.hpp> + +#include <boost/units/systems/si/amount.hpp> +#include <boost/units/systems/si/area.hpp> +#include <boost/units/systems/si/electric_charge.hpp> +#include <boost/units/systems/si/energy.hpp> +#include <boost/units/systems/si/length.hpp> +#include <boost/units/systems/si/mass.hpp> +#include <boost/units/systems/si/magnetic_flux_density.hpp> +#include <boost/units/systems/si/time.hpp> /// \file /// CODATA recommended values of fundamental atomic and nuclear constants @@ -269,7 +278,7 @@ /// shielded helion-shielded proton magnetic moment ratio BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_h_prime_over_mu_p_prime,(measurement<double>(-0.7617861313,3.3e-8)*dimensionless())); /// shielded helion gyromagnetic ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_h_prime,(measurement<double>(2.037894730e8,5.6e-8)/second/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_h_prime,(measurement<double>(2.037894730e8,5.6e-0)/second/tesla)); /// alpha particle mass BOOST_UNITS_AUTO_STATIC_CONSTANT(m_alpha,(measurement<double>(6.64465620e-27,3.3e-34)*kilograms)); Index: electromagnetic_constants.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata/electromagnetic_constants.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- electromagnetic_constants.hpp 31 Mar 2007 00:59:00 -0000 1.3 +++ electromagnetic_constants.hpp 3 Apr 2007 23:14:00 -0000 1.4 @@ -15,7 +15,17 @@ #include <boost/units/measurement.hpp> #include <boost/units/static_constant.hpp> -#include <boost/units/systems/si.hpp> +//#include <boost/units/systems/si.hpp> + +#include <boost/units/systems/si/conductance.hpp> +#include <boost/units/systems/si/current.hpp> +#include <boost/units/systems/si/electric_charge.hpp> +#include <boost/units/systems/si/electric_potential.hpp> +#include <boost/units/systems/si/energy.hpp> +#include <boost/units/systems/si/frequency.hpp> +#include <boost/units/systems/si/magnetic_flux.hpp> +#include <boost/units/systems/si/magnetic_flux_density.hpp> +#include <boost/units/systems/si/resistance.hpp> /// \file /// CODATA recommended values of fundamental electromagnetic constants |
|
From: Matthias S. <mat...@us...> - 2007-04-03 23:13:50
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25407/example Modified Files: unit_example_19.cpp Log Message: use granular SI headers Index: unit_example_19.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_19.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- unit_example_19.cpp 3 Apr 2007 22:43:40 -0000 1.7 +++ unit_example_19.cpp 3 Apr 2007 23:13:40 -0000 1.8 @@ -232,7 +232,7 @@ #include <iostream> #include <boost/units/io.hpp> -#include <boost/units/systems/si.hpp> +//#include <boost/units/systems/si.hpp> #include <boost/units/systems/si/constants.hpp> #if BOOST_UNITS_HAS_TYPEOF |
|
From: Matthias S. <mat...@us...> - 2007-04-03 22:49:35
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15772/systems Modified Files: abstract.hpp Log Message: minor fix Index: abstract.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/abstract.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- abstract.hpp 3 Apr 2007 21:39:48 -0000 1.5 +++ abstract.hpp 3 Apr 2007 22:49:34 -0000 1.6 @@ -48,15 +48,15 @@ typedef homogeneous_system<system_tag> system; -typedef unit<length_type,system> length; ///< abstract unit of length -typedef unit<mass_type,system> mass; ///< abstract unit of mass -typedef unit<time_type,system> time; ///< abstract unit of time -typedef unit<current_type,system> current; ///< abstract unit of current -typedef unit<temperature_type,system> temperature; ///< abstract unit of temperature -typedef unit<amount_type,system> amount; ///< abstract unit of amount -typedef unit<luminous_intensity_type,system> luminous_intensity; ///< abstract unit of intensity -typedef unit<plane_angle_type,system> angle; ///< abstract unit of angle -typedef unit<solid_angle_type,system> solid_angle; ///< abstract unit of solid angle +typedef unit<length_type,system> length; ///< abstract unit of length +typedef unit<mass_type,system> mass; ///< abstract unit of mass +typedef unit<time_type,system> time; ///< abstract unit of time +typedef unit<current_type,system> current; ///< abstract unit of current +typedef unit<temperature_type,system> temperature; ///< abstract unit of temperature +typedef unit<amount_type,system> amount; ///< abstract unit of amount +typedef unit<luminous_intensity_type,system> luminous_intensity; ///< abstract unit of luminous intensity +typedef unit<plane_angle_type,system> plane_angle; ///< abstract unit of plane angle +typedef unit<solid_angle_type,system> solid_angle; ///< abstract unit of solid angle } // namespace abstract |
|
From: Matthias S. <mat...@us...> - 2007-04-03 22:43:42
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13389/example Modified Files: unit_example_19.cpp unit_example_20.cpp unit_example_22.cpp Log Message: SI/CODATA additions Index: unit_example_20.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_20.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- unit_example_20.cpp 2 Apr 2007 21:28:40 -0000 1.4 +++ unit_example_20.cpp 3 Apr 2007 22:43:40 -0000 1.5 @@ -21,9 +21,9 @@ @verbatim { 32 } F -{ 273.16 } K -{ 273.16 } K -{ 273.16 } K +{ 273.15 } K +{ 273.15 } K +{ 273.15 } K [ 32 ] F [ 17.7778 ] K [ 17.7778 ] K @@ -94,7 +94,7 @@ { const typename from_quantity_type::value_type& in(source.value()); - return to_quantity_type::from_value((in.value()-32)*(5.0/9.0) + 273.16); + return to_quantity_type::from_value((in.value()-32)*(5.0/9.0) + 273.15); } }; @@ -151,9 +151,9 @@ << std::endl; sstream2 << "32 absolute F" << std::endl - << "273.16 absolute K" << std::endl - << "273.16 absolute K" << std::endl - << "273.16 absolute K" << std::endl + << "273.15 absolute K" << std::endl + << "273.15 absolute K" << std::endl + << "273.15 absolute K" << std::endl << "32 F" << std::endl << "17.7778 K" << std::endl << "17.7778 K" << std::endl Index: unit_example_22.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_22.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- unit_example_22.cpp 3 Apr 2007 20:48:07 -0000 1.6 +++ unit_example_22.cpp 3 Apr 2007 22:43:41 -0000 1.7 @@ -267,8 +267,8 @@ int main() { -// quantity<SI::temperature> KTR(273.16*SI::kelvin); -// quantity<SI::temperature,absolute<> > KTA(absolute<>(273.16)*SI::kelvin); +// quantity<SI::temperature> KTR(273.15*SI::kelvin); +// quantity<SI::temperature,absolute<> > KTA(absolute<>(273.15)*SI::kelvin); // // quantity<celsius::temperature> CTR(0.0*celsius::degrees); // quantity<celsius::temperature,absolute<> > CTA(absolute<>(0.0)*celsius::degrees); @@ -276,8 +276,8 @@ // quantity<fahrenheit::temperature> FTR(32.0*fahrenheit::degrees); // quantity<fahrenheit::temperature,absolute<> > FTA(absolute<>(32.0)*fahrenheit::degrees); - quantity<SI::temperature> KTR(373.16*SI::kelvin); - quantity<SI::temperature,absolute<> > KTA(absolute<>(373.16)*SI::kelvin); + quantity<SI::temperature> KTR(373.15*SI::kelvin); + quantity<SI::temperature,absolute<> > KTA(absolute<>(373.15)*SI::kelvin); quantity<celsius::temperature> CTR(100.0*celsius::degrees); quantity<celsius::temperature,absolute<> > CTA(absolute<>(100.0)*celsius::degrees); Index: unit_example_19.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_19.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- unit_example_19.cpp 3 Apr 2007 14:51:21 -0000 1.6 +++ unit_example_19.cpp 3 Apr 2007 22:43:40 -0000 1.7 @@ -270,11 +270,12 @@ << "F :\t" << F << std::endl << "R :\t" << R << std::endl << "k_B :\t" << k_B << std::endl - << "V_m :\t" << V_m << std::endl << "sigma_SB :\t" << sigma_SB << std::endl << "c_1 :\t" << c_1 << std::endl + << "c_1L :\t" << c_1L << std::endl << "c_2 :\t" << c_2 << std::endl << "b :\t" << b << std::endl + << "b' :\t" << b_prime << std::endl << std::endl << "Atomic and nuclear constants: " << std::endl << std::endl << "alpha :\t" << alpha << std::endl << "R_infinity :\t" << R_infinity << std::endl @@ -314,6 +315,8 @@ << "M_mu :\t" << M_mu << std::endl << "lambda_C_mu :\t" << lambda_C_mu << std::endl << "mu_mu :\t" << mu_mu << std::endl + << "mu_mu/mu_B :\t" << mu_mu_over_mu_B << std::endl + << "mu_mu/mu_N :\t" << mu_mu_over_mu_N << std::endl << "a_mu :\t" << a_mu << std::endl << "g_mu :\t" << g_mu << std::endl << "mu_mu/mu_p :\t" << mu_mu_over_mu_p << std::endl @@ -333,11 +336,17 @@ << "m_p/m_n :\t" << m_p_over_m_n << std::endl << "e/m_p :\t" << e_over_m_p << std::endl << "M_p :\t" << M_p << std::endl + << "lambda_C_p :\t" << lambda_C_p << std::endl << "R_p :\t" << R_p << std::endl << "mu_p :\t" << mu_p << std::endl + << "mu_p/mu_B :\t" << mu_p_over_mu_B << std::endl + << "mu_p/mu_N :\t" << mu_p_over_mu_N << std::endl << "g_p :\t" << g_p << std::endl << "mu_p/mu_n :\t" << mu_p_over_mu_n << std::endl << "mu_p' :\t" << mu_p_prime << std::endl + << "mu_p'/mu_B :\t" << mu_p_prime_over_mu_B << std::endl + << "mu_p'/mu_N :\t" << mu_p_prime_over_mu_N << std::endl + << "sigma_p' :\t" << sigma_p_prime << std::endl << "gamma_p :\t" << gamma_p << std::endl << "gamma_p' :\t" << gamma_p_prime << std::endl << std::endl << " neutron: " << std::endl << std::endl @@ -346,10 +355,11 @@ << "m_n/m_mu :\t" << m_n_over_m_mu << std::endl << "m_n/m_tau :\t" << m_n_over_m_tau << std::endl << "m_n/m_p :\t" << m_n_over_m_p << std::endl - << "lambda_C_n :\t" << lambda_C_n << std::endl << "M_n :\t" << M_n << std::endl + << "lambda_C_n :\t" << lambda_C_n << std::endl << "mu_n :\t" << mu_n << std::endl << "g_n :\t" << g_n << std::endl + << "mu_n/mu_e :\t" << mu_n_over_mu_e << std::endl << "mu_n/mu_p :\t" << mu_n_over_mu_p << std::endl << "mu_n/mu_p' :\t" << mu_n_over_mu_p_prime << std::endl << "gamma_n :\t" << gamma_n << std::endl @@ -360,13 +370,40 @@ << "M_d :\t" << M_d << std::endl << "R_d :\t" << R_d << std::endl << "mu_d :\t" << mu_d << std::endl + << "mu_d/mu_B :\t" << mu_d_over_mu_B << std::endl + << "mu_d/mu_N :\t" << mu_d_over_mu_N << std::endl + << "g_d :\t" << g_d << std::endl << "mu_d/mu_e :\t" << mu_d_over_mu_e << std::endl << "mu_d/mu_p :\t" << mu_d_over_mu_p << std::endl << "mu_d/mu_n :\t" << mu_d_over_mu_n << std::endl + << std::endl << " triton: " << std::endl << std::endl + << "m_t :\t" << m_t << std::endl + << "m_t/m_e :\t" << m_t_over_m_e << std::endl + << "m_t/m_p :\t" << m_t_over_m_p << std::endl + << "M_t :\t" << M_t << std::endl + << "mu_t :\t" << mu_t << std::endl + << "mu_t/mu_B :\t" << mu_t_over_mu_B << std::endl + << "mu_t/mu_N :\t" << mu_t_over_mu_N << std::endl + << "g_t :\t" << g_t << std::endl + << "mu_t/mu_e :\t" << mu_t_over_mu_e << std::endl + << "mu_t/mu_p :\t" << mu_t_over_mu_p << std::endl + << "mu_t/mu_n :\t" << mu_t_over_mu_n << std::endl << std::endl << " helion: " << std::endl << std::endl << "m_h :\t" << m_h << std::endl + << "m_h/m_e :\t" << m_h_over_m_e << std::endl + << "m_h/m_p :\t" << m_h_over_m_p << std::endl + << "M_h :\t" << M_h << std::endl + << "mu_h' :\t" << mu_h_prime << std::endl + << "mu_h'/mu_B :\t" << mu_h_prime_over_mu_B << std::endl + << "mu_h'/mu_N :\t" << mu_h_prime_over_mu_N << std::endl + << "mu_h'/mu_p :\t" << mu_h_prime_over_mu_p << std::endl + << "mu_h'/mu_p' :\t" << mu_h_prime_over_mu_p_prime << std::endl + << "gamma_h' :\t" << gamma_h_prime << std::endl << std::endl << " alpha particle: " << std::endl << std::endl << "m_alpha :\t" << m_alpha << std::endl + << "m_alpha/m_e :\t" << m_alpha_over_m_e << std::endl + << "m_alpha/m_p :\t" << m_alpha_over_m_p << std::endl + << "M_alpha :\t" << M_alpha << std::endl << std::endl; return 0; |
|
From: Matthias S. <mat...@us...> - 2007-04-03 22:43:13
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12996/systems/si/codata Modified Files: atomic_and_nuclear_constants.hpp physico-chemical_constants.hpp Log Message: SI/CODATA additions Index: physico-chemical_constants.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata/physico-chemical_constants.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- physico-chemical_constants.hpp 30 Mar 2007 23:49:14 -0000 1.3 +++ physico-chemical_constants.hpp 3 Apr 2007 22:43:11 -0000 1.4 @@ -42,16 +42,18 @@ BOOST_UNITS_AUTO_STATIC_CONSTANT(R,(measurement<double>(8.314472,1.5e-5)*joules/kelvin/mole)); /// Boltzmann constant BOOST_UNITS_AUTO_STATIC_CONSTANT(k_B,(measurement<double>(1.3806504e-23,2.4e-29)*joules/kelvin)); -/// molar volume of ideal gas -BOOST_UNITS_AUTO_STATIC_CONSTANT(V_m,(measurement<double>(22.413996e-3,3.9e-8)*cubic_meters/mole)); /// Stefan-Boltzmann constant BOOST_UNITS_AUTO_STATIC_CONSTANT(sigma_SB,(measurement<double>(5.670400e-8,4.0e-13)*watts/square_meter/pow<4>(kelvin))); /// first radiation constant BOOST_UNITS_AUTO_STATIC_CONSTANT(c_1,(measurement<double>(3.74177118e-16,1.9e-23)*watt*square_meters)); +/// first radiation constant for spectral radiance +BOOST_UNITS_AUTO_STATIC_CONSTANT(c_1L,(measurement<double>(1.191042759e-16,5.9e-24)*watt*square_meters/steradian)); /// second radiation constant BOOST_UNITS_AUTO_STATIC_CONSTANT(c_2,(measurement<double>(1.4387752e-2,2.5e-8)*meter*kelvin)); -/// Wien displacement law constant +/// Wien displacement law constant : lambda_max T BOOST_UNITS_AUTO_STATIC_CONSTANT(b,(measurement<double>(2.8977685e-3,5.1e-9)*meter*kelvin)); +/// Wien displacement law constant : nu_max/T +BOOST_UNITS_AUTO_STATIC_CONSTANT(b_prime,(measurement<double>(5.878933e10,1.0e15)*hertz/kelvin)); } // namespace CODATA Index: atomic_and_nuclear_constants.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata/atomic_and_nuclear_constants.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- atomic_and_nuclear_constants.hpp 2 Apr 2007 03:15:15 -0000 1.4 +++ atomic_and_nuclear_constants.hpp 3 Apr 2007 22:43:11 -0000 1.5 @@ -108,12 +108,12 @@ BOOST_UNITS_AUTO_STATIC_CONSTANT(lambda_C_mu,(measurement<double>(11.73444104e-15,3.0e-22)*meters)); /// muon magnetic moment BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_mu,(measurement<double>(-4.49044786e-26,1.6e-33)*joules/tesla)); -/// muon magnetic moment anomaly -BOOST_UNITS_AUTO_STATIC_CONSTANT(a_mu,(measurement<double>(1.16592069e-3,6.0e-10)*dimensionless())); /// muon-Bohr magneton ratio BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_mu_over_mu_B,(measurement<double>(-4.84197049e-3,1.2e-10)*dimensionless())); /// muon-nuclear magneton ratio BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_mu_over_mu_N,(measurement<double>(-8.89059705,2.3e-7)*dimensionless())); +/// muon magnetic moment anomaly +BOOST_UNITS_AUTO_STATIC_CONSTANT(a_mu,(measurement<double>(1.16592069e-3,6.0e-10)*dimensionless())); /// muon g-factor BOOST_UNITS_AUTO_STATIC_CONSTANT(g_mu,(measurement<double>(-2.0023318414,1.2e-9)*dimensionless())); /// muon-proton magnetic moment ratio @@ -164,6 +164,12 @@ BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_p_over_mu_n,(measurement<double>(-1.45989806,3.4e-7)*dimensionless())); /// shielded proton magnetic moment BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_p_prime,(measurement<double>(1.410570419e-26,3.8e-34)*joules/tesla)); +/// shielded proton-Bohr magneton ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_p_prime_over_mu_B,(measurement<double>(1.520993128e-3,1.7e-11)*dimensionless())); +/// shielded proton-nuclear magneton ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_p_prime_over_mu_N,(measurement<double>(2.792775598,3.0e-8)*dimensionless())); +/// proton magnetic shielding correction +BOOST_UNITS_AUTO_STATIC_CONSTANT(sigma_p_prime,(measurement<double>(25.694e-6,1.4e-8)*dimensionless())); /// proton gyromagnetic ratio BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_p,(measurement<double>(2.675222099e8,7.0e0)/second/tesla)); /// shielded proton gyromagnetic ratio @@ -179,14 +185,16 @@ BOOST_UNITS_AUTO_STATIC_CONSTANT(m_n_over_m_tau,(measurement<double>(0.528740,8.6e-5)*dimensionless())); /// neutron-proton mass ratio BOOST_UNITS_AUTO_STATIC_CONSTANT(m_n_over_m_p,(measurement<double>(1.00137841918,4.6e-10)*dimensionless())); -/// neutron Compton wavelength -BOOST_UNITS_AUTO_STATIC_CONSTANT(lambda_C_n,(measurement<double>(1.3195908951e-15,2.0e-24)*meters)); /// neutron molar mass BOOST_UNITS_AUTO_STATIC_CONSTANT(M_n,(measurement<double>(1.00866491597e-3,4.3e-13)*kilograms/mole)); +/// neutron Compton wavelength +BOOST_UNITS_AUTO_STATIC_CONSTANT(lambda_C_n,(measurement<double>(1.3195908951e-15,2.0e-24)*meters)); /// neutron magnetic moment BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_n,(measurement<double>(-0.96623641e-26,2.3e-33)*joules/tesla)); /// neutron g-factor BOOST_UNITS_AUTO_STATIC_CONSTANT(g_n,(measurement<double>(-3.82608545,9.0e-7)*dimensionless())); +/// neutron-electron magnetic moment ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_n_over_mu_e,(measurement<double>(1.04066882e-3,2.5e-10)*dimensionless())); /// neutron-proton magnetic moment ratio BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_n_over_mu_p,(measurement<double>(-0.68497934,1.6e-7)*dimensionless())); /// neutron-shielded proton magnetic moment ratio @@ -197,15 +205,21 @@ /// deuteron mass BOOST_UNITS_AUTO_STATIC_CONSTANT(m_d,(measurement<double>(3.34358320e-27,1.7e-34)*kilograms)); /// deuteron-electron mass ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_d_over_m_e,(measurement<double>(3670.4829654,1.6e-6)*kilograms/kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_d_over_m_e,(measurement<double>(3670.4829654,1.6e-6)*dimensionless())); /// deuteron-proton mass ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_d_over_m_p,(measurement<double>(1.99900750108,2.2e-10)*kilograms/kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_d_over_m_p,(measurement<double>(1.99900750108,2.2e-10)*dimensionless())); /// deuteron molar mass BOOST_UNITS_AUTO_STATIC_CONSTANT(M_d,(measurement<double>(2.013553212724e-3,7.8e-14)*kilograms/mole)); /// deuteron rms charge radius BOOST_UNITS_AUTO_STATIC_CONSTANT(R_d,(measurement<double>(2.1402e-15,2.8e-18)*meters)); /// deuteron magnetic moment BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_d,(measurement<double>(0.433073465e-26,1.1e-34)*joules/tesla)); +/// deuteron-Bohr magneton ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_d_over_mu_B,(measurement<double>(0.4669754556e-3,3.9e-12)*dimensionless())); +/// deuteron-nuclear magneton ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_d_over_mu_N,(measurement<double>(0.8574382308,7.2e-9)*dimensionless())); +/// deuteron g-factor +BOOST_UNITS_AUTO_STATIC_CONSTANT(g_d,(measurement<double>(0.8574382308,7.2e-9)*dimensionless())); /// deuteron-electron magnetic moment ratio BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_d_over_mu_e,(measurement<double>(-4.664345537e-4,3.9e-12)*dimensionless())); /// deuteron-proton magnetic moment ratio @@ -213,11 +227,58 @@ /// deuteron-neutron magnetic moment ratio BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_d_over_mu_n,(measurement<double>(-0.44820652,1.1e-7)*dimensionless())); +/// triton mass +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_t,(measurement<double>(5.00735588e-27,2.5e-34)*kilograms)); +/// triton-electron mass ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_t_over_m_e,(measurement<double>(5496.9215269,5.1e-6)*dimensionless())); +/// triton-proton mass ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_t_over_m_p,(measurement<double>(2.9937170309,2.5e-9)*dimensionless())); +/// triton molar mass +BOOST_UNITS_AUTO_STATIC_CONSTANT(M_t,(measurement<double>(3.0155007134e-3,2.5e-12)*kilograms/mole)); +/// triton magnetic moment +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_t,(measurement<double>(1.504609361e-26,4.2e-34)*joules/tesla)); +/// triton-Bohr magneton ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_t_over_mu_B,(measurement<double>(1.622393657e-3,2.1e-11)*dimensionless())); +/// triton-nuclear magneton ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_t_over_mu_N,(measurement<double>(2.978962448,3.8e-8)*dimensionless())); +/// triton g-factor +BOOST_UNITS_AUTO_STATIC_CONSTANT(g_t,(measurement<double>(5.957924896,7.6e-8)*dimensionless())); +/// triton-electron magnetic moment ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_t_over_mu_e,(measurement<double>(-1.620514423e-3,2.1e-11)*dimensionless())); +/// triton-proton magnetic moment ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_t_over_mu_p,(measurement<double>(1.066639908,1.0e-8)*dimensionless())); +/// triton-neutron magnetic moment ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_t_over_mu_n,(measurement<double>(-1.55718553,3.7e-7)*dimensionless())); + /// helion mass BOOST_UNITS_AUTO_STATIC_CONSTANT(m_h,(measurement<double>(5.00641192e-27,2.5e-34)*kilograms)); +/// helion-electron mass ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_h_over_m_e,(measurement<double>(5495.8852765,5.2e-6)*dimensionless())); +/// helion-proton mass ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_h_over_m_p,(measurement<double>(2.9931526713,2.6e-9)*dimensionless())); +/// helion molar mass +BOOST_UNITS_AUTO_STATIC_CONSTANT(M_h,(measurement<double>(3.0149322473e-3,2.6e-12)*kilograms/mole)); +/// helion shielded magnetic moment +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_h_prime,(measurement<double>(-1.074552982e-26,3.0e-34)*joules/tesla)); +/// shielded helion-Bohr magneton ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_h_prime_over_mu_B,(measurement<double>(-1.158671471e-3,1.4e-11)*dimensionless())); +/// shielded helion-nuclear magneton ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_h_prime_over_mu_N,(measurement<double>(-2.127497718,2.5e-8)*dimensionless())); +/// shielded helion-proton magnetic moment ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_h_prime_over_mu_p,(measurement<double>(-0.761766558,1.1e-8)*dimensionless())); +/// shielded helion-shielded proton magnetic moment ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_h_prime_over_mu_p_prime,(measurement<double>(-0.7617861313,3.3e-8)*dimensionless())); +/// shielded helion gyromagnetic ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_h_prime,(measurement<double>(2.037894730e8,5.6e-8)/second/tesla)); /// alpha particle mass BOOST_UNITS_AUTO_STATIC_CONSTANT(m_alpha,(measurement<double>(6.64465620e-27,3.3e-34)*kilograms)); +/// alpha-electron mass ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_alpha_over_m_e,(measurement<double>(7294.2995365,3.1e-6)*dimensionless())); +/// alpha-proton mass ratio +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_alpha_over_m_p,(measurement<double>(3.97259968951,4.1e-10)*dimensionless())); +/// alpha molar mass +BOOST_UNITS_AUTO_STATIC_CONSTANT(M_alpha,(measurement<double>(4.001506179127e-3,6.2e-14)*kilograms/mole)); } // namespace CODATA |
|
From: Matthias S. <mat...@us...> - 2007-04-03 22:43:13
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12996/systems Modified Files: si.hpp Log Message: SI/CODATA additions Index: si.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- si.hpp 3 Apr 2007 17:12:25 -0000 1.7 +++ si.hpp 3 Apr 2007 22:43:10 -0000 1.8 @@ -20,47 +20,52 @@ #include <boost/units/systems/si/base.hpp> -#include <boost/units/systems/si/dimensionless.hpp> -#include <boost/units/systems/si/length.hpp> -#include <boost/units/systems/si/mass.hpp> -#include <boost/units/systems/si/time.hpp> -#include <boost/units/systems/si/current.hpp> -#include <boost/units/systems/si/temperature.hpp> -#include <boost/units/systems/si/amount.hpp> -#include <boost/units/systems/si/luminous_intensity.hpp> - +#include <boost/units/systems/si/absorbed_dose.hpp> #include <boost/units/systems/si/acceleration.hpp> +#include <boost/units/systems/si/activity.hpp> +#include <boost/units/systems/si/amount.hpp> +#include <boost/units/systems/si/angular_velocity.hpp> #include <boost/units/systems/si/area.hpp> -#include <boost/units/systems/si/energy.hpp> -#include <boost/units/systems/si/force.hpp> -#include <boost/units/systems/si/frequency.hpp> -#include <boost/units/systems/si/mass_density.hpp> -#include <boost/units/systems/si/momentum.hpp> -#include <boost/units/systems/si/power.hpp> -#include <boost/units/systems/si/pressure.hpp> -#include <boost/units/systems/si/velocity.hpp> -#include <boost/units/systems/si/volume.hpp> - -#include <boost/units/systems/si/dynamic_viscosity.hpp> -#include <boost/units/systems/si/kinematic_viscosity.hpp> - #include <boost/units/systems/si/capacitance.hpp> +#include <boost/units/systems/si/catalytic_activity.hpp> #include <boost/units/systems/si/conductance.hpp> #include <boost/units/systems/si/conductivity.hpp> +#include <boost/units/systems/si/current.hpp> +#include <boost/units/systems/si/dimensionless.hpp> +#include <boost/units/systems/si/dose_equivalent.hpp> +#include <boost/units/systems/si/dynamic_viscosity.hpp> #include <boost/units/systems/si/electric_charge.hpp> #include <boost/units/systems/si/electric_potential.hpp> +#include <boost/units/systems/si/energy.hpp> +#include <boost/units/systems/si/force.hpp> +#include <boost/units/systems/si/frequency.hpp> +#include <boost/units/systems/si/illuminance.hpp> #include <boost/units/systems/si/impedance.hpp> #include <boost/units/systems/si/inductance.hpp> +#include <boost/units/systems/si/kinematic_viscosity.hpp> +#include <boost/units/systems/si/length.hpp> +#include <boost/units/systems/si/luminous_flux.hpp> +#include <boost/units/systems/si/luminous_intensity.hpp> #include <boost/units/systems/si/magnetic_field_intensity.hpp> #include <boost/units/systems/si/magnetic_flux.hpp> #include <boost/units/systems/si/magnetic_flux_density.hpp> +#include <boost/units/systems/si/mass.hpp> +#include <boost/units/systems/si/mass_density.hpp> +#include <boost/units/systems/si/momentum.hpp> #include <boost/units/systems/si/permeability.hpp> #include <boost/units/systems/si/permittivity.hpp> +#include <boost/units/systems/si/plane_angle.hpp> +#include <boost/units/systems/si/power.hpp> +#include <boost/units/systems/si/pressure.hpp> #include <boost/units/systems/si/reluctance.hpp> #include <boost/units/systems/si/resistance.hpp> #include <boost/units/systems/si/resistivity.hpp> - -#include <boost/units/systems/si/catalytic_activity.hpp> +#include <boost/units/systems/si/solid_angle.hpp> +#include <boost/units/systems/si/surface_density.hpp> +#include <boost/units/systems/si/temperature.hpp> +#include <boost/units/systems/si/time.hpp> +#include <boost/units/systems/si/velocity.hpp> +#include <boost/units/systems/si/volume.hpp> #include <boost/units/systems/si/wavenumber.hpp> #endif // BOOST_UNITS_SI_HPP |
|
From: Matthias S. <mat...@us...> - 2007-04-03 22:43:13
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12996/systems/si Modified Files: base.hpp Log Message: SI/CODATA additions Index: base.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/base.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- base.hpp 3 Apr 2007 17:11:40 -0000 1.5 +++ base.hpp 3 Apr 2007 22:43:10 -0000 1.6 @@ -104,6 +104,20 @@ static std::string symbol() { return "cd"; } }; +template<> +struct base_unit_info<plane_angle_tag,SI::system_tag> +{ + static std::string name() { return "radian"; } + static std::string symbol() { return "rad"; } +}; + +template<> +struct base_unit_info<solid_angle_tag,SI::system_tag> +{ + static std::string name() { return "steradian"; } + static std::string symbol() { return "sr"; } +}; + } // namespace units } // namespace boost |
|
From: Matthias S. <mat...@us...> - 2007-04-03 21:39:49
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20241/systems Modified Files: abstract.hpp Log Message: SI compliant symbols for fundamental units in abstract unit system Index: abstract.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/abstract.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- abstract.hpp 3 Apr 2007 17:12:25 -0000 1.4 +++ abstract.hpp 3 Apr 2007 21:39:48 -0000 1.5 @@ -84,29 +84,29 @@ template<> struct base_unit_info<current_tag,abstract::system_tag> { - static std::string name() { return "[Current]"; } - static std::string symbol() { return "[C]"; } + static std::string name() { return "[Electric Current]"; } + static std::string symbol() { return "[I]"; } }; template<> struct base_unit_info<temperature_tag,abstract::system_tag> { static std::string name() { return "[Temperature]"; } - static std::string symbol() { return "[K]"; } + static std::string symbol() { return "[Theta]"; } }; template<> struct base_unit_info<amount_tag,abstract::system_tag> { static std::string name() { return "[Amount]"; } - static std::string symbol() { return "[A]"; } + static std::string symbol() { return "[N]"; } }; template<> struct base_unit_info<luminous_intensity_tag,abstract::system_tag> { static std::string name() { return "[Luminous Intensity]"; } - static std::string symbol() { return "[I]"; } + static std::string symbol() { return "[J]"; } }; template<> |
|
From: Matthias S. <mat...@us...> - 2007-04-03 21:38:33
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19473/systems Modified Files: physical_units.hpp Log Message: fix erroneous scale factor for kelvins 273.16->273.15 Index: physical_units.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/physical_units.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- physical_units.hpp 3 Apr 2007 20:27:51 -0000 1.7 +++ physical_units.hpp 3 Apr 2007 21:38:26 -0000 1.8 @@ -17,7 +17,7 @@ /// \file /// \brief Various definitions to simplify systems of physical units. /// -/// \detailed This file includes the six SI-defined fundamental dimensions as +/// \detailed This file includes the seven SI-defined fundamental dimensions as /// well as composite dimensions for a number of commonly encountered /// physical unit types. Angles and solid angles are technically dimensionless. /// However, incorrect use of degrees and radians is a common source of errors, |
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19473/systems/conversions Modified Files: convert_celsius_to_kelvin.hpp convert_fahrenheit_to_kelvin.hpp convert_kelvin_to_celsius.hpp convert_kelvin_to_fahrenheit.hpp Log Message: fix erroneous scale factor for kelvins 273.16->273.15 Index: convert_fahrenheit_to_kelvin.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_fahrenheit_to_kelvin.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_fahrenheit_to_kelvin.hpp 2 Apr 2007 21:24:44 -0000 1.1 +++ convert_fahrenheit_to_kelvin.hpp 3 Apr 2007 21:38:26 -0000 1.2 @@ -51,7 +51,7 @@ { const typename from_quantity_type::value_type& in(source.value()); - return to_quantity_type::from_value((in.value()-32.0)*(5.0/9.0) + 273.16); + return to_quantity_type::from_value((in.value()-32.0)*(5.0/9.0) + 273.15); } }; Index: convert_celsius_to_kelvin.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_celsius_to_kelvin.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_celsius_to_kelvin.hpp 2 Apr 2007 21:24:44 -0000 1.1 +++ convert_celsius_to_kelvin.hpp 3 Apr 2007 21:38:26 -0000 1.2 @@ -49,7 +49,7 @@ { const typename from_quantity_type::value_type& in(source.value()); - return to_quantity_type::from_value(in.value() + 273.16); + return to_quantity_type::from_value(in.value() + 273.15); } }; Index: convert_kelvin_to_fahrenheit.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_kelvin_to_fahrenheit.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_kelvin_to_fahrenheit.hpp 2 Apr 2007 21:24:44 -0000 1.1 +++ convert_kelvin_to_fahrenheit.hpp 3 Apr 2007 21:38:26 -0000 1.2 @@ -40,7 +40,7 @@ { const typename from_quantity_type::value_type& in(source.value()); - return to_quantity_type::from_value((in.value()-273.16)*(9.0/5.0) + 32.0); + return to_quantity_type::from_value((in.value()-273.15)*(9.0/5.0) + 32.0); } }; Index: convert_kelvin_to_celsius.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_kelvin_to_celsius.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_kelvin_to_celsius.hpp 2 Apr 2007 21:24:44 -0000 1.1 +++ convert_kelvin_to_celsius.hpp 3 Apr 2007 21:38:26 -0000 1.2 @@ -40,7 +40,7 @@ { const typename from_quantity_type::value_type& in(source.value()); - return to_quantity_type::from_value(in.value() - 273.16); + return to_quantity_type::from_value(in.value() - 273.15); } }; |
|
From: Matthias S. <mat...@us...> - 2007-04-03 20:54:16
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1975 Modified Files: operators.hpp static_constant.hpp Log Message: minor fixes Index: static_constant.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/static_constant.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- static_constant.hpp 30 Mar 2007 18:56:46 -0000 1.2 +++ static_constant.hpp 3 Apr 2007 20:54:15 -0000 1.3 @@ -30,6 +30,8 @@ /// A convenience macro for static constants with auto /// type deduction. +#if BOOST_UNITS_HAS_TYPEOF + #if BOOST_UNITS_HAS_BOOST_TYPEOF #define BOOST_UNITS_AUTO_STATIC_CONSTANT(name, value) \ @@ -46,6 +48,8 @@ #define BOOST_UNITS_AUTO_STATIC_CONSTANT(name, value) \ BOOST_UNITS_STATIC_CONSTANT(name, typeof(value))(value) \ -#endif +#endif // BOOST_UNITS_HAS_BOOST_TYPEOF + +#endif // BOOST_UNITS_HAS_TYPEOF #endif // BOOST_UNITS_STATIC_CONSTANT_HPP Index: operators.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/operators.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- operators.hpp 3 Apr 2007 19:25:08 -0000 1.2 +++ operators.hpp 3 Apr 2007 20:54:15 -0000 1.3 @@ -91,7 +91,7 @@ } // namespace typeof_ -#if (BOOST_UNITS_HAS_TYPEOF && BOOST_UNITS_HAS_BOOST_TYPEOF) +#if (BOOST_UNITS_HAS_BOOST_TYPEOF) template<typename X> struct unary_plus_typeof_helper { @@ -129,7 +129,7 @@ typedef typename nested::type type; }; -#elif (BOOST_UNITS_HAS_TYPEOF && BOOST_UNITS_HAS_MWERKS_TYPEOF) +#elif (BOOST_UNITS_HAS_MWERKS_TYPEOF) template<typename X> struct unary_plus_typeof_helper { typedef __typeof__((+typeof_::make<X>())) type; }; template<typename X> struct unary_minus_typeof_helper { typedef __typeof__((-typeof_::make<X>())) type; }; @@ -139,7 +139,7 @@ template<typename X,typename Y> struct multiply_typeof_helper { typedef __typeof__((typeof_::make<X>()*typeof_::make<Y>())) type; }; template<typename X,typename Y> struct divide_typeof_helper { typedef __typeof__((typeof_::make<X>()/typeof_::make<Y>())) type; }; -#elif (BOOST_UNITS_HAS_TYPEOF && BOOST_UNITS_HAS_GNU_TYPEOF) +#elif (BOOST_UNITS_HAS_GNU_TYPEOF) template<typename X> struct unary_plus_typeof_helper { typedef typeof((+typeof_::make<X>())) type; }; template<typename X> struct unary_minus_typeof_helper { typedef typeof((-typeof_::make<X>())) type; }; |
|
From: Matthias S. <mat...@us...> - 2007-04-03 20:54:16
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1975/systems/si/codata Modified Files: universal_constants.hpp Log Message: minor fixes Index: universal_constants.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata/universal_constants.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- universal_constants.hpp 30 Mar 2007 23:49:14 -0000 1.2 +++ universal_constants.hpp 3 Apr 2007 20:54:15 -0000 1.3 @@ -19,7 +19,7 @@ /// \file /// CODATA recommended values of fundamental universal constants -/// CODATA 2006 values as of 2007/03/30 +/// using CODATA 2006 values as of 2007/03/30 namespace boost { |
|
From: Matthias S. <mat...@us...> - 2007-04-03 20:48:16
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31968/example Modified Files: unit_example_22.cpp unit_example_5.cpp Log Message: removed deprecated quantity_cast usages Index: unit_example_22.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_22.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- unit_example_22.cpp 3 Apr 2007 14:50:19 -0000 1.5 +++ unit_example_22.cpp 3 Apr 2007 20:48:07 -0000 1.6 @@ -121,7 +121,7 @@ return 0; } */ -/* + #include <iostream> #include <boost/units/io.hpp> #include <boost/units/systems/si.hpp> @@ -150,7 +150,7 @@ << F5 << std::endl << std::endl; - quantity_reinterpret_cast<double&>(F1) = 1.5; + quantity_cast<double&>(F1) = 1.5; std::cout << F1 << std::endl; @@ -179,7 +179,7 @@ return 0; } -*/ + /* //// main.cpp //// @@ -227,7 +227,7 @@ return(0); } */ - +/* #include <iostream> #include <boost/units/io.hpp> #include <boost/units/systems/si.hpp> @@ -252,7 +252,7 @@ return 0; } - +*/ /* #include <iostream> @@ -314,8 +314,8 @@ << std::endl; // kelvin->fahrenheit - quantity<celsius::temperature> FTR2(KTR); - quantity<celsius::temperature,absolute<> > FTA2(KTA); + quantity<fahrenheit::temperature> FTR2(KTR); + quantity<fahrenheit::temperature,absolute<> > FTA2(KTA); std::cout << KTR << " = " << FTR2 << std::endl << KTA << " = " << FTA2 << std::endl Index: unit_example_5.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_5.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- unit_example_5.cpp 29 Mar 2007 19:46:30 -0000 1.2 +++ unit_example_5.cpp 3 Apr 2007 20:48:07 -0000 1.3 @@ -22,8 +22,8 @@ //[unit_example_5_output_1 L1 = 2 m L2 = 2 m -L3 = 2 m -L4 = 2 m +L3 = 5 m +L4 = 4 m L5 = 200 cm //] @@ -78,22 +78,31 @@ { // implicit value_type conversions //[unit_example_5_snippet_1 - quantity<SI::length> L1 = quantity<SI::length,int>(int(2.5)*SI::meter); - quantity<SI::length,int> L2 = quantity<SI::length,double>(2.5*SI::meter); + quantity<SI::length> L1 = quantity<SI::length,int>(int(2.5)*SI::meters); + quantity<SI::length,int> L2 = quantity<SI::length,double>(2.5*SI::meters); //] //[unit_example_5_snippet_2 - quantity<SI::length,int> L3 = quantity_cast< quantity<SI::length,int> >(2.5); + //deprecated + //quantity<SI::length,int> L3 = quantity_cast< quantity<SI::length,int> >(2.5); //] //[unit_example_5_snippet_3 - quantity<SI::length,int> L4 = quantity_cast<quantity<SI::length,int> >(L1); + //deprecated + //quantity<SI::length,int> L4 = quantity_cast<quantity<SI::length,int> >(L1); //] //[unit_example_5_snippet_4 - quantity<CGS::length> L5 = quantity_cast<quantity<CGS::length> >(L1); + //deprecated + //quantity<CGS::length> L5 = quantity_cast<quantity<CGS::length> >(L1); //] + quantity<SI::length,int> L3(4*SI::meters), + L4(5*SI::meters); + quantity<CGS::length> L5(L1); + + swap(L3,L4); + sstream1 << "L1 = " << L1 << std::endl << "L2 = " << L2 << std::endl << "L3 = " << L3 << std::endl @@ -166,8 +175,8 @@ sstream2 << "L1 = 2 m" << std::endl; sstream2 << "L2 = 2 m" << std::endl; - sstream2 << "L3 = 2 m" << std::endl; - sstream2 << "L4 = 2 m" << std::endl; + sstream2 << "L3 = 5 m" << std::endl; + sstream2 << "L4 = 4 m" << std::endl; sstream2 << "L5 = 200 cm" << std::endl; sstream2 << std::endl; sstream2 << "volume (m^3) = 1 m^3" << std::endl; |
|
From: Matthias S. <mat...@us...> - 2007-04-03 20:48:16
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31968/test Modified Files: test_conversion.cpp test_dimensionless_quantity.cpp Log Message: removed deprecated quantity_cast usages Index: test_dimensionless_quantity.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/test/test_dimensionless_quantity.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- test_dimensionless_quantity.cpp 30 Mar 2007 16:53:03 -0000 1.2 +++ test_dimensionless_quantity.cpp 3 Apr 2007 20:48:07 -0000 1.3 @@ -109,9 +109,7 @@ const double V2 = E9; BOOST_CHECK(V2 == E9.value()); - - // quantity_cast - + // unit * scalar BOOST_CHECK(bu::dimensionless()*2.0 == bu::quantity<bu::dimensionless>::from_value(2.0)); Index: test_conversion.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/test/test_conversion.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- test_conversion.cpp 29 Mar 2007 20:05:58 -0000 1.2 +++ test_conversion.cpp 3 Apr 2007 20:48:07 -0000 1.3 @@ -76,10 +76,13 @@ bu::quantity<bu::CGS::force> F0 = 20 * bu::CGS::dyne; BOOST_CHECK((std::abs(F0.value() - 20.0) < .0001)); - bu::quantity<bu::SI::force> F1 = bu::quantity_cast<bu::quantity<bu::SI::force> >(F0); - BOOST_CHECK((std::abs(F1.value() - 2.0e-4) < .000000001)); - bu::quantity<bu::SI::force> F2 = bu::quantity_cast<bu::quantity<bu::SI::force> >(20 * bu::CGS::dyne); - BOOST_CHECK((std::abs(F2.value() - 2.0e-4) < .000000001)); + //deprecated + //bu::quantity<bu::SI::force> F1 = bu::quantity_cast<bu::quantity<bu::SI::force> >(F0); + //BOOST_CHECK((std::abs(F1.value() - 2.0e-4) < .000000001)); + + //deprecated + //bu::quantity<bu::SI::force> F2 = bu::quantity_cast<bu::quantity<bu::SI::force> >(20 * bu::CGS::dyne); + //BOOST_CHECK((std::abs(F2.value() - 2.0e-4) < .000000001)); bu::quantity<bu::SI::force> F3(F0); BOOST_CHECK((std::abs(F3.value() - 2.0e-4) < .000000001)); @@ -87,6 +90,7 @@ bu::quantity<bu::SI::force> F5(20 * bu::CGS::dyne); BOOST_CHECK((std::abs(F5.value() - 2.0e-4) < .000000001)); + //quantity<SI::force> F6 = 20 * CGS::dyne; return(0); |