@@ -139,7 +139,6 @@ bimg = randn(n,2)/2
139
139
A = zeros (eltya,1 ,1 )
140
140
A[1 ,1 ] = α
141
141
@test diagm (α) == A # Test behavior of `diagm` when passed a scalar
142
- @test expm (α) == exp (α) # `expm` should behave like `exp` with scalar argument
143
142
end
144
143
145
144
@testset " Factorize" begin
416
415
eA1 = convert (Matrix{elty}, [147.866622446369 127.781085523181 127.781085523182 ;
417
416
183.765138646367 183.765138646366 163.679601723179 ;
418
417
71.797032399996 91.8825693231832 111.968106246371 ]' )
419
- @test expm (A1) ≈ eA1
418
+ @test exp (A1) ≈ eA1
420
419
421
420
A2 = convert (Matrix{elty},
422
421
[29.87942128909879 0.7815750847907159 - 2.289519314033932 ;
@@ -426,21 +425,21 @@ end
426
425
[ 5496313853692458.0 - 18231880972009236.0 - 30475770808580460.0 ;
427
426
- 18231880972009252.0 60605228702221920.0 101291842930249760.0 ;
428
427
- 30475770808580480.0 101291842930249728.0 169294411240851968.0 ])
429
- @test expm (A2) ≈ eA2
428
+ @test exp (A2) ≈ eA2
430
429
431
430
A3 = convert (Matrix{elty}, [- 131 19 18 ;- 390 56 54 ;- 387 57 52 ])
432
431
eA3 = convert (Matrix{elty}, [- 1.50964415879218 - 5.6325707998812 - 4.934938326092 ;
433
432
0.367879439109187 1.47151775849686 1.10363831732856 ;
434
433
0.135335281175235 0.406005843524598 0.541341126763207 ]' )
435
- @test expm (A3) ≈ eA3
434
+ @test exp (A3) ≈ eA3
436
435
437
436
A4 = convert (Matrix{elty}, [0.25 0.25 ; 0 0 ])
438
437
eA4 = convert (Matrix{elty}, [1.2840254166877416 0.2840254166877415 ; 0 1 ])
439
- @test expm (A4) ≈ eA4
438
+ @test exp (A4) ≈ eA4
440
439
441
440
A5 = convert (Matrix{elty}, [0 0.02 ; 0 0 ])
442
441
eA5 = convert (Matrix{elty}, [1 0.02 ; 0 1 ])
443
- @test expm (A5) ≈ eA5
442
+ @test exp (A5) ≈ eA5
444
443
445
444
# Hessenberg
446
445
@test hessfact (A1)[:H ] ≈ convert (Matrix{elty},
@@ -454,20 +453,20 @@ end
454
453
1 / 3 1 / 4 1 / 5 1 / 6 ;
455
454
1 / 4 1 / 5 1 / 6 1 / 7 ;
456
455
1 / 5 1 / 6 1 / 7 1 / 8 ])
457
- @test expm (logm (A4)) ≈ A4
456
+ @test exp (logm (A4)) ≈ A4
458
457
459
458
A5 = convert (Matrix{elty}, [1 1 0 1 ; 0 1 1 0 ; 0 0 1 1 ; 1 0 0 1 ])
460
- @test expm (logm (A5)) ≈ A5
459
+ @test exp (logm (A5)) ≈ A5
461
460
462
461
A6 = convert (Matrix{elty}, [- 5 2 0 0 ; 1 / 2 - 7 3 0 ; 0 1 / 3 - 9 4 ; 0 0 1 / 4 - 11 ])
463
- @test expm (logm (A6)) ≈ A6
462
+ @test exp (logm (A6)) ≈ A6
464
463
465
464
A7 = convert (Matrix{elty}, [1 0 0 1e-8 ; 0 1 0 0 ; 0 0 1 0 ; 0 0 0 1 ])
466
- @test expm (logm (A7)) ≈ A7
465
+ @test exp (logm (A7)) ≈ A7
467
466
end
468
467
469
468
A8 = 100 * [- 1 + 1im 0 0 1e-8 ; 0 1 0 0 ; 0 0 1 0 ; 0 0 0 1 ]
470
- @test expm (logm (A8)) ≈ A8
469
+ @test exp (logm (A8)) ≈ A8
471
470
end
472
471
473
472
@testset " issue 5116" begin
@@ -476,19 +475,19 @@ end
476
475
0.006540706968939 - 0.999786072879326 0.0 0.0
477
476
0.0 0.0 1.0 0.0
478
477
0.013081413937878 - 3.999572145758650 0.0 1.0 ]
479
- @test expm (A9) ≈ eA9
478
+ @test exp (A9) ≈ eA9
480
479
481
480
A10 = [ 0. 0. 0. 0. ; 0. 0. - im 0. ; 0. im 0. 0. ; 0. 0. 0. 0. ]
482
481
eA10 = [ 1.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im
483
482
0.0 + 0.0im 1.543080634815244 + 0.0im 0.0 - 1.175201193643801im 0.0 + 0.0im
484
483
0.0 + 0.0im 0.0 + 1.175201193643801im 1.543080634815243 + 0.0im 0.0 + 0.0im
485
484
0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im 1.0 + 0.0im ]
486
- @test expm (A10) ≈ eA10
485
+ @test exp (A10) ≈ eA10
487
486
end
488
487
489
488
@testset " Additional matrix logarithm tests" for elty in (Float64, Complex{Float64})
490
489
A11 = convert (Matrix{elty}, [3 2 ; - 5 - 3 ])
491
- @test expm (logm (A11)) ≈ A11
490
+ @test exp (logm (A11)) ≈ A11
492
491
493
492
A12 = convert (Matrix{elty}, [1 - 1 ; 1 - 1 ])
494
493
@test typeof (logm (A12)) == Array{Complex{Float64}, 2 }
498
497
0.2310490602 1.295566591 0.2651438179 ;
499
498
0.2310490602 0.1969543025 1.363756107 ])
500
499
@test logm (A1) ≈ logmA1
501
- @test expm (logm (A1)) ≈ A1
500
+ @test exp (logm (A1)) ≈ A1
502
501
503
502
A4 = convert (Matrix{elty}, [1 / 2 1 / 3 1 / 4 1 / 5 + eps ();
504
503
1 / 3 1 / 4 1 / 5 1 / 6 ;
509
508
0.4462766564 2.994142974 - 7.351095988 3.318413247 ;
510
509
0.2414170219 0.5865285289 3.318413247 - 5.444632124 ])
511
510
@test logm (A4) ≈ logmA4
512
- @test expm (logm (A4)) ≈ A4
511
+ @test exp (logm (A4)) ≈ A4
513
512
end
514
513
515
514
@testset " issue #7181" begin
615
614
616
615
@testset " test ops on Numbers for $elty " for elty in [Float32,Float64,Complex64,Complex128]
617
616
a = rand (elty)
618
- @test expm (a) == exp (a)
617
+ @test exp (a) == exp (a)
619
618
@test isposdef (one (elty))
620
619
@test sqrtm (a) == sqrt (a)
621
620
@test logm (a) ≈ log (a)
0 commit comments