-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHermiteF_nd.m
More file actions
36 lines (31 loc) · 859 Bytes
/
HermiteF_nd.m
File metadata and controls
36 lines (31 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function poly = HermiteF_nd(x, ndim, norder)
%
% HermiteF_nd.m - Compute multi-dimensional Hermite polynomials
% up to a given order at a given coordinate.
%
% Syntax: poly = HermiteF_nd(x, ndim, norder);
%
% Input : x = (1,ndim) array containing a ndim-coordinates
% ndim = dimension of space
% norder = highest order of polynomials returned.
%
% Output: poly = (1, nterm) array. All nterm polynomials evaluated at x.
%
% by Dongbin Xiu 11/09/2005
%
ntmp = length(x);
if ntmp ~= ndim
fprintf('Incompatible dimension in JacobiF_nd! Quit.\n');
end
pmatrix = chaos_sequence(ndim,norder);
ptmp = zeros(norder+1,ndim);
for n=0:norder
ptmp(n+1,:) = HermiteF(x,n);
end
[nterm,ntmp]=size(pmatrix);
poly = ones(1, nterm);
for m=2:nterm
for n=1:ndim
poly(m) = poly(m) * ptmp(pmatrix(m,n)+1,n);
end
end