remove global functions
This commit is contained in:
@@ -89,6 +89,23 @@ class DarcKey(BaseModel):
|
||||
key_type=self.key_type
|
||||
)
|
||||
|
||||
def __eq__(self, other) -> bool:
|
||||
if self.key_type != other.key_type:
|
||||
return False
|
||||
|
||||
if len(self.matrix) != len(other.matrix):
|
||||
return False
|
||||
|
||||
if len(self.matrix[0]) != len(other.matrix[0]):
|
||||
return False
|
||||
|
||||
for i in range(len(self.matrix)):
|
||||
for j in range(len(self.matrix[0])):
|
||||
if self.matrix[i][j] != other.matrix[i][j]:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def column_substitution(self, column: int, substitution: list[int]):
|
||||
assert len(substitution) == len(self.matrix)
|
||||
assert len(self.matrix[0]) > column >= 0
|
||||
|
||||
Reference in New Issue
Block a user