Computes ranks of the QTT-Tucker tensor [R]=RANK(A) computes all ranks of the QTT-Tucker A [R]=RANK(A,IND) computes the rank with index IND of the QTT-Tucker tensor A 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 [r]=rank(a,varargin) 0002 %Computes ranks of the QTT-Tucker tensor 0003 % [R]=RANK(A) computes all ranks of the QTT-Tucker A 0004 % 0005 % [R]=RANK(A,IND) computes the rank with index IND of the QTT-Tucker 0006 % tensor A 0007 % 0008 % 0009 % TT-Toolbox 2.2, 2009-2012 0010 % 0011 %This is TT Toolbox, written by Ivan Oseledets et al. 0012 %Institute of Numerical Mathematics, Moscow, Russia 0013 %webpage: http://spring.inm.ras.ru/osel 0014 % 0015 %For all questions, bugs and suggestions please mail 0016 %ivan.oseledets@gmail.com 0017 %--------------------------- 0018 0019 r = 0; 0020 for i=1:a.dphys 0021 r(1:a.tuck{i}.d+1, i) = a.tuck{i}.r; 0022 if (i<a.dphys) 0023 r(a.tuck{i}.d+2, i) = a.core.r(i+1); 0024 end 0025 end 0026 return 0027 end