Approximate TT-matrix with another one with specified accuracy [TT]=ROUND(TT,EPS) Approximate TT-matrix with relative accuracy EPS [TT]=ROUND(TT,EPS,RMAX) Approximate TT-matrix with relative accuracy EPS and maximal rank RMAX. RMAX can be array of ranks or a number 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 [tt]=round(tt,eps,rmax) 0002 %Approximate TT-matrix with another one with specified accuracy 0003 % [TT]=ROUND(TT,EPS) Approximate TT-matrix with relative accuracy EPS 0004 % 0005 % [TT]=ROUND(TT,EPS,RMAX) Approximate TT-matrix with relative accuracy 0006 % EPS and maximal rank RMAX. RMAX can be array of ranks or a number 0007 % 0008 % 0009 % 0010 % TT-Toolbox 2.2, 2009-2012 0011 % 0012 %This is TT Toolbox, written by Ivan Oseledets et al. 0013 %Institute of Numerical Mathematics, Moscow, Russia 0014 %webpage: http://spring.inm.ras.ru/osel 0015 % 0016 %For all questions, bugs and suggestions please mail 0017 %ivan.oseledets@gmail.com 0018 %--------------------------- 0019 0020 %[TT]=ROUND(TT,EPS) 0021 %[TT]=ROUND(TT,EPS,RMAX) 0022 %Approximate TT-matrix with relative accuracy EPS 0023 if (nargin == 3 ) 0024 tt.tt=round(tt.tt,eps,rmax); 0025 else 0026 tt.tt=round(tt.tt,eps); 0027 end 0028 return 0029 end