Ejemplo n.º 1
0
 static void MergeMonomial(Monomial leftMonomial, Monomial rightMonomial)
 {
     //Console.WriteLine($"{leftMonomial.Value} {leftMonomial.Action} {rightMonomial.Value} {rightMonomial.Action}");
     leftMonomial.Value  = operation[leftMonomial.Action].func(leftMonomial.Value, rightMonomial.Value);
     leftMonomial.Action = rightMonomial.Action;
 }
Ejemplo n.º 2
0
 static bool CanMergeMonomial(Monomial leftMonomial, Monomial rightMonomial)
 {
     return(GetPriority(leftMonomial.Action) >= GetPriority(rightMonomial.Action));
 }