2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-04-04 04:18:22 +00:00

Huffman base2/3

This commit is contained in:
2023-03-27 15:12:40 +03:00
parent 60738d01b4
commit 9a74a01bdf
8 changed files with 268 additions and 96 deletions

View File

@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Esiur.Analysis.Coding
{
public class CodeSet<T> where T : System.Enum
{
public T[] Elements { get; private set; }
public int ElementsCount { get; private set; }
public CodeSet()
{
var values = System.Enum.GetValues(typeof(T));
Elements = new T[values.Length];
ElementsCount = values.Length;
values.CopyTo(Elements, 0);
}
}
//public interface IBaseValue<T>
//{
// public T Value { get; set; }
// public T[] Allowed { get; set; }
//}
public enum Base2: byte
{
Zero,
One
}
public enum Base3 : byte
{
Zero,
One,
Two
}
//public struct BinaryValue : IBaseValue<Base2>
//{
// public Base2 Value { get; set; }
//}
//public struct TernaryValue : IBaseValue<Base3>
//{
// public Base3 Value { get; set; }
//}
}