We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9212bb commit f0654dcCopy full SHA for f0654dc
spatialmath/timing.py
@@ -221,9 +221,21 @@ def result(op, t):
221
a = np.r_[1.0, 2.0, 3.0]
222
b = np.r_[-5.0, 4.0, 3.0]
223
224
+A = np.random.randn(6,6)
225
+As = (A + A.T) / 2
226
+bb = np.random.randn(6)
227
'''
228
table.rule()
229
230
+t = timeit.timeit(stmt='c = np.linalg.inv(As)', setup=misc_setup, number=N)
231
+result("np.inv(As)", t)
232
+
233
+t = timeit.timeit(stmt='c = np.linalg.pinv(As)', setup=misc_setup, number=N)
234
+result("np.pinv(As)", t)
235
236
+t = timeit.timeit(stmt='c = np.linalg.solve(As, bb)', setup=misc_setup, number=N)
237
+result("np.solve(As, b)", t)
238
239
t = timeit.timeit(stmt='c = np.cross(a,b)', setup=misc_setup, number=N)
240
result("np.cross()", t)
241
0 commit comments