YAMP.DotOperator.Perform C# (CSharp) Method

Perform() public method

Performs the evaluation of the dot operator.
public Perform ( Value left, Value right ) : Value
left Value The left value.
right Value The right value.
return Value
        public override Value Perform(Value left, Value right)
        {
            if (left is NumericValue == false)
            {
                throw new YAMPOperationInvalidException(Op, left);
            }

            if (right is NumericValue == false)
            {
                throw new YAMPOperationInvalidException(Op, right);
            }

            if (left is MatrixValue && right is MatrixValue)
            {
                var l = (MatrixValue)left;
                var r = (MatrixValue)right;
                return Dot(l, r);
            }
            else if (left is MatrixValue && right is ScalarValue)
            {
                var l = (MatrixValue)left;
                var r = (ScalarValue)right;
                return Dot(l, r);
            }
            else if (left is ScalarValue && right is MatrixValue)
            {
                var l = (ScalarValue)left;
                var r = (MatrixValue)right;
                return Dot(l, r);
            }

            return _top.Perform(left, right);
        }