public override object Evaluate() { double x = FirstExpression.EvaluateAsReal(); double y = SecondExpression.EvaluateAsReal(); double z = ThirdExpression.EvaluateAsReal(); return(new CMatrix(CoordSysConverter.CartesianToSpherical(x, y, z))); }
public override void Accept(TSqlFragmentVisitor visitor) { visitor.ExplicitVisit(this); FirstExpression?.Accept(visitor); SecondExpression?.Accept(visitor); ThirdExpression?.Accept(visitor); }
public override object Evaluate() { double r = FirstExpression.EvaluateAsReal(); double theta = SecondExpression.EvaluateAsReal(); double phi = ThirdExpression.EvaluateAsReal(); return(new CMatrix(CoordSysConverter.SphericalToCartesian(r, theta, phi))); }
public override object Evaluate() { IList <double> xValues = FirstExpression.EvaluateAsRealVector(); IList <double> yValues = SecondExpression.EvaluateAsRealVector(); double x = ThirdExpression.EvaluateAsReal(); return((Complex)(new NewtonPolynomialInterpolator(xValues, yValues).Interpolate(x))); }
public override object Evaluate() { Func <Complex, Complex> targetFunc = FirstExpression.EvaluateAsFunction <Complex>(ThirdExpression); Complex initGuess = SecondExpression.EvaluateAsComplex(); ComplexMullerEquationSolver solver = new ComplexMullerEquationSolver(targetFunc, initGuess); return(solver.Solve()); }
public void Demangle(DemanglingContext context) { context.Writer.Append("("); FirstExpression.Demangle(context); context.Writer.Append(")"); OperatorName.Demangle(context); context.Writer.Append("("); SecondExpression.Demangle(context); context.Writer.Append(")"); }
public override object Evaluate() { if (ThirdExpression == Expression <Object> .Null) { return(FirstExpression.EvaluateAsCMatrix()[SecondExpression.EvaluateAsInt32()]); } else { return(FirstExpression.EvaluateAsCMatrix()[SecondExpression.EvaluateAsInt32(), ThirdExpression.EvaluateAsInt32()]); } }
public override object Evaluate() { double a = FirstExpression.EvaluateAsReal(); double b = SecondExpression.EvaluateAsReal(); int count = ThirdExpression.EvaluateAsInt32(); PerformanceManager.Current.EnsureAcceptableArraySize(count); double[] v = new double[count]; new UniformDistribution(a, b).GetRandomVariables(_random, v); return(new CMatrix(v)); }
public override void ToString(StringBuilder buf, int indent) { FirstExpression.ToString(buf, indent); if (NotDefined) { buf.Append(" NOT LIKE "); } else { buf.Append(" LIKE "); } SecondExpression.ToString(buf, indent); }
public override void ToString(StringBuilder buf, int indent) { FirstExpression.ToString(buf, indent); switch (BinaryExpressionType) { case BinaryExpressionType.Add: buf.Append(" + "); break; default: throw new NotSupportedException(); } SecondExpression.ToString(buf, indent); }
public override void AddExpression(Expression activeExpression, Expression expressionToBeAdded) { int activeIndex = SecondExpression.IndexOf(activeExpression); if (activeIndex >= 0) { if (Caret.Instance.ExpressionSide == ExpressionSide.Right) { activeIndex++; } SecondExpression.Insert(activeIndex, expressionToBeAdded); // remove auxiliary if (activeExpression is Auxiliary) { SecondExpression.Remove(activeExpression); } base.UpdateChildrensBottomMargin(SecondExpression); return; } activeIndex = FirstExpression.IndexOf(activeExpression); if (activeIndex >= 0) { if (Caret.Instance.ExpressionSide == ExpressionSide.Right) { activeIndex++; } FirstExpression.Insert(activeIndex, expressionToBeAdded); // remove auxiliary if (activeExpression is Auxiliary) { FirstExpression.Remove(activeExpression); } base.UpdateChildrensBottomMargin(FirstExpression); return; } throw new KeyNotFoundException("Active expression wasn't found therefore a new expression couldn't be added."); }
public override void ToString(StringBuilder buf, int indent) { FirstExpression.ToString(buf, indent); switch (TernaryExpressionType) { case BooleanTernaryExpressionType.Between: buf.Append(" BETWEEN "); break; case BooleanTernaryExpressionType.NotBetween: buf.Append(" NOT BETWEEN "); break; default: throw new NotImplementedException(); } SecondExpression.ToString(buf, indent); buf.Append(" AND "); ThirdExpression.ToString(buf, indent); }
public override void ToString(StringBuilder buf, int indent) { FirstExpression.ToString(buf, indent); buf.Append("\r\n"); buf.Append(' ', indent); switch (BinaryExpressionType) { case BooleanBinaryExpressionType.And: buf.Append("AND "); break; case BooleanBinaryExpressionType.Or: buf.Append("OR "); break; default: throw new NotImplementedException(); } SecondExpression.ToString(buf, indent); }
public override void ToString(StringBuilder buf, int indent) { FirstExpression.ToString(buf, indent); switch (ComparisonType) { case BooleanComparisonType.Equals: buf.Append(" = "); break; case BooleanComparisonType.GreaterThan: buf.Append(" > "); break; case BooleanComparisonType.GreaterThanOrEqualTo: buf.Append(" >= "); break; case BooleanComparisonType.LessThan: buf.Append(" < "); break; case BooleanComparisonType.LessThanOrEqualTo: buf.Append(" <= "); break; case BooleanComparisonType.NotEqualToBrackets: buf.Append(" <> "); break; default: throw new NotImplementedException(); } SecondExpression.ToString(buf, indent); }
private string First(FirstExpression exp) => $"SELECT TOP(1) * FROM ({Serialize(exp.Sub)}) AS this {(exp.Predicate == null ? null : "WHERE " + Secondary.Serialize(exp.Predicate.Body))}";
public void Interpret(Context context) { FirstExpression.Interpret(context); SecondExpression.Interpret(context); }
public override string ToDisplayString() => $"{FirstExpression.ToDisplayString()} {Operator.ToDisplayString()} {SecondExpression.ToDisplayString()}";
public override IEnumerable <BindingParserNode> EnumerateNodes() { return(base.EnumerateNodes().Concat(FirstExpression.EnumerateNodes()).Concat(SecondExpression.EnumerateNodes())); }
public override object Evaluate() { return(CMatrix.Minor(FirstExpression.EvaluateAsCMatrix(), SecondExpression.EvaluateAsInt32(), ThirdExpression.EvaluateAsInt32())); }
protected override TResult Execute(CodeActivityContext context) { return(Condition.Get <bool>(context) ? FirstExpression.Get <TResult>(context) : SecondExpression.Get <TResult>(context)); }