Skip to content

Commit

Permalink
Fix a final function.
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertuer committed Dec 30, 2024
1 parent 8b9cbcb commit 304426a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/plans/vectorial_plan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,11 @@ function get_jacobian!(
return JF
end

get_jacobian_basis(vgf::AbstractVectorGradientFunction) = DefaultOrthonormalBasis()
function get_jacobian_basis(
vgf::AbstractVectorGradientFunction{F,G,<:CoordinateVectorialType}
) where {F,G}
return vgf.jacobian_type.basis
function get_jacobian_basis(vgf::AbstractVectorGradientFunction)
return _get_jacobian_basis(vgf.jacobian_type)
end
_get_jacobian_basis(jt::AbstractVectorialType) = DefaultOrthonormalBasis()
_get_jacobian_basis(jt::CoordinateVectorialType) = jt.basis

#
#
Expand Down
10 changes: 10 additions & 0 deletions test/plans/test_vectorial_plan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ using Manopt: get_value, get_value_function, get_gradient_function
)
@test Manopt.get_jacobian_basis(vgf_ji) == vgf_ji.jacobian_type.basis
@test Manopt.get_jacobian_basis(vgf_vi) == DefaultOrthonormalBasis()
vgf_jib = VectorGradientFunction(
g!,
jac_g!,
2;
jacobian_type=CoordinateVectorialType(DefaultBasis()),
evaluation=InplaceEvaluation(),
)
@test Manopt.get_jacobian_basis(vgf_ji) == vgf_ji.jacobian_type.basis
@test Manopt.get_jacobian_basis(vgf_jib) == DefaultBasis()
@test Manopt.get_jacobian_basis(vgf_vi) == DefaultOrthonormalBasis()
p = [1.0, 2.0, 3.0]
c = [0.0, -3.0]
gg = [[1.0, 0.0, 0.0], [0.0, -1.0, 0.0]]
Expand Down

0 comments on commit 304426a

Please sign in to comment.