File tree Expand file tree Collapse file tree 1 file changed +22
-17
lines changed Expand file tree Collapse file tree 1 file changed +22
-17
lines changed Original file line number Diff line number Diff line change 11using SciMLOperators, LinearAlgebra, BenchmarkTools
22using SciMLOperators: IdentityOperator, ⊗
33
4- Id = IdentityOperator {12} ()
5- A = rand (12 ,12 )
6- B = rand (12 ,12 )
7- C = rand (12 ,12 )
4+ N = 12
5+ K = 100
6+ Id = IdentityOperator (N)
7+ A = rand (N,N)
8+ B = rand (N,N)
9+ C = rand (N,N)
810
911println (" #===============================#" )
1012println (" 2D Tensor Products" )
1113println (" #===============================#" )
1214
1315println (" ⊗(A, B)" )
1416
15- u = rand (12 ^ 2 , 100 )
16- v = rand (12 ^ 2 , 100 )
17+ u = rand (N ^ 2 , K )
18+ v = rand (N ^ 2 , K )
1719
1820T = ⊗ (A, B)
1921T = cache_operator (T, u)
2022
23+ @btime * ($ T, $ u)
2124@btime mul! ($ v, $ T, $ u)
2225
2326println (" ⊗(I, B)" )
2427
25- u = rand (12 ^ 2 , 100 )
26- v = rand (12 ^ 2 , 100 )
28+ u = rand (N ^ 2 , K )
29+ v = rand (N ^ 2 , K )
2730
2831T = ⊗ (Id, B)
2932T = cache_operator (T, u)
3033
34+ @btime * ($ T, $ u)
3135@btime mul! ($ v, $ T, $ u)
3236
3337println (" ⊗(A, I)" )
3438
35- u = rand (12 ^ 2 , 100 )
36- v = rand (12 ^ 2 , 100 )
39+ u = rand (N ^ 2 , K )
40+ v = rand (N ^ 2 , K )
3741
3842T = ⊗ (A, Id)
3943T = cache_operator (T, u)
4044
45+ @btime * ($ T, $ u)
4146@btime mul! ($ v, $ T, $ u)
4247
4348println (" #===============================#" )
@@ -46,25 +51,25 @@ println("#===============================#")
4651
4752println (" ⊗(⊗(A, B), C)" )
4853
49- u = rand (12 ^ 3 , 100 )
50- v = rand (12 ^ 3 , 100 )
54+ u = rand (N ^ 3 , K )
55+ v = rand (N ^ 3 , K )
5156
5257T = ⊗ (⊗ (A, B), C)
5358T = cache_operator (T, u)
5459
55- mul! (v, T, u) # dunny
60+ @btime * ( $ T, $ u)
5661@btime mul! ($ v, $ T, $ u); #
5762
5863println (" ⊗(A, ⊗(B, C))" )
5964
60- u = rand (12 ^ 3 , 100 )
61- v = rand (12 ^ 3 , 100 )
65+ u = rand (N ^ 3 , K )
66+ v = rand (N ^ 3 , K )
6267
6368T = ⊗ (A, ⊗ (B, C))
6469T = cache_operator (T, u)
6570
66- mul! (v, T, u) # dunny
71+ @btime * ( $ T, $ u)
6772@btime mul! ($ v, $ T, $ u); #
6873
6974println (" #===============================#" )
70- nothing
75+ #
You can’t perform that action at this time.
0 commit comments