ROUND Approximate TTeMPS tensor within a prescribed tolerance. X = ROUND( X, tol ) truncates the given TTeMPS tensor X to a lower rank such that the error is in order of tol.
0001 function x = round( x, tol ) 0002 %ROUND Approximate TTeMPS tensor within a prescribed tolerance. 0003 % X = ROUND( X, tol ) truncates the given TTeMPS tensor X to a 0004 % lower rank such that the error is in order of tol. 0005 0006 % TTeMPS Toolbox. 0007 % Michael Steinlechner, 2013-2016 0008 % Questions and contact: michael.steinlechner@epfl.ch 0009 % BSD 2-clause license, see LICENSE.txt 0010 0011 y = TTeMPS_block_to_TTeMPS( x ); 0012 y = round(y , tol); 0013 x = TTeMPS_block.TTeMPS_to_TTeMPS_block( y, x.mu, x.p ); 0014 0015 end