示例#1
0
 public EquationFunctionValue(string prototype, string definition, double[] defaults)
 {
     Match m = prototypeRegex.Match(prototype);
     m_paramOrders = new string[m.Groups["VarName"].Captures.Count];
     for (int i = 0; i < m.Groups["VarName"].Captures.Count; i++)
     {
         m_paramOrders[i] = m.Groups["VarName"].Captures[i].Value;
     }
     m_Frag = EquationFragment.Parse(definition, null);
     m_defaults = defaults;
     m_sName = m.Groups["Name"].Value;
 }
示例#2
0
 public EquationGraphSeries(EquationFragment frag, string VariableName)
 {
     m_Frag = frag;
     m_GraphVariable = VariableName;
 }
示例#3
0
 public EquationGraphSeries(EquationFragment frag, string VariableName, double _MinX, double _MaxX)
 {
     m_Frag = frag;
     MinX = _MinX;
     MaxX = _MaxX;
     m_GraphVariable = VariableName;
 }
示例#4
0
 public ValueFragment(string val, EquationFragment parent)
     : base(parent)
 {
     m_sValueName = val;
     m_bIsConst = double.TryParse(val, out m_dConstValue);
 }
示例#5
0
 public UnaryOperand(string op, EquationFragment frag1, EquationFragment parent)
     : base(parent)
 {
     m_sOp = op;
     if (m_Frag1 is EmptyEquationFragment)
         throw new EmptyEquationFragmentException();
     m_Frag1 = frag1;
 }
示例#6
0
        public Function(string name, EquationFragment parameters, EquationFragment parent)
            : base(parent)
        {
            m_sFunctionName = name;
            m_Parameters = parameters;
            if (FunctionValues != null)
            {
                if (FunctionValues.ContainsKey(m_sFunctionName))
                    m_FunctionValue = FunctionValues[m_sFunctionName];
                else if (EquationFragment.GlobalFunctions.ContainsKey(m_sFunctionName))
                    m_FunctionValue = EquationFragment.GlobalFunctions[m_sFunctionName];
                else
                    throw new FunctionNotFoundException("Function '" + name + "' was not found", name);
            }
            else if (EquationFragment.GlobalFunctions.ContainsKey(m_sFunctionName))
                m_FunctionValue = EquationFragment.GlobalFunctions[m_sFunctionName];

            if (m_FunctionValue != null && m_FunctionValue.ParamCount != 0 && parameters is EmptyEquationFragment)
                throw new ParameterMismatchException("Function '" + name + "' does not take zero parameters");
        }
示例#7
0
 protected EquationFragment(string s, EquationFragment parent)
     : this(parent)
 {
     InternalParse(s);
 }
示例#8
0
 protected EquationFragment(EquationFragment parent) { this.m_Parent = parent; }