1function MAP=map_normalize(MAP)
2% MAPOUT=map_normalize(MAPIN) - Try to make a MAP feasible
5% MAPIN: a MAP in the form of {D0,D1}
8% MAPOUT: MAPIN with D0 normalized to make D0+D1 an infinitesimal
9% generator, with all negative entries set to zero, and with complex
10% values set equal to their norm
13% - map_normalize({[0,0;0,0],[1,2;3,4]}) produces a valid MAP
17 for j=1:size(MAP{1},1)
18 MAP{1}(i,j)=real(MAP{1}(i,j));
19 MAP{2}(i,j)=real(MAP{2}(i,j));
28 MAP{1}(n,n)=MAP{1}(n,n)-sum(MAP{b}(n,:));