Skip to content

Commit 7149875

Browse files
committed
transferred isapprox for chakravala/Leibniz.jl#2
1 parent 8c7978b commit 7149875

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DirectSum"
22
uuid = "22fd7b30-a8c0-5bf2-aabe-97783860d07c"
33
authors = ["Michael Reed"]
4-
version = "0.7.4"
4+
version = "0.7.5"
55

66
[deps]
77
ComputedFieldTypes = "459fdd68-db75-56b8-8c15-d717a790f88e"

src/DirectSum.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,13 @@ end
390390

391391
Base.:(==)(a::TensorTerm{V,G},b::TensorTerm{V,G}) where {V,G} = basis(a) == basis(b) ? value(a) == value(b) : 0 == value(a) == value(b)
392392

393+
for T (Fields...,Symbol,Expr)
394+
@eval begin
395+
Base.isapprox(a::S,b::T) where {S<:TensorAlgebra,T<:$T} = Base.isapprox(a,Simplex{Manifold(a)}(b))
396+
Base.isapprox(a::S,b::T) where {S<:$T,T<:TensorAlgebra} = Base.isapprox(b,a)
397+
end
398+
end
399+
393400
for Field Fields
394401
TF = Field Fields ? :Any : :T
395402
EF = Field Any ? Field : ExprField

0 commit comments

Comments
 (0)