module Data.Number.ER.Real.Approx.OI where
import qualified Data.Number.ER.Real.Approx as RA
data ERApproxOI ra =
ERApproxOI
{
eroiOuter :: ra,
eroiInner :: ra
}
deriving (Eq, Ord)
instance (RA.ERApprox ra) => (Show (ERApproxOI ra))
where
show (ERApproxOI oi ii) =
"{ outer = " ++ show oi ++ "; inner = " ++ show ii ++ "}"
instance (RA.ERApprox ra) => RA.ERApproxApprox (ERApproxOI ra)
where
safeIncludes (ERApproxOI oi1 ii1) (ERApproxOI oi2 ii2) =
oi2 `RA.refines` ii1
safeNotIncludes (ERApproxOI oi1 ii1) (ERApproxOI oi2 ii2) =
not $ ii2 `RA.refines` oi1
instance (RA.ERApprox ra) => (Num (ERApproxOI ra))
instance (RA.ERApprox ra) => (Fractional (ERApproxOI ra))
instance (RA.ERApprox ra) => RA.ERApprox (ERApproxOI ra)
where
(ERApproxOI oi1 ii1) `leqReals` (ERApproxOI oi2 ii2) =
oi1 `RA.leqReals` oi2