reassignFwBwMatch

PURPOSE ^

reassingFwBwMatch Reassing forward-backward matches when modifying an

SYNOPSIS ^

function matchNew = reassignFwBwMatch(match,selVec)

DESCRIPTION ^

reassingFwBwMatch Reassing forward-backward matches when modifying an
irreversible model

 matchNew = reassignFwBwMatch(match,selVec)

INPUTS
 match     Forward-backwards mapping vector
 selVec    Selection vector marking reactions to remap

OUTPUT
 matchNew  Modified forward-backwards mapping vector

 Markus Herrgard 11/3/05

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function matchNew = reassignFwBwMatch(match,selVec)
0002 %reassingFwBwMatch Reassing forward-backward matches when modifying an
0003 %irreversible model
0004 %
0005 % matchNew = reassignFwBwMatch(match,selVec)
0006 %
0007 %INPUTS
0008 % match     Forward-backwards mapping vector
0009 % selVec    Selection vector marking reactions to remap
0010 %
0011 %OUTPUT
0012 % matchNew  Modified forward-backwards mapping vector
0013 %
0014 % Markus Herrgard 11/3/05
0015 
0016 % Create an index map from the old indices to new ones
0017 % If selVec = [1 0 0 1 1]
0018 % indexMap = [1 0 0 2 3];
0019 indexMap = selVec*1.0;
0020 indexMap(selVec==1) = [1:sum(selVec)];
0021 
0022 matchNew = [];
0023 for i = 1:length(match)
0024   if (selVec(i)==1)
0025         if (match(i) > 0)
0026             if (selVec(match(i)) == 1)
0027                 matchNew(end+1) = indexMap(match(i));         
0028             else
0029                 matchNew(end+1) = 0;
0030             end
0031         else
0032             matchNew(end+1) = 0;
0033         end
0034     end
0035 end    
0036 matchNew = matchNew';

Generated on Thu 21-Jun-2012 15:39:23 by m2html © 2003