Skip to content

Commit 9b4e3dc

Browse files
committed
added some missing features to AffineAdd
1 parent 19ff354 commit 9b4e3dc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test_linear_operators_calculus.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ r = randn(n)
871871

872872
# with sign
873873
T = AffineAdd(opA,d,false)
874+
@test sign(T) == -1
874875

875876
println(T)
876877
x1 = randn(m)
@@ -881,6 +882,7 @@ r = randn(n)
881882

882883
# with scalar
883884
T = AffineAdd(opA,pi)
885+
@test sign(T) == 1
884886

885887
println(T)
886888
x1 = randn(m)
@@ -893,3 +895,15 @@ r = randn(n)
893895
@test_throws ErrorException AffineAdd(DFT(4),randn(4))
894896
AffineAdd(DFT(4),pi)
895897
@test_throws ErrorException AffineAdd(Eye(4),im*pi)
898+
899+
# permute AddAffine
900+
n,m = 5,6
901+
A = randn(n,m)
902+
d = randn(n)
903+
opH = HCAT(Eye(n),MatrixOp(A))
904+
x = (randn(n),randn(m))
905+
opHT = AffineAdd(opH,d)
906+
907+
@test norm(opHT*x-(x[1]+A*x[2]+d)) < 1e-12
908+
p = [2;1]
909+
@test norm(permute(opHT,p)*x[p]-(x[1]+A*x[2]+d)) < 1e-12

0 commit comments

Comments
 (0)