public virtual double Evaluate(Vector vec) { if (vec.Size != Variables.Count) { throw new ArgumentException("Incorrect number of the arguments"); } Values values = new Values(); for (int i = 0; i < vec.Size; i++) { values.Assign(Variables[i], vec[i]); } return(m_expTree.Evaluate(values)); }