18 using System.Collections.Generic;
21 using TraceLabSDK.Types;
23 namespace TraceLab.Components.DevelopmentKit.Postprocessors.CSTI
35 public static double Compute(TLSimilarityMatrix matrix)
37 List<double> DeltaLookup =
new List<double>();
38 foreach (
string source
in matrix.SourceArtifactsIds)
40 DeltaLookup.Add(ComputeForSourceArtifact(matrix, source));
43 if (DeltaLookup.Count % 2 == 0)
45 return (DeltaLookup[DeltaLookup.Count / 2] + DeltaLookup[(DeltaLookup.Count / 2) + 1]) / 2.0;
49 return DeltaLookup[Convert.ToInt32(Math.Ceiling(DeltaLookup.Count / 2.0))];
61 matrix.Threshold =
double.MinValue;
62 double min = Double.MaxValue;
63 double max = Double.MinValue;
64 foreach (TLSingleLink link
in matrix.GetLinksAboveThresholdForSourceArtifact(source))
75 double delta = (max - min) / 2.0;
79 delta = Math.Pow(delta, 4) / 4;