Skip to content

Commit

Permalink
Test 3 for MPGArray
Browse files Browse the repository at this point in the history
  • Loading branch information
ctkelley committed Nov 19, 2023
1 parent 8b17c9b commit c53b692
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
18 changes: 0 additions & 18 deletions src/Factorizations/mpglu!.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@ MPF=MPGEFact(AH, AL, ALF, VStore, KStore, res, true)
return MPF
end

function mpglu!(MPH::MPArray; basissize=10)
AH = MPH.AH
TD = eltype(AH)
res = MPH.residual
n=length(res)
AL = MPH.AL
TL = eltype(AL)
#
# Factor in low precision
#
(TL == Float16) ? ALF = hlu!(AL) : ALF = lu!(AL)
#
VStore=zeros(TD, n, basissize)
KStore=kstore(n,"gmres")
MPF=MPGEFact(AH, AL, ALF, VStore, KStore, res, true)
return MPF
end

"""
mpglu(A::Array{TH,2}; TL=Float32, basissize=10) where TH <: Real
Expand Down
4 changes: 2 additions & 2 deletions test/DetailsTest/mplu_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ mpglu_test()
Make sure that mpglu and mpglu! do what they are supposed to do
"""
function mpglu_test()
AD=rand(10,10); MPD=MPArray(AD); MPF1=mpglu!(MPD); MPF2=mpglu(AD);
AD=rand(10,10); MPD=MPGArray(AD); MPF1=mpglu!(MPD); MPF2=mpglu(AD);
eq64=test_eq(MPF1,MPF2)
eq64 || println("mpglu t1 fails")
ADx=rand(10,10); MPDx=MPGArray(ADx; TL=Float16);
MPF1x=mpglu!(MPDx); MPF2x=mpglu(ADx; TL=Float16);
eq64x=test_eq(MPF1x,MPF2x)
eq64x || println("mpglu t2 fails")
AS=Float32.(AD); MPS=MPArray(AS); MSF1=mpglu!(MPS); MSF2=mpglu(AS)
AS=Float32.(AD); MPS=MPGArray(AS); MSF1=mpglu!(MPS); MSF2=mpglu(AS)
eq32=test_eq(MSF1,MSF2)
eq32 || println("mpglu t3 fails")
mpgluok = (eq64 && eq64x && eq32)
Expand Down
2 changes: 1 addition & 1 deletion test/GM-IRTest/hvse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ end
function unitt(N)
A64=I - 800.0*Gmat(N)
A=Float32.(A64)
MPA=MPArray(A)
MPA=MPGArray(A)
MPF=mpglu!(MPA)
MPH=MPHArray(A)
MPHF=mpglu!(MPH)
Expand Down

0 comments on commit c53b692

Please sign in to comment.