@@ -24,12 +24,18 @@ K = 19
2424 @test AA isa MatrixOperator
2525 @test AAt isa MatrixOperator
2626
27+ @test isconstant (AA)
28+ @test isconstant (AAt)
29+
2730 FF = factorize (AA)
2831 FFt = FF'
2932
3033 @test FF isa InvertibleOperator
3134 @test FFt isa InvertibleOperator
3235
36+ @test isconstant (FF)
37+ @test isconstant (FFt)
38+
3339 @test eachindex (A) === eachindex (AA)
3440 @test eachindex (A' ) === eachindex (AAt) === eachindex (MatrixOperator (At))
3541
5561 t = rand ()
5662
5763 L = MatrixOperator (zeros (N,N);
58- update_func= (A,u,p,t) -> (A .= p* p' ; nothing )
64+ update_func = (A,u,p,t) -> (A .= p* p' ; nothing )
5965 )
6066
67+ @test ! isconstant (L)
68+
6169 A = p* p'
6270 ans = A * u
6371 @test L (u,p,t) ≈ ans
7078 t = rand ()
7179
7280 D = DiagonalOperator (zeros (N);
73- update_func= (diag,u,p,t) -> (diag .= p* t; nothing )
81+ update_func = (diag,u,p,t) -> (diag .= p* t; nothing )
7482 )
7583
84+ @test ! isconstant (D)
85+
7686 ans = Diagonal (p* t) * u
7787 @test D (u,p,t) ≈ ans
7888 v= copy (u); @test D (v,u,p,t) ≈ ans
8595 β = rand ()
8696
8797 L = DiagonalOperator (d)
98+ @test isconstant (L)
8899
89100 @test L * u ≈ d .* u
90101 v= rand (N,K); @test mul! (v, L, u) ≈ d .* u
105116 β = rand ()
106117
107118 L = AffineOperator (MatrixOperator (A), MatrixOperator (B), b)
119+ @test isconstant (L)
108120
109121 @test L * u ≈ A * u + B* b
110122 v= rand (N,K); @test mul! (v, L, u) ≈ A* u + B* b
141153 t = rand ()
142154
143155 L = AffineOperator (A, B, b;
144- update_func= (b,u,p,t) -> (b .= Diagonal (p* t)* b; nothing )
156+ update_func = (b,u,p,t) -> (b .= Diagonal (p* t)* b; nothing )
145157 )
146158
159+ @test ! isconstant (L)
160+
147161 b = Diagonal (p* t)* b
148162 ans = A * u + B * b
149163 @test L (u,p,t) ≈ ans
@@ -188,13 +202,19 @@ for square in [false, true] #for K in [1, K]
188202 @test opAB isa TensorProductOperator
189203 @test opABC isa TensorProductOperator
190204
205+ @test isconstant (opAB)
206+ @test isconstant (opABC)
207+
191208 @test AB ≈ convert (AbstractMatrix, opAB)
192209 @test ABC ≈ convert (AbstractMatrix, opABC)
193210
194211 # factorization tests
195212 opAB_F = factorize (opAB)
196213 opABC_F = factorize (opABC)
197214
215+ @test isconstant (opAB_F)
216+ @test isconstant (opABC_F)
217+
198218 @test opAB_F isa TensorProductOperator
199219 @test opABC_F isa TensorProductOperator
200220
0 commit comments