Esempio n. 1
0
        /// <summary>
        /// Evaluates the expression in the specified environment.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <returns>The evaluation result.</returns>
        public SymbolicExpression Evaluate(REnvironment environment)
        {
            if (environment == null)
            {
                throw new ArgumentNullException("environment");
            }
            if (Engine != environment.Engine)
            {
                throw new ArgumentException(null, "environment");
            }

            return new SymbolicExpression(Engine, this.GetFunction<Rf_eval>()(handle, environment.DangerousGetHandle()));
        }
Esempio n. 2
0
        /// <summary>
        /// Evaluates the expression in the specified environment.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <param name="result">The evaluation result, or <c>null</c> if the evaluation failed</param>
        /// <returns><c>True</c> if the evaluation succeeded.</returns>
        public bool TryEvaluate(REnvironment environment, out SymbolicExpression result)
        {
            if (environment == null)
            {
                throw new ArgumentNullException("environment");
            }
            if (Engine != environment.Engine)
            {
                throw new ArgumentException(null, "environment");
            }

            bool errorOccurred;
            IntPtr pointer = this.GetFunction<R_tryEval>()(handle, environment.DangerousGetHandle(), out errorOccurred);
            result = errorOccurred ? null : new SymbolicExpression(Engine, pointer);
            return !errorOccurred;
        }
Esempio n. 3
0
        /// <summary>
        /// Evaluates the expression in the specified environment.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <param name="result">The evaluation result, or <c>null</c> if the evaluation failed</param>
        /// <returns><c>True</c> if the evaluation succeeded.</returns>
        public bool TryEvaluate(REnvironment environment, out SymbolicExpression result)
        {
            if (environment == null)
            {
                throw new ArgumentNullException("environment");
            }
            if (Engine != environment.Engine)
            {
                throw new ArgumentException(null, "environment");
            }

            bool   errorOccurred;
            IntPtr pointer = this.GetFunction <R_tryEval>()(handle, environment.DangerousGetHandle(), out errorOccurred);

            result = errorOccurred ? null : new SymbolicExpression(Engine, pointer);
            return(!errorOccurred);
        }
Esempio n. 4
0
        /// <summary>
        /// Evaluates the expression in the specified environment.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <returns>The evaluation result.</returns>
        public SymbolicExpression Evaluate(REnvironment environment)
        {
            if (environment == null)
            {
                throw new ArgumentNullException("environment");
            }
            if (Engine != environment.Engine)
            {
                throw new ArgumentException(null, "environment");
            }

            return(new SymbolicExpression(Engine, this.GetFunction <Rf_eval>()(handle, environment.DangerousGetHandle())));
        }