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
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16467/systems/si/codata Modified Files: atomic_and_nuclear_constants.hpp electromagnetic_constants.hpp physico-chemical_constants.hpp universal_constants.hpp Log Message: CODATA constants now include measurement uncertainties and are updated to latest values as of 2007/03/30 Index: universal_constants.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata/universal_constants.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- universal_constants.hpp 16 Mar 2007 18:12:46 -0000 1.1.1.1 +++ universal_constants.hpp 30 Mar 2007 23:49:14 -0000 1.2 @@ -11,14 +11,15 @@ #ifndef BOOST_UNITS_CODATA_UNIVERSAL_CONSTANTS_HPP #define BOOST_UNITS_CODATA_UNIVERSAL_CONSTANTS_HPP -#include <boost/units/systems/si.hpp> - #if BOOST_UNITS_HAS_TYPEOF +#include <boost/units/measurement.hpp> #include <boost/units/static_constant.hpp> +#include <boost/units/systems/si.hpp> /// \file -/// CODATA recommended values of fundamental universal constants: NIST SP 961 +/// CODATA recommended values of fundamental universal constants +/// CODATA 2006 values as of 2007/03/30 namespace boost { @@ -34,27 +35,27 @@ // UNIVERSAL /// speed of light -BOOST_UNITS_AUTO_STATIC_CONSTANT(c,(299792458.0*meters/second)); -/// magnetic constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_0,(12.566370614e-7*newtons/ampere/ampere)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(c,(measurement<double>(299792458.0,0.0)*meters/second)); +/// magnetic constant (exactly 4 pi x 10^(-7) - error is due to finite precision of pi) +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_0,(measurement<double>(12.56637061435917295385057353311801153679e-7,0.0)*newtons/ampere/ampere)); /// electric constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(epsilon_0,(8.854187817e-12*farad/meter)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(epsilon_0,(measurement<double>(8.854187817620389850536563031710750260608e-12,0.0)*farad/meter)); /// characteristic impedance of vacuum -BOOST_UNITS_AUTO_STATIC_CONSTANT(Z_0,(376.730313461*ohm)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(Z_0,(measurement<double>(376.7303134617706554681984004203193082686,0.0)*ohm)); /// Newtonian constant of gravitation -BOOST_UNITS_AUTO_STATIC_CONSTANT(G,(6.6742e-11*cubic_meters/kilogram/second/second)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(G,(measurement<double>(6.67428e-11,6.7e-15)*cubic_meters/kilogram/second/second)); /// Planck constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(h,(6.6260693e-34*joule*seconds)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(h,(measurement<double>(6.62606896e-34,3.3e-41)*joule*seconds)); /// Dirac constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(hbar,(1.05457168e-34*joule*seconds)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(hbar,(measurement<double>(1.054571628e-34,5.3e-42)*joule*seconds)); /// Planck mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_P,(2.17645e-8*kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_P,(measurement<double>(2.17644e-8,1.1e-12)*kilograms)); /// Planck temperature -BOOST_UNITS_AUTO_STATIC_CONSTANT(T_P,(1.41679e32*kelvin)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(T_P,(measurement<double>(1.416785e32,7.1e27)*kelvin)); /// Planck length -BOOST_UNITS_AUTO_STATIC_CONSTANT(l_P,(1.61624e-35*meters)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(l_P,(measurement<double>(1.616252e-35,8.1e-40)*meters)); /// Planck time -BOOST_UNITS_AUTO_STATIC_CONSTANT(t_P,(5.39121e-44*seconds)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(t_P,(measurement<double>(5.39124e-44,2.7e-48)*seconds)); } // namespace CODATA 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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- physico-chemical_constants.hpp 30 Mar 2007 18:56:47 -0000 1.2 +++ physico-chemical_constants.hpp 30 Mar 2007 23:49:14 -0000 1.3 @@ -11,15 +11,15 @@ #ifndef BOOST_UNITS_CODATA_PHYSICO_CHEMICAL_CONSTANTS_HPP #define BOOST_UNITS_CODATA_PHYSICO_CHEMICAL_CONSTANTS_HPP -#include <boost/units/systems/si.hpp> - #if BOOST_UNITS_HAS_TYPEOF #include <boost/units/measurement.hpp> #include <boost/units/static_constant.hpp> +#include <boost/units/systems/si.hpp> /// \file -/// CODATA recommended values of fundamental physico-chemical constants: NIST SP 961 +/// CODATA recommended values of fundamental physico-chemical constants +/// CODATA 2006 values as of 2007/03/30 namespace boost { @@ -33,25 +33,25 @@ // PHYSICO-CHEMICAL /// Avogadro constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(N_A,(6.0221415e23/mole)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(N_A,(measurement<double>(6.02214179e23,3.0e16)/mole)); /// atomic mass constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_u,(1.66053886e-27*kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_u,(measurement<double>(1.660538782e-27,8.3e-35)*kilograms)); /// Faraday constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(F,(96485.3383*coulombs/mole)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(F,(measurement<double>(96485.3399,2.4e-3)*coulombs/mole)); /// molar gas constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(R,(measurement<double>(8.314472)*joules/kelvin/mole)); +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,(1.3806505e-23*joules/kelvin)); +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,(22.413996e-3*cubic_meters/mole)); +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,(5.670400e-8*watts/square_meter/pow<4>(kelvin))); +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,(3.74177138e-16*watt*square_meters)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(c_1,(measurement<double>(3.74177118e-16,1.9e-23)*watt*square_meters)); /// second radiation constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(c_2,(1.4387752e-2*meter*kelvin)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(c_2,(measurement<double>(1.4387752e-2,2.5e-8)*meter*kelvin)); /// Wien displacement law constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(b,(2.8977685e-3*meter*kelvin)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(b,(measurement<double>(2.8977685e-3,5.1e-9)*meter*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.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- atomic_and_nuclear_constants.hpp 16 Mar 2007 18:12:46 -0000 1.1.1.1 +++ atomic_and_nuclear_constants.hpp 30 Mar 2007 23:49:14 -0000 1.2 @@ -11,14 +11,15 @@ #ifndef BOOST_UNITS_CODATA_ATOMIC_AND_NUCLEAR_CONSTANTS_HPP #define BOOST_UNITS_CODATA_ATOMIC_AND_NUCLEAR_CONSTANTS_HPP -#include <boost/units/systems/si.hpp> - #if BOOST_UNITS_HAS_TYPEOF +#include <boost/units/measurement.hpp> #include <boost/units/static_constant.hpp> +#include <boost/units/systems/si.hpp> /// \file -/// CODATA recommended values of fundamental atomic and nuclear constants: NIST SP 961 +/// CODATA recommended values of fundamental atomic and nuclear constants +/// CODATA 2006 values as of 2007/03/30 namespace boost { @@ -31,179 +32,178 @@ namespace CODATA { /// CODATA recommended values of the fundamental physical constants: NIST SP 961 -typedef dimensionless_quantity<SI::system,double>::type dimensionless_constant; // ATOMIC AND NUCLEAR /// fine structure constant -BOOST_UNITS_STATIC_CONSTANT(alpha,dimensionless_constant) = 7.297352568e-3; +BOOST_UNITS_AUTO_STATIC_CONSTANT(alpha,(measurement<double>(7.2973525376e-3,5.0e-12)*dimensionless())); /// Rydberg constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(R_infinity,(10973731.568525/meter)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(R_infinity,(measurement<double>(10973731.568527,7.3e-5)/meter)); /// Bohr radius -BOOST_UNITS_AUTO_STATIC_CONSTANT(a_0,(0.5291772108e-10*meters)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(a_0,(measurement<double>(0.52917720859e-10,3.6e-20)*meters)); /// Hartree energy -BOOST_UNITS_AUTO_STATIC_CONSTANT(E_h,(4.35974417e-18*joules)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(E_h,(measurement<double>(4.35974394e-18,2.2e-25)*joules)); /// electron mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_e,(9.1093826e-31*kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_e,(measurement<double>(9.10938215e-31,4.5e-38)*kilograms)); /// electron-muon mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_e_over_m_mu,dimensionless_constant) = 4.83633167e-3; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_e_over_m_mu,(measurement<double>(4.83633171e-3,1.2e-10)*dimensionless())); /// electron-tau mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_e_over_m_tau,dimensionless_constant) = 2.87564e-4; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_e_over_m_tau,(measurement<double>(2.87564e-4,4.7e-8)*dimensionless())); /// electron-proton mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_e_over_m_p,dimensionless_constant) = 5.4461702173e-4; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_e_over_m_p,(measurement<double>(5.4461702177e-4,2.4e-13)*dimensionless())); /// electron-neutron mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_e_over_m_n,dimensionless_constant) = 5.4386734481e-4; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_e_over_m_n,(measurement<double>(5.4386734459e-4,3.3e-13)*dimensionless())); /// electron-deuteron mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_e_over_m_d,dimensionless_constant) = 2.7244371095e-4; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_e_over_m_d,(measurement<double>(2.7244371093e-4,1.2e-13)*dimensionless())); /// electron-alpha particle mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_e_over_m_alpha,dimensionless_constant) = 1.37093355575e-4; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_e_over_m_alpha,(measurement<double>(1.37093355570e-4,5.8e-14)*dimensionless())); /// electron charge to mass ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(e_over_m_e,(1.75882012e11*coulombs/kilogram)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(e_over_m_e,(measurement<double>(1.758820150e11,4.4e3)*coulombs/kilogram)); /// electron molar mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(M_e,(5.4857990945e-7*kilograms/mole)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(M_e,(measurement<double>(5.4857990943e-7,2.3e-16)*kilograms/mole)); /// Compton wavelength -BOOST_UNITS_AUTO_STATIC_CONSTANT(lambda_C,(2.426310238e-12*meters)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(lambda_C,(measurement<double>(2.4263102175e-12,3.3e-21)*meters)); /// classical electron radius -BOOST_UNITS_AUTO_STATIC_CONSTANT(r_e,(2.817940325e-15*meters)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(r_e,(measurement<double>(2.8179402894e-15,5.8e-24)*meters)); /// Thompson cross section -BOOST_UNITS_AUTO_STATIC_CONSTANT(sigma_e,(0.665245873e-28*square_meters)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(sigma_e,(measurement<double>(0.6652458558e-28,2.7e-37)*square_meters)); /// electron magnetic moment -BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_e,(-928.476412e-26*joules/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_e,(measurement<double>(-928.476377e-26,2.3e-31)*joules/tesla)); /// electron magnetic moment anomaly -BOOST_UNITS_STATIC_CONSTANT(a_e,dimensionless_constant) = 1.1596521859e-3; +BOOST_UNITS_AUTO_STATIC_CONSTANT(a_e,(measurement<double>(1.15965218111e-3,7.4e-13)*dimensionless())); /// electron g-factor -BOOST_UNITS_STATIC_CONSTANT(g_e,dimensionless_constant) = -2.0023193043718; +BOOST_UNITS_AUTO_STATIC_CONSTANT(g_e,(measurement<double>(-2.0023193043622,1.5e-12)*dimensionless())); /// electron-muon magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_e_over_mu_mu,dimensionless_constant) = 206.7669894; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_e_over_mu_mu,(measurement<double>(206.7669877,5.2e-6)*dimensionless())); /// electron-proton magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_e_over_mu_p,dimensionless_constant) = -658.2106862; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_e_over_mu_p,(measurement<double>(-658.2106848,5.4e-6)*dimensionless())); /// electron-shielded proton magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_e_over_mu_p_prime,dimensionless_constant) = -658.2275956; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_e_over_mu_p_prime,(measurement<double>(-658.2275971,7.2e-6)*dimensionless())); /// electron-neutron magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_e_over_mu_n,dimensionless_constant) = 960.92050; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_e_over_mu_n,(measurement<double>(960.92050,2.3e-4)*dimensionless())); /// electron-deuteron magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_e_over_mu_d,dimensionless_constant) = -2143.923493; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_e_over_mu_d,(measurement<double>(-2143.923498,1.8e-5)*dimensionless())); /// electron-shielded helion magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_e_over_mu_h_prime,dimensionless_constant) = 864.058255; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_e_over_mu_h_prime,(measurement<double>(864.058257,1.0e-5)*dimensionless())); /// electron gyromagnetic ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_e,(1.76085974/second/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_e,(measurement<double>(1.760859770e11,4.4e3)/second/tesla)); /// muon mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_mu,(1.88353140e-28*kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_mu,(measurement<double>(1.88353130e-28,1.1e-35)*kilograms)); /// muon-electron mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_mu_over_m_e,dimensionless_constant) = 206.7682838; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_mu_over_m_e,(measurement<double>(206.7682823,5.2e-6)*dimensionless())); /// muon-tau mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_mu_over_m_tau,dimensionless_constant) = 5.94592e-2; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_mu_over_m_tau,(measurement<double>(5.94592e-2,9.7e-6)*dimensionless())); /// muon-proton mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_mu_over_m_p,dimensionless_constant) = 0.1126095269; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_mu_over_m_p,(measurement<double>(0.1126095261,2.9e-9)*dimensionless())); /// muon-neutron mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_mu_over_m_n,dimensionless_constant) = 0.1124545175; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_mu_over_m_n,(measurement<double>(0.1124545167,2.9e-9)*dimensionless())); /// muon molar mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(M_mu,(0.1134289264e-3*kilograms/mole)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(M_mu,(measurement<double>(0.1134289256e-3,2.9e-12)*kilograms/mole)); /// muon Compton wavelength -BOOST_UNITS_AUTO_STATIC_CONSTANT(lambda_C_mu,(11.73444105e-15*meters)); +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_m,(-4.49044799e-26*joules/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_m,(measurement<double>(-4.49044786e-26,1.6e-33)*joules/tesla)); /// muon magnetic moment anomaly -BOOST_UNITS_STATIC_CONSTANT(a_mu,dimensionless_constant) = 1.16591981e-3; +BOOST_UNITS_AUTO_STATIC_CONSTANT(a_mu,(measurement<double>(1.16592069e-3,6.0e-10)*dimensionless())); /// muon g-factor -BOOST_UNITS_STATIC_CONSTANT(g_mu,dimensionless_constant) = -2.0023318396; +BOOST_UNITS_AUTO_STATIC_CONSTANT(g_mu,(measurement<double>(-2.0023318414,1.2e-9)*dimensionless())); /// muon-proton magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_mu_over_mu_p,dimensionless_constant) = -3.183345118; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_mu_over_mu_p,(measurement<double>(-3.183345118)*dimensionless())); /// tau mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_tau,(3.16777e-27*kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_tau,(measurement<double>(3.16777e-27,5.2e-31)*kilograms)); /// tau-electron mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_tau_over_m_e,dimensionless_constant) = 3477.48; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_tau_over_m_e,(measurement<double>(3477.48,5.7e-1)*dimensionless())); /// tau-muon mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_tau_over_m_mu,dimensionless_constant) = 16.8183; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_tau_over_m_mu,(measurement<double>(16.8183,2.7e-3)*dimensionless())); /// tau-proton mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_tau_over_m_p,dimensionless_constant) = 1.89390; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_tau_over_m_p,(measurement<double>(1.89390,3.1e-4)*dimensionless())); /// tau-neutron mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_tau_over_m_n,dimensionless_constant) = 1.89129; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_tau_over_m_n,(measurement<double>(1.89129,3.1e-4)*dimensionless())); /// tau molar mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(M_tau,(1.907698e-3*kilograms/mole)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(M_tau,(measurement<double>(1.90768e-3,3.1e-7)*kilograms/mole)); /// tau Compton wavelength -BOOST_UNITS_AUTO_STATIC_CONSTANT(lambda_C_tau,(0.69772e-15*meters)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(lambda_C_tau,(measurement<double>(0.69772e-15,1.1e-19)*meters)); /// proton mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_p,(1.67262171e-27*kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_p,(measurement<double>(1.672621637e-27,8.3e-35)*kilograms)); /// proton-electron mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_p_over_m_e,dimensionless_constant) = 1836.15267261; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_p_over_m_e,(measurement<double>(1836.15267247,8.0e-7)*dimensionless())); /// proton-muon mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_p_over_m_mu,dimensionless_constant) = 8.88024333; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_p_over_m_mu,(measurement<double>(8.88024339,2.3e-7)*dimensionless())); /// proton-tau mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_p_over_m_tau,dimensionless_constant) = 0.528012; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_p_over_m_tau,(measurement<double>(0.528012,8.6e-5)*dimensionless())); /// proton-neutron mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_p_over_m_n,dimensionless_constant) = 0.99862347872; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_p_over_m_n,(measurement<double>(0.99862347824,4.6e-10)*dimensionless())); /// proton charge to mass ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(e_over_m_p,(9.57883376e7*coulombs/kilogram)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(e_over_m_p,(measurement<double>(9.57883392e7,2.4e0)*coulombs/kilogram)); /// proton molar mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(M_p,(1.00727646688e-3*kilograms/mole)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(M_p,(measurement<double>(1.00727646677e-3,1.0e-13)*kilograms/mole)); /// proton rms charge radius -BOOST_UNITS_AUTO_STATIC_CONSTANT(R_p,(0.8750e-15*meters)) = 0.8750e-15*meters; +BOOST_UNITS_AUTO_STATIC_CONSTANT(R_p,(measurement<double>(0.8768e-15,6.9e-18)*meters)); /// proton magnetic moment -BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_p,(1.41060671e-26*joules/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_p,(measurement<double>(1.410606662e-26,3.7e-34)*joules/tesla)); /// proton g-factor -BOOST_UNITS_STATIC_CONSTANT(g_p,dimensionless_constant) = 5.585694701; +BOOST_UNITS_AUTO_STATIC_CONSTANT(g_p,(measurement<double>(5.585694713,4.6e-8)*dimensionless())); /// proton-neutron magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_p_over_mu_n,dimensionless_constant) = -1.45989805; +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,(1.41057047e-26*joules/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_p_prime,(measurement<double>(1.41057041e-26,3.8e-34)*joules/tesla)); /// proton gyromagnetic ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_p,(2.67522205e8/second/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_p,(measurement<double>(2.675222099e8,7.0e0)/second/tesla)); /// shielded proton gyromagnetic ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_p_prime,(2.67515333e8/second/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_p_prime,(measurement<double>(2.675153362e8,7.3e0)/second/tesla)); /// neutron mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_n,(1.67492728e-27*kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_n,(measurement<double>(1.674927211e-27,8.4e-35)*kilograms)); /// neutron-electron mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_n_over_m_e,dimensionless_constant) = 1838.6836598; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_n_over_m_e,(measurement<double>(1838.6836605,1.1e-6)*dimensionless())); /// neutron-muon mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_n_over_m_mu,dimensionless_constant) = 8.89248402; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_n_over_m_mu,(measurement<double>(8.89248409,2.3e-7)*dimensionless())); /// neutron-tau mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_n_over_m_tau,dimensionless_constant) = 0.528740; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_n_over_m_tau,(measurement<double>(0.528740,8.6e-5)*dimensionless())); /// neutron-proton mass ratio -BOOST_UNITS_STATIC_CONSTANT(m_n_over_m_p,dimensionless_constant) = 1.00137841870; +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,(1.3195909067e-15*meters)); +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,(1.00866491560e-3*kilograms/mole)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(M_n,(measurement<double>(1.00866491597e-3,4.3e-13)*kilograms/mole)); /// neutron magnetic moment -BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_n,(-0.96623645e-26*joules/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_n,(measurement<double>(-0.96623641e-26,2.3e-33)*joules/tesla)); /// neutron g-factor -BOOST_UNITS_STATIC_CONSTANT(g_n,dimensionless_constant) = -3.82608546; +BOOST_UNITS_AUTO_STATIC_CONSTANT(g_n,(measurement<double>(-3.82608545,9.0e-7)*dimensionless())); /// neutron-proton magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_n_over_mu_p,dimensionless_constant) = -0.68497934; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_n_over_mu_p,(measurement<double>(-0.68497934,1.6e-7)*dimensionless())); /// neutron-shielded proton magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_n_over_mu_p_prime,dimensionless_constant) = -0.68499694; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_n_over_mu_p_prime,(measurement<double>(-0.68499694,1.6e-7)*dimensionless())); /// neutron gyromagnetic ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_n,(1.83247183e8/second/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(gamma_n,(measurement<double>(1.83247185e8,4.3e1)/second/tesla)); /// deuteron mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_d,(3.34358335e-27*kilograms)); +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,(1.0*kilograms/kilograms)) = 3670.4829652; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_d_over_m_e,(measurement<double>(3670.4829654,1.6e-6)*kilograms/kilograms)); /// deuteron-proton mass ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_d_over_m_p,(1.0*kilograms/kilograms)) = 1.99900750082; +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_d_over_m_p,(measurement<double>(1.99900750108,2.2e-10)*kilograms/kilograms)); /// deuteron molar mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(M_d,(2.01355321270e-3*kilograms/mole)); +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,(2.1394e-15*meters)) = 2.1394e-15*meters; +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,(0.43307073482e-26*joules/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_d,(measurement<double>(0.433073465e-26,1.1e-34)*joules/tesla)); /// deuteron-electron magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_d_over_mu_e,dimensionless_constant) = -4.664345584e-4; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_d_over_mu_e,(measurement<double>(-4.664345537e-4,3.9e-12)*dimensionless())); /// deuteron-proton magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_d_over_mu_p,dimensionless_constant) = 0.3070122084; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_d_over_mu_p,(measurement<double>(0.3070122070,2.4e-9)*dimensionless())); /// deuteron-neutron magnetic moment ratio -BOOST_UNITS_STATIC_CONSTANT(mu_d_over_mu_n,dimensionless_constant) = -0.44820652; +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_d_over_mu_n,(measurement<double>(-0.44820652,1.1e-7)*dimensionless())); /// helion mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_h,(5.00641214e-27*kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_h,(measurement<double>(5.00641192e-27,2.5e-34)*kilograms)); /// alpha particle mass -BOOST_UNITS_AUTO_STATIC_CONSTANT(m_alpha,(6.6446565e-27*kilograms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(m_alpha,(measurement<double>(6.64465620e-27,3.3e-34)*kilograms)); } // namespace CODATA Index: electromagnetic_constants.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata/electromagnetic_constants.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- electromagnetic_constants.hpp 16 Mar 2007 18:12:46 -0000 1.1.1.1 +++ electromagnetic_constants.hpp 30 Mar 2007 23:49:14 -0000 1.2 @@ -11,14 +11,15 @@ #ifndef BOOST_UNITS_CODATA_ELECTROMAGNETIC_CONSTANTS_HPP #define BOOST_UNITS_CODATA_ELECTROMAGNETIC_CONSTANTS_HPP -#include <boost/units/systems/si.hpp> - #if BOOST_UNITS_HAS_TYPEOF +#include <boost/units/measurement.hpp> #include <boost/units/static_constant.hpp> +#include <boost/units/systems/si.hpp> /// \file -/// CODATA recommended values of fundamental electromagnetic constants: NIST SP 961 +/// CODATA recommended values of fundamental electromagnetic constants +/// CODATA 2006 values as of 2007/03/30 namespace boost { @@ -34,21 +35,21 @@ // ELECTROMAGNETIC /// elementary charge -BOOST_UNITS_AUTO_STATIC_CONSTANT(e,(1.60217653e-19*coulombs)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(e,(measurement<double>(1.602176487e-19,4.0e-27)*coulombs)); /// elementary charge to Planck constant ratio -BOOST_UNITS_AUTO_STATIC_CONSTANT(e_over_h,(2.41798940*amperes/joule)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(e_over_h,(measurement<double>(2.417989454e14,6.0e6)*amperes/joule)); /// magnetic flux quantum -BOOST_UNITS_AUTO_STATIC_CONSTANT(Phi_0,(2.06783372*webers)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(Phi_0,(measurement<double>(2.067833667e-15,5.2e-23)*webers)); /// conductance quantum -BOOST_UNITS_AUTO_STATIC_CONSTANT(G_0,(7.748091733e-5*siemens)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(G_0,(measurement<double>(7.7480917004e-5,5.3e-14)*siemens)); /// Josephson constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(K_J,(483597.879e9*hertz/volt)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(K_J,(measurement<double>(483597.891e9,1.2e7)*hertz/volt)); /// von Klitzing constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(R_K,(25812.807449*ohms)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(R_K,(measurement<double>(25812.807557,1.8e-5)*ohms)); /// Bohr magneton -BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_B,(927.400949e-26*joules/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_B,(measurement<double>(927.400915e-26,2.3e-31)*joules/tesla)); /// nuclear magneton -BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_N,(5.05078343e-27*joules/tesla)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(mu_N,(measurement<double>(5.05078324e-27,1.3e-34)*joules/tesla)); } // namespace CODATA |
|
From: Matthias S. <mat...@us...> - 2007-03-30 19:00:09
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/other In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25724/systems/other Modified Files: temperature_fahrenheit.hpp Log Message: headers for absolute quantities and measurements with uncertainty (used in CODATA constants) Index: temperature_fahrenheit.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/other/temperature_fahrenheit.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- temperature_fahrenheit.hpp 16 Mar 2007 18:12:45 -0000 1.1.1.1 +++ temperature_fahrenheit.hpp 30 Mar 2007 18:56:47 -0000 1.2 @@ -13,6 +13,7 @@ #include <string> +#include <boost/units/absolute.hpp> #include <boost/units/io.hpp> #include <boost/units/static_constant.hpp> #include <boost/units/system.hpp> @@ -22,55 +23,6 @@ namespace units { -template<class Y = double> -class absolute -{ - public: - typedef absolute<Y> this_type; - typedef Y value_type; - - absolute() : val_() { } - absolute(const value_type& val) : val_(val) { } - absolute(const this_type& source) : val_(source.val_) { } - - value_type& value() { return val_; } - const value_type& value() const { return val_; } - - const this_type& operator+=(const Y& val); - const this_type& operator-=(const Y& val); - - private: - Y val_; -}; - -template<class Y> -absolute<Y> operator+(const absolute<Y>& aval,const Y& rval) -{ - return absolute<Y>(aval.value()+rval.value()); -} - -template<class Y> -absolute<Y> operator-(const absolute<Y>& aval,const Y& rval) -{ - return absolute<Y>(aval.value()-rval.value()); -} - -template<class Y> -Y operator-(const absolute<Y>& aval1,const absolute<Y>& aval2) -{ - return Y(aval1.value()-aval2.value()); -} - -template<class Y> -std::ostream& operator<<(std::ostream& os,const absolute<Y>& aval) -{ - using namespace std; - - os << aval.value(); - - return os; -} - namespace fahrenheit { struct system_tag : public ordinal<110> { }; |
|
From: Matthias S. <mat...@us...> - 2007-03-30 19:00:09
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25724/systems/si Removed Files: non_si_units.hpp Log Message: headers for absolute quantities and measurements with uncertainty (used in CODATA constants) --- non_si_units.hpp DELETED --- |
|
From: Matthias S. <mat...@us...> - 2007-03-30 18:58:19
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25724 Modified Files: static_constant.hpp Added Files: absolute.hpp measurement.hpp Log Message: headers for absolute quantities and measurements with uncertainty (used in CODATA constants) Index: static_constant.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/static_constant.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- static_constant.hpp 16 Mar 2007 18:12:42 -0000 1.1.1.1 +++ static_constant.hpp 30 Mar 2007 18:56:46 -0000 1.2 @@ -34,17 +34,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 --- NEW FILE: measurement.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_MEASUREMENT_HPP #define BOOST_UNITS_MEASUREMENT_HPP #include <cmath> #include <cstdlib> #include <iostream> #include <boost/units/static_rational.hpp> namespace boost { namespace units { namespace sqr_namespace { template<class Y> Y sqr(Y val) { return val*val; } } // namespace using sqr_namespace::sqr; template<class Y> class measurement { public: typedef measurement<Y> this_type; typedef Y value_type; measurement(const value_type& val = value_type(), const value_type& err = value_type()) : value_(val), uncertainty_(std::abs(err)) { } measurement(const this_type& source) : value_(source.value_), uncertainty_(source.uncertainty_) { } //~measurement() { } this_type& operator=(const this_type& source) { if (this == &source) return *this; value_ = source.value_; uncertainty_ = source.uncertainty_; return *this; } operator value_type() const { return value_; } value_type value() const { return value_; } value_type uncertainty() const { return uncertainty_; } this_type& operator+=(const value_type& val) { value_ += val; return *this; } this_type& operator-=(const value_type& val) { value_ -= val; return *this; } this_type& operator*=(const value_type& val) { value_ *= val; uncertainty_ *= val; return *this; } this_type& operator/=(const value_type& val) { value_ /= val; uncertainty_ /= val; return *this; } this_type& operator+=(const this_type& /*source*/); this_type& operator-=(const this_type& /*source*/); this_type& operator*=(const this_type& /*source*/); this_type& operator/=(const this_type& /*source*/); private: value_type value_, uncertainty_; }; } } #if BOOST_UNITS_HAS_BOOST_TYPEOF BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::measurement, 1) #endif namespace boost { namespace units { template<class Y> inline measurement<Y>& measurement<Y>::operator+=(const this_type& source) { uncertainty_ = std::sqrt(sqr(uncertainty_)+sqr(source.uncertainty_)); value_ += source.value_; return *this; } template<class Y> inline measurement<Y>& measurement<Y>::operator-=(const this_type& source) { uncertainty_ = std::sqrt(sqr(uncertainty_)+sqr(source.uncertainty_)); value_ -= source.value_; return *this; } template<class Y> inline measurement<Y>& measurement<Y>::operator*=(const this_type& source) { uncertainty_ = (value_*source.value_)* std::sqrt(sqr(uncertainty_/value_)+ sqr(source.uncertainty_/source.value_)); value_ *= source.value_; return *this; } template<class Y> inline measurement<Y>& measurement<Y>::operator/=(const this_type& source) { uncertainty_ = (value_/source.value_)* std::sqrt(sqr(uncertainty_/value_)+ sqr(source.uncertainty_/source.value_)); value_ /= source.value_; return *this; } // value_type op measurement template<class Y> inline measurement<Y> operator+(Y lhs,const measurement<Y>& rhs) { return (measurement<Y>(lhs,Y(0))+=rhs); } template<class Y> inline measurement<Y> operator-(Y lhs,const measurement<Y>& rhs) { return (measurement<Y>(lhs,Y(0))-=rhs); } template<class Y> inline measurement<Y> operator*(Y lhs,const measurement<Y>& rhs) { return (measurement<Y>(lhs,Y(0))*=rhs); } template<class Y> inline measurement<Y> operator/(Y lhs,const measurement<Y>& rhs) { return (measurement<Y>(lhs,Y(0))/=rhs); } // measurement op value_type template<class Y> inline measurement<Y> operator+(const measurement<Y>& lhs,Y rhs) { return (measurement<Y>(lhs)+=measurement<Y>(rhs,Y(0))); } template<class Y> inline measurement<Y> operator-(const measurement<Y>& lhs,Y rhs) { return (measurement<Y>(lhs)-=measurement<Y>(rhs,Y(0))); } template<class Y> inline measurement<Y> operator*(const measurement<Y>& lhs,Y rhs) { return (measurement<Y>(lhs)*=measurement<Y>(rhs,Y(0))); } template<class Y> inline measurement<Y> operator/(const measurement<Y>& lhs,Y rhs) { return (measurement<Y>(lhs)/=measurement<Y>(rhs,Y(0))); } // measurement op measurement template<class Y> inline measurement<Y> operator+(const measurement<Y>& lhs,const measurement<Y>& rhs) { return (measurement<Y>(lhs)+=rhs); } template<class Y> inline measurement<Y> operator-(const measurement<Y>& lhs,const measurement<Y>& rhs) { return (measurement<Y>(lhs)-=rhs); } template<class Y> inline measurement<Y> operator*(const measurement<Y>& lhs,const measurement<Y>& rhs) { return (measurement<Y>(lhs)*=rhs); } template<class Y> inline measurement<Y> operator/(const measurement<Y>& lhs,const measurement<Y>& rhs) { return (measurement<Y>(lhs)/=rhs); } /// specialize power typeof helper template<class Y,long N,long D> struct power_typeof_helper<measurement<Y>,static_rational<N,D> > { typedef measurement<typename power_typeof_helper<Y,static_rational<N,D> >::type> type; static type value(const measurement<Y>& x) { const static_rational<N,D> rat; const Y m = Y(rat.numerator())/Y(rat.denominator()), newval = std::pow(x.value(),m), err = newval*std::sqrt(std::pow(m*x.uncertainty()/x.value(),2)); return type(newval,err); } }; /// specialize root typeof helper template<class Y,long N,long D> struct root_typeof_helper<measurement<Y>,static_rational<N,D> > { typedef measurement<typename root_typeof_helper<Y,static_rational<N,D> >::type> type; static type value(const measurement<Y>& x) { const static_rational<N,D> rat; const Y m = Y(rat.denominator())/Y(rat.numerator()), newval = std::pow(x.value(),m), err = newval*std::sqrt(std::pow(m*x.uncertainty()/x.value(),2)); return type(newval,err); } }; // stream output template<class Y> inline std::ostream& operator<<(std::ostream& os,const measurement<Y>& val) { os << val.value(); if (val.uncertainty() > Y(0)) os << "(+/-" << val.uncertainty() << ")"; return os; } } // namespace units } // namespace boost #endif // BOOST_UNITS_MEASUREMENT_HPP --- NEW FILE: absolute.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_ABSOLUTE_HPP #define BOOST_UNITS_ABSOLUTE_HPP #include <iosfwd> namespace boost { namespace units { template<class Y = double> class absolute { public: typedef absolute<Y> this_type; typedef Y value_type; absolute() : val_() { } absolute(const value_type& val) : val_(val) { } absolute(const this_type& source) : val_(source.val_) { } this_type& operator=(const this_type& source) { val_ = source.val_; return *this; } const value_type& value() const { return val_; } const this_type& operator+=(const value_type& val) { val_ += val; return *this; } const this_type& operator-=(const value_type& val) { val_ -= val; return *this; } private: value_type val_; }; template<class Y> absolute<Y> operator+(const absolute<Y>& aval,const Y& rval) { return absolute<Y>(aval.value()+rval.value()); } template<class Y> absolute<Y> operator+(const Y& rval,const absolute<Y>& aval) { return absolute<Y>(aval.value()+rval.value()); } template<class Y> absolute<Y> operator-(const absolute<Y>& aval,const Y& rval) { return absolute<Y>(aval.value()-rval.value()); } template<class Y> Y operator-(const absolute<Y>& aval1,const absolute<Y>& aval2) { return Y(aval1.value()-aval2.value()); } template<class Y> std::ostream& operator<<(std::ostream& os,const absolute<Y>& aval) { using namespace std; os << aval.value() << " absolute"; return os; } } // namespace units } // namespace boost #endif // BOOST_UNITS_ABSOLUTE_HPP |
|
From: Matthias S. <mat...@us...> - 2007-03-30 18:58:19
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/codata In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25724/systems/si/codata Modified Files: physico-chemical_constants.hpp Log Message: headers for absolute quantities and measurements with uncertainty (used in CODATA 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.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- physico-chemical_constants.hpp 16 Mar 2007 18:12:46 -0000 1.1.1.1 +++ physico-chemical_constants.hpp 30 Mar 2007 18:56:47 -0000 1.2 @@ -15,6 +15,7 @@ #if BOOST_UNITS_HAS_TYPEOF +#include <boost/units/measurement.hpp> #include <boost/units/static_constant.hpp> /// \file @@ -38,7 +39,7 @@ /// Faraday constant BOOST_UNITS_AUTO_STATIC_CONSTANT(F,(96485.3383*coulombs/mole)); /// molar gas constant -BOOST_UNITS_AUTO_STATIC_CONSTANT(R,(8.314472*joules/kelvin/mole)); +BOOST_UNITS_AUTO_STATIC_CONSTANT(R,(measurement<double>(8.314472)*joules/kelvin/mole)); /// Boltzmann constant BOOST_UNITS_AUTO_STATIC_CONSTANT(k_B,(1.3806505e-23*joules/kelvin)); /// molar volume of ideal gas |
|
From: Matthias S. <mat...@us...> - 2007-03-30 17:16:07
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/other In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16982 Added Files: non_si_units.hpp Log Message: moved non_si_units.hpp --- NEW FILE: non_si_units.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_NON_SI_CONSTANTS_HPP #define BOOST_UNITS_NON_SI_CONSTANTS_HPP #include <boost/units/systems/si.hpp> namespace boost { namespace units { namespace SI { namespace constants { // common astronomical units namespace astronomical { // units of length BOOST_UNITS_STATIC_CONSTANT(astronomical_unit,length) = 149597870691.0*meters; BOOST_UNITS_STATIC_CONSTANT(light_day,length) = 2.59020683712e13*meters; BOOST_UNITS_STATIC_CONSTANT(light_hour,length) = 1.0792528488e12*meters; BOOST_UNITS_STATIC_CONSTANT(light_minute,length) = 1.798754748e10*meters; BOOST_UNITS_STATIC_CONSTANT(light_second,length) = 2.99792458e8*meters; BOOST_UNITS_STATIC_CONSTANT(light_year,length) = 9.460730472580e15*meters; BOOST_UNITS_STATIC_CONSTANT(parsec,length) = 3.0856775813e16*meters; } // namespace astronomical // British imperial units namespace imperial { } // namespace imperial // non-SI metric units namespace metric { // units of length BOOST_UNITS_STATIC_CONSTANT(angstrom,length) = 1.0e-10*meters; BOOST_UNITS_STATIC_CONSTANT(angstroms,length) = 1.0e-10*meters; BOOST_UNITS_STATIC_CONSTANT(fermi,length) = 1.0e-15*meters; BOOST_UNITS_STATIC_CONSTANT(fermis,length) = 1.0e-15*meters; BOOST_UNITS_STATIC_CONSTANT(micron,length) = 1.0e-6*meters; BOOST_UNITS_STATIC_CONSTANT(microns,length) = 1.0e-6*meters; // units of mass BOOST_UNITS_STATIC_CONSTANT(ton,mass) = 1.0e3*kilograms; BOOST_UNITS_STATIC_CONSTANT(tons,mass) = 1.0e3*kilograms; BOOST_UNITS_STATIC_CONSTANT(tonne,mass) = 1.0e3*kilograms; BOOST_UNITS_STATIC_CONSTANT(tonnes,mass) = 1.0e3*kilograms; // units of time BOOST_UNITS_STATIC_CONSTANT(day,time) = 86400*seconds; BOOST_UNITS_STATIC_CONSTANT(days,time) = 86400*seconds; BOOST_UNITS_STATIC_CONSTANT(hour,time) = 3600*seconds; BOOST_UNITS_STATIC_CONSTANT(hours,time) = 3600*seconds; BOOST_UNITS_STATIC_CONSTANT(minute,time) = 60*seconds; BOOST_UNITS_STATIC_CONSTANT(minutes,time) = 60*seconds; // units of planar angle //BOOST_UNITS_STATIC_CONSTANT(arc_degree,angle) = (pi/180)*radians; //BOOST_UNITS_STATIC_CONSTANT(arc_minute,angle) = (pi/10800)*radians; //BOOST_UNITS_STATIC_CONSTANT(arc_second,angle) = (pi/648000)*radians; // units of area BOOST_UNITS_STATIC_CONSTANT(are,area) = 1.0e2*square_meters; BOOST_UNITS_STATIC_CONSTANT(are,area) = 1.0e2*square_meters; BOOST_UNITS_STATIC_CONSTANT(barn,area) = 1.0e-28*square_meters; BOOST_UNITS_STATIC_CONSTANT(barns,area) = 1.0e-28*square_meters; BOOST_UNITS_STATIC_CONSTANT(hectare,area) = 1.0e4*square_meters; BOOST_UNITS_STATIC_CONSTANT(hectares,area) = 1.0e4*square_meters; // units of volume BOOST_UNITS_STATIC_CONSTANT(liter,volume) = 1.0e-3*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(liters,volume) = 1.0e-3*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(litre,volume) = 1.0e-3*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(litres,volume) = 1.0e-3*cubic_meters; // units of pressure BOOST_UNITS_STATIC_CONSTANT(bar,pressure) = 1.0e5*pascals; } // namespace metric // nautical units namespace nautical { // units of length BOOST_UNITS_STATIC_CONSTANT(fathom,length) = 1.852*meters; BOOST_UNITS_STATIC_CONSTANT(fathoms,length) = 1.852*meters; BOOST_UNITS_STATIC_CONSTANT(league,length) = 5556.0*meters; BOOST_UNITS_STATIC_CONSTANT(leagues,length) = 5556.0*meters; BOOST_UNITS_STATIC_CONSTANT(mile,length) = 1852.0*meters; BOOST_UNITS_STATIC_CONSTANT(miles,length) = 1852.0*meters; } // namespace nautical // US customary units namespace us_customary { // conversions from http://ts.nist.gov/WeightsAndMeasures/Publications/appxc.cfm#2 // units of length BOOST_UNITS_STATIC_CONSTANT(inch,length) = 25.4e-3*meters; BOOST_UNITS_STATIC_CONSTANT(inches,length) = 25.4e-3*meters; BOOST_UNITS_STATIC_CONSTANT(foot,length) = 0.3048*meters; BOOST_UNITS_STATIC_CONSTANT(feet,length) = 0.3048*meters; BOOST_UNITS_STATIC_CONSTANT(yard,length) = 0.9144*meters; BOOST_UNITS_STATIC_CONSTANT(yards,length) = 0.9144*meters; BOOST_UNITS_STATIC_CONSTANT(mile,length) = 1609.344*meters; BOOST_UNITS_STATIC_CONSTANT(miles,length) = 1609.344*meters; // units of area BOOST_UNITS_STATIC_CONSTANT(square_inch,area) = 645.16e-6*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_inches,area) = 645.16e-6*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_foot,area) = 9.290304e-2*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_feet,area) = 9.290304e-2*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_yard,area) = 0.83612736*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_yards,area) = 0.83612736*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_mile,area) = 2589988.110336*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_miles,area) = 2589988.110336*square_meters; // units of volume BOOST_UNITS_STATIC_CONSTANT(cubic_inch,volume) = 16.387064e-6*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(cubic_inches,volume) = 16.387064e-6*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(cubic_foot,volume) = 2.8316846592e-2*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(cubic_feet,volume) = 2.8316846592e-2*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(cubic_yard,volume) = 0.764554857984*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(cubic_yards,volume) = 0.764554857984*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(minim,volume) = 6.161152e-8*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(minims,volume) = 6.161152e-8*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(fluid_dram,volume) = 3.696691e-6*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(fluid_drams,volume) = 3.696691e-6*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(fluid_ounce,volume) = 2.957353e-5*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(fluid_ounces,volume) = 2.957353e-5*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(gill,volume) = 1.182941e-4*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(gills,volume) = 1.182941e-4*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(liquid_pint,volume) = 4.731765e-4*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(liquid_pints,volume) = 4.731765e-4*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(liquid_quart,volume) = 9.463529e-4*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(liquid_quarts,volume) = 9.463529e-4*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(gallon,volume) = 3.785412e-3*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(gallons,volume) = 3.785412e-3*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(dry_pint,volume) = 5.506105e-4*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(dry_pints,volume) = 5.506105e-4*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(dry_quart,volume) = 1.101221e-3*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(dry_quarts,volume) = 1.101221e-3*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(peck,volume) = 8.809768e-3*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(pecks,volume) = 8.809768e-3*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(bushel,volume) = 3.523907e-2*cubic_meters; BOOST_UNITS_STATIC_CONSTANT(bushels,volume) = 3.523907e-2*cubic_meters; // units of mass BOOST_UNITS_STATIC_CONSTANT(avoirdupois_dram,mass) = 1.7718451953125e-3*kilograms; BOOST_UNITS_STATIC_CONSTANT(avoirdupois_drams,mass) = 1.7718451953125e-3*kilograms; BOOST_UNITS_STATIC_CONSTANT(dram,mass) = 1.7718451953125e-3*kilograms; BOOST_UNITS_STATIC_CONSTANT(drams,mass) = 1.7718451953125e-3*kilograms; BOOST_UNITS_STATIC_CONSTANT(avoirdupois_ounce,mass) = 2.8349523125e-2*kilograms; BOOST_UNITS_STATIC_CONSTANT(avoirdupois_ounces,mass) = 2.8349523125e-2*kilograms; BOOST_UNITS_STATIC_CONSTANT(ounce,mass) = 2.8349523125e-2*kilograms; BOOST_UNITS_STATIC_CONSTANT(ounces,mass) = 2.8349523125e-2*kilograms; BOOST_UNITS_STATIC_CONSTANT(avoirdupois_pound,mass) = 4.5359237e-1*kilograms; BOOST_UNITS_STATIC_CONSTANT(avoirdupois_pounds,mass) = 4.5359237e-1*kilograms; BOOST_UNITS_STATIC_CONSTANT(pound,mass) = 4.5359237e-1*kilograms; BOOST_UNITS_STATIC_CONSTANT(pounds,mass) = 4.5359237e-1*kilograms; BOOST_UNITS_STATIC_CONSTANT(short_hundredweight,mass) = 4.5359237e1*kilograms; BOOST_UNITS_STATIC_CONSTANT(short_hundredweights,mass) = 4.5359237e1*kilograms; BOOST_UNITS_STATIC_CONSTANT(short_ton,mass) = 9.0718474e2*kilograms; BOOST_UNITS_STATIC_CONSTANT(short_tons,mass) = 9.0718474e2*kilograms; BOOST_UNITS_STATIC_CONSTANT(ton,mass) = 9.0718474e2*kilograms; BOOST_UNITS_STATIC_CONSTANT(tons,mass) = 9.0718474e2*kilograms; BOOST_UNITS_STATIC_CONSTANT(long_ton,mass) = 1.0160469088e3*kilograms; BOOST_UNITS_STATIC_CONSTANT(long_tons,mass) = 1.0160469088e3*kilograms; BOOST_UNITS_STATIC_CONSTANT(grain,mass) = 6.479891e-5*kilograms; BOOST_UNITS_STATIC_CONSTANT(grains,mass) = 6.479891e-5*kilograms; BOOST_UNITS_STATIC_CONSTANT(apothecaries_scruple,mass) = 1.2959782e-3*kilograms; BOOST_UNITS_STATIC_CONSTANT(apothecaries_scruples,mass) = 1.2959782e-3*kilograms; BOOST_UNITS_STATIC_CONSTANT(pennyweight,mass) = 1.55517384e-3*kilograms; BOOST_UNITS_STATIC_CONSTANT(pennyweights,mass) = 1.55517384e-3*kilograms; BOOST_UNITS_STATIC_CONSTANT(apothecaries_dram,mass) = 3.8879346e-3*kilograms; BOOST_UNITS_STATIC_CONSTANT(apothecaries_drams,mass) = 3.8879346e-3*kilograms; BOOST_UNITS_STATIC_CONSTANT(apothecaries_ounce,mass) = 3.11034768e-2*kilograms; BOOST_UNITS_STATIC_CONSTANT(apothecaries_ounces,mass) = 3.11034768e-2*kilograms; BOOST_UNITS_STATIC_CONSTANT(troy_ounce,mass) = 3.11034768e-2*kilograms; BOOST_UNITS_STATIC_CONSTANT(troy_ounces,mass) = 3.11034768e-2*kilograms; BOOST_UNITS_STATIC_CONSTANT(apothecaries_pound,mass) = 3.732417216e-1*kilograms; BOOST_UNITS_STATIC_CONSTANT(apothecaries_pounds,mass) = 3.732417216e-1*kilograms; BOOST_UNITS_STATIC_CONSTANT(troy_pound,mass) = 3.732417216e-1*kilograms; BOOST_UNITS_STATIC_CONSTANT(troy_pounds,mass) = 3.732417216e-1*kilograms; } // namespace us_customary // US survey units namespace us_survey { // conversions from http://ts.nist.gov/WeightsAndMeasures/Publications/appxc.cfm#2 // units of length BOOST_UNITS_STATIC_CONSTANT(link,length) = 0.2011684*meters; BOOST_UNITS_STATIC_CONSTANT(links,length) = 0.2011684*meters; BOOST_UNITS_STATIC_CONSTANT(foot,length) = 0.3048006*meters; BOOST_UNITS_STATIC_CONSTANT(feet,length) = 0.3048006*meters; BOOST_UNITS_STATIC_CONSTANT(rod,length) = 5.029210*meters; BOOST_UNITS_STATIC_CONSTANT(rods,length) = 5.029210*meters; BOOST_UNITS_STATIC_CONSTANT(chain,length) = 20.11684*meters; BOOST_UNITS_STATIC_CONSTANT(chains,length) = 20.11684*meters; BOOST_UNITS_STATIC_CONSTANT(mile,length) = 1609.347*meters; BOOST_UNITS_STATIC_CONSTANT(miles,length) = 1609.347*meters; // units of area BOOST_UNITS_STATIC_CONSTANT(square_foot,area) = 0.09290341*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_feet,area) = 0.09290341*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_rod,area) = 25.29295*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_rods,area) = 25.29295*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_chain,area) = 404.6873*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_chains,area) = 404.6873*square_meters; BOOST_UNITS_STATIC_CONSTANT(acre,area) = 4046.873*square_meters; BOOST_UNITS_STATIC_CONSTANT(acres,area) = 4046.873*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_mile,area) = 2589998.0*square_meters; BOOST_UNITS_STATIC_CONSTANT(square_miles,area) = 2589998.0*square_meters; } // namespace us_survey /* namespace english { /// barleycorn BOOST_UNITS_STATIC_CONSTANT(barleycorn,length) = 8.466667e-3*meters; /// cubit BOOST_UNITS_STATIC_CONSTANT(cubit,length) = 0.4572*meters; /// ell BOOST_UNITS_STATIC_CONSTANT(ell,length) = 1.143*meters; /// fathom BOOST_UNITS_STATIC_CONSTANT(fathom,length) = 1.8288*meters; /// finger BOOST_UNITS_STATIC_CONSTANT(finger,length) = 22.225e-3*meters; /// furlong BOOST_UNITS_STATIC_CONSTANT(furlong,length) = 201.168*meters; /// hand BOOST_UNITS_STATIC_CONSTANT(hand,length) = 0.1016*meters; /// league BOOST_UNITS_STATIC_CONSTANT(league,length) = 4828.032*meters; /// palm BOOST_UNITS_STATIC_CONSTANT(palm,length) = 76.2e-3*meters; /// rod BOOST_UNITS_STATIC_CONSTANT(rod,length) = 5.0292*meters; } // namespace english namespace imperial { /// cable (Imperial) BOOST_UNITS_STATIC_CONSTANT(cable,length) = 185.3184*meters; } // namespace imperial /// atomic unit BOOST_UNITS_STATIC_CONSTANT(atomic_unit,length) = 5.291772083e-11*meters; /// Bohr radius BOOST_UNITS_STATIC_CONSTANT(bohr_radius,length) = atomic_unit; /// cable (US) BOOST_UNITS_STATIC_CONSTANT(us_cable,length) = 219.456*meters; /// calibre BOOST_UNITS_STATIC_CONSTANT(calibre,length) = 25.4e-3*meters; /// chain (surveyor's) BOOST_UNITS_STATIC_CONSTANT(surveyors_chain,length) = 20.1168*meters; /// chain (engineer's) BOOST_UNITS_STATIC_CONSTANT(engineers_chain,length) = 30.48*meters; /// finger (cloth) BOOST_UNITS_STATIC_CONSTANT(cloth_finger,length) = 0.1143*meters; /// foot (Benoit) BOOST_UNITS_STATIC_CONSTANT(benoit_foot,length) = 0.304799735*meters; /// foot (Clarke's) BOOST_UNITS_STATIC_CONSTANT(clarkes_foot,length) = 0.3047972654*meters; /// foot (Indian) BOOST_UNITS_STATIC_CONSTANT(indian_foot,length) = 0.304799514*meters; /// foot (Sear's) BOOST_UNITS_STATIC_CONSTANT(sears_foot,length) = 0.30479947*meters; /// foot (US Survey) BOOST_UNITS_STATIC_CONSTANT(us_foot,length) = (1200.0/3937.0)*meters; /// mile, geographical BOOST_UNITS_STATIC_CONSTANT(geographical_mile,length) = 1853.7936*meters; /// line BOOST_UNITS_STATIC_CONSTANT(line,length) = 2.116667e-3*meters; /// link (surveyor's) BOOST_UNITS_STATIC_CONSTANT(surveyors_link,length) = 0.201168*meters; /// link (engineer's) BOOST_UNITS_STATIC_CONSTANT(engineers_link,length) = 0.3048*meters; /// mickey BOOST_UNITS_STATIC_CONSTANT(mickey,length) = 1.27e-4*meters; /// mil BOOST_UNITS_STATIC_CONSTANT(mil,length) = 2.54e-5*meters; /// mile (US survey) BOOST_UNITS_STATIC_CONSTANT(mile_us,length) = 1609.347219*meters; /// nail (cloth) BOOST_UNITS_STATIC_CONSTANT(nail,length) = 57.15e-3*meters; /// mile (Admiralty nautical) BOOST_UNITS_STATIC_CONSTANT(admiralty_nautical_mile,length) = 1853.184*meters; /// pace BOOST_UNITS_STATIC_CONSTANT(pace,length) = 0.762*meters; /// point (ATA) BOOST_UNITS_STATIC_CONSTANT(ata_point,length) = 0.3514598e-3*meters; /// point (Didot) BOOST_UNITS_STATIC_CONSTANT(didot_point,length) = 0.376065e-3*meters; /// point (metric) BOOST_UNITS_STATIC_CONSTANT(point,length) = 0.375e-3*meters; /// point (PostScript) BOOST_UNITS_STATIC_CONSTANT(postscript_point,length) = 0.352778e-3*meters; /// quarter BOOST_UNITS_STATIC_CONSTANT(quarter,length) = 0.2286*meters; /// rope BOOST_UNITS_STATIC_CONSTANT(rope,length) = 6.096*meters; /// span BOOST_UNITS_STATIC_CONSTANT(span,length) = 0.1524*meters; /// span (cloth) BOOST_UNITS_STATIC_CONSTANT(cloth_span,length) = 0.2286*meters; /// stick BOOST_UNITS_STATIC_CONSTANT(stick,length) = 50.8e-3*meters; */ } // constants } // namespace SI } // namespace units } // namespace boost #endif // BOOST_UNITS_NON_SI_CONSTANTS_HPP |
|
From: Matthias S. <mat...@us...> - 2007-03-30 16:53:09
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6719/test Modified Files: test_dimensionless_quantity.cpp Log Message: remove mutating value() from test_dimensionless_quantity.cpp Index: test_dimensionless_quantity.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/test/test_dimensionless_quantity.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- test_dimensionless_quantity.cpp 16 Mar 2007 18:29:54 -0000 1.1.1.1 +++ test_dimensionless_quantity.cpp 30 Mar 2007 16:53:03 -0000 1.2 @@ -63,21 +63,21 @@ bu::quantity<bu::dimensionless> E9(E2); BOOST_CHECK(E9.value() == E_); - // value assignment - E9.value() = 1.5*bu::dimensionless(); - BOOST_CHECK(E9.value() == 1.5); - - // value assignment with implicit conversion - E9.value() = 1.5; - BOOST_CHECK(E9.value() == 1.5); - - // value assignment with implicit value_type conversion - E9.value() = 2*bu::dimensionless(); - BOOST_CHECK(E9.value() == double(2)); - - // value assignment with implicit value_type conversion - E9.value() = 2; - BOOST_CHECK(E9.value() == double(2)); +// // value assignment +// E9.value() = 1.5*bu::dimensionless(); +// BOOST_CHECK(E9.value() == 1.5); +// +// // value assignment with implicit conversion +// E9.value() = 1.5; +// BOOST_CHECK(E9.value() == 1.5); +// +// // value assignment with implicit value_type conversion +// E9.value() = 2*bu::dimensionless(); +// BOOST_CHECK(E9.value() == double(2)); +// +// // value assignment with implicit value_type conversion +// E9.value() = 2; +// BOOST_CHECK(E9.value() == double(2)); // operator+=(this_type) E9 = 2.0; |
|
From: Karl M. <kar...@us...> - 2007-03-30 15:10:39
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/numeric/bindings/lapack/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27432 Modified Files: ublas_hesv.cc ublas_hbev.cpp Log Message: missing include files Index: ublas_hesv.cc =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/numeric/bindings/lapack/test/ublas_hesv.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ublas_hesv.cc 4 Sep 2003 11:03:38 -0000 1.3 +++ ublas_hesv.cc 30 Mar 2007 15:10:25 -0000 1.4 @@ -7,6 +7,7 @@ #include <iostream> #include <complex> #include <boost/numeric/bindings/lapack/hesv.hpp> +#include <boost/numeric/ublas/matrix_proxy.hpp> #include <boost/numeric/bindings/traits/ublas_matrix.hpp> #include <boost/numeric/bindings/traits/ublas_hermitian.hpp> #include <boost/numeric/bindings/traits/std_vector.hpp> Index: ublas_hbev.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/numeric/bindings/lapack/test/ublas_hbev.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ublas_hbev.cpp 7 Nov 2003 14:30:25 -0000 1.1 +++ ublas_hbev.cpp 30 Mar 2007 15:10:25 -0000 1.2 @@ -8,6 +8,8 @@ #include "../../blas/test/random.hpp" #include <boost/numeric/bindings/lapack/hbev.hpp> +#include <boost/numeric/ublas/matrix_proxy.hpp> +#include <boost/numeric/ublas/vector_proxy.hpp> #include <boost/numeric/bindings/traits/ublas_matrix.hpp> #include <boost/numeric/bindings/traits/ublas_vector.hpp> #include <boost/numeric/bindings/traits/ublas_banded.hpp> |
|
From: Karl M. <kar...@us...> - 2007-03-30 15:08:11
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/numeric/bindings/lapack In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26524 Modified Files: hesv.hpp Log Message: missing include Index: hesv.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/numeric/bindings/lapack/hesv.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- hesv.hpp 11 Sep 2003 12:39:05 -0000 1.5 +++ hesv.hpp 30 Mar 2007 15:08:10 -0000 1.6 @@ -28,6 +28,8 @@ # include <boost/type_traits/is_same.hpp> #endif +#include <cassert> + namespace boost { namespace numeric { namespace bindings { |
|
From: Steven W. <ste...@us...> - 2007-03-30 03:55:42
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14843/boost-sandbox/libs/units/example Modified Files: Jamfile.v2 Log Message: Added new examples + tutorial Index: Jamfile.v2 =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/Jamfile.v2,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Jamfile.v2 16 Mar 2007 18:29:51 -0000 1.1.1.1 +++ Jamfile.v2 30 Mar 2007 03:55:35 -0000 1.2 @@ -14,6 +14,7 @@ { test-suite units : + [ run tutorial.cpp : : : $(UNITS_REQUIREMENTS) : ] [ run unit_example_1.cpp : : : $(UNITS_REQUIREMENTS) : ] [ run unit_example_2.cpp : : : $(UNITS_REQUIREMENTS) : ] [ run unit_example_3.cpp : : : $(UNITS_REQUIREMENTS) : ] @@ -36,6 +37,8 @@ [ run unit_example_18.cpp : : : $(UNITS_REQUIREMENTS) : ] [ run unit_example_19.cpp : : : $(UNITS_REQUIREMENTS) : ] [ run unit_example_20.cpp $(BOOST_ROOT)/libs/regex/build//boost_regex : : : $(UNITS_REQUIREMENTS) <define>BOOST_REGEX_NO_LIB : ] + [ run unit_example_21.cpp : : : $(UNITS_REQUIREMENTS) : ] + [ run unit_example_22.cpp : : : $(UNITS_REQUIREMENTS) : ] ; } |
|
From: Matthias S. <mat...@us...> - 2007-03-29 22:57:45
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27720/example Modified Files: unit_example_10.cpp Log Message: minor fix Index: unit_example_10.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_10.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- unit_example_10.cpp 29 Mar 2007 22:41:06 -0000 1.2 +++ unit_example_10.cpp 29 Mar 2007 22:57:45 -0000 1.3 @@ -71,6 +71,7 @@ #include <boost/units/systems/trig.hpp> #include <boost/units/systems/conversions/convert_degrees_to_radians.hpp> +#include <boost/units/systems/conversions/convert_gradians_to_radians.hpp> int main(void) { @@ -84,10 +85,6 @@ quantity<angle::radian> thetar((3.1415926/6.0)*radians); //] - cos(thetad); - - //quantity<angle::dimensionless_degree> cos_thetad(cos(thetad)); - /* /// test cos { quantity<angle::dimensionless_degree> cos_thetad(cos(thetad)); @@ -144,7 +141,7 @@ << "std::atan(tan(thetar)) = " << std::atan(tan_thetar) << std::endl << std::endl; } - */ + sstream2 << "thetad = 30 deg" << std::endl; sstream2 << "thetag = 33.3333 grad" << std::endl; sstream2 << "thetar = 0.523599 rad" << std::endl; |
|
From: Matthias S. <mat...@us...> - 2007-03-29 22:43:48
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21975 Modified Files: quantity.hpp Log Message: remove mutating value() in dimensionless quantity specialization Index: quantity.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/quantity.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- quantity.hpp 29 Mar 2007 19:19:54 -0000 1.8 +++ quantity.hpp 29 Mar 2007 22:43:48 -0000 1.9 @@ -213,7 +213,6 @@ /// implicit conversion to @c value_type is allowed operator value_type() const { return val_; } - value_type& value() { return val_; } ///< mutating accessor to value value_type value() const { return val_; } ///< constant accessor to value // can add or subtract same quantity type |
|
From: Matthias S. <mat...@us...> - 2007-03-29 22:41:07
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20776/example Modified Files: unit_example_10.cpp unit_example_16.cpp Log Message: fixes for new angle implementation Index: unit_example_10.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_10.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- unit_example_10.cpp 16 Mar 2007 18:29:52 -0000 1.1.1.1 +++ unit_example_10.cpp 29 Mar 2007 22:41:06 -0000 1.2 @@ -65,8 +65,13 @@ #include <boost/units/quantity.hpp> #include <boost/units/conversion.hpp> #include <boost/units/systems/si.hpp> +#include <boost/units/systems/angles/degrees.hpp> +#include <boost/units/systems/angles/gradians.hpp> +#include <boost/units/systems/angles/radians.hpp> #include <boost/units/systems/trig.hpp> +#include <boost/units/systems/conversions/convert_degrees_to_radians.hpp> + int main(void) { using namespace boost::units; @@ -78,12 +83,16 @@ quantity<angle::gradian> thetag((200.0/6.0)*gradians); quantity<angle::radian> thetar((3.1415926/6.0)*radians); //] + + cos(thetad); + //quantity<angle::dimensionless_degree> cos_thetad(cos(thetad)); + /* /// test cos { - quantity< unit<dimensionless_type,angle::degree_system> > cos_thetad(cos(thetad)); - quantity< unit<dimensionless_type,angle::gradian_system> > cos_thetag(cos(thetag)); - quantity< unit<dimensionless_type,angle::radian_system> > cos_thetar(cos(thetar)); + quantity<angle::dimensionless_degree> cos_thetad(cos(thetad)); + quantity<angle::dimensionless_gradian> cos_thetag(cos(thetag)); + quantity<angle::dimensionless_radian> cos_thetar(cos(thetar)); sstream1 << "thetad = " << thetad << std::endl << "thetag = " << thetag << std::endl @@ -100,9 +109,9 @@ /// test sin { - quantity< unit<dimensionless_type,angle::degree_system> > sin_thetad(sin(thetad)); - quantity< unit<dimensionless_type,angle::gradian_system> > sin_thetag(sin(thetag)); - quantity< unit<dimensionless_type,angle::radian_system> > sin_thetar(sin(thetar)); + quantity<angle::dimensionless_degree> sin_thetad(sin(thetad)); + quantity<angle::dimensionless_gradian> sin_thetag(sin(thetag)); + quantity<angle::dimensionless_radian> sin_thetar(sin(thetar)); sstream1 << "thetad = " << thetad << std::endl << "thetag = " << thetag << std::endl @@ -119,9 +128,9 @@ /// test tan { - quantity< unit<dimensionless_type,angle::degree_system> > tan_thetad(tan(thetad)); - quantity< unit<dimensionless_type,angle::gradian_system> > tan_thetag(tan(thetag)); - quantity< unit<dimensionless_type,angle::radian_system> > tan_thetar(tan(thetar)); + quantity<angle::dimensionless_degree> tan_thetad(tan(thetad)); + quantity<angle::dimensionless_gradian> tan_thetag(tan(thetag)); + quantity<angle::dimensionless_radian> tan_thetar(tan(thetar)); sstream1 << "thetad = " << thetad << std::endl << "thetag = " << thetag << std::endl @@ -135,7 +144,7 @@ << "std::atan(tan(thetar)) = " << std::atan(tan_thetar) << std::endl << std::endl; } - + */ sstream2 << "thetad = 30 deg" << std::endl; sstream2 << "thetag = 33.3333 grad" << std::endl; sstream2 << "thetar = 0.523599 rad" << std::endl; Index: unit_example_16.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_16.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- unit_example_16.cpp 29 Mar 2007 19:44:05 -0000 1.3 +++ unit_example_16.cpp 29 Mar 2007 22:41:06 -0000 1.4 @@ -73,7 +73,7 @@ // helper for conversions between nautical length and SI length template<> struct base_unit_converter<length_tag,nautical::system_tag,SI::system_tag> : - public trivial_conversion, define_reverse_automatically + public trivial_conversion, trivial_inverse_conversion { typedef double type; static type value() { return 1.852e3; } |
|
From: Matthias S. <mat...@us...> - 2007-03-29 22:39:48
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angles In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19900/angles Modified Files: degrees.hpp gradians.hpp radians.hpp Log Message: angle conversions using trivial_inverse_conversion Index: gradians.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angles/gradians.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gradians.hpp 29 Mar 2007 20:11:56 -0000 1.1 +++ gradians.hpp 29 Mar 2007 22:39:47 -0000 1.2 @@ -24,9 +24,9 @@ namespace units { -namespace angle { +namespace gradian_ns { -struct gradian_system_tag : public ordinal<-2> { }; ///< unit system tag for angles in gradians +struct system_tag : public ordinal<-2> { }; ///< unit system tag for angles in gradians } @@ -38,7 +38,7 @@ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() -BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::gradian_system_tag) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::gradian_ns::system_tag) #endif @@ -46,21 +46,24 @@ namespace units { -namespace angle { +namespace gradian_ns { -typedef homogeneous_system<gradian_system_tag> gradian_system; ///< gradian unit system +typedef homogeneous_system<system_tag> system; ///< gradian unit system -typedef unit<dimensionless_type,gradian_system> dimensionless_gradian; +} // namespace gradian_ns -typedef unit<angle_type,gradian_system> gradian; ///< angle gradian unit constant +namespace angle { -} // namespace angle +typedef unit<dimensionless_type,gradian_ns::system> dimensionless_gradian; +typedef unit<angle_type,gradian_ns::system> gradian; ///< angle gradian unit constant + +} // namespace gradian_ns BOOST_UNITS_STATIC_CONSTANT(gradian,angle::gradian); BOOST_UNITS_STATIC_CONSTANT(gradians,angle::gradian); template<> -struct base_unit_info<angle_tag,angle::gradian_system_tag> +struct base_unit_info<angle_tag,gradian_ns::system_tag> { static std::string name() { return "gradian"; } static std::string symbol() { return "grad"; } Index: radians.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angles/radians.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- radians.hpp 29 Mar 2007 20:11:56 -0000 1.1 +++ radians.hpp 29 Mar 2007 22:39:47 -0000 1.2 @@ -24,9 +24,9 @@ namespace units { -namespace angle { +namespace radian_ns { -struct radian_system_tag : public ordinal<-1> { }; ///< unit system tag for angles in radians +struct system_tag : public ordinal<-1> { }; ///< unit system tag for angles in radians } @@ -38,7 +38,7 @@ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() -BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::radian_system_tag) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::radian_ns::system_tag) #endif @@ -46,13 +46,16 @@ namespace units { -namespace angle { +namespace radian_ns { -typedef homogeneous_system<radian_system_tag> radian_system; ///< radian unit system +typedef homogeneous_system<system_tag> system; ///< radian unit system -typedef unit<dimensionless_type,radian_system> dimensionless_radian; +} // namespace radian_ns -typedef unit<angle_type,radian_system> radian; ///< angle radian unit constant +namespace angle { + +typedef unit<dimensionless_type,radian_ns::system> dimensionless_radian; +typedef unit<angle_type,radian_ns::system> radian; ///< angle radian unit constant } // namespace angle @@ -60,7 +63,7 @@ BOOST_UNITS_STATIC_CONSTANT(radians,angle::radian); template<> -struct base_unit_info<angle_tag,angle::radian_system_tag> +struct base_unit_info<angle_tag,radian_ns::system_tag> { static std::string name() { return "radian"; } static std::string symbol() { return "rad"; } Index: degrees.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angles/degrees.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- degrees.hpp 29 Mar 2007 20:11:56 -0000 1.1 +++ degrees.hpp 29 Mar 2007 22:39:47 -0000 1.2 @@ -24,9 +24,9 @@ namespace units { -namespace angle { +namespace degree_ns { -struct degree_system_tag : public ordinal<-3> { }; ///< unit system tag for angles in degrees +struct system_tag : public ordinal<-3> { }; ///< unit system tag for angles in degrees } @@ -38,7 +38,7 @@ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() -BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::degree_system_tag) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::degree_ns::system_tag) #endif @@ -46,21 +46,24 @@ namespace units { -namespace angle { +namespace degree_ns { -typedef homogeneous_system<degree_system_tag> degree_system; ///< degree unit system +typedef homogeneous_system<system_tag> system; ///< degree unit system -typedef unit<dimensionless_type,degree_system> dimensionless_degree; +} // namespace degree_ns -typedef unit<angle_type,degree_system> degree; ///< angle degree unit constant +namespace angle { + +typedef unit<dimensionless_type,degree_ns::system> dimensionless_degree; +typedef unit<angle_type,degree_ns::system> degree; ///< angle degree unit constant } // namespace angle BOOST_UNITS_STATIC_CONSTANT(degree,angle::degree); -BOOST_UNITS_STATIC_CONSTANT(degrees,angle::degrees); +BOOST_UNITS_STATIC_CONSTANT(degrees,angle::degree); template<> -struct base_unit_info<angle_tag,angle::degree_system_tag> +struct base_unit_info<angle_tag,degree_ns::system_tag> { static std::string name() { return "degree"; } static std::string symbol() { return "deg"; } |
|
From: Matthias S. <mat...@us...> - 2007-03-29 22:39:48
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19900/conversions Modified Files: conversion_headers.hpp convert_degrees_to_gradians.hpp convert_degrees_to_radians.hpp convert_gradians_to_degrees.hpp convert_gradians_to_radians.hpp convert_radians_to_degrees.hpp convert_radians_to_gradians.hpp Log Message: angle conversions using trivial_inverse_conversion Index: conversion_headers.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/conversion_headers.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- conversion_headers.hpp 29 Mar 2007 19:10:39 -0000 1.2 +++ conversion_headers.hpp 29 Mar 2007 22:39:47 -0000 1.3 @@ -16,12 +16,17 @@ #include <boost/units/systems/conversions/convert_si_to_cgs.hpp> #endif -//#if defined(BOOST_UNITS_SI_BASE_HPP) && defined(BOOST_UNITS_TRIG_HPP) -// #include <boost/units/systems/conversions/convert_trig_to_si.hpp> -// #include <boost/units/systems/conversions/convert_si_to_trig.hpp> -//#endif -// -//#if defined(BOOST_UNITS_TRIG_HPP) && defined(BOOST_UNITS_CGS_BASE_HPP) -// #include <boost/units/systems/conversions/convert_cgs_to_trig.hpp> -// #include <boost/units/systems/conversions/convert_trig_to_cgs.hpp> -//#endif +#if defined(BOOST_UNITS_DEGREES_HPP) && defined(BOOST_UNITS_GRADIANS_HPP) + #include <boost/units/systems/conversions/convert_degrees_to_gradians.hpp> + #include <boost/units/systems/conversions/convert_gradians_to_degrees.hpp> +#endif + +#if defined(BOOST_UNITS_DEGREES_HPP) && defined(BOOST_UNITS_RADIANS_HPP) + #include <boost/units/systems/conversions/convert_degrees_to_radians.hpp> + #include <boost/units/systems/conversions/convert_radians_to_degrees.hpp> +#endif + +#if defined(BOOST_UNITS_GRADIANS_HPP) && defined(BOOST_UNITS_RADIANS_HPP) + #include <boost/units/systems/conversions/convert_gradians_to_radians.hpp> + #include <boost/units/systems/conversions/convert_radians_to_gradians.hpp> +#endif Index: convert_gradians_to_radians.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_gradians_to_radians.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_gradians_to_radians.hpp 29 Mar 2007 20:24:05 -0000 1.1 +++ convert_gradians_to_radians.hpp 29 Mar 2007 22:39:47 -0000 1.2 @@ -11,10 +11,6 @@ #ifndef BOOST_UNITS_CONVERT_GRADIANS_TO_RADIANS_HPP #define BOOST_UNITS_CONVERT_GRADIANS_TO_RADIANS_HPP -#include <boost/units/systems/angles/convert_radians_to_gradians.hpp> - -} // namespace units - -} // namespace boost +#include <boost/units/systems/conversions/convert_radians_to_gradians.hpp> #endif // BOOST_UNITS_CONVERT_GRADIANS_TO_RADIANS_HPP Index: convert_gradians_to_degrees.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_gradians_to_degrees.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_gradians_to_degrees.hpp 29 Mar 2007 20:24:05 -0000 1.1 +++ convert_gradians_to_degrees.hpp 29 Mar 2007 22:39:47 -0000 1.2 @@ -11,10 +11,6 @@ #ifndef BOOST_UNITS_CONVERT_GRADIANS_TO_DEGREES_HPP #define BOOST_UNITS_CONVERT_GRADIANS_TO_DEGREES_HPP -#include <boost/units/systems/angles/convert_degrees_to_gradians.hpp> - -} // namespace units - -} // namespace boost +#include <boost/units/systems/conversions/convert_degrees_to_gradians.hpp> #endif // BOOST_UNITS_CONVERT_GRADIANS_TO_DEGREES_HPP Index: convert_radians_to_gradians.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_radians_to_gradians.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_radians_to_gradians.hpp 29 Mar 2007 20:24:05 -0000 1.1 +++ convert_radians_to_gradians.hpp 29 Mar 2007 22:39:47 -0000 1.2 @@ -22,10 +22,11 @@ // conversions from radians to gradians template<> -struct base_unit_converter<angle_tag,angle::radian_system_tag,angle::gradian_system_tag> +struct base_unit_converter<angle_tag,radian_ns::system_tag,gradian_ns::system_tag> : #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION - : public implicitly_convertible, trivial_inverse_conversion + public implicitly_convertible, #endif + public trivial_inverse_conversion { typedef double type; static type value() { return 200.0/3.1415926535897932385; } Index: convert_radians_to_degrees.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_radians_to_degrees.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_radians_to_degrees.hpp 29 Mar 2007 20:24:05 -0000 1.1 +++ convert_radians_to_degrees.hpp 29 Mar 2007 22:39:47 -0000 1.2 @@ -22,10 +22,11 @@ // conversions from radians to degrees template<> -struct base_unit_converter<angle_tag,angle::radian_system_tag,angle::degree_system_tag> +struct base_unit_converter<angle_tag,radian_ns::system_tag,degree_ns::system_tag> : #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION - : public implicitly_convertible, trivial_inverse_conversion + public implicitly_convertible, #endif + public trivial_inverse_conversion { typedef double type; static type value() { return 180.0/3.1415926535897932385; } Index: convert_degrees_to_gradians.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_degrees_to_gradians.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_degrees_to_gradians.hpp 29 Mar 2007 20:24:05 -0000 1.1 +++ convert_degrees_to_gradians.hpp 29 Mar 2007 22:39:47 -0000 1.2 @@ -22,10 +22,11 @@ // conversions from degrees to gradians template<> -struct base_unit_converter<angle_tag,angle::degree_system_tag,angle::gradian_system_tag> +struct base_unit_converter<angle_tag,degree_ns::system_tag,gradian_ns::system_tag> : #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION - : public implicitly_convertible, trivial_inverse_conversion + public implicitly_convertible, #endif + public trivial_inverse_conversion { typedef double type; static type value() { return 200.0/180.0; } Index: convert_degrees_to_radians.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_degrees_to_radians.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_degrees_to_radians.hpp 29 Mar 2007 20:24:05 -0000 1.1 +++ convert_degrees_to_radians.hpp 29 Mar 2007 22:39:47 -0000 1.2 @@ -11,10 +11,6 @@ #ifndef BOOST_UNITS_CONVERT_DEGREES_TO_RADIANS_HPP #define BOOST_UNITS_CONVERT_DEGREES_TO_RADIANS_HPP -#include <boost/units/systems/angles/convert_degrees_to_radians.hpp> - -} // namespace units - -} // namespace boost +#include <boost/units/systems/conversions/convert_radians_to_degrees.hpp> #endif // BOOST_UNITS_CONVERT_DEGREES_TO_RADIANS_HPP |
|
From: Matthias S. <mat...@us...> - 2007-03-29 22:39:48
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19900 Modified Files: trig.hpp Log Message: angle conversions using trivial_inverse_conversion Index: trig.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/trig.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- trig.hpp 29 Mar 2007 19:10:39 -0000 1.3 +++ trig.hpp 29 Mar 2007 22:39:47 -0000 1.4 @@ -13,135 +13,13 @@ #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> +#include <boost/units/systems/angles/radians.hpp> namespace boost { namespace units { -namespace angle { - -struct degree_system_tag : public ordinal<-3> { }; ///< unit system tag for angles in degrees -struct gradian_system_tag : public ordinal<-2> { }; ///< unit system tag for angles in gradians -struct radian_system_tag : public ordinal<-1> { }; ///< unit system tag for angles in radians - -} - -} - -} - -#if BOOST_UNITS_HAS_BOOST_TYPEOF - -#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() - -BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::degree_system_tag) -BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::gradian_system_tag) -BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::radian_system_tag) - -#endif - -namespace boost { - -namespace units { - -namespace angle { - -typedef homogeneous_system<degree_system_tag> degree_system; ///< degree unit system -typedef homogeneous_system<gradian_system_tag> gradian_system; ///< gradian unit system -typedef homogeneous_system<radian_system_tag> radian_system; ///< radian unit system - -typedef unit<dimensionless_type,degree_system> dimensionless_degree; -typedef unit<dimensionless_type,gradian_system> dimensionless_gradian; -typedef unit<dimensionless_type,radian_system> dimensionless_radian; - -typedef unit<angle_type,degree_system> degree; ///< degree unit constant -typedef unit<angle_type,gradian_system> gradian; ///< gradian unit constant -typedef unit<angle_type,radian_system> radian; ///< radian unit constant - -} // namespace angle - -BOOST_UNITS_STATIC_CONSTANT(degree,angle::degree); -BOOST_UNITS_STATIC_CONSTANT(degrees,angle::degree); -BOOST_UNITS_STATIC_CONSTANT(gradian,angle::gradian); -BOOST_UNITS_STATIC_CONSTANT(gradians,angle::gradian); -BOOST_UNITS_STATIC_CONSTANT(radian,angle::radian); -BOOST_UNITS_STATIC_CONSTANT(radians,angle::radian); - -template<> -struct base_unit_info<angle_tag,angle::degree_system_tag> -{ - static std::string name() { return "degree"; } - static std::string symbol() { return "deg"; } -}; - -template<> -struct base_unit_info<angle_tag,angle::gradian_system_tag> -{ - static std::string name() { return "gradian"; } - static std::string symbol() { return "grad"; } -}; - -template<> -struct base_unit_info<angle_tag,angle::radian_system_tag> -{ - static std::string name() { return "radian"; } - static std::string symbol() { return "rad"; } -}; - -/// convert degrees to radians -template<> -struct base_unit_converter<angle_tag,angle::degree_system_tag,angle::radian_system_tag> -{ - typedef double type; - static type value() { return 3.1415926535897932385/180.0; } -}; - -/// convert radians to degrees -template<> -struct base_unit_converter<angle_tag,angle::radian_system_tag,angle::degree_system_tag> -{ - typedef double type; - static type value() { return 180.0/3.1415926535897932385; } -}; - -/// convert degrees to gradians -template<> -struct base_unit_converter<angle_tag,angle::degree_system_tag,angle::gradian_system_tag> -{ - typedef double type; - static type value() { return 180.0/200.0; } -}; - -/// convert gradians to degrees -template<> -struct base_unit_converter<angle_tag,angle::gradian_system_tag,angle::degree_system_tag> -{ - typedef double type; - static type value() { return 200.0/180.0; } -}; - -/// convert radians to gradians -template<> -struct base_unit_converter<angle_tag,angle::radian_system_tag,angle::gradian_system_tag> -{ - typedef double type; - static type value() { return 200.0/3.1415926535897932385; } -}; - -/// convert gradians to radians -template<> -struct base_unit_converter<angle_tag,angle::gradian_system_tag,angle::radian_system_tag> -{ - typedef double type; - static type value() { return 3.1415926535897932385/200.0; } -}; - /// cos of theta in radians template<class Y> typename dimensionless_quantity<angle::radian,Y>::type @@ -250,6 +128,4 @@ } // namespace boost -#include <boost/units/systems/conversions/conversion_headers.hpp> - #endif // BOOST_UNITS_TRIG_HPP |
|
From: Matthias S. <mat...@us...> - 2007-03-29 20:24:06
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29436 Added Files: convert_degrees_to_gradians.hpp convert_degrees_to_radians.hpp convert_gradians_to_degrees.hpp convert_gradians_to_radians.hpp convert_radians_to_degrees.hpp convert_radians_to_gradians.hpp Log Message: conversions for angles --- NEW FILE: convert_gradians_to_radians.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_CONVERT_GRADIANS_TO_RADIANS_HPP #define BOOST_UNITS_CONVERT_GRADIANS_TO_RADIANS_HPP #include <boost/units/systems/angles/convert_radians_to_gradians.hpp> } // namespace units } // namespace boost #endif // BOOST_UNITS_CONVERT_GRADIANS_TO_RADIANS_HPP --- NEW FILE: convert_gradians_to_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_CONVERT_GRADIANS_TO_DEGREES_HPP #define BOOST_UNITS_CONVERT_GRADIANS_TO_DEGREES_HPP #include <boost/units/systems/angles/convert_degrees_to_gradians.hpp> } // namespace units } // namespace boost #endif // BOOST_UNITS_CONVERT_GRADIANS_TO_DEGREES_HPP --- NEW FILE: convert_radians_to_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_CONVERT_RADIANS_TO_GRADIANS_HPP #define BOOST_UNITS_CONVERT_RADIANS_TO_GRADIANS_HPP #include <boost/units/conversion.hpp> #include <boost/units/systems/angles/gradians.hpp> #include <boost/units/systems/angles/radians.hpp> namespace boost { namespace units { // conversions from radians to gradians template<> struct base_unit_converter<angle_tag,angle::radian_system_tag,angle::gradian_system_tag> #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION : public implicitly_convertible, trivial_inverse_conversion #endif { typedef double type; static type value() { return 200.0/3.1415926535897932385; } }; } // namespace units } // namespace boost #endif // BOOST_UNITS_CONVERT_RADIANS_TO_GRADIANS_HPP --- NEW FILE: convert_radians_to_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_CONVERT_RADIANS_TO_DEGREES_HPP #define BOOST_UNITS_CONVERT_RADIANS_TO_DEGREES_HPP #include <boost/units/conversion.hpp> #include <boost/units/systems/angles/degrees.hpp> #include <boost/units/systems/angles/radians.hpp> namespace boost { namespace units { // conversions from radians to degrees template<> struct base_unit_converter<angle_tag,angle::radian_system_tag,angle::degree_system_tag> #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION : public implicitly_convertible, trivial_inverse_conversion #endif { typedef double type; static type value() { return 180.0/3.1415926535897932385; } }; } // namespace units } // namespace boost #endif // BOOST_UNITS_CONVERT_RADIANS_TO_DEGREES_HPP --- NEW FILE: convert_degrees_to_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_CONVERT_DEGREES_TO_GRADIANS_HPP #define BOOST_UNITS_CONVERT_DEGREES_TO_GRADIANS_HPP #include <boost/units/conversion.hpp> #include <boost/units/systems/angles/degrees.hpp> #include <boost/units/systems/angles/gradians.hpp> namespace boost { namespace units { // conversions from degrees to gradians template<> struct base_unit_converter<angle_tag,angle::degree_system_tag,angle::gradian_system_tag> #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION : public implicitly_convertible, trivial_inverse_conversion #endif { typedef double type; static type value() { return 200.0/180.0; } }; } // namespace units } // namespace boost #endif // BOOST_UNITS_CONVERT_DEGREES_TO_GRADIANS_HPP --- NEW FILE: convert_degrees_to_radians.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_CONVERT_DEGREES_TO_RADIANS_HPP #define BOOST_UNITS_CONVERT_DEGREES_TO_RADIANS_HPP #include <boost/units/systems/angles/convert_degrees_to_radians.hpp> } // namespace units } // namespace boost #endif // BOOST_UNITS_CONVERT_DEGREES_TO_RADIANS_HPP |
|
From: Steven W. <ste...@us...> - 2007-03-29 20:18:54
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27269/boost-sandbox/boost/units Modified Files: io.hpp Log Message: Documentation update Index: io.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/io.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- io.hpp 29 Mar 2007 19:00:26 -0000 1.4 +++ io.hpp 29 Mar 2007 20:18:54 -0000 1.5 @@ -43,6 +43,19 @@ namespace units { +#ifdef BOOST_UNITS_DOXYGEN + +/// Template intended to be specialized for every fundamental unit. +template<class DimensionTag, class System> +struct base_unit_info { + /// the full name of the unit for example "meter". + static std::string name(); + /// The symbol of the unit for example "m". + static std::string symbol(); +}; + +#endif + /// Write integral-valued @c static_rational to @c std::basic_ostream. template<class Char, class Traits, integer_type N> inline std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,const static_rational<N>& val) @@ -59,7 +72,10 @@ return os; } -/// Write @c unit to @c std::basic_ostream. +/// Write @c unit to @c std::basic_ostream. Prints the symbol of +/// each fundamental unit followed by it's exponent e.g. +/// joules = m^2 kg s^(-2). If this is not what you want feel free +/// to overload it for your own units. template<class Char, class Traits, class System,class Dim> std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,const unit<Dim,System>& u) { |
|
From: Matthias S. <mat...@us...> - 2007-03-29 20:11:58
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angles In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24387/angles Added Files: degrees.hpp gradians.hpp radians.hpp Log Message: separate degree/gradian/radian angle systems --- 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 angle { struct gradian_system_tag : public ordinal<-2> { }; ///< unit system tag for angles in gradians } } } #if BOOST_UNITS_HAS_BOOST_TYPEOF #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::gradian_system_tag) #endif namespace boost { namespace units { namespace angle { typedef homogeneous_system<gradian_system_tag> gradian_system; ///< gradian unit system typedef unit<dimensionless_type,gradian_system> dimensionless_gradian; typedef unit<angle_type,gradian_system> gradian; ///< angle gradian unit constant } // namespace angle BOOST_UNITS_STATIC_CONSTANT(gradian,angle::gradian); BOOST_UNITS_STATIC_CONSTANT(gradians,angle::gradian); template<> struct base_unit_info<angle_tag,angle::gradian_system_tag> { static std::string name() { return "gradian"; } static std::string symbol() { return "grad"; } }; } // namespace units } // namespace boost #endif // BOOST_UNITS_GRADIANS_HPP --- NEW FILE: radians.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_RADIANS_HPP #define BOOST_UNITS_RADIANS_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 angle { struct radian_system_tag : public ordinal<-1> { }; ///< unit system tag for angles in radians } } } #if BOOST_UNITS_HAS_BOOST_TYPEOF #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::radian_system_tag) #endif namespace boost { namespace units { namespace angle { typedef homogeneous_system<radian_system_tag> radian_system; ///< radian unit system typedef unit<dimensionless_type,radian_system> dimensionless_radian; typedef unit<angle_type,radian_system> radian; ///< angle radian unit constant } // namespace angle BOOST_UNITS_STATIC_CONSTANT(radian,angle::radian); BOOST_UNITS_STATIC_CONSTANT(radians,angle::radian); template<> struct base_unit_info<angle_tag,angle::radian_system_tag> { static std::string name() { return "radian"; } static std::string symbol() { return "rad"; } }; } // namespace units } // namespace boost #endif // BOOST_UNITS_RADIANS_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_DEGREES_HPP #define BOOST_UNITS_DEGREES_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 angle { struct degree_system_tag : public ordinal<-3> { }; ///< unit system tag for angles in degrees } } } #if BOOST_UNITS_HAS_BOOST_TYPEOF #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::degree_system_tag) #endif namespace boost { namespace units { namespace angle { typedef homogeneous_system<degree_system_tag> degree_system; ///< degree unit system typedef unit<dimensionless_type,degree_system> dimensionless_degree; typedef unit<angle_type,degree_system> degree; ///< angle degree unit constant } // namespace angle BOOST_UNITS_STATIC_CONSTANT(degree,angle::degree); BOOST_UNITS_STATIC_CONSTANT(degrees,angle::degrees); template<> struct base_unit_info<angle_tag,angle::degree_system_tag> { static std::string name() { return "degree"; } static std::string symbol() { return "deg"; } }; } // namespace units } // namespace boost #endif // BOOST_UNITS_DEGREES_HPP |
|
From: Matthias S. <mat...@us...> - 2007-03-29 20:10:59
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angles In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23979/angles Log Message: Directory /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angles added to the repository |
|
From: Steven W. <ste...@us...> - 2007-03-29 20:07:44
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22728/boost-sandbox/libs/units/test Modified Files: test_header.hpp Log Message: Added missing #include <boost/units/io.hpp> Index: test_header.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/test/test_header.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- test_header.hpp 29 Mar 2007 17:10:55 -0000 1.2 +++ test_header.hpp 29 Mar 2007 20:07:43 -0000 1.3 @@ -28,6 +28,7 @@ #include <boost/units/static_constant.hpp> #include <boost/units/quantity.hpp> +#include <boost/units/io.hpp> #define BOOST_UNITS_CHECK_CLOSE(a, b) (BOOST_CHECK((std::abs((a) - (b)) < .0000001))) |
|
From: Steven W. <ste...@us...> - 2007-03-29 20:06:00
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21924/boost-sandbox/libs/units/test Modified Files: test_conversion.cpp Log Message: Added test for converting unit and value_type simultaniously Index: test_conversion.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/test/test_conversion.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- test_conversion.cpp 16 Mar 2007 18:29:54 -0000 1.1.1.1 +++ test_conversion.cpp 29 Mar 2007 20:05:58 -0000 1.2 @@ -71,6 +71,24 @@ bu::quantity<mixed_energy_2> e4(e3); BOOST_CHECK((std::abs(e4.value() - 20.0) < .0001)); + + + 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)); + + bu::quantity<bu::SI::force> F3(F0); + BOOST_CHECK((std::abs(F3.value() - 2.0e-4) < .000000001)); + //quantity<SI::force> F4 = F0; + + 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); } |
|
From: Steven W. <ste...@us...> - 2007-03-29 20:03:28
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21131/boost-sandbox/libs/units/test Modified Files: test_quantity.cpp Log Message: Replaced mutating value with quantity_cast Index: test_quantity.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/test/test_quantity.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- test_quantity.cpp 16 Mar 2007 18:29:55 -0000 1.1.1.1 +++ test_quantity.cpp 29 Mar 2007 20:03:27 -0000 1.2 @@ -61,11 +61,11 @@ BOOST_CHECK(E9.value() == E_); // value assignment - E9.value() = 1.5; + bu::quantity_cast<double&>(E9) = 1.5; BOOST_CHECK(E9.value() == 1.5); // value assignment with implicit value_type conversion - E9.value() = 2; + bu::quantity_cast<double&>(E9) = 2; BOOST_CHECK(E9.value() == double(2)); // operator+=(this_type) |
|
From: Steven W. <ste...@us...> - 2007-03-29 19:46:31
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14063/boost-sandbox/libs/units/example Modified Files: unit_example_5.cpp Log Message: Updated quantity_casts Index: unit_example_5.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_5.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- unit_example_5.cpp 16 Mar 2007 18:29:53 -0000 1.1.1.1 +++ unit_example_5.cpp 29 Mar 2007 19:46:30 -0000 1.2 @@ -87,11 +87,11 @@ //] //[unit_example_5_snippet_3 - quantity<SI::length,int> L4 = quantity_cast<int>(L1); + quantity<SI::length,int> L4 = quantity_cast<quantity<SI::length,int> >(L1); //] //[unit_example_5_snippet_4 - quantity<CGS::length> L5 = quantity_cast<CGS::length>(L1); + quantity<CGS::length> L5 = quantity_cast<quantity<CGS::length> >(L1); //] sstream1 << "L1 = " << L1 << std::endl |
|
From: Steven W. <ste...@us...> - 2007-03-29 19:44:06
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12892/boost-sandbox/libs/units/example Modified Files: unit_example_16.cpp Log Message: Replaced trival_reverse_conversion with trivial_conversion, define_reverse_automatically Index: unit_example_16.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_16.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- unit_example_16.cpp 29 Mar 2007 16:48:14 -0000 1.2 +++ unit_example_16.cpp 29 Mar 2007 19:44:05 -0000 1.3 @@ -73,7 +73,7 @@ // helper for conversions between nautical length and SI length template<> struct base_unit_converter<length_tag,nautical::system_tag,SI::system_tag> : - public trivial_inverse_conversion + public trivial_conversion, define_reverse_automatically { typedef double type; static type value() { return 1.852e3; } |