@@ -483,12 +483,12 @@ for (f, elty) in ((:dsyevd_, :Float64), (:ssyevd_, :Float32))
483
483
function syevd! (jobz:: Char , uplo:: Char , A:: StridedMatrix{$elty} )
484
484
n = LinearAlgebra. checksquare (A)
485
485
lda = stride (A, 2 )
486
- w = Vector {$elty} (n)
486
+ w = Vector {$elty} (undef, n)
487
487
work = Vector {$elty} (undef, 1 )
488
488
lwork = BlasInt (- 1 )
489
489
iwork = Vector {BlasInt} (undef, 1 )
490
490
liwork = BlasInt (- 1 )
491
- info = BlasInt[ 0 ]
491
+ info = Ref ( BlasInt ( 0 ))
492
492
for i = 1 : 2
493
493
ccall (
494
494
(@blasfunc ($ f), liblapack_name),
@@ -504,7 +504,7 @@ for (f, elty) in ((:dsyevd_, :Float64), (:ssyevd_, :Float32))
504
504
Ref{BlasInt},
505
505
Ptr{BlasInt},
506
506
Ref{BlasInt},
507
- Ptr {BlasInt},
507
+ Ref {BlasInt},
508
508
),
509
509
jobz,
510
510
uplo,
@@ -519,8 +519,8 @@ for (f, elty) in ((:dsyevd_, :Float64), (:ssyevd_, :Float32))
519
519
info,
520
520
)
521
521
522
- if info[1 ] != 0
523
- return LinearAlgebra. LAPACKException (info[1 ])
522
+ if info[] != 0
523
+ return LinearAlgebra. LAPACKException (info[])
524
524
end
525
525
if i == 1
526
526
lwork = BlasInt (work[1 ])
@@ -540,14 +540,14 @@ for (f, elty, relty) in
540
540
function heevd! (jobz:: Char , uplo:: Char , A:: StridedMatrix{$elty} )
541
541
n = LinearAlgebra. checksquare (A)
542
542
lda = stride (A, 2 )
543
- w = Vector {$relty} (n)
543
+ w = Vector {$relty} (undef, n)
544
544
work = Vector {$elty} (undef, 1 )
545
545
lwork = BlasInt (- 1 )
546
546
rwork = Vector {$relty} (undef, 1 )
547
547
lrwork = BlasInt (- 1 )
548
548
iwork = Vector {BlasInt} (undef, 1 )
549
549
liwork = BlasInt (- 1 )
550
- info = BlasInt[ 0 ]
550
+ info = Ref ( BlasInt ( 0 ))
551
551
for i = 1 : 2
552
552
ccall (
553
553
(@blasfunc ($ f), liblapack_name),
@@ -565,7 +565,7 @@ for (f, elty, relty) in
565
565
Ref{BlasInt},
566
566
Ptr{BlasInt},
567
567
Ref{BlasInt},
568
- Ptr {BlasInt},
568
+ Ref {BlasInt},
569
569
),
570
570
jobz,
571
571
uplo,
@@ -582,8 +582,8 @@ for (f, elty, relty) in
582
582
info,
583
583
)
584
584
585
- if info[1 ] != 0
586
- return LinearAlgebra. LAPACKException (info[1 ])
585
+ if info[] != 0
586
+ return LinearAlgebra. LAPACKException (info[])
587
587
end
588
588
589
589
if i == 1
@@ -675,23 +675,23 @@ for (f, elty) in ((:dtgevc_, :Float64), (:stgevc_, :Float32))
675
675
)
676
676
end
677
677
elseif howmny == ' S'
678
- mx, mn = extrama (select)
679
- if mx > 1 || nm < 0
678
+ mx, mn = extrema (select)
679
+ if mx > 1 || mn < 0
680
680
throw (ArgumentError (" the elements of select must be either 0 or 1" ))
681
681
end
682
- if sum (howmny ) != mm
682
+ if sum (select ) != mm
683
683
throw (
684
684
DimensionMismatch (
685
- " the number of columns in the output arrays is $mm , but you have selected $(sum (howmny )) vectors" ,
685
+ " the number of columns in the output arrays is $mm , but you have selected $(sum (select )) vectors" ,
686
686
),
687
687
)
688
688
end
689
689
else
690
- throw (ArgumentError (" howmny must be either A, B, or S" ))
690
+ throw (ArgumentError (" howmny must be either A, B, or S but was $howmny " ))
691
691
end
692
692
693
- m = BlasInt[ 0 ]
694
- info = BlasInt[ 0 ]
693
+ m = Ref ( BlasInt ( 0 ))
694
+ info = Ref ( BlasInt ( 0 ))
695
695
696
696
ccall (
697
697
(@blasfunc ($ f), liblapack_name),
@@ -710,9 +710,9 @@ for (f, elty) in ((:dtgevc_, :Float64), (:stgevc_, :Float32))
710
710
Ptr{$ elty},
711
711
Ref{BlasInt},
712
712
Ref{BlasInt},
713
- Ptr {BlasInt},
713
+ Ref {BlasInt},
714
714
Ptr{$ elty},
715
- Ptr {BlasInt},
715
+ Ref {BlasInt},
716
716
),
717
717
side,
718
718
howmny,
@@ -732,11 +732,11 @@ for (f, elty) in ((:dtgevc_, :Float64), (:stgevc_, :Float32))
732
732
info,
733
733
)
734
734
735
- if info[1 ] != 0
736
- throw (LAPACKException (info[1 ]))
735
+ if info[] != 0
736
+ throw (LAPACKException (info[]))
737
737
end
738
738
739
- return VL, VR, m[1 ]
739
+ return VL, VR, m[]
740
740
end
741
741
742
742
function tgevc! (
@@ -750,7 +750,7 @@ for (f, elty) in ((:dtgevc_, :Float64), (:stgevc_, :Float32))
750
750
)
751
751
752
752
n = LinearAlgebra. checksquare (S)
753
- work = Vector {$elty} (6 n)
753
+ work = Vector {$elty} (undef, 6 n)
754
754
755
755
return tgevc! (side, howmny, select, S, P, VL, VR, work)
756
756
end
@@ -765,26 +765,26 @@ for (f, elty) in ((:dtgevc_, :Float64), (:stgevc_, :Float32))
765
765
# No checks here as they are done in method above
766
766
n = LinearAlgebra. checksquare (S)
767
767
if side == ' L'
768
- VR = Matrix {$elty} (n, 0 )
768
+ VR = Matrix {$elty} (undef, n, 0 )
769
769
if howmny == ' A' || howmny == ' B'
770
- VL = Matrix {$elty} (n, n)
770
+ VL = Matrix {$elty} (undef, n, n)
771
771
else
772
- VL = Matrix {$elty} (n, sum (select))
772
+ VL = Matrix {$elty} (undef, n, sum (select))
773
773
end
774
774
elseif side == ' R'
775
- VL = Matrix {$elty} (n, 0 )
775
+ VL = Matrix {$elty} (undef, n, 0 )
776
776
if howmny == ' A' || howmny == ' B'
777
- VR = Matrix {$elty} (n, n)
777
+ VR = Matrix {$elty} (undef, n, n)
778
778
else
779
- VR = Matrix {$elty} (n, sum (select))
779
+ VR = Matrix {$elty} (undef, n, sum (select))
780
780
end
781
781
else
782
782
if howmny == ' A' || howmny == ' B'
783
- VL = Matrix {$elty} (n, n)
784
- VR = Matrix {$elty} (n, n)
783
+ VL = Matrix {$elty} (undef, n, n)
784
+ VR = Matrix {$elty} (undef, n, n)
785
785
else
786
- VL = Matrix {$elty} (n, sum (select))
787
- VR = Matrix {$elty} (n, sum (select))
786
+ VL = Matrix {$elty} (undef, n, sum (select))
787
+ VR = Matrix {$elty} (undef, n, sum (select))
788
788
end
789
789
end
790
790
0 commit comments