本文整理汇总了C#中Vector.SubVector方法的典型用法代码示例。如果您正苦于以下问题:C# Vector.SubVector方法的具体用法?C# Vector.SubVector怎么用?C# Vector.SubVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector
的用法示例。
在下文中一共展示了Vector.SubVector方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindQRSOnset
public int FindQRSOnset( double drightEnd, double dmiddleR, Vector<double> dwt, int decompLevel)
{
int rightEnd = (int)drightEnd;
int middleR = (int)dmiddleR;
int sectionStart = (rightEnd >> decompLevel);
int len = (middleR >> decompLevel) - (rightEnd >> decompLevel);
if (len < 1)
len = 1;
//Console.WriteLine("nadupcamy!");
//Console.WriteLine(sectionStart);
//Console.WriteLine((middleR >> decompLevel) - (rightEnd >> decompLevel) + 1);
//Console.WriteLine(dwt.Count);
if (sectionStart + len >= dwt.Count)
return -1;
int qrsOnsetInd = dwt.SubVector(sectionStart, len).MinimumIndex() + sectionStart;
double treshold = Math.Abs(dwt[qrsOnsetInd])*0.05;
while (Math.Abs(dwt[qrsOnsetInd]) > treshold && qrsOnsetInd > sectionStart)
qrsOnsetInd--;
if (qrsOnsetInd == sectionStart)
return -1;
else
return (qrsOnsetInd << decompLevel);
}
示例2: Diff
public Vector<double> Diff(Vector<double> signal)
{
Vector<double> diffSignal = Vector<double>.Build.Dense(signal.Count - 1);
signal.SubVector(1, signal.Count - 1).Subtract(signal.SubVector(0, signal.Count - 1), diffSignal);
return diffSignal;
}
示例3: FindQRSEnd
public int FindQRSEnd( double dmiddleR, double dleftEnd, Vector<double> dwt, int decompLevel)
{
int middleR = (int)dmiddleR;
int leftEnd = (int)dleftEnd;
int sectionEnd = (leftEnd >> decompLevel) + 1;
int qrsEndInd = (middleR >> decompLevel);
int len = (leftEnd >> decompLevel) - qrsEndInd;
if ( len < 1)
len = 1;
//Console.WriteLine("qrsEndzik");
//Console.WriteLine(len);
//Console.WriteLine(qrsEndInd);
//Console.WriteLine(dwt.Count);
if (qrsEndInd + len >= dwt.Count)
{
return -1;
//Console.WriteLine("Brak enda");
}
double treshold = Math.Abs(dwt.SubVector(qrsEndInd, len).Minimum()) * 0.08;
//Console.WriteLine("szczegoliki:");
//Console.WriteLine(qrsEndInd);
//Console.WriteLine(dwt.Count);
if (!(qrsEndInd + 1 < dwt.Count))
{
return -1;
//Console.WriteLine("brak enda");
}
//while (dwt[qrsEndInd] < dwt[qrsEndInd + 1])
// qrsEndInd++;
while (dwt[qrsEndInd] > dwt[qrsEndInd + 1])
qrsEndInd++;
while (Math.Abs(dwt[qrsEndInd]) > treshold && qrsEndInd < sectionEnd)
qrsEndInd++;
if (qrsEndInd >= sectionEnd)
return -1;
else
return (qrsEndInd << decompLevel);
}
示例4: FindIndexes
public Vector<double> FindIndexes(Vector<double> signal, Func<double, bool> predicate)
{
Vector<double> indexes = Vector<double>.Build.Dense(signal.Count);
int i = 0;
int lastInd = 0;
while (lastInd < signal.Count)
{
Vector<double> partSig = signal.SubVector(lastInd, signal.Count - lastInd);
Tuple<int, double> findItem = partSig.Find(predicate);
if (findItem != null)
{
lastInd = findItem.Item1 + lastInd;
indexes[i] = Convert.ToDouble(lastInd);
i++;
}
else { break; }
lastInd++;
}
return i != 0 ? indexes.SubVector(0, i) : null;
}