本文整理汇总了C#中SortedSet.Overlaps方法的典型用法代码示例。如果您正苦于以下问题:C# SortedSet.Overlaps方法的具体用法?C# SortedSet.Overlaps怎么用?C# SortedSet.Overlaps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SortedSet
的用法示例。
在下文中一共展示了SortedSet.Overlaps方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupFeatureParams
//.........这里部分代码省略.........
double[] colorToCNSaliency = new double[swatches.lab.Count()];
double avgE = 0;
for (int i = 0; i < swatches.lab.Count(); i++)
{
CIELAB s = swatches.lab[i];
double sal = colorNames.Saliency(s);
minE = Math.Min(minE, sal);
maxE = Math.Max(maxE, sal);
avgE += sal;
colorToCNSaliency[i] = sal;
}
avgE /= swatches.lab.Count();
avgE = (avgE - minE) / (maxE - minE);
//find the avg and max color name distance between swatches
double maxN = Double.NegativeInfinity;
double avgN = 0;
for (int i = 0; i < scount; i++)
{
for (int j = i + 1; j < scount; j++)
{
double val = 1 - colorNames.CosineDistance(swatches.lab[i], swatches.lab[j]);
avgN += val;
maxN = Math.Max(maxN, val);
}
}
avgN /= ((scount - 1) * scount / 2);
//cache the distance between image colors and swatches
Dictionary<Tuple<int, int>, double> imageSwatchDist = new Dictionary<Tuple<int, int>, double>();
int[,] binAssignments = new int[image.Width, image.Height];
int[] swatchIdxToBin = new int[swatches.colors.Count()];
if (included.Overlaps(options.NameCovFeatures))
{
for (int i = 0; i < image.Width; i++)
{
for (int j = 0; j < image.Height; j++)
{
CIELAB c = imageLAB[i, j];
for (int s = 0; s < swatches.lab.Count(); s++)
{
int a = colorNames.GetBin(imageLAB[i, j]);
int b = colorNames.GetBin(swatches.lab[s]);
binAssignments[i, j] = a;
swatchIdxToBin[s] = b;
GetCNDist(a, b);
}
}
}
}
//segment to total saliency
Segmentation seg = LoadSegAssignments(key, image.Width, image.Height, imageLAB);
double[] segmentToSaliency = new double[seg.numSegments];
double[] segmentToSD = new double[seg.numSegments];
for (int i = 0; i < image.Width; i++)
{
for (int j = 0; j < image.Height; j++)
{
int id = seg.assignments[i, j];
segmentToSaliency[id] += mapData[i, j];
示例2: LoadRepository
void LoadRepository(ChunkRepository cr)
{
Log.WriteLine ("Database.LoadRepository()");
SortedSet<byte[]> pendingData = new SortedSet<byte[]> (ByteSequenceComparer.Shared);
var e = cr.Ldata.EnumerateKeys ();
while (e.MoveNext ())
pendingData.Add (e.Current);
while (pendingData.Count != 0)
foreach (var nchunk in new SortedSet<byte[]>(pendingData, ByteSequenceComparer.Shared)) {
//Log.WriteLine ("Testing object");
byte[][] deps = cr.LdataDependencies.Get (nchunk);
if (deps == null)
throw new InvalidDataException ();
Log.WriteLine ("dependency count = {0}", deps.Length);
if (pendingData.Overlaps (deps)) {
Log.WriteLine ("Found an unloaded dependency, skipping...");
continue;
}
Log.WriteLine ("All the dependencies are loaded, proceeding...");
LoadChunk (nchunk, cr);
pendingData.Remove (nchunk);
}
}