% Vyhleda mozne systemy tvorici mikrostrukturu X
addpath('./skripty', './funkce');
clear all;

orientace2
twins

tol=6;
                                                        
disp '-----------------------------------'
disp '-----------------------------------'
disp '-----------------------------------'
for A=1:6 % 1. varianta
 for B=1:6; % 2. varianta
  if A ~= B
   for i=1:2 % Typ dvojcat A-B
    if ~isempty(lambda{A,B,i,1})
     for j=1:2 % lambda a 1-lambda
      for k=1:2 % 2 reseni rovnice kompatibility
       for C=1:6 % 1. varianta
        if C ~= D 
         for p=1:2 % Typ dvojcat C-D
          if ~isempty(lambda{C,D,p,1})
           for q=1:2 % lambda a 1-lambda
            for r=1:2 % 2 reseni rovnice kompatibility
             D=B; % 2. varianta
             UB=U{B};
             UC=U{C};
             UD=U{D};
             RCD=R{C,D,p};
             QAB=Q{A,B,i,j,k};
             QCD=Q{C,D,p,q,r};
             FCD=F{C,D,p,q,r};                                                        
             nAB=normc(inv(QAB*UB)'*n{A,B,i});
             mAB=m{A,B,i,j,k};
             nCD=normc(inv(QCD*UD)'*n{C,D,p});
             mCD=m{C,D,p,q,r};
             if (abs(chyba(AC, mCD, mAB, 44)) < tol) && ...
                (abs(chyba(AC, mAB, nAB, 47)) < tol) && ...
                (abs(chyba(AC, mCD, nCD, 46)) < tol) && ...
                (abs(chyba(BD, mAB, nAB, 1.3)) < tol) && ...
                (abs(chyba(BD, mCD, nCD, 0)) < tol)
              disp 'A-B'; disp([A B i j k])
              disp 'C-D'; disp([C D p q r])
              disp(rnorm(QCD*RCD*UC-QAB*UB))
              disp '-----------'
             end
end; end; end; end; end; end; end; end; end; end; end; end; end;

clear all;