diff --git a/annotated.html b/annotated.html index 02b6c8334..d86facf53 100644 --- a/annotated.html +++ b/annotated.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: Class List @@ -60,7 +60,7 @@ window.MathJax = { - + @@ -60,7 +60,7 @@ window.MathJax = { - +
@@ -120,23 +120,22 @@ $(function(){initNavTree('d7/d7f/section.html','../../'); initResizable(true); }
-
-
Prime factorization
+
+
vector< T >::iterator Class Reference
-

-

Prime Factorization is a very important and useful technique to factorize any number into its prime factors. It has various applications in the field of number theory.

-

The method of prime factorization involves two function calls. First: Calculating all the prime number up till a certain range using the standard Sieve of Eratosthenes.

-

Second: Using the prime numbers to reduce the the given number and thus find all its prime factors.

-

The complexity of the solution involves approx. O(n logn) in calculating sieve of eratosthenes O(log n) in calculating the prime factors of the number. So in total approx. O(n logn).

-

Requirements: For compile you need the compiler flag for C++ 11

-
-
+ +

STL iterator class. + More...

+

Detailed Description

+

STL iterator class.

+

The documentation for this class was generated from the following files:
diff --git a/d0/d08/realtime__stats_8cpp.html b/d0/d08/realtime__stats_8cpp.html index cf047d562..ed8849d42 100644 --- a/d0/d08/realtime__stats_8cpp.html +++ b/d0/d08/realtime__stats_8cpp.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: math/realtime_stats.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + diff --git a/d0/d3c/classvector__coll__graph_org.svg b/d0/d3c/classvector__coll__graph_org.svg new file mode 100644 index 000000000..e9ea31b01 --- /dev/null +++ b/d0/d3c/classvector__coll__graph_org.svg @@ -0,0 +1,40 @@ + + + + + + +vector< T > + + +Node1 + + +vector< T > + + + + + +Node2 + + +T + + + + + +Node2->Node1 + + + + + + elements + + + diff --git a/d0/d3e/classdata__structures_1_1trie.html b/d0/d3e/classdata__structures_1_1trie.html index a5804dde1..60bc17da4 100644 --- a/d0/d3e/classdata__structures_1_1trie.html +++ b/d0/d3e/classdata__structures_1_1trie.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: data_structures::trie Class Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
HKGraph Member List
+
+
+ +

This is the complete list of members for HKGraph, including all inherited members.

+ + + + + + + + + + + + + + + +
addEdge(int u, int v)HKGraph
adjHKGraphprivate
bfs()HKGraph
dfs(int u)HKGraph
distHKGraphprivate
HKGraph()HKGraph
HKGraph(int m, int n)HKGraph
hopcroftKarpAlgorithm()HKGraph
INF (defined in HKGraph)HKGraphprivate
mHKGraphprivate
nHKGraphprivate
NIL (defined in HKGraph)HKGraphprivate
pair_uHKGraphprivate
pair_vHKGraphprivate
+
+ + + + diff --git a/d0/df1/z__function_8cpp__incl.svg b/d0/df1/z__function_8cpp__incl.svg index 94038a7ed..26b95b7b6 100644 --- a/d0/df1/z__function_8cpp__incl.svg +++ b/d0/df1/z__function_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + TheAlgorithms/C++: abbreviation Namespace Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
tests::Node Member List
+
+
+ +

This is the complete list of members for tests::Node, including all inherited members.

+ + + + + +
datatests::Node
nexttests::Node
Node(int64_t _data)tests::Nodeinlineexplicit
Node(int64_t _data, Node *_next)tests::Nodeinlineexplicit
+
+ + + + diff --git a/d0/dfc/sqrt__double_8cpp__incl.svg b/d0/dfc/sqrt__double_8cpp__incl.svg index 340045a6f..61708010a 100644 --- a/d0/dfc/sqrt__double_8cpp__incl.svg +++ b/d0/dfc/sqrt__double_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - - - + TheAlgorithms/C++: linkedlist Struct Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
priority_queue< T > Class Template Reference
+
+
+ +

STL class. + More...

+
+Collaboration diagram for priority_queue< T >:
+
+
+
[legend]
+ + + + + +

+Public Attributes

+T elements
 STL member.
 
+

Detailed Description

+

STL class.

+

The documentation for this class was generated from the following files:
+
+ + + + diff --git a/d1/d1b/classpriority__queue.js b/d1/d1b/classpriority__queue.js new file mode 100644 index 000000000..81b929153 --- /dev/null +++ b/d1/d1b/classpriority__queue.js @@ -0,0 +1,4 @@ +var classpriority__queue = +[ + [ "elements", "d1/d1b/classpriority__queue.html#a4df2ae826d2b2caf4a6755adbd34a836", null ] +]; \ No newline at end of file diff --git a/d1/d1b/topological__sort__by__kahns__algo_8cpp_source.html b/d1/d1b/topological__sort__by__kahns__algo_8cpp_source.html index 6f597b867..e3725c53a 100644 --- a/d1/d1b/topological__sort__by__kahns__algo_8cpp_source.html +++ b/d1/d1b/topological__sort__by__kahns__algo_8cpp_source.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: graph/topological_sort_by_kahns_algo.cpp Source File @@ -60,7 +60,7 @@ window.MathJax = { - + + diff --git a/d1/d6c/classstats__computer1__coll__graph_org.svg b/d1/d6c/classstats__computer1__coll__graph_org.svg new file mode 100644 index 000000000..9db9970e3 --- /dev/null +++ b/d1/d6c/classstats__computer1__coll__graph_org.svg @@ -0,0 +1,40 @@ + + + + + + +stats_computer1< T > + + +Node1 + + +stats_computer1< T > + + + + + +Node2 + + +T + + + + + +Node2->Node1 + + + + + + K + + + diff --git a/d1/d6d/lru__cache_8cpp__incl.svg b/d1/d6d/lru__cache_8cpp__incl.svg index 40f4b470b..b87cf0179 100644 --- a/d1/d6d/lru__cache_8cpp__incl.svg +++ b/d1/d6d/lru__cache_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - - - + TheAlgorithms/C++: data_structures/cll/cll.cpp Source File @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
stats_computer1< T > Class Template Reference
+
+
+
+Collaboration diagram for stats_computer1< T >:
+
+
+
[legend]
+ + + + + + + + + + +

+Public Member Functions

void new_val (T x)
 
double mean () const
 
double variance () const
 
double std () const
 
+ + + + + + + + + +

+Private Attributes

unsigned int n = 0
 
double Ex
 
double Ex2
 
K
 
+ + + +

+Friends

std::istream & operator>> (std::istream &input, stats_computer1 &stat)
 
+

Detailed Description

+
template<typename T>
+class stats_computer1< T >

continuous mean and variance computance using first value as an approximation for the mean. If the first number is much far form the mean, the algorithm becomes very inaccurate to compute variance and standard deviation.

+ +

Definition at line 27 of file realtime_stats.cpp.

+

Member Function Documentation

+ +

◆ mean()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
double statistics::stats_computer1< T >::mean () const
+
+inline
+
+

return sample mean computed till last sample

+ +

Definition at line 42 of file realtime_stats.cpp.

+
42{ return K + Ex / n; }
+
+
+
+ +

◆ new_val()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
void statistics::stats_computer1< T >::new_val (T x)
+
+inline
+
+

Constructor

Parameters
+ + +
[in]xnew data sample
+
+
+ +

Definition at line 32 of file realtime_stats.cpp.

+
32 {
+
33 if (n == 0)
+
34 K = x;
+
35 n++;
+
36 T tmp = x - K;
+
37 Ex += tmp;
+
38 Ex2 += static_cast<double>(tmp) * tmp;
+
39 }
+ +
+
+
+ +

◆ std()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
double statistics::stats_computer1< T >::std () const
+
+inline
+
+

return sample standard deviation computed till last sample

+ +

Definition at line 48 of file realtime_stats.cpp.

+
48{ return std::sqrt(this->variance()); }
+ +
+
+
+ +

◆ variance()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
double statistics::stats_computer1< T >::variance () const
+
+inline
+
+

return data variance computed till last sample

+ +

Definition at line 45 of file realtime_stats.cpp.

+
45{ return (Ex2 - (Ex * Ex) / n) / (n - 1); }
+
+
+
+

Friends And Related Symbol Documentation

+ +

◆ operator>>

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + + + + + +
std::istream & operator>> (std::istream & input,
stats_computer1< T > & stat )
+
+friend
+
+

short-hand operator to read new sample from input stream
+ e.g.: std::cin >> stats1;

+ +

Definition at line 53 of file realtime_stats.cpp.

+
54 {
+
55 T val;
+
56 input >> val;
+ +
58 return input;
+
59 }
+ +
+
+
+

Member Data Documentation

+ +

◆ Ex

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
double statistics::stats_computer1< T >::Ex
+
+private
+
+ +

Definition at line 63 of file realtime_stats.cpp.

+ +
+
+ +

◆ Ex2

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
double statistics::stats_computer1< T >::Ex2
+
+private
+
+ +

Definition at line 63 of file realtime_stats.cpp.

+ +
+
+ +

◆ K

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
T statistics::stats_computer1< T >::K
+
+private
+
+ +

Definition at line 64 of file realtime_stats.cpp.

+ +
+
+ +

◆ n

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
unsigned int statistics::stats_computer1< T >::n = 0
+
+private
+
+ +

Definition at line 62 of file realtime_stats.cpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/d2/d0f/classstats__computer1.js b/d2/d0f/classstats__computer1.js new file mode 100644 index 000000000..0d224227f --- /dev/null +++ b/d2/d0f/classstats__computer1.js @@ -0,0 +1,8 @@ +var classstats__computer1 = +[ + [ "mean", "d2/d0f/classstats__computer1.html#a390697dcee210b91823ceff04b25081b", null ], + [ "new_val", "d2/d0f/classstats__computer1.html#aa13bf7c38de112f71921a5525d71a2f2", null ], + [ "std", "d2/d0f/classstats__computer1.html#af57e942d49f4fd70f059f224b4ac07e1", null ], + [ "variance", "d2/d0f/classstats__computer1.html#a27f0a03e2fd2254f1c81fe668226bd92", null ], + [ "operator>>", "d2/d0f/classstats__computer1.html#a350bf6c429691d3578c4dfc6679a0797", null ] +]; \ No newline at end of file diff --git a/d2/d1a/vigenere__cipher_8cpp__incl.svg b/d2/d1a/vigenere__cipher_8cpp__incl.svg index aa00c0059..ae309ee25 100644 --- a/d2/d1a/vigenere__cipher_8cpp__incl.svg +++ b/d2/d1a/vigenere__cipher_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + TheAlgorithms/C++: sorting/gnome_sort.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + diff --git a/d2/d77/classadaline__coll__graph_org.svg b/d2/d77/classadaline__coll__graph_org.svg new file mode 100644 index 000000000..30aa428dc --- /dev/null +++ b/d2/d77/classadaline__coll__graph_org.svg @@ -0,0 +1,40 @@ + + + + + + +adaline + + +Node1 + + +adaline + + + + + +Node2 + + +std::vector< double > + + + + + +Node2->Node1 + + + + + + weights + + + diff --git a/d2/d7d/egg__dropping__puzzle_8cpp_source.html b/d2/d7d/egg__dropping__puzzle_8cpp_source.html index 20e866a5b..0d3574a57 100644 --- a/d2/d7d/egg__dropping__puzzle_8cpp_source.html +++ b/d2/d7d/egg__dropping__puzzle_8cpp_source.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: dynamic_programming/egg_dropping_puzzle.cpp Source File @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
vector< T > Member List
+
+
+ +

This is the complete list of members for vector< T >, including all inherited members.

+ + +
elementsvector< T >
+
+ + + + diff --git a/d2/db9/structdata__structures_1_1treap_1_1_treap__coll__graph.svg b/d2/db9/structdata__structures_1_1treap_1_1_treap__coll__graph.svg index 257ec1c7c..202eed97b 100644 --- a/d2/db9/structdata__structures_1_1treap_1_1_treap__coll__graph.svg +++ b/d2/db9/structdata__structures_1_1treap_1_1_treap__coll__graph.svg @@ -1,7 +1,7 @@ - - - diff --git a/d2/dba/non__preemptive__sjf__scheduling_8cpp__incl_org.svg b/d2/dba/non__preemptive__sjf__scheduling_8cpp__incl_org.svg index 5dc553af6..b41a974b8 100644 --- a/d2/dba/non__preemptive__sjf__scheduling_8cpp__incl_org.svg +++ b/d2/dba/non__preemptive__sjf__scheduling_8cpp__incl_org.svg @@ -1,7 +1,7 @@ - - + TheAlgorithms/C++: stack_linkedList Class Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
unordered_set< K > Class Template Reference
+
+
+ +

STL class. + More...

+
+Collaboration diagram for unordered_set< K >:
+
+
+
[legend]
+ + + + + + + + + + + + + + +

+Classes

class  const_iterator
 STL iterator class. More...
 
class  const_reverse_iterator
 STL iterator class. More...
 
class  iterator
 STL iterator class. More...
 
class  reverse_iterator
 STL iterator class. More...
 
+ + + + +

+Public Attributes

+K keys
 STL member.
 
+

Detailed Description

+

STL class.

+

The documentation for this class was generated from the following files:
+
+ + + + diff --git a/d3/d6d/classunordered__set.js b/d3/d6d/classunordered__set.js new file mode 100644 index 000000000..bb359e750 --- /dev/null +++ b/d3/d6d/classunordered__set.js @@ -0,0 +1,8 @@ +var classunordered__set = +[ + [ "const_iterator", "da/d02/classunordered__set_1_1const__iterator.html", null ], + [ "const_reverse_iterator", "d7/d21/classunordered__set_1_1const__reverse__iterator.html", null ], + [ "iterator", "d9/d5e/classunordered__set_1_1iterator.html", null ], + [ "reverse_iterator", "dc/da8/classunordered__set_1_1reverse__iterator.html", null ], + [ "keys", "d3/d6d/classunordered__set.html#a9401ae48c5b80204409ee475f277cdb0", null ] +]; \ No newline at end of file diff --git a/d3/d6d/namespacesimpson__method.html b/d3/d6d/namespacesimpson__method.html index baf7fa55b..99c0ec678 100644 --- a/d3/d6d/namespacesimpson__method.html +++ b/d3/d6d/namespacesimpson__method.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: simpson_method Namespace Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
priority_queue< T > Member List
+
+
+ +

This is the complete list of members for priority_queue< T >, including all inherited members.

+ + +
elementspriority_queue< T >
+
+ + + + diff --git a/d3/dd7/md__c_o_d_e___o_f___c_o_n_d_u_c_t.html b/d3/dd7/md__c_o_d_e___o_f___c_o_n_d_u_c_t.html index 0435f10d7..84803f08b 100644 --- a/d3/dd7/md__c_o_d_e___o_f___c_o_n_d_u_c_t.html +++ b/d3/dd7/md__c_o_d_e___o_f___c_o_n_d_u_c_t.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: Contributor Covenant Code of Conduct @@ -60,7 +60,7 @@ window.MathJax = { - + + diff --git a/d4/d60/classunordered__set__coll__graph_org.svg b/d4/d60/classunordered__set__coll__graph_org.svg new file mode 100644 index 000000000..6b4138edc --- /dev/null +++ b/d4/d60/classunordered__set__coll__graph_org.svg @@ -0,0 +1,40 @@ + + + + + + +unordered_set< K > + + +Node1 + + +unordered_set< K > + + + + + +Node2 + + +K + + + + + +Node2->Node1 + + + + + + keys + + + diff --git a/d4/d60/kohonen__som__trace_8cpp__incl.svg b/d4/d60/kohonen__som__trace_8cpp__incl.svg index 9d879bca4..4ea53389e 100644 --- a/d4/d60/kohonen__som__trace_8cpp__incl.svg +++ b/d4/d60/kohonen__som__trace_8cpp__incl.svg @@ -1,7 +1,7 @@ - diff --git a/d4/d60/kohonen__som__trace_8cpp__incl_org.svg b/d4/d60/kohonen__som__trace_8cpp__incl_org.svg index 460131672..5badce242 100644 --- a/d4/d60/kohonen__som__trace_8cpp__incl_org.svg +++ b/d4/d60/kohonen__som__trace_8cpp__incl_org.svg @@ -1,7 +1,7 @@ - - + TheAlgorithms/C++: numerical_methods/qr_decompose.h File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Entry Member List
+
+
+ +

This is the complete list of members for Entry, including all inherited members.

+ + + +
Entry(int key=notPresent)Entryinlineexplicit
keyEntry
+
+ + + + diff --git a/d4/d72/qr__eigen__values_8cpp__incl.svg b/d4/d72/qr__eigen__values_8cpp__incl.svg index 44e095f1d..9e6264ffb 100644 --- a/d4/d72/qr__eigen__values_8cpp__incl.svg +++ b/d4/d72/qr__eigen__values_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - + TheAlgorithms/C++: sorting/shell_sort2.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
stats_computer1< T > Member List
+
+
+ +

This is the complete list of members for stats_computer1< T >, including all inherited members.

+ + + + + + + + + + +
Ex (defined in stats_computer1< T >)stats_computer1< T >private
Ex2 (defined in stats_computer1< T >)stats_computer1< T >private
K (defined in stats_computer1< T >)stats_computer1< T >private
mean() conststats_computer1< T >inline
n (defined in stats_computer1< T >)stats_computer1< T >private
new_val(T x)stats_computer1< T >inline
operator>>(std::istream &input, stats_computer1 &stat)stats_computer1< T >friend
std() conststats_computer1< T >inline
variance() conststats_computer1< T >inline
+
+ + + + diff --git a/d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html b/d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html index 999fe3cbd..96e747683 100644 --- a/d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html +++ b/d4/d8f/travelling__salesman__using__bit__manipulation_8cpp.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: bit_manipulation/travelling_salesman_using_bit_manipulation.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
vector< T >::const_iterator Class Reference
+
+
+ +

STL iterator class. + More...

+

Detailed Description

+

STL iterator class.

+

The documentation for this class was generated from the following files:
+
+ + + + diff --git a/d4/df8/prime__numbers_8cpp__incl.svg b/d4/df8/prime__numbers_8cpp__incl.svg index caaa8ccf8..4c311cf38 100644 --- a/d4/df8/prime__numbers_8cpp__incl.svg +++ b/d4/df8/prime__numbers_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + TheAlgorithms/C++: cycle_sort Namespace Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
adaline Member List
+
+
+ +

This is the complete list of members for adaline, including all inherited members.

+ + + + + + + + + + + +
accuracyadalineprivate
activation(double x)adalineinline
adaline(int num_features, const double eta=0.01f, const double accuracy=1e-5)adalineinlineexplicit
check_size_match(const std::vector< double > &x)adalineinlineprivate
etaadalineprivate
fit(const std::vector< double > &x, const int &y)adalineinline
fit(std::array< std::vector< double >, N > const &X, std::array< int, N > const &Y)adalineinline
operator<<(std::ostream &out, const adaline &ada)adalinefriend
predict(const std::vector< double > &x, double *out=nullptr)adalineinline
weightsadalineprivate
+
+ + + + diff --git a/d5/d85/xor__cipher_8cpp__incl.svg b/d5/d85/xor__cipher_8cpp__incl.svg index 735532f5d..0d99e6fb2 100644 --- a/d5/d85/xor__cipher_8cpp__incl.svg +++ b/d5/d85/xor__cipher_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + TheAlgorithms/C++: Backtracking @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
tests::Node Struct Reference
+
+
+ +

A Node struct that represents a single Node in a Binary Tree. + More...

+
+Collaboration diagram for tests::Node:
+
+
+
[legend]
+ + + + + + + + +

+Public Member Functions

 Node (int64_t _data)
 Creates a new Node with some initial data.
 
 Node (int64_t _data, Node *_next)
 Creates a new Node with initial data and a successor.
 
+ + + + + + + +

+Public Attributes

int64_t data
 The value of the Node.
 
Nodenext
 The Node's successor.
 
+

Detailed Description

+

A Node struct that represents a single Node in a Binary Tree.

+ +

Definition at line 32 of file circular_linked_list.cpp.

+

Constructor & Destructor Documentation

+ +

◆ Node() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
operations_on_datastructures::circular_linked_list::Node::Node (int64_t _data)
+
+inlineexplicit
+
+ +

Creates a new Node with some initial data.

+
Parameters
+ + +
_dataValue of Node
+
+
+

< Set value of Node data

+

< Initialize successor

+ +

Definition at line 39 of file circular_linked_list.cpp.

+
39 {
+
40 data = _data;
+
41 next = nullptr;
+
42 }
+
int64_t data
The value of the Node.
+
Node * next
The Node's successor.
+
+
+
+ +

◆ Node() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
operations_on_datastructures::circular_linked_list::Node::Node (int64_t _data,
Node * _next )
+
+inlineexplicit
+
+ +

Creates a new Node with initial data and a successor.

+
Parameters
+ + + +
_dataValue of Node
_nextPointer to the next Node
+
+
+

< Set value of Node data

+

< Initialize successor

+ +

Definition at line 48 of file circular_linked_list.cpp.

+
48 {
+
49 data = _data;
+
50 next = _next;
+
51 }
+
+
+
+

Member Data Documentation

+ +

◆ data

+ +
+
+ + + + +
int64_t operations_on_datastructures::circular_linked_list::Node::data
+
+ +

The value of the Node.

+ +

Definition at line 33 of file circular_linked_list.cpp.

+ +
+
+ +

◆ next

+ +
+
+ + + + +
Node* operations_on_datastructures::circular_linked_list::Node::next
+
+ +

The Node's successor.

+ +

Definition at line 34 of file circular_linked_list.cpp.

+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/d6/d7c/structtests_1_1_node.js b/d6/d7c/structtests_1_1_node.js new file mode 100644 index 000000000..b96349599 --- /dev/null +++ b/d6/d7c/structtests_1_1_node.js @@ -0,0 +1,7 @@ +var structtests_1_1_node = +[ + [ "Node", "d6/d7c/structtests_1_1_node.html#a005dc56b0c58350a13f4796b9b30b6c5", null ], + [ "Node", "d6/d7c/structtests_1_1_node.html#a12a06eef5ccaf667f319506eee655d95", null ], + [ "data", "d6/d7c/structtests_1_1_node.html#a7461292b8b91aed86404d0ab019dfdd1", null ], + [ "next", "d6/d7c/structtests_1_1_node.html#a7c867b8e1034a6f5da490c8b8c09cb77", null ] +]; \ No newline at end of file diff --git a/d6/d80/double__hash__hash__table_8cpp.html b/d6/d80/double__hash__hash__table_8cpp.html index f883e4b2b..0ed766cc3 100644 --- a/d6/d80/double__hash__hash__table_8cpp.html +++ b/d6/d80/double__hash__hash__table_8cpp.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: hashing/double_hash_hash_table.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + diff --git a/d6/dc1/classtests_1_1_circular_linked_list__coll__graph_org.svg b/d6/dc1/classtests_1_1_circular_linked_list__coll__graph_org.svg new file mode 100644 index 000000000..483dd1e49 --- /dev/null +++ b/d6/dc1/classtests_1_1_circular_linked_list__coll__graph_org.svg @@ -0,0 +1,52 @@ + + + + + + +tests::CircularLinkedList + + +Node1 + + +tests::CircularLinkedList + + + + + +Node2 + + +operations_on_datastructures +::circular_linked_list::Node + + + + + +Node2->Node1 + + + + + + end +root + + + +Node2->Node2 + + + + + + next + + + diff --git a/d6/dc9/classcatalan__numbers-members.html b/d6/dc9/classcatalan__numbers-members.html index 47abe184f..c732970a7 100644 --- a/d6/dc9/classcatalan__numbers-members.html +++ b/d6/dc9/classcatalan__numbers-members.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: Member List @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
unordered_set< K >::const_reverse_iterator Class Reference
+
+
+ +

STL iterator class. + More...

+

Detailed Description

+

STL iterator class.

+

The documentation for this class was generated from the following files:
+
+ + + + diff --git a/d7/d24/nqueen__print__all__solutions_8cpp.html b/d7/d24/nqueen__print__all__solutions_8cpp.html index 80bd0a160..6520490fd 100644 --- a/d7/d24/nqueen__print__all__solutions_8cpp.html +++ b/d7/d24/nqueen__print__all__solutions_8cpp.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: backtracking/nqueen_print_all_solutions.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
unordered_set< K > Member List
+
+
+ +

This is the complete list of members for unordered_set< K >, including all inherited members.

+ + +
keysunordered_set< K >
+
+ + + + diff --git a/d7/dac/structstd_1_1is__integral_3_01uint256__t_01_4__inherit__graph.svg b/d7/dac/structstd_1_1is__integral_3_01uint256__t_01_4__inherit__graph.svg index 353f2929e..b148ba046 100644 --- a/d7/dac/structstd_1_1is__integral_3_01uint256__t_01_4__inherit__graph.svg +++ b/d7/dac/structstd_1_1is__integral_3_01uint256__t_01_4__inherit__graph.svg @@ -1,7 +1,7 @@ - - - - - + TheAlgorithms/C++: Knapsack Namespace Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
tests::CircularLinkedList Member List
+
+
+ +

This is the complete list of members for tests::CircularLinkedList, including all inherited members.

+ + + + + + + + + + + + + + + + + +
CircularLinkedList()tests::CircularLinkedListinline
CircularLinkedList(const CircularLinkedList &copy)tests::CircularLinkedListinline
CircularLinkedList(CircularLinkedList &&source) noexcepttests::CircularLinkedListinline
endtests::CircularLinkedListprivate
erase()tests::CircularLinkedListinline
insert(const std::vector< int64_t > &values)tests::CircularLinkedListinline
insert(int64_t data)tests::CircularLinkedListinline
insert(Node *node)tests::CircularLinkedListinline
operator=(const CircularLinkedList &other)tests::CircularLinkedListinline
operator=(CircularLinkedList &&other) noexcepttests::CircularLinkedListinline
print()tests::CircularLinkedListinline
print(Node *root)tests::CircularLinkedListinline
roottests::CircularLinkedListprivate
values()tests::CircularLinkedListinline
values(Node *root)tests::CircularLinkedListinline
~CircularLinkedList()tests::CircularLinkedListinline
+
+ + + + diff --git a/d7/dd9/eratosthenes_8cpp__incl.svg b/d7/dd9/eratosthenes_8cpp__incl.svg index 8a20bd861..31baa5d85 100644 --- a/d7/dd9/eratosthenes_8cpp__incl.svg +++ b/d7/dd9/eratosthenes_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - + TheAlgorithms/C++: data_structures/queue.hpp Source File @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
vector< T > Class Template Reference
+
+
+ +

STL class. + More...

+
+Collaboration diagram for vector< T >:
+
+
+
[legend]
+ + + + + + + + + + + + + + +

+Classes

class  const_iterator
 STL iterator class. More...
 
class  const_reverse_iterator
 STL iterator class. More...
 
class  iterator
 STL iterator class. More...
 
class  reverse_iterator
 STL iterator class. More...
 
+ + + + +

+Public Attributes

+T elements
 STL member.
 
+

Detailed Description

+

STL class.

+

The documentation for this class was generated from the following files:
+
+ + + + diff --git a/d7/dfc/classvector.js b/d7/dfc/classvector.js new file mode 100644 index 000000000..68749bc5b --- /dev/null +++ b/d7/dfc/classvector.js @@ -0,0 +1,8 @@ +var classvector = +[ + [ "const_iterator", "d4/df5/classvector_1_1const__iterator.html", null ], + [ "const_reverse_iterator", "dd/d51/classvector_1_1const__reverse__iterator.html", null ], + [ "iterator", "d0/d05/classvector_1_1iterator.html", null ], + [ "reverse_iterator", "dd/d96/classvector_1_1reverse__iterator.html", null ], + [ "elements", "d7/dfc/classvector.html#a2396209900e8f592db1f0b2467f7d899", null ] +]; \ No newline at end of file diff --git a/d8/d01/struct_item-members.html b/d8/d01/struct_item-members.html index 283551d65..ec4e94282 100644 --- a/d8/d01/struct_item-members.html +++ b/d8/d01/struct_item-members.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: Member List @@ -60,7 +60,7 @@ window.MathJax = { - + + diff --git a/d8/d68/classpriority__queue__coll__graph_org.svg b/d8/d68/classpriority__queue__coll__graph_org.svg new file mode 100644 index 000000000..35ceaeb3b --- /dev/null +++ b/d8/d68/classpriority__queue__coll__graph_org.svg @@ -0,0 +1,40 @@ + + + + + + +priority_queue< T > + + +Node1 + + +priority_queue< T > + + + + + +Node2 + + +T + + + + + +Node2->Node1 + + + + + + elements + + + diff --git a/d8/d68/dijkstra_8cpp.html b/d8/d68/dijkstra_8cpp.html index b2d695bf6..c0f4dcf62 100644 --- a/d8/d68/dijkstra_8cpp.html +++ b/d8/d68/dijkstra_8cpp.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: graph/dijkstra.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
adaline Class Reference
+
+
+
+Collaboration diagram for adaline:
+
+
+
[legend]
+ + + + + + + + + + + + + +

+Public Member Functions

 adaline (int num_features, const double eta=0.01f, const double accuracy=1e-5)
 
int predict (const std::vector< double > &x, double *out=nullptr)
 
double fit (const std::vector< double > &x, const int &y)
 
template<size_t N>
void fit (std::array< std::vector< double >, N > const &X, std::array< int, N > const &Y)
 
int activation (double x)
 
+ + + +

+Private Member Functions

bool check_size_match (const std::vector< double > &x)
 
+ + + + + + + + + + +

+Private Attributes

const double eta
 learning rate of the algorithm
 
const double accuracy
 model fit convergence accuracy
 
std::vector< double > weights
 weights of the neural network
 
+ + + +

+Friends

std::ostream & operator<< (std::ostream &out, const adaline &ada)
 
+

Detailed Description

+
+

Definition at line 46 of file adaline_learning.cpp.

+

Constructor & Destructor Documentation

+ +

◆ adaline()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
machine_learning::adaline::adaline (int num_features,
const double eta = 0.01f,
const double accuracy = 1e-5 )
+
+inlineexplicit
+
+

Default constructor

Parameters
+ + + + +
[in]num_featuresnumber of features present
[in]etalearning rate (optional, default=0.1)
[in]convergenceaccuracy (optional, default= \(1\times10^{-5}\))
+
+
+ +

Definition at line 55 of file adaline_learning.cpp.

+
+
58 if (eta <= 0) {
+
59 std::cerr << "learning rate should be positive and nonzero"
+
60 << std::endl;
+
61 std::exit(EXIT_FAILURE);
+
62 }
+
63
+
64 weights = std::vector<double>(
+
65 num_features +
+
66 1); // additional weight is for the constant bias term
+
67
+
68 // initialize with random weights in the range [-50, 49]
+
69 for (double &weight : weights) weight = 1.f;
+
70 // weights[i] = (static_cast<double>(std::rand() % 100) - 50);
+
71 }
+
const double eta
learning rate of the algorithm
+
std::vector< double > weights
weights of the neural network
+
const double accuracy
model fit convergence accuracy
+
const double eta
learning rate of the algorithm
+
const double accuracy
model fit convergence accuracy
+
+
+
+

Member Function Documentation

+ +

◆ activation()

+ +
+
+ + + + + +
+ + + + + + + +
int machine_learning::adaline::activation (double x)
+
+inline
+
+

Defines activation function as Heaviside's step function.

+\[f(x) = \begin{cases} +-1 & \forall x \le 0\\ + 1 & \forall x > 0 +\end{cases} +\] +

+
Parameters
+ + +
xinput value to apply activation on
+
+
+
Returns
activation output
+ +

Definition at line 186 of file adaline_learning.cpp.

+
186{ return x > 0 ? 1 : -1; }
+
+
+
+ +

◆ check_size_match()

+ +
+
+ + + + + +
+ + + + + + + +
bool machine_learning::adaline::check_size_match (const std::vector< double > & x)
+
+inlineprivate
+
+

convenient function to check if input feature vector size matches the model weights size

Parameters
+ + +
[in]xfecture vector to check
+
+
+
Returns
true size matches
+
+false size does not match
+ +

Definition at line 196 of file adaline_learning.cpp.

+
196 {
+
197 if (x.size() != (weights.size() - 1)) {
+
198 std::cerr << __func__ << ": "
+
199 << "Number of features in x does not match the feature "
+
200 "dimension in model!"
+
201 << std::endl;
+
202 return false;
+
203 }
+
204 return true;
+
205 }
+
+
+
+ +

◆ fit() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
double machine_learning::adaline::fit (const std::vector< double > & x,
const int & y )
+
+inline
+
+

Update the weights of the model using supervised learning for one feature vector

Parameters
+ + + +
[in]xfeature vector
[in]yknown output value
+
+
+
Returns
correction factor
+ +

Definition at line 119 of file adaline_learning.cpp.

+
119 {
+
120 if (!check_size_match(x)) {
+
121 return 0;
+
122 }
+
123
+
124 /* output of the model with current weights */
+
125 int p = predict(x);
+
126 int prediction_error = y - p; // error in estimation
+
127 double correction_factor = eta * prediction_error;
+
128
+
129 /* update each weight, the last weight is the bias term */
+
130 for (int i = 0; i < x.size(); i++) {
+
131 weights[i] += correction_factor * x[i];
+
132 }
+
133 weights[x.size()] += correction_factor; // update bias
+
134
+
135 return correction_factor;
+
136 }
+
int predict(const std::vector< double > &x, double *out=nullptr)
+
bool check_size_match(const std::vector< double > &x)
+
+
+
+ +

◆ fit() [2/2]

+ +
+
+
+template<size_t N>
+ + + + + +
+ + + + + + + + + + + +
void machine_learning::adaline::fit (std::array< std::vector< double >, N > const & X,
std::array< int, N > const & Y )
+
+inline
+
+

Update the weights of the model using supervised learning for an array of vectors.

Parameters
+ + + +
[in]Xarray of feature vector
[in]yknown output value for each feature vector
+
+
+ +

Definition at line 145 of file adaline_learning.cpp.

+
146 {
+
147 double avg_pred_error = 1.f;
+
148
+
149 int iter = 0;
+
150 for (iter = 0; (iter < MAX_ITER) && (avg_pred_error > accuracy);
+
151 iter++) {
+
152 avg_pred_error = 0.f;
+
153
+
154 // perform fit for each sample
+
155 for (int i = 0; i < N; i++) {
+
156 double err = fit(X[i], Y[i]);
+
157 avg_pred_error += std::abs(err);
+
158 }
+
159 avg_pred_error /= N;
+
160
+
161 // Print updates every 200th iteration
+
162 // if (iter % 100 == 0)
+
163 std::cout << "\tIter " << iter << ": Training weights: " << *this
+
164 << "\tAvg error: " << avg_pred_error << std::endl;
+
165 }
+
166
+
167 if (iter < MAX_ITER) {
+
168 std::cout << "Converged after " << iter << " iterations."
+
169 << std::endl;
+
170 } else {
+
171 std::cout << "Did not converge after " << iter << " iterations."
+
172 << std::endl;
+
173 }
+
174 }
+
double fit(const std::vector< double > &x, const int &y)
+
constexpr int MAX_ITER
+
constexpr uint32_t N
A struct to represent sparse table for min() as their invariant function, for the given array A....
+
+
+
+ +

◆ predict()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
int machine_learning::adaline::predict (const std::vector< double > & x,
double * out = nullptr )
+
+inline
+
+

predict the output of the model for given set of features

Parameters
+ + + +
[in]xinput vector
[out]outoptional argument to return neuron output before applying activation function (optional, nullptr to ignore)
+
+
+
Returns
model prediction output
+ +

Definition at line 95 of file adaline_learning.cpp.

+
95 {
+
96 if (!check_size_match(x)) {
+
97 return 0;
+
98 }
+
99
+
100 double y = weights.back(); // assign bias value
+
101
+
102 // for (int i = 0; i < x.size(); i++) y += x[i] * weights[i];
+
103 y = std::inner_product(x.begin(), x.end(), weights.begin(), y);
+
104
+
105 if (out != nullptr) { // if out variable is provided
+
106 *out = y;
+
107 }
+
108
+
109 return activation(y); // quantizer: apply ADALINE threshold function
+
110 }
+ +
+
+
+

Friends And Related Symbol Documentation

+ +

◆ operator<<

+ +
+
+ + + + + +
+ + + + + + + + + + + +
std::ostream & operator<< (std::ostream & out,
const adaline & ada )
+
+friend
+
+

Operator to print the weights of the model

+ +

Definition at line 76 of file adaline_learning.cpp.

+
76 {
+
77 out << "<";
+
78 for (int i = 0; i < ada.weights.size(); i++) {
+
79 out << ada.weights[i];
+
80 if (i < ada.weights.size() - 1) {
+
81 out << ", ";
+
82 }
+
83 }
+
84 out << ">";
+
85 return out;
+
86 }
+
std::vector< double > weights
weights of the neural network
+
+
+
+

Member Data Documentation

+ +

◆ accuracy

+ +
+
+ + + + + +
+ + + + +
const double machine_learning::adaline::accuracy
+
+private
+
+ +

model fit convergence accuracy

+ +

Definition at line 208 of file adaline_learning.cpp.

+ +
+
+ +

◆ eta

+ +
+
+ + + + + +
+ + + + +
const double machine_learning::adaline::eta
+
+private
+
+ +

learning rate of the algorithm

+ +

Definition at line 207 of file adaline_learning.cpp.

+ +
+
+ +

◆ weights

+ +
+
+ + + + + +
+ + + + +
std::vector<double> machine_learning::adaline::weights
+
+private
+
+ +

weights of the neural network

+ +

Definition at line 209 of file adaline_learning.cpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/d8/df2/classadaline.js b/d8/df2/classadaline.js new file mode 100644 index 000000000..e3d1956eb --- /dev/null +++ b/d8/df2/classadaline.js @@ -0,0 +1,13 @@ +var classadaline = +[ + [ "adaline", "d8/df2/classadaline.html#a0acbe32aaab897e7939e5b0454035b8c", null ], + [ "activation", "d8/df2/classadaline.html#a082f758fb55fe19f22b3df66f89b2325", null ], + [ "check_size_match", "d8/df2/classadaline.html#ac8a9c2aaaa63b0f27ea176857e1e7d56", null ], + [ "fit", "d8/df2/classadaline.html#a74e3c6c037b67895014414c5d75465e5", null ], + [ "fit", "d8/df2/classadaline.html#a8d61f9ed872eef26bca39388cbda6a91", null ], + [ "predict", "d8/df2/classadaline.html#ab11242d9ad5b03a75911e29b04f78fd3", null ], + [ "operator<<", "d8/df2/classadaline.html#ae347040516e995c8fb8ca2e5c0496daa", null ], + [ "accuracy", "d8/df2/classadaline.html#aa23d60262f917f35836ef4b1c1d9f7d3", null ], + [ "eta", "d8/df2/classadaline.html#a28160d17e492597a2f112e0d38551cda", null ], + [ "weights", "d8/df2/classadaline.html#a4cd8fe438032fedaa66f93bfd66f5492", null ] +]; \ No newline at end of file diff --git a/d8/df4/array__right__rotation_8cpp__incl.svg b/d8/df4/array__right__rotation_8cpp__incl.svg index c09ee69a4..6af333b89 100644 --- a/d8/df4/array__right__rotation_8cpp__incl.svg +++ b/d8/df4/array__right__rotation_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - - - + TheAlgorithms/C++: search/median_search2.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
unordered_set< K >::iterator Class Reference
+
+
+ +

STL iterator class. + More...

+

Detailed Description

+

STL iterator class.

+

The documentation for this class was generated from the following files:
+
+ + + + diff --git a/d9/d5f/dijkstra_8cpp__incl.svg b/d9/d5f/dijkstra_8cpp__incl.svg index c2e06bbbb..47187f8f1 100644 --- a/d9/d5f/dijkstra_8cpp__incl.svg +++ b/d9/d5f/dijkstra_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + TheAlgorithms/C++: search/longest_increasing_subsequence_using_binary_search.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
unordered_set< K >::const_iterator Class Reference
+
+
+ +

STL iterator class. + More...

+

Detailed Description

+

STL iterator class.

+

The documentation for this class was generated from the following files:
+
+ + + + diff --git a/da/d0d/longest__common__string_8cpp.html b/da/d0d/longest__common__string_8cpp.html index 1329e1255..eb5c01edc 100644 --- a/da/d0d/longest__common__string_8cpp.html +++ b/da/d0d/longest__common__string_8cpp.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: dynamic_programming/longest_common_string.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
stats_computer2< T > Class Template Reference
+
+
+ + + + + + + + + + +

+Public Member Functions

void new_val (T x)
 
double mean () const
 
double variance () const
 
double std () const
 
+ + + + + + + + + +

+Private Attributes

unsigned int n = 0
 
double mu = 0
 
double var = 0
 
double M = 0
 
+ + + +

+Friends

std::istream & operator>> (std::istream &input, stats_computer2 &stat)
 
+

Detailed Description

+
template<typename T>
+class stats_computer2< T >

continuous mean and variance computance using Welford's algorithm (very accurate)

+ +

Definition at line 72 of file realtime_stats.cpp.

+

Member Function Documentation

+ +

◆ mean()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
double statistics::stats_computer2< T >::mean () const
+
+inline
+
+

return sample mean computed till last sample

+ +

Definition at line 86 of file realtime_stats.cpp.

+
86{ return mu; }
+
+
+
+ +

◆ new_val()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
void statistics::stats_computer2< T >::new_val (T x)
+
+inline
+
+

Constructor

Parameters
+ + +
[in]xnew data sample
+
+
+ +

Definition at line 77 of file realtime_stats.cpp.

+
77 {
+
78 n++;
+
79 double delta = x - mu;
+
80 mu += delta / n;
+
81 double delta2 = x - mu;
+
82 M += delta * delta2;
+
83 }
+ +
+
+
+ +

◆ std()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
double statistics::stats_computer2< T >::std () const
+
+inline
+
+

return sample standard deviation computed till last sample

+ +

Definition at line 92 of file realtime_stats.cpp.

+
92{ return std::sqrt(this->variance()); }
+ +
+
+
+ +

◆ variance()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
double statistics::stats_computer2< T >::variance () const
+
+inline
+
+

return data variance computed till last sample

+ +

Definition at line 89 of file realtime_stats.cpp.

+
89{ return M / n; }
+
+
+
+

Friends And Related Symbol Documentation

+ +

◆ operator>>

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + + + + + +
std::istream & operator>> (std::istream & input,
stats_computer2< T > & stat )
+
+friend
+
+

short-hand operator to read new sample from input stream
+ e.g.: std::cin >> stats1;

+ +

Definition at line 97 of file realtime_stats.cpp.

+
98 {
+
99 T val;
+
100 input >> val;
+ +
102 return input;
+
103 }
+ +
+
+
+

Member Data Documentation

+ +

◆ M

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
double statistics::stats_computer2< T >::M = 0
+
+private
+
+ +

Definition at line 107 of file realtime_stats.cpp.

+ +
+
+ +

◆ mu

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
double statistics::stats_computer2< T >::mu = 0
+
+private
+
+ +

Definition at line 107 of file realtime_stats.cpp.

+ +
+
+ +

◆ n

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
unsigned int statistics::stats_computer2< T >::n = 0
+
+private
+
+ +

Definition at line 106 of file realtime_stats.cpp.

+ +
+
+ +

◆ var

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
double statistics::stats_computer2< T >::var = 0
+
+private
+
+ +

Definition at line 107 of file realtime_stats.cpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/dc/d02/classstats__computer2.js b/dc/d02/classstats__computer2.js new file mode 100644 index 000000000..222307054 --- /dev/null +++ b/dc/d02/classstats__computer2.js @@ -0,0 +1,8 @@ +var classstats__computer2 = +[ + [ "mean", "dc/d02/classstats__computer2.html#a8290966ad468f2a8c266d008bc60720e", null ], + [ "new_val", "dc/d02/classstats__computer2.html#ade6de704deea24fdc88077b3d9a0d534", null ], + [ "std", "dc/d02/classstats__computer2.html#acf2e84df4fc386bb3295016ef8fd156e", null ], + [ "variance", "dc/d02/classstats__computer2.html#af6198817084276113b3c064e87ce0555", null ], + [ "operator>>", "dc/d02/classstats__computer2.html#ab444d485c9e7db35bdc2ff6b7775291a", null ] +]; \ No newline at end of file diff --git a/dc/d13/classdata__structures_1_1tree__234_1_1_tree234-members.html b/dc/d13/classdata__structures_1_1tree__234_1_1_tree234-members.html index a830d6ab2..00c95e8ad 100644 --- a/dc/d13/classdata__structures_1_1tree__234_1_1_tree234-members.html +++ b/dc/d13/classdata__structures_1_1tree__234_1_1_tree234-members.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: Member List @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
tests::CircularLinkedList Class Reference
+
+
+ +

A class that implements a Circular Linked List. + More...

+
+Collaboration diagram for tests::CircularLinkedList:
+
+
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 CircularLinkedList ()
 Creates an empty CircularLinkedList.
 
 CircularLinkedList (const CircularLinkedList &copy)
 Copy constructor for CircularLinkedList.
 
 CircularLinkedList (CircularLinkedList &&source) noexcept
 Move constructor for CircularLinkedList.
 
CircularLinkedListoperator= (const CircularLinkedList &other)
 Copy assignment operator.
 
CircularLinkedListoperator= (CircularLinkedList &&other) noexcept
 Move assignment operator.
 
 ~CircularLinkedList ()
 Cleans up memory when destroyed.
 
void erase ()
 
void insert (const std::vector< int64_t > &values)
 Inserts all the values from a vector into the Circular Linked List.
 
void insert (int64_t data)
 Inserts a single value into the Circular Linked List.
 
void insert (Node *node)
 Inserts a given Node into the Circular Linked List.
 
void print ()
 Prints the values of the Circular Linked List, beginning from the root Node.
 
void print (Node *root)
 Prints the values of the Circular Linked List, beginning from a given Node to be used as the root.
 
std::vector< int64_t > values ()
 Returns a std::vector of the values of the Circular Linked List.
 
std::vector< int64_t > values (Node *root)
 Returns a std::vector of the values of the Circular Linked List, beginning from a given Node.
 
+ + + + + + + +

+Private Attributes

Noderoot
 Pointer to the root Node.
 
Nodeend {}
 Pointer to the last Node.
 
+

Detailed Description

+

A class that implements a Circular Linked List.

+ +

Definition at line 57 of file circular_linked_list.cpp.

+

Constructor & Destructor Documentation

+ +

◆ CircularLinkedList() [1/3]

+ +
+
+ + + + + +
+ + + + + + + +
operations_on_datastructures::circular_linked_list::CircularLinkedList::CircularLinkedList ()
+
+inline
+
+ +

Creates an empty CircularLinkedList.

+ +

Definition at line 66 of file circular_linked_list.cpp.

+
66 {
+
67 root = nullptr;
+
68 end = nullptr;
+
69 }
+
Node * root
Pointer to the root Node.
+
Node * end
Pointer to the last Node.
+
+
+
+ +

◆ CircularLinkedList() [2/3]

+ +
+
+ + + + + +
+ + + + + + + +
operations_on_datastructures::circular_linked_list::CircularLinkedList::CircularLinkedList (const CircularLinkedList & copy)
+
+inline
+
+ +

Copy constructor for CircularLinkedList.

+ +

Definition at line 73 of file circular_linked_list.cpp.

+
73 {
+
74 erase();
+
75 root = nullptr;
+
76 Node* node = copy.root;
+
77 while (node != nullptr) {
+
78 insert(node->data);
+
79 node = node->next;
+
80 }
+
81 }
+
struct node { int data; int height; struct node *left; struct node *right;} node
for std::queue
Definition avltree.cpp:13
+ +
void insert(const std::vector< int64_t > &values)
Inserts all the values from a vector into the Circular Linked List.
+
+
+
+ +

◆ CircularLinkedList() [3/3]

+ +
+
+ + + + + +
+ + + + + + + +
operations_on_datastructures::circular_linked_list::CircularLinkedList::CircularLinkedList (CircularLinkedList && source)
+
+inlinenoexcept
+
+ +

Move constructor for CircularLinkedList.

+
Parameters
+ + +
sourcervalue reference to a Circular Linked List
+
+
+ +

Definition at line 86 of file circular_linked_list.cpp.

+
86 {
+
87 root = source.root;
+
88 end = source.end;
+
89 source.root = nullptr;
+
90 source.end = nullptr;
+
91 }
+
+
+
+ +

◆ ~CircularLinkedList()

+ +
+
+ + + + + +
+ + + + + + + +
operations_on_datastructures::circular_linked_list::CircularLinkedList::~CircularLinkedList ()
+
+inline
+
+ +

Cleans up memory when destroyed.

+ +

Definition at line 122 of file circular_linked_list.cpp.

+
122{ erase(); }
+
+
+
+

Member Function Documentation

+ +

◆ erase()

+ +
+
+ + + + + +
+ + + + + + + +
void operations_on_datastructures::circular_linked_list::CircularLinkedList::erase ()
+
+inline
+
+

Iteratively frees each node in the Circular Linked List from the heap

+ +

Definition at line 126 of file circular_linked_list.cpp.

+
126 {
+
127 if (root == nullptr) {
+
128 return;
+
129 }
+
130 Node* node = root;
+
131 do {
+
132 Node* temp = node;
+
133 node = node->next;
+
134 delete (temp);
+
135 } while (node != root);
+
136 root = nullptr;
+
137 end = nullptr;
+
138 }
+
+
+
+ +

◆ insert() [1/3]

+ +
+
+ + + + + +
+ + + + + + + +
void operations_on_datastructures::circular_linked_list::CircularLinkedList::insert (const std::vector< int64_t > & values)
+
+inline
+
+ +

Inserts all the values from a vector into the Circular Linked List.

+

Goes through each element in the vector sequentially, inserting it into the list

Parameters
+ + +
valuesThe vector of integer values that is to be inserted
+
+
+
Returns
void
+ +

Definition at line 146 of file circular_linked_list.cpp.

+
146 {
+
147 for (int64_t value : values) {
+
148 insert(value);
+
149 }
+
150 }
+
std::vector< int64_t > values()
Returns a std::vector of the values of the Circular Linked List.
+
+
+
+ +

◆ insert() [2/3]

+ +
+
+ + + + + +
+ + + + + + + +
void operations_on_datastructures::circular_linked_list::CircularLinkedList::insert (int64_t data)
+
+inline
+
+ +

Inserts a single value into the Circular Linked List.

+

Creates a Node with the given value, pointing to the root Node and inserts it into the list

Parameters
+ + +
dataThe integer valus to be inserted
+
+
+
Returns
void
+ +

Definition at line 158 of file circular_linked_list.cpp.

+
158 {
+
159 Node* node = new Node(data, root);
+
160 insert(node);
+
161 }
+
int data[MAX]
test data
+
+
+
+ +

◆ insert() [3/3]

+ +
+
+ + + + + +
+ + + + + + + +
void operations_on_datastructures::circular_linked_list::CircularLinkedList::insert (Node * node)
+
+inline
+
+ +

Inserts a given Node into the Circular Linked List.

+

Checks wheter the list is empty, and inserts the Node, modifying the end pointer

Parameters
+ + +
nodeThe Node that is to be inserted
+
+
+
Returns
void
+

< Set node as the root

+

< Point node to itself

+

< Set the end to the root

+

< Append node to the end

+

< Set the next value to the root

+

< Make end point to node

+ +

Definition at line 169 of file circular_linked_list.cpp.

+
169 {
+
170 if (root == nullptr) {
+
171 root = node;
+
172 node->next = root;
+
173 end = root;
+
174 } else {
+
175 end->next = node;
+
176 node->next = root;
+
177 end = node;
+
178 }
+
179 }
+
+
+
+ +

◆ operator=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
CircularLinkedList & operations_on_datastructures::circular_linked_list::CircularLinkedList::operator= (CircularLinkedList && other)
+
+inlinenoexcept
+
+ +

Move assignment operator.

+
Parameters
+ + +
otherrvalue reference to a Circular Linked List
+
+
+
Returns
Reference to CircularLinkedList
+ +

Definition at line 112 of file circular_linked_list.cpp.

+
112 {
+
113 root = other.root;
+
114 end = other.end;
+
115 other.root = nullptr;
+
116 other.end = nullptr;
+
117 return *this;
+
118 }
+
+
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
CircularLinkedList & operations_on_datastructures::circular_linked_list::CircularLinkedList::operator= (const CircularLinkedList & other)
+
+inline
+
+ +

Copy assignment operator.

+
Parameters
+ + +
otherReference to a Circular Linked List
+
+
+
Returns
Reference to CircularLinkedList
+ +

Definition at line 97 of file circular_linked_list.cpp.

+
97 {
+
98 erase();
+
99 root = nullptr;
+
100 Node* node = other.root;
+
101 while (node != nullptr) {
+
102 insert(node->data);
+
103 node = node->next;
+
104 }
+
105 return *this;
+
106 }
+
+
+
+ +

◆ print() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
void operations_on_datastructures::circular_linked_list::CircularLinkedList::print ()
+
+inline
+
+ +

Prints the values of the Circular Linked List, beginning from the root Node.

+

Goes through each Node from the root and prints them out in order

Returns
void
+ +

Definition at line 187 of file circular_linked_list.cpp.

+
187{ print(root); }
+
void print()
Prints the values of the Circular Linked List, beginning from the root Node.
+
+
+
+ +

◆ print() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
void operations_on_datastructures::circular_linked_list::CircularLinkedList::print (Node * root)
+
+inline
+
+ +

Prints the values of the Circular Linked List, beginning from a given Node to be used as the root.

+

Goes through each Node from the given Node and prints them out in order. If the list is empty, it prints the message 'Empty List!'

Parameters
+ + +
rootThe Node to start at
+
+
+
Returns
void
+ +

Definition at line 196 of file circular_linked_list.cpp.

+
196 {
+
197 Node* temp = root;
+
198 if (root == nullptr) {
+
199 std::cout << "Empty List!\n";
+
200 return;
+
201 }
+
202 do {
+
203 std::cout << temp->data << " ";
+
204 temp = temp->next;
+
205 } while (temp != root);
+
206 std::cout << "\n";
+
207 }
+
+
+
+ +

◆ values() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
std::vector< int64_t > operations_on_datastructures::circular_linked_list::CircularLinkedList::values ()
+
+inline
+
+ +

Returns a std::vector of the values of the Circular Linked List.

+

Starting from the root Node, appends each value of the list to a std::vector and returns it

Returns
A std::vector of the list's values
+ +

Definition at line 214 of file circular_linked_list.cpp.

+
214{ return values(root); }
+
std::vector< int64_t > values()
Returns a std::vector of the values of the Circular Linked List.
+
+
+
+ +

◆ values() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
std::vector< int64_t > operations_on_datastructures::circular_linked_list::CircularLinkedList::values (Node * root)
+
+inline
+
+ +

Returns a std::vector of the values of the Circular Linked List, beginning from a given Node.

+

Starting from a given Node, appends each value of the list to a std::vector and returns it

Parameters
+ + +
rootThe Node to start at
+
+
+
Returns
A std::vector of the list's values
+

< Return empty vector

+ +

Definition at line 223 of file circular_linked_list.cpp.

+
223 {
+
224 std::vector<int64_t> res;
+
225 if (root == nullptr) {
+
226 return res;
+
227 }
+
228 Node* temp = root;
+
229 do {
+
230 res.push_back(temp->data);
+
231 temp = temp->next;
+
232 } while (temp != root);
+
233 return res;
+
234 }
+
+
+
+

Member Data Documentation

+ +

◆ end

+ +
+
+ + + + + +
+ + + + +
Node* operations_on_datastructures::circular_linked_list::CircularLinkedList::end {}
+
+private
+
+ +

Pointer to the last Node.

+ +

Definition at line 60 of file circular_linked_list.cpp.

+
60{};
+
+
+
+ +

◆ root

+ +
+
+ + + + + +
+ + + + +
Node* operations_on_datastructures::circular_linked_list::CircularLinkedList::root
+
+private
+
+ +

Pointer to the root Node.

+ +

Definition at line 59 of file circular_linked_list.cpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/dc/d53/classtests_1_1_circular_linked_list.js b/dc/d53/classtests_1_1_circular_linked_list.js new file mode 100644 index 000000000..13b8faa82 --- /dev/null +++ b/dc/d53/classtests_1_1_circular_linked_list.js @@ -0,0 +1,19 @@ +var classtests_1_1_circular_linked_list = +[ + [ "CircularLinkedList", "dc/d53/classtests_1_1_circular_linked_list.html#aa704319924f97fedfb41caf193a00888", null ], + [ "CircularLinkedList", "dc/d53/classtests_1_1_circular_linked_list.html#a142fa439b102c6f86341f421ddcfe0a1", null ], + [ "CircularLinkedList", "dc/d53/classtests_1_1_circular_linked_list.html#abde75f6ee432b0378d264da8c7c64db2", null ], + [ "~CircularLinkedList", "dc/d53/classtests_1_1_circular_linked_list.html#a46195fcf11b636064c7172cb74b55dd0", null ], + [ "erase", "dc/d53/classtests_1_1_circular_linked_list.html#a398d6cc927a2c8e4a156ae2806f48986", null ], + [ "insert", "dc/d53/classtests_1_1_circular_linked_list.html#ac38565472a07d07f63ec0d2fd8a69d4d", null ], + [ "insert", "dc/d53/classtests_1_1_circular_linked_list.html#a3b7bbb0918c261bc216aef9e6dd39aa4", null ], + [ "insert", "dc/d53/classtests_1_1_circular_linked_list.html#a15150d6d933c58190c9c1dd7d22c51ae", null ], + [ "operator=", "dc/d53/classtests_1_1_circular_linked_list.html#a8f26dc32615abc5bab8ac458ef424bc5", null ], + [ "operator=", "dc/d53/classtests_1_1_circular_linked_list.html#a9cc37166f2f73763df39894b675f89c9", null ], + [ "print", "dc/d53/classtests_1_1_circular_linked_list.html#ac341901e926b3fa3a796c64ca572f592", null ], + [ "print", "dc/d53/classtests_1_1_circular_linked_list.html#a424b17ddc672b25fe0bd9dc8612fba21", null ], + [ "values", "dc/d53/classtests_1_1_circular_linked_list.html#a53611ec1fef92eeeb875aea1bde1e4de", null ], + [ "values", "dc/d53/classtests_1_1_circular_linked_list.html#a03a896b34d27fda69049827e0c4dab42", null ], + [ "end", "dc/d53/classtests_1_1_circular_linked_list.html#ab682f854f39582a20c9c4102f0482208", null ], + [ "root", "dc/d53/classtests_1_1_circular_linked_list.html#a5d5cebd6bc906c60763fc6be10cfdd13", null ] +]; \ No newline at end of file diff --git a/dc/d55/structstd_1_1is__integral_3_01uint256__t_01_4__coll__graph.svg b/dc/d55/structstd_1_1is__integral_3_01uint256__t_01_4__coll__graph.svg index 353f2929e..b148ba046 100644 --- a/dc/d55/structstd_1_1is__integral_3_01uint256__t_01_4__coll__graph.svg +++ b/dc/d55/structstd_1_1is__integral_3_01uint256__t_01_4__coll__graph.svg @@ -1,7 +1,7 @@ - - - - - + TheAlgorithms/C++: backtracking/rat_maze.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + diff --git a/dc/d9a/class_h_k_graph__coll__graph_org.svg b/dc/d9a/class_h_k_graph__coll__graph_org.svg new file mode 100644 index 000000000..dcbfa596a --- /dev/null +++ b/dc/d9a/class_h_k_graph__coll__graph_org.svg @@ -0,0 +1,81 @@ + + + + + + +HKGraph + + +Node1 + + +HKGraph + + + + + +Node2 + + +std::vector< std::list +< int > > + + + + + +Node2->Node1 + + + + + + adj + + + +Node3 + + +std::list< int > + + + + + +Node3->Node2 + + + + + + elements + + + +Node4 + + +std::vector< int > + + + + + +Node4->Node1 + + + + + + dist +pair_u +pair_v + + + diff --git a/dc/d9c/babylonian__method_8cpp.html b/dc/d9c/babylonian__method_8cpp.html index b5035c8fb..c3f20e714 100644 --- a/dc/d9c/babylonian__method_8cpp.html +++ b/dc/d9c/babylonian__method_8cpp.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: numerical_methods/babylonian_method.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
unordered_set< K >::reverse_iterator Class Reference
+
+
+ +

STL iterator class. + More...

+

Detailed Description

+

STL iterator class.

+

The documentation for this class was generated from the following files:
+
+ + + + diff --git a/dc/daa/lru__cache2_8cpp.html b/dc/daa/lru__cache2_8cpp.html index 79d3eed6b..dc2db42d8 100644 --- a/dc/daa/lru__cache2_8cpp.html +++ b/dc/daa/lru__cache2_8cpp.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: others/lru_cache2.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + diff --git a/dc/dce/structtests_1_1_node__coll__graph_org.svg b/dc/dce/structtests_1_1_node__coll__graph_org.svg new file mode 100644 index 000000000..e0d119cc9 --- /dev/null +++ b/dc/dce/structtests_1_1_node__coll__graph_org.svg @@ -0,0 +1,51 @@ + + + + + + +tests::Node + + +Node1 + + +tests::Node + + + + + +Node2 + + +operations_on_datastructures +::circular_linked_list::Node + + + + + +Node2->Node1 + + + + + + next + + + +Node2->Node2 + + + + + + next + + + diff --git a/dc/dcf/vector__ops_8hpp__incl.svg b/dc/dcf/vector__ops_8hpp__incl.svg index 95a097dba..39f6667de 100644 --- a/dc/dcf/vector__ops_8hpp__incl.svg +++ b/dc/dcf/vector__ops_8hpp__incl.svg @@ -1,7 +1,7 @@ - - - diff --git a/dc/dd2/sha256_8cpp__incl_org.svg b/dc/dd2/sha256_8cpp__incl_org.svg index ac8611679..8789c1344 100644 --- a/dc/dd2/sha256_8cpp__incl_org.svg +++ b/dc/dd2/sha256_8cpp__incl_org.svg @@ -1,7 +1,7 @@ - - + TheAlgorithms/C++: Member List @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Entry Struct Reference
+
+
+ + + + + +

+Public Member Functions

 Entry (int key=notPresent)
 constructor
 
+ + + + +

+Public Attributes

int key
 key value
 
+

Detailed Description

+

Node object that holds key

+ +

Definition at line 36 of file double_hash_hash_table.cpp.

+

Constructor & Destructor Documentation

+ +

◆ Entry()

+ +
+
+ + + + + +
+ + + + + + + +
double_hashing::Entry::Entry (int key = notPresent)
+
+inlineexplicit
+
+ +

constructor

+ +

Definition at line 37 of file double_hash_hash_table.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ key

+ +
+
+ + + + +
int double_hashing::Entry::key
+
+ +

key value

+ +

Definition at line 38 of file double_hash_hash_table.cpp.

+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/dd/d3b/struct_entry.js b/dd/d3b/struct_entry.js new file mode 100644 index 000000000..1936d5b31 --- /dev/null +++ b/dd/d3b/struct_entry.js @@ -0,0 +1,5 @@ +var struct_entry = +[ + [ "Entry", "dd/d3b/struct_entry.html#a287b92112b6b43b34808a93778873475", null ], + [ "key", "dd/d3b/struct_entry.html#ae114967c89dbba3b754dc4976bba3248", null ] +]; \ No newline at end of file diff --git a/dd/d40/classdata__structures_1_1tree__234_1_1_node.html b/dd/d40/classdata__structures_1_1tree__234_1_1_node.html index 9fe5c2cfd..9fdd775ca 100644 --- a/dd/d40/classdata__structures_1_1tree__234_1_1_node.html +++ b/dd/d40/classdata__structures_1_1tree__234_1_1_node.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: data_structures::tree_234::Node Class Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
vector< T >::const_reverse_iterator Class Reference
+
+
+ +

STL iterator class. + More...

+

Detailed Description

+

STL iterator class.

+

The documentation for this class was generated from the following files:
+
+ + + + diff --git a/dd/d53/structdouble__hashing_1_1_entry-members.html b/dd/d53/structdouble__hashing_1_1_entry-members.html index 3f9dd19e0..9412949bd 100644 --- a/dd/d53/structdouble__hashing_1_1_entry-members.html +++ b/dd/d53/structdouble__hashing_1_1_entry-members.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: Member List @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
vector< T >::reverse_iterator Class Reference
+
+
+ +

STL iterator class. + More...

+

Detailed Description

+

STL iterator class.

+

The documentation for this class was generated from the following files:
+
+ + + + diff --git a/dd/d9a/namespacegreedy__algorithms_1_1stable__matching.html b/dd/d9a/namespacegreedy__algorithms_1_1stable__matching.html index 643dbc3fe..e8a532675 100644 --- a/dd/d9a/namespacegreedy__algorithms_1_1stable__matching.html +++ b/dd/d9a/namespacegreedy__algorithms_1_1stable__matching.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: greedy_algorithms::stable_matching Namespace Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
stats_computer2< T > Member List
+
+
+ +

This is the complete list of members for stats_computer2< T >, including all inherited members.

+ + + + + + + + + + +
M (defined in stats_computer2< T >)stats_computer2< T >private
mean() conststats_computer2< T >inline
mu (defined in stats_computer2< T >)stats_computer2< T >private
n (defined in stats_computer2< T >)stats_computer2< T >private
new_val(T x)stats_computer2< T >inline
operator>>(std::istream &input, stats_computer2 &stat)stats_computer2< T >friend
std() conststats_computer2< T >inline
var (defined in stats_computer2< T >)stats_computer2< T >private
variance() conststats_computer2< T >inline
+
+ + + + diff --git a/df/d97/main__cll_8cpp_source.html b/df/d97/main__cll_8cpp_source.html index f1a4441a7..c62ef63a9 100644 --- a/df/d97/main__cll_8cpp_source.html +++ b/df/d97/main__cll_8cpp_source.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: data_structures/cll/main_cll.cpp Source File @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
HKGraph Class Reference
+
+
+ +

Represents Bipartite graph for Hopcroft Karp implementation. + More...

+
+Collaboration diagram for HKGraph:
+
+
+
[legend]
+ + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

HKGraph ()
 Default Constructor for initialization.
 
 HKGraph (int m, int n)
 Constructor for initialization.
 
void addEdge (int u, int v)
 function to add edge from u to v
 
bool bfs ()
 This function checks for the possibility of augmented path availability.
 
bool dfs (int u)
 This functions checks whether an augmenting path is available exists beginning with free vertex u.
 
int hopcroftKarpAlgorithm ()
 This function counts the number of augmenting paths between left and right sides of the Bipartite graph.
 
+ + + + + + + + + + + + + + + + + + + + + + + +

+Private Attributes

int m {}
 m is the number of vertices on left side of Bipartite Graph
 
int n {}
 n is the number of vertices on right side of Bipartite Graph
 
const int NIL {0}
 
const int INF {INT_MAX}
 
std::vector< std::list< int > > adj
 adj[u] stores adjacents of left side and 0 is used for dummy vertex
 
std::vector< int > pair_u
 value of vertex 'u' ranges from 1 to m
 
std::vector< int > pair_v
 value of vertex 'v' ranges from 1 to n
 
std::vector< int > dist
 dist represents the distance between vertex 'u' and vertex 'v'
 
+

Detailed Description

+

Represents Bipartite graph for Hopcroft Karp implementation.

+ +

Definition at line 66 of file hopcroft_karp.cpp.

+

Constructor & Destructor Documentation

+ +

◆ HKGraph()

+ +
+
+ + + + + + + + + + + +
graph::HKGraph::HKGraph (int m,
int n )
+
+ +

Constructor for initialization.

+
Parameters
+ + + +
mis the number of vertices on left side of Bipartite Graph
nis the number of vertices on right side of Bipartite Graph
+
+
+ +

Definition at line 231 of file hopcroft_karp.cpp.

+
231 {
+
232 this->m = m;
+
233 this->n = n;
+
234 adj = std::vector<std::list<int> >(m + 1);
+
235}
+
std::vector< std::list< int > > adj
adj[u] stores adjacents of left side and 0 is used for dummy vertex
+
int m
m is the number of vertices on left side of Bipartite Graph
+
int n
n is the number of vertices on right side of Bipartite Graph
+
+
+
+

Member Function Documentation

+ +

◆ addEdge()

+ +
+
+ + + + + + + + + + + +
void graph::HKGraph::addEdge (int u,
int v )
+
+ +

function to add edge from u to v

+
Parameters
+ + + +
uis the position of first vertex
vis the position of second vertex
+
+
+ +

Definition at line 242 of file hopcroft_karp.cpp.

+
243{
+
244 adj[u].push_back(v); // Add v to u’s list.
+
245}
+
+
+
+ +

◆ bfs()

+ +
+
+ + + + + + + +
bool graph::HKGraph::bfs ()
+
+ +

This function checks for the possibility of augmented path availability.

+
Returns
true if there is an augmenting path available
+
+false if there is no augmenting path available
+ +

Definition at line 133 of file hopcroft_karp.cpp.

+
134{
+
135 std::queue<int> q; // an integer queue for bfs
+
136
+
137 // First layer of vertices (set distance as 0)
+
138 for (int u = 1; u <= m; u++)
+
139 {
+
140 // If this is a free vertex, add it to queue
+
141 if (pair_u[u] == NIL){
+
142
+
143 dist[u] = 0; // u is not matched so distance is 0
+
144 q.push(u);
+
145 }
+
146
+
147 else{
+
148 dist[u] = INF; // set distance as infinite so that this vertex is considered next time for availibility
+
149 }
+
150 }
+
151
+
152
+
153 dist[NIL] = INF; // Initialize distance to NIL as infinite
+
154
+
155 // q is going to contain vertices of left side only.
+
156 while (!q.empty())
+
157 {
+
158 int u = q.front(); // dequeue a vertex
+
159 q.pop();
+
160
+
161 // If this node is not NIL and can provide a shorter path to NIL then
+
162 if (dist[u] < dist[NIL])
+
163 {
+
164 // Get all the adjacent vertices of the dequeued vertex u
+
165 std::list<int>::iterator it;
+
166 for (it = adj[u].begin(); it != adj[u].end(); ++it)
+
167 {
+
168 int v = *it;
+
169
+
170 // If pair of v is not considered so far i.e. (v, pair_v[v]) is not yet explored edge.
+
171 if (dist[pair_v[v]] == INF)
+
172 {
+
173 dist[pair_v[v]] = dist[u] + 1;
+
174 q.push(pair_v[v]); // Consider the pair and push it to queue
+
175 }
+
176 }
+
177 }
+
178 }
+
179
+
180
+
181
+
182 return (dist[NIL] != INF); // If we could come back to NIL using alternating path of distinct vertices then there is an augmenting path available
+
183}
+
std::vector< int > dist
dist represents the distance between vertex 'u' and vertex 'v'
+
std::vector< int > pair_u
value of vertex 'u' ranges from 1 to m
+
std::vector< int > pair_v
value of vertex 'v' ranges from 1 to n
+
+
+
+ +

◆ dfs()

+ +
+
+ + + + + + + +
bool graph::HKGraph::dfs (int u)
+
+ +

This functions checks whether an augmenting path is available exists beginning with free vertex u.

+
Parameters
+ + +
urepresents position of vertex
+
+
+
Returns
true if there is an augmenting path beginning with free vertex u
+
+false if there is no augmenting path beginning with free vertex u
+ +

Definition at line 191 of file hopcroft_karp.cpp.

+
192{
+
193 if (u != NIL)
+
194 {
+
195 std::list<int>::iterator it;
+
196 for (it = adj[u].begin(); it != adj[u].end(); ++it)
+
197 {
+
198
+
199 int v = *it; // Adjacent vertex of u
+
200
+
201 // Follow the distances set by BFS search
+
202 if (dist[pair_v[v]] == dist[u] + 1)
+
203 {
+
204 // If dfs for pair of v also return true then new matching possible, store the matching
+
205 if (dfs(pair_v[v]) == true)
+
206 {
+
207 pair_v[v] = u;
+
208 pair_u[u] = v;
+
209 return true;
+
210 }
+
211 }
+
212 }
+
213
+
214
+
215 dist[u] = INF; // If there is no augmenting path beginning with u then set distance to infinite.
+
216 return false;
+
217 }
+
218 return true;
+
219}
+
bool dfs(int u)
This functions checks whether an augmenting path is available exists beginning with free vertex u.
+
+
+
+ +

◆ hopcroftKarpAlgorithm()

+ +
+
+ + + + + + + +
int graph::HKGraph::hopcroftKarpAlgorithm ()
+
+ +

This function counts the number of augmenting paths between left and right sides of the Bipartite graph.

+
Returns
size of maximum matching
+ +

Definition at line 95 of file hopcroft_karp.cpp.

+
96{
+
97
+
98 // pair_u[u] stores pair of u in matching on left side of Bipartite Graph.
+
99 // If u doesn't have any pair, then pair_u[u] is NIL
+
100 pair_u = std::vector<int>(m + 1,NIL);
+
101
+
102 // pair_v[v] stores pair of v in matching on right side of Biparite Graph.
+
103 // If v doesn't have any pair, then pair_u[v] is NIL
+
104 pair_v = std::vector<int>(n + 1,NIL);
+
105
+
106 dist = std::vector<int>(m + 1); // dist[u] stores distance of left side vertices
+
107
+
108 int result = 0; // Initialize result
+
109
+
110 // Keep updating the result while there is an augmenting path possible.
+
111 while (bfs())
+
112 {
+
113 // Find a free vertex to check for a matching
+
114 for (int u = 1; u <= m; u++){
+
115
+
116 // If current vertex is free and there is
+
117 // an augmenting path from current vertex
+
118 // then increment the result
+
119 if (pair_u[u] == NIL && dfs(u)){
+
120 result++;
+
121 }
+
122 }
+
123 }
+
124 return result;
+
125}
+
bool bfs()
This function checks for the possibility of augmented path availability.
+
uint64_t result(uint64_t n)
+
+
+
+

Member Data Documentation

+ +

◆ adj

+ +
+
+ + + + + +
+ + + + +
std::vector<std::list<int> > graph::HKGraph::adj
+
+private
+
+ +

adj[u] stores adjacents of left side and 0 is used for dummy vertex

+ +

Definition at line 73 of file hopcroft_karp.cpp.

+ +
+
+ +

◆ dist

+ +
+
+ + + + + +
+ + + + +
std::vector<int> graph::HKGraph::dist
+
+private
+
+ +

dist represents the distance between vertex 'u' and vertex 'v'

+ +

Definition at line 77 of file hopcroft_karp.cpp.

+ +
+
+ +

◆ INF

+ +
+
+ + + + + +
+ + + + +
const int graph::HKGraph::INF {INT_MAX}
+
+private
+
+ +

Definition at line 71 of file hopcroft_karp.cpp.

+
71{INT_MAX};
+
+
+
+ +

◆ m

+ +
+
+ + + + + +
+ + + + +
int graph::HKGraph::m {}
+
+private
+
+ +

m is the number of vertices on left side of Bipartite Graph

+ +

Definition at line 68 of file hopcroft_karp.cpp.

+
68{};
+
+
+
+ +

◆ n

+ +
+
+ + + + + +
+ + + + +
int graph::HKGraph::n {}
+
+private
+
+ +

n is the number of vertices on right side of Bipartite Graph

+ +

Definition at line 69 of file hopcroft_karp.cpp.

+
69{};
+
+
+
+ +

◆ NIL

+ +
+
+ + + + + +
+ + + + +
const int graph::HKGraph::NIL {0}
+
+private
+
+ +

Definition at line 70 of file hopcroft_karp.cpp.

+
70{0};
+
+
+
+ +

◆ pair_u

+ +
+
+ + + + + +
+ + + + +
std::vector<int> graph::HKGraph::pair_u
+
+private
+
+ +

value of vertex 'u' ranges from 1 to m

+ +

Definition at line 75 of file hopcroft_karp.cpp.

+ +
+
+ +

◆ pair_v

+ +
+
+ + + + + +
+ + + + +
std::vector<int> graph::HKGraph::pair_v
+
+private
+
+ +

value of vertex 'v' ranges from 1 to n

+ +

Definition at line 76 of file hopcroft_karp.cpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/df/dee/class_h_k_graph.js b/df/dee/class_h_k_graph.js new file mode 100644 index 000000000..8b3a9aca9 --- /dev/null +++ b/df/dee/class_h_k_graph.js @@ -0,0 +1,15 @@ +var class_h_k_graph = +[ + [ "HKGraph", "df/dee/class_h_k_graph.html#af02b0c83911070ac6d95fc9905e58aa9", null ], + [ "HKGraph", "df/dee/class_h_k_graph.html#a0da5aa674d3b3e54a38251ee60d7cd64", null ], + [ "addEdge", "df/dee/class_h_k_graph.html#a3b49011c09cf90a116ab53bef61cd95a", null ], + [ "bfs", "df/dee/class_h_k_graph.html#a7491add14d9fc04f679114ca6d6f0f93", null ], + [ "dfs", "df/dee/class_h_k_graph.html#ae794950cb3407b6b47d3dc986cf714c0", null ], + [ "hopcroftKarpAlgorithm", "df/dee/class_h_k_graph.html#a9dbda80d02bdc26c3e8ff7330c9be75d", null ], + [ "adj", "df/dee/class_h_k_graph.html#a35893def7a1c5cd60907b4893117796f", null ], + [ "dist", "df/dee/class_h_k_graph.html#a6a0228bbba3818447fcf6b56128b552a", null ], + [ "m", "df/dee/class_h_k_graph.html#a3d9101e3b4598159005fd028b9b0ff74", null ], + [ "n", "df/dee/class_h_k_graph.html#a6f5a9fdbb83ef731d739ba6707e21c3c", null ], + [ "pair_u", "df/dee/class_h_k_graph.html#a86ebff8a70cbfedd05281993d5d1987b", null ], + [ "pair_v", "df/dee/class_h_k_graph.html#a976ee239402cc2726a280e781c706d77", null ] +]; \ No newline at end of file diff --git a/df/def/power__for__huge__numbers_8cpp.html b/df/def/power__for__huge__numbers_8cpp.html index 91036b8d2..fbd9de394 100644 --- a/df/def/power__for__huge__numbers_8cpp.html +++ b/df/def/power__for__huge__numbers_8cpp.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: math/power_for_huge_numbers.cpp File Reference @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented functions with links to the documentation:
+ +

- k -

+
+
+ + + + diff --git a/globals_func_l.html b/globals_func_l.html index 89500f9f7..14ca71abf 100644 --- a/globals_func_l.html +++ b/globals_func_l.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: File Members @@ -60,7 +60,7 @@ window.MathJax = { - + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
TheAlgorithms/C++ 1.0.0 +
+
All the algorithms implemented in C++
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented file members with links to the documentation:
+ +

- k -

+
+
+ + + + diff --git a/globals_l.html b/globals_l.html index 1728a1e0b..4012617a6 100644 --- a/globals_l.html +++ b/globals_l.html @@ -4,7 +4,7 @@ - + TheAlgorithms/C++: File Members @@ -60,7 +60,7 @@ window.MathJax = { - +