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