from
2D random paths generator integrating leg's contraints
by Sebastien PARIS
Generates random 2D leg'paths from departure to arrival integrating leg's constraints
|
| circulant.m |
function t = circulant(c)
% Return the circulant matrix according vector c
%
% Usage W = circulant([c]);
% -----
% Input
% -----
% c vector (1 x D )(default [1 1 0 0 0 0 0 1 ])
%
% Output
% ------
%
% W matrice (D x D)
%
% Example
% -------
%
% delta_d = circulant([1 1 0 0 0 0 0 1 ]);
%
%
%
% Author Sbastien PARIS (sebastien.paris@lsis.org)
% -------
if (nargin < 1)
c = [1 1 0 0 0 0 0 1 ];
end
m = length(c);
c = c(:);
Om = ones(m , 1);
ridx = (1:m);
cidx = ridx';
t = cidx(: , Om) - ridx(Om , :);
t = t - floor(t./m).*m + 1;
t(:) = c(t);
|
|
Contact us