Initial BitContradiction implementation on GPU
This commit is contained in:
1 parent
e61d166eb1
commit
17763033e1
13 files changed
+1969
-23
No files matched your search
@@ -5,6 +5,7 @@ using Xunit;
|
||||
|
||||
namespace PerfectNumbers.Core.Tests;
|
||||
|
||||
[Trait("Category", "Fast")]
|
||||
public class BitContradictionIntegrationTests
|
||||
{
|
||||
// 2^11 - 1 = 2047 = 23 * 89
|
||||
@@ -39,11 +40,21 @@ public class BitContradictionIntegrationTests
|
||||
divides.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BitContradictionAcceptsKnownLargeDivisor()
|
||||
{
|
||||
BigInteger divisor = BigInteger.Parse("1209708008767");
|
||||
ulong p = 138000001;
|
||||
bool decided = Invoke(divisor, p, out bool divides);
|
||||
decided.Should().BeTrue();
|
||||
divides.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BitContradictionRejectsNonDivisorWithDecision()
|
||||
{
|
||||
// 2^11 - 1 is not divisible by 25
|
||||
BigInteger divisor = 25;
|
||||
// 2^11 - 1 is not divisible by 45 (k=2, q=22*2+1).
|
||||
BigInteger divisor = 45;
|
||||
ulong p = 11;
|
||||
bool decided = Invoke(divisor, p, out bool divides);
|
||||
decided.Should().BeTrue("small p should be decided exactly");
|
||||
|
||||
Reference in new issue
Block a user