From b98db53ab4ca1496ef01bbfaaff602efa09d0199 Mon Sep 17 00:00:00 2001 From: realstealthninja Date: Mon, 21 Oct 2024 13:23:10 +0000 Subject: [PATCH] Documentation for 37a98113724205f66d2f92adb784a34c44553c2b --- ...se__fermat__little__theorem_8cpp__incl.map | 12 +- ...se__fermat__little__theorem_8cpp__incl.md5 | 2 +- ...se__fermat__little__theorem_8cpp__incl.svg | 44 +- ...fermat__little__theorem_8cpp__incl_org.svg | 44 +- d7/d50/namespacemodular__inverse__fermat.html | 125 +++++ ...inverse__fermat__little__theorem_8cpp.html | 283 +++++++--- ...__inverse__fermat__little__theorem_8cpp.js | 8 +- ...c62a87e79f29b98d8fe5b12eacdd928_cgraph.map | 6 + ...c62a87e79f29b98d8fe5b12eacdd928_cgraph.md5 | 1 + ...c62a87e79f29b98d8fe5b12eacdd928_cgraph.svg | 75 +++ ...87e79f29b98d8fe5b12eacdd928_cgraph_org.svg | 49 ++ ...a4929409fee35c3cb559e962a544b3e_cgraph.map | 4 + ...a4929409fee35c3cb559e962a544b3e_cgraph.md5 | 1 + ...a4929409fee35c3cb559e962a544b3e_cgraph.svg | 57 ++ ...9409fee35c3cb559e962a544b3e_cgraph_org.svg | 31 ++ ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 10 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 58 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 58 +- ...7e807e02c65c6fffd6162b4c66290c2_cgraph.map | 10 + ...7e807e02c65c6fffd6162b4c66290c2_cgraph.md5 | 1 + ...7e807e02c65c6fffd6162b4c66290c2_cgraph.svg | 112 ++++ ...7e02c65c6fffd6162b4c66290c2_cgraph_org.svg | 86 +++ dd/d47/namespacemath.html | 3 + doxygen_crawl.html | 11 +- globals_b.html | 2 +- globals_func_b.html | 2 +- globals_func_i.html | 1 - globals_func_t.html | 2 +- globals_i.html | 1 - globals_t.html | 2 +- namespaces.html | 135 ++--- namespaces_dup.js | 1 + navtreedata.js | 16 +- navtreeindex0.js | 496 ++++++++--------- navtreeindex1.js | 500 +++++++++--------- navtreeindex10.js | 38 +- navtreeindex11.js | 14 +- navtreeindex12.js | 20 +- navtreeindex13.js | 44 +- navtreeindex14.js | 54 +- navtreeindex15.js | 3 + navtreeindex2.js | 100 ++-- navtreeindex3.js | 24 +- navtreeindex4.js | 20 +- navtreeindex5.js | 38 +- navtreeindex6.js | 48 +- navtreeindex7.js | 40 +- navtreeindex8.js | 58 +- navtreeindex9.js | 50 +- search/all_12.js | 58 +- search/all_19.js | 2 +- search/all_7.js | 2 +- search/all_e.js | 2 +- search/functions_14.js | 2 +- search/functions_2.js | 2 +- search/functions_9.js | 2 +- search/functions_d.js | 31 +- search/namespaces_c.js | 5 +- 59 files changed, 1786 insertions(+), 1122 deletions(-) create mode 100644 d7/d50/namespacemodular__inverse__fermat.html create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.map create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.md5 create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.svg create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph_org.svg create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.map create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.md5 create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.svg create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph_org.svg create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.map create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.md5 create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.svg create mode 100644 d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph_org.svg diff --git a/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.map b/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.map index 2d09cdf4f..7d766a72b 100644 --- a/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.map +++ b/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.map @@ -1,7 +1,9 @@ - - - - - + + + + + + + diff --git a/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.md5 b/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.md5 index 6ea75e3c2..650a78eb5 100644 --- a/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.md5 +++ b/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.md5 @@ -1 +1 @@ -62765084653e18adcb37ceef2bdd2163 \ No newline at end of file +b57f4879813954ad46b5ec86c896aa3a \ No newline at end of file diff --git a/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.svg b/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.svg index 8a3bae120..6a167e5e0 100644 --- a/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.svg +++ b/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl.svg @@ -4,8 +4,8 @@ - + @@ -23,9 +23,9 @@ Node1 - -math/modular_inverse -_fermat_little_theorem.cpp + +math/modular_inverse +_fermat_little_theorem.cpp @@ -33,8 +33,8 @@ Node2 - -iostream + +cassert @@ -42,8 +42,8 @@ Node1->Node2 - - + + @@ -51,8 +51,8 @@ Node3 - -vector + +cstdint @@ -60,8 +60,26 @@ Node1->Node3 - - + + + + + + + +Node4 + + +iostream + + + + + +Node1->Node4 + + + diff --git a/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl_org.svg b/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl_org.svg index fa0eca44d..e43a0d8cd 100644 --- a/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl_org.svg +++ b/d3/d1e/modular__inverse__fermat__little__theorem_8cpp__incl_org.svg @@ -4,17 +4,17 @@ - + math/modular_inverse_fermat_little_theorem.cpp Node1 - -math/modular_inverse -_fermat_little_theorem.cpp + +math/modular_inverse +_fermat_little_theorem.cpp @@ -22,8 +22,8 @@ Node2 - -iostream + +cassert @@ -31,8 +31,8 @@ Node1->Node2 - - + + @@ -40,8 +40,8 @@ Node3 - -vector + +cstdint @@ -49,8 +49,26 @@ Node1->Node3 - - + + + + + + + +Node4 + + +iostream + + + + + +Node1->Node4 + + + diff --git a/d7/d50/namespacemodular__inverse__fermat.html b/d7/d50/namespacemodular__inverse__fermat.html new file mode 100644 index 000000000..b885ae2db --- /dev/null +++ b/d7/d50/namespacemodular__inverse__fermat.html @@ -0,0 +1,125 @@ + + + + + + + +Algorithms_in_C++: modular_inverse_fermat Namespace Reference + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C++ 1.0.0 +
+
Set of algorithms implemented in C++.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
modular_inverse_fermat Namespace Reference
+
+
+ +

Calculate modular inverse using Fermat's Little Theorem. +More...

+

Detailed Description

+

Calculate modular inverse using Fermat's Little Theorem.

+
+
+ + + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp.html b/d8/d53/modular__inverse__fermat__little__theorem_8cpp.html index 1c5feeaaa..34afa6e66 100644 --- a/d8/d53/modular__inverse__fermat__little__theorem_8cpp.html +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp.html @@ -105,6 +105,7 @@ $(function(){initNavTree('d8/d53/modular__inverse__fermat__little__theorem_8cpp.
modular_inverse_fermat_little_theorem.cpp File Reference
@@ -112,21 +113,40 @@ $(function(){initNavTree('d8/d53/modular__inverse__fermat__little__theorem_8cpp.

C++ Program to find the modular inverse using Fermat's Little Theorem More...

-
#include <iostream>
-#include <vector>
+
#include <cassert>
+#include <cstdint>
+#include <iostream>
Include dependency graph for modular_inverse_fermat_little_theorem.cpp:
-
+
+ + + + + + + +

+Namespaces

namespace  math
 for IO operations
 
namespace  modular_inverse_fermat
 Calculate modular inverse using Fermat's Little Theorem.
 
- - - - + + + + + + + + + + + + +

Functions

int64_t binExpo (int64_t a, int64_t b, int64_t m)
 
bool isPrime (int64_t m)
 
std::int64_t math::modular_inverse_fermat::binExpo (std::int64_t a, std::int64_t b, std::int64_t m)
 Calculate exponent with modulo using binary exponentiation in \(O(\log b)\) time.
 
bool math::modular_inverse_fermat::isPrime (std::int64_t m)
 Check if an integer is a prime number in \(O(\sqrt{m})\) time.
 
std::int64_t math::modular_inverse_fermat::modular_inverse (std::int64_t a, std::int64_t m)
 calculates the modular inverse.
 
static void test ()
 Self-test implementation.
 
int main ()
 Main function.
 

Detailed Description

@@ -153,7 +173,7 @@ Functions a^{m-2} &≡& a^{-1} \;\text{mod}\; m \end{eqnarray*}

-

We will find the exponent using binary exponentiation. Such that the algorithm works in \(O(\log m)\) time.

+

We will find the exponent using binary exponentiation such that the algorithm works in \(O(\log n)\) time.

Examples: -

Function Documentation

- -

◆ binExpo()

+ +

◆ binExpo()

- + - + - + - +
int64_t binExpo std::int64_t math::modular_inverse_fermat::binExpo (int64_t a, std::int64_t a,
int64_t b, std::int64_t b,
int64_t m )std::int64_t m )
-

Recursive function to calculate exponent in \(O(\log n)\) using binary exponent.

-
52 {
-
53 a %= m;
-
54 int64_t res = 1;
-
55 while (b > 0) {
-
56 if (b % 2) {
-
57 res = res * a % m;
-
58 }
-
59 a = a * a % m;
-
60 // Dividing b by 2 is similar to right shift.
-
61 b >>= 1;
-
62 }
-
63 return res;
-
64}
-
-
-
- -

◆ isPrime()

-
-
- - - - - - - -
bool isPrime (int64_t m)
-
-

Prime check in \(O(\sqrt{m})\) time.

-
68 {
-
69 if (m <= 1) {
-
70 return false;
-
71 } else {
-
72 for (int64_t i = 2; i * i <= m; i++) {
-
73 if (m % i == 0) {
-
74 return false;
-
75 }
-
76 }
-
77 }
-
78 return true;
+

Calculate exponent with modulo using binary exponentiation in \(O(\log b)\) time.

+
Parameters
+ + + + +
aThe base
bThe exponent
mThe modulo
+
+
+
Returns
The result of \(a^{b} % m\)
+
67 {
+
68 a %= m;
+
69 std::int64_t res = 1;
+
70 while (b > 0) {
+
71 if (b % 2 != 0) {
+
72 res = res * a % m;
+
73 }
+
74 a = a * a % m;
+
75 // Dividing b by 2 is similar to right shift by 1 bit
+
76 b >>= 1;
+
77 }
+
78 return res;
79}
-
+ +
+Here is the call graph for this function:
+
+
+
+ +
+
+ +

◆ isPrime()

+ +
+
+ + + + + + + +
bool math::modular_inverse_fermat::isPrime (std::int64_t m)
+
+ +

Check if an integer is a prime number in \(O(\sqrt{m})\) time.

+
Parameters
+ + +
mAn intger to check for primality
+
+
+
Returns
true if the number is prime
+
+false if the number is not prime
+
86 {
+
87 if (m <= 1) {
+
88 return false;
+
89 }
+
90 for (std::int64_t i = 2; i * i <= m; i++) {
+
91 if (m % i == 0) {
+
92 return false;
+
93 }
+
94 }
+
95 return true;
+
96}
+
+Here is the call graph for this function:
+
+
+
+
@@ -245,33 +295,108 @@ Hence, \(3^{-1} \;\text{mod}\; 7 = 5\) or \(3 \times 5 \;\text{mod}\; 7 = 1 \;\
-

Main function

-
84 {
-
85 int64_t a, m;
-
86 // Take input of a and m.
-
87 std::cout << "Computing ((a^(-1))%(m)) using Fermat's Little Theorem";
- -
89 std::cout << "Give input 'a' and 'm' space separated : ";
-
90 std::cin >> a >> m;
-
91 if (isPrime(m)) {
-
92 std::cout << "The modular inverse of a with mod m is (a^(m-2)) : ";
-
93 std::cout << binExpo(a, m - 2, m) << std::endl;
-
94 } else {
-
95 std::cout << "m must be a prime number.";
- -
97 }
-
98}
- - -
T endl(T... args)
-
bool isPrime(int64_t m)
Definition modular_inverse_fermat_little_theorem.cpp:68
-
int64_t binExpo(int64_t a, int64_t b, int64_t m)
Definition modular_inverse_fermat_little_theorem.cpp:52
+ +

Main function.

+
Returns
0 on exit
+
137 {
+
138 test(); // run self-test implementation
+
139 return 0;
+
140}
+
static void test()
Self-test implementation.
Definition modular_inverse_fermat_little_theorem.cpp:122
Here is the call graph for this function:
-
+
+
+
+ +

◆ modular_inverse()

+ +
+
+ + + + + + + + + + + +
std::int64_t math::modular_inverse_fermat::modular_inverse (std::int64_t a,
std::int64_t m )
+
+ +

calculates the modular inverse.

+
Parameters
+ + + +
aInteger value for the base
mInteger value for modulo
+
+
+
Returns
The result that is the modular inverse of a modulo m
+
103 {
+
104 while (a < 0) {
+
105 a += m;
+
106 }
+
107
+
108 // Check for invalid cases
+
109 if (!isPrime(m) || a == 0) {
+
110 return -1; // Invalid input
+
111 }
+
112
+
113 return binExpo(a, m - 2, m); // Fermat's Little Theorem
+
114}
+
int binExpo(int a, int b)
Definition binary_exponent.cpp:28
+
bool isPrime(std::int64_t m)
Check if an integer is a prime number in time.
Definition modular_inverse_fermat_little_theorem.cpp:86
+
+Here is the call graph for this function:
+
+
+
+ +
+
+ +

◆ test()

+ +
+
+ + + + + +
+ + + + + + + +
static void test ()
+
+static
+
+ +

Self-test implementation.

+
Returns
void
+
122 {
+
123 assert(math::modular_inverse_fermat::modular_inverse(0, 97) == -1);
+
124 assert(math::modular_inverse_fermat::modular_inverse(15, -2) == -1);
+
125 assert(math::modular_inverse_fermat::modular_inverse(3, 10) == -1);
+
126 assert(math::modular_inverse_fermat::modular_inverse(3, 7) == 5);
+
127 assert(math::modular_inverse_fermat::modular_inverse(1, 101) == 1);
+
128 assert(math::modular_inverse_fermat::modular_inverse(-1337, 285179) == 165519);
+
129 assert(math::modular_inverse_fermat::modular_inverse(123456789, 998244353) == 25170271);
+
130 assert(math::modular_inverse_fermat::modular_inverse(-9876543210, 1000000007) == 784794281);
+
131}
+
diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp.js b/d8/d53/modular__inverse__fermat__little__theorem_8cpp.js index c9d83f270..2c322fcfc 100644 --- a/d8/d53/modular__inverse__fermat__little__theorem_8cpp.js +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp.js @@ -1,6 +1,8 @@ var modular__inverse__fermat__little__theorem_8cpp = [ - [ "binExpo", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a4c6eefd1254eab3e8d34bf02c205e0f4", null ], - [ "isPrime", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a09660096b134753128952246f4f4e4bd", null ], - [ "main", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] + [ "binExpo", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#a1c62a87e79f29b98d8fe5b12eacdd928", null ], + [ "isPrime", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#aba4929409fee35c3cb559e962a544b3e", null ], + [ "main", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "modular_inverse", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#ae7e807e02c65c6fffd6162b4c66290c2", null ], + [ "test", "d8/d53/modular__inverse__fermat__little__theorem_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.map b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.map new file mode 100644 index 000000000..774e09c30 --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.md5 b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.md5 new file mode 100644 index 000000000..955880f8e --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.md5 @@ -0,0 +1 @@ +ffd05ce4440be176113734b51fcbbe0c \ No newline at end of file diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.svg b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.svg new file mode 100644 index 000000000..5a633b0ca --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + +math::modular_inverse_fermat::binExpo + + +Node1 + + +math::modular_inverse +_fermat::binExpo + + + + + +Node2 + + +binExpo + + + + + +Node1->Node2 + + + + + + + + +Node2->Node2 + + + + + + + + + + + + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph_org.svg b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph_org.svg new file mode 100644 index 000000000..9516f1cb9 --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_a1c62a87e79f29b98d8fe5b12eacdd928_cgraph_org.svg @@ -0,0 +1,49 @@ + + + + + + +math::modular_inverse_fermat::binExpo + + +Node1 + + +math::modular_inverse +_fermat::binExpo + + + + + +Node2 + + +binExpo + + + + + +Node1->Node2 + + + + + + + + +Node2->Node2 + + + + + + + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.map b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.map new file mode 100644 index 000000000..efc5f5452 --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.md5 b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.md5 new file mode 100644 index 000000000..a15166611 --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.md5 @@ -0,0 +1 @@ +6bc11f0296ee2fc351d4f5cb6f0ca359 \ No newline at end of file diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.svg b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.svg new file mode 100644 index 000000000..66becdceb --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + +math::modular_inverse_fermat::isPrime + + +Node1 + + +math::modular_inverse +_fermat::isPrime + + + + + +Node1->Node1 + + + + + + + + + + + + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph_org.svg b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph_org.svg new file mode 100644 index 000000000..02a240df9 --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_aba4929409fee35c3cb559e962a544b3e_cgraph_org.svg @@ -0,0 +1,31 @@ + + + + + + +math::modular_inverse_fermat::isPrime + + +Node1 + + +math::modular_inverse +_fermat::isPrime + + + + + +Node1->Node1 + + + + + + + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index dd8a1551c..a62ccb083 100644 --- a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,9 +1,5 @@ - - - - - - - + + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index fc1593dbf..0e95d81d4 100644 --- a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -56ec41e0c570e465d9b60d882058e4d7 \ No newline at end of file +7c26bf167d094d5e36710e1d61d5adb7 \ No newline at end of file diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index f2c936315..3a23c85f7 100644 --- a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -4,8 +4,8 @@ - + @@ -17,23 +17,23 @@ ]]> - + main Node1 - - -main + + +main Node2 - - -binExpo + + +test @@ -41,44 +41,8 @@ Node1->Node2 - - - - - - - -Node3 - - -std::endl - - - - - -Node1->Node3 - - - - - - - - -Node4 - - -isPrime - - - - - -Node1->Node4 - - - + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg index 487486443..4e1bcad16 100644 --- a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg @@ -4,25 +4,25 @@ - - + + main Node1 - - -main + + +main Node2 - - -binExpo + + +test @@ -30,44 +30,8 @@ Node1->Node2 - - - - - - - -Node3 - - -std::endl - - - - - -Node1->Node3 - - - - - - - - -Node4 - - -isPrime - - - - - -Node1->Node4 - - - + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.map b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.map new file mode 100644 index 000000000..0177d728b --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.map @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.md5 b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.md5 new file mode 100644 index 000000000..ff74585e1 --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.md5 @@ -0,0 +1 @@ +cebe99d531236e9949a4458c0aa57b4e \ No newline at end of file diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.svg b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.svg new file mode 100644 index 000000000..35c192184 --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + +math::modular_inverse_fermat::modular_inverse + + +Node1 + + +math::modular_inverse +_fermat::modular_inverse + + + + + +Node1->Node1 + + + + + + + + +Node2 + + +binExpo + + + + + +Node1->Node2 + + + + + + + + +Node3 + + +math::modular_inverse +_fermat::isPrime + + + + + +Node1->Node3 + + + + + + + + +Node2->Node2 + + + + + + + + +Node3->Node3 + + + + + + + + + + + + + diff --git a/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph_org.svg b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph_org.svg new file mode 100644 index 000000000..9ac5aa94f --- /dev/null +++ b/d8/d53/modular__inverse__fermat__little__theorem_8cpp_ae7e807e02c65c6fffd6162b4c66290c2_cgraph_org.svg @@ -0,0 +1,86 @@ + + + + + + +math::modular_inverse_fermat::modular_inverse + + +Node1 + + +math::modular_inverse +_fermat::modular_inverse + + + + + +Node1->Node1 + + + + + + + + +Node2 + + +binExpo + + + + + +Node1->Node2 + + + + + + + + +Node3 + + +math::modular_inverse +_fermat::isPrime + + + + + +Node1->Node3 + + + + + + + + +Node2->Node2 + + + + + + + + +Node3->Node3 + + + + + + + + diff --git a/dd/d47/namespacemath.html b/dd/d47/namespacemath.html index 457d7fa9f..07e168ba4 100644 --- a/dd/d47/namespacemath.html +++ b/dd/d47/namespacemath.html @@ -284,6 +284,7 @@ Functions

for IO operations

for std::cin and std::cout

std::cout

+

for IO implementations

for io operations

Evaluate recurrence relation using matrix exponentiation.

Math algorithms.

@@ -319,6 +320,8 @@ Algorithm

This problem can be solved using matrix exponentiation method.

See also
here for simple number exponentiation algorithm or explaination here.
Author
Ashish Daulatabad for assert for IO operations for std::vector STL

Mathematical algorithms

+

for assert for std::int64_t

+

Maths algorithms.

for assert for std::cout

Mathematical algorithms

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

diff --git a/doxygen_crawl.html b/doxygen_crawl.html index ff3633aaf..d2640dfcb 100644 --- a/doxygen_crawl.html +++ b/doxygen_crawl.html @@ -582,6 +582,7 @@ + @@ -2327,6 +2328,7 @@ + @@ -2445,9 +2447,11 @@ - - + + + + @@ -3188,6 +3192,9 @@ + + + diff --git a/globals_b.html b/globals_b.html index 1f879fa18..ddb2e86a3 100644 --- a/globals_b.html +++ b/globals_b.html @@ -110,7 +110,7 @@ $(function(){initNavTree('globals_b.html',''); initResizable(true); });
  • bayes_AgivenB() : bayes_theorem.cpp
  • bayes_BgivenA() : bayes_theorem.cpp
  • binary_s() : exponential_search.cpp
  • -
  • binExpo() : binary_exponent.cpp, modular_inverse_fermat_little_theorem.cpp
  • +
  • binExpo() : binary_exponent.cpp
  • binExpo_alt() : binary_exponent.cpp
  • binomial_expected() : binomial_dist.cpp
  • binomial_range_successes() : binomial_dist.cpp
  • diff --git a/globals_func_b.html b/globals_func_b.html index 3328dfb1b..74a2da0a6 100644 --- a/globals_func_b.html +++ b/globals_func_b.html @@ -110,7 +110,7 @@ $(function(){initNavTree('globals_func_b.html',''); initResizable(true); });
  • bayes_AgivenB() : bayes_theorem.cpp
  • bayes_BgivenA() : bayes_theorem.cpp
  • binary_s() : exponential_search.cpp
  • -
  • binExpo() : binary_exponent.cpp, modular_inverse_fermat_little_theorem.cpp
  • +
  • binExpo() : binary_exponent.cpp
  • binExpo_alt() : binary_exponent.cpp
  • binomial_expected() : binomial_dist.cpp
  • binomial_range_successes() : binomial_dist.cpp
  • diff --git a/globals_func_i.html b/globals_func_i.html index fa15d3412..0dbc53315 100644 --- a/globals_func_i.html +++ b/globals_func_i.html @@ -116,7 +116,6 @@ $(function(){initNavTree('globals_func_i.html',''); initResizable(true); });
  • is_happy() : happy_number.cpp
  • is_square() : ordinary_least_squares_regressor.cpp
  • IsPrime() : primality_test.cpp
  • -
  • isPrime() : modular_inverse_fermat_little_theorem.cpp
  • it_ternary_search() : ternary_search.cpp
  • diff --git a/globals_func_t.html b/globals_func_t.html index 543ee9589..340faaf54 100644 --- a/globals_func_t.html +++ b/globals_func_t.html @@ -108,7 +108,7 @@ $(function(){initNavTree('globals_func_t.html',''); initResizable(true); });

    - t -

    diff --git a/globals_t.html b/globals_t.html index bfaa8bf68..296abd7ad 100644 --- a/globals_t.html +++ b/globals_t.html @@ -108,7 +108,7 @@ $(function(){initNavTree('globals_t.html',''); initResizable(true); });

    - t -