MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / matrix_exponentiation_time

Function matrix_exponentiation_time

maths/matrix_exponentiation.py:98–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96
97
98def matrix_exponentiation_time() -> float:
99 setup = """
100from random import randint
101from __main__ import fibonacci_with_matrix_exponentiation
102"""
103 code = "fibonacci_with_matrix_exponentiation(randint(1,70000), 1, 1)"
104 exec_time = timeit.timeit(setup=setup, stmt=code, number=100)
105 print("With matrix exponentiation the average execution time is ", exec_time / 100)
106 return exec_time
107
108
109def simple_fibonacci_time() -> float:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected