public void AfterNormalization_TotalIsOne() { var q2 = new Quantization2f(new[] { 0, 10f, 0 }, new[] { 5f, 0.5f, 4.5f }); var result = q2.Normalized; result.Total.Should().Be(1); }
public void AbleToMultiplyAQuantizationByAFloat() { var q2 = new Quantization2f(new[] { 1.0f, 2.0f, 3.0f }, new[] { 4.0f, 0.5f, 1.5f }); var result = q2 * 0.5f; result.GetXValues().Should().BeEquivalentTo(new[] { 0.5f, 1, 1.5f }); result.GetYValues().Should().BeEquivalentTo(new[] { 2, 0.25f, 0.75f }); }
public void AbleToAddTwoQuantizations() { var q1 = new Quantization2f(new[] { 1.0f, 2.0f, 3.0f }, new[] { 4.0f, 0.5f, 1.5f }); var q2 = new Quantization2f(new[] { 10.0f, 11.0f, 12.0f }, new[] { .5f, 1.5f, 31 }); var result = q1 + q2; result.GetXValues().Should().BeEquivalentTo(new[] { 11f, 13, 15 }); result.GetYValues().Should().BeEquivalentTo(new[] { 4.5f, 2, 32.5f }); }
public void AbleToCreateANewQuantization2() { var q = new Quantization2f(10); q.Total.Should().Be(0); }
public Velocity2dProbability(Quantization2f copy) : base(copy.GetXValues(), copy.GetYValues()) { }
public void AbleToMakeANewQuantization2() { var q = new Quantization2f(new[] { 0.3f, 1f, 0 }, new[] { 0.1f, 1f, 0.2f }); q.Total.Should().Be(1.3f); }