Skip to content

Commit

Permalink
Print out imaginary part of logdet also.
Browse files Browse the repository at this point in the history
  • Loading branch information
klho committed Jun 26, 2020
1 parent c2b73cd commit 37d91de
Show file tree
Hide file tree
Showing 34 changed files with 129 additions and 109 deletions.
8 changes: 4 additions & 4 deletions hifde/test/fd_cube1.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ function fd_cube1(n,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions hifde/test/fd_cube1x.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ function fd_cube1x(n,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions hifde/test/fd_cube2.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ function fd_cube2(n,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions hifde/test/fd_cube2x.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ function fd_cube2x(n,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
10 changes: 5 additions & 5 deletions hifde/test/fd_cube3.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function fd_cube3(n,k,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
if doiter, [~,~,~,iter] = gmres(@(x)(A*x),B,32,1e-12,32); end

% run preconditioned GMRES
tic;
tic
[Y,~,~,piter] = gmres(@(x)(A*x),B,32,1e-12,32,@(x)hifde_sv(F,x));
t = toc;
err1 = norm(X - Y)/norm(X);
Expand All @@ -113,10 +113,10 @@ function fd_cube3(n,k,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
(iter(1)+1)*iter(2))

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
10 changes: 5 additions & 5 deletions hifde/test/fd_cube3x.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function fd_cube3x(n,k,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
if doiter, [~,~,~,iter] = gmres(@(x)(A*x),B,32,1e-12,32); end

% run preconditioned GMRES
tic;
tic
[Y,~,~,piter] = gmres(@(x)(A*x),B,32,1e-12,32,@(x)hifde_sv(F,x));
t = toc;
err1 = norm(X - Y)/norm(X);
Expand All @@ -115,10 +115,10 @@ function fd_cube3x(n,k,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
(iter(1)+1)*iter(2))

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions hifde/test/fd_square1.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ function fd_square1(n,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions hifde/test/fd_square1x.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ function fd_square1x(n,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions hifde/test/fd_square2.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ function fd_square2(n,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
10 changes: 5 additions & 5 deletions hifde/test/fd_square3.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function fd_square3(n,k,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
if doiter, [~,~,~,iter] = gmres(@(x)(A*x),B,32,1e-12,32); end

% run preconditioned GMRES
tic;
tic
[Y,~,~,piter] = gmres(@(x)(A*x),B,32,1e-12,32,@(x)hifde_sv(F,x));
t = toc;
err1 = norm(X - Y)/norm(X);
Expand All @@ -94,10 +94,10 @@ function fd_square3(n,k,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
(iter(1)+1)*iter(2))

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions hifde/test/fd_square4x.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ function fd_square4x(n,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions hifde/test/fd_square5.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ function fd_square5(n,occ,rank_or_tol,Tmax,skip,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = hifde_logdet(F);
t = toc;
fprintf('hifde_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = hifde_logdet(F); t = toc;
fprintf('hifde_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
4 changes: 3 additions & 1 deletion hifie/test/cov_cube1.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ function cov_cube1(n,occ,p,rank_or_tol,Tmax,skip,symm,noise,scale,diagmode)

% compute log-determinant
tic; ld = hifie_logdet(F); t = toc;
fprintf('hifie_logdet: %22.16e / %10.4e (s)\n',ld,t)
fprintf('hifie_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
4 changes: 3 additions & 1 deletion hifie/test/cov_cube2.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ function cov_cube2(n,occ,p,rank_or_tol,Tmax,skip,symm,noise,scale,diagmode)

% compute log-determinant
tic; ld = hifie_logdet(F); t = toc;
fprintf('hifie_logdet: %22.16e / %10.4e (s)\n',ld,t)
fprintf('hifie_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
4 changes: 3 additions & 1 deletion hifie/test/cov_square1.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ function cov_square1(n,occ,p,rank_or_tol,Tmax,skip,symm,noise,scale,diagmode)

% compute log-determinant
tic; ld = hifie_logdet(F); t = toc;
fprintf('hifie_logdet: %22.16e / %10.4e (s)\n',ld,t)
fprintf('hifie_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
4 changes: 3 additions & 1 deletion hifie/test/cov_square2.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ function cov_square2(n,occ,p,rank_or_tol,Tmax,skip,symm,noise,scale,diagmode)

% compute log-determinant
tic; ld = hifie_logdet(F); t = toc;
fprintf('hifie_logdet: %22.16e / %10.4e (s)\n',ld,t)
fprintf('hifie_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions mf/test/fd_cube1.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ function fd_cube1(n,occ,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = mf_logdet(F);
t = toc;
fprintf('mf_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = mf_logdet(F); t = toc;
fprintf('mf_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions mf/test/fd_cube1x.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ function fd_cube1x(n,occ,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = mf_logdet(F);
t = toc;
fprintf('mf_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = mf_logdet(F); t = toc;
fprintf('mf_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions mf/test/fd_cube2.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ function fd_cube2(n,occ,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = mf_logdet(F);
t = toc;
fprintf('mf_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = mf_logdet(F); t = toc;
fprintf('mf_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions mf/test/fd_cube3.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ function fd_cube3(n,k,occ,symm,doiter,diagmode)
(iter(1)+1)*iter(2))

% compute log-determinant
tic
ld = mf_logdet(F);
t = toc;
fprintf('mf_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = mf_logdet(F); t = toc;
fprintf('mf_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions mf/test/fd_line1x.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ function fd_line1x(n,occ,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = mf_logdet(F);
t = toc;
fprintf('mf_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = mf_logdet(F); t = toc;
fprintf('mf_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions mf/test/fd_line2x.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ function fd_line2x(n,occ,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = mf_logdet(F);
t = toc;
fprintf('mf_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = mf_logdet(F); t = toc;
fprintf('mf_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions mf/test/fd_square1.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ function fd_square1(n,occ,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = mf_logdet(F);
t = toc;
fprintf('mf_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = mf_logdet(F); t = toc;
fprintf('mf_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions mf/test/fd_square1x.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ function fd_square1x(n,occ,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = mf_logdet(F);
t = toc;
fprintf('mf_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = mf_logdet(F); t = toc;
fprintf('mf_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
8 changes: 4 additions & 4 deletions mf/test/fd_square2.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ function fd_square2(n,occ,symm,doiter,diagmode)
fprintf(' precon/unprecon iter: %d / %d\n',piter,iter)

% compute log-determinant
tic
ld = mf_logdet(F);
t = toc;
fprintf('mf_logdet: %22.16e / %10.4e (s)\n',ld,t)
tic; ld = mf_logdet(F); t = toc;
fprintf('mf_logdet:\n')
fprintf(' real/imag: %22.16e / %22.16e\n',real(ld),imag(ld))
fprintf(' time: %10.4e (s)\n',t)

if diagmode > 0
% prepare for diagonal extraction
Expand Down
Loading

0 comments on commit 37d91de

Please sign in to comment.