Home > vbmeg > functions > brain > vb_asign_neighbor_vertex.m

vb_asign_neighbor_vertex

PURPOSE ^

asign external vertex by base vertex according to distance

SYNOPSIS ^

function [ext_index,ext_table] =vb_asign_neighbor_vertex(base_index,nextIX,nextDD)

DESCRIPTION ^

  asign external vertex by base vertex according to distance
  [ext_index,ext_table] = vb_asign_neighbor_vertex(base_index,nextIX,nextDD);

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ext_index,ext_table] = ...
0002                vb_asign_neighbor_vertex(base_index,nextIX,nextDD)
0003 %  asign external vertex by base vertex according to distance
0004 %  [ext_index,ext_table] = vb_asign_neighbor_vertex(base_index,nextIX,nextDD);
0005 %
0006 % Copyright (C) 2011, ATR All Rights Reserved.
0007 % License : New BSD License(see VBMEG_LICENSE.txt)
0008 
0009 Nbase = length(base_index);
0010 Nall  = size(nextDD,1);
0011 
0012 base_flag = zeros(Nall,1);
0013 base_flag(base_index) = 1;
0014 
0015 ext_index = vb_setdiff2([1:Nall], base_index);
0016 Next = length(ext_index);
0017 ext_table = cell(Next,1);
0018 
0019 for i=1:Next
0020     ix     = ext_index(i);
0021     
0022     % neighbor index of ext_index(i)
0023     inext  = nextIX{ix};
0024     % neighbor distance of ext_index(i)
0025     nextdd = nextDD{ix};
0026     
0027     % base_index in inext
0028     jnext  = find(base_flag(inext) > 0 );
0029     % distance to base_index vertex
0030     jdd = nextdd(jnext);
0031     [dmin,jj] = min(jdd);
0032     
0033     % base_index nearest to ext_index(i)
0034     jmin = jnext(jj);
0035     ext_table{i} = inext(jmin);
0036 end

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005