public override object Evaluate() { IList <double> v = LeftExpression.EvaluateAsRealVector(); if (RightExpression == Expression <Object> .Null) { return(new CMatrix(MathStats.Histogram(v))); } else { object intvals = RightExpression.Evaluate(); if (intvals is Complex) { return(new CMatrix(MathStats.Histogram(v, ExpressionExtensions.AsInt32((Complex)intvals)))); } else if (intvals is CMatrix) { return(new CMatrix(MathStats.Histogram(v, ExpressionExtensions.AsRealVector((CMatrix)intvals)))); } else { throw ExceptionHelper.ThrowWrongArgumentType(intvals); } } }
public override object Evaluate() { IList <double> xValues = LeftExpression.EvaluateAsRealVector(); IList <double> yValues = RightExpression.EvaluateAsRealVector(); return(new CMatrix(CPolynomial.InterpolatingPolynomial(xValues, yValues).ToArray())); }