MINUS Multiplication of TT/MPS tensor by scalar. X = MTIMES(A, X) multiplies the TT/MPS tensor X by the scalar A. See also PLUS, MINUS.
0001 function x = mtimes( a, x ) 0002 %MINUS Multiplication of TT/MPS tensor by scalar. 0003 % X = MTIMES(A, X) multiplies the TT/MPS tensor X by the scalar A. 0004 % 0005 % See also PLUS, MINUS. 0006 0007 % TTeMPS Toolbox. 0008 % Michael Steinlechner, 2013-2016 0009 % Questions and contact: michael.steinlechner@epfl.ch 0010 % BSD 2-clause license, see LICENSE.txt 0011 0012 %x.U{1} = a*x.U{1}; 0013 0014 c = a^(1/x.order); 0015 for i = 1:x.order 0016 x.U{i} = c*x.U{i}; 0017 end 0018 end