From 41be012ea2aa61519af1003a4ba9c35e46b18b93 Mon Sep 17 00:00:00 2001 From: realstealthninja Date: Sat, 31 Aug 2024 00:44:14 +0000 Subject: [PATCH] Documentation for af72fab013cc448c74b79a2981f3ceee957f9eae --- d6/d84/namespaceutils.html | 125 +++++++ ..._1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html | 265 +++++---------- ...th_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.js | 9 +- ...431ec5c876e1154d8e1e5f89e1ab34a_cgraph.map | 8 - ...431ec5c876e1154d8e1e5f89e1ab34a_cgraph.md5 | 1 - ...c5c876e1154d8e1e5f89e1ab34a_cgraph_org.svg | 68 ---- ...b95277f5f527beacc8d0f3bc91fcd08_cgraph.map | 10 - ...b95277f5f527beacc8d0f3bc91fcd08_cgraph.md5 | 1 - ...b95277f5f527beacc8d0f3bc91fcd08_cgraph.svg | 170 ---------- ...77f5f527beacc8d0f3bc91fcd08_cgraph_org.svg | 87 ----- ...de201f4687740454302c444f507a926_cgraph.map | 6 - ...de201f4687740454302c444f507a926_cgraph.md5 | 1 - ...ulo__p_1_1_n_c_r_modulo_p__coll__graph.map | 10 +- ...ulo__p_1_1_n_c_r_modulo_p__coll__graph.md5 | 2 +- ...ulo__p_1_1_n_c_r_modulo_p__coll__graph.svg | 30 +- ..._p_1_1_n_c_r_modulo_p__coll__graph_org.svg | 30 +- dd/d47/namespacemath.html | 2 - ..._modulo__p_1_1_n_c_r_modulo_p-members.html | 11 +- de/dab/ncr__modulo__p_8cpp.html | 243 +++++++++++--- de/dab/ncr__modulo__p_8cpp.js | 6 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.map | 5 + ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.md5 | 1 + ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.svg | 66 ++++ ...8ccf42aaf7375a83e91490eda1e_cgraph_org.svg | 40 +++ ...c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.map | 9 + ...c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.md5 | 1 + ...c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.svg | 45 ++- ...e3bdaa086d32261a5c5584d0fa9_cgraph_org.svg | 77 +++++ ...010ad5669d31449c3bf3271ab5ebc86_cgraph.map | 6 + ...010ad5669d31449c3bf3271ab5ebc86_cgraph.md5 | 1 + ...010ad5669d31449c3bf3271ab5ebc86_cgraph.svg | 26 +- ...d5669d31449c3bf3271ab5ebc86_cgraph_org.svg | 26 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 12 - ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 - ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 188 ----------- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 105 ------ ...0a3e6827f41c151e47451f5ff98b1f1_cgraph.map | 12 - ...0a3e6827f41c151e47451f5ff98b1f1_cgraph.md5 | 1 - ...0a3e6827f41c151e47451f5ff98b1f1_cgraph.svg | 188 ----------- ...6827f41c151e47451f5ff98b1f1_cgraph_org.svg | 105 ------ doxygen_crawl.html | 19 +- functions_c.html | 1 + functions_f.html | 1 + functions_func_c.html | 1 + functions_func_g.html | 1 - functions_func_m.html | 1 - functions_func_n.html | 4 +- functions_g.html | 1 - functions_m.html | 1 - functions_n.html | 4 +- functions_p.html | 2 +- functions_vars.html | 3 +- globals_e.html | 1 + globals_func_e.html | 1 + globals_func_m.html | 2 +- globals_func_t.html | 2 +- globals_m.html | 2 +- globals_t.html | 2 +- namespaces.html | 17 +- namespaces_dup.js | 1 + navtreedata.js | 4 +- navtreeindex10.js | 2 +- navtreeindex12.js | 2 +- navtreeindex13.js | 10 +- navtreeindex14.js | 2 + navtreeindex2.js | 2 +- navtreeindex5.js | 2 +- navtreeindex6.js | 2 +- navtreeindex7.js | 14 +- navtreeindex9.js | 2 +- search/all_12.js | 4 +- search/all_13.js | 4 +- search/all_15.js | 2 +- search/all_19.js | 2 +- search/all_1a.js | 3 +- search/all_8.js | 173 +++++----- search/all_a.js | 51 +-- search/all_b.js | 315 +++++++++--------- search/all_c.js | 2 +- search/functions_14.js | 2 +- search/functions_3.js | 107 +++--- search/functions_5.js | 35 +- search/functions_7.js | 2 +- search/functions_d.js | 4 +- search/functions_e.js | 4 +- search/namespaces_13.js | 3 +- search/variables_6.js | 11 +- search/variables_e.js | 2 +- 88 files changed, 1144 insertions(+), 1691 deletions(-) create mode 100644 d6/d84/namespaceutils.html delete mode 100644 d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.map delete mode 100644 d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.md5 delete mode 100644 d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph_org.svg delete mode 100644 d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.map delete mode 100644 d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.md5 delete mode 100644 d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.svg delete mode 100644 d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph_org.svg delete mode 100644 d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.map delete mode 100644 d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.md5 create mode 100644 de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.map create mode 100644 de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.md5 create mode 100644 de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.svg create mode 100644 de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph_org.svg create mode 100644 de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.map create mode 100644 de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.md5 rename d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.svg => de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.svg (50%) create mode 100644 de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph_org.svg create mode 100644 de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.map create mode 100644 de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.md5 rename d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.svg => de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.svg (63%) rename d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph_org.svg => de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph_org.svg (51%) delete mode 100644 de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map delete mode 100644 de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 delete mode 100644 de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg delete mode 100644 de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg delete mode 100644 de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.map delete mode 100644 de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.md5 delete mode 100644 de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.svg delete mode 100644 de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph_org.svg diff --git a/d6/d84/namespaceutils.html b/d6/d84/namespaceutils.html new file mode 100644 index 000000000..68faafb30 --- /dev/null +++ b/d6/d84/namespaceutils.html @@ -0,0 +1,125 @@ + + + + + + + +Algorithms_in_C++: utils Namespace Reference + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C++ 1.0.0 +
+
Set of algorithms implemented in C++.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
utils Namespace Reference
+
+
+ +

this namespace contains the definitions of the functions called from the class math::ncr_modulo_p::NCRModuloP +More...

+

Detailed Description

+

this namespace contains the definitions of the functions called from the class math::ncr_modulo_p::NCRModuloP

+
+
+ + + + diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html index 4b769dc4f..261a06419 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html +++ b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html @@ -106,6 +106,7 @@ $(function(){initNavTree('d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.
math::ncr_modulo_p::NCRModuloP Class Reference
@@ -117,35 +118,39 @@ $(function(){initNavTree('d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.
Collaboration diagram for math::ncr_modulo_p::NCRModuloP:
-
+
[legend]
- - - - - - - - - + + + + + + +

Public Member Functions

 NCRModuloP (const uint64_t &size, const uint64_t &mod)
 the p from (nCr % p)
 
uint64_t gcdExtended (const uint64_t &a, const uint64_t &b, int64_t *x, int64_t *y)
 
int64_t modInverse (const uint64_t &a, const uint64_t &m)
 
int64_t ncr (const uint64_t &n, const uint64_t &r, const uint64_t &p)
 
 NCRModuloP (const int64_t &size, const int64_t &p)
 constructs an NCRModuloP object allowing to compute (nCr)p for inputs from 0 to size
 
int64_t ncr (const int64_t &n, const int64_t &r) const
 computes nCr % p
 
+ + + +

+Static Private Member Functions

static std::vector< int64_t > computeFactorialsMod (const int64_t &max_arg_val, const int64_t &mod)
 stores precomputed factorial(i) % p value
 
- - - - - + + + + +

Private Attributes

std::vector< uint64_t > fac {}
 
-uint64_t p = 0
 stores precomputed factorial(i) % p value
 
+const int64_t p = 0
 
+const std::vector< int64_t > fac
 the p from (nCr % p)
 

Detailed Description

Class which contains all methods required for calculating nCr mod p.

Constructor & Destructor Documentation

- -

◆ NCRModuloP()

+ +

◆ NCRModuloP()

@@ -156,12 +161,12 @@ uint64_t p = 0 math::ncr_modulo_p::NCRModuloP::NCRModuloP ( - const uint64_t & size, + const int64_t & size, - const uint64_t & mod ) + const int64_t & p ) @@ -171,24 +176,16 @@ uint64_t p = 0
-

the p from (nCr % p)

-

Constructor which precomputes the values of n! % mod from n=0 to size and stores them in vector 'fac' @params[in] the numbers 'size', 'mod'

-
41 {
-
42 p = mod;
-
43 fac = std::vector<uint64_t>(size);
-
44 fac[0] = 1;
-
45 for (int i = 1; i <= size; i++) {
-
46 fac[i] = (fac[i - 1] * i) % p;
-
47 }
-
48 }
-
uint64_t p
stores precomputed factorial(i) % p value
Definition ncr_modulo_p.cpp:34
- +

constructs an NCRModuloP object allowing to compute (nCr)p for inputs from 0 to size

+
108 : p(p), fac(computeFactorialsMod(size, p)) {}
+
const std::vector< int64_t > fac
the p from (nCr % p)
Definition ncr_modulo_p.cpp:83
+
static std::vector< int64_t > computeFactorialsMod(const int64_t &max_arg_val, const int64_t &mod)
stores precomputed factorial(i) % p value
Definition ncr_modulo_p.cpp:92

Member Function Documentation

- -

◆ gcdExtended()

+ +

◆ computeFactorialsMod()

@@ -197,106 +194,46 @@ uint64_t p = 0 - + - + - - - - - - - - - - - +
uint64_t math::ncr_modulo_p::NCRModuloP::gcdExtended static std::vector< int64_t > math::ncr_modulo_p::NCRModuloP::computeFactorialsMod (const uint64_t & a, const int64_t & max_arg_val,
const uint64_t & b,
int64_t * x,
int64_t * y )const int64_t & mod )
-inline +inlinestaticprivate
-

Finds the value of x, y such that a*x + b*y = gcd(a,b)

-

@params[in] the numbers 'a', 'b' and address of 'x' and 'y' from above equation

Returns
the gcd of a and b
-
57 {
-
58 if (a == 0) {
-
59 *x = 0, *y = 1;
-
60 return b;
-
61 }
-
62
-
63 int64_t x1 = 0, y1 = 0;
-
64 uint64_t gcd = gcdExtended(b % a, a, &x1, &y1);
-
65
-
66 *x = y1 - (b / a) * x1;
-
67 *y = x1;
-
68 return gcd;
-
69 }
-
uint64_t gcdExtended(const uint64_t &a, const uint64_t &b, int64_t *x, int64_t *y)
Definition ncr_modulo_p.cpp:56
-
int gcd(int num1, int num2)
Definition gcd_iterative_euclidean.cpp:15
-
-Here is the call graph for this function:
-
-
-
+

stores precomputed factorial(i) % p value

+

computes the array of values of factorials reduced modulo mod

Parameters
+ + + +
max_arg_valargument of the last factorial stored in the result
modvalue of the divisor used to reduce factorials
+
+
+
Returns
vector storing factorials of the numbers 0, ..., max_arg_val reduced modulo mod
+
93 {
+
94 auto res = std::vector<int64_t>(max_arg_val + 1);
+
95 res[0] = 1;
+
96 for (int64_t i = 1; i <= max_arg_val; i++) {
+
97 res[i] = (res[i - 1] * i) % mod;
+
98 }
+
99 return res;
+
100 }
+ +
- -

◆ modInverse()

- -
-
- - - - - -
- - - - - - - - - - - -
int64_t math::ncr_modulo_p::NCRModuloP::modInverse (const uint64_t & a,
const uint64_t & m )
-
-inline
-
-

Find modular inverse of a with m i.e. a number x such that (a*x)m = 1

-

@params[in] the numbers 'a' and 'm' from above equation

Returns
the modular inverse of a
-
76 {
-
77 int64_t x = 0, y = 0;
-
78 uint64_t g = gcdExtended(a, m, &x, &y);
-
79 if (g != 1) { // modular inverse doesn't exist
-
80 return -1;
-
81 } else {
-
82 int64_t res = ((x + m) % m);
-
83 return res;
-
84 }
-
85 }
-
double g(double x)
Another test function.
Definition composite_simpson_rule.cpp:115
-
-Here is the call graph for this function:
-
-
-
- -
-
- -

◆ ncr()

+ +

◆ ncr()

@@ -307,17 +244,12 @@ Here is the call graph for this function:
int64_t math::ncr_modulo_p::NCRModuloP::ncr ( - const uint64_t & n, + const int64_t & n, - const uint64_t & r, - - - - - const uint64_t & p ) + const int64_t & r ) const @@ -326,60 +258,35 @@ Here is the call graph for this function:
-

Find nCr % p

-

@params[in] the numbers 'n', 'r' and 'p'

Returns
the value nCr % p
-
92 {
-
93 // Base cases
-
94 if (r > n) {
-
95 return 0;
-
96 }
-
97 if (r == 1) {
-
98 return n % p;
-
99 }
-
100 if (r == 0 || r == n) {
-
101 return 1;
-
102 }
-
103 // fac is a global array with fac[r] = (r! % p)
-
104 int64_t denominator = modInverse(fac[r], p);
-
105 if (denominator < 0) { // modular inverse doesn't exist
-
106 return -1;
-
107 }
-
108 denominator = (denominator * modInverse(fac[n - r], p)) % p;
-
109 if (denominator < 0) { // modular inverse doesn't exist
-
110 return -1;
-
111 }
-
112 return (fac[n] * denominator) % p;
-
113 }
-
int64_t modInverse(const uint64_t &a, const uint64_t &m)
Definition ncr_modulo_p.cpp:76
-
-Here is the call graph for this function:
-
-
-
-
-
-

Member Data Documentation

- -

◆ fac

- -
-
- - - - - -
- - - - -
std::vector<uint64_t> math::ncr_modulo_p::NCRModuloP::fac {}
-
-private
-
-
33{}; /// stores precomputed factorial(i) % p value
+

computes nCr % p

+
Parameters
+ + + +
[in]nthe number of objects to be chosen
[in]rthe number of objects to choose from
+
+
+
Returns
the value nCr % p
+
116 {
+
117 // Base cases
+
118 if (r > n) {
+
119 return 0;
+
120 }
+
121 if (r == 1) {
+
122 return n % p;
+
123 }
+
124 if (r == 0 || r == n) {
+
125 return 1;
+
126 }
+
127 // fac is a global array with fac[r] = (r! % p)
+
128 const auto denominator = (fac[r] * fac[n - r]) % p;
+
129 const auto denominator_inv = utils::modInverse(denominator, p);
+
130 if (denominator_inv < 0) { // modular inverse doesn't exist
+
131 return -1;
+
132 }
+
133 return (fac[n] * denominator_inv) % p;
+
134 }
diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.js b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.js index a761f61e0..f2b3aa309 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.js +++ b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.js @@ -1,8 +1,7 @@ var classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p = [ - [ "NCRModuloP", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#af3d41271912f9fa50b774c96c51874b9", null ], - [ "gcdExtended", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#afde201f4687740454302c444f507a926", null ], - [ "modInverse", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#a0431ec5c876e1154d8e1e5f89e1ab34a", null ], - [ "ncr", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#a6b95277f5f527beacc8d0f3bc91fcd08", null ], - [ "p", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#a57c168cd6eb85718eab97da658a698ad", null ] + [ "NCRModuloP", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#a94b07e7dc61d8d7a1e9c5a28988e72f9", null ], + [ "computeFactorialsMod", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#ab5744fa589f6a48f9fe7bca13dbe661f", null ], + [ "ncr", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#a499df7a01bcd348345dc5a0ab79bb0e9", null ], + [ "fac", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#a738a5f59bb3560c81cdb7f43bcfe9fec", null ] ]; \ No newline at end of file diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.map b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.map deleted file mode 100644 index 3f6f101ac..000000000 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.map +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.md5 b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.md5 deleted file mode 100644 index 1507d2f65..000000000 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -f06cc14bf3912fe369d70a4a9a0413b6 \ No newline at end of file diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph_org.svg b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph_org.svg deleted file mode 100644 index 9a1091e9b..000000000 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph_org.svg +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - -math::ncr_modulo_p::NCRModuloP::modInverse - - -Node1 - - -math::ncr_modulo_p -::NCRModuloP::modInverse - - - - - -Node2 - - -math::ncr_modulo_p -::NCRModuloP::gcdExtended - - - - - -Node1->Node2 - - - - - - - - -Node2->Node2 - - - - - - - - -Node3 - - -gcd - - - - - -Node2->Node3 - - - - - - - - diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.map b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.map deleted file mode 100644 index 546da1263..000000000 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.map +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.md5 b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.md5 deleted file mode 100644 index c6ee41c07..000000000 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -f639372407ee0f37245df2e372d826c1 \ No newline at end of file diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.svg b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.svg deleted file mode 100644 index 9b530e5be..000000000 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.svg +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -math::ncr_modulo_p::NCRModuloP::ncr - - -Node1 - - -math::ncr_modulo_p -::NCRModuloP::ncr - - - - - -Node2 - - -math::ncr_modulo_p -::NCRModuloP::modInverse - - - - - -Node1->Node2 - - - - - - - - -Node3 - - -math::ncr_modulo_p -::NCRModuloP::gcdExtended - - - - - -Node2->Node3 - - - - - - - - -Node3->Node3 - - - - - - - - -Node4 - - -gcd - - - - - -Node3->Node4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph_org.svg b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph_org.svg deleted file mode 100644 index f46353727..000000000 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph_org.svg +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - -math::ncr_modulo_p::NCRModuloP::ncr - - -Node1 - - -math::ncr_modulo_p -::NCRModuloP::ncr - - - - - -Node2 - - -math::ncr_modulo_p -::NCRModuloP::modInverse - - - - - -Node1->Node2 - - - - - - - - -Node3 - - -math::ncr_modulo_p -::NCRModuloP::gcdExtended - - - - - -Node2->Node3 - - - - - - - - -Node3->Node3 - - - - - - - - -Node4 - - -gcd - - - - - -Node3->Node4 - - - - - - - - diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.map b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.map deleted file mode 100644 index 00d91d0c4..000000000 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.map +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.md5 b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.md5 deleted file mode 100644 index 6ad9f0f22..000000000 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -36d1c5e8e42c63e54f30e372c1a629bd \ No newline at end of file diff --git a/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.map b/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.map index 8f081dd30..9fe7ce4e4 100644 --- a/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.map +++ b/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.map @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.md5 b/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.md5 index 0ca6c7de3..dd23966a2 100644 --- a/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.md5 +++ b/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.md5 @@ -1 +1 @@ -7507f17b72c8027fffdd536f1bb9971d \ No newline at end of file +a4f915c326bfb68f957e0df8cc1226e7 \ No newline at end of file diff --git a/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.svg b/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.svg index 745b32791..7a8694e69 100644 --- a/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.svg +++ b/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.svg @@ -4,8 +4,8 @@ - + @@ -23,9 +23,9 @@ Node1 - -math::ncr_modulo_p -::NCRModuloP + +math::ncr_modulo_p +::NCRModuloP @@ -33,8 +33,8 @@ Node2 - -std::vector< uint64_t > + +std::vector< int64_t > @@ -42,18 +42,18 @@ Node2->Node1 - - + + - fac + fac Node3 - -std::uint64_t + +std::int64_t @@ -61,11 +61,11 @@ Node3->Node2 - - + + - elements + elements diff --git a/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph_org.svg b/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph_org.svg index a3315580a..0354b605d 100644 --- a/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph_org.svg +++ b/db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph_org.svg @@ -4,17 +4,17 @@ - + math::ncr_modulo_p::NCRModuloP Node1 - -math::ncr_modulo_p -::NCRModuloP + +math::ncr_modulo_p +::NCRModuloP @@ -22,8 +22,8 @@ Node2 - -std::vector< uint64_t > + +std::vector< int64_t > @@ -31,18 +31,18 @@ Node2->Node1 - - + + - fac + fac Node3 - -std::uint64_t + +std::int64_t @@ -50,11 +50,11 @@ Node3->Node2 - - + + - elements + elements diff --git a/dd/d47/namespacemath.html b/dd/d47/namespacemath.html index 267507b7b..14be483a1 100644 --- a/dd/d47/namespacemath.html +++ b/dd/d47/namespacemath.html @@ -313,8 +313,6 @@ Algorithm

Mathematical algorithms

for assert for std::cout

Mathematical algorithms

-

for assert for io operations

-

Mathematical algorithms

for assert for M_PI definition and pow() for uint16_t datatype

Mathematical algorithms

std::array assert std::sqrt, std::trunc, std::pow std::complex std::invalid_argument std::setprecision

diff --git a/de/d1e/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p-members.html b/de/d1e/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p-members.html index ee5155729..a26288082 100644 --- a/de/d1e/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p-members.html +++ b/de/d1e/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p-members.html @@ -110,12 +110,11 @@ $(function(){initNavTree('d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.

This is the complete list of members for math::ncr_modulo_p::NCRModuloP, including all inherited members.

- - - - - - + + + + +
fac (defined in math::ncr_modulo_p::NCRModuloP)math::ncr_modulo_p::NCRModuloPprivate
gcdExtended(const uint64_t &a, const uint64_t &b, int64_t *x, int64_t *y)math::ncr_modulo_p::NCRModuloPinline
modInverse(const uint64_t &a, const uint64_t &m)math::ncr_modulo_p::NCRModuloPinline
ncr(const uint64_t &n, const uint64_t &r, const uint64_t &p)math::ncr_modulo_p::NCRModuloPinline
NCRModuloP(const uint64_t &size, const uint64_t &mod)math::ncr_modulo_p::NCRModuloPinline
pmath::ncr_modulo_p::NCRModuloPprivate
computeFactorialsMod(const int64_t &max_arg_val, const int64_t &mod)math::ncr_modulo_p::NCRModuloPinlineprivatestatic
facmath::ncr_modulo_p::NCRModuloPprivate
ncr(const int64_t &n, const int64_t &r) constmath::ncr_modulo_p::NCRModuloPinline
NCRModuloP(const int64_t &size, const int64_t &p)math::ncr_modulo_p::NCRModuloPinline
p (defined in math::ncr_modulo_p::NCRModuloP)math::ncr_modulo_p::NCRModuloPprivate
diff --git a/de/dab/ncr__modulo__p_8cpp.html b/de/dab/ncr__modulo__p_8cpp.html index 9daa9e4d7..a4096c83d 100644 --- a/de/dab/ncr__modulo__p_8cpp.html +++ b/de/dab/ncr__modulo__p_8cpp.html @@ -137,20 +137,130 @@ Namespaces namespace  ncr_modulo_p  Functions for nCr modulo p implementation.
  +namespace  utils + this namespace contains the definitions of the functions called from the class math::ncr_modulo_p::NCRModuloP
+  - - - + + + + + + + + + + + -

Functions

static void tests (math::ncr_modulo_p::NCRModuloP ncrObj)
 Test implementations.
 
int64_t math::ncr_modulo_p::utils::gcdExtended (const int64_t &a, const int64_t &b, int64_t &x, int64_t &y)
 finds the values x and y such that a*x + b*y = gcd(a,b)
 
int64_t math::ncr_modulo_p::utils::modInverse (const int64_t &a, const int64_t &m)
 
static void tests ()
 tests math::ncr_modulo_p::NCRModuloP
 
void example ()
 example showing the usage of the math::ncr_modulo_p::NCRModuloP class
 
int main ()
 Main function.
 

Detailed Description

This program aims at calculating nCr modulo p.

nCr is defined as n! / (r! * (n-r)!) where n! represents factorial of n. In many cases, the value of nCr is too large to fit in a 64 bit integer. Hence, in competitive programming, there are many problems or subproblems to compute nCr modulo p where p is a given number.

Author
Kaustubh Damania

Function Documentation

+ +

◆ example()

+ +
+
+ + + + + + + +
void example ()
+
+ +

example showing the usage of the math::ncr_modulo_p::NCRModuloP class

+
175 {
+
176 const int64_t size = 1e6 + 1;
+
177 const int64_t p = 1e9 + 7;
+
178
+
179 // the ncrObj contains the precomputed values of factorials modulo p for
+
180 // values from 0 to size
+
181 const auto ncrObj = math::ncr_modulo_p::NCRModuloP(size, p);
+
182
+
183 // having the ncrObj we can efficiently query the values of (n C r)%p
+
184 // note that time of the computation does not depend on size
+
185 for (int i = 0; i <= 7; i++) {
+
186 std::cout << 6 << "C" << i << " mod " << p << " = " << ncrObj.ncr(6, i)
+
187 << "\n";
+
188 }
+
189}
+ +
Class which contains all methods required for calculating nCr mod p.
Definition ncr_modulo_p.cpp:79
+
+
+
+ +

◆ gcdExtended()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
int64_t math::ncr_modulo_p::utils::gcdExtended (const int64_t & a,
const int64_t & b,
int64_t & x,
int64_t & y )
+
+ +

finds the values x and y such that a*x + b*y = gcd(a,b)

+
Parameters
+ + + + + +
[in]athe first input of the gcd
[in]athe second input of the gcd
[out]xthe Bézout coefficient of a
[out]ythe Bézout coefficient of b
+
+
+
Returns
the gcd of a and b
+
45 {
+
46 if (a == 0) {
+
47 x = 0;
+
48 y = 1;
+
49 return b;
+
50 }
+
51
+
52 int64_t x1 = 0, y1 = 0;
+
53 const int64_t gcd = gcdExtended(b % a, a, x1, y1);
+
54
+
55 x = y1 - (b / a) * x1;
+
56 y = x1;
+
57 return gcd;
+
58}
+
int gcd(int num1, int num2)
Definition gcd_iterative_euclidean.cpp:15
+
int64_t gcdExtended(const int64_t &a, const int64_t &b, int64_t &x, int64_t &y)
finds the values x and y such that a*x + b*y = gcd(a,b)
Definition ncr_modulo_p.cpp:44
+
+Here is the call graph for this function:
+
+
+
+ +
+

◆ main()

@@ -165,37 +275,63 @@ Functions
+
191 {
+
192 tests();
+
193 example();
+
194 return 0;
+
195}
+
static void tests()
tests math::ncr_modulo_p::NCRModuloP
Definition ncr_modulo_p.cpp:142
+
void example()
example showing the usage of the math::ncr_modulo_p::NCRModuloP class
Definition ncr_modulo_p.cpp:175
+
+
+ + +

◆ modInverse()

-

Main function.

-
Returns
0 on exit
-
137 {
-
138 // populate the fac array
-
139 const uint64_t size = 1e6 + 1;
-
140 const uint64_t p = 1e9 + 7;
- - -
143 // test 6Ci for i=0 to 7
-
144 for (int i = 0; i <= 7; i++) {
-
145 std::cout << 6 << "C" << i << " = " << ncrObj.ncr(6, i, p) << "\n";
-
146 }
-
147 tests(ncrObj); // execute the tests
-
148 std::cout << "Assertions passed\n";
-
149 return 0;
-
150}
- -
Class which contains all methods required for calculating nCr mod p.
Definition ncr_modulo_p.cpp:31
-
int64_t ncr(const uint64_t &n, const uint64_t &r, const uint64_t &p)
Definition ncr_modulo_p.cpp:92
-
Testcases to check Union of Two Arrays.
+
+
+ + + + + + + + + + + +
int64_t math::ncr_modulo_p::utils::modInverse (const int64_t & a,
const int64_t & m )
+
+

Find modular inverse of a modulo m i.e. a number x such that (a*x)m = 1

+
Parameters
+ + + +
[in]athe number for which the modular inverse is queried
[in]mthe modulus
+
+
+
Returns
the inverce of a modulo m, if it exists, -1 otherwise
+
66 {
+
67 int64_t x = 0, y = 0;
+
68 const int64_t g = gcdExtended(a, m, x, y);
+
69 if (g != 1) { // modular inverse doesn't exist
+
70 return -1;
+
71 } else {
+
72 return ((x + m) % m);
+
73 }
+
74}
+
double g(double x)
Another test function.
Definition composite_simpson_rule.cpp:115
Here is the call graph for this function:
-
+
- -

◆ tests()

+ +

◆ tests()

@@ -206,7 +342,7 @@ Here is the call graph for this function:
static void tests ( - math::ncr_modulo_p::NCRModuloP ncrObj) + ) @@ -217,26 +353,43 @@ Here is the call graph for this function:
-

Test implementations.

-
Parameters
- - -
ncrObjobject which contains the precomputed factorial values and ncr function
-
-
-
Returns
void
-
124 {
-
125 // (52323 C 26161) % (1e9 + 7) = 224944353
-
126 assert(ncrObj.ncr(52323, 26161, 1000000007) == 224944353);
-
127 // 6 C 2 = 30, 30%5 = 0
-
128 assert(ncrObj.ncr(6, 2, 5) == 0);
-
129 // 7C3 = 35, 35 % 29 = 8
-
130 assert(ncrObj.ncr(7, 3, 29) == 6);
-
131}
+

tests math::ncr_modulo_p::NCRModuloP

+
142 {
+
143 struct TestCase {
+
144 const int64_t size;
+
145 const int64_t p;
+
146 const int64_t n;
+
147 const int64_t r;
+
148 const int64_t expected;
+
149
+
150 TestCase(const int64_t size, const int64_t p, const int64_t n,
+
151 const int64_t r, const int64_t expected)
+
152 : size(size), p(p), n(n), r(r), expected(expected) {}
+
153 };
+
154 const std::vector<TestCase> test_cases = {
+
155 TestCase(60000, 1000000007, 52323, 26161, 224944353),
+
156 TestCase(20, 5, 6, 2, 30 % 5),
+
157 TestCase(100, 29, 7, 3, 35 % 29),
+
158 TestCase(1000, 13, 10, 3, 120 % 13),
+
159 TestCase(20, 17, 1, 10, 0),
+
160 TestCase(45, 19, 23, 1, 23 % 19),
+
161 TestCase(45, 19, 23, 0, 1),
+
162 TestCase(45, 19, 23, 23, 1),
+
163 TestCase(20, 9, 10, 2, -1)};
+
164 for (const auto& tc : test_cases) {
+
165 assert(math::ncr_modulo_p::NCRModuloP(tc.size, tc.p).ncr(tc.n, tc.r) ==
+
166 tc.expected);
+
167 }
+
168
+
169 std::cout << "\n\nAll tests have successfully passed!\n";
+
170}
+
int64_t ncr(const int64_t &n, const int64_t &r) const
computes nCr % p
Definition ncr_modulo_p.cpp:116
+
represents single example inputs and expected output of the function longest_common_string_length
Definition longest_common_string.cpp:54
+
Here is the call graph for this function:
-
+
diff --git a/de/dab/ncr__modulo__p_8cpp.js b/de/dab/ncr__modulo__p_8cpp.js index d539e73f3..812411e71 100644 --- a/de/dab/ncr__modulo__p_8cpp.js +++ b/de/dab/ncr__modulo__p_8cpp.js @@ -1,6 +1,8 @@ var ncr__modulo__p_8cpp = [ [ "math::ncr_modulo_p::NCRModuloP", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p" ], - [ "main", "de/dab/ncr__modulo__p_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "tests", "de/dab/ncr__modulo__p_8cpp.html#af0a3e6827f41c151e47451f5ff98b1f1", null ] + [ "example", "de/dab/ncr__modulo__p_8cpp.html#afa2b50f4716fc3b42221a72e676e1422", null ], + [ "gcdExtended", "de/dab/ncr__modulo__p_8cpp.html#a9010ad5669d31449c3bf3271ab5ebc86", null ], + [ "modInverse", "de/dab/ncr__modulo__p_8cpp.html#a6c7bfe3bdaa086d32261a5c5584d0fa9", null ], + [ "tests", "de/dab/ncr__modulo__p_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e", null ] ]; \ No newline at end of file diff --git a/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.map b/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.map new file mode 100644 index 000000000..f41266ef4 --- /dev/null +++ b/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.md5 b/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.md5 new file mode 100644 index 000000000..bd2141301 --- /dev/null +++ b/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.md5 @@ -0,0 +1 @@ +ec67b7f0511b8bc24ff7b08d968d95ab \ No newline at end of file diff --git a/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.svg b/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.svg new file mode 100644 index 000000000..8852bcb7b --- /dev/null +++ b/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + +tests + + +Node1 + + +tests + + + + + +Node2 + + +math::ncr_modulo_p +::NCRModuloP::ncr + + + + + +Node1->Node2 + + + + + + + + + + + + + diff --git a/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph_org.svg b/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph_org.svg new file mode 100644 index 000000000..8326290db --- /dev/null +++ b/de/dab/ncr__modulo__p_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph_org.svg @@ -0,0 +1,40 @@ + + + + + + +tests + + +Node1 + + +tests + + + + + +Node2 + + +math::ncr_modulo_p +::NCRModuloP::ncr + + + + + +Node1->Node2 + + + + + + + + diff --git a/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.map b/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.map new file mode 100644 index 000000000..8dfe7ecf7 --- /dev/null +++ b/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.md5 b/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.md5 new file mode 100644 index 000000000..5cb077109 --- /dev/null +++ b/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.md5 @@ -0,0 +1 @@ +1a4f0a265ffd31483084966d366feec6 \ No newline at end of file diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.svg b/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.svg similarity index 50% rename from d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.svg rename to de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.svg index 9b87952d7..7139cdcfe 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.svg +++ b/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph.svg @@ -3,9 +3,9 @@ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> - - + + @@ -18,24 +18,33 @@ -math::ncr_modulo_p::NCRModuloP::modInverse +math::ncr_modulo_p::utils::modInverse Node1 - + math::ncr_modulo_p -::NCRModuloP::modInverse +::utils::modInverse + + + + + +Node1->Node1 + + + Node2 - - -math::ncr_modulo_p -::NCRModuloP::gcdExtended + + +math::ncr_modulo_p +::utils::gcdExtended @@ -43,8 +52,8 @@ Node1->Node2 - - + + @@ -52,8 +61,8 @@ Node2->Node2 - - + + @@ -61,8 +70,8 @@ Node3 - -gcd + +gcd @@ -70,8 +79,8 @@ Node2->Node3 - - + + diff --git a/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph_org.svg b/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph_org.svg new file mode 100644 index 000000000..49119a3ae --- /dev/null +++ b/de/dab/ncr__modulo__p_8cpp_a6c7bfe3bdaa086d32261a5c5584d0fa9_cgraph_org.svg @@ -0,0 +1,77 @@ + + + + + + +math::ncr_modulo_p::utils::modInverse + + +Node1 + + +math::ncr_modulo_p +::utils::modInverse + + + + + +Node1->Node1 + + + + + + + + +Node2 + + +math::ncr_modulo_p +::utils::gcdExtended + + + + + +Node1->Node2 + + + + + + + + +Node2->Node2 + + + + + + + + +Node3 + + +gcd + + + + + +Node2->Node3 + + + + + + + + diff --git a/de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.map b/de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.map new file mode 100644 index 000000000..9c74eae12 --- /dev/null +++ b/de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.md5 b/de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.md5 new file mode 100644 index 000000000..b8480c416 --- /dev/null +++ b/de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.md5 @@ -0,0 +1 @@ +ba3da75994498c1bdb1f6cc36a33fadf \ No newline at end of file diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.svg b/de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.svg similarity index 63% rename from d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.svg rename to de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.svg index 9cbcc2f00..b2392fada 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph.svg +++ b/de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph.svg @@ -3,9 +3,9 @@ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> - - + + @@ -18,14 +18,14 @@ -math::ncr_modulo_p::NCRModuloP::gcdExtended +math::ncr_modulo_p::utils::gcdExtended Node1 - - + + math::ncr_modulo_p -::NCRModuloP::gcdExtended +::utils::gcdExtended @@ -33,8 +33,8 @@ Node1->Node1 - - + + @@ -42,8 +42,8 @@ Node2 - -gcd + +gcd @@ -51,8 +51,8 @@ Node1->Node2 - - + + diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph_org.svg b/de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph_org.svg similarity index 51% rename from d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph_org.svg rename to de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph_org.svg index 7d82111f8..b1d911018 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_afde201f4687740454302c444f507a926_cgraph_org.svg +++ b/de/dab/ncr__modulo__p_8cpp_a9010ad5669d31449c3bf3271ab5ebc86_cgraph_org.svg @@ -3,18 +3,18 @@ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> - - + + -math::ncr_modulo_p::NCRModuloP::gcdExtended +math::ncr_modulo_p::utils::gcdExtended Node1 - - + + math::ncr_modulo_p -::NCRModuloP::gcdExtended +::utils::gcdExtended @@ -22,8 +22,8 @@ Node1->Node1 - - + + @@ -31,8 +31,8 @@ Node2 - -gcd + +gcd @@ -40,8 +40,8 @@ Node1->Node2 - - + + diff --git a/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map deleted file mode 100644 index fee44b9b0..000000000 --- a/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 deleted file mode 100644 index 7ff52b0cb..000000000 --- a/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -afda47681566cb929ac8335b91ba8353 \ No newline at end of file diff --git a/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg deleted file mode 100644 index 061207347..000000000 --- a/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -main - - -Node1 - - -main - - - - - -Node2 - - -math::ncr_modulo_p -::NCRModuloP::ncr - - - - - -Node1->Node2 - - - - - - - - -Node3 - - -math::ncr_modulo_p -::NCRModuloP::modInverse - - - - - -Node2->Node3 - - - - - - - - -Node4 - - -math::ncr_modulo_p -::NCRModuloP::gcdExtended - - - - - -Node3->Node4 - - - - - - - - -Node4->Node4 - - - - - - - - -Node5 - - -gcd - - - - - -Node4->Node5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg b/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg deleted file mode 100644 index 026838667..000000000 --- a/de/dab/ncr__modulo__p_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - -main - - -Node1 - - -main - - - - - -Node2 - - -math::ncr_modulo_p -::NCRModuloP::ncr - - - - - -Node1->Node2 - - - - - - - - -Node3 - - -math::ncr_modulo_p -::NCRModuloP::modInverse - - - - - -Node2->Node3 - - - - - - - - -Node4 - - -math::ncr_modulo_p -::NCRModuloP::gcdExtended - - - - - -Node3->Node4 - - - - - - - - -Node4->Node4 - - - - - - - - -Node5 - - -gcd - - - - - -Node4->Node5 - - - - - - - - diff --git a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.map b/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.map deleted file mode 100644 index 8a7982dcb..000000000 --- a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.map +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.md5 b/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.md5 deleted file mode 100644 index 42c565649..000000000 --- a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -2cc016bbb48cae071e8a751a9517bc3b \ No newline at end of file diff --git a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.svg b/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.svg deleted file mode 100644 index b2ebe0ad4..000000000 --- a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.svg +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -tests - - -Node1 - - -tests - - - - - -Node2 - - -math::ncr_modulo_p -::NCRModuloP::ncr - - - - - -Node1->Node2 - - - - - - - - -Node3 - - -math::ncr_modulo_p -::NCRModuloP::modInverse - - - - - -Node2->Node3 - - - - - - - - -Node4 - - -math::ncr_modulo_p -::NCRModuloP::gcdExtended - - - - - -Node3->Node4 - - - - - - - - -Node4->Node4 - - - - - - - - -Node5 - - -gcd - - - - - -Node4->Node5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph_org.svg b/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph_org.svg deleted file mode 100644 index 63c5b5f7a..000000000 --- a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph_org.svg +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - -tests - - -Node1 - - -tests - - - - - -Node2 - - -math::ncr_modulo_p -::NCRModuloP::ncr - - - - - -Node1->Node2 - - - - - - - - -Node3 - - -math::ncr_modulo_p -::NCRModuloP::modInverse - - - - - -Node2->Node3 - - - - - - - - -Node4 - - -math::ncr_modulo_p -::NCRModuloP::gcdExtended - - - - - -Node3->Node4 - - - - - - - - -Node4->Node4 - - - - - - - - -Node5 - - -gcd - - - - - -Node4->Node5 - - - - - - - - diff --git a/doxygen_crawl.html b/doxygen_crawl.html index 2628f7c5e..78c8d5e7f 100644 --- a/doxygen_crawl.html +++ b/doxygen_crawl.html @@ -669,6 +669,7 @@ + @@ -2130,6 +2131,7 @@ + @@ -2162,11 +2164,10 @@ - - - - - + + + + @@ -2676,6 +2677,8 @@ + + @@ -3696,8 +3699,10 @@ - - + + + + diff --git a/functions_c.html b/functions_c.html index fe2bd34c3..8687a0a0a 100644 --- a/functions_c.html +++ b/functions_c.html @@ -122,6 +122,7 @@ $(function(){initNavTree('functions_c.html',''); initResizable(true); });
  • comb() : data_structures::SegmentTree< T >
  • combine() : range_queries::heavy_light_decomposition::SG< X >
  • Complex() : Complex
  • +
  • computeFactorialsMod() : math::ncr_modulo_p::NCRModuloP
  • construct() : range_queries::perSegTree
  • Contains() : data_structures::tree_234::Node
  • contains() : binary_search_tree< T >, data_structures::Bitset, data_structures::BloomFilter< T >
  • diff --git a/functions_f.html b/functions_f.html index 3255af9b0..2bcee1022 100644 --- a/functions_f.html +++ b/functions_f.html @@ -107,6 +107,7 @@ $(function(){initNavTree('functions_f.html',''); initResizable(true); });
    Here is a list of all documented class members with links to the class documentation for each member:

    - f -

    diff --git a/functions_func_n.html b/functions_func_n.html index 41b98adf8..5b9094ba0 100644 --- a/functions_func_n.html +++ b/functions_func_n.html @@ -108,8 +108,8 @@ $(function(){initNavTree('functions_func_n.html',''); initResizable(true); });

    - n -