Frobenius norm of the QTT-Tucker [NRM]=NORM(QTT_TUCKER) Computes the Frobenius norm of the QTT-Tucker TT-Toolbox 2.2, 2009-2012 This is TT Toolbox, written by Ivan Oseledets et al. Institute of Numerical Mathematics, Moscow, Russia webpage: http://spring.inm.ras.ru/osel For all questions, bugs and suggestions please mail ivan.oseledets@gmail.com ---------------------------
0001 function [nrm] = norm(tt) 0002 %Frobenius norm of the QTT-Tucker 0003 % [NRM]=NORM(QTT_TUCKER) Computes the Frobenius norm of the QTT-Tucker 0004 % 0005 % 0006 % TT-Toolbox 2.2, 2009-2012 0007 % 0008 %This is TT Toolbox, written by Ivan Oseledets et al. 0009 %Institute of Numerical Mathematics, Moscow, Russia 0010 %webpage: http://spring.inm.ras.ru/osel 0011 % 0012 %For all questions, bugs and suggestions please mail 0013 %ivan.oseledets@gmail.com 0014 %--------------------------- 0015 d=tt.dphys; 0016 core=tt.core; 0017 tuck=tt.tuck; 0018 for i=1:d 0019 if (isa(tuck{i}, 'tt_matrix')) 0020 tuck{i} = tt_tensor(tuck{i}); 0021 end; 0022 [tuck{i},rm]=qr(tuck{i},'lr'); 0023 core{i}=ten_conv(core{i},2,rm.'); 0024 end 0025 nrm=norm(core); 0026 0027 return 0028 end