@@ -58,15 +58,17 @@ function test_scaling_maps(T)
58
58
end
59
59
60
60
function test_identity_map (T)
61
- i1 = StaticIdentityMap {T} ()
62
- i2 = StaticIdentityMap {SVector{2,T}} ()
61
+ i1 = IdentityMap {T} ()
62
+ @test i1 isa FunctionMaps. StaticIdentityMap
63
+ i2 = IdentityMap {SVector{2,T}} ()
64
+ @test i2 isa FunctionMaps. StaticIdentityMap
63
65
test_generic_map (i1)
64
66
test_generic_map (i2)
65
67
@test i1 == i2
66
68
@test hash (i1) == hash (i2)
67
69
@test islinearmap (i1)
68
70
@test isaffinemap (i1)
69
- @test convert (StaticIdentityMap{SVector{2 ,T}}, i1) === i2
71
+ @test convert (FunctionMaps . StaticIdentityMap{SVector{2 ,T}}, i1) === i2
70
72
@test jacobian (i1) isa ConstantMap
71
73
@test jacobian (i1, 1 ) == 1
72
74
@test jacdet (i1, 1 ) == 1
@@ -78,13 +80,19 @@ function test_identity_map(T)
78
80
@test m2 isa LinearMap{T}
79
81
@test jacdet (m2, 1 ) == 1
80
82
81
- i3 = VectorIdentityMap {T} (10 )
83
+ i3 = IdentityMap {Vector{T}} (10 )
84
+ @test i3 isa FunctionMaps. VectorIdentityMap
82
85
test_generic_map (i3)
83
86
r = rand (T, 10 )
84
87
@test i3 (r) ≈ r
85
- @test hash (i3) == hash (VectorIdentityMap { Int} (10 ))
88
+ @test hash (i3) == hash (IdentityMap {Vector{ Int} } (10 ))
86
89
87
90
@test IdentityMap () ∘ LinearMap (2 ) == LinearMap (2.0 )
91
+
92
+ @test_throws ArgumentError IdentityMap {Float64} (10 )
93
+ @test_throws ArgumentError IdentityMap {Float64} (Val (2 ))
94
+ @test IdentityMap {Float64} (1 ) isa Map
95
+ @test IdentityMap {Float64} (Val (1 )) isa Map
88
96
end
89
97
90
98
function test_basic_maps (T)
0 commit comments