mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
some fix
This commit is contained in:
parent
e26ea4a95c
commit
27e40e61bd
@ -327,23 +327,12 @@ assert result_mat == correct_result_mat
|
||||
|
||||
# test determinant
|
||||
test_mat_copy = test_mat.copy()
|
||||
list_mat = [[0,0,0], [0,0,0], [0,0,0]]
|
||||
for i in range(3):
|
||||
for j in range(3):
|
||||
list_mat[i][j] = test_mat[i, j]
|
||||
determinant = list_mat[0][0]*(list_mat[1][1]*list_mat[2][2] - list_mat[1][2]*list_mat[2][1]) - list_mat[0][1]*(list_mat[1][0]*list_mat[2][2] - list_mat[1][2]*list_mat[2][0]) + list_mat[0][2]*(list_mat[1][0]*list_mat[2][1] - list_mat[1][1]*list_mat[2][0])
|
||||
_0 = determinant
|
||||
_1 = test_mat_copy.determinant()
|
||||
_0, _1 = round(_0, 2), round(_1, 2)
|
||||
assert (_0 == _1), f'{_0} != {_1}'
|
||||
|
||||
|
||||
test_mat_copy.determinant()
|
||||
|
||||
# test __repr__
|
||||
assert str(static_test_mat_float) == 'mat3x3([[7.2642, -5.4322, 1.8765],\n [-2.4911, 8.9897, -0.7169],\n [9.5580, -3.3363, 4.9514]])'
|
||||
assert str(static_test_mat_int) == 'mat3x3([[1.0000, 2.0000, 3.0000],\n [4.0000, 5.0000, 6.0000],\n [7.0000, 8.0000, 9.0000]])'
|
||||
|
||||
|
||||
# test __getnewargs__
|
||||
test_mat_copy = test_mat.copy()
|
||||
element_value_list = [getattr(test_mat, attr) for attr in element_name_list]
|
||||
|
Loading…
x
Reference in New Issue
Block a user