You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(89) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(208) |
Feb
(76) |
Mar
(55) |
Apr
(74) |
May
(43) |
Jun
(116) |
Jul
(109) |
Aug
(46) |
Sep
(36) |
Oct
(106) |
Nov
(159) |
Dec
(128) |
| 2007 |
Jan
(54) |
Feb
(225) |
Mar
(200) |
Apr
(229) |
May
(7) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Steven W. <ste...@us...> - 2007-04-12 20:42:30
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11870/boost-sandbox/libs/units/test Modified Files: test_predicates.cpp Log Message: Switched to BOOST_UNITS_REGISTER_BASE_DIMENSION Index: test_predicates.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/test/test_predicates.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test_predicates.cpp 4 Apr 2007 23:49:15 -0000 1.3 +++ test_predicates.cpp 12 Apr 2007 20:42:29 -0000 1.4 @@ -30,7 +30,7 @@ namespace bu = boost::units; -typedef bu::base_dimension<0> dimension_tag; +BOOST_UNITS_REGISTER_BASE_DIMENSION(dimension_tag, 0); struct system1 : bu::ordinal<100> {}; struct system2 : bu::ordinal<101> {}; |
|
From: Steven W. <ste...@us...> - 2007-04-12 20:41:59
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11489/boost-sandbox/libs/units/test Modified Files: test_header.hpp Log Message: Switched to BOOST_UNITS_REGISTER_BASE_DIMENSION Index: test_header.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/test/test_header.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- test_header.hpp 10 Apr 2007 23:13:05 -0000 1.5 +++ test_header.hpp 12 Apr 2007 20:41:49 -0000 1.6 @@ -36,9 +36,9 @@ namespace units { -typedef base_dimension<1> length_dim; -typedef base_dimension<2> mass_dim; -typedef base_dimension<3> time_dim; +BOOST_UNITS_REGISTER_BASE_DIMENSION(length_dim, 1); +BOOST_UNITS_REGISTER_BASE_DIMENSION(mass_dim, 2); +BOOST_UNITS_REGISTER_BASE_DIMENSION(time_dim, 3); typedef length_dim::type length_type; typedef mass_dim::type mass_type; |
|
From: Matthias S. <mat...@us...> - 2007-04-12 18:09:05
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/doc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14595/doc Modified Files: units.qbk Log Message: doc edits Index: units.qbk =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/doc/units.qbk,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -d -r1.1.1.2 -r1.2 --- units.qbk 20 Mar 2007 04:57:10 -0000 1.1.1.2 +++ units.qbk 12 Apr 2007 18:09:01 -0000 1.2 @@ -1,6 +1,6 @@ [library Boost.Units [quickbook 1.3] - [version 0.7.1] + [version 0.8.0] [authors [Schabel, Matthias C.]] [authors [Watanabe, Steven]] [copyright 2003-2007 Matthias Christian Schabel, 2007 Steven Watanabe] @@ -57,14 +57,16 @@ [section:Introduction Introduction] -The Boost.Units library is a C++ implementation of zero runtime overhead compile-time dimensional analysis in a general -and extensible manner, treating it as a generic metaprogramming problem. Support for units +The Boost.Units library is a C++ implementation of dimensional analysis in a general +and extensible manner, treating it as a generic compile-time metaprogramming problem. With appropriate +compiler optimization, no runtime execution cost is introduced, facilitating the use of this library to +provide dimension checking in performance-critical code. Support for units and quantities (defined as a unit and associated value) for arbitrary unit system models and arbitrary -value types is provided, as is a general facility for unit conversions enabling fine-grained control over -conversion. Complete SI and CGS unit system models are provided, along with systems for -angles measured in degrees, gradians, and radians. A small subset of the SI system including only length, mass, -and time is developed in the examples as a demonstration of the relative ease of adding new unit systems and -the extensibility of the library architecture. +value types is provided, as is a fine-grained general facility for unit conversions. Complete SI and CGS unit +systems are provided, along with systems for +angles measured in degrees, gradians and systems for temperatures measured in degrees Celsius or Fahrenheit. +The library architecture has been designed with flexibility and extensibility in mind; demonstrations of the ease +of adding new units and new unit systems are provided in the examples. In order to enable complex compile-time dimensional analysis calculations with no runtime overhead, Boost.Units relies heavily on the [___boost_mpl] (MPL) and on template metaprogramming techniques, and is, as a consequence, @@ -82,6 +84,7 @@ # Microsoft Visual C++ 6.0 on Windows XP # Microsoft Visual C++ 7.0 on Windows XP # Metrowerks CodeWarrior 8.0 on Windows XP. +# g++ 3.3.x [endsect] @@ -90,19 +93,23 @@ Before discussing the basics of the library, we first define a few terms that will be used frequently in the following : -* *Fundamental dimension* : A fundamental dimension is a type of measurement that forms the basis - of a unit system. The SI unit system defines seven fundamental dimensions : length \[L\], mass \[M\], time \[T\], - current \[C\], temperature \[K\], amount \[A\], and luminous intensity \[I\]. -* *Dimension* : A dimension represents the signature of a collection of fundamental dimensions, each - potentially raised to a different rational power. For example, area = \[L\]^2, velocity = \[L\]/\[T\], - energy = \[M\] \[L\]^2/\[T\]^2. -* *Unit* : Units are a specific measure of a dimension. While length is an abstract measure of - distance, the meter is the concrete unit of distance in the SI system. Units represent a reference - measure of some dimension (fundamental or otherwise). -* *Quantity* : Quantities represent a concrete amount of some unit. Thus, while the meter is a unit of length in the SI system, - 5.5 meters is a quantity of length in that system. +* *Base dimension* : A base dimension is defined as a measurable entity that forms a component of the basis + of a unit system. The SI unit system defines seven base dimensions : length \[L\], mass \[M\], time \[T\], + current \[I\], temperature \[theta\], amount \[N\], and luminous intensity \[J\]. +* *Derived dimension* : A collection of one or more base dimensions, each + potentially raised to a different rational power. For example, area = \[L\]^2, velocity = \[L\]/\[T\], and + energy = \[M\] \[L\]^2/\[T\]^2 are all derived dimensions. +* *Dimension* : The general term dimension is used to refer to either a base or a derived dimension. +* *Base unit* : A base unit represents a specific measure of a base dimension. While length is an abstract measure of + distance, the meter is the concrete base unit of distance in the SI system. +* *Derived unit* : Derived units represent a specific measure of a derived dimension. +* *Unit* : The general term unit is used to refer to either a base or a derived unit. +* *Base quantity* : A base quantity represents a concrete amount of a base unit. Thus, while the meter is the base + unit of length in the SI system, 5.5 meters is a base quantity of length in that system. +* *Derived quantity* : Derived quantities represent a concrete amount of a derived unit. +* *Quantity* : The general term quantity is used to refer to either a base or a derived quantity. -To begin, we present a short [@../example/tutorial.cpp tutorial] that demonstrates the use of +To begin, we present two short tutorials. [@../example/tutorial1.cpp Tutorial1] demonstrates the use of [@http://en.wikipedia.org/wiki/SI_units SI] units. After including the appropriate system headers and the headers for the various SI units we will need (all SI units can be included with [headerref boost/units/systems/si.hpp]) and for quantity I/O ([headerref boost/units/io.hpp]), we define |
|
From: Matthias S. <mat...@us...> - 2007-04-12 18:08:43
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/detail In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14579/detail Modified Files: conversion_impl.hpp Log Message: cosmetic changes Index: conversion_impl.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/detail/conversion_impl.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- conversion_impl.hpp 12 Apr 2007 00:39:12 -0000 1.6 +++ conversion_impl.hpp 12 Apr 2007 18:08:35 -0000 1.7 @@ -86,13 +86,16 @@ // tag class to indicate that implicit conversions are allowed struct implicitly_convertible { }; +// tag class to indicate that conversion is trivial struct trivial_conversion { typedef one type; static one value() { return one(); } }; -struct identity_conversion : trivial_conversion, implicitly_convertible {}; +struct identity_conversion : + public trivial_conversion, implicitly_convertible +{ }; struct trivial_inverse_conversion { }; |
|
From: Steven W. <ste...@us...> - 2007-04-12 00:39:21
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15994/boost-sandbox/libs/units/example Modified Files: unit_example_1.cpp Log Message: Switched metafunctions to mpl Index: unit_example_1.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_1.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- unit_example_1.cpp 10 Apr 2007 23:13:05 -0000 1.4 +++ unit_example_1.cpp 12 Apr 2007 00:39:12 -0000 1.5 @@ -68,9 +68,9 @@ << "energy_type = " << simplify_typename(energy_type()) << std::endl; //[unit_example_1_snippet_1 - typedef static_multiply<length_type,mass_type>::type LM_type; - typedef static_divide<length_type,time_type>::type L_T_type; - typedef static_root<static_divide<energy_type,mass_type>::type,static_rational<2> >::type V_type; + typedef mpl::times<length_type,mass_type>::type LM_type; + typedef mpl::divides<length_type,time_type>::type L_T_type; + typedef static_root<mpl::divides<energy_type,mass_type>::type,static_rational<2> >::type V_type; //] BOOST_MPL_ASSERT((boost::is_same<LM_type, |
|
From: Steven W. <ste...@us...> - 2007-04-12 00:39:21
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15994/boost-sandbox/boost/units Modified Files: system.hpp dim.hpp unit.hpp static_rational.hpp dimension.hpp Log Message: Switched metafunctions to mpl Index: unit.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/unit.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- unit.hpp 16 Mar 2007 18:12:43 -0000 1.1.1.1 +++ unit.hpp 12 Apr 2007 00:39:12 -0000 1.2 @@ -245,7 +245,7 @@ struct multiply_typeof_helper< unit<Dim1,homogeneous_system<System> >, unit<Dim2,homogeneous_system<System> > > { - typedef unit<typename static_multiply<Dim1,Dim2>::type,homogeneous_system<System> > type; + typedef unit<typename mpl::times<Dim1,Dim2>::type,homogeneous_system<System> > type; }; /// unit multiply typeof helper for two different homogeneous systems @@ -257,7 +257,7 @@ unit<Dim2,homogeneous_system<System2> > > { typedef unit< - typename static_multiply<Dim1,Dim2>::type, + typename mpl::times<Dim1,Dim2>::type, typename detail::multiply_systems< heterogeneous_system_view<System1, Dim1>, heterogeneous_system_view<System2, Dim2> @@ -274,7 +274,7 @@ unit<Dim2,homogeneous_system<System2> > > { typedef unit< - typename static_multiply<Dim1,Dim2>::type, + typename mpl::times<Dim1,Dim2>::type, typename detail::multiply_systems< heterogeneous_system<System1>, heterogeneous_system_view<System2, Dim2> @@ -291,7 +291,7 @@ unit<Dim2,heterogeneous_system<System2> > > { typedef unit< - typename static_multiply<Dim1,Dim2>::type, + typename mpl::times<Dim1,Dim2>::type, typename detail::multiply_systems< heterogeneous_system_view<System1, Dim1>, heterogeneous_system<System2> @@ -308,7 +308,7 @@ unit<Dim2,heterogeneous_system<System2> > > { typedef unit< - typename static_multiply<Dim1,Dim2>::type, + typename mpl::times<Dim1,Dim2>::type, typename detail::multiply_systems< heterogeneous_system<System1>, heterogeneous_system<System2> @@ -323,7 +323,7 @@ struct divide_typeof_helper< unit<Dim1,homogeneous_system<System> >, unit<Dim2,homogeneous_system<System> > > { - typedef unit<typename static_divide<Dim1,Dim2>::type,homogeneous_system<System> > type; + typedef unit<typename mpl::divides<Dim1,Dim2>::type,homogeneous_system<System> > type; }; /// unit divide typeof helper for two different homogeneous systems @@ -335,7 +335,7 @@ unit<Dim2,homogeneous_system<System2> > > { typedef unit< - typename static_divide<Dim1,Dim2>::type, + typename mpl::divides<Dim1,Dim2>::type, typename detail::divide_systems< heterogeneous_system_view<System1, Dim1>, heterogeneous_system_view<System2, Dim2> @@ -352,7 +352,7 @@ unit<Dim2,homogeneous_system<System2> > > { typedef unit< - typename static_divide<Dim1,Dim2>::type, + typename mpl::divides<Dim1,Dim2>::type, typename detail::divide_systems< heterogeneous_system<System1>, heterogeneous_system_view<System2, Dim2> @@ -369,7 +369,7 @@ unit<Dim2,heterogeneous_system<System2> > > { typedef unit< - typename static_divide<Dim1,Dim2>::type, + typename mpl::divides<Dim1,Dim2>::type, typename detail::divide_systems< heterogeneous_system_view<System1, Dim1>, heterogeneous_system<System2> @@ -386,7 +386,7 @@ unit<Dim2,heterogeneous_system<System2> > > { typedef unit< - typename static_divide<Dim1,Dim2>::type, + typename mpl::divides<Dim1,Dim2>::type, typename detail::divide_systems< heterogeneous_system<System1>, heterogeneous_system<System2> Index: static_rational.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/static_rational.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- static_rational.hpp 11 Apr 2007 22:21:01 -0000 1.4 +++ static_rational.hpp 12 Apr 2007 00:39:12 -0000 1.5 @@ -126,44 +126,44 @@ return T(N)/T(D); } -/// negate @c static_rational -template<integer_type N,integer_type D> -struct static_negate< static_rational<N,D> > -{ - typedef typename static_rational<-N,D>::type type; -}; - -/// add @c static_rational -template<integer_type N1,integer_type D1, - integer_type N2,integer_type D2> -struct static_add< static_rational<N1,D1>,static_rational<N2,D2> > -{ - typedef typename static_rational<N1*D2+N2*D1,D1*D2>::type type; -}; - -/// subtract @c static_rational -template<integer_type N1,integer_type D1, - integer_type N2,integer_type D2> -struct static_subtract< static_rational<N1,D1>,static_rational<N2,D2> > -{ - typedef typename static_rational<N1*D2-N2*D1,D1*D2>::type type; -}; - -/// multiply @c static_rational -template<integer_type N1,integer_type D1, - integer_type N2,integer_type D2> -struct static_multiply< static_rational<N1,D1>,static_rational<N2,D2> > -{ - typedef typename static_rational<N1*N2,D1*D2>::type type; -}; - -/// divide @c static_rational -template<integer_type N1,integer_type D1, - integer_type N2,integer_type D2> -struct static_divide< static_rational<N1,D1>,static_rational<N2,D2> > -{ - typedef typename static_rational<N1*D2,D1*N2>::type type; -}; +///// negate @c static_rational +//template<integer_type N,integer_type D> +//struct static_negate< static_rational<N,D> > +//{ +// typedef typename static_rational<-N,D>::type type; +//}; +// +///// add @c static_rational +//template<integer_type N1,integer_type D1, +// integer_type N2,integer_type D2> +//struct static_add< static_rational<N1,D1>,static_rational<N2,D2> > +//{ +// typedef typename static_rational<N1*D2+N2*D1,D1*D2>::type type; +//}; +// +///// subtract @c static_rational +//template<integer_type N1,integer_type D1, +// integer_type N2,integer_type D2> +//struct static_subtract< static_rational<N1,D1>,static_rational<N2,D2> > +//{ +// typedef typename static_rational<N1*D2-N2*D1,D1*D2>::type type; +//}; +// +///// multiply @c static_rational +//template<integer_type N1,integer_type D1, +// integer_type N2,integer_type D2> +//struct static_multiply< static_rational<N1,D1>,static_rational<N2,D2> > +//{ +// typedef typename static_rational<N1*N2,D1*D2>::type type; +//}; +// +///// divide @c static_rational +//template<integer_type N1,integer_type D1, +// integer_type N2,integer_type D2> +//struct static_divide< static_rational<N1,D1>,static_rational<N2,D2> > +//{ +// typedef typename static_rational<N1*D2,D1*N2>::type type; +//}; /// raise @c int to a @c static_rational power template<long N,long D> @@ -348,7 +348,10 @@ { template<class T0, class T1> struct apply { - typedef typename boost::units::static_add<T0, T1>::type type; + typedef typename boost::units::static_rational< + T0::Numerator*T1::Denominator+T1::Numerator*T0::Denominator, + T0::Denominator*T1::Denominator + >::type type; }; }; @@ -357,7 +360,10 @@ { template<class T0, class T1> struct apply { - typedef typename boost::units::static_subtract<T0, T1>::type type; + typedef typename boost::units::static_rational< + T0::Numerator*T1::Denominator-T1::Numerator*T0::Denominator, + T0::Denominator*T1::Denominator + >::type type; }; }; @@ -366,7 +372,10 @@ { template<class T0, class T1> struct apply { - typedef typename boost::units::static_multiply<T0, T1>::type type; + typedef typename boost::units::static_rational< + T0::Numerator*T1::Numerator, + T0::Denominator*T1::Denominator + >::type type; }; }; @@ -375,7 +384,10 @@ { template<class T0, class T1> struct apply { - typedef typename boost::units::static_divide<T0, T1>::type type; + typedef typename boost::units::static_rational< + T0::Numerator*T1::Denominator, + T0::Denominator*T1::Numerator + >::type type; }; }; @@ -384,7 +396,7 @@ { template<class T0> struct apply { - typedef typename boost::units::static_negate<T0>::type type; + typedef typename boost::units::static_rational<-T0::Numerator,T0::Denominator>::type type; }; }; Index: dimension.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/dimension.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- dimension.hpp 11 Apr 2007 21:25:10 -0000 1.4 +++ dimension.hpp 12 Apr 2007 00:39:12 -0000 1.5 @@ -36,6 +36,7 @@ /// Dimension lists in which all exponents resolve to zero reduce to @c dimensionless_type. struct dimensionless_type { + typedef dimensionless_type type; typedef detail::dimension_list_tag tag; typedef mpl::long_<0> size; }; @@ -72,54 +73,54 @@ public mpl::true_ { }; -// All the static_* metafunctions in this file assume -// that their parameters are sorted dimension lists. -// -// should we static assert is_dimension_list here? - -/// Negate dimension list. -template<typename DL> -struct static_negate -{ - typedef DL type; -}; - -/// Add two dimension list, only permitted if they are commensurate. -template<typename DL1,typename DL2> -struct static_add -{ - BOOST_STATIC_ASSERT((is_same<DL1,DL2>::value == true)); - typedef DL1 type; -}; - -/// Subtract two dimension sequences, only permitted if they are commensurate. -template<typename DL1,typename DL2> -struct static_subtract -{ - BOOST_STATIC_ASSERT((is_same<DL1,DL2>::value == true)); - typedef DL2 type; -}; - -/// Multiply two dimension sequences. -template<typename DL1,typename DL2> -struct static_multiply -{ - typedef typename detail::merge_dimensions<DL1,DL2>::type type; -}; - -/// Divide two dimension lists. -template<typename DL1,typename DL2> -struct static_divide -{ - typedef typename detail::merge_dimensions< - DL1, - typename detail::static_inverse_impl< - mpl::size<DL2>::value - >::template apply< - typename mpl::begin<DL2>::type - >::type - >::type type; -}; +//// All the static_* metafunctions in this file assume +//// that their parameters are sorted dimension lists. +//// +//// should we static assert is_dimension_list here? +// +///// Negate dimension list. +//template<typename DL> +//struct static_negate +//{ +// typedef DL type; +//}; +// +///// Add two dimension list, only permitted if they are commensurate. +//template<typename DL1,typename DL2> +//struct static_add +//{ +// BOOST_STATIC_ASSERT((is_same<DL1,DL2>::value == true)); +// typedef DL1 type; +//}; +// +///// Subtract two dimension sequences, only permitted if they are commensurate. +//template<typename DL1,typename DL2> +//struct static_subtract +//{ +// BOOST_STATIC_ASSERT((is_same<DL1,DL2>::value == true)); +// typedef DL2 type; +//}; +// +///// Multiply two dimension sequences. +//template<typename DL1,typename DL2> +//struct static_multiply +//{ +// typedef typename detail::merge_dimensions<DL1,DL2>::type type; +//}; +// +///// Divide two dimension lists. +//template<typename DL1,typename DL2> +//struct static_divide +//{ +// typedef typename detail::merge_dimensions< +// DL1, +// typename detail::static_inverse_impl< +// mpl::size<DL2>::value +// >::template apply< +// typename mpl::begin<DL2>::type +// >::type +// >::type type; +//}; /// Raise a dimension list to a scalar power. template<typename DL,typename Ex> @@ -210,7 +211,8 @@ template<class T0, class T1> struct apply { - typedef typename boost::units::static_add<T0, T1>::type type; + BOOST_STATIC_ASSERT((boost::is_same<T0,T1>::value == true)); + typedef T0 type; }; }; @@ -220,7 +222,8 @@ template<class T0, class T1> struct apply { - typedef typename boost::units::static_subtract<T0, T1>::type type; + BOOST_STATIC_ASSERT((boost::is_same<T0,T1>::value == true)); + typedef T0 type; }; }; @@ -230,7 +233,7 @@ template<class T0, class T1> struct apply { - typedef typename boost::units::static_multiply<T0, T1>::type type; + typedef typename boost::units::detail::merge_dimensions<T0,T1>::type type; }; }; @@ -240,17 +243,24 @@ template<class T0, class T1> struct apply { - typedef typename boost::units::static_divide<T0, T1>::type type; + typedef typename boost::units::detail::merge_dimensions< + T0, + typename boost::units::detail::static_inverse_impl< + mpl::size<T1>::value + >::template apply< + typename mpl::begin<T1>::type + >::type + >::type type; }; }; template<> struct negate_impl<boost::units::detail::dimension_list_tag> { - template<class T0, class T1> + template<class T0> struct apply { - typedef typename boost::units::static_negate<T0>::type type; + typedef T0 type; }; }; Index: system.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/system.hpp,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -d -r1.1.1.2 -r1.2 --- system.hpp 20 Mar 2007 04:49:08 -0000 1.1.1.2 +++ system.hpp 12 Apr 2007 00:39:12 -0000 1.2 @@ -80,19 +80,36 @@ static const bool value = true; }; -template<class S1, class E1, class E2> -struct static_add<heterogeneous_system_element<S1, E1>, heterogeneous_system_element<S1, E2> > +} // namespace units + +namespace mpl { + +template<> +struct plus_impl<boost::units::detail::heterogeneous_system_element_tag, boost::units::detail::heterogeneous_system_element_tag> { - typedef heterogeneous_system_element<S1, typename static_multiply<E1, E2>::type> type; + template<class T0, class T1> + struct apply { + BOOST_STATIC_ASSERT((boost::is_same<typename T0::tag_type, typename T1::tag_type>::value == true)); + typedef boost::units::heterogeneous_system_element<typename T0::tag_type, typename times<typename T0::value_type, typename T1::value_type>::type> type; + }; }; -template<class S1, class E1> -struct static_negate<heterogeneous_system_element<S1, E1> > +template<> +struct negate_impl<boost::units::detail::heterogeneous_system_element_tag> { - typedef typename detail::static_inverse_impl<mpl::size<E1>::value>::template apply<typename mpl::begin<E1>::type>::type inverse; - typedef heterogeneous_system_element<S1, inverse> type; + template<class T0> + struct apply { + typedef typename boost::units::detail::static_inverse_impl< + mpl::size<typename T0::value_type>::value + >::template apply<typename mpl::begin<typename T0::value_type>::type>::type inverse; + typedef boost::units::heterogeneous_system_element<typename T0::tag_type, inverse> type; + }; }; +} // namespace mpl + +namespace units { + template<class System, class Dimensions> struct heterogeneous_system_view { Index: dim.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/dim.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- dim.hpp 16 Mar 2007 18:12:42 -0000 1.1.1.1 +++ dim.hpp 12 Apr 2007 00:39:12 -0000 1.2 @@ -54,83 +54,159 @@ public mpl::true_ { }; -/// \brief Negate a @c dim. -/// -/// \detailed @c static_negate operation delegates to @c value_type. -template<typename T,typename V> -struct static_negate< dim<T,V> > +///// \brief Negate a @c dim. +///// +///// \detailed @c static_negate operation delegates to @c value_type. +//template<typename T,typename V> +//struct static_negate< dim<T,V> > +//{ +// typedef dim<T,typename static_negate<V>::type> type; +//}; +// +///// \brief Add two dims. +///// +///// \detailed +///// @c static_add operations on dim are only defined between dims having identical +///// @c tag_type. Operation delegates to @c value_type. +//template<typename T,typename V1,typename V2> +//struct static_add< dim<T,V1>,dim<T,V2> > +//{ +// typedef dim<T,typename static_add<V1,V2>::type> type; +//}; +// +///// \brief Subtract two dims. +///// +///// \detailed +///// @c static_subtract operations on dim are only defined between dims having identical +///// @c tag_type. Operation delegates to @c value_type. +//template<typename T,typename V1,typename V2> +//struct static_subtract< dim<T,V1>,dim<T,V2> > +//{ +// typedef dim<T,typename static_subtract<V1,V2>::type> type; +//}; +// +///// \brief Multiply a @c dim and a @c value_type. +///// +///// \detailed +///// @c static_multiply operations on @c dim are only defined between @c dim and +///// @c value_type or @c value_type and @c dim. Operation delegates to @c value_type. +//template<typename T,typename V,typename X> +//struct static_multiply< dim<T,V>,X > +//{ +// typedef dim<T,typename static_multiply<V,X>::type> type; +//}; +// +///// \brief Multipy a @c value_type and a @c dim. +///// +///// \detailed +///// @c static_multiply operations on @c dim are only defined between @c dim and +///// @c value_type or @c value_type and @c dim. Operation delegates to @c value_type. +//template<typename T,typename V,typename X> +//struct static_multiply< X,dim<T,V> > +//{ +// typedef dim<T,typename static_multiply<X,V>::type> type; +//}; +// +///// \brief Divide a @c dim by a @c value_type. +///// +///// \detailed +///// @c static_divide operations on dim are only defined between @c dim and @c value_type or +///// @c value_type and @c dim. Operation delegates to @c value_type. +//template<typename T,typename V,typename X> +//struct static_divide< dim<T,V>,X > +//{ +// typedef dim<T,typename static_divide<V,X>::type> type; +//}; +// +///// \brief Divide a @c value_type by a @c dim. +///// +///// \detailed +///// @c static_divide operations on dim are only defined between @c dim and @c value_type or +///// @c value_type and @c dim. Operation delegates to @c value_type, negating to account +///// for the resulting inverse unit tag. +//template<typename T,typename V,typename X> +//struct static_divide< X,dim<T,V> > +//{ +// typedef dim<T,typename static_negate<typename static_divide<X,V>::type>::type> type; +//}; + +} // namespace units + +namespace mpl { + +template<> +struct plus_impl<boost::units::detail::dim_tag,boost::units::detail::dim_tag> { - typedef dim<T,typename static_negate<V>::type> type; + template<class T0, class T1> + struct apply + { + BOOST_STATIC_ASSERT((boost::is_same<typename T0::tag_type,typename T1::tag_type>::value == true)); + typedef boost::units::dim<typename T0::tag_type, typename mpl::plus<typename T0::value_type, typename T1::value_type>::type> type; + }; }; -/// \brief Add two dims. -/// -/// \detailed -/// @c static_add operations on dim are only defined between dims having identical -/// @c tag_type. Operation delegates to @c value_type. -template<typename T,typename V1,typename V2> -struct static_add< dim<T,V1>,dim<T,V2> > +template<> +struct minus_impl<boost::units::detail::dim_tag,boost::units::detail::dim_tag> { - typedef dim<T,typename static_add<V1,V2>::type> type; + template<class T0, class T1> + struct apply + { + BOOST_STATIC_ASSERT((boost::is_same<typename T0::tag_type,typename T1::tag_type>::value == true)); + typedef boost::units::dim<typename T0::tag_type, typename mpl::minus<typename T0::value_type, typename T1::value_type>::type> type; + }; }; -/// \brief Subtract two dims. -/// -/// \detailed -/// @c static_subtract operations on dim are only defined between dims having identical -/// @c tag_type. Operation delegates to @c value_type. -template<typename T,typename V1,typename V2> -struct static_subtract< dim<T,V1>,dim<T,V2> > +template<> +struct times_impl<boost::units::detail::dim_tag,boost::units::detail::static_rational_tag> { - typedef dim<T,typename static_subtract<V1,V2>::type> type; + template<class T0, class T1> + struct apply + { + typedef boost::units::dim<typename T0::tag_type, typename mpl::times<typename T0::value_type, T1>::type> type; + }; }; -/// \brief Multiply a @c dim and a @c value_type. -/// -/// \detailed -/// @c static_multiply operations on @c dim are only defined between @c dim and -/// @c value_type or @c value_type and @c dim. Operation delegates to @c value_type. -template<typename T,typename V,typename X> -struct static_multiply< dim<T,V>,X > +template<> +struct times_impl<boost::units::detail::static_rational_tag,boost::units::detail::dim_tag> { - typedef dim<T,typename static_multiply<V,X>::type> type; + template<class T0, class T1> + struct apply + { + typedef boost::units::dim<typename T1::tag_type, typename mpl::times<T0, typename T1::value_type>::type> type; + }; }; -/// \brief Multipy a @c value_type and a @c dim. -/// -/// \detailed -/// @c static_multiply operations on @c dim are only defined between @c dim and -/// @c value_type or @c value_type and @c dim. Operation delegates to @c value_type. -template<typename T,typename V,typename X> -struct static_multiply< X,dim<T,V> > +template<> +struct divides_impl<boost::units::detail::dim_tag,boost::units::detail::static_rational_tag> { - typedef dim<T,typename static_multiply<X,V>::type> type; + template<class T0, class T1> + struct apply + { + typedef boost::units::dim<typename T0::tag_type, typename mpl::divides<typename T0::value_type, T1>::type> type; + }; }; -/// \brief Divide a @c dim by a @c value_type. -/// -/// \detailed -/// @c static_divide operations on dim are only defined between @c dim and @c value_type or -/// @c value_type and @c dim. Operation delegates to @c value_type. -template<typename T,typename V,typename X> -struct static_divide< dim<T,V>,X > +template<> +struct divides_impl<boost::units::detail::static_rational_tag,boost::units::detail::dim_tag> { - typedef dim<T,typename static_divide<V,X>::type> type; + template<class T0, class T1> + struct apply + { + typedef boost::units::dim<typename T1::tag_type, typename mpl::divides<T0, typename T1::value_type>::type> type; + }; }; -/// \brief Divide a @c value_type by a @c dim. -/// -/// \detailed -/// @c static_divide operations on dim are only defined between @c dim and @c value_type or -/// @c value_type and @c dim. Operation delegates to @c value_type, negating to account -/// for the resulting inverse unit tag. -template<typename T,typename V,typename X> -struct static_divide< X,dim<T,V> > +template<> +struct negate_impl<boost::units::detail::dim_tag> { - typedef dim<T,typename static_negate<typename static_divide<X,V>::type>::type> type; + template<class T0> + struct apply + { + typedef boost::units::dim<typename T0::tag_type,typename mpl::negate<typename T0::value_type>::type> type; + }; }; -} // namespace units +} // namespace mpl } // namespace boost |
|
From: Steven W. <ste...@us...> - 2007-04-12 00:39:21
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/detail In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15994/boost-sandbox/boost/units/detail Modified Files: system_impl.hpp conversion_impl.hpp dimension_impl.hpp dim_impl.hpp Log Message: Switched metafunctions to mpl Index: conversion_impl.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/detail/conversion_impl.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- conversion_impl.hpp 9 Apr 2007 18:35:01 -0000 1.5 +++ conversion_impl.hpp 12 Apr 2007 00:39:12 -0000 1.6 @@ -362,10 +362,14 @@ }; }; +struct heterogeneous_system_by_dimension_dim_tag {}; + // the hardest case: heterogeneous->heterogeneous template<class Tag, class Value> struct heterogeneous_system_by_dimension_dim { + typedef heterogeneous_system_by_dimension_dim type; + typedef heterogeneous_system_by_dimension_dim_tag tag; typedef Tag tag_type; typedef Value value_type; }; @@ -385,26 +389,56 @@ boost::mpl::true_ { }; -} +} // namespace detail -template<class T1, class V1, class V2> -struct static_add<detail::heterogeneous_system_by_dimension_dim<T1, V1>, detail::heterogeneous_system_by_dimension_dim<T1, V2> > +} // namespace units + +namespace mpl { + +template<> +struct plus_impl< + boost::units::detail::heterogeneous_system_by_dimension_dim_tag, + boost::units::detail::heterogeneous_system_by_dimension_dim_tag +> { - typedef detail::heterogeneous_system_by_dimension_dim<T1, typename detail::merge_dimensions<V1, V2>::type> type; + template<class T0, class T1> + struct apply { + BOOST_STATIC_ASSERT((boost::is_same<typename T0::tag_type, typename T1::tag_type>::value == true)); + typedef boost::units::detail::heterogeneous_system_by_dimension_dim< + typename T0::tag_type, + typename boost::units::detail::merge_dimensions< + typename T0::value_type, + typename T1::value_type + >::type + > type; + }; }; -template<class T1, class V1> -struct static_negate<detail::heterogeneous_system_by_dimension_dim<T1, V1> > +template<> +struct negate_impl<boost::units::detail::heterogeneous_system_by_dimension_dim_tag> { - typedef typename detail::static_inverse_impl<mpl::size<V1>::value>::template apply<typename mpl::begin<V1>::type>::type inverse; - typedef detail::heterogeneous_system_by_dimension_dim<T1, inverse> type; + template<class T0> + struct apply { + typedef typename boost::units::detail::static_inverse_impl<mpl::size<typename T0::value_type>::value>::template apply< + typename mpl::begin<typename T0::value_type>::type + >::type inverse; + typedef boost::units::detail::heterogeneous_system_by_dimension_dim<typename T0::tag_type, inverse> type; + }; }; +} // namespace mpl + +namespace units { + namespace detail { +struct heterogeneous_system_by_dimension_value_tag {}; + template<class SystemTag, class Value> struct heterogeneous_system_by_dimension_value { + typedef heterogeneous_system_by_dimension_value type; + typedef heterogeneous_system_by_dimension_value_tag tag; typedef SystemTag tag_type; typedef Value value_type; }; @@ -424,20 +458,41 @@ boost::mpl::true_ { }; -} +} // namespace detail -template<class T1, class V1, class V2> -struct static_add<detail::heterogeneous_system_by_dimension_value<T1, V1>, detail::heterogeneous_system_by_dimension_value<T1, V2> > +} // namespace units + +namespace mpl { + +template<> +struct plus_impl< + boost::units::detail::heterogeneous_system_by_dimension_value_tag, + boost::units::detail::heterogeneous_system_by_dimension_value_tag +> { - typedef detail::heterogeneous_system_by_dimension_value<T1, typename static_add<V1, V2>::type> type; + template<class T0, class T1> + struct apply { + BOOST_STATIC_ASSERT((boost::is_same<typename T0::tag_type, typename T1::tag_type>::value == true)); + typedef boost::units::detail::heterogeneous_system_by_dimension_value< + typename T0::tag_type, + typename plus<typename T0::value_type, typename T1::value_type>::type + > type; + }; }; -template<class T1, class V1> -struct static_negate<detail::heterogeneous_system_by_dimension_value<T1, V1> > +template<> +struct negate_impl<boost::units::detail::heterogeneous_system_by_dimension_value_tag> { - typedef detail::heterogeneous_system_by_dimension_value<T1, typename static_negate<V1>::type> type; + template<class T0> + struct apply { + typedef boost::units::detail::heterogeneous_system_by_dimension_value<typename T0::tag_type, typename negate<typename T0::value_type>::type> type; + }; }; +} // namespace mpl + +namespace units { + namespace detail { template<int N> Index: system_impl.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/detail/system_impl.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- system_impl.hpp 16 Mar 2007 18:12:44 -0000 1.1.1.1 +++ system_impl.hpp 12 Apr 2007 00:39:12 -0000 1.2 @@ -48,9 +48,17 @@ typedef Dimensions dimension_type; }; +namespace detail { + +struct heterogeneous_system_element_tag {}; + +} + template<class System, class Dimensions> struct heterogeneous_system_element { + typedef heterogeneous_system_element type; + typedef detail::heterogeneous_system_element_tag tag; typedef System tag_type; typedef Dimensions value_type; }; @@ -145,7 +153,7 @@ struct multiply_systems { typedef typename detail::merge_dimensions<typename S1::type, typename S2::type>::type type1; - typedef typename static_multiply<typename S1::dimension, typename S2::dimension>::type dimension; + typedef typename mpl::times<typename S1::dimension, typename S2::dimension>::type dimension; typedef typename make_system<mpl::size<type1>::value == 1>::template apply<type1,dimension>::type type; }; @@ -156,7 +164,7 @@ typedef typename detail::static_inverse_impl<mpl::size<s2>::value>::template apply<typename mpl::begin<s2>::type>::type inverse; typedef typename detail::merge_dimensions<typename S1::type, inverse>::type type1; - typedef typename static_divide<typename S1::dimension, typename S2::dimension>::type dimension; + typedef typename mpl::divides<typename S1::dimension, typename S2::dimension>::type dimension; typedef typename make_system<mpl::size<type1>::value == 1>::template apply<type1, dimension>::type type; }; Index: dim_impl.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/detail/dim_impl.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- dim_impl.hpp 16 Mar 2007 18:12:44 -0000 1.1.1.1 +++ dim_impl.hpp 12 Apr 2007 00:39:12 -0000 1.2 @@ -23,6 +23,12 @@ namespace units { +namespace detail { + +struct dim_tag {}; + +} + /// \brief Dimension tag/exponent pair for a single fundamental dimension. /// /// \detailed @@ -37,6 +43,8 @@ template<typename T,typename V> struct dim { + typedef dim type; + typedef detail::dim_tag tag; typedef T tag_type; typedef V value_type; }; Index: dimension_impl.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/detail/dimension_impl.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- dimension_impl.hpp 16 Mar 2007 18:12:44 -0000 1.1.1.1 +++ dimension_impl.hpp 12 Apr 2007 00:39:12 -0000 1.2 @@ -153,7 +153,7 @@ struct apply { typedef sort_dims_list< - typename static_add<T, typename Sequence::item>::type, + typename mpl::plus<T, typename Sequence::item>::type, typename Sequence::next > type; }; @@ -409,7 +409,7 @@ template<typename Begin1, typename Begin2, int N1, int N2> struct apply { - typedef typename static_add<typename boost::mpl::deref<Begin1>::type, typename boost::mpl::deref<Begin2>::type>::type combined; + typedef typename mpl::plus<typename boost::mpl::deref<Begin1>::type, typename boost::mpl::deref<Begin2>::type>::type combined; typedef typename push_front_if<!is_empty_dim<combined>::value>::template apply< typename merge_dimensions_impl<N1 - 1, N2 - 1>::template apply< typename boost::mpl::next<Begin1>::type, @@ -512,7 +512,7 @@ typename static_inverse_impl<N - 1>::template apply< typename boost::mpl::next<Begin>::type >::type, - typename static_negate<typename boost::mpl::deref<Begin>::type>::type + typename mpl::negate<typename boost::mpl::deref<Begin>::type>::type >::type type; }; }; @@ -535,7 +535,7 @@ { typedef typename mpl::push_front< typename detail::static_power_impl<N - 1>::template apply<typename mpl::next<Begin>::type, Ex>::type, - typename static_multiply<typename mpl::deref<Begin>::type, Ex>::type + typename mpl::times<typename mpl::deref<Begin>::type, Ex>::type >::type type; }; }; @@ -556,7 +556,7 @@ struct apply { typedef typename mpl::push_front< typename detail::static_root_impl<N - 1>::template apply<typename mpl::next<Begin>::type, Ex>::type, - typename static_divide<typename mpl::deref<Begin>::type, Ex>::type + typename mpl::divides<typename mpl::deref<Begin>::type, Ex>::type >::type type; }; }; |
|
From: Matthias S. <mat...@us...> - 2007-04-11 22:21:02
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27061 Modified Files: static_rational.hpp Log Message: add implicit conversion for equivalent reduced static_rationals Index: static_rational.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/static_rational.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- static_rational.hpp 5 Apr 2007 00:22:29 -0000 1.3 +++ static_rational.hpp 11 Apr 2007 22:21:01 -0000 1.4 @@ -15,8 +15,8 @@ #include <complex> #include <boost/math/common_factor_ct.hpp> - #include <boost/mpl/arithmetic.hpp> +#include <boost/type_traits/is_same.hpp> #include <boost/units/operators.hpp> @@ -88,6 +88,15 @@ static_rational() { } //~static_rational() { } + +// // static rationals are implicitly convertible if reduced types are the same +// template<integer_type NN,integer_type DD> +// operator static_rational<NN,DD>() +// { +// BOOST_STATIC_ASSERT((boost::is_same<type,typename static_rational<NN,DD>::type>::value == true)); +// +// return static_rational<NN,DD>(); +// } }; } |
|
From: Matthias S. <mat...@us...> - 2007-04-11 22:11:04
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22900 Modified Files: quantity.hpp Log Message: added some comments Index: quantity.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/quantity.hpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- quantity.hpp 11 Apr 2007 21:25:10 -0000 1.17 +++ quantity.hpp 11 Apr 2007 22:11:03 -0000 1.18 @@ -217,13 +217,17 @@ value_type value() const { return val_; } ///< constant accessor to value - // can add or subtract same quantity type - this_type& operator+=(const this_type& source) { val_ += source.val_; return *this; } ///< can add quantity of same type - this_type& operator-=(const this_type& source) { val_ -= source.val_; return *this; } ///< can subtract quantity of same type + ///< can add a quantity of the same type if add_typeof_helper<value_type,value_type>::type is convertible to value_type + this_type& operator+=(const this_type& source) { val_ += source.val_; return *this; } - // can multiply or divide by value_type - this_type& operator*=(const value_type& val) { val_ *= val; return *this; } ///< can multiply quantity by scalar - this_type& operator/=(const value_type& val) { val_ /= val; return *this; } ///< can divide quantity by scalar + ///< can subtract a quantity of the same type if subtract_typeof_helper<value_type,value_type>::type is convertible to value_type + this_type& operator-=(const this_type& source) { val_ -= source.val_; return *this; } + + ///< can multiply a quantity by a scalar value_type if multiply_typeof_helper<value_type,value_type>::type is convertible to value_type + this_type& operator*=(const value_type& val) { val_ *= val; return *this; } + + ///< can divide a quantity by a scalar value_type if divide_typeof_helper<value_type,value_type>::type is convertible to value_type + this_type& operator/=(const value_type& val) { val_ /= val; return *this; } /// Construct quantity directly from @c value_type. static this_type from_value(const value_type& val) { return this_type(val); } |
|
From: Matthias S. <mat...@us...> - 2007-04-11 21:25:11
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4655/systems Modified Files: physical_units.hpp Log Message: added BOOST_UNITS_REGISTER_BASE_DIMENSION macro Index: physical_units.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/physical_units.hpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- physical_units.hpp 10 Apr 2007 22:58:42 -0000 1.14 +++ physical_units.hpp 11 Apr 2007 21:25:10 -0000 1.15 @@ -28,32 +28,42 @@ namespace units { -/// tag representing length -typedef base_dimension<-9> length_dim; - -/// tag representing mass -typedef base_dimension<-8> mass_dim; - -/// tag representing time -typedef base_dimension<-7> time_dim; - -/// tag representing electrical current -typedef base_dimension<-6> current_dim; - -/// tag representing temperature -typedef base_dimension<-5> temperature_dim; - -/// tag representing amount of substance -typedef base_dimension<-4> amount_dim; - -/// tag representing luminous intensity -typedef base_dimension<-3> luminous_intensity_dim; - -/// tag representing plane angle -typedef base_dimension<-2> plane_angle_dim; +BOOST_UNITS_REGISTER_BASE_DIMENSION(length_dim,-9); ///> base dimension of length +BOOST_UNITS_REGISTER_BASE_DIMENSION(mass_dim,-8); ///> base dimension of mass +BOOST_UNITS_REGISTER_BASE_DIMENSION(time_dim,-7); ///> base dimension of time +BOOST_UNITS_REGISTER_BASE_DIMENSION(current_dim,-6); ///> base dimension of current +BOOST_UNITS_REGISTER_BASE_DIMENSION(temperature_dim,-5); ///> base dimension of temperature +BOOST_UNITS_REGISTER_BASE_DIMENSION(amount_dim,-4); ///> base dimension of amount +BOOST_UNITS_REGISTER_BASE_DIMENSION(luminous_intensity_dim,-3); ///> base dimension of luminous intensity +BOOST_UNITS_REGISTER_BASE_DIMENSION(plane_angle_dim,-2); ///> base dimension of plane angle +BOOST_UNITS_REGISTER_BASE_DIMENSION(solid_angle_dim,-1); ///> base dimension of solid angle -/// tag representing solid angle -typedef base_dimension<-1> solid_angle_dim; +///// tag representing length +//typedef base_dimension<-9> length_dim; +// +///// tag representing mass +//typedef base_dimension<-8> mass_dim; +// +///// tag representing time +//typedef base_dimension<-7> time_dim; +// +///// tag representing electrical current +//typedef base_dimension<-6> current_dim; +// +///// tag representing temperature +//typedef base_dimension<-5> temperature_dim; +// +///// tag representing amount of substance +//typedef base_dimension<-4> amount_dim; +// +///// tag representing luminous intensity +//typedef base_dimension<-3> luminous_intensity_dim; +// +///// tag representing plane angle +//typedef base_dimension<-2> plane_angle_dim; +// +///// tag representing solid angle +//typedef base_dimension<-1> solid_angle_dim; } |
|
From: Matthias S. <mat...@us...> - 2007-04-11 21:25:11
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4655 Modified Files: dimension.hpp quantity.hpp Log Message: added BOOST_UNITS_REGISTER_BASE_DIMENSION macro Index: dimension.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/dimension.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- dimension.hpp 4 Apr 2007 23:42:25 -0000 1.3 +++ dimension.hpp 11 Apr 2007 21:25:10 -0000 1.4 @@ -161,23 +161,22 @@ >::type type; }; -/// A utility class for defining fundamental dimensions. -//template<class DT> -//struct fundamental_dimension -//{ -// typedef typename make_dimension_list< boost::mpl::list< dim< DT,static_rational<1> > > >::type type; -//}; +/// A utility class for defining base dimensions. +template<long N> struct base_dimension; -/// replacement for fundamental_dimension -template<long N> -struct base_dimension : - public mpl::int_<N> -{ - typedef base_dimension<N> this_type; - typedef mpl::int_<N> value; - - typedef typename make_dimension_list< boost::mpl::list< dim< this_type,static_rational<1> > > >::type type; -}; +/// each specialization must be separately instantiated in boost::units namespace to prevent duplication of tag values +#define BOOST_UNITS_REGISTER_BASE_DIMENSION(name, N) \ +template<> \ +struct base_dimension<N> : \ + public mpl::int_<N> \ +{ \ + typedef base_dimension<N> this_type; \ + typedef mpl::int_<N> value; \ + \ + typedef make_dimension_list< mpl::list< dim< this_type,static_rational<1> > > >::type type; \ +}; \ + \ +typedef base_dimension<N> name; \ /// A utility class for defining composite dimensions with integer powers. template<class DT1 = dimensionless_type,int E1 = 0, Index: quantity.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/quantity.hpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- quantity.hpp 10 Apr 2007 22:57:24 -0000 1.16 +++ quantity.hpp 11 Apr 2007 21:25:10 -0000 1.17 @@ -70,7 +70,7 @@ return *this; } -#ifndef BOOST_NO_SFINAE + #ifndef BOOST_NO_SFINAE /// explicit conversion between different unit systems is allowed if implicit conversion is disallowed template<class System2,class Dim2,class YY> @@ -91,7 +91,7 @@ BOOST_STATIC_ASSERT((boost::is_convertible<YY,Y>::value == true)); } -#else + #else /// without SFINAE we can't distinguish between explicit and implicit conversions so /// the conversion is always explicit @@ -102,7 +102,7 @@ BOOST_STATIC_ASSERT((boost::is_convertible<YY,Y>::value == true)); } -#endif + #endif /// implicit assignment between different unit systems is allowed if each fundamental dimension is implicitly convertible template<class System2,class Dim2,class YY> @@ -121,14 +121,17 @@ const value_type& value() const { return val_; } ///< constant accessor to value - // need to check that add_typeof_helper<value_type,value_type>==value_type - this_type& operator+=(const this_type& source) { val_ += source.val_; return *this; } ///< can add quantity of same type + ///< can add a quantity of the same type if add_typeof_helper<value_type,value_type>::type is convertible to value_type + this_type& operator+=(const this_type& source) { val_ += source.val_; return *this; } - // need to check that subtract_typeof_helper<value_type,value_type>==value_type - this_type& operator-=(const this_type& source) { val_ -= source.val_; return *this; } ///< can subtract quantity of same type + ///< can subtract a quantity of the same type if subtract_typeof_helper<value_type,value_type>::type is convertible to value_type + this_type& operator-=(const this_type& source) { val_ -= source.val_; return *this; } - this_type& operator*=(const value_type& val) { val_ *= val; return *this; } ///< can multiply quantity by scalar - this_type& operator/=(const value_type& val) { val_ /= val; return *this; } ///< can divide quantity by scalar + ///< can multiply a quantity by a scalar value_type if multiply_typeof_helper<value_type,value_type>::type is convertible to value_type + this_type& operator*=(const value_type& val) { val_ *= val; return *this; } + + ///< can divide a quantity by a scalar value_type if divide_typeof_helper<value_type,value_type>::type is convertible to value_type + this_type& operator/=(const value_type& val) { val_ /= val; return *this; } /// Construct quantity directly from @c value_type (potentially dangerous). static this_type from_value(const value_type& val) { return this_type(val); } @@ -217,12 +220,10 @@ // can add or subtract same quantity type this_type& operator+=(const this_type& source) { val_ += source.val_; return *this; } ///< can add quantity of same type this_type& operator-=(const this_type& source) { val_ -= source.val_; return *this; } ///< can subtract quantity of same type - // consider adding *=,/= for dimensionless_type // can multiply or divide by value_type this_type& operator*=(const value_type& val) { val_ *= val; return *this; } ///< can multiply quantity by scalar this_type& operator/=(const value_type& val) { val_ /= val; return *this; } ///< can divide quantity by scalar - // consider adding +=,-= for dimensionless_type /// Construct quantity directly from @c value_type. static this_type from_value(const value_type& val) { return this_type(val); } |
|
From: Matthias S. <mat...@us...> - 2007-04-11 21:24:09
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4146/example Modified Files: test_system.hpp unit_example_15.cpp unit_example_22.cpp Log Message: added BOOST_UNITS_REGISTER_BASE_DIMENSION macro Index: unit_example_15.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_15.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- unit_example_15.cpp 5 Apr 2007 21:09:34 -0000 1.4 +++ unit_example_15.cpp 11 Apr 2007 21:24:04 -0000 1.5 @@ -34,10 +34,14 @@ namespace units { -namespace wo { +// fails due to redefinition of tag +//BOOST_UNITS_REGISTER_BASE_DIMENSION(erroneous_tag,-1); +BOOST_UNITS_REGISTER_BASE_DIMENSION(world_space_tag,101); +BOOST_UNITS_REGISTER_BASE_DIMENSION(object_space_tag,102); +//typedef base_dimension<101> world_space_tag; +//typedef base_dimension<102> object_space_tag; -typedef base_dimension<101> world_space_tag; -typedef base_dimension<102> object_space_tag; +namespace wo { typedef world_space_tag::type world_space_type; typedef object_space_tag::type object_space_type; Index: unit_example_22.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_22.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- unit_example_22.cpp 10 Apr 2007 23:13:05 -0000 1.14 +++ unit_example_22.cpp 11 Apr 2007 21:24:04 -0000 1.15 @@ -413,7 +413,6 @@ return 0; } */ - #include <iostream> #include <boost/units/io.hpp> @@ -429,6 +428,11 @@ #include <boost/units/systems/other/non_si_units.hpp> +struct blah { }; +struct blahblah { }; + +blahblah operator+(const blah&) { return blahblah(); } + int main() { using namespace boost; @@ -443,6 +447,10 @@ std::cout << conversion_factor<double>(SI::momentum()/SI::mass(),CGS::momentum()/CGS::mass()) << std::endl; std::cout << conversion_factor<double>(CGS::gal,SI::meter_per_second_squared) << std::endl; + blah b; + + std::cout << typeid(+b).name() << std::cout; + return 0; } Index: test_system.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/test_system.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- test_system.hpp 10 Apr 2007 23:13:05 -0000 1.4 +++ test_system.hpp 11 Apr 2007 21:24:04 -0000 1.5 @@ -23,9 +23,12 @@ namespace units { //[test_system_snippet_1 -typedef base_dimension<1> length_dim; -typedef base_dimension<2> mass_dim; -typedef base_dimension<3> time_dim; +BOOST_UNITS_REGISTER_BASE_DIMENSION(length_dim,1); ///> base dimension of length +BOOST_UNITS_REGISTER_BASE_DIMENSION(mass_dim,2); ///> base dimension of mass +BOOST_UNITS_REGISTER_BASE_DIMENSION(time_dim,3); ///> base dimension of time +//typedef base_dimension<1> length_dim; +//typedef base_dimension<2> mass_dim; +//typedef base_dimension<3> time_dim; //] #if 0 |
|
From: John M. <joh...@us...> - 2007-04-11 11:44:48
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22857/libs/math_functions/test Modified Files: Tag: math_toolkit test_bessel_j.cpp test_bessel_y.cpp test_beta.cpp test_gamma.cpp test_ibeta.cpp test_igamma.cpp test_igamma_inv.cpp test_legendre.cpp test_lognormal.cpp test_tgamma_ratio.cpp Log Message: Adjusted Mac OS error levels. Fixed up pareto failures. Added some debugging code to track remaining Mac OS failures. Index: test_beta.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/test_beta.cpp,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -d -r1.1.2.6 -r1.1.2.7 --- test_beta.cpp 2 Sep 2006 15:05:43 -0000 1.1.2.6 +++ test_beta.cpp 11 Apr 2007 11:44:42 -0000 1.1.2.7 @@ -47,6 +47,17 @@ // Define the max and mean errors expected for // various compilers and platforms. // + + // Darwin: + add_expected_result( + ".*", // compiler + ".*", // stdlib + "Mac OS.*", // platform + "(long\\s+)?double", // test type(s) + "Beta Function: Medium.*", // test data group + "boost::math::beta", 200, 35); // test function + + add_expected_result( ".*", // compiler ".*", // stdlib Index: test_legendre.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/Attic/test_legendre.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- test_legendre.cpp 4 Jan 2007 16:20:49 -0000 1.1.2.2 +++ test_legendre.cpp 11 Apr 2007 11:44:43 -0000 1.1.2.3 @@ -119,7 +119,7 @@ ".*", // platform largest_type, // test type(s) "Legendre Polynomials.*Large.*", // test data group - "boost::math::legendre_q", 5000, 500); // test function + "boost::math::legendre_q", 5400, 500); // test function add_expected_result( ".*", // compiler ".*", // stdlib @@ -155,7 +155,7 @@ ".*", // platform "real_concept", // test type(s) "Legendre Polynomials.*Large.*", // test data group - "boost::math::legendre_q", 5000, 500); // test function + "boost::math::legendre_q", 5400, 500); // test function add_expected_result( ".*", // compiler ".*", // stdlib Index: test_igamma_inv.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/Attic/test_igamma_inv.cpp,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -d -r1.1.2.6 -r1.1.2.7 --- test_igamma_inv.cpp 23 Dec 2006 17:28:30 -0000 1.1.2.6 +++ test_igamma_inv.cpp 11 Apr 2007 11:44:43 -0000 1.1.2.7 @@ -127,7 +127,7 @@ "[^|]*", // platform largest_type, // test type(s) "[^|]*small[^|]*", // test data group - "[^|]*", 2000, 500); // test function + "[^|]*", 2100, 500); // test function add_expected_result( "[^|]*", // compiler "[^|]*", // stdlib Index: test_bessel_j.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/Attic/test_bessel_j.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- test_bessel_j.cpp 29 Jan 2007 11:35:10 -0000 1.1.2.2 +++ test_bessel_j.cpp 11 Apr 2007 11:44:42 -0000 1.1.2.3 @@ -91,6 +91,35 @@ ".*", 3000, 500); // test function // + // Mac OS X: + // + add_expected_result( + ".*", // compiler + ".*", // stdlib + "Mac OS", // platform + largest_type, // test type(s) + "Bessel JN.*", // test data group + ".*", 40000, 20000); // test function + add_expected_result( + ".*", // compiler + ".*", // stdlib + "Mac OS", // platform + largest_type, // test type(s) + "Bessel J:.*", // test data group + ".*", 50000, 20000); // test function + + // This shouldn't be required, could be limited test data precision + // i.e. not enough bits in double input to get double result. + add_expected_result( + ".*", // compiler + ".*", // stdlib + "Mac OS", // platform + "double", // test type(s) + ".*Tricky.*", // test data group + ".*", 100000, 100000); // test function + + + // // Linux specific results: // // sin and cos appear to have only double precision for large Index: test_gamma.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/test_gamma.cpp,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -d -r1.1.2.8 -r1.1.2.9 --- test_gamma.cpp 19 Nov 2006 18:29:05 -0000 1.1.2.8 +++ test_gamma.cpp 11 Apr 2007 11:44:42 -0000 1.1.2.9 @@ -62,6 +62,18 @@ largest_type = "(long\\s+)?double"; #endif // + // G++ on Darwin: results are just slightly worse than we might hope for + // but still pretty good: + // + add_expected_result( + ".*", // compiler + ".*", // stdlib + "Mac OS", // platform + largest_type, // test type(s) + "factorials", // test data group + "boost::math::tgamma", 100, 15); // test function + + // // G++ on Linux, result vary a bit by processor type, // on Itanium results are *much* better than listed here, // but x86 appears to have much less accurate std::pow @@ -228,7 +240,7 @@ ".*", // platform "real_concept", // test type(s) "near.*", // test data group - "boost::math::tgamma", 50, 30); // test function + "boost::math::tgamma", 60, 30); // test function add_expected_result( ".*", // compiler ".*", // stdlib Index: test_bessel_y.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/Attic/test_bessel_y.cpp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -d -r1.1.2.3 -r1.1.2.4 --- test_bessel_y.cpp 6 Feb 2007 13:32:59 -0000 1.1.2.3 +++ test_bessel_y.cpp 11 Apr 2007 11:44:42 -0000 1.1.2.4 @@ -59,7 +59,7 @@ #endif // - // HP-uX rates are very slightly higher: + // HP-UX rates are very slightly higher: // add_expected_result( ".*", // compiler @@ -77,6 +77,24 @@ ".*", 400, 200); // test function // + // Mac OS X rates are very slightly higher: + // + add_expected_result( + ".*", // compiler + ".*", // stdlib + "Mac OS", // platform + largest_type, // test type(s) + ".*(Y[nv1]).*", // test data group + ".*", 600000, 100000); // test function + add_expected_result( + ".*", // compiler + ".*", // stdlib + "Mac OS", // platform + largest_type, // test type(s) + ".*Y[0].*", // test data group + ".*", 500, 200); // test function + + // // Linux: // add_expected_result( Index: test_lognormal.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/Attic/test_lognormal.cpp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -d -r1.1.2.4 -r1.1.2.5 --- test_lognormal.cpp 16 Mar 2007 15:16:00 -0000 1.1.2.4 +++ test_lognormal.cpp 11 Apr 2007 11:44:43 -0000 1.1.2.5 @@ -277,9 +277,9 @@ // Test range and support using double only, // because it supports numeric_limits max for a pseudo-infinity. BOOST_CHECK_EQUAL(range(myf2).first, 0); // range 0 to +infinity - BOOST_CHECK_EQUAL(range(myf2).second, numeric_limits<double>::max()); + BOOST_CHECK_EQUAL(range(myf2).second, (std::numeric_limits<double>::max)()); BOOST_CHECK_EQUAL(support(myf2).first, 0); // support 0 to + infinity. - BOOST_CHECK_EQUAL(support(myf2).second, numeric_limits<double>::max()); + BOOST_CHECK_EQUAL(support(myf2).second, (std::numeric_limits<double>::max)()); // Basic sanity-check spot values. Index: test_ibeta.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/test_ibeta.cpp,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -u -d -r1.1.2.13 -r1.1.2.14 --- test_ibeta.cpp 4 Jan 2007 16:20:49 -0000 1.1.2.13 +++ test_ibeta.cpp 11 Apr 2007 11:44:42 -0000 1.1.2.14 @@ -62,6 +62,17 @@ largest_type = "(long\\s+)?double"; #endif // + // Darwin: just one special case for real_concept: + // + add_expected_result( + "[^|]*", // compiler + "[^|]*", // stdlib + "Mac OS", // platform + "real_concept", // test type(s) + "(?i).*large.*", // test data group + ".*", 400000, 50000); // test function + + // // Linux - results depend quite a bit on the // processor type, and how good the std::pow // function is for that processor. @@ -143,7 +154,7 @@ "[^|]*", // platform largest_type, // test type(s) "(?i).*small.*", // test data group - ".*", 40, 10); // test function + ".*", 60, 10); // test function add_expected_result( "[^|]*", // compiler "[^|]*", // stdlib @@ -165,7 +176,7 @@ "[^|]*", // platform "real_concept", // test type(s) "(?i).*small.*", // test data group - ".*", 40, 15); // test function + ".*", 60, 15); // test function add_expected_result( "[^|]*", // compiler "[^|]*", // stdlib Index: test_igamma.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/Attic/test_igamma.cpp,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -d -r1.1.2.7 -r1.1.2.8 --- test_igamma.cpp 23 Dec 2006 17:28:30 -0000 1.1.2.7 +++ test_igamma.cpp 11 Apr 2007 11:44:43 -0000 1.1.2.8 @@ -118,6 +118,17 @@ "[^|]*", 500, 100); // test function // + // Mac OS X: + // + add_expected_result( + "[^|]*", // compiler + "[^|]*", // stdlib + "Mac OS", // platform + largest_type, // test type(s) + "[^|]*medium[^|]*", // test data group + "[^|]*", 100, 50); // test function + + // // Large exponent range causes more extreme test cases to be evaluated: // if(std::numeric_limits<long double>::max_exponent > std::numeric_limits<double>::max_exponent) @@ -169,7 +180,7 @@ "[^|]*", // platform largest_type, // test type(s) "[^|]*large[^|]*", // test data group - "boost::math::gamma_p", 300, 50); // test function + "boost::math::gamma_p", 350, 50); // test function add_expected_result( "[^|]*", // compiler "[^|]*", // stdlib Index: test_tgamma_ratio.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/math_functions/test/Attic/test_tgamma_ratio.cpp,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -d -r1.1.2.7 -r1.1.2.8 --- test_tgamma_ratio.cpp 4 Jan 2007 16:20:49 -0000 1.1.2.7 +++ test_tgamma_ratio.cpp 11 Apr 2007 11:44:43 -0000 1.1.2.8 @@ -56,14 +56,15 @@ #endif // // HP-UX - // This is a weird one, HP-UX shows up errors at float + // This is a weird one, HP-UX and Mac OS X show up errors at float // precision, that don't show up on other platforms. - // There appears to be some kind of rounding issue going on: + // There appears to be some kind of rounding issue going on (not enough + // precision in the input to get the answer right): // add_expected_result( "[^|]*", // compiler "[^|]*", // stdlib - "HP-UX|linux|.*(bsd|BSD).*", // platform + "HP-UX|Mac OS|linux|.*(bsd|BSD).*", // platform "float", // test type(s) "[^|]*", // test data group "boost::math::tgamma_ratio[^|]*", 35, 8); // test function |
|
From: John M. <joh...@us...> - 2007-04-11 11:44:46
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/math/special_functions/detail In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22857/boost/math/special_functions/detail Modified Files: Tag: math_toolkit ibeta_inv_ab.hpp Log Message: Adjusted Mac OS error levels. Fixed up pareto failures. Added some debugging code to track remaining Mac OS failures. Index: ibeta_inv_ab.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/math/special_functions/detail/Attic/ibeta_inv_ab.hpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- ibeta_inv_ab.hpp 20 Aug 2006 09:28:25 -0000 1.1.2.2 +++ ibeta_inv_ab.hpp 11 Apr 2007 11:44:41 -0000 1.1.2.3 @@ -40,6 +40,7 @@ // // Special cases first: // + BOOST_MATH_INSTRUMENT_CODE("b = " << b << " z = " << z << " p = " << p << " q = " << " swap = " << swap_ab); if(p == 0) { return swap_ab ? tools::min_value<T>() : tools::max_value<T>(); @@ -73,6 +74,7 @@ { guess = b / 2; } + BOOST_MATH_INSTRUMENT_CODE("guess = " << guess); // // Max iterations permitted: // |
|
From: John M. <joh...@us...> - 2007-04-11 11:44:43
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/math/tools In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22857/boost/math/tools Modified Files: Tag: math_toolkit config.hpp precision.hpp test.hpp toms748_solve.hpp Log Message: Adjusted Mac OS error levels. Fixed up pareto failures. Added some debugging code to track remaining Mac OS failures. Index: config.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/math/tools/Attic/config.hpp,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -d -r1.1.2.6 -r1.1.2.7 --- config.hpp 3 Jan 2007 19:05:10 -0000 1.1.2.6 +++ config.hpp 11 Apr 2007 11:44:42 -0000 1.1.2.7 @@ -67,4 +67,11 @@ #define BOOST_FPU_EXCEPTION_GUARD #endif +#ifdef BOOST_MATH_INSTRUMENT +#define BOOST_MATH_INSTRUMENT_CODE(x) \ + std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl; +#else +#define BOOST_MATH_INSTRUMENT_CODE(x) +#endif + #endif // BOOST_MATH_TOOLS_CONFIG_HPP Index: precision.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/math/tools/Attic/precision.hpp,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -u -d -r1.1.2.11 -r1.1.2.12 --- precision.hpp 28 Mar 2007 11:46:08 -0000 1.1.2.11 +++ precision.hpp 11 Apr 2007 11:44:42 -0000 1.1.2.12 @@ -151,8 +151,10 @@ template <> inline long double epsilon<long double>(const mpl::true_& BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(long double)) { - // numeric_limits on Darwin tells lies here: - BOOST_STATIC_ASSERT(std::numeric_limits<long double>::digits == 106); + // numeric_limits on Darwin tells lies here. + // This static assert fails for some unknown reason, so + // disabled for now... + // BOOST_STATIC_ASSERT(std::numeric_limits<long double>::digits == 106); return 2.4651903288156618919116517665087e-32L; } #endif Index: toms748_solve.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/math/tools/Attic/toms748_solve.hpp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -d -r1.1.2.4 -r1.1.2.5 --- toms748_solve.hpp 16 Sep 2006 16:41:17 -0000 1.1.2.4 +++ toms748_solve.hpp 11 Apr 2007 11:44:42 -0000 1.1.2.5 @@ -8,6 +8,7 @@ #include <boost/math/tools/precision.hpp> #include <boost/math/tools/error_handling.hpp> +#include <boost/math/tools/config.hpp> #include <boost/math/special_functions/sign.hpp> #include <boost/cstdint.hpp> #include <limits> @@ -289,6 +290,7 @@ c = detail::secant_interpolate(a, b, fa, fb); detail::bracket(f, a, b, c, fa, fb, d, fd); --count; + BOOST_MATH_INSTRUMENT_CODE(" a = " << a << " b = " << b); if(count && (fa != 0)) { @@ -300,6 +302,7 @@ fe = fd; detail::bracket(f, a, b, c, fa, fb, d, fd); --count; + BOOST_MATH_INSTRUMENT_CODE(" a = " << a << " b = " << b); } } @@ -320,6 +323,7 @@ if(prof) { c = detail::quadratic_interpolate(a, b, d, fa, fb, fd, 2); + BOOST_MATH_INSTRUMENT_CODE("Can't take cubic step!!!!"); } else { @@ -333,6 +337,7 @@ detail::bracket(f, a, b, c, fa, fb, d, fd); if((0 == --count) || (fa == 0) || tol(a, b)) break; + BOOST_MATH_INSTRUMENT_CODE(" a = " << a << " b = " << b); // // Now another interpolated step: // @@ -340,6 +345,7 @@ if(prof) { c = detail::quadratic_interpolate(a, b, d, fa, fb, fd, 3); + BOOST_MATH_INSTRUMENT_CODE("Can't take cubic step!!!!"); } else { @@ -351,6 +357,7 @@ detail::bracket(f, a, b, c, fa, fb, d, fd); if((0 == --count) || (fa == 0) || tol(a, b)) break; + BOOST_MATH_INSTRUMENT_CODE(" a = " << a << " b = " << b); // // Now we take a double-length secant step: // @@ -377,6 +384,7 @@ detail::bracket(f, a, b, c, fa, fb, d, fd); if((0 == --count) || (fa == 0) || tol(a, b)) break; + BOOST_MATH_INSTRUMENT_CODE(" a = " << a << " b = " << b); // // And finally... check to see if an additional bisection step is // to be taken, we do this if we're not converging fast enough: @@ -390,6 +398,8 @@ fe = fd; detail::bracket(f, a, b, a + (b - a) / 2, fa, fb, d, fd); --count; + BOOST_MATH_INSTRUMENT_CODE("Not converging: Taking a bisection!!!!"); + BOOST_MATH_INSTRUMENT_CODE(" a = " << a << " b = " << b); } // while loop max_iter -= count; @@ -443,6 +453,7 @@ b *= factor; fb = f(b); --count; + BOOST_MATH_INSTRUMENT_CODE("a = " << a << " b = " << b << " fa = " << fa << " fb = " << fb << " count = " << count); } } else @@ -460,12 +471,14 @@ a /= factor; fa = f(a); --count; + BOOST_MATH_INSTRUMENT_CODE("a = " << a << " b = " << b << " fa = " << fa << " fb = " << fb << " count = " << count); } } max_iter -= count; max_iter += 1; std::pair<T, T> r = toms748_solve(f, a, b, fa, fb, tol, count); max_iter += count; + BOOST_MATH_INSTRUMENT_CODE("max_iter = " << max_iter << " count = " << count); return r; } Index: test.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/math/tools/Attic/test.hpp,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -d -r1.1.2.7 -r1.1.2.8 --- test.hpp 19 Jan 2007 17:05:19 -0000 1.1.2.7 +++ test.hpp 11 Apr 2007 11:44:42 -0000 1.1.2.8 @@ -101,6 +101,51 @@ return (std::max)(fabs((a-b)/a), fabs((a-b)/b)); } +#if defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) +template <> +inline double relative_error<double>(double a, double b) +{ + using namespace std; + // + // On Mac OS X we evaluate "double" functions at "long double" precision, + // but "long double" actually has a very slightly narrower range than "double"! + // Therefore use the range of "long double" as our limits since results outside + // that range may have been truncated to 0 or INF: + // + double min_val = (std::max)((double)tools::min_value<long double>(), tools::min_value<double>()); + double max_val = (std::min)((double)tools::max_value<long double>(), tools::max_value<double>()); + + if((a != 0) && (b != 0)) + { + // TODO: use isfinite: + if(b > max_val) + { + if(a > max_val) + return 0; // one infinity is as good as another! + } + // If the result is denormalised, treat all denorms as equivalent: + if((a < min_val) && (a > 0)) + a = min_val; + else if((a > -min_val) && (a < 0)) + a = -min_val; + if((b < min_val) && (b > 0)) + b = min_val; + else if((b > -min_val) && (b < 0)) + b = -min_val; + return (std::max)(fabs((a-b)/a), fabs((a-b)/b)); + } + + // Handle special case where one or both are zero: + if(min_val == 0) + return fabs(a-b); + if(fabs(a) < min_val) + a = min_val; + if(fabs(b) < min_val) + b = min_val; + return (std::max)(fabs((a-b)/a), fabs((a-b)/b)); +} +#endif + template <class Seq> void print_row(const Seq& row) { |
|
From: John M. <joh...@us...> - 2007-04-11 11:44:43
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/math/special_functions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22857/boost/math/special_functions Modified Files: Tag: math_toolkit ellint_1.hpp ellint_rf.hpp Log Message: Adjusted Mac OS error levels. Fixed up pareto failures. Added some debugging code to track remaining Mac OS failures. Index: ellint_rf.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/math/special_functions/Attic/ellint_rf.hpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- ellint_rf.hpp 5 Feb 2007 10:34:44 -0000 1.1.2.2 +++ ellint_rf.hpp 11 Apr 2007 11:44:42 -0000 1.1.2.3 @@ -54,10 +54,12 @@ if(tools::digits<T>() > 64) { tolerance = pow(tools::epsilon<T>(), T(1)/4.25f); + BOOST_MATH_INSTRUMENT_CODE(tolerance); } else { tolerance = pow(4*tools::epsilon<T>(), T(1)/6); + BOOST_MATH_INSTRUMENT_CODE(tolerance); } // duplication @@ -82,11 +84,13 @@ } // Check to see if we gave up too soon: tools::check_series_iterations(BOOST_CURRENT_FUNCTION, k); + BOOST_MATH_INSTRUMENT_CODE(k); // Taylor series expansion to the 5th order E2 = X * Y - Z * Z; E3 = X * Y * Z; value = (1 + E2*(E2/24 - E3*T(3)/44 - T(0.1)) + E3/14) / sqrt(u); + BOOST_MATH_INSTRUMENT_CODE(value); return value; } Index: ellint_1.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/math/special_functions/Attic/ellint_1.hpp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -d -r1.1.2.4 -r1.1.2.5 --- ellint_1.hpp 5 Feb 2007 10:34:43 -0000 1.1.2.4 +++ ellint_1.hpp 11 Apr 2007 11:44:41 -0000 1.1.2.5 @@ -43,6 +43,7 @@ bool invert = false; if(phi < 0) { + BOOST_MATH_INSTRUMENT_CODE(phi); phi = fabs(phi); invert = true; } @@ -53,12 +54,14 @@ { // Need to handle infinity as a special case: result = tools::overflow_error<T>(BOOST_CURRENT_FUNCTION); + BOOST_MATH_INSTRUMENT_CODE(result); } else if(phi > 1 / tools::epsilon<T>()) { // Phi is so large that phi%pi is necessarily zero (or garbage), // just return the second part of the duplication formula: result = 2 * phi * ellint_k_imp(k) / constants::pi<T>(); + BOOST_MATH_INSTRUMENT_CODE(result); } else { @@ -70,19 +73,26 @@ // so rewritten to use fmod instead: // T rphi = fmod(phi, constants::pi<T>() / 2); + BOOST_MATH_INSTRUMENT_CODE(rphi); T m = 2 * (phi - rphi) / constants::pi<T>(); + BOOST_MATH_INSTRUMENT_CODE(m); int s = 1; if(fmod(m, T(2)) > 0.5) { m += 1; s = -1; rphi = constants::pi<T>() / 2 - rphi; + BOOST_MATH_INSTRUMENT_CODE(rphi); } T sinp = sin(rphi); T cosp = cos(rphi); result = s * sinp * ellint_rf_imp(cosp * cosp, 1 - k * k * sinp * sinp, T(1)); + BOOST_MATH_INSTRUMENT_CODE(result); if(m != 0) + { result += m * ellint_k_imp(k); + BOOST_MATH_INSTRUMENT_CODE(result); + } } return invert ? -result : result; } |
|
From: John M. <joh...@us...> - 2007-04-11 11:44:43
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/math/distributions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22857/boost/math/distributions Modified Files: Tag: math_toolkit pareto.hpp Log Message: Adjusted Mac OS error levels. Fixed up pareto failures. Added some debugging code to track remaining Mac OS failures. Index: pareto.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/math/distributions/Attic/pareto.hpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- pareto.hpp 20 Mar 2007 19:18:06 -0000 1.1.2.2 +++ pareto.hpp 11 Apr 2007 11:44:41 -0000 1.1.2.3 @@ -308,6 +308,7 @@ template <class RealType> inline RealType median(const pareto_distribution<RealType>& dist) { + using namespace std; return dist.location() * pow(2, (1/dist.shape())); } // median @@ -334,6 +335,7 @@ template <class RealType> inline RealType skewness(const pareto_distribution<RealType>& dist) { + using namespace std; RealType result; RealType shape = dist.shape(); if (shape > 3) |
|
From: Matthias S. <mat...@us...> - 2007-04-10 23:13:06
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16800/test Modified Files: test_header.hpp test_implicit_conversion.cpp Log Message: change base dimension syntax Index: test_header.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/test/test_header.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- test_header.hpp 4 Apr 2007 20:06:57 -0000 1.4 +++ test_header.hpp 10 Apr 2007 23:13:05 -0000 1.5 @@ -36,24 +36,24 @@ namespace units { -typedef base_dimension<1> length_tag; -typedef base_dimension<2> mass_tag; -typedef base_dimension<3> time_tag; +typedef base_dimension<1> length_dim; +typedef base_dimension<2> mass_dim; +typedef base_dimension<3> time_dim; -typedef length_tag::type length_type; -typedef mass_tag::type mass_type; -typedef time_tag::type time_type; +typedef length_dim::type length_type; +typedef mass_dim::type mass_type; +typedef time_dim::type time_type; -typedef derived_dimension<length_tag,2>::type area_type; -typedef derived_dimension<mass_tag,1, - length_tag,2, - time_tag,-2>::type energy_type; -typedef derived_dimension<mass_tag,-1, - length_tag,-2, - time_tag,2>::type inverse_energy_type; -typedef derived_dimension<length_tag,1, - time_tag,-1>::type velocity_type; -typedef derived_dimension<length_tag,3>::type volume_type; +typedef derived_dimension<length_dim,2>::type area_type; +typedef derived_dimension<mass_dim,1, + length_dim,2, + time_dim,-2>::type energy_type; +typedef derived_dimension<mass_dim,-1, + length_dim,-2, + time_dim,2>::type inverse_energy_type; +typedef derived_dimension<length_dim,1, + time_dim,-1>::type velocity_type; +typedef derived_dimension<length_dim,3>::type volume_type; /// placeholder class defining test unit system struct system_tag : public ordinal<101> { }; @@ -90,20 +90,20 @@ BOOST_UNITS_STATIC_CONSTANT(cubic_meter,volume); BOOST_UNITS_STATIC_CONSTANT(cubic_meters,volume); -template<> struct base_unit_info<length_tag,system_tag> +template<> struct base_unit_info<length_dim,system_tag> { static std::string name() { return "meter"; } static std::string symbol() { return "m"; } }; //] -template<> struct base_unit_info<mass_tag,system_tag> +template<> struct base_unit_info<mass_dim,system_tag> { static std::string name() { return "kilogram"; } static std::string symbol() { return "kg"; } }; -template<> struct base_unit_info<time_tag,system_tag> +template<> struct base_unit_info<time_dim,system_tag> { static std::string name() { return "second"; } static std::string symbol() { return "s"; } Index: test_implicit_conversion.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/test/test_implicit_conversion.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test_implicit_conversion.cpp 4 Apr 2007 23:50:22 -0000 1.3 +++ test_implicit_conversion.cpp 10 Apr 2007 23:13:05 -0000 1.4 @@ -35,31 +35,31 @@ int test_main(int,char *[]) { // SI->SI always true - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::length_tag,bu::SI::system_tag,bu::SI::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::mass_tag,bu::SI::system_tag,bu::SI::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::time_tag,bu::SI::system_tag,bu::SI::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::current_tag,bu::SI::system_tag,bu::SI::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::temperature_tag,bu::SI::system_tag,bu::SI::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::amount_tag,bu::SI::system_tag,bu::SI::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::luminous_intensity_tag,bu::SI::system_tag,bu::SI::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::plane_angle_tag,bu::SI::system_tag,bu::SI::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::solid_angle_tag,bu::SI::system_tag,bu::SI::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::length_dim,bu::SI::system_tag,bu::SI::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::mass_dim,bu::SI::system_tag,bu::SI::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::time_dim,bu::SI::system_tag,bu::SI::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::current_dim,bu::SI::system_tag,bu::SI::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::temperature_dim,bu::SI::system_tag,bu::SI::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::amount_dim,bu::SI::system_tag,bu::SI::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::luminous_intensity_dim,bu::SI::system_tag,bu::SI::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::plane_angle_dim,bu::SI::system_tag,bu::SI::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::solid_angle_dim,bu::SI::system_tag,bu::SI::system_tag>::value == true)); // CGS->CGS always true - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::length_tag,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::mass_tag,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::time_tag,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::current_tag,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::temperature_tag,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::amount_tag,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::luminous_intensity_tag,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::plane_angle_tag,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::solid_angle_tag,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::length_dim,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::mass_dim,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::time_dim,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::current_dim,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::temperature_dim,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::amount_dim,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::luminous_intensity_dim,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::plane_angle_dim,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::solid_angle_dim,bu::CGS::system_tag,bu::CGS::system_tag>::value == true)); // SI->CGS - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::length_tag,bu::SI::system_tag,bu::CGS::system_tag>::value == false)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::mass_tag,bu::SI::system_tag,bu::CGS::system_tag>::value == false)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::time_tag,bu::SI::system_tag,bu::CGS::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::length_dim,bu::SI::system_tag,bu::CGS::system_tag>::value == false)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::mass_dim,bu::SI::system_tag,bu::CGS::system_tag>::value == false)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::time_dim,bu::SI::system_tag,bu::CGS::system_tag>::value == true)); BOOST_CHECK((bu::is_implicitly_convertible<bu::SI::length,bu::CGS::length>::value == false)); BOOST_CHECK((bu::is_implicitly_convertible<bu::SI::mass,bu::CGS::mass>::value == false)); @@ -78,9 +78,9 @@ BOOST_CHECK((bu::is_implicitly_convertible<bu::SI::wavenumber,bu::CGS::wavenumber>::value == false)); // CGS->SI - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::length_tag,bu::CGS::system_tag,bu::SI::system_tag>::value == false)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::mass_tag,bu::CGS::system_tag,bu::SI::system_tag>::value == false)); - BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::time_tag,bu::CGS::system_tag,bu::SI::system_tag>::value == true)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::length_dim,bu::CGS::system_tag,bu::SI::system_tag>::value == false)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::mass_dim,bu::CGS::system_tag,bu::SI::system_tag>::value == false)); + BOOST_CHECK((bu::base_unit_is_implicitly_convertible<bu::time_dim,bu::CGS::system_tag,bu::SI::system_tag>::value == true)); BOOST_CHECK((bu::is_implicitly_convertible<bu::CGS::length,bu::SI::length>::value == false)); BOOST_CHECK((bu::is_implicitly_convertible<bu::CGS::mass,bu::SI::mass>::value == false)); |
|
From: Matthias S. <mat...@us...> - 2007-04-10 23:13:06
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16800/example Modified Files: test_system.hpp unit_example_1.cpp unit_example_16.cpp unit_example_20.cpp unit_example_22.cpp Log Message: change base dimension syntax Index: unit_example_20.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_20.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- unit_example_20.cpp 4 Apr 2007 20:06:57 -0000 1.6 +++ unit_example_20.cpp 10 Apr 2007 23:13:05 -0000 1.7 @@ -63,7 +63,7 @@ } // fahrenheit -template<> struct base_unit_info<temperature_tag,fahrenheit::system_tag> +template<> struct base_unit_info<temperature_dim,fahrenheit::system_tag> { static std::string name() { return "Fahrenheit"; } static std::string symbol() { return "F"; } @@ -189,3 +189,4 @@ return(-1); } } + Index: unit_example_22.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_22.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- unit_example_22.cpp 5 Apr 2007 21:56:15 -0000 1.13 +++ unit_example_22.cpp 10 Apr 2007 23:13:05 -0000 1.14 @@ -203,8 +203,8 @@ template<int N> struct f { - typedef typename derived_dimension<length_tag, (1<<N) >::type dim1; - typedef typename derived_dimension<mass_tag, (1<<N) >::type dim2; + typedef typename derived_dimension<length_dim, (1<<N) >::type dim1; + typedef typename derived_dimension<mass_dim, (1<<N) >::type dim2; template<class T> static void apply(const T& t) { f<N - 1>::apply(t * unit<dim1, SI::system>()); @@ -413,10 +413,13 @@ return 0; } */ + #include <iostream> #include <boost/units/io.hpp> #include <boost/units/quantity.hpp> +#include <boost/units/systems/cgs/acceleration.hpp> +#include <boost/units/systems/si/acceleration.hpp> #include <boost/units/systems/si/force.hpp> #include <boost/units/systems/cgs/force.hpp> #include <boost/units/systems/si/mass.hpp> @@ -424,17 +427,21 @@ #include <boost/units/systems/si/momentum.hpp> #include <boost/units/systems/cgs/momentum.hpp> +#include <boost/units/systems/other/non_si_units.hpp> + int main() { using namespace boost; using namespace boost::units; std::cout << quantity<SI::dimensionless>(1.0*CGS::dyne/SI::newton) << std::endl; +// std::cout << exp(1.0*(SI::newtons*CGS::dynes)/(SI::newtons*CGS::dynes)) << std::endl; std::cout << exp(quantity<SI::dimensionless>(1.0*(SI::newtons*CGS::dynes)/(SI::newtons*CGS::dynes))) << std::endl; std::cout << conversion_factor<double>(CGS::dyne,SI::newton) << std::endl; std::cout << conversion_factor<double>(SI::newton/SI::kilogram,CGS::dyne/CGS::gram) << std::endl; std::cout << conversion_factor<double>(CGS::momentum(),SI::momentum()) << std::endl; std::cout << conversion_factor<double>(SI::momentum()/SI::mass(),CGS::momentum()/CGS::mass()) << std::endl; + std::cout << conversion_factor<double>(CGS::gal,SI::meter_per_second_squared) << std::endl; return 0; } Index: test_system.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/test_system.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test_system.hpp 4 Apr 2007 20:06:57 -0000 1.3 +++ test_system.hpp 10 Apr 2007 23:13:05 -0000 1.4 @@ -23,39 +23,39 @@ namespace units { //[test_system_snippet_1 -typedef base_dimension<1> length_tag; -typedef base_dimension<2> mass_tag; -typedef base_dimension<3> time_tag; +typedef base_dimension<1> length_dim; +typedef base_dimension<2> mass_dim; +typedef base_dimension<3> time_dim; //] #if 0 //[test_system_snippet_2 -typedef make_dimension_list< boost::mpl::list< dim< length_tag,static_rational<1> > > >::type length_type; -typedef make_dimension_list< boost::mpl::list< dim< mass_tag,static_rational<1> > > >::type mass_type; -typedef make_dimension_list< boost::mpl::list< dim< time_tag,static_rational<1> > > >::type time_type; +typedef make_dimension_list< boost::mpl::list< dim< length_dim,static_rational<1> > > >::type length_type; +typedef make_dimension_list< boost::mpl::list< dim< mass_dim,static_rational<1> > > >::type mass_type; +typedef make_dimension_list< boost::mpl::list< dim< time_dim,static_rational<1> > > >::type time_type; //] #endif //[test_system_snippet_3 -typedef length_tag::type length_type; -typedef mass_tag::type mass_type; -typedef time_tag::type time_type; +typedef length_dim::type length_type; +typedef mass_dim::type mass_type; +typedef time_dim::type time_type; //] #if 0 //[test_system_snippet_4 -typedef make_dimension_list< boost::mpl::list< dim< length_tag,static_rational<2> > > >::type area_type; -typedef make_dimension_list< boost::mpl::list< dim< mass_tag,static_rational<1> >, - dim< length_tag,static_rational<2> >, - dim< time_tag,static_rational<-2> > > >::type energy_type; +typedef make_dimension_list< boost::mpl::list< dim< length_dim,static_rational<2> > > >::type area_type; +typedef make_dimension_list< boost::mpl::list< dim< mass_dim,static_rational<1> >, + dim< length_dim,static_rational<2> >, + dim< time_dim,static_rational<-2> > > >::type energy_type; //] #endif //[test_system_snippet_5 -typedef derived_dimension<length_tag,2>::type area_type; -typedef derived_dimension<mass_tag,1, - length_tag,2, - time_tag,-2>::type energy_type; +typedef derived_dimension<length_dim,2>::type area_type; +typedef derived_dimension<mass_dim,1, + length_dim,2, + time_dim,-2>::type energy_type; //] namespace test { @@ -95,20 +95,20 @@ } // namespace test //[test_system_snippet_8 -template<> struct base_unit_info<length_tag,test::system_tag> +template<> struct base_unit_info<length_dim,test::system_tag> { static std::string name() { return "meter"; } static std::string symbol() { return "m"; } }; //] -template<> struct base_unit_info<mass_tag,test::system_tag> +template<> struct base_unit_info<mass_dim,test::system_tag> { static std::string name() { return "kilogram"; } static std::string symbol() { return "kg"; } }; -template<> struct base_unit_info<time_tag,test::system_tag> +template<> struct base_unit_info<time_dim,test::system_tag> { static std::string name() { return "second"; } static std::string symbol() { return "s"; } Index: unit_example_1.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_1.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- unit_example_1.cpp 4 Apr 2007 20:06:57 -0000 1.3 +++ unit_example_1.cpp 10 Apr 2007 23:13:05 -0000 1.4 @@ -20,13 +20,13 @@ @verbatim //[unit_example_1_output -length_type = l_item<long_<1L>, dim<length_tag, static_rational<1L, 1L> > > -mass_type = l_item<long_<1L>, dim<mass_tag, static_rational<1L, 1L> > > -time_type = l_item<long_<1L>, dim<time_tag, static_rational<1L, 1L> > > -energy_type = l_item<long_<3L>, dim<length_tag, static_rational<2L, 1L> >, l_item<long_<2L>, dim<mass_tag, static_rational<1L, 1L> >, l_item<long_<1L>, dim<time_tag, static_rational<-2L, 1L> > > > > -LM_type = l_item<long_<2L>, dim<length_tag, static_rational<1L, 1L> >, l_item<long_<1L>, dim<mass_tag, static_rational<1L, 1L> > > > -L_T_type = l_item<long_<2L>, dim<length_tag, static_rational<1L, 1L> >, l_item<long_<1L>, dim<time_tag, static_rational<-1L, 1L> > > > -V_type = l_item<long_<2L>, dim<length_tag, static_rational<1L, 1L> >, l_item<long_<1L>, dim<time_tag, static_rational<-1L, 1L> > > > +length_type = l_item<long_<1L>, dim<length_dim, static_rational<1L, 1L> > > +mass_type = l_item<long_<1L>, dim<mass_dim, static_rational<1L, 1L> > > +time_type = l_item<long_<1L>, dim<time_dim, static_rational<1L, 1L> > > +energy_type = l_item<long_<3L>, dim<length_dim, static_rational<2L, 1L> >, l_item<long_<2L>, dim<mass_dim, static_rational<1L, 1L> >, l_item<long_<1L>, dim<time_dim, static_rational<-2L, 1L> > > > > +LM_type = l_item<long_<2L>, dim<length_dim, static_rational<1L, 1L> >, l_item<long_<1L>, dim<mass_dim, static_rational<1L, 1L> > > > +L_T_type = l_item<long_<2L>, dim<length_dim, static_rational<1L, 1L> >, l_item<long_<1L>, dim<time_dim, static_rational<-1L, 1L> > > > +V_type = l_item<long_<2L>, dim<length_dim, static_rational<1L, 1L> >, l_item<long_<1L>, dim<time_dim, static_rational<-1L, 1L> > > > //] @endverbatim @@ -51,16 +51,16 @@ { using namespace boost::units; - BOOST_MPL_ASSERT((boost::is_same<length_type, mpl::push_front<dimensionless_type, dim<length_tag, static_rational<1L, 1L> > >::type>)); - BOOST_MPL_ASSERT((boost::is_same<mass_type, mpl::push_front<dimensionless_type, dim<mass_tag, static_rational<1L, 1L> > >::type>)); + BOOST_MPL_ASSERT((boost::is_same<length_type, mpl::push_front<dimensionless_type, dim<length_dim, static_rational<1L, 1L> > >::type>)); + BOOST_MPL_ASSERT((boost::is_same<mass_type, mpl::push_front<dimensionless_type, dim<mass_dim, static_rational<1L, 1L> > >::type>)); BOOST_MPL_ASSERT((boost::is_same<energy_type, mpl::push_front< mpl::push_front< mpl::push_front< dimensionless_type, - dim<time_tag, static_rational<-2L, 1L> > >::type, - dim<mass_tag, static_rational<1L, 1L> > >::type, - dim<length_tag, static_rational<2L, 1L> > >::type>)); + dim<time_dim, static_rational<-2L, 1L> > >::type, + dim<mass_dim, static_rational<1L, 1L> > >::type, + dim<length_dim, static_rational<2L, 1L> > >::type>)); std::cout << "length_type = " << simplify_typename(length_type()) << std::endl << "mass_type = " << simplify_typename(mass_type()) << std::endl @@ -77,22 +77,22 @@ mpl::push_front< mpl::push_front< dimensionless_type, - dim<mass_tag, static_rational<1L, 1L> > >::type, - dim<length_tag, static_rational<1L, 1L> > >::type>)); + dim<mass_dim, static_rational<1L, 1L> > >::type, + dim<length_dim, static_rational<1L, 1L> > >::type>)); BOOST_MPL_ASSERT((boost::is_same<L_T_type, mpl::push_front< mpl::push_front< dimensionless_type, - dim<time_tag, static_rational<-1L, 1L> > >::type, - dim<length_tag, static_rational<1L, 1L> > >::type>)); + dim<time_dim, static_rational<-1L, 1L> > >::type, + dim<length_dim, static_rational<1L, 1L> > >::type>)); BOOST_MPL_ASSERT((boost::is_same<V_type, mpl::push_front< mpl::push_front< dimensionless_type, - dim<time_tag, static_rational<-1L, 1L> > >::type, - dim<length_tag, static_rational<1L, 1L> > >::type>)); + dim<time_dim, static_rational<-1L, 1L> > >::type, + dim<length_dim, static_rational<1L, 1L> > >::type>)); std::cout << "LM_type = " << simplify_typename(LM_type()) << std::endl << "L_T_type = " << simplify_typename(L_T_type()) << 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.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- unit_example_16.cpp 29 Mar 2007 22:41:06 -0000 1.4 +++ unit_example_16.cpp 10 Apr 2007 23:13:05 -0000 1.5 @@ -64,7 +64,7 @@ // IO helper class template<> -struct base_unit_info<length_tag,nautical::system_tag> +struct base_unit_info<length_dim,nautical::system_tag> { static std::string name() { return "nautical mile"; } static std::string symbol() { return "nmi"; } @@ -72,7 +72,7 @@ // helper for conversions between nautical length and SI length template<> -struct base_unit_converter<length_tag,nautical::system_tag,SI::system_tag> : +struct base_unit_converter<length_dim,nautical::system_tag,SI::system_tag> : public trivial_conversion, trivial_inverse_conversion { typedef double type; @@ -97,7 +97,7 @@ // IO helper class template<> -struct base_unit_info<length_tag,imperial::system_tag> +struct base_unit_info<length_dim,imperial::system_tag> { static std::string name() { return "foot"; } static std::string symbol() { return "ft"; } @@ -105,14 +105,14 @@ // helpers for conversions between imperial length and SI length template<> -struct base_unit_converter<length_tag,imperial::system_tag,SI::system_tag> +struct base_unit_converter<length_dim,imperial::system_tag,SI::system_tag> { typedef double type; static type value() { return 1.0/3.28083989501312; } }; template<> -struct base_unit_converter<length_tag,SI::system_tag,imperial::system_tag> +struct base_unit_converter<length_dim,SI::system_tag,imperial::system_tag> { typedef double type; static type value() { return 3.28083989501312; } |
|
From: Matthias S. <mat...@us...> - 2007-04-10 22:58:48
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angle In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11216/systems/angle Modified Files: degrees.hpp gradians.hpp Log Message: change dimension tagging Index: gradians.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angle/gradians.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gradians.hpp 4 Apr 2007 19:52:59 -0000 1.1 +++ gradians.hpp 10 Apr 2007 22:58:42 -0000 1.2 @@ -59,7 +59,7 @@ } // namespace gradian template<> -struct base_unit_info<plane_angle_tag,gradian::system_tag> +struct base_unit_info<plane_angle_dim,gradian::system_tag> { static std::string name() { return "gradian"; } static std::string symbol() { return "grad"; } Index: degrees.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/angle/degrees.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- degrees.hpp 4 Apr 2007 19:52:59 -0000 1.1 +++ degrees.hpp 10 Apr 2007 22:58:42 -0000 1.2 @@ -59,7 +59,7 @@ } // namespace degree template<> -struct base_unit_info<plane_angle_tag,degree::system_tag> +struct base_unit_info<plane_angle_dim,degree::system_tag> { static std::string name() { return "degree"; } static std::string symbol() { return "deg"; } |
|
From: Matthias S. <mat...@us...> - 2007-04-10 22:58:48
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11216/systems Modified Files: abstract.hpp physical_units.hpp Log Message: change dimension tagging Index: abstract.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/abstract.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- abstract.hpp 3 Apr 2007 22:49:34 -0000 1.6 +++ abstract.hpp 10 Apr 2007 22:58:42 -0000 1.7 @@ -61,63 +61,63 @@ } // namespace abstract template<> -struct base_unit_info<length_tag,abstract::system_tag> +struct base_unit_info<length_dim,abstract::system_tag> { static std::string name() { return "[Length]"; } static std::string symbol() { return "[L]"; } }; template<> -struct base_unit_info<mass_tag,abstract::system_tag> +struct base_unit_info<mass_dim,abstract::system_tag> { static std::string name() { return "[Mass]"; } static std::string symbol() { return "[M]"; } }; template<> -struct base_unit_info<time_tag,abstract::system_tag> +struct base_unit_info<time_dim,abstract::system_tag> { static std::string name() { return "[Time]"; } static std::string symbol() { return "[T]"; } }; template<> -struct base_unit_info<current_tag,abstract::system_tag> +struct base_unit_info<current_dim,abstract::system_tag> { static std::string name() { return "[Electric Current]"; } static std::string symbol() { return "[I]"; } }; template<> -struct base_unit_info<temperature_tag,abstract::system_tag> +struct base_unit_info<temperature_dim,abstract::system_tag> { static std::string name() { return "[Temperature]"; } static std::string symbol() { return "[Theta]"; } }; template<> -struct base_unit_info<amount_tag,abstract::system_tag> +struct base_unit_info<amount_dim,abstract::system_tag> { static std::string name() { return "[Amount]"; } static std::string symbol() { return "[N]"; } }; template<> -struct base_unit_info<luminous_intensity_tag,abstract::system_tag> +struct base_unit_info<luminous_intensity_dim,abstract::system_tag> { static std::string name() { return "[Luminous Intensity]"; } static std::string symbol() { return "[J]"; } }; template<> -struct base_unit_info<plane_angle_tag,abstract::system_tag> +struct base_unit_info<plane_angle_dim,abstract::system_tag> { static std::string name() { return "[Planar Angle]"; } static std::string symbol() { return "[QP]"; } }; template<> -struct base_unit_info<solid_angle_tag,abstract::system_tag> +struct base_unit_info<solid_angle_dim,abstract::system_tag> { static std::string name() { return "[Solid Angle]"; } static std::string symbol() { return "[QS]"; } Index: physical_units.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/physical_units.hpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- physical_units.hpp 6 Apr 2007 20:57:45 -0000 1.13 +++ physical_units.hpp 10 Apr 2007 22:58:42 -0000 1.14 @@ -11,14 +11,15 @@ #ifndef BOOST_UNITS_PHYSICAL_UNITS_HPP #define BOOST_UNITS_PHYSICAL_UNITS_HPP +#include <boost/units/static_constant.hpp> #include <boost/units/system.hpp> #include <boost/units/unit.hpp> /// \file /// \brief Various definitions to simplify systems of physical units. /// -/// \detailed This file includes the seven SI-defined fundamental dimensions as -/// well as composite dimensions for a number of commonly encountered +/// \detailed This file includes the seven SI-defined base dimensions as +/// well as derived dimensions for a number of commonly encountered /// physical unit types. Angles and solid angles are technically dimensionless. /// However, incorrect use of degrees and radians is a common source of errors, /// so we treat them on the same footing as the seven physical dimensions. @@ -28,31 +29,31 @@ namespace units { /// tag representing length -typedef base_dimension<-9> length_tag; +typedef base_dimension<-9> length_dim; /// tag representing mass -typedef base_dimension<-8> mass_tag; +typedef base_dimension<-8> mass_dim; /// tag representing time -typedef base_dimension<-7> time_tag; +typedef base_dimension<-7> time_dim; /// tag representing electrical current -typedef base_dimension<-6> current_tag; +typedef base_dimension<-6> current_dim; /// tag representing temperature -typedef base_dimension<-5> temperature_tag; +typedef base_dimension<-5> temperature_dim; /// tag representing amount of substance -typedef base_dimension<-4> amount_tag; +typedef base_dimension<-4> amount_dim; /// tag representing luminous intensity -typedef base_dimension<-3> luminous_intensity_tag; +typedef base_dimension<-3> luminous_intensity_dim; /// tag representing plane angle -typedef base_dimension<-2> plane_angle_tag; +typedef base_dimension<-2> plane_angle_dim; /// tag representing solid angle -typedef base_dimension<-1> solid_angle_tag; +typedef base_dimension<-1> solid_angle_dim; } @@ -62,15 +63,15 @@ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() -BOOST_TYPEOF_REGISTER_TYPE(boost::units::length_tag) -BOOST_TYPEOF_REGISTER_TYPE(boost::units::mass_tag) -BOOST_TYPEOF_REGISTER_TYPE(boost::units::time_tag) -BOOST_TYPEOF_REGISTER_TYPE(boost::units::current_tag) -BOOST_TYPEOF_REGISTER_TYPE(boost::units::temperature_tag) -BOOST_TYPEOF_REGISTER_TYPE(boost::units::amount_tag) -BOOST_TYPEOF_REGISTER_TYPE(boost::units::luminous_intensity_tag) -BOOST_TYPEOF_REGISTER_TYPE(boost::units::plane_angle_tag) -BOOST_TYPEOF_REGISTER_TYPE(boost::units::solid_angle_tag) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::length_dim) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::mass_dim) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::time_dim) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::current_dim) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::temperature_dim) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::amount_dim) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::luminous_intensity_dim) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::plane_angle_dim) +BOOST_TYPEOF_REGISTER_TYPE(boost::units::solid_angle_dim) #endif @@ -78,107 +79,107 @@ namespace units { -/// fundamental dimension of length (L) -typedef length_tag::type length_type; +/// base dimension of length (L) +typedef length_dim::type length_type; -/// fundamental dimension of mass (M) -typedef mass_tag::type mass_type; +/// base dimension of mass (M) +typedef mass_dim::type mass_type; -/// fundamental dimension of time (T) -typedef time_tag::type time_type; +/// base dimension of time (T) +typedef time_dim::type time_type; -/// fundamental dimension of electric current (I) -typedef current_tag::type current_type; +/// base dimension of electric current (I) +typedef current_dim::type current_type; -/// fundamental dimension of temperature (Theta) -typedef temperature_tag::type temperature_type; +/// base dimension of temperature (Theta) +typedef temperature_dim::type temperature_type; -/// fundamental dimension of amount of substance (N) -typedef amount_tag::type amount_type; +/// base dimension of amount of substance (N) +typedef amount_dim::type amount_type; -/// fundamental dimension of luminous intensity (J) -typedef luminous_intensity_tag::type luminous_intensity_type; +/// base dimension of luminous intensity (J) +typedef luminous_intensity_dim::type luminous_intensity_type; -/// fundamental dimension of planar angle (QP) -typedef plane_angle_tag::type plane_angle_type; +/// base dimension of planar angle (QP) +typedef plane_angle_dim::type plane_angle_type; -/// fundamental dimension of solid angle (QS) -typedef solid_angle_tag::type solid_angle_type; +/// base dimension of solid angle (QS) +typedef solid_angle_dim::type solid_angle_type; -/// composite dimension for absorbed dose : L^2 T^-2 -typedef derived_dimension<length_tag,2,time_tag,-2>::type absorbed_dose_type; +/// derived dimension for absorbed dose : L^2 T^-2 +typedef derived_dimension<length_dim,2,time_dim,-2>::type absorbed_dose_type; -/// composite dimension for acceleration : L T^-2 -typedef derived_dimension<length_tag,1,time_tag,-2>::type acceleration_type; +/// derived dimension for acceleration : L T^-2 +typedef derived_dimension<length_dim,1,time_dim,-2>::type acceleration_type; -/// composite dimension for action : L^2 M T^-1 -typedef derived_dimension<length_tag,2,mass_tag,1,time_tag,-1>::type action_type; +/// derived dimension for action : L^2 M T^-1 +typedef derived_dimension<length_dim,2,mass_dim,1,time_dim,-1>::type action_type; -/// composite dimension for activity : T^-1 -typedef derived_dimension<time_tag,-1>::type activity_type; +/// derived dimension for activity : T^-1 +typedef derived_dimension<time_dim,-1>::type activity_type; -/// composite dimension for angular velocity : T^-1 QP -typedef derived_dimension<time_tag,-1,plane_angle_tag,1>::type angular_velocity_type; +/// derived dimension for angular velocity : T^-1 QP +typedef derived_dimension<time_dim,-1,plane_angle_dim,1>::type angular_velocity_type; -/// composite dimension for area : L^2 -typedef derived_dimension<length_tag,2>::type area_type; +/// derived dimension for area : L^2 +typedef derived_dimension<length_dim,2>::type area_type; -/// composite dimension for dose equivalent : L^2 T^-2 -typedef derived_dimension<length_tag,2,time_tag,-2>::type dose_equivalent_type; +/// derived dimension for dose equivalent : L^2 T^-2 +typedef derived_dimension<length_dim,2,time_dim,-2>::type dose_equivalent_type; -/// composite dimension for dynamic viscosity : M L^-1 T^-1 -typedef derived_dimension<mass_tag,1,length_tag,-1,time_tag,-1>::type dynamic_viscosity_type; +/// derived dimension for dynamic viscosity : M L^-1 T^-1 +typedef derived_dimension<mass_dim,1,length_dim,-1,time_dim,-1>::type dynamic_viscosity_type; -/// composite dimension for energy : L^2 M T^-2 -typedef derived_dimension<length_tag,2,mass_tag,1,time_tag,-2>::type energy_type; +/// derived dimension for energy : L^2 M T^-2 +typedef derived_dimension<length_dim,2,mass_dim,1,time_dim,-2>::type energy_type; -/// composite dimension for force : L M T^-2 -typedef derived_dimension<length_tag,1,mass_tag,1,time_tag,-2>::type force_type; +/// derived dimension for force : L M T^-2 +typedef derived_dimension<length_dim,1,mass_dim,1,time_dim,-2>::type force_type; -/// composite dimension for frequency : T^-1 -typedef derived_dimension<time_tag,-1>::type frequency_type; +/// derived dimension for frequency : T^-1 +typedef derived_dimension<time_dim,-1>::type frequency_type; -/// composite dimension for illuminance : L^-2 I QS -typedef derived_dimension<length_tag,-2,luminous_intensity_tag,1,solid_angle_tag,1>::type illuminance_type; +/// derived dimension for illuminance : L^-2 I QS +typedef derived_dimension<length_dim,-2,luminous_intensity_dim,1,solid_angle_dim,1>::type illuminance_type; -/// composite dimension for kinematic viscosity : L^2 T^-1 -typedef derived_dimension<length_tag,2,time_tag,-1>::type kinematic_viscosity_type; +/// derived dimension for kinematic viscosity : L^2 T^-1 +typedef derived_dimension<length_dim,2,time_dim,-1>::type kinematic_viscosity_type; -/// composite dimension for luminance : L^-2 I -typedef derived_dimension<length_tag,-2,luminous_intensity_tag,1>::type luminance_type; +/// derived dimension for luminance : L^-2 I +typedef derived_dimension<length_dim,-2,luminous_intensity_dim,1>::type luminance_type; -/// composite dimension for luminous flux : I QS -typedef derived_dimension<luminous_intensity_tag,1,solid_angle_tag,1>::type luminous_flux_type; +/// derived dimension for luminous flux : I QS +typedef derived_dimension<luminous_intensity_dim,1,solid_angle_dim,1>::type luminous_flux_type; -/// composite dimension for mass density : L^-3 M -typedef derived_dimension<length_tag,-3,mass_tag,1>::type mass_density_type; +/// derived dimension for mass density : L^-3 M +typedef derived_dimension<length_dim,-3,mass_dim,1>::type mass_density_type; -/// composite dimension for linear momentum : L M T^-1 -typedef derived_dimension<length_tag,1,mass_tag,1,time_tag,-1>::type momentum_type; +/// derived dimension for linear momentum : L M T^-1 +typedef derived_dimension<length_dim,1,mass_dim,1,time_dim,-1>::type momentum_type; -/// composite dimension for power : L^2 M T^-3 -typedef derived_dimension<length_tag,2,mass_tag,1,time_tag,-3>::type power_type; +/// derived dimension for power : L^2 M T^-3 +typedef derived_dimension<length_dim,2,mass_dim,1,time_dim,-3>::type power_type; -/// composite dimension for pressure : L^-1 M T^-2 -typedef derived_dimension<length_tag,-1,mass_tag,1,time_tag,-2>::type pressure_type; +/// derived dimension for pressure : L^-1 M T^-2 +typedef derived_dimension<length_dim,-1,mass_dim,1,time_dim,-2>::type pressure_type; -/// composite dimension for specific volume : L^3 M^-1 -typedef derived_dimension<length_tag,3,mass_tag,-1>::type specific_volume_type; +/// derived dimension for specific volume : L^3 M^-1 +typedef derived_dimension<length_dim,3,mass_dim,-1>::type specific_volume_type; -/// composite dimension for stress : L^-1 M T^-2 -typedef derived_dimension<length_tag,-1,mass_tag,1,time_tag,-2>::type stress_type; +/// derived dimension for stress : L^-1 M T^-2 +typedef derived_dimension<length_dim,-1,mass_dim,1,time_dim,-2>::type stress_type; -/// composite dimension for surface density : L^-2 M -typedef derived_dimension<length_tag,-2,mass_tag,1>::type surface_density_type; +/// derived dimension for surface density : L^-2 M +typedef derived_dimension<length_dim,-2,mass_dim,1>::type surface_density_type; -/// composite dimension for velocity : L T^-1 -typedef derived_dimension<length_tag,1,time_tag,-1>::type velocity_type; +/// derived dimension for velocity : L T^-1 +typedef derived_dimension<length_dim,1,time_dim,-1>::type velocity_type; -/// composite dimension for volume : l^3 -typedef derived_dimension<length_tag,3>::type volume_type; +/// derived dimension for volume : l^3 +typedef derived_dimension<length_dim,3>::type volume_type; -/// composite dimension for wavenumber : L^-1 -typedef derived_dimension<length_tag,-1>::type wavenumber_type; +/// derived dimension for wavenumber : L^-1 +typedef derived_dimension<length_dim,-1>::type wavenumber_type; } // namespace units |
|
From: Matthias S. <mat...@us...> - 2007-04-10 22:58:48
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11216/systems/conversions Modified Files: convert_celsius_to_fahrenheit.hpp convert_celsius_to_kelvin.hpp convert_cgs_to_si.hpp convert_degrees_to_gradians.hpp convert_fahrenheit_to_kelvin.hpp convert_radians_to_degrees.hpp convert_radians_to_gradians.hpp convert_si_to_cgs.hpp Log Message: change dimension tagging Index: convert_fahrenheit_to_kelvin.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_fahrenheit_to_kelvin.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- convert_fahrenheit_to_kelvin.hpp 3 Apr 2007 21:38:26 -0000 1.2 +++ convert_fahrenheit_to_kelvin.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -22,7 +22,7 @@ // convert temperature differences in Fahrenheit to Kelvin template<> -struct base_unit_converter<temperature_tag,fahrenheit::system_tag,SI::system_tag> : +struct base_unit_converter<temperature_dim,fahrenheit::system_tag,SI::system_tag> : #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION public implicitly_convertible, #endif Index: convert_celsius_to_kelvin.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_celsius_to_kelvin.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- convert_celsius_to_kelvin.hpp 3 Apr 2007 21:38:26 -0000 1.2 +++ convert_celsius_to_kelvin.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -22,7 +22,7 @@ // convert temperature differences in Celsius to Kelvin template<> -struct base_unit_converter<temperature_tag,celsius::system_tag,SI::system_tag> : +struct base_unit_converter<temperature_dim,celsius::system_tag,SI::system_tag> : #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION public implicitly_convertible, #endif Index: convert_cgs_to_si.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_cgs_to_si.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- convert_cgs_to_si.hpp 30 Mar 2007 23:57:49 -0000 1.3 +++ convert_cgs_to_si.hpp 10 Apr 2007 22:58:42 -0000 1.4 @@ -22,7 +22,7 @@ // conversions from CGS to SI units template<> -struct base_unit_converter<length_tag,CGS::system_tag,SI::system_tag> +struct base_unit_converter<length_dim,CGS::system_tag,SI::system_tag> #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION : public implicitly_convertible #endif @@ -32,7 +32,7 @@ }; template<> -struct base_unit_converter<mass_tag,CGS::system_tag,SI::system_tag> +struct base_unit_converter<mass_dim,CGS::system_tag,SI::system_tag> #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION : public implicitly_convertible #endif @@ -42,7 +42,7 @@ }; template<> -struct base_unit_converter<time_tag,CGS::system_tag,SI::system_tag> : +struct base_unit_converter<time_dim,CGS::system_tag,SI::system_tag> : public implicitly_convertible, public trivial_conversion { }; 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- convert_radians_to_gradians.hpp 4 Apr 2007 19:53:54 -0000 1.5 +++ convert_radians_to_gradians.hpp 10 Apr 2007 22:58:42 -0000 1.6 @@ -22,7 +22,7 @@ // conversions from radians to gradians template<> -struct base_unit_converter<plane_angle_tag,SI::system_tag,gradian::system_tag> : +struct base_unit_converter<plane_angle_dim,SI::system_tag,gradian::system_tag> : #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION public implicitly_convertible, #endif 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- convert_radians_to_degrees.hpp 4 Apr 2007 19:53:54 -0000 1.5 +++ convert_radians_to_degrees.hpp 10 Apr 2007 22:58:42 -0000 1.6 @@ -22,7 +22,7 @@ // conversions from radians to degrees template<> -struct base_unit_converter<plane_angle_tag,SI::system_tag,degree::system_tag> : +struct base_unit_converter<plane_angle_dim,SI::system_tag,degree::system_tag> : #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION public implicitly_convertible, #endif 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- convert_degrees_to_gradians.hpp 4 Apr 2007 19:53:54 -0000 1.5 +++ convert_degrees_to_gradians.hpp 10 Apr 2007 22:58:42 -0000 1.6 @@ -22,7 +22,7 @@ // conversions from degrees to gradians template<> -struct base_unit_converter<plane_angle_tag,degree::system_tag,gradian::system_tag> : +struct base_unit_converter<plane_angle_dim,degree::system_tag,gradian::system_tag> : #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION public implicitly_convertible, #endif Index: convert_celsius_to_fahrenheit.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_celsius_to_fahrenheit.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- convert_celsius_to_fahrenheit.hpp 2 Apr 2007 21:24:44 -0000 1.1 +++ convert_celsius_to_fahrenheit.hpp 10 Apr 2007 22:58:42 -0000 1.2 @@ -22,7 +22,7 @@ // convert temperature differences in Celsius to Fahrenheit template<> -struct base_unit_converter<temperature_tag,celsius::system_tag,fahrenheit::system_tag> : +struct base_unit_converter<temperature_dim,celsius::system_tag,fahrenheit::system_tag> : #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION public implicitly_convertible, #endif Index: convert_si_to_cgs.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/conversions/convert_si_to_cgs.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- convert_si_to_cgs.hpp 30 Mar 2007 23:57:49 -0000 1.3 +++ convert_si_to_cgs.hpp 10 Apr 2007 22:58:42 -0000 1.4 @@ -22,7 +22,7 @@ // conversions from SI to CGS units template<> -struct base_unit_converter<length_tag,SI::system_tag,CGS::system_tag> +struct base_unit_converter<length_dim,SI::system_tag,CGS::system_tag> #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION : public implicitly_convertible #endif @@ -32,7 +32,7 @@ }; template<> -struct base_unit_converter<mass_tag,SI::system_tag,CGS::system_tag> +struct base_unit_converter<mass_dim,SI::system_tag,CGS::system_tag> #ifdef BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSION : public implicitly_convertible #endif @@ -42,7 +42,7 @@ }; template<> -struct base_unit_converter<time_tag,SI::system_tag,CGS::system_tag> : +struct base_unit_converter<time_dim,SI::system_tag,CGS::system_tag> : public implicitly_convertible, public trivial_conversion { }; |
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11216/systems/si Modified Files: base.hpp capacitance.hpp catalytic_activity.hpp conductance.hpp conductivity.hpp electric_charge.hpp electric_potential.hpp impedance.hpp inductance.hpp magnetic_field_intensity.hpp magnetic_flux.hpp magnetic_flux_density.hpp permeability.hpp permittivity.hpp reluctance.hpp resistance.hpp resistivity.hpp Log Message: change dimension tagging Index: resistivity.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/resistivity.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- resistivity.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ resistivity.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// resistivity : L^3 M T^-3 C^-2 -typedef derived_dimension<length_tag,3,mass_tag,1,time_tag,-3,current_tag,-2>::type resistivity_type; +typedef derived_dimension<length_dim,3,mass_dim,1,time_dim,-3,current_dim,-2>::type resistivity_type; typedef unit<SI::resistivity_type,SI::system> resistivity; Index: permeability.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/permeability.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- permeability.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ permeability.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// permeability : L M T^-2 C^-2 -typedef derived_dimension<length_tag,1,mass_tag,1,time_tag,-2,current_tag,-2>::type permeability_type; +typedef derived_dimension<length_dim,1,mass_dim,1,time_dim,-2,current_dim,-2>::type permeability_type; typedef unit<SI::permeability_type,SI::system> permeability; Index: electric_charge.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/electric_charge.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- electric_charge.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ electric_charge.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// electric charge : T^1 C^1 -typedef derived_dimension<time_tag,1,current_tag,1>::type electric_charge_type; +typedef derived_dimension<time_dim,1,current_dim,1>::type electric_charge_type; typedef unit<SI::electric_charge_type,SI::system> electric_charge; Index: electric_potential.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/electric_potential.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- electric_potential.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ electric_potential.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// electric potential : L^2 M T^-3 C^-1 -typedef derived_dimension<length_tag,2,mass_tag,1,time_tag,-3,current_tag,-1>::type electric_potential_type; +typedef derived_dimension<length_dim,2,mass_dim,1,time_dim,-3,current_dim,-1>::type electric_potential_type; typedef unit<SI::electric_potential_type,SI::system> electric_potential; Index: impedance.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/impedance.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- impedance.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ impedance.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// impedance : L^2 M T^-3 C^-2 -typedef derived_dimension<length_tag,2,mass_tag,1,time_tag,-3,current_tag,-2>::type impedance_type; +typedef derived_dimension<length_dim,2,mass_dim,1,time_dim,-3,current_dim,-2>::type impedance_type; typedef unit<SI::impedance_type,SI::system> impedance; Index: capacitance.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/capacitance.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- capacitance.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ capacitance.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// capacitance : L^-2 M^-1 T^4 C^2 -typedef derived_dimension<length_tag,-2,mass_tag,-1,time_tag,4,current_tag,2>::type capacitance_type; +typedef derived_dimension<length_dim,-2,mass_dim,-1,time_dim,4,current_dim,2>::type capacitance_type; typedef unit<SI::capacitance_type,SI::system> capacitance; Index: magnetic_flux_density.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/magnetic_flux_density.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- magnetic_flux_density.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ magnetic_flux_density.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// magnetic flux density : M T^-2 C^-1 -typedef derived_dimension<mass_tag,1,time_tag,-2,current_tag,-1>::type magnetic_flux_density_type; +typedef derived_dimension<mass_dim,1,time_dim,-2,current_dim,-1>::type magnetic_flux_density_type; typedef unit<SI::magnetic_flux_density_type,SI::system> magnetic_flux_density; Index: conductance.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/conductance.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- conductance.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ conductance.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// conductance : L^-2 M^-1 T^3 C^2 -typedef derived_dimension<length_tag,-2,mass_tag,-1,time_tag,3,current_tag,2>::type conductance_type; +typedef derived_dimension<length_dim,-2,mass_dim,-1,time_dim,3,current_dim,2>::type conductance_type; typedef unit<SI::conductance_type,SI::system> conductance; Index: resistance.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/resistance.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- resistance.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ resistance.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// resistance : L^2 M T^-3 C^-2 -typedef derived_dimension<length_tag,2,mass_tag,1,time_tag,-3,current_tag,-2>::type resistance_type; +typedef derived_dimension<length_dim,2,mass_dim,1,time_dim,-3,current_dim,-2>::type resistance_type; typedef unit<SI::resistance_type,SI::system> resistance; Index: permittivity.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/permittivity.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- permittivity.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ permittivity.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// permittivity : L^-3 M^-1 T^4 C^2 -typedef derived_dimension<length_tag,-3,mass_tag,-1,time_tag,4,current_tag,2>::type permittivity_type; +typedef derived_dimension<length_dim,-3,mass_dim,-1,time_dim,4,current_dim,2>::type permittivity_type; typedef unit<SI::permittivity_type,SI::system> permittivity; Index: reluctance.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/reluctance.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- reluctance.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ reluctance.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// reluctance : L^-2 M^-1 T^2 C^2 -typedef derived_dimension<length_tag,-2,mass_tag,-1,time_tag,2,current_tag,2>::type reluctance_type; +typedef derived_dimension<length_dim,-2,mass_dim,-1,time_dim,2,current_dim,2>::type reluctance_type; typedef unit<SI::reluctance_type,SI::system> reluctance; Index: catalytic_activity.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/catalytic_activity.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- catalytic_activity.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ catalytic_activity.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// catalytic activity : T^-1 A^1 -typedef derived_dimension<time_tag,-1,amount_tag,1>::type catalytic_activity_type; +typedef derived_dimension<time_dim,-1,amount_dim,1>::type catalytic_activity_type; typedef unit<SI::catalytic_activity_type,SI::system> catalytic_activity; Index: base.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/base.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- base.hpp 3 Apr 2007 22:43:10 -0000 1.6 +++ base.hpp 10 Apr 2007 22:58:42 -0000 1.7 @@ -56,63 +56,63 @@ } // namespace SI template<> -struct base_unit_info<length_tag,SI::system_tag> +struct base_unit_info<length_dim,SI::system_tag> { static std::string name() { return "meter"; } static std::string symbol() { return "m"; } }; template<> -struct base_unit_info<mass_tag,SI::system_tag> +struct base_unit_info<mass_dim,SI::system_tag> { static std::string name() { return "kilogram"; } static std::string symbol() { return "kg"; } }; template<> -struct base_unit_info<time_tag,SI::system_tag> +struct base_unit_info<time_dim,SI::system_tag> { static std::string name() { return "second"; } static std::string symbol() { return "s"; } }; template<> -struct base_unit_info<current_tag,SI::system_tag> +struct base_unit_info<current_dim,SI::system_tag> { static std::string name() { return "ampere"; } static std::string symbol() { return "A"; } }; template<> -struct base_unit_info<temperature_tag,SI::system_tag> +struct base_unit_info<temperature_dim,SI::system_tag> { static std::string name() { return "kelvin"; } static std::string symbol() { return "K"; } }; template<> -struct base_unit_info<amount_tag,SI::system_tag> +struct base_unit_info<amount_dim,SI::system_tag> { static std::string name() { return "mole"; } static std::string symbol() { return "mol"; } }; template<> -struct base_unit_info<luminous_intensity_tag,SI::system_tag> +struct base_unit_info<luminous_intensity_dim,SI::system_tag> { static std::string name() { return "candela"; } static std::string symbol() { return "cd"; } }; template<> -struct base_unit_info<plane_angle_tag,SI::system_tag> +struct base_unit_info<plane_angle_dim,SI::system_tag> { static std::string name() { return "radian"; } static std::string symbol() { return "rad"; } }; template<> -struct base_unit_info<solid_angle_tag,SI::system_tag> +struct base_unit_info<solid_angle_dim,SI::system_tag> { static std::string name() { return "steradian"; } static std::string symbol() { return "sr"; } Index: inductance.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/inductance.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- inductance.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ inductance.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// inductance : L^2 M T^-2 C^-2 -typedef derived_dimension<length_tag,2,mass_tag,1,time_tag,-2,current_tag,-2>::type inductance_type; +typedef derived_dimension<length_dim,2,mass_dim,1,time_dim,-2,current_dim,-2>::type inductance_type; typedef unit<SI::inductance_type,SI::system> inductance; Index: magnetic_field_intensity.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/magnetic_field_intensity.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- magnetic_field_intensity.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ magnetic_field_intensity.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// magnetic field intensity : L^-1 C -typedef derived_dimension<length_tag,-1,current_tag,1>::type magnetic_field_intensity_type; +typedef derived_dimension<length_dim,-1,current_dim,1>::type magnetic_field_intensity_type; typedef unit<SI::magnetic_field_intensity_type,SI::system> magnetic_field_intensity; Index: magnetic_flux.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/magnetic_flux.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- magnetic_flux.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ magnetic_flux.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// magnetic flux : L^2 M T^-2 C^-1 -typedef derived_dimension<length_tag,2,mass_tag,1,time_tag,-2,current_tag,-1>::type magnetic_flux_type; +typedef derived_dimension<length_dim,2,mass_dim,1,time_dim,-2,current_dim,-1>::type magnetic_flux_type; typedef unit<SI::magnetic_flux_type,SI::system> magnetic_flux; Index: conductivity.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/si/conductivity.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- conductivity.hpp 4 Apr 2007 19:53:54 -0000 1.2 +++ conductivity.hpp 10 Apr 2007 22:58:42 -0000 1.3 @@ -20,7 +20,7 @@ namespace SI { /// conductivity : L^-3 M^-1 T^3 C^2 -typedef derived_dimension<length_tag,-3,mass_tag,-1,time_tag,3,current_tag,2>::type conductivity_type; +typedef derived_dimension<length_dim,-3,mass_dim,-1,time_dim,3,current_dim,2>::type conductivity_type; typedef unit<SI::conductivity_type,SI::system> conductivity; |
|
From: Matthias S. <mat...@us...> - 2007-04-10 22:58:48
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/cgs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11216/systems/cgs Modified Files: base.hpp Log Message: change dimension tagging Index: base.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/cgs/base.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- base.hpp 31 Mar 2007 01:17:17 -0000 1.4 +++ base.hpp 10 Apr 2007 22:58:42 -0000 1.5 @@ -56,21 +56,21 @@ } // namespace CGS template<> -struct base_unit_info<length_tag,CGS::system_tag> +struct base_unit_info<length_dim,CGS::system_tag> { static std::string name() { return "centimeter"; } static std::string symbol() { return "cm"; } }; template<> -struct base_unit_info<mass_tag,CGS::system_tag> +struct base_unit_info<mass_dim,CGS::system_tag> { static std::string name() { return "gram"; } static std::string symbol() { return "g"; } }; template<> -struct base_unit_info<time_tag,CGS::system_tag> +struct base_unit_info<time_dim,CGS::system_tag> { static std::string name() { return "second"; } static std::string symbol() { return "s"; } |
|
From: Matthias S. <mat...@us...> - 2007-04-10 22:58:48
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/temperature In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11216/systems/temperature Modified Files: celsius.hpp fahrenheit.hpp Log Message: change dimension tagging Index: celsius.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/temperature/celsius.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- celsius.hpp 2 Apr 2007 21:25:32 -0000 1.1 +++ celsius.hpp 10 Apr 2007 22:58:42 -0000 1.2 @@ -36,7 +36,7 @@ } // namespace celsius -template<> struct base_unit_info<temperature_tag,celsius::system_tag> +template<> struct base_unit_info<temperature_dim,celsius::system_tag> { static std::string name() { return "Celsius"; } static std::string symbol() { return "C"; } Index: fahrenheit.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/systems/temperature/fahrenheit.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- fahrenheit.hpp 2 Apr 2007 21:25:32 -0000 1.1 +++ fahrenheit.hpp 10 Apr 2007 22:58:42 -0000 1.2 @@ -36,7 +36,7 @@ } // namespace fahrenheit -template<> struct base_unit_info<temperature_tag,fahrenheit::system_tag> +template<> struct base_unit_info<temperature_dim,fahrenheit::system_tag> { static std::string name() { return "Fahrenheit"; } static std::string symbol() { return "F"; } |