Skip to content

Commit

Permalink
dummy instead of Cii compress
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-saydjari committed Dec 31, 2022
1 parent deec8e4 commit 94f7e83
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions test/compress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
n_big = 100
n_lit = 2

A = 1e-5*abs.(randn(n_big))
A = 1e-4*abs.(randn(n_big))
V = randn(n_big,n_lit)
W = DiagWoodbury(A,V)

Expand All @@ -12,31 +12,28 @@
W1 = read_krybury(fname)
@test W == W1

function Cii_precomp_mult(matList)
function dummy_precomp_mult(matList)
return []
end

function Cii_fxn_mult(matList,precompList,x)
Ctotinv = matList[1]
function dummy_fxn_mult(matList,precompList,x)
A = matList[1]
Vi = matList[2]
arg2 = Vi*(Vi'*x)
return arg2 - Vi*(Vi'*(Ctotinv*arg2))
return A*x + Vi*(Vi'*x)
end

function Cii_precomp_diag(matList)
Ctotinv = matList[1]
Vi = matList[2]
return [Vi'*(Ctotinv*Vi)]
function dummy_precomp_diag(matList)
return []
end

function Cii_diag_map(matList,precompList)
function dummy_diag_map(matList,precompList)
A = matList[1]
Vi = matList[2]
arg1 = precompList[1]
return dropdims(sum(Vi.^2,dims=2),dims=2).-dropdims(sum(Vi'.*(arg1*Vi'),dims=1),dims=1)
return diag(A) + dropdims(sum(Vi.^2,dims=2),dims=2)
end

BMat = LowRankMultMat([Diagonal(A),V],Cii_precomp_mult,Cii_fxn_mult);
BMatDiag = LowRankDiagMat([Diagonal(A),V],Cii_precomp_diag,Cii_diag_map);
BMat = LowRankMultMat([Diagonal(A),V],dummy_precomp_mult,dummy_fxn_mult);
BMatDiag = LowRankDiagMat([Diagonal(A),V],dummy_precomp_diag,dummy_diag_map);

out = kryburyCompress(BMat,BMatDiag,n_big)

Expand Down

2 comments on commit 94f7e83

@andrew-saydjari
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/74861

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 94f7e83fe12e6ceb945de0390fad187307d6836f
git push origin v0.1.0

Please sign in to comment.