carl  24.04
Computer ARithmetic Library
Conversion.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Interval.h"
5 
6 namespace carl {
7 
8  template<typename From, typename To, carl::DisableIf< std::is_same<From,To> > = dummy >
9  inline Interval<To> convert(const Interval<From>& i) {
10  return Interval<To>(carl::convert<From,To>(i.lower()), i.lower_bound_type(), carl::convert<From,To>(i.upper()), i.upper_bound_type());
11  }
12 
13  template<typename From, typename To, carl::EnableIf< std::is_same<From,To> > = dummy >
14  inline Interval<To> convert(const Interval<From>& i) {
15  return i;
16  }
17 
18 } // namespace
carl is the main namespace for the library.
BasicConstraint< ToPoly > convert(const typename ToPoly::ContextType &context, const BasicConstraint< FromPoly > &c)
Definition: Conversion.h:9
The class which contains the interval arithmetic including trigonometric functions.
Definition: Interval.h:134
BoundType lower_bound_type() const
The getter for the lower bound type of the interval.
Definition: Interval.h:883
const Number & upper() const
The getter for the upper boundary of the interval.
Definition: Interval.h:849
const Number & lower() const
The getter for the lower boundary of the interval.
Definition: Interval.h:840
BoundType upper_bound_type() const
The getter for the upper bound type of the interval.
Definition: Interval.h:892