annotate core/magnatagatune/tests_evals/rbm_subspace/simple_dist.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function [dis_s12,dis_s13] = simple_dist(index_list,vector_list,index_map)
wolffd@0 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 3 % compute the distance vector from 2 vector %
wolffd@0 4 % sontran2013 %
wolffd@0 5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 6 s_num = size(index_list,1);
wolffd@0 7 s_len = size(vector_list,2);
wolffd@0 8
wolffd@0 9 dis_s12 = zeros(s_num,s_len);
wolffd@0 10 dis_s13 = zeros(s_num,s_len);
wolffd@0 11
wolffd@0 12 % Convert list of assigned indices to ordered indices
wolffd@0 13 [checker index_list] = ismember(index_list,index_map);
wolffd@0 14
wolffd@0 15 if all(all(checker(:,1:3)))
wolffd@0 16 dis_s12 = abs(vector_list(index_list(:,1),:)-vector_list(index_list(:,2),:));
wolffd@0 17 dis_s13 = abs(vector_list(index_list(:,1),:)-vector_list(index_list(:,3),:));
wolffd@0 18 else
wolffd@0 19 fprintf('Some indices are not mapped\n');
wolffd@0 20 end
wolffd@0 21
wolffd@0 22 end
wolffd@0 23 % simple_dist(sontest{1},sonfeatures,sonindex)