Beispiel #1
0
    def __truediv__(self, other):
        """
        self / other

        The result is a rational function.
        """
        return ratfunc.RationalFunction(self, other)
Beispiel #2
0
 def _get_zero(self):
     "getter for zero"
     if self._zero is None:
         import nzmath.poly.ratfunc as ratfunc
         poly_one = self.basedomain.one
         poly_zero = self.basedomain.zero
         self._zero = ratfunc.RationalFunction(poly_zero, poly_one)
     return self._zero
Beispiel #3
0
 def setUp(self):
     self.f = ratfunc.RationalFunction(uniutil.polynomial({
         3: 1,
         0: 1
     }, Z), uniutil.polynomial({
         2: 1,
         0: -2
     }, Z))
     self.f2 = self.f
     self.f3 = ratfunc.RationalFunction(
         uniutil.polynomial({
             4: 1,
             1: 1
         }, Z), uniutil.polynomial({
             3: 1,
             1: -2
         }, Z))
Beispiel #4
0
 def _get_one(self):
     """
     getter for one
     """
     if self._one is None:
         import nzmath.poly.ratfunc as ratfunc
         poly_one = self.basedomain.one
         self._one = ratfunc.RationalFunction(poly_one, poly_one)
     return self._one
Beispiel #5
0
 def createElement(self, *seedarg, **seedkwd):
     """
     Return an element of the field made from seed.
     """
     import nzmath.poly.ratfunc as ratfunc
     return ratfunc.RationalFunction(*seedarg, **seedkwd)