The simplest multigrid operator in QTT as a TT-matrix [M]=QTT_MG_INTERP(D) Computes the simplest MG-operator in the QTT-format on 2^D grid. Its stencil is 1, 0 0.5, 0.5 0, 1 0, 0.5 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 ---------------------------
0001 function [m]=qtt_mg_interp(d) 0002 %The simplest multigrid operator in QTT as a TT-matrix 0003 % [M]=QTT_MG_INTERP(D) Computes the simplest MG-operator in the 0004 % QTT-format on 2^D grid. Its stencil is 0005 % 1, 0 0006 % 0.5, 0.5 0007 % 0, 1 0008 % 0, 0.5 0009 % 0010 % 0011 % TT-Toolbox 2.2, 2009-2012 0012 % 0013 %This is TT Toolbox, written by Ivan Oseledets et al. 0014 %Institute of Numerical Mathematics, Moscow, Russia 0015 %webpage: http://spring.inm.ras.ru/osel 0016 % 0017 %For all questions, bugs and suggestions please mail 0018 %ivan.oseledets@gmail.com 0019 %--------------------------- 0020 0021 0022 prol0 = [1 0; 0.5 0.5; 0 1; 0 0.5]; 0023 h0 = [0 0; 0 0; 0 0; 0.5 0]; 0024 I = eye(2); 0025 I12 = [0 1; 0 0]; 0026 I21 = [0 0; 1 0]; 0027 0028 m = cell(d,1); 0029 0030 m{1}=zeros(4,2,2); 0031 m{1}(:,:,1)=prol0; m{1}(:,:,2)=h0; 0032 for i=2:d-1 0033 m{i}=zeros(2,2,2,2); 0034 m{i}(:,:,1,1)=I; 0035 m{i}(:,:,2,1)=I12; m{i}(:,:,2,2)=I21; 0036 end; 0037 m{d} = zeros(2,2,2); 0038 m{d}(:,:,1)=I; m{d}(:,:,2)=I12; 0039 0040 m = tt_matrix(m); 0041 0042 end