diff options
author | Hind-M <hind.montassif@gmail.com> | 2021-07-27 11:01:31 +0200 |
---|---|---|
committer | Hind-M <hind.montassif@gmail.com> | 2021-07-27 11:01:31 +0200 |
commit | a93e26976e5898b267d8b743e080e8869ff41b4f (patch) | |
tree | 63b20a84a2c049e663526ab109b9b469c6ad9429 /src/Persistent_cohomology/include | |
parent | aa1a040f6338ec938b9360de35196ad0518be502 (diff) |
Remove unnecessary checks for primality
Document homology_coeff_field values in cubical
Diffstat (limited to 'src/Persistent_cohomology/include')
-rw-r--r-- | src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h index 7ecc9a80..8ec89e41 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h @@ -38,12 +38,12 @@ class Field_Zp { Prime = charac; - // Check that the provided prime is less than the maximum allowed as int and calculation below : 46337 ; i.e (max_prime-1)**2 <= INT_MAX + // Check that the provided prime is less than the maximum allowed as int, calculation below, and 'plus_times_equal' function : 46337 ; i.e (max_prime-1)*max_prime <= INT_MAX if(Prime > 46337) throw std::invalid_argument("Maximum homology_coeff_field allowed value is 46337"); // Check for primality - if ((Prime == 0) || (Prime == 1) || ((Prime > 3) && ((Prime % 2 == 0) || (Prime % 3 == 0)))) + if (Prime <= 1) throw std::invalid_argument("homology_coeff_field must be a prime number"); inverse_.clear(); @@ -59,10 +59,6 @@ class Field_Zp { mult = inv * i; } inverse_.push_back(inv); - if ( (i*i <= Prime) && (((i-5)%6) == 0) ) { - if ((Prime % i == 0) || (Prime % (i + 2) == 0)) - throw std::invalid_argument("homology_coeff_field must be a prime number"); - } } } |