Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
        public override object Evaluate()
        {
            IList <double> xValues = LeftExpression.EvaluateAsRealVector();
            IList <double> yValues = RightExpression.EvaluateAsRealVector();

            return(new CMatrix(CPolynomial.InterpolatingPolynomial(xValues, yValues).ToArray()));
        }