本文整理汇总了C#中HTuple.TupleSortIndex方法的典型用法代码示例。如果您正苦于以下问题:C# HTuple.TupleSortIndex方法的具体用法?C# HTuple.TupleSortIndex怎么用?C# HTuple.TupleSortIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTuple
的用法示例。
在下文中一共展示了HTuple.TupleSortIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: drawFunction
/// <summary>Plots a function provided as an HTuple</summary>
private void drawFunction(HTuple tuple)
{
HTuple val;
int maxY,maxX;
float stepOffset;
if (tuple.Length == 0)
{
resetPlot();
return;
}
val = tuple.TupleSortIndex();
maxX = tuple.Length - 1;
maxY = (int)tuple[val[val.Length - 1].I].D;
axisXLength = maxX;
switch (axisAdaption)
{
case AXIS_RANGE_ADAPTING:
axisYLength = maxY;
break;
case AXIS_RANGE_INCREASING:
axisYLength = (maxY > axisYLength) ? maxY : axisYLength;
break;
}
backBuffer.Clear(System.Drawing.Color.WhiteSmoke);
backBuffer.FillRectangle(brushFuncPanel, originX, 0, panelWidth, panelHeight);
stepOffset = drawXYLabels();
drawLineCurve(tuple, stepOffset);
backBuffer.Flush();
gPanel.DrawImageUnscaled(functionMap, 0, 0);
gPanel.Flush();
}
示例2: ComputeStatistics
/// <summary>Adjusts statistics of measure projection (line profile).</summary>
public void ComputeStatistics(double[] grayVals)
{
HTuple tuple, val;
int max =0;
if (grayVals != null)
{
tuple = new HTuple(grayVals);
val = tuple.TupleMean();
labelMean.Text = val[0].D.ToString("f2");
val = tuple.TupleDeviation();
labelDeviation.Text = val[0].D.ToString("f2");
val = tuple.TupleSortIndex();
labelPeakX.Text = val[val.Length - 1].I + "";
max = (int)tuple[val[val.Length - 1].I].D;
labelPeak.Text = max + "";
labelRange.Text = (int)tuple[0].D + " ... " + (int)tuple[tuple.Length - 1].D;
labelRangeX.Text = "0 ... " + (tuple.Length - 1);
}
else
{
labelMean.Text = "0";
labelDeviation.Text = "0";
labelPeakX.Text = "0";
labelPeak.Text = "0";
labelRange.Text = "0 ... 0";
labelRangeX.Text = "0 ... 0";
}
}