-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move generate_phi.hpp code phi_vector.cpp (#74)
- Loading branch information
1 parent
eb3f1f5
commit 80a6ad9
Showing
8 changed files
with
100 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/// | ||
/// @file phi_vector.hpp | ||
/// | ||
/// Copyright (C) 2024 Kim Walisch, <kim.walisch@gmail.com> | ||
/// | ||
/// This file is distributed under the BSD License. See the COPYING | ||
/// file in the top level directory. | ||
/// | ||
|
||
#ifndef PHI_VECTOR_HPP | ||
#define PHI_VECTOR_HPP | ||
|
||
#include <PiTable.hpp> | ||
#include <Vector.hpp> | ||
#include <stdint.h> | ||
|
||
namespace primecount { | ||
|
||
/// Returns a vector with phi(x, i - 1) values such that | ||
/// phi[i] = phi(x, i - 1) for 1 <= i <= a. | ||
/// phi(x, a) counts the numbers <= x that are not | ||
/// divisible by any of the first a primes. | ||
/// | ||
Vector<int64_t> phi_vector(int64_t x, | ||
int64_t a, | ||
const Vector<uint32_t>& primes, | ||
const PiTable& pi); | ||
|
||
/// Returns a vector with phi(x, i - 1) values such that | ||
/// phi[i] = phi(x, i - 1) for 1 <= i <= a. | ||
/// phi(x, a) counts the numbers <= x that are not | ||
/// divisible by any of the first a primes. | ||
/// | ||
Vector<int64_t> phi_vector(int64_t x, | ||
int64_t a, | ||
const Vector<int64_t>& primes, | ||
const PiTable& pi); | ||
|
||
} // namespace | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters