public void Dealloc() { iBookmarkManager.EventBookmarkAdded -= ModelChanged; iBookmarkManager.EventBookmarkRemoved -= ModelChanged; iBookmarkManager.EventBookmarksChanged -= ModelChanged; View.Release(); ArrayController.Release(); this.SendMessageSuper(ThisClass, "dealloc"); }
/// <summary> /// Operator to multiply a polynomial per an monomial. /// </summary> /// <param name="polynomial"> /// The polynomial. /// </param> /// <param name="monomial"> /// The monomial. /// </param> /// <returns> /// Polynomial /// </returns> public static Polynomial operator *(Polynomial polynomial, Monomial monomial) { Polynomial p = polynomial.Clone(); if (monomial.Coefficient.Equals(0)) { p.Monomials.Clear(); p.Coefficient = 0; } else { var arrayController = ArrayController.GetInstance(); Dictionary <string, Monomial> monomialCollection = arrayController.CloneDictionary(p.Monomials); foreach (var monomialInCollection in monomialCollection.Values) { string oldKey = monomialInCollection.VariablesToString(); monomialInCollection.Multiply(monomial); string key = monomialInCollection.VariablesToString(); if (!p.Monomials.ContainsKey(key)) { p.Monomials.Add(key, monomialInCollection); } else { p.Monomials[key] = monomialInCollection; } p.Monomials.Remove(oldKey); } if (!p.Coefficient.Equals(0)) { Monomial maux = monomial.Clone(); maux.Multiply(p.Coefficient); string key = monomial.VariablesToString(); if (!p.Monomials.ContainsKey(key)) { p.Monomials.Add(key, maux); } else { p.Monomials[key] = maux; } } p.Coefficient = 0; } return(p); }
public void Dealloc() { iModel.EventChanged -= ModelChanged; StopRefresh(); ButtonRefresh.ActionEvent -= RefreshClick; View.Release(); ArrayController.Release(); this.SendMessageSuper(ThisClass, "dealloc"); }
/// <summary> /// Gets the mcm of the denominators's fractions /// </summary> /// <param name="af1"></param> /// <returns></returns> private Polynomial GetMcm(AlgebraicFraction af1) { // Calculate the mcm of the denominators obtaining a new denominator Polynomial oldDenominator = af1.Denominator; var arrayController = ArrayController.GetInstance(); af1.Denominator = arrayController.GetMcm( new[] { af1.Denominator, this.Denominator } ).GetExplicitPolynomial(); return(oldDenominator); }
/// <summary> /// Gets the opposite or the minus monomial. /// </summary> /// <returns> /// The <see cref="Monomial"/>. /// </returns> public Monomial ReverseOf() { var arrayController = ArrayController.GetInstance(); return(new Monomial(-this.Coefficient, arrayController.CloneDictionary(this.Variables))); }
void Start() { SnakeBody = new List <SnakeNode>(); AC = FindObjectOfType <ArrayController>(); }
/// <summary> /// Gets a clone of the polynomial /// </summary> /// <returns></returns> public Polynomial Clone() { var arrayController = ArrayController.GetInstance(); return(new Polynomial(this.Coefficient, arrayController.CloneDictionary(this.Monomials).Values.ToArray())); }