A=B+C [A]=PLUS(B,C) A is the sum of TT-matrices B and C 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 [a]=plus(b,c) 0002 %A=B+C 0003 % [A]=PLUS(B,C) A is the sum of TT-matrices B and C 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 if ( isempty(b) ) 0016 a=c; 0017 return 0018 elseif (isempty(c) ) 0019 a=b; 0020 return 0021 end 0022 a=tt_matrix; 0023 a.n=b.n; 0024 a.m=b.m; 0025 a.tt=b.tt+c.tt; 0026 return 0027 end