@@ -69,17 +69,17 @@ module Test19626
69
69
ulims = map (x -> map (MockQuantity, x), lims)
70
70
for (lb, ub) in ulims
71
71
# # function
72
- f = x -> 1 / (1 + (x/ oneunit (x ))^ 2 )
72
+ f = x -> 1 / (1 + (x/ MockQuantity ( 1.0 ))^ 2 )
73
73
buf = QuadGK. alloc_segbuf (MockQuantity, Float64, MockQuantity)
74
74
@test QuadGK. quadgk (f, lb, ub, atol= MockQuantity (0.0 ))[1 ] ≈
75
75
QuadGK. quadgk (f, lb, ub, atol= MockQuantity (0.0 ), segbuf= buf)[1 ]
76
76
# # inplace
77
- fiip = (y, x) -> y[1 ] = 1 / (1 + (x/ oneunit (x ))^ 2 )
77
+ fiip = (y, x) -> y[1 ] = 1 / (1 + (x/ MockQuantity ( 1.0 ))^ 2 )
78
78
ibuf = QuadGK. alloc_segbuf (MockQuantity, Array{Float64,1 }, MockQuantity)
79
79
@test QuadGK. quadgk! (fiip, [MockQuantity (0.0 )], lb, ub, atol= MockQuantity (0.0 ), norm= abs∘ first)[1 ][] ≈
80
80
QuadGK. quadgk! (fiip, [MockQuantity (0.0 )], lb, ub, atol= MockQuantity (0.0 ), norm= abs∘ getindex, segbuf= ibuf)[1 ][]
81
81
# # batch
82
- fbatch = BatchIntegrand {Float64} ((y, x) -> y .= 1 ./ (1 .+ (x ./ oneunit .(x )) .^ 2 ))
82
+ fbatch = BatchIntegrand {Float64} ((y, x) -> y .= 1 ./ (1 .+ (x ./ MockQuantity ( 1.0 )) .^ 2 ))
83
83
@test QuadGK. quadgk (fbatch, lb, ub, atol= MockQuantity (0.0 ))[1 ] ≈
84
84
QuadGK. quadgk (fbatch, lb, ub, atol= MockQuantity (0.0 ), segbuf= buf)[1 ]
85
85
end
0 commit comments