Home > vbmeg > functions > estimation > bayes > dynamics > mex-programs > init_index.m

init_index

PURPOSE ^

SYNOPSIS ^

function [Delta_set, Ndelta, indx, deltax, Nindx, nl_indx, NL_indx] =init_index(Delta)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function    [Delta_set, Ndelta, indx, deltax, Nindx, nl_indx, NL_indx] = ...
0002                 init_index(Delta)
0003 
0004 Nvact = size(Delta,1);
0005 
0006 % Set of Integer delay values
0007 Delta = round(Delta); %
0008 ix = find(Delta ~= 0);
0009 
0010 % unidlt -> Delta_set
0011 Delta_set = unique(Delta(ix)); % unique set of Delta
0012 Ndelta = length(Delta_set);
0013 
0014 % Connection matrix index for each vertex
0015 indx = cell(Nvact,1);
0016 deltax = cell(Nvact,1);
0017 Nindx = zeros(Nvact,1);
0018 
0019 % Connection matrix index for each vertex & each delay
0020 nl_indx = cell(Nvact,Ndelta);
0021 NL_indx = cell(Nvact,Ndelta);
0022 
0023 for nv = 1:Nvact
0024     % connected vertex index with nv-th vertex
0025     indx{nv} = find(Delta(nv,:)~=0)';
0026     deltax{nv} = full(Delta(nv, indx{nv} ))' ;% its delay
0027     Nindx(nv) = length(indx{nv});% # of connected vertex with nv-th vertex
0028     
0029     for nl = 1:Ndelta
0030         % connected vertex index with nv-th vertex & nl-th delay
0031         %  indnl = (Deltax{nv}==Delta_set(nl)); -> nl_indx
0032         nl_indx{nv,nl} = find(deltax{nv}==Delta_set(nl)); % for small full mat.
0033         NL_indx{nv,nl} = find(Delta(nv,:)==Delta_set(nl));% for large sparse
0034     end
0035 end
0036 
0037 return
0038 
0039 
0040 err = 0;
0041 
0042 %        indnl = (Deltax{nv}==Delta_set(nl));
0043 %
0044 %        temp1 = indx{nv}(indnl);
0045 %        temp2 = indx{nv}(nl_indx{nv,nl});
0046 %
0047 %        err = err + sum(abs(temp1 - temp2));

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