function Inv = inverse2x2(A)
  % ========================
  % https://guiard.org/pages/octave/inverseX.html
  % =========================
  %
  % Parallel inverte multiple matrices of size [2 2].
  % size(A) = [2 2 x]
  % Version 1.00
  %

  Inv = 1./(A(1,1,:).*A(2,2,:)-A(2,1,:).*A(1,2,:)) .* [A(2,2,:) -A(1,2,:); -A(2,1,:) A(1,1,:)];

endfunction
