/Sequences

Primary LanguageC#MIT LicenseMIT

Sequence class, that given min, max and step can calculate, without enumerating, such basic descriptives as sum, length, Variance, Standard Deviation etc. Also, extension methods to generate sequences in GetSequence class.

Example usages:

            var tested = new Sequence(0, 10, 1);
            var sum = tested.Sum; // 55
            var variance = tested.Variance; // 10

Getting the actual range is also possible, by calling GetFullSequence() like this:

            var tested = new Sequence(0, 10, 1);
            var sequence = tested.GetFullSequence(); // this is lazily evaluated, so call ToList() to eager load.