Commit 878b9fed authored by Anastasiia's avatar Anastasiia

fix the "element not found exception" for listFailed

parent 60697f73
......@@ -248,6 +248,7 @@ object RelativeErrorPhase extends DaisyPhase with Subdivision with ErrorFunction
}
listFailInterval = (listFailInterval ++ listFailed).toSet.toList
reporter.debug("print what is ACTUALLY in ListFailed " + listFailed.map(removeDeltasFromMap).map(_.keySet.map(_.globalId)))
(finalErr, listFailInterval)
}
......
......@@ -692,6 +692,8 @@ trait Taylor{
def getTaylorRemainder(e:Expr, intervals: Seq[Map[Identifier, Interval]]): Option[Rational] = {
val simple = easySimplify(e)
reporter.debug("WHAT is INITIALLY in the listFailed " + listFailed.map(removeDeltasFromMap).map(_.keySet.map(_.globalId)))
// both deltas and epsilons
val deltas:Set[Expr with Identifiable] = deltasOf(simple) ++ epsilonsOf(simple)
//todo fix fold or map
......@@ -712,7 +714,9 @@ trait Taylor{
if (interval.isDefined)
Some(maxAbs(interval.get))
else {
listFailed = listFailed :+ x
if (!listFailed.contains(x)) {
listFailed = listFailed :+ x
}
None
}
})
......@@ -720,6 +724,10 @@ trait Taylor{
}
else None
})
// remove a dummy entry from the list
reporter.debug(s"before "+ listFailed.map(removeDeltasFromMap))
listFailed = listFailed.filter(x => removeDeltasFromMap(x).keySet == removeDeltasFromMap(intervals.head).keySet)
reporter.debug(s"after "+ listFailed.map(removeDeltasFromMap))
tmpValOut.fold(None)(sumOption)
})
......
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