This function works fine.
I call it many times as dijkstra(A,C,1) into an optimization function.
Nevertheless, the Matlab profiler halt me with warnings about the use of sparse functions, and indexing sparse matrices.
I think you could speed up Dirk Stelder's solution by replacing the first for loop (between "candidate=[];' and "[u_index u]=min(candidate);") by the statement
[u_index u] = min(1 ./ (S==0) .* dist);
(Note that u_index is in fact the value; u is the index.) Entries in 1 ./ (S==0) have value Inf when their value in S is 1, i.e. when they have been visited, and 1 otherwise. Multiplying by dist leaves all visited nodes with distance Inf: precisely what 'candidate' looks like.
Comment only
04 Jun 2014
Face Detection System
Face Detection using Gabor feature extraction and neural network
Hi,
Please i want your help because i realy need this program. after all of the step when i click on "Train Network" i have this error :
********
Out of memory. Type HELP MEMORY for your options.
Error in nnMex2.codeHints (line 117)
hints.TEMP = zeros(1,ceil(tempSize/8),'double');
Error in nncalc.setup2 (line 13)
calcHints = calcMode.codeHints(calcHints);
Error in network/train (line 306)
[calcLib,calcNet] =
nncalc.setup2(calcMode,calcNet,calcData,calcHints);
Error in train_net (line 35)
net = train(net,P{1,1},T{1,1});
Error in run (line 64)
evalin('caller', [script ';']);
Error in main (line 40)
run ('include/train_net.m');
********
thanks for any suggestions
4
11 May 2014
Face Detection System
Face Detection using Gabor feature extraction and neural network
Comment only