summaryrefslogtreecommitdiff
path: root/remove_similar_soln.m
blob: a106affc80489319f3aa65490733e6895c761931 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function [ possible_lens_placement_uniq, possible_lens_placement, possible_sample_energy, possible_lens_set, index ] = remove_similar_soln( possible_sample_energy, possible_lens_placement, possible_lens_set, n_truncate )
%Removes similar solutions based on n_truncate (decimal tolerance to
%determin uniqueness)

%Sorting possible solution according to energy
[possible_sample_energy, index] = sort(possible_sample_energy);
possible_lens_placement = possible_lens_placement(index,:);
possible_lens_set = possible_lens_set(index,:);

%Truncate other possible solutions to an accuracy of n decimal places
possible_lens_placement_trunc = round(possible_lens_placement*10^n_truncate)./10^n_truncate;
[possible_lens_placement_uniq, index] = unique(possible_lens_placement_trunc,'rows','stable'); %Unique solutions only


end