This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Volatile var i = 0 | |
val lock = AtomicInteger(0) | |
fun LockSynchronized() | |
{ | |
synchronized(this) { | |
i++ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get determinant expression for a matrix. | |
def Minor(M, rowIdx): | |
""" | |
:param M Matrix to get minor for. | |
:param rowIdx: Row index for minor submatrix. Assuming column 0. | |
:return: Minor submatrix. | |
""" | |
m = [] | |
for i in range(0, len(M)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get determinant expression for a matrix. | |
# Works for 4x4 matrix only because Rule of Sarrus is used. Can be adapted for any size by using | |
# recursive algorithm. | |
M = [] | |
SIZE = 4 | |
def Minor(rowIdx): | |
""" |