TTeMPS Toolbox. Michael Steinlechner, 2013-2016 Questions and contact: michael.steinlechner@epfl.ch BSD 2-clause license, see LICENSE.txt
0001 % TTeMPS Toolbox. 0002 % Michael Steinlechner, 2013-2016 0003 % Questions and contact: michael.steinlechner@epfl.ch 0004 % BSD 2-clause license, see LICENSE.txt 0005 0006 function check_precond_laplace(P, grad, P_grad) 0007 0008 d = grad.order; 0009 0010 0011 % first check whether P_grad is correctly gauged 0012 for ii=1:d-1 0013 orth_err(ii) = norm( unfold(P_grad.dU{ii},'left')'*unfold(grad.U{ii},'left') , 2 ) / norm( unfold(P_grad.dU{ii},'left'), 2 ); 0014 end 0015 0016 if max(orth_err) > 1e-12 0017 orth_err 0018 warning('precond_laplace.m returned an inaccurate result') 0019 end 0020 0021 end