@@ -60,23 +60,23 @@ function Base.isapprox(t1::LinearMap, t2::LinearMap; kwargs...)
60
60
end
61
61
62
62
function Base. isapprox (t1:: LinearMap , t2:: Translation ; kwargs... )
63
- isapprox (vecnorm ( t1. linear), 0 ; kwargs... ) &&
64
- isapprox (vecnorm (t2. translation),0 ; kwargs... )
63
+ isapprox (t1. linear, one (t1 . linear) ; kwargs... ) &&
64
+ isapprox (norm (t2. translation),0 ; kwargs... )
65
65
end
66
66
67
67
function Base. isapprox (t1:: Translation , t2:: LinearMap ; kwargs... )
68
- isapprox (vecnorm (t1. translation), 0 ; kwargs... ) &&
69
- isapprox (vecnorm (t2. linear), 0 ; kwargs... )
68
+ isapprox (norm (t1. translation), 0 ; kwargs... ) &&
69
+ isapprox (t2 . linear, one (t2. linear); kwargs... )
70
70
end
71
71
72
72
function Base.:(== )(t1:: LinearMap , t2:: Translation )
73
- vecnorm (t1. linear) == 0 &&
74
- 0 == vecnorm (t2. translation)
73
+ isone (t1. linear) &&
74
+ 0 == norm (t2. translation)
75
75
end
76
76
77
77
function Base.:(== )(t1:: Translation , t2:: LinearMap )
78
- vecnorm (t1. translation) == 0 &&
79
- vecnorm (t2. linear) == 0
78
+ norm (t1. translation) == 0 &&
79
+ isone (t2. linear)
80
80
end
81
81
82
82
transform_deriv (trans:: LinearMap , x) = trans. linear
@@ -165,44 +165,44 @@ function Base.isapprox(t1::AffineMap, t2::AffineMap; kwargs...)
165
165
end
166
166
167
167
function Base. isapprox (t1:: AffineMap , t2:: Translation ; kwargs... )
168
- isapprox (vecnorm ( t1. linear), 0 ; kwargs... ) &&
168
+ isapprox (t1. linear, one (t1 . linear) ; kwargs... ) &&
169
169
isapprox (t1. translation, t2. translation; kwargs... )
170
170
end
171
171
172
172
function Base. isapprox (t1:: Translation , t2:: AffineMap ; kwargs... )
173
- isapprox (vecnorm ( t2. linear), 0 ; kwargs... ) &&
173
+ isapprox (t2. linear, one (t2 . linear) ; kwargs... ) &&
174
174
isapprox (t1. translation, t2. translation; kwargs... )
175
175
end
176
176
177
177
function Base. isapprox (t1:: AffineMap , t2:: LinearMap ; kwargs... )
178
178
isapprox (t1. linear, t2. linear; kwargs... ) &&
179
- isapprox (vecnorm (t1. translation), 0 ; kwargs... )
179
+ isapprox (norm (t1. translation), 0 ; kwargs... )
180
180
end
181
181
182
182
function Base. isapprox (t1:: LinearMap , t2:: AffineMap ; kwargs... )
183
183
isapprox (t1. linear, t2. linear; kwargs... ) &&
184
- isapprox (0 , vecnorm (t2. translation); kwargs... )
184
+ isapprox (0 , norm (t2. translation); kwargs... )
185
185
end
186
186
187
187
188
188
function Base.:(== )(t1:: AffineMap , t2:: Translation )
189
- vecnorm (t1. linear) == 0 &&
189
+ isone (t1. linear) &&
190
190
t1. translation == t2. translation
191
191
end
192
192
193
193
function Base.:(== )(t1:: Translation , t2:: AffineMap )
194
- vecnorm (t2. linear) == 0 &&
194
+ isone (t2. linear) &&
195
195
t1. translation == t2. translation
196
196
end
197
197
198
198
function Base.:(== )(t1:: AffineMap , t2:: LinearMap )
199
199
t1. linear == t2. linear &&
200
- vecnorm (t1. translation) == 0
200
+ norm (t1. translation) == 0
201
201
end
202
202
203
203
function Base.:(== )(t1:: LinearMap , t2:: AffineMap )
204
204
t1. linear == t2. linear &&
205
- 0 == vecnorm (t2. translation)
205
+ 0 == norm (t2. translation)
206
206
end
207
207
208
208
recenter (trans:: AbstractMatrix , origin:: Union{AbstractVector, Tuple} ) = recenter (LinearMap (trans), origin)
0 commit comments