/// <summary> /// For use by the clone method. /// </summary> protected ClLinearExpression(ClDouble constant, Dictionary <ClAbstractVariable, ClDouble> terms) { _constant = constant.Clone(); _terms = new Dictionary <ClAbstractVariable, ClDouble>(); // need to unalias the ClDouble-s that we clone (do a deep clone) foreach (var clv in terms.Keys) { _terms.Add(clv, (terms[clv]).Clone()); } }
/// <summary> /// For use by the clone method. /// </summary> protected ClLinearExpression(ClDouble constant, Hashtable terms) { if (Cl.GC) { Console.Error.WriteLine("clone ClLinearExpression"); } _constant = (ClDouble)constant.Clone(); _terms = new Hashtable(); // need to unalias the ClDouble-s that we clone (do a deep clone) foreach (ClAbstractVariable clv in terms.Keys) { _terms.Add(clv, ((ClDouble)terms[clv]).Clone()); } }
/// <summary> /// For use by the clone method. /// </summary> protected ClLinearExpression(ClDouble constant, Hashtable terms) { if (Cl.GC) { Console.Error.WriteLine("clone ClLinearExpression"); } _constant = (ClDouble) constant.Clone(); _terms = new Hashtable(); // need to unalias the ClDouble-s that we clone (do a deep clone) foreach (ClAbstractVariable clv in terms.Keys) { _terms.Add(clv, ((ClDouble) terms[clv]).Clone()); } }