Builds a Chebyshev-type polynomial [p]=build_poly(n, nodes, c) 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 [p]=build_poly(n, nodes, c) 0002 %Builds a Chebyshev-type polynomial 0003 % [p]=build_poly(n, nodes, c) 0004 % 0005 % 0006 % TT-Toolbox 2.2, 2009-2012 0007 % 0008 %This is TT Toolbox, written by Ivan Oseledets et al. 0009 %Institute of Numerical Mathematics, Moscow, Russia 0010 %webpage: http://spring.inm.ras.ru/osel 0011 % 0012 %For all questions, bugs and suggestions please mail 0013 %ivan.oseledets@gmail.com 0014 %--------------------------- 0015 0016 p = 0*nodes; 0017 for i=n:-1:0 0018 % p = p+c(n+1,i+1)*(nodes.^i); 0019 p = p+c(n+1,i+1)*cos(i*acos(nodes)); 0020 end; 0021 0022 end