예제 #1
0
 def Add(expr, assumptions):
     """
     Hermitian + Hermitian  -> Hermitian
     Hermitian + !Hermitian -> !Hermitian
     """
     if expr.is_number:
         return AskRealHandler._number(expr, assumptions)
     return test_closed_group(expr, assumptions, Q.hermitian)
예제 #2
0
 def Add(expr, assumptions):
     """
     Antihermitian + Antihermitian  -> Antihermitian
     Antihermitian + !Antihermitian -> !Antihermitian
     """
     if expr.is_number:
         return AskImaginaryHandler._number(expr, assumptions)
     return test_closed_group(expr, assumptions, Q.antihermitian)
예제 #3
0
 def Add(expr, assumptions):
     """
     Antihermitian + Antihermitian  -> Antihermitian
     Antihermitian + !Antihermitian -> !Antihermitian
     """
     if expr.is_number:
         return AskImaginaryHandler._number(expr, assumptions)
     return test_closed_group(expr, assumptions, Q.antihermitian)
예제 #4
0
파일: sets.py 프로젝트: xivarri/sympy
 def Add(expr, assumptions):
     """
     Real + Real              -> Real
     Real + (Complex & !Real) -> !Real
     """
     if expr.is_number:
         return AskRealHandler._number(expr, assumptions)
     return test_closed_group(expr, assumptions, Q.real)
예제 #5
0
 def Add(expr, assumptions):
     """
     Real + Real              -> Real
     Real + (Complex & !Real) -> !Real
     """
     if expr.is_number:
         return AskRealHandler._number(expr, assumptions)
     return test_closed_group(expr, assumptions, Q.real)
예제 #6
0
 def Add(expr, assumptions):
     """
     Hermitian + Hermitian  -> Hermitian
     Hermitian + !Hermitian -> !Hermitian
     """
     if expr.is_number:
         return AskRealHandler._number(expr, assumptions)
     return test_closed_group(expr, assumptions, Q.hermitian)
예제 #7
0
 def Add(expr, assumptions):
     """
     Integer + Integer       -> Integer
     Integer + !Integer      -> !Integer
     !Integer + !Integer -> ?
     """
     if expr.is_number:
         return AskIntegerHandler._number(expr, assumptions)
     return test_closed_group(expr, assumptions, Q.integer)
예제 #8
0
파일: sets.py 프로젝트: helpin/sympy
 def Add(expr, assumptions):
     """
     Integer + Integer       -> Integer
     Integer + !Integer      -> !Integer
     !Integer + !Integer -> ?
     """
     if expr.is_number:
         return AskIntegerHandler._number(expr, assumptions)
     return test_closed_group(expr, assumptions, Q.integer)
예제 #9
0
파일: sets.py 프로젝트: helpin/sympy
 def Add(expr, assumptions):
     """
     Rational + Rational     -> Rational
     Rational + !Rational    -> !Rational
     !Rational + !Rational   -> ?
     """
     if expr.is_number:
         if expr.as_real_imag()[1]:
             return False
     return test_closed_group(expr, assumptions, Q.rational)
예제 #10
0
 def Add(expr, assumptions):
     """
     Rational + Rational     -> Rational
     Rational + !Rational    -> !Rational
     !Rational + !Rational   -> ?
     """
     if expr.is_number:
         if expr.as_real_imag()[1]:
             return False
     return test_closed_group(expr, assumptions, Q.rational)
예제 #11
0
 def MatAdd(expr, assumptions):
     return test_closed_group(expr, assumptions, Q.complex_elements)
예제 #12
0
 def MatAdd(expr, assumptions):
     return test_closed_group(expr, assumptions, Q.integer_elements)
예제 #13
0
파일: sets.py 프로젝트: helpin/sympy
 def Mul(expr, assumptions):
     return test_closed_group(expr, assumptions, Q.algebraic)
예제 #14
0
파일: sets.py 프로젝트: helpin/sympy
 def Add(expr, assumptions):
     return test_closed_group(expr, assumptions, Q.complex)
예제 #15
0
파일: sets.py 프로젝트: helpin/sympy
 def Add(expr, assumptions):
     return test_closed_group(expr, assumptions, Q.extended_real)
예제 #16
0
 def Mul(expr, assumptions):
     return test_closed_group(expr, assumptions, Q.algebraic)
예제 #17
0
def _(expr, assumptions):
    return test_closed_group(expr, assumptions, Q.real_elements)
예제 #18
0
 def Add(expr, assumptions):
     return test_closed_group(expr, assumptions, Q.complex)
예제 #19
0
파일: matrices.py 프로젝트: Lenqth/sympy
def MatMul_elements(matrix_predicate, scalar_predicate, expr, assumptions):
    d = sift(expr.args, lambda x: isinstance(x, MatrixExpr))
    factors, matrices = d[False], d[True]
    return fuzzy_and([
        test_closed_group(Basic(*factors), assumptions, scalar_predicate),
        test_closed_group(Basic(*matrices), assumptions, matrix_predicate)])
예제 #20
0
def MatMul_elements(matrix_predicate, scalar_predicate, expr, assumptions):
    d = sift(expr.args, lambda x: isinstance(x, MatrixExpr))
    factors, matrices = d[False], d[True]
    return fuzzy_and(
        test_closed_group(Basic(*factors), assumptions, scalar_predicate),
        test_closed_group(Basic(*matrices), assumptions, matrix_predicate))
예제 #21
0
 def Add(expr, assumptions):
     return test_closed_group(expr, assumptions, Q.extended_real)