You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GetNodeInxPermutation.m 347B

123456789101112131415161718
  1. function [newInx, nodePerm] = GetNodeInxPermutation(inx, nodePerm)
  2. newInx = -1;
  3. numNodes = size(nodePerm,1);
  4. for n =1:numNodes
  5. if nodePerm(n,2) == inx
  6. newInx = nodePerm(n,1);
  7. break;
  8. end
  9. end
  10. if newInx == -1
  11. newInx = numNodes +1;
  12. nodePerm(newInx,1) = newInx;
  13. nodePerm(newInx,2) = inx;
  14. end