Home > tt2 > core > tt_reverse.m

tt_reverse

PURPOSE ^

Returns a reversed TT representation

SYNOPSIS ^

function [tt2]=tt_reverse(tt,phd)

DESCRIPTION ^

 Returns a reversed TT representation
   [TT2]=TT_REVERSE(TT,PHD)
 January 25, 2011
 Vladimir Kazeev
 vladimir.kazeev@gmail.com
 INM RAS
 Moscow, Russia

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [tt2]=tt_reverse(tt,phd)
0002 % Returns a reversed TT representation
0003 %   [TT2]=TT_REVERSE(TT,PHD)
0004 % January 25, 2011
0005 % Vladimir Kazeev
0006 % vladimir.kazeev@gmail.com
0007 % INM RAS
0008 % Moscow, Russia
0009 %
0010 
0011 d=size(tt,1);
0012 tt2=cell(d,1);
0013 
0014 tt2{1}=tt{d};
0015 for k=2:d-1
0016     prm=(1:phd+2);
0017     prm(phd+1)=phd+2;
0018     prm(phd+2)=phd+1;
0019     tt2{k}=permute(tt{d+1-k},prm);
0020 end
0021 tt2{d}=tt{1};
0022 
0023 return
0024 end

Generated on Wed 08-Feb-2012 18:20:24 by m2html © 2005