@@ -204,6 +204,28 @@ function test_lbfgs()
204
204
@test nallocs == 0
205
205
end
206
206
207
+ @testset " push! errors" begin
208
+ n = 100
209
+ mem = 20
210
+ B = LBFGSOperator (n, mem = mem)
211
+ H = InverseLBFGSOperator (n, mem = mem)
212
+ BD = LBFGSOperator (n, mem = mem, damped = true )
213
+ HD = InverseLBFGSOperator (n, mem = mem, damped = true )
214
+ s = ones (n)
215
+ y = ones (n)
216
+ g = ones (n)
217
+ Bs = zeros (n)
218
+ @test_throws ErrorException push! (B, s, y, Bs)
219
+ @test_throws ErrorException push! (H, s, y, Bs)
220
+ @test_throws ErrorException push! (HD, s, y, Bs)
221
+ @test_throws ErrorException push! (B, s, y, 1.0 , g)
222
+ @test_throws ErrorException push! (BD, s, y, 1.0 , g)
223
+ @test_throws ErrorException push! (H, s, y, 1.0 , g)
224
+ @test_throws ErrorException push! (B, s, y, 1.0 , g, Bs)
225
+ @test_throws ErrorException push! (BD, s, y, 1.0 , g, Bs)
226
+ @test_throws ErrorException push! (H, s, y, 1.0 , g, Bs)
227
+ end
228
+
207
229
@testset " LBFGS eigenvalues" begin
208
230
n = 100
209
231
mem = 20
0 commit comments