当前位置: 首页>>代码示例>>C#>>正文


C# Vector.SubVector方法代码示例

本文整理汇总了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);
        }
开发者ID:Nefarin,项目名称:DadmProject,代码行数:30,代码来源:Waves_Alg.cs

示例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;
 }
开发者ID:Nefarin,项目名称:DadmProject,代码行数:6,代码来源:R_Peaks_Alg.cs

示例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);
        }
开发者ID:Nefarin,项目名称:DadmProject,代码行数:44,代码来源:Waves_Alg.cs

示例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;
        }
开发者ID:Nefarin,项目名称:DadmProject,代码行数:21,代码来源:R_Peaks_Alg.cs


注:本文中的Vector.SubVector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。