2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-05-06 11:32:59 +00:00
This commit is contained in:
Esiur Project 2023-03-29 23:08:40 +03:00
parent 1d48d97dbe
commit 5966598c9f
2 changed files with 2 additions and 20 deletions

View File

@ -48,26 +48,7 @@ namespace Esiur.Analysis.Test
{
var graph = new DirectedGraph<double>();
var n1 = graph.AddNode(1, "1", 10, 10);
var n2 = graph.AddNode(2, "2", 20, 10);
graph.Link(n1, n2, 0.5, "1->2");
graph.Link(n1, n1, 0.5, "1->1");
graph.Link(n2, n1, 0.2, "2->1");
graph.Link(n2, n2, 0.8, "2->2");
var matrix = new Matrix<double>(new double[,] { { 0.5, 0.5 }, { 0.2, 0.8 } });
var m = matrix;
for(var i = 0; i < 3; i++)
{
m = m * m;
Console.WriteLine(m);
}
var msg = Encoding.ASCII.GetBytes("A_DEAD_DAD_CEDED_A_BAD_BABE_A_BEADED_ABACA_BED").Select(x => CodeWord<Base2>.FromByte(x)).ToArray();// <Base2>());

View File

@ -160,7 +160,8 @@ namespace Esiur.Analysis.Coding
decision[0].Parent = branch;
decision[1].Parent = branch;
nodes = nodes.Skip(2).Append(branch).OrderBy(x => x.Frequency).ToList();
// remove processed branches, append the new branch and sort by probability
nodes = nodes.Skip(CodeSet.ElementsCount).Append(branch).OrderBy(x => x.Frequency).ToList();
}
// create tree