Exemple #1
0
 /// <summary>
 /// Constructor
 /// given a binary operation with two terms
 /// </summary>
 /// <param name="op">operator id</param>
 /// <param name="t1">left term</param>
 /// <param name="t2">right term</param>
 protected BinaryOperation(char op, IArithmetic t1, IArithmetic t2)
 {
     this[operatorName]  = op;
     this[leftTermName]  = t1.Clone();
     this[rightTermName] = t2.Clone();
 }
Exemple #2
0
 /// <summary>
 /// Add an addition to the sum
 /// </summary>
 /// <param name="a">element to add</param>
 public void Add(IArithmetic a)
 {
     this.List.Add(a.Clone() as IArithmetic);
 }
Exemple #3
0
 /// <summary>
 /// Constructor
 /// given a letter name to
 /// identify unknown term
 /// given its equation
 /// </summary>
 /// <param name="letter">ketter</param>
 /// <param name="eq">equation</param>
 public UnknownTerm(string letter, IArithmetic eq)
 {
     this[letterName]   = letter;
     this[hasValueName] = true;
     this[equationName] = eq.Clone() as IArithmetic;
 }
Exemple #4
0
 /// <summary>
 /// Constructor
 /// given a unary operation with one term
 /// </summary>
 /// <param name="op">operator</param>
 /// <param name="t">term</param>
 protected UnaryOperation(char op, IArithmetic t)
 {
     this[operatorName]     = op;
     this[innerOperandName] = t.Clone();
 }
 /// <summary>
 /// Constructor for a term
 /// </summary>
 /// <param name="c">constant equation</param>
 /// <param name="s">coefficient equation</param>
 /// <param name="u">unknown term equation</param>
 public Term(IArithmetic c, IArithmetic s, IArithmetic u)
 {
     this[constantName] = c.Clone();
     this[coefName]     = s.Clone();
     this[unknownName]  = u.Clone();
 }