File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,7 @@ def result(op, t):
217
217
from spatialmath import base
218
218
import numpy as np
219
219
s = np.r_[1.0,2,3,4,5,6]
220
+ s3 = np.r_[1.0,2,3]
220
221
a = np.r_[1.0, 2.0, 3.0]
221
222
b = np.r_[-5.0, 4.0, 3.0]
222
223
@@ -244,4 +245,15 @@ def result(op, t):
244
245
t = timeit .timeit (stmt = 'a = np.sum(s ** 2)' , setup = misc_setup , number = N )
245
246
result ("np.sum(s ** 2)" , t )
246
247
248
+ t = timeit .timeit (stmt = 'a = np.linalg.norm(s)' , setup = misc_setup , number = N )
249
+ result ("np.norm(R6)" , t )
250
+ t = timeit .timeit (stmt = 'a = base.norm(s)' , setup = misc_setup , number = N )
251
+ result ("base.norm(R6)" , t )
252
+
253
+ t = timeit .timeit (stmt = 'a = np.linalg.norm(s3)' , setup = misc_setup , number = N )
254
+ result ("np.norm(R3)" , t )
255
+ t = timeit .timeit (stmt = 'a = base.norm(s3)' , setup = misc_setup , number = N )
256
+ result ("base.norm(R3)" , t )
257
+
258
+
247
259
table .print ()
You can’t perform that action at this time.
0 commit comments