예제 #1
0
        public static Signal Constant(Context context, long numerator, long denominator)
        {
            Signal s = new Signal(context, new RationalValue(numerator, denominator));

            s.Label = s.Value.ToString() + "_Constant";
            s.AddConstraint(Properties.ConstantSignalProperty.Instance);
            return(s);
        }
예제 #2
0
        public static Signal Constant(Context context, long value)
        {
            Signal s = new Signal(context, new IntegerValue(value));

            s.Label = s.Value.ToString() + "_Constant";
            s.AddConstraint(Properties.ConstantSignalProperty.Instance);
            return(s);
        }
예제 #3
0
        public static Signal Constant(Context context, Complex value, string name)
        {
            Signal s = new Signal(context, new ComplexValue(value));

            s.Label = name + "_Constant";
            s.AddConstraint(Properties.ConstantSignalProperty.Instance);
            return(s);
        }
예제 #4
0
        public static Signal Constant(Context context, TScalar[] value, string name)
        {
            Signal s = new Signal(context, new VectorValue <TScalar>(value));

            s.Label = name + "_Constant";
            s.AddConstraint(Properties.ConstantSignalProperty.Instance);
            return(s);
        }
예제 #5
0
        private void btnBuildSample_Click(object sender, EventArgs e)
        {
            Signal x = Binder.CreateSignal(); x.Label = "x";

            x.AddConstraint(RealSetProperty.Instance);
            Signal x2      = StdBuilder.Square(x); x2.Label = "x2";
            Signal sinx2   = StdBuilder.Sine(x2); sinx2.Label = "sinx2";
            Signal sinx2t2 = sinx2 * IntegerValue.ConstantTwo;

            _ctrl.CurrentSystem.AddSignalTree(sinx2t2, true, true);
        }
예제 #6
0
        public static Signal Constant(Context context, string value)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            Signal s = new Signal(context, new LiteralValue(value));

            s.Label = s.Value.ToString() + "_Constant";
            s.AddConstraint(Properties.ConstantSignalProperty.Instance);
            return(s);
        }
예제 #7
0
        private void btnBuildSample_Click(object sender, EventArgs e)
        {
            s = _project.CurrentSystem;
            Context c = s.Context;
            Builder b = c.Builder;
            Signal  x = new Signal(c); x.Label = "x";

            x.AddConstraint(RealSetProperty.Instance);
            Signal x2          = b.Square(x); x2.Label = "x2";
            Signal sinx2       = Std.Sine(c, x2); sinx2.Label = "sinx2";
            Signal sinx2t2     = sinx2 * IntegerValue.ConstantTwo(c);
            Signal sinx2t2cosx = sinx2t2 + Std.Cosine(c, x); sinx2t2cosx.Label = "sinx2t2cosx";

            s.AddSignalTree(sinx2t2, true, true);
        }
예제 #8
0
        public static Signal Constant(Context context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            MathIdentifier id = _structureId.DerivePostfix("Constant");
            Signal         ret;

            if (context.SingletonSignals.TryGetValue(id, out ret))
            {
                return(ret);
            }
            else
            {
                ret       = new Signal(context, Instance);
                ret.Label = "Undefined";
                ret.AddConstraint(Properties.ConstantSignalProperty.Instance);
                context.SingletonSignals.Add(id, ret);
                return(ret);
            }
        }