Commit 2da6d0d1 authored by Anastasiia's avatar Anastasiia

uncomment

parent bbe0cbc9
......@@ -64,19 +64,19 @@ trait Taylor{
List(x)
}
// reporter.warning("=== BEFOREEXPRESSION ==== list Nominators " + nom)
// reporter.warning("=== BEFOREEXPRESSION ==== list Denominators " + denom)
reporter.warning("=== BEFOREEXPRESSION ==== list Nominators " + nom)
reporter.warning("=== BEFOREEXPRESSION ==== list Denominators " + denom)
// get lists of the elements in nominator and denominator
val noms = listElements(nom)
val denoms = listElements(denom)
// reporter.warning(s"===BEFORE==== list Nominators $noms")
// reporter.warning(s"===BEFORE==== list Denominators $denoms")
reporter.warning(s"===BEFORE==== list Nominators $noms")
reporter.warning(s"===BEFORE==== list Denominators $denoms")
// get repeating terms in nominator and denominator
val toExtract = noms.intersect(denoms)
// reporter.warning(s"===EXTRACT=== $toExtract")
reporter.warning(s"===EXTRACT=== $toExtract")
// remove repeating terms from nominator and denominator
val newNomList = noms.diff(toExtract)
......@@ -86,8 +86,8 @@ trait Taylor{
// multiply the terms that left
val newNom = multiply(newNomList)
val newDenom = multiply(newDenomList)
// reporter.warning(s"===AFTER==== Nominator $newNom")
// reporter.warning(s"===AFTER==== Denominator $newDenom")
reporter.warning(s"===AFTER==== Nominator $newNom")
reporter.warning(s"===AFTER==== Denominator $newDenom")
if (newDenom.equals(RealLiteral(Rational.one)))
newNom
......@@ -323,6 +323,8 @@ trait Taylor{
(lhs, rhs) match {
case (RealLiteral(lhsIn), RealLiteral(rhsIn)) =>
RealLiteral(lhsIn./(rhsIn))
case (_, Division(lhsIn, rhsIn)) if lhs == one =>
Division(simpleRound(rhsIn), simpleRound(lhsIn))
// case (_, UMinus(RealLiteral(Rational.one))) =>
// UMinus(simpleRound(lhs))
// case (UMinus(lhsIn), UMinus(rhsIn)) =>
......@@ -372,6 +374,7 @@ trait Taylor{
throw new IllegalArgumentException("Unknown expression. Simplifying expression failed. " + n.toString)
}
// reporter.warning(s"COMPLETE EXPR is $ex")
while (!ready){
// simplify expression
val tmpresExpr = simpleRound(resExpr)
......@@ -379,6 +382,7 @@ trait Taylor{
ready = expressionsEqual(resExpr, tmpresExpr)
resExpr = tmpresExpr
}
// reporter.info(s"SIMPLIFIED EXPR is $resExpr")
resExpr
}
......
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