Home > tt2 > @tt_tensor > col.m

col

PURPOSE ^

Computes the columns of a block TT-tensor

SYNOPSIS ^

function [y]=col(x, k, varargin)

DESCRIPTION ^

Computes the columns of a block TT-tensor 
   [Y]=COL(X,K)
   It is useful for block algorithms when r(d+1) is not equal to 1
   For analogous thing on r(1) see ROW(X,K)


 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
---------------------------

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [y]=col(x, k, varargin)
0002 %Computes the columns of a block TT-tensor
0003 %   [Y]=COL(X,K)
0004 %   It is useful for block algorithms when r(d+1) is not equal to 1
0005 %   For analogous thing on r(1) see ROW(X,K)
0006 %
0007 %
0008 % TT-Toolbox 2.2, 2009-2012
0009 %
0010 %This is TT Toolbox, written by Ivan Oseledets et al.
0011 %Institute of Numerical Mathematics, Moscow, Russia
0012 %webpage: http://spring.inm.ras.ru/osel
0013 %
0014 %For all questions, bugs and suggestions please mail
0015 %ivan.oseledets@gmail.com
0016 %---------------------------
0017 
0018 d=x.d;
0019 r=x.r;
0020 
0021 if nargin > 2
0022     for j = 1 : nargin-2
0023         k = [k, varargin{j}];
0024     end
0025 end
0026 
0027 BlockSize = r(d+1);
0028 if max(k) > BlockSize
0029     error('TT-tensor.col:Index exceeds dimensions in TT block.');
0030 end
0031 
0032 CutMatr = eye(BlockSize);
0033 CutMatr = CutMatr(:, k);
0034 y = x*CutMatr;  
0035 
0036 return
0037 end

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