Tensor rounding for the TT-matrix in TT1.0 format [RES]=TT_MAT_COMPR(MAT,EPS) Compress TT matrix with accuracy EPS. Avoid the usage, use round() function of the object-oriented design. Will be removed in future releases. 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 --------------------------- n=size(mat{1},1); m=size(mat{1},2);
0001 function [res]=tt_mat_compr(mat,eps, max_rank) 0002 %Tensor rounding for the TT-matrix in TT1.0 format 0003 % [RES]=TT_MAT_COMPR(MAT,EPS) Compress TT matrix with accuracy EPS. Avoid 0004 % the usage, use round() function of the object-oriented design. Will be 0005 % removed in future releases. 0006 % 0007 % 0008 % TT-Toolbox 2.2, 2009-2012 0009 % 0010 %This is TT Toolbox, written by Ivan Oseledets et al. 0011 %Institute of Numerical Mathematics, Moscow, Russia 0012 %webpage: http://spring.inm.ras.ru/osel 0013 % 0014 %For all questions, bugs and suggestions please mail 0015 %ivan.oseledets@gmail.com 0016 %--------------------------- 0017 %n=size(mat{1},1); 0018 %m=size(mat{1},2); 0019 0020 if (nargin<3) 0021 max_rank=[]; 0022 end; 0023 0024 d=size(mat,1); 0025 n=zeros(d,1); m=zeros(d,1); 0026 for i=1:d 0027 n(i)=size(mat{i},1); m(i)=size(mat{i},2); 0028 end 0029 res=tt_vec_to_mat(tt_compr2(tt_mat_to_vec(mat),eps,max_rank),n,m); 0030 return 0031 end