https://github.com/colgreen/redzen
General purpose C# code library.
https://github.com/colgreen/redzen
gaussian io numerics prng random timsort wyrand xoshiro ziggurat
Last synced: 16 days ago
JSON representation
General purpose C# code library.
- Host: GitHub
- URL: https://github.com/colgreen/redzen
- Owner: colgreen
- License: other
- Created: 2015-11-07T20:56:47.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2025-02-01T23:24:09.000Z (8 months ago)
- Last Synced: 2025-08-22T19:04:22.976Z (about 1 month ago)
- Topics: gaussian, io, numerics, prng, random, timsort, wyrand, xoshiro, ziggurat
- Language: C#
- Homepage:
- Size: 1.32 MB
- Stars: 99
- Watchers: 5
- Forks: 17
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
# Redzen
A general purpose C# code library.Available in nuget form at [nuget.org/packages/Redzen/](https://www.nuget.org/packages/Redzen/)
Much of the code in Redzen began life in [SharpNEAT](../../../../colgreen/sharpneat) and other projects, and has found a new home in the Redzen library to allow for reuse of
general purpose code.This project endeavours to provide code that is high quality, well tested, clean, performant, and memory efficient.
## Redzen top level namespaces
* Collections
* IO
* Linq
* Numerics
* Random
* Sorting
* Structures## Redzen project map
* **Collections**
* *IntStack*
* A stack of int32 values. A simpler alternative to Stack\ that provides additional Poke() and TryPoke() methods. Optimised for stacks of Int32.
* *LightweightList*
* A simpler alternative to List that provides an AsSpan() method for efficient access to the internal array element.
* *LightweightStack*
* A simpler alternative to Stack\ that provides additional Poke() and TryPoke() methods.
* **IO**
* *Base64EncodingOutputStream*
* Base64 stream encoder.
* *FileByteArray*
* Presents a 'byte array' backed by a file on disk.
* *MemoryBlockStream*
* A memory backed stream that stores byte data in blocks, this gives improved performance over System.IO.MemoryStream in some circumstances.
* *NonClosingStreamWrapper*
* Wraps a stream and prevents calls to Close() and Dispose() from being made on it.
* *StreamHelper*
* General purpose helper methods for working with streams.
* **Linq**
* *EnumerableUtils*
* Utility methods related to LINQ and IEnumerable.
* **Numerics**
* **Distributions**
* **Double**
* *BoxMullerGaussian*
* Static methods for taking samples from Gaussian distributions using the Box-Muller transform.
* *BoxMullerGaussianSampler*
* A Gaussian distribution sampler based on the Box-Muller transform.
* *BoxMullerGaussianStatelessSampler*
* A stateless Gaussian distribution sampler based on the Box-Muller transform.
* *UniformDistribution*
* Static methods for taking samples from uniform distributions.
* *UniformDistributionSampler*
* A uniform distribution sampler.
* *UniformDistributionStatelessSampler*
* A stateless uniform distribution sampler.
* *ZigguratGaussian*
* Static methods for taking samples from Gaussian distributions using the Ziggurat algorithm.
* *ZigguratGaussianSampler*
* A Gaussian distribution sampler based on the Ziggurat algorithm.
* *ZigguratGaussianStatelessSampler*
* A stateless Gaussian distribution sampler based on the Ziggurat algorithm.
* **Float**
* *BoxMullerGaussian*
* Static methods for taking samples from Gaussian distributions using the Box-Muller transform.
* *BoxMullerGaussianSampler*
* A Gaussian distribution sampler based on the Box-Muller transform.
* *BoxMullerGaussianStatelessSampler*
* A stateless Gaussian distribution sampler based on the Box-Muller transform.
* *UniformDistribution*
* Static methods for taking samples from uniform distributions.
* *UniformDistributionSampler*
* A uniform distribution sampler.
* *UniformDistributionStatelessSampler*
* A stateless uniform distribution sampler.
* *ZigguratGaussian*
* Static methods for taking samples from Gaussian distributions using the Ziggurat algorithm.
* *ZigguratGaussianSampler*
* A Gaussian distribution sampler based on the Ziggurat algorithm.
* *ZigguratGaussianStatelessSampler*
* A stateless Gaussian distribution sampler based on the Ziggurat algorithm.* **Random**
* *DefaultRandomSeedSource*
* A default source of seed values for use by pseudo-random number generators (PRNGs).
* *RandomDefaults*
* Provides a means of creating default implementations of IRandomSource, and also a standard way of generating seed values for PRNGs generally.
* *Splitmix64Rng*
* Splitmix64 Pseudo Random Number Generator (PRNG).
* *WyRandom*
* wyrand pseudo-random number generator. Uses the wyrand PRNG defined at https://github.com/wangyi-fudan/wyhash.
* *XorShiftRandom*
* xor-shift pseudo random number generator (PRNG) devised by George Marsaglia.
* *Xoshiro256PlusPlusRandom*
* xoshiro256+ (xor, shift, rotate) pseudo-random number generator (PRNG).
* *Xoshiro256PlusRandom*
* xoshiro256++ (xor, shift, rotate) pseudo-random number generator (PRNG).
* *Xoshiro256StarStarRandom*
* xoshiro256** (xor, shift, rotate) pseudo-random number generator (PRNG).
* *Xoshiro512StarStarRandom*
* xoshiro512** (xor, shift, rotate) pseudo-random number generator (PRNG).* **Sorting**
* *IntroSort\*
* For sorting an array of key values, and two additional arrays based on the array of keys.
* *SortUtils*
* Helper methods related to sorting.
* *TimSort\*
* A timsort implementation.
* *TimSort\*
* A timsort implementation. This version accepts a secondary values array, the elements of which are repositioned in-line with their associated key values.
* *TimSort\*
* A timsort implementation. This version accepts two secondary values arrays, the elements of which are repositioned in-line with their associated key values.* **Structures**
* **Compact**
* *CompactIntegerList*
* A compact list of sequential integer values.
* *FixedPointDecimal*
* A fixed point decimal data type that uses Int32 for its underlying state, i.e. 4 bytes versus the native decimal's 16 bytes.
* *BoolArray*
* A leaner faster alternative to System.Collections.BitArray.
* *CircularBuffer\*
* A generic circular buffer of items of type T.
* *CircularBufferWithStats*
* A circular buffer of double precision floating point values, that maintains a sum of the contained values, and therefore also the arithmetic mean.
* *Int32Sequence*
* Conveniently encapsulates a single Int32, which is incremented to produce new IDs.
* *KeyedCircularBuffer\*
* A generic circular buffer of KeyValuePairs. The values are retrievable by their key.* **Miscellany / Root Namespace**
* *FloatUtils*
* Static utility methods for `IBinaryFloatingPointIeee754` types.
* *MathSpan*
* Math utility methods for working with spans.
* *MathUtils*
* Math utility methods.
* *PrimeUtils*
* Utility methods related to prime numbers.
* *SearchUtils*
* Helper methods related to binary search.
* *SpanUtils*
* Span static utility methods.
* *VariableUtils*
* General purpose helper methods.