Horje
python laplace expansion Code Example
python laplace expansion
# Python determinant a la Laplace expansion (Rekursion)
def determinant(matrix):
	d = 0
	if len(matrix) == 2:
		return matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0]
	else:
		for index in range(len(matrix)):
			if index % 2 == 0:
				d += matrix[index][0] * determinant([row[1:] for row in matrix if matrix.index(row) != index])
			else:
				d -= matrix[index][0] * determinant([row[1:] for row in matrix if matrix.index(row) != index])
		return d




Python

Related
python print string in red color Code Example python print string in red color Code Example
blender python get current filename Code Example blender python get current filename Code Example
qtimer singleshot Code Example qtimer singleshot Code Example
python using string to access objects Code Example python using string to access objects Code Example
matplotlib convert color string to int Code Example matplotlib convert color string to int Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9