1 | function [H_new zero range eigvec mi]=update_hyperstate(H_old,zero, range, eigvec, mi,n_grid,H_full)
|
---|
2 | dim=2;
|
---|
3 |
|
---|
4 | next_u=zeros(1,size(H_old,2));
|
---|
5 |
|
---|
6 | step=[1; n_grid];
|
---|
7 | stav1=zeros(dim,1);
|
---|
8 |
|
---|
9 | H_new=generate_trajectories(H_old,mi);
|
---|
10 |
|
---|
11 | for i=2:size(H_new,1)
|
---|
12 | pom(:,:)=H_new(i,:,:);
|
---|
13 |
|
---|
14 | % plot(H_new(i,:,1),H_new(i,:,2),'g.'); hold on
|
---|
15 |
|
---|
16 | [H_new(i,:,:) next_zero next_range next_eigvec]=make_box3(pom); %rovnomerne rozmisti body v zasazenem regionu
|
---|
17 |
|
---|
18 | if (H_full) %kopirovani stareho mi* do H_new
|
---|
19 | for j=1:size(H_new,2)
|
---|
20 | stav(1,1)=H_new(i,j,1)-zero(i,1);
|
---|
21 | stav(1,2)=H_new(i,j,2)-zero(i,2);
|
---|
22 | % for p=1:dim
|
---|
23 | % stav1(p)=(stav(1)*eigvec(i,1,p)+stav(2)*eigvec(i,2,p))*range(i,p)*n_grid-1+1;
|
---|
24 | % end
|
---|
25 | stav1=stav.*range(i,:)*(n_grid-1)+1;
|
---|
26 | index=min(max(round(stav1),1),n_grid)-[0 1];
|
---|
27 | index=index*step;
|
---|
28 |
|
---|
29 | next_u(j)=mi(i,index);
|
---|
30 | end
|
---|
31 |
|
---|
32 | for j=1:size(H_new,2)
|
---|
33 | mi(i,j)= next_u(j);
|
---|
34 | end
|
---|
35 | end
|
---|
36 |
|
---|
37 | zero(i,:)=next_zero;
|
---|
38 | range(i,:)=next_range;
|
---|
39 | eigvec(i,:,:)=next_eigvec;
|
---|
40 | end
|
---|
41 | end |
---|