function Q = fipert_qr(A,B,C);
%FIPERT_QR  private function

%   Copyright 1986-2000 The MathWorks, Inc.
%   $Revision: 1.5 $  $Date: 2000/06/15 11:40:13 $

[n,m]  = size(B);
In = eye(n);

X = [ kron(A.',In) - kron(In,A) ; kron(B.',In) ;- kron(In,C)];
[m,z] = size(X);

[QQ,R] = qr(X);
Q = QQ(:,n*n+1:m);

