Home > FR3DSource > xMutualDiscrepancy.m

xMutualDiscrepancy

PURPOSE ^

xMutualDiscrepancy computes the mutual distances between candidates

SYNOPSIS ^

function [Search] = xMutualDiscrepancy(File,Search,Limit)

DESCRIPTION ^

 xMutualDiscrepancy computes the mutual distances between candidates

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % xMutualDiscrepancy computes the mutual distances between candidates
0002 
0003 function [Search] = xMutualDiscrepancy(File,Search,Limit)
0004 
0005 Query      = Search.Query;
0006 Candidates = Search.Candidates;
0007 
0008 N     = Query.NumNT;
0009 [s,t] = size(Candidates);
0010 
0011 if nargin > 2,
0012   s = min(s,Limit);
0013 end
0014 
0015 if ~isfield(Query,'LocWeight'),              % should not be necessary
0016   Query.LocWeight = ones(1,N);
0017 end  
0018 
0019 if ~isfield(Query,'AngleWeight'),            % should not be necessary
0020   Query.AngleWeight = ones(1,N);
0021 end 
0022 
0023 % ----------------------------------- Compute mutual discrepancies btw cand's
0024 
0025 if min(Search.DiscComputed(1,1:s)) == 0,             % some not computed
0026   for k=1:s,
0027     if Search.DiscComputed(k) == 0,                % k has never been done
0028       f1             = Candidates(k,N+1);
0029       c1.NumNT       = Query.NumNT;                  % set up c1 as "Model"
0030       c1.NT          = File(f1).NT(Candidates(k,1:N));
0031       c1.LocWeight   = Query.LocWeight;
0032       c1.AngleWeight = Query.AngleWeight;
0033       c1.LDiscCutoff = Inf;
0034       c1             = xPrecomputeForDiscrepancy(c1);
0035 
0036       for j=1:k-1,
0037         f2 = Candidates(j,N+1);
0038         c2 = File(f2).NT(Candidates(j,1:N));     
0039         Search.Disc(j,k) = sqrt(xDiscrepancyFast(c1,c2))/Query.NumNT;
0040         Search.Disc(k,j) = Search.Disc(j,k);
0041       end
0042       Search.DiscComputed(k) = 1;
0043     end
0044   end
0045 end
0046

Generated on Fri 03-Apr-2009 09:52:35 by m2html © 2003