stabilize build system: depends, installer, boost/bdb fixes, cross targets groundwork
This commit is contained in:
@@ -0,0 +1,153 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
///
|
||||
/// \file
|
||||
/// \brief Absolute units (points rather than vectors).
|
||||
/// \details Operations between absolute units, and relative units like temperature differences.
|
||||
///
|
||||
|
||||
#ifndef BOOST_UNITS_ABSOLUTE_HPP
|
||||
#define BOOST_UNITS_ABSOLUTE_HPP
|
||||
|
||||
#include <iosfwd>
|
||||
|
||||
#include <boost/units/detail/absolute_impl.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// A wrapper to represent absolute units (points rather than vectors). Intended
|
||||
/// originally for temperatures, this class implements operators for absolute units
|
||||
/// so that addition of a relative unit to an absolute unit results in another
|
||||
/// absolute unit : absolute<T> +/- T -> absolute<T> and subtraction of one absolute
|
||||
/// unit from another results in a relative unit : absolute<T> - absolute<T> -> T.
|
||||
template<class Y>
|
||||
class absolute
|
||||
{
|
||||
public:
|
||||
typedef absolute<Y> this_type;
|
||||
typedef Y value_type;
|
||||
|
||||
absolute() : val_() { }
|
||||
absolute(const value_type& val) : val_(val) { }
|
||||
absolute(const this_type& source) : val_(source.val_) { }
|
||||
|
||||
this_type& operator=(const this_type& source) { val_ = source.val_; return *this; }
|
||||
|
||||
const value_type& value() const { return val_; }
|
||||
|
||||
const this_type& operator+=(const value_type& val) { val_ += val; return *this; }
|
||||
const this_type& operator-=(const value_type& val) { val_ -= val; return *this; }
|
||||
|
||||
private:
|
||||
value_type val_;
|
||||
};
|
||||
|
||||
/// add a relative value to an absolute one
|
||||
template<class Y>
|
||||
absolute<Y> operator+(const absolute<Y>& aval,const Y& rval)
|
||||
{
|
||||
return absolute<Y>(aval.value()+rval);
|
||||
}
|
||||
|
||||
/// add a relative value to an absolute one
|
||||
template<class Y>
|
||||
absolute<Y> operator+(const Y& rval,const absolute<Y>& aval)
|
||||
{
|
||||
return absolute<Y>(aval.value()+rval);
|
||||
}
|
||||
|
||||
/// subtract a relative value from an absolute one
|
||||
template<class Y>
|
||||
absolute<Y> operator-(const absolute<Y>& aval,const Y& rval)
|
||||
{
|
||||
return absolute<Y>(aval.value()-rval);
|
||||
}
|
||||
|
||||
/// subtracting two absolutes gives a difference
|
||||
template<class Y>
|
||||
Y operator-(const absolute<Y>& aval1,const absolute<Y>& aval2)
|
||||
{
|
||||
return Y(aval1.value()-aval2.value());
|
||||
}
|
||||
|
||||
/// creates a quantity from an absolute unit and a raw value
|
||||
template<class D, class S, class T>
|
||||
quantity<absolute<unit<D, S> >, T> operator*(const T& t, const absolute<unit<D, S> >&)
|
||||
{
|
||||
return(quantity<absolute<unit<D, S> >, T>::from_value(t));
|
||||
}
|
||||
|
||||
/// creates a quantity from an absolute unit and a raw value
|
||||
template<class D, class S, class T>
|
||||
quantity<absolute<unit<D, S> >, T> operator*(const absolute<unit<D, S> >&, const T& t)
|
||||
{
|
||||
return(quantity<absolute<unit<D, S> >, T>::from_value(t));
|
||||
}
|
||||
|
||||
/// Print an absolute unit
|
||||
template<class Char, class Traits, class Y>
|
||||
std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,const absolute<Y>& aval)
|
||||
{
|
||||
|
||||
os << "absolute " << aval.value();
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::absolute, (class))
|
||||
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// Macro to define the offset between two absolute units.
|
||||
/// Requires the value to be in the destination units e.g
|
||||
/// @code
|
||||
/// BOOST_UNITS_DEFINE_CONVERSION_OFFSET(celsius_base_unit, fahrenheit_base_unit, double, 32.0);
|
||||
/// @endcode
|
||||
/// @c BOOST_UNITS_DEFINE_CONVERSION_FACTOR is also necessary to
|
||||
/// specify the conversion factor. Like @c BOOST_UNITS_DEFINE_CONVERSION_FACTOR
|
||||
/// this macro defines both forward and reverse conversions so
|
||||
/// defining, e.g., the conversion from celsius to fahrenheit as above will also
|
||||
/// define the inverse conversion from fahrenheit to celsius.
|
||||
#define BOOST_UNITS_DEFINE_CONVERSION_OFFSET(From, To, type_, value_) \
|
||||
namespace boost { \
|
||||
namespace units { \
|
||||
template<> \
|
||||
struct affine_conversion_helper< \
|
||||
reduce_unit<From::unit_type>::type, \
|
||||
reduce_unit<To::unit_type>::type> \
|
||||
{ \
|
||||
static const bool is_defined = true; \
|
||||
typedef type_ type; \
|
||||
static type value() { return(value_); } \
|
||||
}; \
|
||||
} \
|
||||
} \
|
||||
void boost_units_require_semicolon()
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_ABSOLUTE_HPP
|
||||
@@ -0,0 +1,107 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
/// \file
|
||||
/// \brief base dimensions (mass, length, time...).
|
||||
/// \details base dimension definition registration.
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_DIMENSION_HPP
|
||||
#define BOOST_UNITS_BASE_DIMENSION_HPP
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/dim.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/units_fwd.hpp>
|
||||
#include <boost/units/detail/dimension_list.hpp>
|
||||
#include <boost/units/detail/ordinal.hpp>
|
||||
#include <boost/units/detail/prevent_redefinition.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// This must be in namespace boost::units so that ADL
|
||||
/// will work with friend functions defined inline.
|
||||
/// INTERNAL ONLY
|
||||
template<long N> struct base_dimension_ordinal { };
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class T, long N> struct base_dimension_pair { };
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class T, long N>
|
||||
struct check_base_dimension {
|
||||
enum {
|
||||
value =
|
||||
sizeof(boost_units_is_registered(units::base_dimension_ordinal<N>())) == sizeof(detail::yes) &&
|
||||
sizeof(boost_units_is_registered(units::base_dimension_pair<T, N>())) != sizeof(detail::yes)
|
||||
};
|
||||
};
|
||||
|
||||
/// Defines a base dimension. To define a dimension you need to provide
|
||||
/// the derived class (CRTP) and a unique integer.
|
||||
/// @code
|
||||
/// struct my_dimension : boost::units::base_dimension<my_dimension, 1> {};
|
||||
/// @endcode
|
||||
/// It is designed so that you will get an error message if you try
|
||||
/// to use the same value in multiple definitions.
|
||||
template<class Derived,
|
||||
long N
|
||||
#if !defined(BOOST_UNITS_DOXYGEN) && !defined(__BORLANDC__)
|
||||
,
|
||||
class = typename detail::ordinal_has_already_been_defined<
|
||||
check_base_dimension<Derived, N>::value
|
||||
>::type
|
||||
#endif
|
||||
>
|
||||
class base_dimension :
|
||||
public ordinal<N>
|
||||
{
|
||||
public:
|
||||
/// INTERNAL ONLY
|
||||
typedef base_dimension this_type;
|
||||
/// A convenience typedef. Equivalent to boost::units::derived_dimension<Derived,1>::type.
|
||||
#ifndef BOOST_UNITS_DOXYGEN
|
||||
typedef list<dim<Derived,static_rational<1> >, dimensionless_type> dimension_type;
|
||||
#else
|
||||
typedef detail::unspecified dimension_type;
|
||||
#endif
|
||||
/// Provided for mpl compatability.
|
||||
typedef Derived type;
|
||||
|
||||
private:
|
||||
/// Check for C++0x. In C++0x, we have to have identical
|
||||
/// arguments but a different return type to trigger an
|
||||
/// error. Note that this is only needed for clang as
|
||||
/// check_base_dimension will trigger an error earlier
|
||||
/// for compilers with less strict name lookup.
|
||||
/// INTERNAL ONLY
|
||||
friend Derived*
|
||||
check_double_register(const units::base_dimension_ordinal<N>&)
|
||||
{ return(0); }
|
||||
|
||||
/// Register this ordinal
|
||||
/// INTERNAL ONLY
|
||||
friend detail::yes
|
||||
boost_units_is_registered(const units::base_dimension_ordinal<N>&)
|
||||
{ detail::yes result; return(result); }
|
||||
|
||||
/// But make sure we can identify the current instantiation!
|
||||
/// INTERNAL ONLY
|
||||
friend detail::yes
|
||||
boost_units_is_registered(const units::base_dimension_pair<Derived, N>&)
|
||||
{ detail::yes result; return(result); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_DIMENSION_HPP
|
||||
@@ -0,0 +1,128 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
/// \file
|
||||
/// \brief base unit (meter, kg, sec...).
|
||||
/// \details base unit definition registration.
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/heterogeneous_system.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/units_fwd.hpp>
|
||||
#include <boost/units/unit.hpp>
|
||||
#include <boost/units/detail/dimension_list.hpp>
|
||||
#include <boost/units/detail/ordinal.hpp>
|
||||
#include <boost/units/detail/prevent_redefinition.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// This must be in namespace boost::units so that ADL
|
||||
/// will work with friend functions defined inline.
|
||||
/// Base dimensions and base units are independent.
|
||||
/// INTERNAL ONLY
|
||||
template<long N> struct base_unit_ordinal { };
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class T, long N> struct base_unit_pair { };
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class T, long N>
|
||||
struct check_base_unit {
|
||||
enum {
|
||||
value =
|
||||
sizeof(boost_units_unit_is_registered(units::base_unit_ordinal<N>())) == sizeof(detail::yes) &&
|
||||
sizeof(boost_units_unit_is_registered(units::base_unit_pair<T, N>())) != sizeof(detail::yes)
|
||||
};
|
||||
};
|
||||
|
||||
/// Defines a base unit. To define a unit you need to provide
|
||||
/// the derived class (CRTP), a dimension list and a unique integer.
|
||||
/// @code
|
||||
/// struct my_unit : boost::units::base_unit<my_unit, length_dimension, 1> {};
|
||||
/// @endcode
|
||||
/// It is designed so that you will get an error message if you try
|
||||
/// to use the same value in multiple definitions.
|
||||
template<class Derived,
|
||||
class Dim,
|
||||
long N
|
||||
#if !defined(BOOST_UNITS_DOXYGEN) && !defined(__BORLANDC__)
|
||||
,
|
||||
class = typename detail::ordinal_has_already_been_defined<
|
||||
check_base_unit<Derived, N>::value
|
||||
>::type
|
||||
#endif
|
||||
>
|
||||
class base_unit :
|
||||
public ordinal<N>
|
||||
{
|
||||
public:
|
||||
/// INTERNAL ONLY
|
||||
typedef void boost_units_is_base_unit_type;
|
||||
/// INTERNAL ONLY
|
||||
typedef base_unit this_type;
|
||||
/// The dimensions of this base unit.
|
||||
typedef Dim dimension_type;
|
||||
|
||||
/// Provided for mpl compatability.
|
||||
typedef Derived type;
|
||||
|
||||
/// The unit corresponding to this base unit.
|
||||
#ifndef BOOST_UNITS_DOXYGEN
|
||||
typedef unit<
|
||||
Dim,
|
||||
heterogeneous_system<
|
||||
heterogeneous_system_impl<
|
||||
list<
|
||||
heterogeneous_system_dim<Derived,static_rational<1> >,
|
||||
dimensionless_type
|
||||
>,
|
||||
Dim,
|
||||
no_scale
|
||||
>
|
||||
>
|
||||
> unit_type;
|
||||
#else
|
||||
typedef detail::unspecified unit_type;
|
||||
#endif
|
||||
|
||||
private:
|
||||
/// Check for C++0x. In C++0x, we have to have identical
|
||||
/// arguments but a different return type to trigger an
|
||||
/// error. Note that this is only needed for clang as
|
||||
/// check_base_unit will trigger an error earlier
|
||||
/// for compilers with less strict name lookup.
|
||||
/// INTERNAL ONLY
|
||||
friend Derived*
|
||||
check_double_register(const units::base_unit_ordinal<N>&)
|
||||
{ return(0); }
|
||||
|
||||
/// Register this ordinal
|
||||
/// INTERNAL ONLY
|
||||
friend detail::yes
|
||||
boost_units_unit_is_registered(const units::base_unit_ordinal<N>&)
|
||||
{ detail::yes result; return(result); }
|
||||
|
||||
/// But make sure we can identify the current instantiation!
|
||||
/// INTERNAL ONLY
|
||||
friend detail::yes
|
||||
boost_units_unit_is_registered(const units::base_unit_pair<Derived, N>&)
|
||||
{ detail::yes result; return(result); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,36 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_BASE_UNITS_ANGLE_ARCMINUTE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_BASE_UNITS_ANGLE_ARCMINUTE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/angle/degree.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace angle {
|
||||
|
||||
typedef scaled_base_unit<degree_base_unit, scale<60, static_rational<-1> > > arcminute_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<angle::arcminute_base_unit> {
|
||||
static const char* name() { return("arcminute"); }
|
||||
static const char* symbol() { return("'"); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_UNIT_BASE_UNITS_ANGLE_ARCMINUTE_HPP_INCLUDED
|
||||
@@ -0,0 +1,37 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_ANGLE_ARCSECOND_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_ANGLE_ARCSECOND_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/angle/degree.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace angle {
|
||||
|
||||
//typedef scaled_base_unit<degree_base_unit, scale<60, static_rational<-2> > > arcsecond_base_unit;
|
||||
typedef scaled_base_unit<degree_base_unit, scale<3600, static_rational<-1> > > arcsecond_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<angle::arcsecond_base_unit> {
|
||||
static const char* name() { return("arcsecond"); }
|
||||
static const char* symbol() { return("\""); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_ANGLE_ARCSECOND_HPP_INCLUDED
|
||||
@@ -0,0 +1,27 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_ANGLE_DEGREE_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_ANGLE_DEGREE_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/base_units/angle/radian.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(angle,degree,"degree","deg",6.28318530718/360.,boost::units::angle::radian_base_unit,-101);
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::degree_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNITS_ANGLE_DEGREE_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,27 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_ANGLE_GRADIAN_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_ANGLE_GRADIAN_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/base_units/angle/radian.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(angle,gradian,"gradian","grad",6.28318530718/400.,boost::units::angle::radian_base_unit,-102);
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::gradian_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNITS_ANGLE_GRADIAN_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,48 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_ANGLE_RADIAN_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_ANGLE_RADIAN_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/plane_angle.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace angle {
|
||||
|
||||
struct radian_base_unit : public base_unit<radian_base_unit, plane_angle_dimension, -2>
|
||||
{
|
||||
static std::string name() { return("radian"); }
|
||||
static std::string symbol() { return("rad"); }
|
||||
};
|
||||
|
||||
} // namespace angle
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::radian_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
//#include <boost/units/base_units/angle/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_ANGLE_RADIAN_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,36 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_REVOLUTION_HPP
|
||||
#define BOOST_UNITS_BASE_UNITS_REVOLUTION_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/angle/degree.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace angle {
|
||||
|
||||
typedef scaled_base_unit<degree_base_unit, scale<360, static_rational<1> > > revolution_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<angle::revolution_base_unit> {
|
||||
static const char* name() { return("revolution"); }
|
||||
static const char* symbol() { return("rev"); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_REVOLUTION_HPP
|
||||
@@ -0,0 +1,48 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/solid_angle.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace angle {
|
||||
|
||||
struct steradian_base_unit : public base_unit<steradian_base_unit, solid_angle_dimension, -1>
|
||||
{
|
||||
static std::string name() { return("steradian"); }
|
||||
static std::string symbol() { return("sr"); }
|
||||
};
|
||||
|
||||
} // namespace angle
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::steradian_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
//#include <boost/units/base_units/angle/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_ASTRONOMICAL_UNIT_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_ASTRONOMICAL_UNIT_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/base_units/si/meter.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, astronomical_unit, "astronomical unit", "a.u.", 149597870691.0, boost::units::si::meter_base_unit, -207);
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::astronomical::astronomical_unit_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_ASTRONOMICAL_UNIT_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_DAY_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_DAY_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/astronomical/light_second.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace astronomical {
|
||||
|
||||
typedef scaled_base_unit<boost::units::astronomical::light_second_base_unit, scale<86400, static_rational<1> > > light_day_base_unit;
|
||||
|
||||
} // namespace astronomical
|
||||
|
||||
template<>
|
||||
struct base_unit_info<astronomical::light_day_base_unit> {
|
||||
static const char* name() { return("light day"); }
|
||||
static const char* symbol() { return("ldy"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_DAY_HPP_INCLUDED
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_HOUR_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_HOUR_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/astronomical/light_second.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace astronomical {
|
||||
|
||||
typedef scaled_base_unit<boost::units::astronomical::light_second_base_unit, scale<3600, static_rational<1> > > light_hour_base_unit;
|
||||
|
||||
} // namespace astronomical
|
||||
|
||||
template<>
|
||||
struct base_unit_info<astronomical::light_hour_base_unit> {
|
||||
static const char* name() { return("light hour"); }
|
||||
static const char* symbol() { return("lhr"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_HOUR_HPP_INCLUDED
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_MINUTE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_MINUTE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/astronomical/light_second.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace astronomical {
|
||||
|
||||
typedef scaled_base_unit<boost::units::astronomical::light_second_base_unit, scale<60, static_rational<1> > > light_minute_base_unit;
|
||||
|
||||
} // namespace astronomical
|
||||
|
||||
template<>
|
||||
struct base_unit_info<astronomical::light_minute_base_unit> {
|
||||
static const char* name() { return("light minute"); }
|
||||
static const char* symbol() { return("lmn"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_MINUTE_HPP_INCLUDED
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_SECOND_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_SECOND_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/base_units/si/meter.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, light_second, "light second", "lsc", 2.99792458e8, boost::units::si::meter_base_unit, -201);
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::astronomical::light_second_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_SECOND_HPP_INCLUDED
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_YEAR_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_YEAR_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/astronomical/light_second.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace astronomical {
|
||||
|
||||
typedef scaled_base_unit<boost::units::astronomical::light_second_base_unit, scale<31557600, static_rational<1> > > light_year_base_unit;
|
||||
|
||||
} // namespace astronomical
|
||||
|
||||
template<>
|
||||
struct base_unit_info<astronomical::light_year_base_unit> {
|
||||
static const char* name() { return("light year"); }
|
||||
static const char* symbol() { return("ly"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_YEAR_HPP_INCLUDED
|
||||
@@ -0,0 +1,27 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_PARSEC_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_PARSEC_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/base_units/si/meter.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, parsec, "parsec", "psc", 3.0856775813e16, boost::units::si::meter_base_unit, -206);
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::astronomical::parsec_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_PARSEC_HPP_INCLUDED
|
||||
@@ -0,0 +1,31 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_CGS_BIOT_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_CGS_BIOT_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/base_units/si/ampere.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace cgs {
|
||||
|
||||
typedef scaled_base_unit<boost::units::si::ampere_base_unit, scale<10, static_rational<+1> > > biot_base_unit;
|
||||
|
||||
} // namespace cgs
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_CGS_BIOT_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,31 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_CENTIMETER_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_CENTIMETER_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/base_units/si/meter.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace cgs {
|
||||
|
||||
typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<10, static_rational<-2> > > centimeter_base_unit;
|
||||
|
||||
} // namespace cgs
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_CENTIMETER_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,49 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_CGS_GRAM_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_CGS_GRAM_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/mass.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace cgs {
|
||||
|
||||
struct gram_base_unit : public base_unit<gram_base_unit, mass_dimension, -8>
|
||||
{
|
||||
static std::string name() { return("gram"); }
|
||||
static std::string symbol() { return("g"); }
|
||||
};
|
||||
|
||||
} // namespace cgs
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::cgs::gram_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
//#include <boost/units/base_units/detail/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_CGS_GRAM_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,46 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// No include guards. This header is intended to be included
|
||||
// multiple times.
|
||||
|
||||
// imperial units
|
||||
|
||||
#if 0
|
||||
|
||||
#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED) &&\
|
||||
!defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GALLON_CONVERSION_DEFINED)
|
||||
#define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GALLON_CONVERSION_DEFINED
|
||||
#include <boost/units/conversion.hpp>
|
||||
BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::gallon_base_unit, double, 1./8.);
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED) &&\
|
||||
!defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_QUART_CONVERSION_DEFINED)
|
||||
#define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_QUART_CONVERSION_DEFINED
|
||||
#include <boost/units/conversion.hpp>
|
||||
BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::quart_base_unit, double, 1./2.);
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED) &&\
|
||||
!defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GILL_CONVERSION_DEFINED)
|
||||
#define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GILL_CONVERSION_DEFINED
|
||||
#include <boost/units/conversion.hpp>
|
||||
BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::gill_base_unit, double, 4.);
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED) &&\
|
||||
!defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_FLUID_OUNCE_CONVERSION_DEFINED)
|
||||
#define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_FLUID_OUNCE_CONVERSION_DEFINED
|
||||
#include <boost/units/conversion.hpp>
|
||||
BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::fluid_ounce_base_unit, double, 20.);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_DRACHM_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_IMPERIAL_DRACHM_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<16, static_rational<-2> > > drachm_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::drachm_base_unit> {
|
||||
static const char* name() { return("drachm"); }
|
||||
static const char* symbol() { return("drachm"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_DRACHM_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<pint_base_unit, scale<20, static_rational<-1> > > fluid_ounce_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::fluid_ounce_base_unit> {
|
||||
static const char* name() { return("fluid ounce (imp.)"); }
|
||||
static const char* symbol() { return("fl oz"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_IMPERIAL_FOOT_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_IMPERIAL_FOOT_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/yard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<yard_base_unit, scale<3, static_rational<-1> > > foot_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::foot_base_unit> {
|
||||
static const char* name() { return("foot"); }
|
||||
static const char* symbol() { return("ft"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_IMPERIAL_FOOT_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_IMPERIAL_FURLONG_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_IMPERIAL_FURLONG_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/yard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<yard_base_unit, scale<220, static_rational<1> > > furlong_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::furlong_base_unit> {
|
||||
static const char* name() { return("furlong"); }
|
||||
static const char* symbol() { return("furlong"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_IMPERIAL_FURLONG_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,40 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
//typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<3> > > gallon_base_unit;
|
||||
typedef scaled_base_unit<pint_base_unit, scale<8, static_rational<1> > > gallon_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::gallon_base_unit> {
|
||||
static const char* name() { return("gallon (imp.)"); }
|
||||
static const char* symbol() { return("gal"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED
|
||||
@@ -0,0 +1,40 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
//typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-2> > > gill_base_unit;
|
||||
typedef scaled_base_unit<pint_base_unit, scale<4, static_rational<-1> > > gill_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::gill_base_unit> {
|
||||
static const char* name() { return("gill (imp.)"); }
|
||||
static const char* symbol() { return("gill"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_GRAIN_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_IMPERIAL_GRAIN_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<7000, static_rational<-1> > > grain_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::grain_base_unit> {
|
||||
static const char* name() { return("grain"); }
|
||||
static const char* symbol() { return("grain"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_GRAIN_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_HUNDREDWEIGHT_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_IMPERIAL_HUNDREDWEIGHT_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<112, static_rational<1> > > hundredweight_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::hundredweight_base_unit> {
|
||||
static const char* name() { return("hundredweight"); }
|
||||
static const char* symbol() { return("cwt"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_HUNDREDWEIGHT_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_IMPERIAL_INCH_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_IMPERIAL_INCH_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/yard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<yard_base_unit, scale<36, static_rational<-1> > > inch_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::inch_base_unit> {
|
||||
static const char* name() { return("inch"); }
|
||||
static const char* symbol() { return("in"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_IMPERIAL_INCH_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_IMPERIAL_LEAGUE_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_IMPERIAL_LEAGUE_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/yard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<yard_base_unit, scale<5280, static_rational<1> > > league_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::league_base_unit> {
|
||||
static const char* name() { return("league"); }
|
||||
static const char* symbol() { return("league"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_IMPERIAL_LEAGUE_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_IMPERIAL_MILE_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_IMPERIAL_MILE_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/yard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<yard_base_unit, scale<1760, static_rational<1> > > mile_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::mile_base_unit> {
|
||||
static const char* name() { return("mile"); }
|
||||
static const char* symbol() { return("mi"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_IMPERIAL_MILE_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_OUNCE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_IMPERIAL_OUNCE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<2, static_rational<-4> > > ounce_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::ounce_base_unit> {
|
||||
static const char* name() { return("ounce"); }
|
||||
static const char* symbol() { return("oz"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_OUNCE_HPP_INCLUDED
|
||||
@@ -0,0 +1,29 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/systems/si/volume.hpp>
|
||||
#include <boost/units/conversion.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pint, "pint (imp.)", "pt", 4.54609e-3/8., si::volume, -303); // exact conversion
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::imperial::pint_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED
|
||||
@@ -0,0 +1,34 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_POUND_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_IMPERIAL_POUND_HPP_INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/mass.hpp>
|
||||
#include <boost/units/base_units/cgs/gram.hpp>
|
||||
#include <boost/units/conversion.hpp>
|
||||
|
||||
// can't define in terms of kilogram because it is a scaled_base_unit
|
||||
//BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pound, "pound", "lb", 0.45359237, si::kilogram_base_unit, -302); // exact conversion
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pound, "pound", "lb", 453.59237, cgs::gram_base_unit, -302); // exact conversion
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::imperial::pound_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_POUND_HPP_INCLUDED
|
||||
@@ -0,0 +1,40 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
//typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<1> > > quart_base_unit;
|
||||
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<1> > > quart_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::quart_base_unit> {
|
||||
static const char* name() { return("quart (imp.)"); }
|
||||
static const char* symbol() { return("qt"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_QUARTER_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_IMPERIAL_QUARTER_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<28, static_rational<1> > > quarter_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::quarter_base_unit> {
|
||||
static const char* name() { return("quarter"); }
|
||||
static const char* symbol() { return("quarter"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_QUARTER_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_STONE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_IMPERIAL_STONE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<14, static_rational<1> > > stone_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::stone_base_unit> {
|
||||
static const char* name() { return("stone"); }
|
||||
static const char* symbol() { return("st"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_STONE_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_IMPERIAL_THOU_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_IMPERIAL_THOU_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/yard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<yard_base_unit, scale<36000, static_rational<-1> > > thou_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::thou_base_unit> {
|
||||
static const char* name() { return("thou"); }
|
||||
static const char* symbol() { return("thou"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_IMPERIAL_THOU_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,40 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_TON_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_IMPERIAL_TON_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/imperial/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace imperial {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<2240, static_rational<1> > > ton_base_unit;
|
||||
|
||||
} // namespace imperial
|
||||
|
||||
template<>
|
||||
struct base_unit_info<imperial::ton_base_unit> {
|
||||
static const char* name() { return("long ton"); }
|
||||
static const char* symbol() { return("t"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_TON_HPP_INCLUDED
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SYSTEMS_IMPERIAL_YARD_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_SYSTEMS_IMPERIAL_YARD_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/length.hpp>
|
||||
#include <boost/units/base_units/si/meter.hpp>
|
||||
#include <boost/units/conversion.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, yard, "yard", "yd", 0.9144, si::meter_base_unit, -301); // exact conversion
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::imperial::yard_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNITS_SYSTEMS_IMPERIAL_YARD_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,41 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2014 Erik Erlandson
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_INFORMATION_BIT_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_INFORMATION_BIT_HPP_INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/information.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace information {
|
||||
|
||||
struct bit_base_unit : public base_unit<bit_base_unit, information_dimension, -700>
|
||||
{
|
||||
static std::string name() { return("bit"); }
|
||||
static std::string symbol() { return("b"); }
|
||||
};
|
||||
|
||||
} // namespace information
|
||||
} // namespace units
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::information::bit_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_INFORMATION_BIT_HPP_INCLUDED
|
||||
@@ -0,0 +1,36 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2014 Erik Erlandson
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_INFORMATION_BYTE_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_INFORMATION_BYTE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/units_fwd.hpp>
|
||||
#include <boost/units/base_units/information/bit.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace information {
|
||||
|
||||
typedef scaled_base_unit<boost::units::information::bit_base_unit, scale<2, static_rational<3> > > byte_base_unit;
|
||||
|
||||
} // namespace information
|
||||
|
||||
template<>
|
||||
struct base_unit_info<information::byte_base_unit> {
|
||||
static const char* name() { return("byte"); }
|
||||
static const char* symbol() { return("B"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_INFORMATION_BYTE_HPP_INCLUDED
|
||||
@@ -0,0 +1,30 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2014 Erik Erlandson
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_INFORMATION_HARTLEY_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_INFORMATION_HARTLEY_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/base_units/information/bit.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(information, hartley,
|
||||
"hartley", "Hart",
|
||||
3.321928094887363,
|
||||
boost::units::information::bit_base_unit,
|
||||
-703);
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::information::hartley_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_INFORMATION_HARTLEY_HPP_INCLUDED
|
||||
@@ -0,0 +1,30 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2014 Erik Erlandson
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_INFORMATION_NAT_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_INFORMATION_NAT_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/base_units/information/bit.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(information, nat,
|
||||
"nat", "nat",
|
||||
1.442695040888964,
|
||||
boost::units::information::bit_base_unit,
|
||||
-702);
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::information::nat_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_INFORMATION_NAT_HPP_INCLUDED
|
||||
@@ -0,0 +1,36 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2014 Erik Erlandson
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_INFORMATION_SHANNON_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_INFORMATION_SHANNON_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/units_fwd.hpp>
|
||||
#include <boost/units/base_units/information/bit.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace information {
|
||||
|
||||
typedef scaled_base_unit<boost::units::information::bit_base_unit, scale<1, static_rational<1> > > shannon_base_unit;
|
||||
|
||||
} // namespace information
|
||||
|
||||
template<>
|
||||
struct base_unit_info<information::shannon_base_unit> {
|
||||
static const char* name() { return("shannon"); }
|
||||
static const char* symbol() { return("Sh"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_INFORMATION_SHANNON_HPP_INCLUDED
|
||||
@@ -0,0 +1,37 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_ANGSTROM_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_ANGSTROM_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/units_fwd.hpp>
|
||||
#include <boost/units/base_units/si/meter.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace metric {
|
||||
|
||||
typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<10, static_rational<-10> > > angstrom_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<metric::angstrom_base_unit> {
|
||||
static const char* name() { return("angstrom"); }
|
||||
static const char* symbol() { return("A"); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_ANGSTROM_HPP_INCLUDED
|
||||
@@ -0,0 +1,19 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_ARE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_ARE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/systems/si/area.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, are, "are", "a", 1.0e2, si::area, 10);
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_ARE_HPP_INCLUDED
|
||||
@@ -0,0 +1,19 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_ATMOSPHERE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_ATMOSPHERE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/systems/si/pressure.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, atmosphere, "atmosphere", "atm", 1.01325e5, si::pressure, 33);
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_ATMOSPHERE_HPP_INCLUDED
|
||||
@@ -0,0 +1,19 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_BAR_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_BAR_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/systems/si/pressure.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, bar, "bar", "bar", 1.0e5, si::pressure, 14);
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_BAR_HPP_INCLUDED
|
||||
@@ -0,0 +1,19 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_BARN_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_BARN_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/systems/si/area.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, barn, "barn", "b", 1.0e-28, si::area, 11);
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_BARN_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_OTHER_DAY_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_OTHER_DAY_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/si/second.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace metric {
|
||||
|
||||
typedef scaled_base_unit<boost::units::si::second_base_unit, scale<86400, static_rational<1> > > day_base_unit;
|
||||
|
||||
} // namespace metric
|
||||
|
||||
template<>
|
||||
struct base_unit_info<metric::day_base_unit> {
|
||||
static const char* name() { return("day"); }
|
||||
static const char* symbol() { return("d"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/si/meter.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace metric {
|
||||
|
||||
typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<10, static_rational<-15> > > fermi_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<metric::fermi_base_unit> {
|
||||
static const char* name() { return("fermi"); }
|
||||
static const char* symbol() { return("fm"); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED
|
||||
@@ -0,0 +1,19 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_HECTARE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_HECTARE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/systems/si/area.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, hectare, "hectare", "ha", 1.0e4, si::area, 12);
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_HECTARE_HPP_INCLUDED
|
||||
@@ -0,0 +1,37 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_HOUR_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_HOUR_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/units_fwd.hpp>
|
||||
#include <boost/units/base_units/si/second.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace metric {
|
||||
|
||||
typedef scaled_base_unit<boost::units::si::second_base_unit, scale<60, static_rational<2> > > hour_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<metric::hour_base_unit> {
|
||||
static const char* name() { return("hour"); }
|
||||
static const char* symbol() { return("h"); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_HOUR_HPP_INCLUDED
|
||||
@@ -0,0 +1,19 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_KNOT_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_KNOT_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/systems/si/velocity.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, knot, "knot", "kt", 1852./3600., boost::units::si::velocity, -403);
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_KNOT_HPP_INCLUDED
|
||||
@@ -0,0 +1,19 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_LITER_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_LITER_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/systems/si/volume.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, liter, "liter", "L", 1.0e-3, si::volume, 13);
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_LITER_HPP_INCLUDED
|
||||
@@ -0,0 +1,36 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_MICRON_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_MICRON_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/si/meter.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace metric {
|
||||
|
||||
typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<10, static_rational<-6> > > micron_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<metric::micron_base_unit> {
|
||||
static const char* name() { return("micron"); }
|
||||
static const char* symbol() { return("u"); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_MICRON_HPP_INCLUDED
|
||||
@@ -0,0 +1,37 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_MINUTE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_MINUTE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/units_fwd.hpp>
|
||||
#include <boost/units/base_units/si/second.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace metric {
|
||||
|
||||
typedef scaled_base_unit<boost::units::si::second_base_unit, scale<60, static_rational<1> > > minute_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<metric::minute_base_unit> {
|
||||
static const char* name() { return("minute"); }
|
||||
static const char* symbol() { return("min"); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_MINUTE_HPP_INCLUDED
|
||||
@@ -0,0 +1,19 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_MMHG_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_MMHG_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/systems/si/pressure.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, mmHg, "millimeters mercury", "mmHg", 133.322, si::pressure, -404);
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_MMHG_HPP_INCLUDED
|
||||
@@ -0,0 +1,36 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_NAUTICAL_MILE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_NAUTICAL_MILE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/si/meter.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace metric {
|
||||
|
||||
typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<1852, static_rational<1> > > nautical_mile_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<metric::nautical_mile_base_unit> {
|
||||
static const char* name() { return("nautical mile"); }
|
||||
static const char* symbol() { return("nmi"); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_NAUTICAL_MILE_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_TON_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_TON_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/units_fwd.hpp>
|
||||
#include <boost/units/base_units/si/kilogram.hpp>
|
||||
//#include <boost/units/base_units/cgs/gram.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace metric {
|
||||
|
||||
//typedef scaled_base_unit<boost::units::cgs::gram_base_unit, scale<10, static_rational<6> > > ton_base_unit;
|
||||
typedef scaled_base_unit<boost::units::si::kilogram_base_unit, scale<1000, static_rational<1> > > ton_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<metric::ton_base_unit> {
|
||||
static const char* name() { return("metric ton"); }
|
||||
static const char* symbol() { return("t"); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_METRIC_TON_HPP_INCLUDED
|
||||
@@ -0,0 +1,19 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_METRIC_TORR_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_METRIC_TORR_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/systems/si/pressure.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, torr, "torr", "Torr", 1.01325e5/760.0, si::pressure, -401);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_OTHER_YEAR_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_OTHER_YEAR_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/si/second.hpp>
|
||||
|
||||
// Julian year = 365.25 days exactly = 8766 hours exactly
|
||||
|
||||
namespace boost {
|
||||
namespace units {
|
||||
namespace metric {
|
||||
|
||||
typedef scaled_base_unit<boost::units::si::second_base_unit, scale<31557600, static_rational<1> > > year_base_unit;
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct base_unit_info<metric::year_base_unit> {
|
||||
static const char* name() { return("Julian year"); }
|
||||
static const char* symbol() { return("yr"); }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,48 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/current.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
struct ampere_base_unit : public base_unit<ampere_base_unit, current_dimension, -6>
|
||||
{
|
||||
static std::string name() { return("ampere"); }
|
||||
static std::string symbol() { return("A"); }
|
||||
};
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::ampere_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
//#include <boost/units/base_units/detail/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,48 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_CANDELA_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_SI_CANDELA_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/luminous_intensity.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
struct candela_base_unit : public base_unit<candela_base_unit, luminous_intensity_dimension, -3>
|
||||
{
|
||||
static std::string name() { return("candela"); }
|
||||
static std::string symbol() { return("cd"); }
|
||||
};
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::candela_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
//#include <boost/units/base_units/detail/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_SI_CANDELA_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,48 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/temperature.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
struct kelvin_base_unit : public base_unit<kelvin_base_unit, temperature_dimension, -5>
|
||||
{
|
||||
static std::string name() { return("kelvin"); }
|
||||
static std::string symbol() { return("K"); }
|
||||
};
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::kelvin_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
//#include <boost/units/base_units/detail/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,31 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_KILOGRAM_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_SI_KILOGRAM_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/base_units/cgs/gram.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
typedef scaled_base_unit<boost::units::cgs::gram_base_unit, scale<10, static_rational<3> > > kilogram_base_unit;
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_SI_KILOGRAM_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,50 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_METER_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_SI_METER_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/length.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
struct meter_base_unit : public base_unit<meter_base_unit, length_dimension, -9>
|
||||
{
|
||||
static std::string name() { return("meter"); }
|
||||
static std::string symbol() { return("m"); }
|
||||
};
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::meter_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
//#include <boost/units/base_units/detail/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_SI_METER_BASE_UNIT_HPP
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_MOLE_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_SI_MOLE_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/amount.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
struct mole_base_unit : public base_unit<mole_base_unit, amount_dimension, -4>
|
||||
{
|
||||
static std::string name() { return("mole"); }
|
||||
static std::string symbol() { return("mol"); }
|
||||
};
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::mole_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
//#include <boost/units/base_units/detail/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_SI_MOLE_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,48 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_SECOND_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_SI_SECOND_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/time.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
struct second_base_unit : public base_unit<second_base_unit, time_dimension, -7>
|
||||
{
|
||||
static std::string name() { return("second"); }
|
||||
static std::string symbol() { return("s"); }
|
||||
};
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::second_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
//#include <boost/units/base_units/detail/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_SI_SECOND_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,48 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/temperature.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace temperature {
|
||||
|
||||
struct celsius_base_unit : public base_unit<celsius_base_unit, temperature_dimension, -1008>
|
||||
{
|
||||
static std::string name() { return("celsius"); }
|
||||
static std::string symbol() { return("C"); }
|
||||
};
|
||||
|
||||
} // namespace temperature
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::temperature::celsius_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/units/base_units/temperature/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// No include guards. This header is intended to be included
|
||||
// multiple times.
|
||||
|
||||
// units of temperature
|
||||
|
||||
#if defined(BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP) && defined(BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP) &&\
|
||||
!defined(BOOST_UNITS_SYSTEMS_KELVIN_TO_CELSIUS_CONVERSION_DEFINED)
|
||||
#define BOOST_UNITS_SYSTEMS_KELVIN_TO_CELSIUS_CONVERSION_DEFINED
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/absolute.hpp>
|
||||
BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::si::kelvin_base_unit, boost::units::temperature::celsius_base_unit, one, make_one());
|
||||
BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::si::kelvin_base_unit, boost::units::temperature::celsius_base_unit, double, -273.15);
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP) && defined(BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP) &&\
|
||||
!defined(BOOST_UNITS_SYSTEMS_KELVIN_TO_FAHRENHEIT_CONVERSION_DEFINED)
|
||||
#define BOOST_UNITS_SYSTEMS_KELVIN_TO_FAHRENHEIT_CONVERSION_DEFINED
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/absolute.hpp>
|
||||
BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::si::kelvin_base_unit, boost::units::temperature::fahrenheit_base_unit, double, 9.0/5.0);
|
||||
BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::si::kelvin_base_unit, boost::units::temperature::fahrenheit_base_unit, double, -273.15 * 9.0 / 5.0 + 32.0);
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP) && defined(BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP) &&\
|
||||
!defined(BOOST_UNITS_SYSTEMS_CELSUIS_TO_FAHRENHEIT_CONVERSION_DEFINED)
|
||||
#define BOOST_UNITS_SYSTEMS_CELSUIS_TO_FAHRENHEIT_CONVERSION_DEFINED
|
||||
#include <boost/units/conversion.hpp>
|
||||
#include <boost/units/absolute.hpp>
|
||||
BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::temperature::celsius_base_unit, boost::units::temperature::fahrenheit_base_unit, double, 9.0/5.0);
|
||||
BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::temperature::celsius_base_unit, boost::units::temperature::fahrenheit_base_unit, double, 32.0);
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/temperature.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace temperature {
|
||||
|
||||
struct fahrenheit_base_unit : public base_unit<fahrenheit_base_unit, temperature_dimension, -1007>
|
||||
{
|
||||
static std::string name() { return("fahrenheit"); }
|
||||
static std::string symbol() { return("F"); }
|
||||
};
|
||||
|
||||
} // namespace temperature
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::temperature::fahrenheit_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/units/base_units/temperature/conversions.hpp>
|
||||
|
||||
#endif // BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-1> > > cup_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::cup_base_unit> {
|
||||
static const char* name() { return("cup"); }
|
||||
static const char* symbol() { return("c"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED
|
||||
#define BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<16, static_rational<-2> > > dram_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::dram_base_unit> {
|
||||
static const char* name() { return("dram (U.S.)"); }
|
||||
static const char* symbol() { return("dr"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-7> > > fluid_dram_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::fluid_dram_base_unit> {
|
||||
static const char* name() { return("fluid dram (U.S.)"); }
|
||||
static const char* symbol() { return("fl dr"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pint_base_unit, scale<16, static_rational<-1> > > fluid_ounce_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::fluid_ounce_base_unit> {
|
||||
static const char* name() { return("fluid ounce (U.S.)"); }
|
||||
static const char* symbol() { return("fl oz"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_US_FOOT_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_US_FOOT_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/yard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<yard_base_unit, scale<3, static_rational<-1> > > foot_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::foot_base_unit> {
|
||||
static const char* name() { return("foot"); }
|
||||
static const char* symbol() { return("ft"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_US_FOOT_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<3> > > gallon_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::gallon_base_unit> {
|
||||
static const char* name() { return("gallon (U.S.)"); }
|
||||
static const char* symbol() { return("gal"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-2> > > gill_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::gill_base_unit> {
|
||||
static const char* name() { return("gill (U.S.)"); }
|
||||
static const char* symbol() { return("gi"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED
|
||||
#define BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<7000, static_rational<-1> > > grain_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::grain_base_unit> {
|
||||
static const char* name() { return("grain"); }
|
||||
static const char* symbol() { return("gr"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED
|
||||
@@ -0,0 +1,40 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED
|
||||
#define BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
//typedef scaled_base_unit<pound_base_unit, scale<10, static_rational<2> > > hundredweight_base_unit;
|
||||
typedef scaled_base_unit<pound_base_unit, scale<100, static_rational<1> > > hundredweight_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::hundredweight_base_unit> {
|
||||
static const char* name() { return("hundredweight (U.S.)"); }
|
||||
static const char* symbol() { return("cwt"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_US_INCH_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_US_INCH_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/yard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<yard_base_unit, scale<36, static_rational<-1> > > inch_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::inch_base_unit> {
|
||||
static const char* name() { return("inch"); }
|
||||
static const char* symbol() { return("in"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_US_INCH_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_US_MIL_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_US_MIL_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/yard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<yard_base_unit, scale<36000, static_rational<-1> > > mil_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::mil_base_unit> {
|
||||
static const char* name() { return("mil"); }
|
||||
static const char* symbol() { return("mil"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_US_MIL_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_US_MILE_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_US_MILE_BASE_UNIT_HPP
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/yard.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<yard_base_unit, scale<1760, static_rational<1> > > mile_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::mile_base_unit> {
|
||||
static const char* name() { return("mile"); }
|
||||
static const char* symbol() { return("mi"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_US_MILE_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pint_base_unit, scale<7680, static_rational<-1> > > minim_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::minim_base_unit> {
|
||||
static const char* name() { return("minim (U.S.)"); }
|
||||
static const char* symbol() { return("minim"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<2, static_rational<-4> > > ounce_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::ounce_base_unit> {
|
||||
static const char* name() { return("ounce"); }
|
||||
static const char* symbol() { return("oz"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED
|
||||
@@ -0,0 +1,28 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/systems/si/volume.hpp>
|
||||
#include <boost/units/conversion.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pint, "pint (U.S.)", "pt", 0.4731765e-3, si::volume, -503);
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pint_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED
|
||||
@@ -0,0 +1,32 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/mass.hpp>
|
||||
#include <boost/units/base_units/cgs/gram.hpp>
|
||||
#include <boost/units/conversion.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pound, "pound", "lb", 453.59237, cgs::gram_base_unit, -502); // exact conversion
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pound_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED
|
||||
@@ -0,0 +1,32 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2009 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2009 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED
|
||||
#define BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
//#include <boost/units/physical_dimensions/mass.hpp>
|
||||
#include <boost/units/systems/si/force.hpp>
|
||||
#include <boost/units/conversion.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pound_force, "pound-force", "lbf", 4.4482216152605, si::force, -600); // exact conversion
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pound_force_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<1> > > quart_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::quart_base_unit> {
|
||||
static const char* name() { return("quart (U.S.)"); }
|
||||
static const char* symbol() { return("qt"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-5> > > tablespoon_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::tablespoon_base_unit> {
|
||||
static const char* name() { return("tablespoon"); }
|
||||
static const char* symbol() { return("tbsp"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED
|
||||
#define BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pint.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pint_base_unit, scale<96, static_rational<-1> > > teaspoon_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::teaspoon_base_unit> {
|
||||
static const char* name() { return("teaspoon"); }
|
||||
static const char* symbol() { return("tsp"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED
|
||||
@@ -0,0 +1,39 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED
|
||||
#define BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED
|
||||
|
||||
#include <boost/units/scaled_base_unit.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/scale.hpp>
|
||||
#include <boost/units/base_units/us/pound.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace us {
|
||||
|
||||
typedef scaled_base_unit<pound_base_unit, scale<2000, static_rational<1> > > ton_base_unit;
|
||||
|
||||
} // namespace us
|
||||
|
||||
template<>
|
||||
struct base_unit_info<us::ton_base_unit> {
|
||||
static const char* name() { return("short ton"); }
|
||||
static const char* symbol() { return("t"); }
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED
|
||||
@@ -0,0 +1,32 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP
|
||||
#define BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/units/config.hpp>
|
||||
#include <boost/units/base_unit.hpp>
|
||||
#include <boost/units/physical_dimensions/length.hpp>
|
||||
#include <boost/units/base_units/si/meter.hpp>
|
||||
#include <boost/units/conversion.hpp>
|
||||
|
||||
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, yard, "yard", "yd", 0.9144, si::meter_base_unit, -501); // exact conversion
|
||||
|
||||
#if BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::yard_base_unit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP
|
||||
@@ -0,0 +1,676 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_CMATH_HPP
|
||||
#define BOOST_UNITS_CMATH_HPP
|
||||
|
||||
#include <boost/config/no_tr1/cmath.hpp>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
#include <boost/math/special_functions/hypot.hpp>
|
||||
#include <boost/math/special_functions/next.hpp>
|
||||
#include <boost/math/special_functions/round.hpp>
|
||||
#include <boost/math/special_functions/sign.hpp>
|
||||
|
||||
#include <boost/units/dimensionless_quantity.hpp>
|
||||
#include <boost/units/pow.hpp>
|
||||
#include <boost/units/quantity.hpp>
|
||||
#include <boost/units/detail/cmath_impl.hpp>
|
||||
#include <boost/units/detail/dimensionless_unit.hpp>
|
||||
|
||||
#include <boost/units/systems/si/plane_angle.hpp>
|
||||
|
||||
/// \file
|
||||
/// \brief Overloads of functions in \<cmath\> for quantities.
|
||||
/// \details Only functions for which a dimensionally-correct result type
|
||||
/// can be determined are overloaded.
|
||||
/// All functions work with dimensionless quantities.
|
||||
|
||||
// BOOST_PREVENT_MACRO_SUBSTITUTION is needed on certain compilers that define
|
||||
// some <cmath> functions as macros; it is used for all functions even though it
|
||||
// isn't necessary -- I didn't want to think :)
|
||||
//
|
||||
// the form using namespace detail; return(f(x)); is used
|
||||
// to enable ADL for UDTs.
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
bool
|
||||
isfinite BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using boost::math::isfinite;
|
||||
return isfinite BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
bool
|
||||
isinf BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using boost::math::isinf;
|
||||
return isinf BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
bool
|
||||
isnan BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using boost::math::isnan;
|
||||
return isnan BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
bool
|
||||
isnormal BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using boost::math::isnormal;
|
||||
return isnormal BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
bool
|
||||
isgreater BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using namespace detail;
|
||||
return isgreater BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
bool
|
||||
isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using namespace detail;
|
||||
return isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
bool
|
||||
isless BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using namespace detail;
|
||||
return isless BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
bool
|
||||
islessequal BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using namespace detail;
|
||||
return islessequal BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
bool
|
||||
islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using namespace detail;
|
||||
return islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
bool
|
||||
isunordered BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using namespace detail;
|
||||
return isunordered BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
abs BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using std::abs;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(abs BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
ceil BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using std::ceil;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(ceil BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
copysign BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using boost::math::copysign;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(copysign BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
fabs BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using std::fabs;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(fabs BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
floor BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using std::floor;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(floor BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
fdim BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using namespace detail;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(fdim BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
template<class Unit1,class Unit2,class Unit3,class Y>
|
||||
inline
|
||||
typename add_typeof_helper<
|
||||
typename multiply_typeof_helper<quantity<Unit1,Y>,
|
||||
quantity<Unit2,Y> >::type,
|
||||
quantity<Unit3,Y> >::type
|
||||
fma BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit1,Y>& q1,
|
||||
const quantity<Unit2,Y>& q2,
|
||||
const quantity<Unit3,Y>& q3)
|
||||
{
|
||||
using namespace detail;
|
||||
|
||||
typedef quantity<Unit1,Y> type1;
|
||||
typedef quantity<Unit2,Y> type2;
|
||||
typedef quantity<Unit3,Y> type3;
|
||||
|
||||
typedef typename multiply_typeof_helper<type1,type2>::type prod_type;
|
||||
typedef typename add_typeof_helper<prod_type,type3>::type quantity_type;
|
||||
|
||||
return quantity_type::from_value(fma BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value(),q3.value()));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
fmax BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using namespace detail;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(fmax BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
fmin BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using namespace detail;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(fmin BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
int
|
||||
fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using boost::math::fpclassify;
|
||||
|
||||
return fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
typename root_typeof_helper<
|
||||
typename add_typeof_helper<
|
||||
typename power_typeof_helper<quantity<Unit,Y>,
|
||||
static_rational<2> >::type,
|
||||
typename power_typeof_helper<quantity<Unit,Y>,
|
||||
static_rational<2> >::type>::type,
|
||||
static_rational<2> >::type
|
||||
hypot BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using boost::math::hypot;
|
||||
|
||||
typedef quantity<Unit,Y> type1;
|
||||
|
||||
typedef typename power_typeof_helper<type1,static_rational<2> >::type pow_type;
|
||||
typedef typename add_typeof_helper<pow_type,pow_type>::type add_type;
|
||||
typedef typename root_typeof_helper<add_type,static_rational<2> >::type quantity_type;
|
||||
|
||||
return quantity_type::from_value(hypot BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
|
||||
}
|
||||
|
||||
// does ISO C++ support long long? g++ claims not
|
||||
//template<class Unit,class Y>
|
||||
//inline
|
||||
//quantity<Unit,long long>
|
||||
//llrint BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
//{
|
||||
// using namespace detail;
|
||||
//
|
||||
// typedef quantity<Unit,long long> quantity_type;
|
||||
//
|
||||
// return quantity_type::from_value(llrint BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
|
||||
//}
|
||||
|
||||
// does ISO C++ support long long? g++ claims not
|
||||
//template<class Unit,class Y>
|
||||
//inline
|
||||
//quantity<Unit,long long>
|
||||
//llround BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
//{
|
||||
// using namespace detail;
|
||||
//
|
||||
// typedef quantity<Unit,long long> quantity_type;
|
||||
//
|
||||
// return quantity_type::from_value(llround BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
|
||||
//}
|
||||
|
||||
#if 0
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
nearbyint BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using namespace detail;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(nearbyint BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y> nextafter BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using boost::math::nextafter;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(nextafter BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
|
||||
}
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y> nexttoward BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
|
||||
const quantity<Unit,Y>& q2)
|
||||
{
|
||||
// the only difference between nextafter and nexttowards is
|
||||
// in the argument types. Since we are requiring identical
|
||||
// argument types, there is no difference.
|
||||
using boost::math::nextafter;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(nextafter BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
rint BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using namespace detail;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(rint BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
round BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using boost::math::round;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(round BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
int
|
||||
signbit BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using boost::math::signbit;
|
||||
|
||||
return signbit BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit,Y>
|
||||
trunc BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
|
||||
{
|
||||
using namespace detail;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(trunc BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
quantity<Unit, Y>
|
||||
fmod(const quantity<Unit,Y>& q1, const quantity<Unit,Y>& q2)
|
||||
{
|
||||
using std::fmod;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(fmod(q1.value(), q2.value()));
|
||||
}
|
||||
|
||||
template<class Unit, class Y>
|
||||
inline
|
||||
quantity<Unit, Y>
|
||||
modf(const quantity<Unit, Y>& q1, quantity<Unit, Y>* q2)
|
||||
{
|
||||
using std::modf;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(modf(q1.value(), &quantity_cast<Y&>(*q2)));
|
||||
}
|
||||
|
||||
template<class Unit, class Y, class Int>
|
||||
inline
|
||||
quantity<Unit, Y>
|
||||
frexp(const quantity<Unit, Y>& q,Int* ex)
|
||||
{
|
||||
using std::frexp;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(frexp(q.value(),ex));
|
||||
}
|
||||
|
||||
/// For non-dimensionless quantities, integral and rational powers
|
||||
/// and roots can be computed by @c pow<Ex> and @c root<Rt> respectively.
|
||||
template<class S, class Y>
|
||||
inline
|
||||
quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>
|
||||
pow(const quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>& q1,
|
||||
const quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>& q2)
|
||||
{
|
||||
using std::pow;
|
||||
|
||||
typedef quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S),Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(pow(q1.value(), q2.value()));
|
||||
}
|
||||
|
||||
template<class S, class Y>
|
||||
inline
|
||||
quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>
|
||||
exp(const quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>& q)
|
||||
{
|
||||
using std::exp;
|
||||
|
||||
typedef quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(exp(q.value()));
|
||||
}
|
||||
|
||||
template<class Unit, class Y, class Int>
|
||||
inline
|
||||
quantity<Unit, Y>
|
||||
ldexp(const quantity<Unit, Y>& q,const Int& ex)
|
||||
{
|
||||
using std::ldexp;
|
||||
|
||||
typedef quantity<Unit,Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(ldexp(q.value(), ex));
|
||||
}
|
||||
|
||||
template<class S, class Y>
|
||||
inline
|
||||
quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>
|
||||
log(const quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>& q)
|
||||
{
|
||||
using std::log;
|
||||
|
||||
typedef quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(log(q.value()));
|
||||
}
|
||||
|
||||
template<class S, class Y>
|
||||
inline
|
||||
quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>
|
||||
log10(const quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>& q)
|
||||
{
|
||||
using std::log10;
|
||||
|
||||
typedef quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y> quantity_type;
|
||||
|
||||
return quantity_type::from_value(log10(q.value()));
|
||||
}
|
||||
|
||||
template<class Unit,class Y>
|
||||
inline
|
||||
typename root_typeof_helper<
|
||||
quantity<Unit,Y>,
|
||||
static_rational<2>
|
||||
>::type
|
||||
sqrt(const quantity<Unit,Y>& q)
|
||||
{
|
||||
using std::sqrt;
|
||||
|
||||
typedef typename root_typeof_helper<
|
||||
quantity<Unit,Y>,
|
||||
static_rational<2>
|
||||
>::type quantity_type;
|
||||
|
||||
return quantity_type::from_value(sqrt(q.value()));
|
||||
}
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
// trig functions with si argument/return types
|
||||
|
||||
/// cos of theta in radians
|
||||
template<class Y>
|
||||
typename dimensionless_quantity<si::system,Y>::type
|
||||
cos(const quantity<si::plane_angle,Y>& theta)
|
||||
{
|
||||
using std::cos;
|
||||
return cos(theta.value());
|
||||
}
|
||||
|
||||
/// sin of theta in radians
|
||||
template<class Y>
|
||||
typename dimensionless_quantity<si::system,Y>::type
|
||||
sin(const quantity<si::plane_angle,Y>& theta)
|
||||
{
|
||||
using std::sin;
|
||||
return sin(theta.value());
|
||||
}
|
||||
|
||||
/// tan of theta in radians
|
||||
template<class Y>
|
||||
typename dimensionless_quantity<si::system,Y>::type
|
||||
tan(const quantity<si::plane_angle,Y>& theta)
|
||||
{
|
||||
using std::tan;
|
||||
return tan(theta.value());
|
||||
}
|
||||
|
||||
/// cos of theta in other angular units
|
||||
template<class System,class Y>
|
||||
typename dimensionless_quantity<System,Y>::type
|
||||
cos(const quantity<unit<plane_angle_dimension,System>,Y>& theta)
|
||||
{
|
||||
return cos(quantity<si::plane_angle,Y>(theta));
|
||||
}
|
||||
|
||||
/// sin of theta in other angular units
|
||||
template<class System,class Y>
|
||||
typename dimensionless_quantity<System,Y>::type
|
||||
sin(const quantity<unit<plane_angle_dimension,System>,Y>& theta)
|
||||
{
|
||||
return sin(quantity<si::plane_angle,Y>(theta));
|
||||
}
|
||||
|
||||
/// tan of theta in other angular units
|
||||
template<class System,class Y>
|
||||
typename dimensionless_quantity<System,Y>::type
|
||||
tan(const quantity<unit<plane_angle_dimension,System>,Y>& theta)
|
||||
{
|
||||
return tan(quantity<si::plane_angle,Y>(theta));
|
||||
}
|
||||
|
||||
/// acos of dimensionless quantity returning angle in same system
|
||||
template<class Y,class System>
|
||||
quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>
|
||||
acos(const quantity<unit<dimensionless_type, homogeneous_system<System> >,Y>& val)
|
||||
{
|
||||
using std::acos;
|
||||
return quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>(acos(val.value())*si::radians);
|
||||
}
|
||||
|
||||
/// acos of dimensionless quantity returning angle in radians
|
||||
template<class Y>
|
||||
quantity<angle::radian_base_unit::unit_type,Y>
|
||||
acos(const quantity<unit<dimensionless_type, heterogeneous_dimensionless_system>,Y>& val)
|
||||
{
|
||||
using std::acos;
|
||||
return quantity<angle::radian_base_unit::unit_type,Y>::from_value(acos(val.value()));
|
||||
}
|
||||
|
||||
/// asin of dimensionless quantity returning angle in same system
|
||||
template<class Y,class System>
|
||||
quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>
|
||||
asin(const quantity<unit<dimensionless_type, homogeneous_system<System> >,Y>& val)
|
||||
{
|
||||
using std::asin;
|
||||
return quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>(asin(val.value())*si::radians);
|
||||
}
|
||||
|
||||
/// asin of dimensionless quantity returning angle in radians
|
||||
template<class Y>
|
||||
quantity<angle::radian_base_unit::unit_type,Y>
|
||||
asin(const quantity<unit<dimensionless_type, heterogeneous_dimensionless_system>,Y>& val)
|
||||
{
|
||||
using std::asin;
|
||||
return quantity<angle::radian_base_unit::unit_type,Y>::from_value(asin(val.value()));
|
||||
}
|
||||
|
||||
/// atan of dimensionless quantity returning angle in same system
|
||||
template<class Y,class System>
|
||||
quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>
|
||||
atan(const quantity<unit<dimensionless_type, homogeneous_system<System> >, Y>& val)
|
||||
{
|
||||
using std::atan;
|
||||
return quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>(atan(val.value())*si::radians);
|
||||
}
|
||||
|
||||
/// atan of dimensionless quantity returning angle in radians
|
||||
template<class Y>
|
||||
quantity<angle::radian_base_unit::unit_type,Y>
|
||||
atan(const quantity<unit<dimensionless_type, heterogeneous_dimensionless_system>, Y>& val)
|
||||
{
|
||||
using std::atan;
|
||||
return quantity<angle::radian_base_unit::unit_type,Y>::from_value(atan(val.value()));
|
||||
}
|
||||
|
||||
/// atan2 of @c value_type returning angle in radians
|
||||
template<class Y, class Dimension, class System>
|
||||
quantity<unit<plane_angle_dimension, homogeneous_system<System> >, Y>
|
||||
atan2(const quantity<unit<Dimension, homogeneous_system<System> >, Y>& y,
|
||||
const quantity<unit<Dimension, homogeneous_system<System> >, Y>& x)
|
||||
{
|
||||
using std::atan2;
|
||||
return quantity<unit<plane_angle_dimension, homogeneous_system<System> >, Y>(atan2(y.value(),x.value())*si::radians);
|
||||
}
|
||||
|
||||
/// atan2 of @c value_type returning angle in radians
|
||||
template<class Y, class Dimension, class System>
|
||||
quantity<angle::radian_base_unit::unit_type,Y>
|
||||
atan2(const quantity<unit<Dimension, heterogeneous_system<System> >, Y>& y,
|
||||
const quantity<unit<Dimension, heterogeneous_system<System> >, Y>& x)
|
||||
{
|
||||
using std::atan2;
|
||||
return quantity<angle::radian_base_unit::unit_type,Y>::from_value(atan2(y.value(),x.value()));
|
||||
}
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_CMATH_HPP
|
||||
@@ -0,0 +1,98 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_CONFIG_HPP
|
||||
#define BOOST_UNITS_CONFIG_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/version.hpp>
|
||||
|
||||
#ifndef BOOST_UNITS_HAS_BOOST_TYPEOF
|
||||
#if (BOOST_VERSION >= 103400)
|
||||
///INTERNAL ONLY
|
||||
#define BOOST_UNITS_HAS_BOOST_TYPEOF 1
|
||||
#else
|
||||
///INTERNAL ONLY
|
||||
#define BOOST_UNITS_HAS_BOOST_TYPEOF 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (BOOST_UNITS_HAS_BOOST_TYPEOF)
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
///INTERNAL ONLY
|
||||
#define BOOST_UNITS_HAS_TYPEOF 1
|
||||
#else
|
||||
#if (__GNUC__ && __cplusplus)
|
||||
///INTERNAL ONLY
|
||||
#define BOOST_UNITS_HAS_TYPEOF 1
|
||||
///INTERNAL ONLY
|
||||
#define BOOST_UNITS_HAS_GNU_TYPEOF 1
|
||||
#elif defined(__MWERKS__)
|
||||
///INTERNAL ONLY
|
||||
#define BOOST_UNITS_HAS_TYPEOF 1
|
||||
///INTERNAL ONLY
|
||||
#define BOOST_UNITS_HAS_MWERKS_TYPEOF 1
|
||||
#else
|
||||
///INTERNAL ONLY
|
||||
#define BOOST_UNITS_HAS_TYPEOF 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// uncomment this to test without typeof support at all
|
||||
//#undef BOOST_UNITS_HAS_TYPEOF
|
||||
//#define BOOST_UNITS_HAS_TYPEOF 0
|
||||
|
||||
#ifndef BOOST_UNITS_NO_COMPILER_CHECK
|
||||
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATES
|
||||
#error Boost.Units requires member template
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
|
||||
#error Boost.Units requires member template keyword
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
#error Boost.Units requires in class member initialization
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
#error Boost.Units requires function template partial ordering
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
|
||||
///INTERNAL ONLY
|
||||
#define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) BOOST_STATIC_ASSERT((sizeof(a) == sizeof(b)))
|
||||
#else
|
||||
///INTERNAL ONLY
|
||||
#define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) ((void)0)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_UNITS_DOXYGEN
|
||||
|
||||
/// If defined will trigger a static assertion if quantity<Unit, T>
|
||||
/// is not layout compatible with T
|
||||
#define BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
|
||||
|
||||
/// If defined will disable a preprocessor check that the
|
||||
/// compiler is able to handle the library.
|
||||
#define BOOST_UNITS_NO_COMPILER_CHECK
|
||||
|
||||
/// Enable checking to verify that a homogeneous system
|
||||
/// is actually capable of representing all the dimensions
|
||||
/// that it is used with. Off by default.
|
||||
#define BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,185 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_CONVERSION_HPP
|
||||
#define BOOST_UNITS_CONVERSION_HPP
|
||||
|
||||
/// \file
|
||||
/// \brief Template for defining conversions between quantities.
|
||||
|
||||
#include <boost/units/detail/conversion_impl.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
template<class From, class To>
|
||||
struct conversion_helper;
|
||||
|
||||
#ifdef BOOST_UNITS_DOXYGEN
|
||||
|
||||
/// Template for defining conversions between
|
||||
/// quantities. This template should be specialized
|
||||
/// for every quantity that allows conversions.
|
||||
/// For example, if you have a two units
|
||||
/// called pair and dozen you would write
|
||||
/// @code
|
||||
/// namespace boost {
|
||||
/// namespace units {
|
||||
/// template<class T0, class T1>
|
||||
/// struct conversion_helper<quantity<dozen, T0>, quantity<pair, T1> >
|
||||
/// {
|
||||
/// static quantity<pair, T1> convert(const quantity<dozen, T0>& source)
|
||||
/// {
|
||||
/// return(quantity<pair, T1>::from_value(6 * source.value()));
|
||||
/// }
|
||||
/// };
|
||||
/// }
|
||||
/// }
|
||||
/// @endcode
|
||||
///
|
||||
/// In most cases, the predefined specializations for @c unit
|
||||
/// and @c absolute should be sufficient, so users should rarely
|
||||
/// need to use this.
|
||||
template<class From, class To>
|
||||
struct conversion_helper
|
||||
{
|
||||
static To convert(const From&);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/// Defines the conversion factor from a base unit to any unit
|
||||
/// or to another base unit with the correct dimensions. Uses
|
||||
/// of this macro must appear at global scope.
|
||||
/// If the destination unit is a base unit or a unit that contains
|
||||
/// only one base unit which is raised to the first power (e.g. feet->meters)
|
||||
/// the reverse (meters->feet in this example) need not be defined explicitly.
|
||||
#define BOOST_UNITS_DEFINE_CONVERSION_FACTOR(Source, Destination, type_, value_) \
|
||||
namespace boost { \
|
||||
namespace units { \
|
||||
template<> \
|
||||
struct select_base_unit_converter< \
|
||||
unscale<Source>::type, \
|
||||
unscale<reduce_unit<Destination::unit_type>::type>::type \
|
||||
> \
|
||||
{ \
|
||||
typedef Source source_type; \
|
||||
typedef reduce_unit<Destination::unit_type>::type destination_type; \
|
||||
}; \
|
||||
template<> \
|
||||
struct base_unit_converter<Source, reduce_unit<Destination::unit_type>::type> \
|
||||
{ \
|
||||
static const bool is_defined = true; \
|
||||
typedef type_ type; \
|
||||
static type value() { return(value_); } \
|
||||
}; \
|
||||
} \
|
||||
} \
|
||||
void boost_units_require_semicolon()
|
||||
|
||||
/// Defines the conversion factor from a base unit to any other base
|
||||
/// unit with the same dimensions. Params should be a Boost.Preprocessor
|
||||
/// Seq of template parameters, such as (class T1)(class T2)
|
||||
/// All uses of must appear at global scope. The reverse conversion will
|
||||
/// be defined automatically. This macro is a little dangerous, because,
|
||||
/// unlike the non-template form, it will silently fail if either base
|
||||
/// unit is scaled. This is probably not an issue if both the source
|
||||
/// and destination types depend on the template parameters, but be aware
|
||||
/// that a generic conversion to kilograms is not going to work.
|
||||
#define BOOST_UNITS_DEFINE_CONVERSION_FACTOR_TEMPLATE(Params, Source, Destination, type_, value_) \
|
||||
namespace boost { \
|
||||
namespace units { \
|
||||
template<BOOST_PP_SEQ_ENUM(Params)> \
|
||||
struct base_unit_converter< \
|
||||
Source, \
|
||||
BOOST_UNITS_MAKE_HETEROGENEOUS_UNIT(Destination, typename Source::dimension_type)\
|
||||
> \
|
||||
{ \
|
||||
static const bool is_defined = true; \
|
||||
typedef type_ type; \
|
||||
static type value() { return(value_); } \
|
||||
}; \
|
||||
} \
|
||||
} \
|
||||
void boost_units_require_semicolon()
|
||||
|
||||
/// Specifies the default conversion to be applied when
|
||||
/// no direct conversion is available.
|
||||
/// Source is a base unit. Dest is any unit with the
|
||||
/// same dimensions.
|
||||
#define BOOST_UNITS_DEFAULT_CONVERSION(Source, Dest) \
|
||||
namespace boost { \
|
||||
namespace units { \
|
||||
template<> \
|
||||
struct unscaled_get_default_conversion<unscale<Source>::type> \
|
||||
{ \
|
||||
static const bool is_defined = true; \
|
||||
typedef Dest::unit_type type; \
|
||||
}; \
|
||||
} \
|
||||
} \
|
||||
void boost_units_require_semicolon()
|
||||
|
||||
/// Specifies the default conversion to be applied when
|
||||
/// no direct conversion is available.
|
||||
/// Params is a PP Sequence of template arguments.
|
||||
/// Source is a base unit. Dest is any unit with the
|
||||
/// same dimensions. The source must not be a scaled
|
||||
/// base unit.
|
||||
#define BOOST_UNITS_DEFAULT_CONVERSION_TEMPLATE(Params, Source, Dest) \
|
||||
namespace boost { \
|
||||
namespace units { \
|
||||
template<BOOST_PP_SEQ_ENUM(Params)> \
|
||||
struct unscaled_get_default_conversion<Source> \
|
||||
{ \
|
||||
static const bool is_defined = true; \
|
||||
typedef typename Dest::unit_type type; \
|
||||
}; \
|
||||
} \
|
||||
} \
|
||||
void boost_units_require_semicolon()
|
||||
|
||||
/// INTERNAL ONLY
|
||||
/// Users should not create their units in namespace boost::units.
|
||||
/// If we want to make this public it needs to allow better control over
|
||||
/// the namespaces. --SJW.
|
||||
/// template that defines a base_unit and conversion to another dimensionally-consistent unit
|
||||
#define BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(namespace_, name_, name_string_, symbol_string_, factor, unit, id)\
|
||||
namespace boost { \
|
||||
namespace units { \
|
||||
namespace namespace_ { \
|
||||
struct name_ ## _base_unit \
|
||||
: base_unit<name_ ## _base_unit, unit::dimension_type, id> { \
|
||||
static const char* name() { return(name_string_); } \
|
||||
static const char* symbol() { return(symbol_string_); } \
|
||||
}; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
BOOST_UNITS_DEFINE_CONVERSION_FACTOR(namespace_::name_ ## _base_unit, unit, double, factor); \
|
||||
BOOST_UNITS_DEFAULT_CONVERSION(namespace_::name_ ## _base_unit, unit)
|
||||
|
||||
/// Find the conversion factor between two units.
|
||||
template<class FromUnit,class ToUnit>
|
||||
inline
|
||||
typename one_to_double_type<
|
||||
typename detail::conversion_factor_helper<FromUnit, ToUnit>::type
|
||||
>::type
|
||||
conversion_factor(const FromUnit&,const ToUnit&)
|
||||
{
|
||||
return(one_to_double(detail::conversion_factor_helper<FromUnit, ToUnit>::value()));
|
||||
}
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_CONVERSION_HPP
|
||||
@@ -0,0 +1,208 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_DERIVED_DIMENSION_HPP
|
||||
#define BOOST_UNITS_DERIVED_DIMENSION_HPP
|
||||
|
||||
#include <boost/units/dim.hpp>
|
||||
#include <boost/units/dimension.hpp>
|
||||
#include <boost/units/static_rational.hpp>
|
||||
#include <boost/units/units_fwd.hpp>
|
||||
#include <boost/units/detail/dimension_list.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// A utility class for defining composite dimensions with integer powers.
|
||||
template<class DT1 = dimensionless_type,long E1 = 0,
|
||||
class DT2 = dimensionless_type,long E2 = 0,
|
||||
class DT3 = dimensionless_type,long E3 = 0,
|
||||
class DT4 = dimensionless_type,long E4 = 0,
|
||||
class DT5 = dimensionless_type,long E5 = 0,
|
||||
class DT6 = dimensionless_type,long E6 = 0,
|
||||
class DT7 = dimensionless_type,long E7 = 0,
|
||||
class DT8 = dimensionless_type,long E8 = 0>
|
||||
struct derived_dimension
|
||||
{
|
||||
#ifdef BOOST_UNITS_DOXYGEN
|
||||
typedef detail::unspecified type;
|
||||
#else
|
||||
typedef typename
|
||||
make_dimension_list< list< dim< DT1,static_rational<E1> >,
|
||||
list< dim< DT2,static_rational<E2> >,
|
||||
list< dim< DT3,static_rational<E3> >,
|
||||
list< dim< DT4,static_rational<E4> >,
|
||||
list< dim< DT5,static_rational<E5> >,
|
||||
list< dim< DT6,static_rational<E6> >,
|
||||
list< dim< DT7,static_rational<E7> >,
|
||||
list< dim< DT8,static_rational<E8> >, dimensionless_type > > > > > > > > >::type type;
|
||||
#endif
|
||||
};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class DT1,long E1>
|
||||
struct derived_dimension<
|
||||
DT1, E1,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0>
|
||||
{
|
||||
typedef typename
|
||||
make_dimension_list< list< dim< DT1,static_rational<E1> >, dimensionless_type > >::type type;
|
||||
};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class DT1,long E1,
|
||||
class DT2,long E2>
|
||||
struct derived_dimension<
|
||||
DT1, E1,
|
||||
DT2, E2,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0>
|
||||
{
|
||||
typedef typename
|
||||
make_dimension_list< list< dim< DT1,static_rational<E1> >,
|
||||
list< dim< DT2,static_rational<E2> >, dimensionless_type > > >::type type;
|
||||
};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class DT1,long E1,
|
||||
class DT2,long E2,
|
||||
class DT3,long E3>
|
||||
struct derived_dimension<
|
||||
DT1, E1,
|
||||
DT2, E2,
|
||||
DT3, E3,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0>
|
||||
{
|
||||
typedef typename
|
||||
make_dimension_list< list< dim< DT1,static_rational<E1> >,
|
||||
list< dim< DT2,static_rational<E2> >,
|
||||
list< dim< DT3,static_rational<E3> >, dimensionless_type > > > >::type type;
|
||||
};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class DT1,long E1,
|
||||
class DT2,long E2,
|
||||
class DT3,long E3,
|
||||
class DT4,long E4>
|
||||
struct derived_dimension<
|
||||
DT1, E1,
|
||||
DT2, E2,
|
||||
DT3, E3,
|
||||
DT4, E4,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0>
|
||||
{
|
||||
typedef typename
|
||||
make_dimension_list< list< dim< DT1,static_rational<E1> >,
|
||||
list< dim< DT2,static_rational<E2> >,
|
||||
list< dim< DT3,static_rational<E3> >,
|
||||
list< dim< DT4,static_rational<E4> >, dimensionless_type > > > > >::type type;
|
||||
};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class DT1,long E1,
|
||||
class DT2,long E2,
|
||||
class DT3,long E3,
|
||||
class DT4,long E4,
|
||||
class DT5,long E5>
|
||||
struct derived_dimension<
|
||||
DT1, E1,
|
||||
DT2, E2,
|
||||
DT3, E3,
|
||||
DT4, E4,
|
||||
DT5, E5,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0>
|
||||
{
|
||||
typedef typename
|
||||
make_dimension_list< list< dim< DT1,static_rational<E1> >,
|
||||
list< dim< DT2,static_rational<E2> >,
|
||||
list< dim< DT3,static_rational<E3> >,
|
||||
list< dim< DT4,static_rational<E4> >,
|
||||
list< dim< DT5,static_rational<E5> >, dimensionless_type > > > > > >::type type;
|
||||
};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class DT1,long E1,
|
||||
class DT2,long E2,
|
||||
class DT3,long E3,
|
||||
class DT4,long E4,
|
||||
class DT5,long E5,
|
||||
class DT6,long E6>
|
||||
struct derived_dimension<
|
||||
DT1, E1,
|
||||
DT2, E2,
|
||||
DT3, E3,
|
||||
DT4, E4,
|
||||
DT5, E5,
|
||||
DT6, E6,
|
||||
dimensionless_type,0,
|
||||
dimensionless_type,0>
|
||||
{
|
||||
typedef typename
|
||||
make_dimension_list< list< dim< DT1,static_rational<E1> >,
|
||||
list< dim< DT2,static_rational<E2> >,
|
||||
list< dim< DT3,static_rational<E3> >,
|
||||
list< dim< DT4,static_rational<E4> >,
|
||||
list< dim< DT5,static_rational<E5> >,
|
||||
list< dim< DT6,static_rational<E6> >, dimensionless_type > > > > > > >::type type;
|
||||
};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class DT1,long E1,
|
||||
class DT2,long E2,
|
||||
class DT3,long E3,
|
||||
class DT4,long E4,
|
||||
class DT5,long E5,
|
||||
class DT6,long E6,
|
||||
class DT7,long E7>
|
||||
struct derived_dimension<
|
||||
DT1, E1,
|
||||
DT2, E2,
|
||||
DT3, E3,
|
||||
DT4, E4,
|
||||
DT5, E5,
|
||||
DT6, E6,
|
||||
DT7, E7,
|
||||
dimensionless_type,0>
|
||||
{
|
||||
typedef typename
|
||||
make_dimension_list< list< dim< DT1,static_rational<E1> >,
|
||||
list< dim< DT2,static_rational<E2> >,
|
||||
list< dim< DT3,static_rational<E3> >,
|
||||
list< dim< DT4,static_rational<E4> >,
|
||||
list< dim< DT5,static_rational<E5> >,
|
||||
list< dim< DT6,static_rational<E6> >,
|
||||
list< dim< DT7,static_rational<E7> >, dimensionless_type > > > > > > > >::type type;
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_DERIVED_DIMENSION_HPP
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user