Mode sizes of the TT-tensor [SZ]=SIZE(TT) returns all mode sizes of TT [SZ]=SIZE(TT,DIM) returns the mode size with number DIM 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 [sz] = size(tt,dim) 0002 % Mode sizes of the TT-tensor 0003 % [SZ]=SIZE(TT) returns all mode sizes of TT 0004 % 0005 % [SZ]=SIZE(TT,DIM) returns the mode size with number DIM 0006 % 0007 % TT-Toolbox 2.2, 2009-2012 0008 % 0009 %This is TT Toolbox, written by Ivan Oseledets et al. 0010 %Institute of Numerical Mathematics, Moscow, Russia 0011 %webpage: http://spring.inm.ras.ru/osel 0012 % 0013 %For all questions, bugs and suggestions please mail 0014 %ivan.oseledets@gmail.com 0015 %--------------------------- 0016 0017 if exist('dim','var') 0018 sz = tt.n(dim); 0019 else 0020 sz=tt.n; 0021 0022 end