2424 @test AA isa MatrixOperator
2525 @test AAt isa MatrixOperator
2626
27+ @test issquare (AA)
28+ @test islinear (AA)
29+
2730 FF = factorize (AA)
2831 FFt = FF'
2932
7376 update_func= (diag,u,p,t) -> (diag .= p* t; nothing )
7477 )
7578
79+ @test issquare (D)
80+ @test islinear (D)
81+
7682 ans = Diagonal (p* t) * u
7783 @test D (u,p,t) ≈ ans
7884 v= copy (u); @test D (v,u,p,t) ≈ ans
8692
8793 L = DiagonalOperator (d)
8894
95+ @test issquare (L)
96+ @test islinear (L)
97+
8998 @test L * u ≈ d .* u
9099 v= rand (N,K); @test mul! (v, L, u) ≈ d .* u
91100 v= rand (N,K); w= copy (v); @test mul! (v, L, u, α, β) ≈ α* (d .* u) + β* w
@@ -105,17 +114,25 @@ end
105114 β = rand ()
106115
107116 L = AffineOperator (MatrixOperator (A), MatrixOperator (B), b)
117+ @test issquare (L)
118+ @test ! islinear (L)
108119
109120 @test L * u ≈ A * u + B* b
110121 v= rand (N,K); @test mul! (v, L, u) ≈ A* u + B* b
111122 v= rand (N,K); w= copy (v); @test mul! (v, L, u, α, β) ≈ α* (A* u + B* b) + β* w
112123
113124 L = AffineOperator (MatrixOperator (D), MatrixOperator (B), b)
125+ @test issquare (L)
126+ @test ! islinear (L)
127+
114128 @test L \ u ≈ D \ (u - B * b)
115129 v= rand (N,K); @test ldiv! (v, L, u) ≈ D \ (u- B* b)
116130 v= copy (u); @test ldiv! (L, u) ≈ D \ (v- B* b)
117131
118132 L = AddVector (b)
133+ @test issquare (L)
134+ @test ! islinear (L)
135+
119136 @test L * u ≈ u + b
120137 @test L \ u ≈ u - b
121138 v= rand (N,K); @test mul! (v, L, u) ≈ u + b
124141 v= copy (u); @test ldiv! (L, u) ≈ v - b
125142
126143 L = AddVector (MatrixOperator (B), b)
144+ @test issquare (L)
145+ @test ! islinear (L)
146+
127147 @test L * u ≈ u + B * b
128148 @test L \ u ≈ u - B * b
129149 v= rand (N,K); @test mul! (v, L, u) ≈ u + B * b
@@ -188,6 +208,17 @@ for square in [false, true] #for K in [1, K]
188208 @test opAB isa TensorProductOperator
189209 @test opABC isa TensorProductOperator
190210
211+ if square
212+ @test issquare (opAB)
213+ @test issquare (opABC)
214+ else
215+ @test ! issquare (opAB)
216+ @test ! issquare (opABC)
217+ end
218+
219+ @test islinear (opAB)
220+ @test islinear (opABC)
221+
191222 @test AB ≈ convert (AbstractMatrix, opAB)
192223 @test ABC ≈ convert (AbstractMatrix, opABC)
193224
0 commit comments