Home > manopt > manifolds > ttfixedrank > TTeMPS_1.1 > @TTeMPS > disp.m

disp

PURPOSE ^

DISP Display TT/MPS tensor.

SYNOPSIS ^

function disp( x, name )

DESCRIPTION ^

DISP Display TT/MPS tensor. 
   disp(X) displays the TT/MPS tensor X as a tensor network.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function disp( x, name )
0002     %DISP Display TT/MPS tensor.
0003     %   disp(X) displays the TT/MPS tensor X as a tensor network.
0004 
0005     %   TTeMPS Toolbox.
0006     %   Michael Steinlechner, 2013-2016
0007     %   Questions and contact: michael.steinlechner@epfl.ch
0008     %   BSD 2-clause license, see LICENSE.txt
0009 
0010 
0011     if (nargin < 2 || ~ischar(name))
0012       name = inputname(1);
0013     end
0014     
0015     
0016     disp([name, ' is a TT/MPS tensor of order ', num2str(x.order), ...
0017                         ' with size (', num2str(x.size), ...
0018                         ') and ranks (', num2str(x.rank), ')']);
0019     disp('');
0020 
0021     row1 = '';
0022     row2 = '';
0023     row3 = '';
0024 
0025     for i=1:x.order
0026         row1 = [row1, sprintf('%3i--(U%2i)--', x.rank(i), i)];
0027         row2 = [row2, '       |    '];
0028         row3 = [row3, sprintf('     %3i    ', x.size(i))];   
0029     end
0030     row1 = [row1, sprintf( '%3i', x.rank(end) )]; 
0031     disp(row1)
0032     disp(row2)
0033     disp(row3)
0034 
0035 end

Generated on Fri 30-Sep-2022 13:18:25 by m2html © 2005