@@ -8,6 +8,12 @@ export valuetype, value, hasinf, hasorigin, isorigin, norm, indices, tangent, is
8
8
(M:: Signature )(b:: Int... ) = SubManifold {M} (b)
9
9
(M:: DiagonalForm )(b:: Int... ) = SubManifold {M} (b)
10
10
(M:: SubManifold )(b:: Int... ) = SubManifold {supermanifold(M)} (b)
11
+ (M:: Signature )(b:: T ) where T<: AbstractVector{Int} = SubManifold {M} (b)
12
+ (M:: DiagonalForm )(b:: T ) where T<: AbstractVector{Int} = SubManifold {M} (b)
13
+ (M:: SubManifold )(b:: T ) where T<: AbstractVector{Int} = SubManifold {supermanifold(M)} (b)
14
+ (M:: Signature )(b:: T ) where T<: AbstractRange{Int} = SubManifold {M} (b)
15
+ (M:: DiagonalForm )(b:: T ) where T<: AbstractRange{Int} = SubManifold {M} (b)
16
+ (M:: SubManifold )(b:: T ) where T<: AbstractRange{Int} = SubManifold {supermanifold(M)} (b)
11
17
12
18
@pure Base. ndims (S:: SubManifold{M,G} ) where {G,M} = isbasis (S) ? ndims (M) : G
13
19
@pure grade (V:: M ) where M<: Manifold{N} where N = N- (isdyadic (V) ? 2 : 1 )* diffvars (V)
@@ -50,15 +56,21 @@ const mixedmode = dyadmode
50
56
@inline value (:: SubManifold ,T= Int) = T== Any ? 1 : one (T)
51
57
@inline value (m:: Simplex ,T:: DataType = valuetype (m)) = T∉ (valuetype (m),Any) ? convert (T,m. v) : m. v
52
58
@inline value_diff (m:: T ) where T<: TensorTerm = (v= value (m);istensor (v) ? v : m)
53
- @pure isbasis (:: SubManifold{V} ) where V = typeof (V)<: SubManifold
54
- @pure isbasis (:: T ) where T<: TensorBundle = false
55
- @pure isbasis (:: Simplex ) = false
59
+
60
+ for T ∈ (:T ,:(Type{T}))
61
+ @eval begin
62
+ @pure isbasis (:: $T ) where T<: SubManifold{V} where V = typeof (V)<: SubManifold
63
+ @pure isbasis (:: $T ) where T<: TensorAlgebra = false
64
+ @pure isbasis (:: $T ) where T<: TensorBundle = false
65
+ @pure isbasis (:: $T ) where T<: Simplex = false
66
+ @pure bits (b:: $T ) where T<: SubManifold{V,G,B} where {V,G} where B = B:: UInt
67
+ @pure UInt (b:: $T ) where T<: SubManifold{V,G,B} where {V,G} where B = B:: UInt
68
+ end
69
+ end
70
+ @pure UInt (m:: T ) where T<: TensorTerm = UInt (basis (m))
71
+ @pure bits (m:: T ) where T<: TensorTerm = bits (basis (m))
56
72
@pure basis (m:: SubManifold ) = isbasis (m) ? m : SubManifold (m)
57
73
@pure basis (m:: Simplex{V,G,B} where {V,G}) where B = B
58
- @pure UInt (m:: T ) where T<: TensorTerm = bits (basis (m))
59
- @pure bits (m:: T ) where T<: TensorTerm = bits (basis (m))
60
- @pure bits (b:: SubManifold{V,G,B} where {V,G}) where B = B:: UInt
61
- @pure bits (:: Type{SubManifold{V,G,B}} where {V,G}) where B = B
62
74
@pure det (s:: Signature ) = isodd (count_ones (metric (s))) ? - 1 : 1
63
75
@pure det (s:: DiagonalForm ) = PROD (diagonalform (s))
64
76
@pure Base. abs (s:: SubManifold ) = isbasis (s) ? Base. sqrt (Base. abs2 (s)) : sqrt (abs (det (s)))
0 commit comments