sigma  1.0.0
Loading...
Searching...
No Matches
convert.hpp File Reference

Conversions between sigma::Interval and the boost interval it wraps. More...

#include "sigma/interval/detail_/policies.hpp"
#include "sigma/interval/interval.hpp"
#include <stdexcept>
#include <string>

Go to the source code of this file.

Namespaces

namespace  sigma
 The primary namespace for the sigma library.
namespace  sigma::detail_
 The namespace that contains the implementation details of the library.

Functions

template<typename T>
boost_interval_t< T > sigma::detail_::to_boost_ (const Interval< T > &a)
 Convert a sigma::Interval into the boost interval it wraps.
template<typename T>
Interval< T > sigma::detail_::from_boost_ (const boost_interval_t< T > &x)
 Convert a boost interval into a sigma::Interval.
template<typename T>
void sigma::detail_::assert_within_unit_ (const Interval< T > &a, bool open, const std::string &name)
 Throws unless every value in a lies in the unit interval.

Detailed Description

Conversions between sigma::Interval and the boost interval it wraps.

The elementary functions of an Interval are implemented by handing the bounds to boost, which does the outwardly rounded numerics, and then restoring the one piece of state boost does not track: emptiness. These helpers are the two halves of that round trip. The counterparts for GeneralInterval, which also restore the openness of the bounds, are in general_convert.hpp.