random하게 생성한 10x10 행렬
[ 1 -2 1 1 0 -2 -1 1 2 0]
[ 2 0 -1 0 1 0 -1 1 -2 -1/2]
[ 1 1 0 1 2 2 0 -1 1 1]
[ 2 -1/2 1 -2 0 0 0 1 1 -2]
[ 2 1/2 0 2 0 -1/2 0 -1 -1/2 -1]
[ 1 0 1/2 0 1 0 0 2 0 -2]
[ 0 1 0 0 0 2 0 1 1 0]
[ 0 -1/2 0 0 0 1 0 1 2 -1]
[ -1 -1/2 0 0 0 2 0 0 0 -2]
[ -1 1/2 0 0 0 -2 -2 -2 -1/2 -1/2]
A.is_invertible 함수
True
det(A) 연산 결과
67059/8
Gauss-Jordan 소거법
[1 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0 0]
[0 0 0 0 1 0 0 0 0 0]
[0 0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 0 1]
Gauss Jordan 소거법을 이용한 역행렬
[ 1 0 0 0
0 0 0 0 0
0 2243/67059 8825/67059 1760/67059 8503/44706
10753/67059 -4115/22353 374/7451 -2107/134118 -578/7451
-5534/67059]
[ 0 1 0 0
0 0 0 0 0
0 -4922/22353 -2942/22353 -992/22353 -161/7451
2474/22353 1642/7451 2348/7451 797/22353 -2274/7451
3932/22353]
[ 0 0 1 0
0 0 0 0 0
0 26875/67059 -21503/67059 5362/67059 8861/44706
-2827/67059 3593/22353 3561/7451 -150215/134118 2625/7451
-2686/67059]
[ 0 0 0 1
0 0 0 0 0
0 3169/22353 -1085/22353 -533/22353 -3553/14902
4529/22353 717/7451 871/7451 -3515/44706 686/7451
-1042/22353]
[ 0 0 0 0
1 0 0 0 0
0 -11681/134118 -515/134118 22175/67059 -7867/89412
-28135/134118 15311/44706 -6409/14902 36445/268236
-933/14902 3049/67059]
[ 0 0 0 0
0 1 0 0 0
0 7339/67059 5077/67059 4204/67059 2987/44706
-1291/67059 -4495/22353 2011/7451 -35057/134118 2311/7451
-6208/67059]
[ 0 0 0 0
0 0 1 0 0
0 -6131/22353 -5018/22353 481/22353 -305/7451
1910/22353 1352/7451 -3512/7451 5675/22353 -1346/7451
-5602/22353]
[ 0 0 0 0
0 0 0 1 0
0 1663/22353 1321/22353 -3080/22353 -1841/14902
-2053/22353 1613/7451 1762/7451 -1901/44706 -691/7451
-1492/22353]
[ 0 0 0 0
0 0 0 0 1
0 -4901/67059 -5291/67059 3808/67059 515/44706
1319/67059 -775/22353 -681/7451 71035/134118 -1657/7451
5096/67059]
[ 0 0 0 0
0 0 0 0 0
1 1101/7451 319/7451 452/7451 -341/14902
-947/7451 -1223/7451 1237/7451 -3911/14902 -557/7451
-710/7451]
A의 역행렬 B
[ 2243/67059 8825/67059 1760/67059 8503/44706
10753/67059 -4115/22353 374/7451 -2107/134118 -578/7451
-5534/67059]
[ -4922/22353 -2942/22353 -992/22353 -161/7451
2474/22353 1642/7451 2348/7451 797/22353 -2274/7451
3932/22353]
[ 26875/67059 -21503/67059 5362/67059 8861/44706
-2827/67059 3593/22353 3561/7451 -150215/134118 2625/7451
-2686/67059]
[ 3169/22353 -1085/22353 -533/22353 -3553/14902
4529/22353 717/7451 871/7451 -3515/44706 686/7451
-1042/22353]
[ -11681/134118 -515/134118 22175/67059 -7867/89412
-28135/134118 15311/44706 -6409/14902 36445/268236
-933/14902 3049/67059]
[ 7339/67059 5077/67059 4204/67059 2987/44706
-1291/67059 -4495/22353 2011/7451 -35057/134118 2311/7451
-6208/67059]
[ -6131/22353 -5018/22353 481/22353 -305/7451
1910/22353 1352/7451 -3512/7451 5675/22353 -1346/7451
-5602/22353]
[ 1663/22353 1321/22353 -3080/22353 -1841/14902
-2053/22353 1613/7451 1762/7451 -1901/44706 -691/7451
-1492/22353]
[ -4901/67059 -5291/67059 3808/67059 515/44706
1319/67059 -775/22353 -681/7451 71035/134118 -1657/7451
5096/67059]
[ 1101/7451 319/7451 452/7451 -341/14902
-947/7451 -1223/7451 1237/7451 -3911/14902 -557/7451
-710/7451]
AB 행렬 곱 연산결과
[1 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0 0]
[0 0 0 0 1 0 0 0 0 0]
[0 0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 0 1]
BA 행렬 곱 연산결과
[1 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0 0]
[0 0 0 0 1 0 0 0 0 0]
[0 0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 0 1]
Traceback (click to the left of this block for traceback)
...
TypeError: matrix has denominators so can't change to ZZ.
random하게 생성한 10x10 행렬
[ 1 -2 1 1 0 -2 -1 1 2 0]
[ 2 0 -1 0 1 0 -1 1 -2 -1/2]
[ 1 1 0 1 2 2 0 -1 1 1]
[ 2 -1/2 1 -2 0 0 0 1 1 -2]
[ 2 1/2 0 2 0 -1/2 0 -1 -1/2 -1]
[ 1 0 1/2 0 1 0 0 2 0 -2]
[ 0 1 0 0 0 2 0 1 1 0]
[ 0 -1/2 0 0 0 1 0 1 2 -1]
[ -1 -1/2 0 0 0 2 0 0 0 -2]
[ -1 1/2 0 0 0 -2 -2 -2 -1/2 -1/2]
A.is_invertible 함수
True
det(A) 연산 결과
67059/8
Gauss-Jordan 소거법
[1 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0 0]
[0 0 0 0 1 0 0 0 0 0]
[0 0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 0 1]
Gauss Jordan 소거법을 이용한 역행렬
[ 1 0 0 0 0 0 0 0 0 0 2243/67059 8825/67059 1760/67059 8503/44706 10753/67059 -4115/22353 374/7451 -2107/134118 -578/7451 -5534/67059]
[ 0 1 0 0 0 0 0 0 0 0 -4922/22353 -2942/22353 -992/22353 -161/7451 2474/22353 1642/7451 2348/7451 797/22353 -2274/7451 3932/22353]
[ 0 0 1 0 0 0 0 0 0 0 26875/67059 -21503/67059 5362/67059 8861/44706 -2827/67059 3593/22353 3561/7451 -150215/134118 2625/7451 -2686/67059]
[ 0 0 0 1 0 0 0 0 0 0 3169/22353 -1085/22353 -533/22353 -3553/14902 4529/22353 717/7451 871/7451 -3515/44706 686/7451 -1042/22353]
[ 0 0 0 0 1 0 0 0 0 0 -11681/134118 -515/134118 22175/67059 -7867/89412 -28135/134118 15311/44706 -6409/14902 36445/268236 -933/14902 3049/67059]
[ 0 0 0 0 0 1 0 0 0 0 7339/67059 5077/67059 4204/67059 2987/44706 -1291/67059 -4495/22353 2011/7451 -35057/134118 2311/7451 -6208/67059]
[ 0 0 0 0 0 0 1 0 0 0 -6131/22353 -5018/22353 481/22353 -305/7451 1910/22353 1352/7451 -3512/7451 5675/22353 -1346/7451 -5602/22353]
[ 0 0 0 0 0 0 0 1 0 0 1663/22353 1321/22353 -3080/22353 -1841/14902 -2053/22353 1613/7451 1762/7451 -1901/44706 -691/7451 -1492/22353]
[ 0 0 0 0 0 0 0 0 1 0 -4901/67059 -5291/67059 3808/67059 515/44706 1319/67059 -775/22353 -681/7451 71035/134118 -1657/7451 5096/67059]
[ 0 0 0 0 0 0 0 0 0 1 1101/7451 319/7451 452/7451 -341/14902 -947/7451 -1223/7451 1237/7451 -3911/14902 -557/7451 -710/7451]
A의 역행렬 B
[ 2243/67059 8825/67059 1760/67059 8503/44706 10753/67059 -4115/22353 374/7451 -2107/134118 -578/7451 -5534/67059]
[ -4922/22353 -2942/22353 -992/22353 -161/7451 2474/22353 1642/7451 2348/7451 797/22353 -2274/7451 3932/22353]
[ 26875/67059 -21503/67059 5362/67059 8861/44706 -2827/67059 3593/22353 3561/7451 -150215/134118 2625/7451 -2686/67059]
[ 3169/22353 -1085/22353 -533/22353 -3553/14902 4529/22353 717/7451 871/7451 -3515/44706 686/7451 -1042/22353]
[ -11681/134118 -515/134118 22175/67059 -7867/89412 -28135/134118 15311/44706 -6409/14902 36445/268236 -933/14902 3049/67059]
[ 7339/67059 5077/67059 4204/67059 2987/44706 -1291/67059 -4495/22353 2011/7451 -35057/134118 2311/7451 -6208/67059]
[ -6131/22353 -5018/22353 481/22353 -305/7451 1910/22353 1352/7451 -3512/7451 5675/22353 -1346/7451 -5602/22353]
[ 1663/22353 1321/22353 -3080/22353 -1841/14902 -2053/22353 1613/7451 1762/7451 -1901/44706 -691/7451 -1492/22353]
[ -4901/67059 -5291/67059 3808/67059 515/44706 1319/67059 -775/22353 -681/7451 71035/134118 -1657/7451 5096/67059]
[ 1101/7451 319/7451 452/7451 -341/14902 -947/7451 -1223/7451 1237/7451 -3911/14902 -557/7451 -710/7451]
AB 행렬 곱 연산결과
[1 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0 0]
[0 0 0 0 1 0 0 0 0 0]
[0 0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 0 1]
BA 행렬 곱 연산결과
[1 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0 0]
[0 0 0 0 1 0 0 0 0 0]
[0 0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 0 1]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_4.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("IyByYW5kb23tlZwg7Jyg66as7IiYIOybkOyGjOuhnCDsnbTro6jslrTsp4QgMTB4MTAg7ZaJ66CsIOyDneyEsQpBID0gcmFuZG9tX21hdHJpeChRUSwgMTAsIDEwKQpwcmludCAicmFuZG9t7ZWY6rKMIOyDneyEse2VnCAxMHgxMCDtlonroKwiCnByaW50IEEKCiMg6rCA7Jet7ZaJ66Cs7J247KeAIO2ZleyduApwcmludCAiQS5pc19pbnZlcnRpYmxlIO2VqOyImCIKcHJpbnQgQS5pc19pbnZlcnRpYmxlKCkKCiMgZGV0KEEpCnByaW50ICJkZXQoQSkg7Jew7IKwIOqysOqzvCIKcHJpbnQgQS5kZXQoKQoKIyBHYXVzcy1Kb3JkYW4g7IaM6rGw67KVCnByaW50ICJHYXVzcy1Kb3JkYW4g7IaM6rGw67KVIgpwcmludCBBLnJyZWYoKQoKIyBHYXVzcyBKb3JkYW4g7IaM6rGw67KV7J2EIOydtOyaqe2VmOyXrCDsl63tlonroKwg7IOd7ISx7ZWY6riwIApJPWlkZW50aXR5X21hdHJpeCgxMCkKcHJpbnQgIkdhdXNzIEpvcmRhbiDshozqsbDrspXsnYQg7J207Jqp7ZWcIOyXre2WieugrCIKQz1BLmF1Z21lbnQoSSkucnJlZigpCnByaW50IEMKCgojIGRldChBKeqwgCAw7J20IOyVhOuLjCDqsr3smrAKaWYgQS5kZXQoKSAhPSAwOgogICAgIyDsl63tlonroKwg6rOE7IKwCiAgICBCID0gQS5pbnZlcnNlKCkKCiAgICBwcmludCAiQeydmCDsl63tlonroKwgQiIKICAgIHByaW50IEIKCiAgICBwcmludCAiQUIg7ZaJ66CsIOqzsSDsl7DsgrDqsrDqs7wiCiAgICBwcmludCBBKkIKCiAgICBwcmludCAiQkEg7ZaJ66CsIOqzsSDsl7DsgrDqsrDqs7wiCiAgICBwcmludCBCKkEKICAgIAogICAgI0nrpbwg7LKo6rCA7ZWo7Jy866Gc7I2oIOyDneyEse2VnCDsl63tlonroKzqs7wg7Jet7ZaJ66Cs7J2EIOu5hOq1kO2VtOuztOq4sAogICAgaWYgQz09SS5hdWdtZW50KEIpOgogICAgICAgIHByaW50ICdUcnVlJwogICAgCiAgICBlbHNlOgogICAgICAgIHByaW50ICdGYWxzZSc="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpQDCxMB/___code___.py", line 41, in <module>
if C==I.augment(B):
File "matrix_integer_dense.pyx", line 4489, in sage.matrix.matrix_integer_dense.Matrix_integer_dense.augment (sage/matrix/matrix_integer_dense.c:34956)
File "matrix_rational_dense.pyx", line 1358, in sage.matrix.matrix_rational_dense.Matrix_rational_dense.change_ring (sage/matrix/matrix_rational_dense.c:14489)
TypeError: matrix has denominators so can't change to ZZ.