Пример #1
0
        public static WaveletCollection FromWaveletData(IEnumerable <double> waveletData)
        {
            int index = 0;

            double smoothingCoefficient = waveletData.ElementAt(index++);

            List <List <double> > decomposition = new List <List <double> >();

            int levelCount = (int)Scalars.Logarithm(2, waveletData.Count());

            for (int levelIndex = 0; levelIndex < levelCount; levelIndex++)
            {
                List <double> level = new List <double>();

                int itemCount = (int)Scalars.Exponentiate(2, levelIndex);

                for (int itemIndex = 0; itemIndex < itemCount; itemIndex++)
                {
                    level.Add(waveletData.ElementAt(index++));
                }

                decomposition.Add(level);
            }

            return(new WaveletCollection(smoothingCoefficient, decomposition));
        }
Пример #2
0
 public double NextExponential(double minimum, double maximum)
 {
     return(Scalars.Logarithm(NextDouble(Scalars.Exponentiate(minimum), Scalars.Exponentiate(maximum))));
 }
Пример #3
0
 public override IEnumerable <double> Evaluate(IEnumerable <double> values)
 {
     yield return(Scalars.Logarithm(values.ElementAt(0)));
 }