View SmartI.cs
public class SmartI
{
public readonly HashSet<int> FutureReserchUnknownAttributes = new HashSet<int>();
private Dictionary<int, Smart> _smartInfo = new Dictionary<int, Smart>();
private static bool Is64Bit => IntPtr.Size == 8;
private static uint OffsetSize => Is64Bit ? 8u : 6u;
public Dictionary<int, Smart> SmartInfo
{
get
{
View PDiskInformation.cs
public class PDiskInformation
{
private Dictionary<string, PhysicalDiskStruct> _pdiCache = new Dictionary<string, PhysicalDiskStruct>();
public Dictionary<string, PhysicalDiskStruct> PDiskInfo
{
get
{
if(_pdiCache.Count == 0)
_pdiCache = GetDiskPI();
return _pdiCache;
View bigsqrt.cs
public BigInteger Sqrt(BigInteger n)
{
var q = BigInteger.One << ((int)BigInteger.Log(n, 2) >> 1);
var m = BigInteger.Zero;
while (BigInteger.Abs(q - m) >= 1)
{
m = q;
q = (m + n / m) >> 1;
}
return q;
View ConcurrentHashSet.cs
[Serializable]
public class ConcurrentHashSet<T> : IReadOnlyCollection<T>, ICollection<T>
{
private readonly IEqualityComparer<T> _comparer;
private readonly bool _growLockArray;
private int _budget;
private volatile Tables _tables;
public ConcurrentHashSet()
: this(DefaultConcurrencyLevel, 16, true, null)
{
View PolyNomial.cs
public class PolyNomial
{
public int[] _coefficients;
public PolyNomial()
{
}
public PolyNomial(int degree)
{
_coefficients = new int[degree];
}
View GetObjBytes.cs
public static byte[] GetObjBytes(object obj, Type type = null)
{
Type _type;
if (type == null)
_type = obj.GetType();
else
_type = type;
switch (_type.Name)
{
case "Byte":
View TinyHashSet.cs
public class TinyHashSet<T> : IEnumerable<T>
{
private readonly IEqualityComparer<T> _comparer;
private int[] _hashBuckets;
private uint[] _hashcodes;
private int[] _next;
public T[] Items;
public int Version;
public TinyHashSet() : this(1, EqualityComparer<T>.Default)
{
View TinyDictionary.cs
public class TinyDictionary<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>
{
private readonly IEqualityComparer<TKey> _comparer;
private int[] _hashBuckets;
private uint[] _hashcodes;
private int[] _next;
private TinyHashSet<TValue> _searchValues;
public TKey[] Keys;
public TValue[] Values;
public int Version;
View CRng.cs
[Serializable]
public class CRng
{
private static readonly double ED_Char = 1.0 / char.MaxValue;
private static readonly double ED_SByte = 1.0 / sbyte.MaxValue;
private static readonly double ED_Byte = 1.0 / byte.MaxValue;
private static readonly double ED_Short = 1.0 / short.MaxValue;
private static readonly double ED_UShort = 1.0 / ushort.MaxValue;
private static readonly double ED_Int = 1.0 / int.MaxValue;
private static readonly double ED_UInt = 1.0 / uint.MaxValue;
View LimitedList.cs
[Serializable]
public class LimitedList<T> : IEnumerable<T>
{
private T[] _thing;
public LimitedList(int maxsize)
{
_thing = new T[maxsize];
MaxSize = maxsize;
}
private int MaxSize { get; }