update_inverse

PURPOSE ^

function iAtB_mod = update_inverse(AtB, Atb, atB, atb);

SYNOPSIS ^

function iAtB = update_inverse(AtB, iAtB_old,flag);

DESCRIPTION ^

 function iAtB_mod = update_inverse(AtB, Atb, atB, atb);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % function iAtB_mod = update_inverse(AtB, Atb, atB, atb);
0002 
0003 % This function uses matrix inversion lemma to update the inverse of
0004 % square matrix after addition or removal of a row-column pair.
0005 %
0006 % Written by: Salman Asif, Georgia Tech
0007 % Email: sasif@ece.gatech.edu
0008 
0009 function iAtB = update_inverse(AtB, iAtB_old,flag);
0010 
0011 n = size(AtB,1);
0012 
0013 %A11 = AtB(1:n-1,1:n-1);
0014 A12 = AtB(1:n-1,n);
0015 A21 = AtB(n,1:n-1);
0016 A22 = AtB(n,n);
0017 
0018 % add columns
0019 if flag == 1
0020     iA11 = iAtB_old;
0021     iA11A12 = iA11*A12;
0022     A21iA11 = A21*iA11;
0023     S = A22-A21*iA11A12;
0024     Q11_right = iA11A12*(A21iA11/S); 
0025 %     Q11 = iA11+ Q11_right;
0026 %     Q12 = -iA11A12/S;
0027 %     Q21 = -A21iA11/S;
0028 %     Q22 = 1/S;
0029 
0030     iAtB = zeros(n);
0031     %iAtB = [Q11 Q12; Q21 Q22];
0032     iAtB(1:n-1,1:n-1) = iA11+ Q11_right;
0033     iAtB(1:n-1,n) = -iA11A12/S; 
0034     iAtB(n,1:n-1) =  -A21iA11/S;
0035     iAtB(n,n) = 1/S;
0036 %delete columns
0037 else if flag == 2
0038         Q11 = iAtB_old(1:n-1,1:n-1);
0039         Q12 = iAtB_old(1:n-1,n);
0040         Q21 = iAtB_old(n,1:n-1);
0041         Q22 = iAtB_old(n,n);
0042         Q12Q21_Q22 = Q12*(Q21/Q22);
0043         iAtB = Q11 - Q12Q21_Q22;
0044         %iAtB = iA11;
0045     end
0046 end

Generated on Mon 10-Jun-2013 23:03:23 by m2html © 2005