在python和rusty的线性代数方面是新手。但是,我正在寻找如何正确地从python中的矩阵中创建行列式而不使用Numpy的指导。请参阅下面的代码片段。非常感谢任何帮助。在
import math
from math import sqrt
import numbers
import operators
def determinant(self)
if not self.is_square():
raise(ValueError, "Cannot calculate determinant of non-square matrix.")
if self.h > 2:
raise(NotImplementedError, "Calculating determinant not implemented for matrices larger than 2x2.")
|x| = A
det(A) = [[A, B][C, D]]
assert self.rows == A.cols
assert self.row > 1
term_list = []
相关问题 更多 >
编程相关推荐