Пример #1
0
        /// <summary>Initializes a function that defined by expression.</summary>
        /// <exception cref="System.ArgumentException" caption=""></exception>
        /// <exception cref="System.ArgumentNullException" caption=""></exception>
        /// <exception cref="ExpressionSyntaxException" caption="ExpressionSyntaxException"></exception>
        public Implicit2DFunction(string expression)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            _expressionTree = new ExpressionTree(expression);

            if (_expressionTree.Variables.Length != 2)
            {
                throw new ArgumentException("Implicit 2D function must have two variables in expression", "expression");
            }

            _expression = expression;



            ExpressionCompiler compiler = new ExpressionCompiler(_expressionTree);

            _function = (BivariateRealFunction)compiler.CreateDelegate(typeof(BivariateRealFunction));

            base._delegate       = _function;
            base._definitionType = DefinitionType.Analytic;
        }
Пример #2
0
		/// <summary><para>Initializes a function that defined by delegate.</para></summary>
		public Explicit3DFunction(BivariateRealFunction function)
		{
			if (function == null)
				throw new ArgumentNullException("function");

			_function = function;
			base._delegate = _function;
			base._definitionType = DefinitionType.Numerical;
		}
Пример #3
0
        /// <summary><para>Initializes a function that defined by delegate.</para></summary>
        public Explicit3DFunction(BivariateRealFunction function)
        {
            if (function == null)
            {
                throw new ArgumentNullException("function");
            }

            _function            = function;
            base._delegate       = _function;
            base._definitionType = DefinitionType.Numerical;
        }
Пример #4
0
        private Explicit3DFunction(ExpressionTree tree)
        {
            _expressionTree = tree;
            _expression     = _expressionTree.ToString();

            ExpressionCompiler compiler = new ExpressionCompiler(_expressionTree);

            _function = (BivariateRealFunction)compiler.CreateDelegate(typeof(BivariateRealFunction));

            base._delegate       = _function;
            base._definitionType = DefinitionType.Analytic;
        }
Пример #5
0
		/// <summary>Initializes a function that defined by expression.</summary>
		/// <exception cref="System.ArgumentException" caption=""></exception>
		/// <exception cref="System.ArgumentNullException" caption=""></exception>
		/// <exception cref="ExpressionSyntaxException" caption="ExpressionSyntaxException"></exception>
		public Implicit2DFunction(string expression)
		{
			if (expression == null)
				throw new ArgumentNullException("expression");

			_expressionTree = new ExpressionTree(expression);

			if (_expressionTree.Variables.Length != 2)
				throw new ArgumentException("Implicit 2D function must have two variables in expression","expression");

			_expression = expression;



			ExpressionCompiler compiler = new ExpressionCompiler(_expressionTree);
			_function = (BivariateRealFunction) compiler.CreateDelegate(typeof(BivariateRealFunction));

			base._delegate = _function;
			base._definitionType = DefinitionType.Analytic;
		}
 public Explicit3DFunctionPlotter(Explicit3DFunction function)
 {
     _function = function.ValueAt;
 }
Пример #7
0
		private Explicit3DFunction (ExpressionTree tree)
		{
			_expressionTree = tree;
			_expression = _expressionTree.ToString();

			ExpressionCompiler compiler = new ExpressionCompiler(_expressionTree);
			_function = (BivariateRealFunction) compiler.CreateDelegate(typeof(BivariateRealFunction));
			
			base._delegate = _function;
			base._definitionType = DefinitionType.Analytic;
		}
		public Implicit2DFunctionPlotter(Implicit2DFunction function)
		{
			_function = function.ValueAt;
		}
		public Explicit3DFunctionPlotter(Explicit3DFunction function)
		{	
			_function = function.ValueAt;
		}
Пример #10
0
 public Implicit2DFunctionPlotter(Implicit2DFunction function)
 {
     _function = function.ValueAt;
 }