   function C = strass(A,B,nmin)
%
% Strassen matrix multiplication C=AB
%       A, B must be square and of dimension n >= 1
% From Coleman and Van Loan
% If n <= nmin or if n is odd, the multiplication is done conventionally
%
   [n n] = size(A);
   if n <= nmin | n/2 ~= floor(n/2)
      C = A * B;  % n is small, get C conventionally
   else
      m = n/2; u = 1:m; v= m+1:n;
      P1 = strass(A(u,u)+A(v,v), B(u,u)+B(v,v), nmin);
      P2 = strass(A(v,u)+A(v,v), B(u,u),        nmin);
      P3 = strass(A(u,u),        B(u,v)-B(v,v), nmin);
      P4 = strass(A(v,v),        B(v,u)-B(u,u), nmin);
      P5 = strass(A(u,u)+A(u,v), B(v,v),        nmin);
      P6 = strass(A(v,u)-A(u,u), B(u,u)+B(u,v), nmin);
      P7 = strass(A(u,v)-A(v,v), B(v,u)+B(v,v), nmin);
      C = [P1+P4-P5+P7 P3+P5; P2+P4 P1+P3-P2+P6];
   end
