public void Combination() { var factor = new StaticModIntFactor <Mod1000000007>(10); for (int i = 0; i <= 10; i++) { for (int j = 0; j <= 10; j++) { factor.Combination(i, j).Value.Should().Be((int)MathLibEx.Combination(i, j)); } } factor.Invoking(factor => factor.Combination(11, 0)).Should().Throw <Exception>(); }
public void Homogeneous() { var factor = new StaticModIntFactor <Mod1000000007>(30); for (int i = 0; i <= 10; i++) { for (int j = 0; j <= 20; j++) { factor.Homogeneous(i, j).Should().Be(factor.Combination(i + j - 1, j)); } } factor.Invoking(factor => factor.Homogeneous(10, 22)).Should().Throw <Exception>(); }