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

orientace1
twins

tol=5;

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
        for D=C:6; % 2. 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
              UB=U{B};
              UD=U{D};
              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, 35.7)) < tol) && ...
                 (abs(chyba(AC, mAB, nCD, 11)) < tol) && ...
                 (abs(chyba(AC, mAB, nAB, 32)) < tol) && ...
                 (abs(chyba(AC, mCD, nCD, 46.3)) < tol) && ...
                 (abs(chyba(BD, mAB, nAB, 16.2)) < tol) && ...
                 (abs(chyba(BD, mCD, nCD, 71)) < tol)
               disp 'A-B'; disp([A B i j k])
               disp 'C-D'; disp([C D p q r])
               disp(rnorm(FCD-QAB*UB))
               disp '-----------'
              end
end; end; end; end; end; end; end; end; end; end; end; end; end; end;

clear all;