- add progress to edge, dct and fft plugins
[FaRetSys.git] / IPlugin / ResultSorter.cs
bloba96f88006ec634d23b6a4595d8876d17fb064a63
1 using System;
2 using System.Collections;
4 namespace Eithne
6 class ResultSorter : IComparer
8 private double identity;
9 private double[] res;
11 public ResultSorter(double identity, double[] res)
13 this.identity = identity;
14 this.res = res;
17 public int Compare(object x, object y)
19 double vx = Math.Abs(identity - res[(int)x]);
20 double vy = Math.Abs(identity - res[(int)y]);
22 if(vx < vy)
23 return -1;
24 else if(vx > vy)
25 return 1;
26 else
27 return 0;