.. -*- coding: utf-8 -*- ==== 演算 ==== .. module:: pysimple 単項演算 -------- .. function:: __pos__(obj) :annotation: → +obj 単項演算 ``+obj`` を返します. :type obj: :term:`operable-type` :return: obj が :term:`funcable-type` の場合は Parameter を,それ以外の場合は Expression を返します. :rtype: Parameter or Expression .. function:: __neg__(obj1) :annotation: → -obj 単項演算 ``-obj1`` を返します. :type obj: :term:`operable-type` :return: obj が :term:`funcable-type` の場合は Parameter を,それ以外の場合は Expression を返します. :rtype: Parameter or Expression 算術演算 -------- .. automethod:: pysimple.Set.__sub__ .. automethod:: pysimple.Set.__mul__ .. automethod:: pysimple.Set.__rsub__ .. automethod:: pysimple.Set.__rmul__ .. function:: __add__(obj1, obj2) :annotation: → obj1 + obj2 二項演算 ``obj1+obj2`` を返します. :param obj1: :param obj2: :type obj1: :term:`operable-type` :type obj2: :term:`operable-type` :return: obj1 または obj2 が Variable, Expression の場合は Expression を, それ以外の場合は Parameter を返します. :rtype: Parameter or Expression .. function:: __sub__(obj1, obj2) :annotation: → obj1 - obj2 二項演算 ``obj1-obj2`` を返します. :param obj1: :param obj2: :type obj1: :term:`operable-type` :type obj2: :term:`operable-type` :return: obj1 または obj2 が Variable, Expression の場合は Expression を, それ以外の場合は Parameter を返します. :rtype: Parameter or Expression .. function:: __mul__(obj1, obj2) :annotation: → obj1 * obj2 二項演算 ``obj1*obj2`` を返します. :param obj1: :param obj2: :type obj1: :term:`operable-type` :type obj2: :term:`operable-type` :return: obj1 または obj2 が Variable, Expression の場合は Expression を, それ以外の場合は Parameter を返します. 演算結果が線形または二次でない場合,TypeError が投げられます. :rtype: Parameter or Expression :raises TypeError: high dimension operand type(s) for \*: {} and {} .. function:: __mod__(obj1, obj2) :annotation: → obj1 % obj2 二項演算 ``obj1%obj2`` を返します. :param obj1: :param obj2: :type obj1: :term:`funcable-type` :type obj2: :term:`funcable-type` :return: 演算結果が線形または二次でない場合,TypeError が投げられます. :rtype: Parameter :raises TypeError: high dimension operand type(s) for %: {} and {} .. function:: __truediv__(obj1, obj2) :annotation: → obj1 / obj2 二項演算 ``obj1/obj2`` を返します. :param obj1: :param obj2: :type obj1: :term:`operable-type` :type obj2: :term:`funcable-type` :return: obj1 が Variable, Expression の場合は Expression を, それ以外の場合は Parameter を返します. 演算結果が線形または二次でない場合,TypeError が投げられます. :rtype: Parameter or Expression :raises TypeError: high dimension operand type(s) for /: {} and {} .. function:: __floordiv__(obj1, obj2) :annotation: → obj1 // obj2 二項演算 ``obj1//obj2`` を返します. :param obj1: :param obj2: :type obj1: :term:`funcable-type` :type obj2: :term:`funcable-type` :return: 演算結果が線形または二次でない場合,TypeError が投げられます. :rtype: Parameter :raises TypeError: high dimension operand type(s) for //: {} and {} .. function:: __pow__(obj1, obj2) :annotation: → obj1 ** obj2 二項演算 ``obj1**obj2`` を返します. :param obj1: :param obj2: :type obj1: :term:`funcable-type` :type obj2: :term:`funcable-type` :return: 演算結果が線形または二次でない場合,TypeError が投げられます. :rtype: Parameter :raises TypeError: high dimension operand type(s) for \**: {} and {} .. function:: __radd__(obj1, obj2) .. function:: __rsub__(obj1, obj2) .. function:: __rmul__(obj1, obj2) .. function:: __rmod__(obj1, obj2) .. function:: __rdiv__(obj1, obj2) .. function:: __rtruediv__(obj1, obj2) .. function:: __rfloordiv__(obj1, obj2) .. function:: __rpow__(obj1, obj2) 同様に定義されています. 比較演算 -------- .. automethod:: pysimple._compare.pysimple.__lt__ .. automethod:: pysimple._compare.pysimple.__gt__ .. automethod:: pysimple._compare.pysimple.__le__ .. automethod:: pysimple._compare.pysimple.__ge__ .. automethod:: pysimple._compare.pysimple.__eq__ .. automethod:: pysimple._compare.pysimple.__ne__ ビット演算 ---------- .. automethod:: pysimple.Set.__or__ .. automethod:: pysimple.Set.__and__ .. automethod:: pysimple.Set.__xor__ .. automethod:: pysimple.Set.__ror__ .. automethod:: pysimple.Set.__rand__ .. automethod:: pysimple.Set.__rxor__ .. automethod:: pysimple.condition.Cond.__or__ .. automethod:: pysimple.condition.Cond.__and__