예제 #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
파일: Graph.cs 프로젝트: ChrisMoreton/Test3
 public EquationGraphSeries(EquationFragment frag, string VariableName)
 {
     m_Frag = frag;
     m_GraphVariable = VariableName;
 }
예제 #3
0
파일: Graph.cs 프로젝트: ChrisMoreton/Test3
 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; }