zad 4 #32
4
hw4.py
4
hw4.py
@ -49,7 +49,7 @@ class QuotientRing():
|
|||||||
def idempotent(self):
|
def idempotent(self):
|
||||||
idems = []
|
idems = []
|
||||||
for rem in self.remainders:
|
for rem in self.remainders:
|
||||||
if (rem * rem / self.f) == (rem / self.f):
|
if (rem * rem % self.f) == (rem % self.f):
|
||||||
idems.append(rem)
|
idems.append(rem)
|
||||||
try:
|
try:
|
||||||
if idems[0].poly == []: #implementacja wielomianow ucina zera
|
if idems[0].poly == []: #implementacja wielomianow ucina zera
|
||||||
@ -63,7 +63,7 @@ class QuotientRing():
|
|||||||
phi = len([ i for i in range(1, self.m) if gcd(i, self.m) == 1 ])
|
phi = len([ i for i in range(1, self.m) if gcd(i, self.m) == 1 ])
|
||||||
for zero_div in self.zero_divisors:
|
for zero_div in self.zero_divisors:
|
||||||
for i in range(self.m):
|
for i in range(self.m):
|
||||||
if len((zero_div ** i / self.f).poly) == 0:
|
if len((zero_div ** i % self.f).poly) == 0:
|
||||||
nils.append(zero_div)
|
nils.append(zero_div)
|
||||||
break
|
break
|
||||||
return nils
|
return nils
|
||||||
|
Loading…
Reference in New Issue
Block a user