Commit 0fef1430 authored by Heiko Becker's avatar Heiko Becker

Fix some minor details, as discussed in Merge Request

parent 6c7edec9
......@@ -33,7 +33,7 @@ object RangeErrorPhase extends DaisyPhase with ErrorFunctions {
optionPrecision
)
implicit val debugSection = DebugSectionAnalysis
override implicit val debugSection = DebugSectionAnalysis
var reporter: Reporter = null
......
......@@ -32,7 +32,8 @@ trait ErrorFunctions {
var uniformPrecision: Precision = Float64
var reporter: Reporter
val debugSection: DebugSection
implicit val debugSection = DebugSectionAnalysis
/**
* Calculate static error using interval ranges and interval errors
......@@ -48,7 +49,7 @@ trait ErrorFunctions {
val (_, error) = evaluate[Interval, Interval](
expr,
inputValMap,
inputErrorMap.mapValues(Interval.fromError(_)),
inputErrorMap.map(x => (x._1 -> Interval.fromError(x._2))),
Interval.apply,
Interval.zero,
Interval.fromError,
......@@ -323,7 +324,7 @@ trait ErrorFunctions {
x.absError = maxAbs(error.toInterval)
}
//print state
reporter.info(s"$x: ${x.interval},${x.absError}")
reporter.debug(s"$x: ${x.interval},${x.absError}")
(range, error)
case x @ RealLiteral(r) =>
......@@ -338,7 +339,7 @@ trait ErrorFunctions {
x.interval = range.toInterval
}
//print state
reporter.info(s"$x: ${x.interval},${x.absError}")
reporter.debug(s"$x: ${x.interval},${x.absError}")
(range, error)
case x @ Plus(lhs, rhs) =>
......@@ -355,7 +356,7 @@ trait ErrorFunctions {
x.interval = range.toInterval
}
//print state
reporter.info(s"$x: ${x.interval},${x.absError}")
reporter.debug(s"$x: ${x.interval},${x.absError}")
(range, newError)
case x @ Minus(lhs, rhs) =>
......@@ -372,7 +373,7 @@ trait ErrorFunctions {
x.interval = range.toInterval
}
//print state
reporter.info(s"$x: ${x.interval},${x.absError}")
reporter.debug(s"$x: ${x.interval},${x.absError}")
(range, newError)
case x @ Times(lhs, rhs) =>
......@@ -395,7 +396,7 @@ trait ErrorFunctions {
x.interval = range.toInterval
}
//print state
reporter.info(s"$x: ${x.interval},${x.absError}")
reporter.debug(s"$x: ${x.interval},${x.absError}")
(range, newError)
case x @ Division(lhs, rhs) =>
......@@ -425,7 +426,7 @@ trait ErrorFunctions {
x.interval = range.toInterval
}
//print state
reporter.info(s"$x: ${x.interval},${x.absError}")
reporter.debug(s"$x: ${x.interval},${x.absError}")
(range, newError)
case x @ UMinus(t) =>
......
......@@ -15,10 +15,10 @@ object Interval {
def apply(i: Interval): Interval = i
def fromError(absError: Rational): Interval = {
Interval(-absError, absError) //TODO verify
Interval(-absError, absError)
}
val zero: Interval = Interval(0,0)
val zero: Interval = Interval(0)
}
case class PartialInterval(xlo: Option[Rational], xhi: Option[Rational])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment