Skip to content

Commit

Permalink
fix Floats to Vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLampert committed Sep 26, 2024
1 parent ea66100 commit 8f027eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/specializations/BezierCurve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function integral(
# Create a wrapper that returns only the value component in those units
uintegrand(uv) = Unitful.ustrip.(integrandunits, integrand(uv))
# Integrate only the unitless values
value = HCubature.hcubature(uintegrand, zero(FP), one(FP); rule.kwargs...)[1]
value = HCubature.hcubature(uintegrand, zeros(FP, 1), ones(FP, 1); rule.kwargs...)[1]

# Reapply units
return value .* integrandunits
Expand Down
4 changes: 2 additions & 2 deletions src/specializations/Ray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ function integral(

# HCubature doesn't support functions that output Unitful Quantity types
# Establish the units that are output by f
testpoint_parametriccoord = zero(FP)
testpoint_parametriccoord = zeros(FP, 1)
integrandunits = Unitful.unit.(integrand(testpoint_parametriccoord))
# Create a wrapper that returns only the value component in those units
uintegrand(uv) = Unitful.ustrip.(integrandunits, integrand(uv))
# Integrate only the unitless values
value = HCubature.hcubature(uintegrand, zero(FP), one(FP); rule.kwargs...)[1]
value = HCubature.hcubature(uintegrand, zeros(FP, 1), ones(FP, 1); rule.kwargs...)[1]

# Reapply units
return value .* integrandunits
Expand Down

0 comments on commit 8f027eb

Please sign in to comment.