|
368 | 368 |
|
369 | 369 | R = real(M) |
370 | 370 | @test typeof(M)(M) == M |
| 371 | + |
| 372 | + P = PlusOperator([M,M]) |
| 373 | + @test typeof(P)(P) == P |
| 374 | + |
| 375 | + T = TimesOperator([M,M]) |
| 376 | + @test typeof(T)(T) == T |
| 377 | + |
| 378 | + cT = 2M |
| 379 | + @test typeof(cT)(cT) == cT |
| 380 | + |
| 381 | + Q = qr(M) |
| 382 | + Q2 = typeof(Q)(Q) |
| 383 | + # For some reason (perhaps owing to mutability), this does't satisfy Q == Q2, |
| 384 | + # so we check the fields |
| 385 | + @test typeof(Q) == typeof(Q2) |
| 386 | + @test all(x -> getfield(Q, x) === getfield(Q2, x), fieldnames(typeof(Q))) |
| 387 | + |
| 388 | + Sp = ApproxFunBase.SpaceOperator(M, PointSpace(2:4), PointSpace(2:4)) |
| 389 | + @test typeof(Sp)(Sp) == Sp |
| 390 | + |
| 391 | + K = Sp ⊗ Sp |
| 392 | + @test typeof(K)(K) == K |
| 393 | + |
| 394 | + Sb = view(M, 1:3, 1:3) |
| 395 | + @test typeof(Sb)(Sb) == Sb |
| 396 | + |
| 397 | + Intrlc = [M; M] |
| 398 | + @test typeof(Intrlc)(Intrlc) == Intrlc |
| 399 | + |
| 400 | + Hrm = ApproxFunBase.HermitianOperator(M) |
| 401 | + @test typeof(Hrm)(Hrm) == Hrm |
| 402 | + |
| 403 | + Sym = ApproxFunBase.SymmetricOperator(M) |
| 404 | + @test typeof(Sym)(Sym) == Sym |
| 405 | + |
| 406 | + Cch = cache(M) |
| 407 | + Cch2 = typeof(Cch)(Cch) |
| 408 | + # For some reason (perhaps owing to mutability), this does't satisfy Cch == Cch2, |
| 409 | + # so we check the fields |
| 410 | + @test typeof(Cch) == typeof(Cch2) |
| 411 | + @test all(x -> getfield(Cch, x) === getfield(Cch2, x), fieldnames(typeof(Cch))) |
| 412 | + |
| 413 | + Madj = M' |
| 414 | + @test typeof(Madj)(Madj) == Madj |
| 415 | + |
| 416 | + Mtr = transpose(M) |
| 417 | + @test typeof(Mtr)(Mtr) == Mtr |
| 418 | + |
| 419 | + CnstO = Operator(2I, PointSpace(1:3)) |
| 420 | + @test typeof(CnstO)(CnstO) == CnstO |
| 421 | + |
| 422 | + Tplz = ApproxFunBase.ToeplitzOperator([1,2], [2,3]) |
| 423 | + @test typeof(Tplz)(Tplz) == Tplz |
| 424 | + |
| 425 | + Hnkl = ApproxFunBase.HankelOperator([1,2, 3]) |
| 426 | + @test typeof(Hnkl)(Hnkl) == Hnkl |
371 | 427 | end |
372 | 428 | end |
373 | 429 |
|
|
0 commit comments