-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
…ifolds
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,6 +144,21 @@ end | |
return inner(M.manifold, x, v, w) | ||
end | ||
|
||
@traitfn function inner(B::VectorBundleFibers{<:CotangentSpaceType, MMT}, x, v, w) where {MT<:Manifold, | ||
GT<:Metric, | ||
MMT<:MetricManifold{MT,GT}; | ||
!HasMetric{MT,GT}} | ||
ginv = inverse_local_metric(B.M, x) | ||
return dot(ginv * v, ginv * w) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mateuszbaran
Author
Member
|
||
end | ||
|
||
@traitfn function inner(B::VectorBundleFibers{<:CotangentSpaceType, MMT}, x, v, w) where {MT<:Manifold, | ||
GT<:Metric, | ||
MMT<:MetricManifold{MT,GT}; | ||
HasMetric{MT,GT}} | ||
return inner(VectorBundleFibers(B.VS, B.M.manifold), x, v, w) | ||
end | ||
|
||
@traitfn function norm(M::MMT, x, v) where {MT<:Manifold, | ||
GT<:Metric, | ||
MMT<:MetricManifold{MT,GT}; | ||
|
@@ -457,3 +472,47 @@ end | |
HasMetric{MT,GT}} | ||
return is_tangent_vector(M.manifold, x, v; kwargs...) | ||
end | ||
|
||
@traitfn function flat!(M::MMT, | ||
v::FVector{CotangentSpaceType}, | ||
x, | ||
w::FVector{TangentSpaceType}) where {MT<:Manifold, | ||
GT<:Metric, | ||
MMT<:MetricManifold{MT,GT}; | ||
!HasMetric{MT,GT}} | ||
g = local_metric(M, x) | ||
copyto!(v, g*w) | ||
return v | ||
end | ||
|
||
@traitfn function flat!(M::MMT, | ||
v::FVector{CotangentSpaceType}, | ||
x, | ||
w::FVector{TangentSpaceType}) where {MT<:Manifold, | ||
GT<:Metric, | ||
MMT<:MetricManifold{MT,GT}; | ||
HasMetric{MT,GT}} | ||
return flat!(M.manifold, v, x, w) | ||
end | ||
|
||
@traitfn function sharp!(M::MMT, | ||
v::FVector{TangentSpaceType}, | ||
x, | ||
w::FVector{CotangentSpaceType}) where {MT<:Manifold, | ||
GT<:Metric, | ||
MMT<:MetricManifold{MT,GT}; | ||
!HasMetric{MT,GT}} | ||
ginv = inverse_local_metric(M, x) | ||
copyto!(v, ginv*w) | ||
return v | ||
end | ||
|
||
@traitfn function sharp!(M::MMT, | ||
v::FVector{TangentSpaceType}, | ||
x, | ||
w::FVector{CotangentSpaceType}) where {MT<:Manifold, | ||
GT<:Metric, | ||
MMT<:MetricManifold{MT,GT}; | ||
HasMetric{MT,GT}} | ||
return flat!(M.manifold, v, x, w) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
end |
I don't think this is correct. It should be
v' * ginv * W
. I'm working on a 3-argdot
in Julia.Base. JuliaLang/julia#32739 With that one, it would bedot(v, ginv, w)
.