From 08e8eb037e70096035599eddd1324fa9d80a6c2d Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Fri, 3 Sep 2021 19:56:17 +0000 Subject: [PATCH] Documentation for 341ed50da8593680c4791b02b1c5908fd52977c3 --- annotated.html | 81 +- annotated_dup.js | 54 +- classes.html | 69 +- d0/d01/smallest__circle_8cpp.html | 307 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 2 +- ...86819c7c140a023582b7269e2d0_cgraph_org.svg | 2 +- ...b0676df8e4da7a08c7ccaecea344903_cgraph.svg | 2 +- ...cbebd6f4d2cdf227663c67fe41ba12a_cgraph.svg | 2 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.svg | 2 +- ...5dd5c30adda100e95f0423c786e_cgraph_org.svg | 2 +- ...4682a4a70d5906857ca09de5b9fb2cc_cgraph.svg | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 2 +- ...68e7947464bee7714f6d43b7002_cgraph_org.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 2 +- ...e6d48762c1dfb9f14627927f0c16fad_cgraph.svg | 2 +- d0/d04/qr__decompose_8h__incl.svg | 2 +- d0/d08/realtime__stats_8cpp.html | 199 +- d0/d08/realtime__stats_8cpp.js | 4 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 2 +- ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 2 +- ...54c915581fcc495489175a4386d59fd_cgraph.svg | 2 +- d0/d0d/structmst-members.html | 33 +- d0/d1f/structnode__coll__graph.map | 3 +- d0/d1f/structnode__coll__graph.md5 | 2 +- d0/d1f/structnode__coll__graph.svg | 55 +- ...lassgraph_1_1_rooted_tree__coll__graph.map | 8 +- ...lassgraph_1_1_rooted_tree__coll__graph.md5 | 2 +- ...lassgraph_1_1_rooted_tree__coll__graph.svg | 92 +- d0/d2c/class_r_btree__coll__graph.svg | 2 +- ...ecomposition_1_1_h_l_d__inherit__graph.svg | 2 +- ...__for__fast__multiplication_8cpp__incl.svg | 2 +- d0/d2e/namespaceneural__network.html | 33 +- d0/d3e/classdata__structures_1_1trie.html | 271 +- ...99f87fd833203ef9492b4870aa6d42d_cgraph.svg | 2 +- ...b373beb3f618b90922528c68797d988_cgraph.svg | 2 +- ...ac27cfd397d2dd3f2f519efffafeeab_cgraph.md5 | 2 +- ...ac27cfd397d2dd3f2f519efffafeeab_cgraph.svg | 10 +- ...umber__of__digits__in__a__number_8cpp.html | 261 ++ ..._number__of__digits__in__a__number_8cpp.js | 6 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 4 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 38 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 53 + ...tree__traversals_1_1_node__coll__graph.svg | 2 +- d0/d52/namespacewiggle__sort.html | 35 +- d0/d55/classcll-members.html | 41 +- d0/d58/classgraph_1_1_rooted_tree.html | 119 +- ...6928f3ebd491541e9570e746b877c1e_cgraph.map | 5 +- ...6928f3ebd491541e9570e746b877c1e_cgraph.md5 | 2 +- ...6928f3ebd491541e9570e746b877c1e_cgraph.svg | 59 +- d0/d59/uint256__t_8hpp__dep__incl.svg | 2 +- d0/d5a/skip__list_8cpp.html | 89 +- d0/d5a/skip__list_8cpp.js | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...uctures_1_1trie__operations_1_1_tnode.html | 685 ++-- ...tructures_1_1trie__operations_1_1_tnode.js | 12 +- ...97913c4badec2b60d50a171ecc299fe_cgraph.map | 4 +- ...97913c4badec2b60d50a171ecc299fe_cgraph.md5 | 2 +- ...97913c4badec2b60d50a171ecc299fe_cgraph.svg | 16 +- ...8b70172ca4fb2811dbfb9a86e48b34c_cgraph.map | 2 +- ...8b70172ca4fb2811dbfb9a86e48b34c_cgraph.md5 | 2 +- ...8b70172ca4fb2811dbfb9a86e48b34c_cgraph.svg | 40 +- ...c5ab271d8042540f64ef16d259d1503_cgraph.map | 4 +- ...c5ab271d8042540f64ef16d259d1503_cgraph.md5 | 2 +- ...c5ab271d8042540f64ef16d259d1503_cgraph.svg | 52 +- ...e556f52c837190ecf4265b1f05cfe9c_cgraph.map | 4 +- ...e556f52c837190ecf4265b1f05cfe9c_cgraph.md5 | 2 +- ...e556f52c837190ecf4265b1f05cfe9c_cgraph.svg | 16 +- ...cafb8c9f3ebac7ac6c01d9645bb67b6_cgraph.svg | 2 +- ...ef6940391f981ab86767775176b7169_cgraph.map | 4 +- ...ef6940391f981ab86767775176b7169_cgraph.md5 | 2 +- ...ef6940391f981ab86767775176b7169_cgraph.svg | 18 +- ...fd24626ac47277431c9b8604e064340_cgraph.map | 12 +- ...fd24626ac47277431c9b8604e064340_cgraph.md5 | 2 +- ...fd24626ac47277431c9b8604e064340_cgraph.svg | 26 +- ...ca808362c13273ca8c8ae7d58e8eee0_cgraph.svg | 2 +- ...ratic__probing__hash__table_8cpp__incl.svg | 2 +- d0/d62/struct_queue-members.html | 41 +- d0/d65/namespacedouble__hashing.html | 373 ++- d0/d65/namespacedouble__hashing.js | 9 +- ...e901418c759627557eff359b8db38cd_cgraph.svg | 2 +- ...8083ecac6eb94b643281875c8665931_cgraph.svg | 2 +- ...ecac6eb94b643281875c8665931_cgraph_org.svg | 2 +- ...d06e4598569526294f10104875f6824_cgraph.svg | 2 +- ...4598569526294f10104875f6824_cgraph_org.svg | 2 +- ...9a9c914a6c68275b3640303d7faad8a_cgraph.svg | 2 +- ...f8ff4fb018e1bb32d67d8a1885d3200_cgraph.svg | 2 +- ...c652b2e467e5d250dfe3bed83b12560_cgraph.svg | 2 +- ...b2e467e5d250dfe3bed83b12560_cgraph_org.svg | 2 +- ...4981819aae8bc7e7beeaef02615e30d_cgraph.svg | 2 +- ...819aae8bc7e7beeaef02615e30d_cgraph_org.svg | 2 +- d0/d6d/modular__exponentiation_8cpp.html | 99 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d0/d6f/namespaceothers.html | 45 +- d0/d6f/namespaceothers.js | 4 +- d0/d77/linear__search_8cpp__incl.svg | 2 +- ...ongest__palindromic__subsequence_8cpp.html | 171 +- ...f73ddd8cd83d784036f131dfc6540c4_cgraph.svg | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...tatistics_1_1stats__computer1-members.html | 41 +- d0/d83/n__queens_8cpp__incl.svg | 2 +- d0/da1/string__fibonacci_8cpp__incl.svg | 2 +- .../number__of__positive__divisors_8cpp.html | 157 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d0/dab/interpolation__search_8cpp__incl.svg | 2 +- d0/db1/check__factorial_8cpp__incl.svg | 2 +- d0/db5/trie__modern_8cpp__incl.svg | 2 +- d0/db6/non__recursive__merge__sort_8cpp.html | 92 +- d0/db6/non__recursive__merge__sort_8cpp.js | 1 - d0/db7/smallest__circle_8cpp__incl.svg | 2 +- d0/dc4/struct_point-members.html | 35 +- d0/dcc/modular__division_8cpp__incl.svg | 2 +- .../successive__approximation_8cpp__incl.svg | 2 +- d0/dd1/binaryheap_8cpp__incl.svg | 2 +- d0/dd3/modular__exponentiation_8cpp__incl.svg | 2 +- .../classciphers_1_1_hill_cipher-members.html | 51 +- d0/dd5/ode__midpoint__euler_8cpp__incl.svg | 2 +- d0/dda/namespacesaddleback.html | 35 +- d0/de2/gaussian__elimination_8cpp.html | 179 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- d0/df8/namespaceabbreviation.html | 35 +- d0/dfc/sqrt__double_8cpp__incl.svg | 2 +- ..._first__search__with__stack_8cpp__incl.svg | 2 +- ...__search_1_1_eight_puzzle__coll__graph.map | 6 - ...__search_1_1_eight_puzzle__coll__graph.md5 | 1 - ...__search_1_1_eight_puzzle__coll__graph.svg | 74 - d0/dff/structlinkedlist.html | 37 +- d0/dff/structlinkedlist.js | 5 - d1/d06/ternary__search_8cpp__incl.svg | 2 +- d1/d07/class_solution-members.html | 39 +- d1/d11/gcd__of__n__numbers_8cpp.html | 103 +- ...5034543c20f271da04fb24ad2b2747a_cgraph.map | 3 + ...5034543c20f271da04fb24ad2b2747a_cgraph.md5 | 1 + ...5034543c20f271da04fb24ad2b2747a_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 32 +- ...s_1_1linked__list_1_1list__coll__graph.map | 4 - ...s_1_1linked__list_1_1list__coll__graph.md5 | 1 - ...s_1_1linked__list_1_1list__coll__graph.svg | 42 - d1/d1d/class_graph-members.html | 71 +- d1/d1d/pascal__triangle_8cpp__incl.svg | 2 +- ...1_1trie__operations_1_1_tnode-members.html | 51 +- d1/d21/quick__sort_8cpp.html | 122 +- d1/d21/quick__sort_8cpp.js | 3 +- d1/d2a/knight__tour_8cpp.html | 103 +- d1/d33/caesar__cipher_8cpp__incl.svg | 2 +- .../queue__using__two__stacks_8cpp__incl.svg | 2 +- ...st__increasing__subsequence_8cpp__incl.svg | 2 +- ...__of__digits__in__a__number_8cpp__incl.map | 5 + ...__of__digits__in__a__number_8cpp__incl.md5 | 1 + ...__of__digits__in__a__number_8cpp__incl.svg | 53 + ...__least__squares__regressor_8cpp__incl.svg | 2 +- ...1heavy__light__decomposition_1_1_tree.html | 308 +- ...1_1heavy__light__decomposition_1_1_tree.js | 1 - ...4cd96efaba147b19d3afc769b90ff70_cgraph.svg | 2 +- ...9ab4601c4a95c0902ac04e779e5f54d_cgraph.map | 4 - ...9ab4601c4a95c0902ac04e779e5f54d_cgraph.md5 | 1 - ...9ab4601c4a95c0902ac04e779e5f54d_cgraph.svg | 39 - ...35fb2bbb27307b8cacad9b287968bc1_cgraph.map | 5 - ...35fb2bbb27307b8cacad9b287968bc1_cgraph.md5 | 1 - ...35fb2bbb27307b8cacad9b287968bc1_cgraph.svg | 54 - ...f7bca1746d40f21ad832fcea59aa6c6_cgraph.svg | 2 +- ...339c31ec74cd86a4842a8b09653d460_cgraph.map | 3 + ...339c31ec74cd86a4842a8b09653d460_cgraph.md5 | 1 + ...339c31ec74cd86a4842a8b09653d460_cgraph.svg | 30 + ...22d760a5a33545a70e7ea5e1786c8dc_cgraph.map | 6 +- ...22d760a5a33545a70e7ea5e1786c8dc_cgraph.md5 | 2 +- ...22d760a5a33545a70e7ea5e1786c8dc_cgraph.svg | 48 +- ...2b407e64aaf9878fbee7ee6efe9c7d4_cgraph.svg | 2 +- ...8de7aefcb6635d3dacdd174cd4890c4_cgraph.map | 3 + ...8de7aefcb6635d3dacdd174cd4890c4_cgraph.md5 | 1 + ...8de7aefcb6635d3dacdd174cd4890c4_cgraph.svg | 30 + d1/d52/lcm__sum_8cpp__incl.svg | 2 +- d1/d57/classcll__coll__graph.svg | 2 +- ...ic_3_01uint256__t_01_4__inherit__graph.svg | 2 +- d1/d64/namespacemodular__division.html | 35 +- ...ht__decomposition_1_1_s_g__coll__graph.map | 4 - ...ht__decomposition_1_1_s_g__coll__graph.md5 | 1 - ...ht__decomposition_1_1_s_g__coll__graph.svg | 40 - d1/d6d/lru__cache_8cpp__incl.svg | 2 +- d1/d6d/queue__using__array_8cpp__incl.svg | 2 +- d1/d6f/vector__ops_8hpp__dep__incl.svg | 2 +- ..._1_lowest_common_ancestor__coll__graph.map | 10 +- ..._1_lowest_common_ancestor__coll__graph.md5 | 2 +- ..._1_lowest_common_ancestor__coll__graph.svg | 117 +- d1/d73/jarvis__algorithm_8cpp__incl.svg | 2 +- d1/d76/buzz__number_8cpp.html | 63 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d1/d77/structmst.html | 39 +- d1/d77/structmst.js | 6 - d1/d7d/gcd__of__n__numbers_8cpp__incl.svg | 2 +- d1/d83/classuint256__t.html | 1221 ++++--- d1/d83/classuint256__t.js | 53 +- ...0d18c74d5cbf3c087665172079e67dd_cgraph.md5 | 1 - ...33d66c965e8d1fbc5bafb59ad60e163_cgraph.svg | 2 +- ...fa3d95584d071add9b46597d3747b39_cgraph.svg | 2 +- ...d43a4a92dc825a010a17578b3bdedb_cgraph.map} | 2 +- ...cd43a4a92dc825a010a17578b3bdedb_cgraph.md5 | 1 + ...d43a4a92dc825a010a17578b3bdedb_cgraph.svg} | 4 +- ...45040fe68ff01d83400f173fd2bb21_cgraph.map} | 0 ...45040fe68ff01d83400f173fd2bb21_cgraph.md5} | 0 ...45040fe68ff01d83400f173fd2bb21_cgraph.svg} | 2 +- ...fdeb4d4bf8cca4ee99b8487e59831df_cgraph.map | 2 +- ...fdeb4d4bf8cca4ee99b8487e59831df_cgraph.md5 | 2 +- ...fdeb4d4bf8cca4ee99b8487e59831df_cgraph.svg | 4 +- ...9a697fc2ee38e46506a80ddf405c188_cgraph.md5 | 1 - ...61d52d369e525f4e61129376adfcf1_cgraph.map} | 0 ...61d52d369e525f4e61129376adfcf1_cgraph.md5} | 0 ...61d52d369e525f4e61129376adfcf1_cgraph.svg} | 2 +- ...aab081bb7db2771e4a4f30c3eed8e2_cgraph.map} | 0 ...aab081bb7db2771e4a4f30c3eed8e2_cgraph.md5} | 0 ...aab081bb7db2771e4a4f30c3eed8e2_cgraph.svg} | 2 +- ...ddd133cee83f3a2ab6ed60a7ccbc250_cgraph.svg | 2 +- ...9e585b186e71d7cbe9c1d7387c38967_cgraph.svg | 2 +- ...b36e64de42f3622e7d6ec5efa273d4_cgraph.map} | 2 +- ...1b36e64de42f3622e7d6ec5efa273d4_cgraph.md5 | 1 + ...b36e64de42f3622e7d6ec5efa273d4_cgraph.svg} | 4 +- ...4928175eaaaa2b559bc945affe63ad2_cgraph.map | 2 +- ...4928175eaaaa2b559bc945affe63ad2_cgraph.md5 | 2 +- ...4928175eaaaa2b559bc945affe63ad2_cgraph.svg | 4 +- ...ee82fa5052e9d8c946b9205b943cec4_cgraph.svg | 2 +- ...classdata__structures_1_1trie-members.html | 39 +- d1/d90/subarray__sum_8cpp__incl.svg | 2 +- d1/d9a/hopcroft__karp_8cpp.html | 199 +- d1/d9a/hopcroft__karp_8cpp.js | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.map | 8 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 120 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 10 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 260 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 146 - .../decimal__to__hexadecimal_8cpp__incl.svg | 2 +- d1/da6/rungekutta_8cpp.html | 191 +- ...b9f40c7b5e9749cc550f19be3dc8856_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d1/daa/random__pivot__quick__sort_8cpp.html | 275 +- d1/daa/random__pivot__quick__sort_8cpp.js | 6 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...224851353fc92bfbff6f499fa97_cgraph_org.svg | 2 +- ...1c39e1ff42c04fb8ec0c0b9411cd3e_cgraph.map} | 0 ...1c39e1ff42c04fb8ec0c0b9411cd3e_cgraph.md5} | 0 ...1c39e1ff42c04fb8ec0c0b9411cd3e_cgraph.svg} | 2 +- ...675d2eb960c71ca31ec475ba90120d_cgraph.map} | 0 ...675d2eb960c71ca31ec475ba90120d_cgraph.md5} | 0 ...675d2eb960c71ca31ec475ba90120d_cgraph.svg} | 2 +- ...2e7465e7b5d54c2de6d5e9db1ea6a5_cgraph.map} | 0 ...2e7465e7b5d54c2de6d5e9db1ea6a5_cgraph.md5} | 0 ...2e7465e7b5d54c2de6d5e9db1ea6a5_cgraph.svg} | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...7b867074164d5f45b0f3851269d_cgraph_org.svg | 2 +- ...c5657b4fe2251cd21073f44233f6ea5_cgraph.svg | 2 +- ...3281dc34a9cfd7beb332419b8a0aa10_cgraph.svg | 2 +- ...egral_3_01uint128__t_01_4__coll__graph.svg | 2 +- d1/db3/structcompare.html | 76 +- d1/db3/structcompare.js | 4 - d1/dbb/n__choose__r_8cpp.html | 99 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...__ciphers__in__factorial__n_8cpp__incl.svg | 2 +- d1/dbe/lu__decomposition_8h.html | 181 +- ...108d43bd32c6fb3b3c158476c51ba7f_cgraph.svg | 2 +- ...5b8a228c6419ecda6077255d6d60509_cgraph.svg | 2 +- d1/dbe/lu__decomposition_8h_source.html | 237 +- ...__traversal__of__bst_1_1_node-members.html | 33 +- d1/dc2/class_graph__coll__graph.map | 13 +- d1/dc2/class_graph__coll__graph.md5 | 2 +- d1/dc2/class_graph__coll__graph.svg | 153 +- d1/dc2/classstack.html | 299 +- d1/dc2/classstack.js | 2 +- ...7f65710c376f67d1ba3bde45a9cb628_cgraph.svg | 2 +- ...cd4b95d5de00d41b2491392338384dc_cgraph.svg | 2 +- d1/dc5/classlarge__number__coll__graph.map | 4 - d1/dc5/classlarge__number__coll__graph.md5 | 1 - d1/dc5/classlarge__number__coll__graph.svg | 39 - d1/dc7/linear__probing__hash__table_8cpp.html | 183 +- d1/dc7/linear__probing__hash__table_8cpp.js | 11 +- d1/dcc/wiggle__sort_8cpp.html | 103 +- d1/dcc/wiggle__sort_8cpp.js | 2 +- ...eeded693ac073717282fae365957a1_cgraph.map} | 0 ...eeded693ac073717282fae365957a1_cgraph.md5} | 0 ...eeded693ac073717282fae365957a1_cgraph.svg} | 2 +- d1/dce/classuint256__t__coll__graph.svg | 2 +- ...hashmap_1_1_trie_1_1_node__coll__graph.map | 5 - ...hashmap_1_1_trie_1_1_node__coll__graph.md5 | 1 - ...hashmap_1_1_trie_1_1_node__coll__graph.svg | 149 - ...map_1_1_trie_1_1_node__coll__graph_org.svg | 61 - d1/de0/namespacenumerical__methods.html | 39 +- ..._decomposition_1_1_s_g__inherit__graph.svg | 2 +- ...etry_1_1jarvis_1_1_convexhull-members.html | 35 +- d1/de9/integral__approximation_8cpp.html | 144 +- d1/de9/integral__approximation_8cpp.js | 1 - ...ng__hashmap_1_1_trie_1_1_node-members.html | 33 +- ...a__structures_1_1linked__list_1_1list.html | 247 +- ...ata__structures_1_1linked__list_1_1list.js | 1 - ...98be172c737f236763afdb8cada4835_cgraph.svg | 2 +- ...fb1792ab867dc26639eef368a56989e_cgraph.svg | 2 +- ...c73f393e984f93f33852334d1a04be0_cgraph.svg | 2 +- ...f7c97616b873ffeebdd0eac2d19d13e_cgraph.svg | 2 +- ...585670a392c7e842c992d088093dff5_cgraph.svg | 2 +- d1/df2/structnode-members.html | 49 +- d1/df3/hash__search_8cpp.html | 239 +- ...6ea13c16028f18ef2d5ff47f3fda7a2_cgraph.svg | 2 +- ...0831425f1389166a9518f422d0c6ec5_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d1/df6/bidirectional__dijkstra_8cpp__incl.svg | 2 +- d1/df9/qr__decomposition_8cpp__incl.svg | 2 +- d2/d05/class_min_heap.html | 277 +- d2/d05/class_min_heap.js | 2 - ...7ac126eabb0c3ce04047172abccca29_cgraph.svg | 2 +- ...7f726cc6327955d22871592227432f5_cgraph.svg | 2 +- ...ef438c1056492cb62c4a4d9035b5cad_cgraph.md5 | 2 +- ...ef438c1056492cb62c4a4d9035b5cad_cgraph.svg | 12 +- ...f78f3384f5a0ae880ad0883d2d44b82_cgraph.svg | 2 +- d2/d0b/fast__power_8cpp.html | 185 +- ...d4e3f0099a6975b74a314a35bd0f94d_cgraph.map | 3 + ...d4e3f0099a6975b74a314a35bd0f94d_cgraph.md5 | 1 + ...d4e3f0099a6975b74a314a35bd0f94d_cgraph.svg | 28 + ...399b847626e5bba983cab7c7918b445_cgraph.map | 3 + ...399b847626e5bba983cab7c7918b445_cgraph.md5 | 1 + ...399b847626e5bba983cab7c7918b445_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 16 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 50 +- d2/d1a/vigenere__cipher_8cpp__incl.svg | 2 +- d2/d21/gnome__sort_8cpp.html | 151 +- d2/d21/gnome__sort_8cpp.js | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d2/d22/jump__search_8cpp.html | 136 +- d2/d22/jump__search_8cpp.js | 3 +- ...49fd8f401bfc71f63b74711390cccf0_cgraph.svg | 2 +- d2/d23/neural__network_8cpp__incl.svg | 2 +- d2/d23/neural__network_8cpp__incl_org.svg | 2 +- d2/d26/addition__rule_8cpp__incl.svg | 2 +- d2/d26/count__inversions_8cpp.html | 265 +- ...332498eabf6579ef059c0d0e9f4ec80_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...97a486e14101c4822ea8dc47f0d1661_cgraph.map | 6 +- ...97a486e14101c4822ea8dc47f0d1661_cgraph.md5 | 2 +- ...97a486e14101c4822ea8dc47f0d1661_cgraph.svg | 42 +- d2/d2c/structtower.html | 43 +- ...tgeometry_1_1jarvis_1_1_point-members.html | 33 +- d2/d38/pancake__sort_8cpp__incl.svg | 2 +- d2/d3b/namespaceqr__algorithm.html | 495 ++- ...7425cb2365359da51c6fe6741834d8_cgraph.map} | 0 ...7425cb2365359da51c6fe6741834d8_cgraph.md5} | 0 ...7425cb2365359da51c6fe6741834d8_cgraph.svg} | 2 +- ...e2fa3e803abaea6c568dc45d69d8cc_cgraph.map} | 8 +- ...8e2fa3e803abaea6c568dc45d69d8cc_cgraph.md5 | 1 + ...e2fa3e803abaea6c568dc45d69d8cc_cgraph.svg} | 12 +- ...3e803abaea6c568dc45d69d8cc_cgraph_org.svg} | 10 +- ...3c7dce1f142141f509d09f6c0e25dc_cgraph.map} | 0 ...3c7dce1f142141f509d09f6c0e25dc_cgraph.md5} | 0 ...3c7dce1f142141f509d09f6c0e25dc_cgraph.svg} | 2 +- ...ce637634fc49e1d10d190eb388ebf1_cgraph.map} | 4 +- ...3ce637634fc49e1d10d190eb388ebf1_cgraph.md5 | 1 + ...ce637634fc49e1d10d190eb388ebf1_cgraph.svg} | 6 +- ...63896dbb4a7e95c4a1e614ac0819d66_cgraph.md5 | 1 - ...1ac74497ffb2101040cc1efe3546de8_cgraph.md5 | 1 - ...16da2183db22378435042f26af43d5f_cgraph.svg | 2 +- ...bdf47277c8cfee229b05b72f1f7834_cgraph.map} | 0 ...bdf47277c8cfee229b05b72f1f7834_cgraph.md5} | 0 ...bdf47277c8cfee229b05b72f1f7834_cgraph.svg} | 2 +- d2/d4b/spirograph_8cpp__incl.svg | 2 +- d2/d4b/spirograph_8cpp__incl_org.svg | 2 +- d2/d52/heap__sort_8cpp.html | 112 +- d2/d52/heap__sort_8cpp.js | 1 - ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d2/d58/neural__network_8cpp.html | 173 +- d2/d58/neural__network_8cpp.js | 4 +- ...3aa9d32bcbcd65cfc85f0a41e2afadc_cgraph.svg | 2 +- ...a5e874b9774aa5362dbcf288828b95c_cgraph.svg | 2 +- ...2c00da08f2cf641dd336270f6e3c407_cgraph.svg | 2 +- ...71aa7dd5d5add0143d1756bb0a1b32f_cgraph.svg | 2 +- ...5d3e30406712ada3d9713ece3c1b153_cgraph.svg | 2 +- ...6eb66212d577f948a457b6e29d87c46_cgraph.svg | 2 +- ...69e95a34054d7989bf446f96b2ffaf9_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 36 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 38 +- ...7b867074164d5f45b0f3851269d_cgraph_org.svg | 38 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 36 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 38 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 38 +- ...8f264600754602b6a9ea19cc690e50e_cgraph.svg | 2 +- d2/d5a/subset__sum_8cpp.html | 179 +- ...cb50d36a59427a33f64a266dac83d99_cgraph.map | 2 +- ...cb50d36a59427a33f64a266dac83d99_cgraph.md5 | 2 +- ...cb50d36a59427a33f64a266dac83d99_cgraph.svg | 4 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d2/d5f/merge__sort_8cpp__incl.svg | 2 +- d2/d66/binary__search_8cpp__incl.svg | 2 +- d2/d73/word__break_8cpp__incl.svg | 2 +- ...iptic__curve__key__exchange_8cpp__incl.svg | 2 +- ...tent__seg__tree__lazy__prop_8cpp__incl.svg | 2 +- d2/d89/median__search_8cpp__incl.svg | 2 +- ...heavy__light__decomposition_1_1_h_l_d.html | 293 +- ...579062b384e54b611b80c6337c7f2c8_cgraph.map | 3 + ...579062b384e54b611b80c6337c7f2c8_cgraph.md5 | 1 + ...579062b384e54b611b80c6337c7f2c8_cgraph.svg | 30 + ...dfbda148aad0bfaba2ebfda9ebc915a_cgraph.map | 3 + ...dfbda148aad0bfaba2ebfda9ebc915a_cgraph.md5 | 1 + ...dfbda148aad0bfaba2ebfda9ebc915a_cgraph.svg | 30 + ...dfbf5d9df825eeb63b294c6849bdcab_cgraph.svg | 2 +- ...d5b40c076347a6aabfb37a0590f2f24_cgraph.svg | 2 +- ...f1cb54ed09fde931bf3220d75ee4c57_cgraph.svg | 2 +- ...9e979edd69678b85665c01e2ee97828_cgraph.map | 14 +- ...9e979edd69678b85665c01e2ee97828_cgraph.md5 | 2 +- ...9e979edd69678b85665c01e2ee97828_cgraph.svg | 134 +- ...64848d6630c39d0f09ce2359cc7c4f8_cgraph.map | 3 + ...64848d6630c39d0f09ce2359cc7c4f8_cgraph.md5 | 1 + ...64848d6630c39d0f09ce2359cc7c4f8_cgraph.svg | 30 + ...1iterative__tree__traversals_1_1_node.html | 47 +- ...aversal__of__bst_1_1_node__coll__graph.svg | 2 +- d2/dc4/classstack__linked_list.html | 170 +- d2/dc4/classstack__linked_list.js | 9 - ...e__traversals_1_1_binary_tree-members.html | 35 +- d2/dcf/namespacestatistics.html | 35 +- ...d_1_1is__integral_3_01uint128__t_01_4.html | 31 +- d2/ddd/gaussian__elimination_8cpp__incl.svg | 2 +- d2/de1/namespacehouse__robber.html | 35 +- ...ructlinear__probing_1_1_entry-members.html | 33 +- d2/de7/namespacerunge__kutta.html | 35 +- d2/de9/heavy__light__decomposition_8cpp.html | 317 +- d2/de9/heavy__light__decomposition_8cpp.js | 6 +- ...4b8683a2b429de5cce57e6d733ec817_cgraph.map | 40 +- ...4b8683a2b429de5cce57e6d733ec817_cgraph.md5 | 2 +- ...4b8683a2b429de5cce57e6d733ec817_cgraph.svg | 376 ++- ...83a2b429de5cce57e6d733ec817_cgraph_org.svg | 378 ++- ...58410412185a5f09199deaff7157a8d_cgraph.map | 40 +- ...58410412185a5f09199deaff7157a8d_cgraph.md5 | 2 +- ...58410412185a5f09199deaff7157a8d_cgraph.svg | 376 ++- ...0412185a5f09199deaff7157a8d_cgraph_org.svg | 378 ++- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 46 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 496 +-- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 498 +-- ...31ec5409537703d9c8a47350386b32a_cgraph.map | 40 +- ...31ec5409537703d9c8a47350386b32a_cgraph.md5 | 2 +- ...31ec5409537703d9c8a47350386b32a_cgraph.svg | 376 ++- ...5409537703d9c8a47350386b32a_cgraph_org.svg | 378 ++- d2/def/prime__factorization_8cpp__incl.svg | 2 +- ...1_1is__arithmetic_3_01uint128__t_01_4.html | 31 +- d3/d05/classbinary__search__tree-members.html | 53 +- d3/d06/ode__semi__implicit__euler_8cpp.html | 179 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...13517b8e5de1b75592052db7f7e237f_cgraph.svg | 2 +- ...3adf7b092a87868917ee5fb4255192b_cgraph.svg | 2 +- d3/d17/namespaceutil__functions.html | 33 +- d3/d19/sparse__matrix_8cpp.html | 119 +- d3/d1a/hill__cipher_8cpp__incl.svg | 2 +- d3/d1a/hill__cipher_8cpp__incl_org.svg | 2 +- ...se__fermat__little__theorem_8cpp__incl.svg | 2 +- ...ctures_1_1list__array_1_1list-members.html | 41 +- ...h_1_1sublist__search_1_1_node-members.html | 33 +- d3/d22/saddleback__search_8cpp.html | 193 +- d3/d22/saddleback__search_8cpp.js | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...e0ca34797d88490747c08eca70a2e6_cgraph.map} | 0 ...e0ca34797d88490747c08eca70a2e6_cgraph.md5} | 0 ...e0ca34797d88490747c08eca70a2e6_cgraph.svg} | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d3/d24/qr__decomposition_8cpp.html | 117 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.map | 6 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.md5 | 2 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 8 +- ...1bc02cba5474a4cb46a9b9566fe_cgraph_org.svg | 8 +- d3/d26/binary__search__tree_8cpp.html | 428 ++- d3/d26/binary__search__tree_8cpp.js | 15 +- ...ures_1_1trie__using__hashmap_1_1_trie.html | 323 +- ...ctures_1_1trie__using__hashmap_1_1_trie.js | 4 +- ...f501b7f1240a58bc082187f22c2fe17_cgraph.md5 | 1 - ...be538c8015e8ce158e7ed43f605ebd_cgraph.map} | 6 +- ...bbe538c8015e8ce158e7ed43f605ebd_cgraph.md5 | 1 + ...be538c8015e8ce158e7ed43f605ebd_cgraph.svg} | 20 +- ...0bf3d6791cba144b3f539835d835e75_cgraph.svg | 2 +- ...bfd4a79adb242022fa2829740328c17_cgraph.md5 | 1 - ...5fdc7f2b5023992d87a711d78566c4_cgraph.map} | 8 +- ...15fdc7f2b5023992d87a711d78566c4_cgraph.md5 | 1 + ...5fdc7f2b5023992d87a711d78566c4_cgraph.svg} | 22 +- d3/d28/wiggle__sort_8cpp__incl.svg | 2 +- ...y_star_search_1_1comparison__operator.html | 84 +- ..._ay_star_search_1_1comparison__operator.js | 4 - d3/d30/hash__search_8cpp__incl.svg | 2 +- d3/d39/check__prime_8cpp__incl.svg | 2 +- d3/d39/manacher__algorithm_8cpp.html | 299 +- ...5e6a2976bb2f332898f373941d52098_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d3/d3d/complex__numbers_8cpp__incl.svg | 2 +- d3/d40/graph__coloring_8cpp.html | 91 +- d3/d4c/quick__sort__3_8cpp.html | 157 +- d3/d4c/quick__sort__3_8cpp.js | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d3/d4c/xor__cipher_8cpp.html | 149 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d3/d56/binomial__dist_8cpp__incl.svg | 2 +- d3/d61/vector__important__functions_8cpp.html | 107 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...1_1layers_1_1_dense_layer__coll__graph.map | 8 +- ...1_1layers_1_1_dense_layer__coll__graph.md5 | 2 +- ...1_1layers_1_1_dense_layer__coll__graph.svg | 69 +- d3/d66/structlinkedlist__coll__graph.svg | 2 +- ...oyd__cycle__detection__algo_8cpp__incl.svg | 2 +- d3/d78/namespacelinear__algebra.html | 37 +- .../brute__force__string__searching_8cpp.html | 71 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d3/d84/word__break_8cpp.html | 235 +- ...cc9dd6e6190d10a010fdcdfe7a21a81_cgraph.svg | 2 +- ...72b0f5cdb4e41fd6dee4538b808c06a_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...e4dcd6fd5282e535685361cba645d7c_cgraph.svg | 2 +- ...d6fd5282e535685361cba645d7c_cgraph_org.svg | 2 +- d3/d92/pancake__sort_8cpp.html | 199 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...ff90bc0f54e4f8ea5f0330471781bd5_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...__structures_1_1tree__234_1_1_tree234.html | 1218 +++---- ...ta__structures_1_1tree__234_1_1_tree234.js | 6 - ...2df91964915ca97609d35f847faff5f_cgraph.map | 4 +- ...2df91964915ca97609d35f847faff5f_cgraph.md5 | 2 +- ...2df91964915ca97609d35f847faff5f_cgraph.svg | 6 +- ...1964915ca97609d35f847faff5f_cgraph_org.svg | 6 +- ...1f0d016dff7f7e62b3dddb9fdf47805_cgraph.map | 2 +- ...1f0d016dff7f7e62b3dddb9fdf47805_cgraph.md5 | 2 +- ...1f0d016dff7f7e62b3dddb9fdf47805_cgraph.svg | 4 +- ...016dff7f7e62b3dddb9fdf47805_cgraph_org.svg | 4 +- ...73511e84a5243ffffe81be28bd24855_cgraph.map | 2 +- ...73511e84a5243ffffe81be28bd24855_cgraph.md5 | 2 +- ...73511e84a5243ffffe81be28bd24855_cgraph.svg | 14 +- ...e9a9db7792cf5383f4c4cc418255165_cgraph.svg | 2 +- ...da1be3f5b5d967ebb36a201f3ebad11_cgraph.map | 4 +- ...da1be3f5b5d967ebb36a201f3ebad11_cgraph.md5 | 2 +- ...da1be3f5b5d967ebb36a201f3ebad11_cgraph.svg | 6 +- ...e3f5b5d967ebb36a201f3ebad11_cgraph_org.svg | 6 +- ...1dd051a74e5f36c8dc03dae8dca6ef4_cgraph.map | 4 +- ...1dd051a74e5f36c8dc03dae8dca6ef4_cgraph.md5 | 2 +- ...1dd051a74e5f36c8dc03dae8dca6ef4_cgraph.svg | 6 +- ...51a74e5f36c8dc03dae8dca6ef4_cgraph_org.svg | 6 +- ...5a1235659356166a3e9b451c64fcc36_cgraph.map | 2 +- ...5a1235659356166a3e9b451c64fcc36_cgraph.md5 | 2 +- ...5a1235659356166a3e9b451c64fcc36_cgraph.svg | 4 +- ...749ebb40710c9752a2771eda03c6b3e_cgraph.svg | 2 +- ...4ab7b4fe7442b5e2eeed8c050bb86bd_cgraph.map | 4 +- ...4ab7b4fe7442b5e2eeed8c050bb86bd_cgraph.md5 | 2 +- ...4ab7b4fe7442b5e2eeed8c050bb86bd_cgraph.svg | 16 +- ...36bb546e6a94d8b9d35b30ee1bb291a_cgraph.map | 6 +- ...36bb546e6a94d8b9d35b30ee1bb291a_cgraph.md5 | 2 +- ...36bb546e6a94d8b9d35b30ee1bb291a_cgraph.svg | 16 +- ...7e5e00033f38006a224f30bdbf3f703_cgraph.svg | 2 +- ...85ba5abfd6d34dcd908b2afe6464657_cgraph.map | 2 +- ...85ba5abfd6d34dcd908b2afe6464657_cgraph.md5 | 2 +- ...85ba5abfd6d34dcd908b2afe6464657_cgraph.svg | 4 +- ...37e29e2a4a6cc0eb65cbd5595e1da95_cgraph.svg | 2 +- ...9e2a4a6cc0eb65cbd5595e1da95_cgraph_org.svg | 2 +- ...ork_1_1layers_1_1_dense_layer-members.html | 47 +- ...postfix__expression_1_1_stack-members.html | 33 +- d3/da1/namespacen__queens.html | 35 +- ...tatistics_1_1stats__computer2-members.html | 39 +- ...classbinary__search__tree__coll__graph.map | 5 +- ...classbinary__search__tree__coll__graph.md5 | 2 +- ...classbinary__search__tree__coll__graph.svg | 43 +- ...__table_1_1_sparse__table__coll__graph.map | 6 - ...__table_1_1_sparse__table__coll__graph.md5 | 1 - ...__table_1_1_sparse__table__coll__graph.svg | 80 - d3/db0/namespacelinked__list.html | 33 +- d3/db3/lru__cache_8cpp.html | 253 +- d3/db3/lru__cache_8cpp.js | 2 +- ...1ec21fc91ddafd964ae2035ba7892c0_cgraph.map | 17 +- ...1ec21fc91ddafd964ae2035ba7892c0_cgraph.md5 | 2 +- ...1ec21fc91ddafd964ae2035ba7892c0_cgraph.svg | 187 +- ...4d21a345ed06f7fba6919718cf3e058_cgraph.svg | 2 +- ...b02e288a407876a8d6024f98a2a25ec_cgraph.map | 17 +- ...b02e288a407876a8d6024f98a2a25ec_cgraph.md5 | 2 +- ...b02e288a407876a8d6024f98a2a25ec_cgraph.svg | 187 +- ...401e8f2d41d8cc9cd0e52ab381608d4_cgraph.map | 17 +- ...401e8f2d41d8cc9cd0e52ab381608d4_cgraph.md5 | 2 +- ...401e8f2d41d8cc9cd0e52ab381608d4_cgraph.svg | 187 +- ...a3be6d8871b1f5dc03688da8f3ee9e6_cgraph.map | 23 +- ...a3be6d8871b1f5dc03688da8f3ee9e6_cgraph.md5 | 2 +- ...a3be6d8871b1f5dc03688da8f3ee9e6_cgraph.svg | 399 +-- ...6d8871b1f5dc03688da8f3ee9e6_cgraph_org.svg | 312 -- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 13 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 203 +- d3/db7/graph_2dijkstra_8cpp__incl.svg | 2 +- d3/dbb/class_cycle_check.html | 311 +- d3/dbb/class_cycle_check.js | 5 - ...f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.md5 | 2 +- ...f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.svg | 8 +- ...99292a33edf87499daa52b51315aca5_cgraph.svg | 2 +- ...9a270ffba3a68539b92272c702e3474_cgraph.md5 | 2 +- ...9a270ffba3a68539b92272c702e3474_cgraph.svg | 8 +- d3/dbe/comb__sort_8cpp__incl.svg | 2 +- d3/dc9/namespacefibonacci__sum.html | 33 +- ...edlist__implentation__usingarray_8cpp.html | 259 +- ...nkedlist__implentation__usingarray_8cpp.js | 9 +- ...cb07da7984e20b3207934696791f5df_cgraph.svg | 2 +- ..._light__decomposition_1_1_s_g-members.html | 39 +- ...espaceshortest__common__supersequence.html | 33 +- d3/df9/recursive__bubble__sort_8cpp.html | 167 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d3/dfd/trie__using__hashmap_8cpp__incl.svg | 2 +- d3/dfe/horspool_8cpp.html | 223 +- d3/dfe/horspool_8cpp.js | 2 +- ...9c3aa55ccc79d0f47d50c580997336_cgraph.map} | 4 +- ...a9c3aa55ccc79d0f47d50c580997336_cgraph.md5 | 1 + ...a9c3aa55ccc79d0f47d50c580997336_cgraph.svg | 122 + ...884bca75ce39c116697ea2574adb37d_cgraph.map | 6 +- ...884bca75ce39c116697ea2574adb37d_cgraph.md5 | 2 +- ...884bca75ce39c116697ea2574adb37d_cgraph.svg | 40 +- ...352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.md5 | 1 - ...352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.svg | 122 - ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d4/d0c/binary__search__tree_8cpp__incl.svg | 2 +- d4/d0f/namespacegram__schmidt.html | 35 +- d4/d12/namespace_minimum.html | 37 +- d4/d13/namespacebidirectional__dijkstra.html | 35 +- d4/d1c/namespacehamming__distance.html | 35 +- d4/d1e/class_r_btree-members.html | 43 +- d4/d1f/class_min_heap-members.html | 45 +- d4/d1f/merge__insertion__sort_8cpp__incl.svg | 2 +- d4/d21/least__common__multiple_8cpp.html | 165 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 8 +- ...ba1fc66e4134ab25b2602b323150563_cgraph.map | 3 + ...ba1fc66e4134ab25b2602b323150563_cgraph.md5 | 1 + ...ba1fc66e4134ab25b2602b323150563_cgraph.svg | 28 + ...8d0e241db517813725e721a152e3a25_cgraph.map | 4 +- ...8d0e241db517813725e721a152e3a25_cgraph.md5 | 2 +- ...8d0e241db517813725e721a152e3a25_cgraph.svg | 16 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 8 +- d4/d25/ncr__modulo__p_8cpp__incl.svg | 2 +- d4/d26/durand__kerner__roots_8cpp__incl.svg | 2 +- .../durand__kerner__roots_8cpp__incl_org.svg | 2 +- d4/d28/pigeonhole__sort_8cpp__incl.svg | 2 +- ...struct_trie_1_1_trie_node__coll__graph.map | 4 - ...struct_trie_1_1_trie_node__coll__graph.md5 | 1 - ...struct_trie_1_1_trie_node__coll__graph.svg | 39 - ...nge__queries_2sparse__table_8cpp__incl.svg | 2 +- d4/d32/fibonacci__fast_8cpp.html | 105 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d4/d32/inorder__successor__of__bst_8cpp.html | 432 ++- d4/d32/inorder__successor__of__bst_8cpp.js | 14 +- ...fe8a029e155c43e4efa598d4d089d9_cgraph.map} | 0 ...fe8a029e155c43e4efa598d4d089d9_cgraph.md5} | 0 ...fe8a029e155c43e4efa598d4d089d9_cgraph.svg} | 2 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...224851353fc92bfbff6f499fa97_cgraph_org.svg | 2 +- ...23fb22b46e085376703cae0b44d690_cgraph.map} | 0 ...23fb22b46e085376703cae0b44d690_cgraph.md5} | 0 ...23fb22b46e085376703cae0b44d690_cgraph.svg} | 2 +- ...d7266b934ca50c4f53e4f1e725d89a4_cgraph.svg | 2 +- ...483e3f6933e004a8d86371e8a990db_cgraph.map} | 0 ...483e3f6933e004a8d86371e8a990db_cgraph.md5} | 0 ...483e3f6933e004a8d86371e8a990db_cgraph.svg} | 2 +- ...b20eb99272665c1777949e26ab59589_cgraph.svg | 2 +- ...6f73a33beec448c27cc1d70b220702_cgraph.map} | 0 ...6f73a33beec448c27cc1d70b220702_cgraph.md5} | 0 ...6f73a33beec448c27cc1d70b220702_cgraph.svg} | 2 +- ...4cbf1814854824cf05f062eea07b95_cgraph.map} | 0 ...4cbf1814854824cf05f062eea07b95_cgraph.md5} | 0 ...4cbf1814854824cf05f062eea07b95_cgraph.svg} | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...7b867074164d5f45b0f3851269d_cgraph_org.svg | 2 +- d4/d38/power__of__two_8cpp.html | 71 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d4/d39/group__open__addressing.html | 47 +- d4/d39/group__open__addressing.js | 6 + d4/d3e/n__queens_8cpp.html | 199 +- ...dbd7af47d87f0b956609fe9e3288ecb_cgraph.svg | 2 +- d4/d45/gcd__recursive__euclidean_8cpp.html | 125 +- ...48807fa2b7000afae599e67f327545e_cgraph.map | 3 + ...48807fa2b7000afae599e67f327545e_cgraph.md5 | 1 + ...48807fa2b7000afae599e67f327545e_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 32 +- d4/d48/hamming__distance_8cpp.html | 161 +- ...0ba9fe8b5df5c268f0c7d677ff2fe80_cgraph.svg | 2 +- ...5d845df3fecff7087a2126c7b72030b_cgraph.svg | 2 +- ...fe6fbb2f3460a2623c96f283178a07a_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t.html | 53 +- d4/d59/large__factorial_8cpp__incl.svg | 2 +- d4/d5d/math_2armstrong__number_8cpp.html | 145 +- ...cebd92bc70890c3cfa261d68a5016e7_cgraph.map | 2 +- ...cebd92bc70890c3cfa261d68a5016e7_cgraph.md5 | 2 +- ...cebd92bc70890c3cfa261d68a5016e7_cgraph.svg | 4 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.map | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.md5 | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- d4/d60/kohonen__som__trace_8cpp__incl.svg | 2 +- d4/d60/kohonen__som__trace_8cpp__incl_org.svg | 2 +- d4/d68/qr__decompose_8h.html | 69 +- d4/d68/qr__decompose_8h.js | 8 +- d4/d68/qr__decompose_8h_source.html | 459 ++- d4/d72/qr__eigen__values_8cpp__incl.svg | 2 +- d4/d75/skip__list_8cpp__incl.svg | 2 +- d4/d7a/shell__sort2_8cpp.html | 361 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...2ea0d1f7943ebb4371d31e44b465b6d_cgraph.svg | 2 +- ...3aaff7cabfa3da2da8b9477b5fad9d6_cgraph.svg | 2 +- ...95b313cb2671e8f712040460325573e_cgraph.svg | 2 +- ...51127aea9d7e1e53ea9ae0868633246_cgraph.svg | 2 +- d4/d83/sum__of__digits_8cpp.html | 121 +- ...283886819c7c140a023582b7269e2d0_cgraph.map | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.md5 | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 4 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.map | 2 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 | 2 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 4 +- ...619c78b6ad985713024f930f31c4395_cgraph.map | 2 +- ...619c78b6ad985713024f930f31c4395_cgraph.md5 | 2 +- ...619c78b6ad985713024f930f31c4395_cgraph.svg | 4 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.map | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.md5 | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- d4/d86/large__number_8h.html | 37 +- d4/d86/large__number_8h_source.html | 627 ++-- d4/d8d/jarvis__algorithm_8cpp.html | 123 +- d4/d8d/jarvis__algorithm_8cpp.js | 4 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- .../classdata__structures_1_1_skip_list.html | 309 +- d4/d90/classdata__structures_1_1_skip_list.js | 2 +- ...0a4042bdf0b6683b5f21ae7854de8a9_cgraph.svg | 2 +- ...12611f80b8079268dbb19cc4e9bee5c_cgraph.svg | 2 +- ...6925c53e139cc6c3f7df1e9003bb0b0_cgraph.svg | 2 +- ...3f3813e9896792fc86b296547689ba4_cgraph.svg | 2 +- ...f3d4e15b1f47afac849c2e08a730f4_cgraph.map} | 0 ...f3d4e15b1f47afac849c2e08a730f4_cgraph.md5} | 0 ...f3d4e15b1f47afac849c2e08a730f4_cgraph.svg} | 2 +- d4/d91/namespacevector__cross.html | 33 +- .../range__queries_2sparse__table_8cpp.html | 171 +- d4/d96/range__queries_2sparse__table_8cpp.js | 4 +- ...810d8c0fe3f8cf432ab128b1ae0300_cgraph.map} | 0 ...810d8c0fe3f8cf432ab128b1ae0300_cgraph.md5} | 0 ...810d8c0fe3f8cf432ab128b1ae0300_cgraph.svg} | 2 +- ...3a2451e87021d14ae06f148383e6bc_cgraph.map} | 0 ...3a2451e87021d14ae06f148383e6bc_cgraph.md5} | 0 ...3a2451e87021d14ae06f148383e6bc_cgraph.svg} | 2 +- ...32816c3de9e5ad122b180de60978e8f_cgraph.svg | 2 +- d4/d9c/primes__up__to__billion_8cpp.html | 93 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- .../sum__of__binomial__coefficient_8cpp.html | 99 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d4/da0/gcd__iterative__euclidean_8cpp.html | 125 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...ber__of__positive__divisors_8cpp__incl.svg | 2 +- d4/db4/bayes__theorem_8cpp__incl.svg | 2 +- d4/db4/struct_segment_intersection.html | 157 +- d4/db4/struct_segment_intersection.js | 1 - ...08941b2272866c64cdaf959afa939bf_cgraph.svg | 2 +- d4/db6/struct_min_heap_node-members.html | 35 +- d4/db9/namespacencr__modulo__p.html | 35 +- ...extended__euclid__algorithm_8cpp__incl.svg | 2 +- d4/dc8/tree__234_8cpp__incl.svg | 2 +- d4/dcb/classstack__coll__graph.map | 4 - d4/dcb/classstack__coll__graph.md5 | 1 - d4/dcb/classstack__coll__graph.svg | 38 - d4/dd2/namespacequadratic__probing.html | 379 ++- d4/dd2/namespacequadratic__probing.js | 9 +- ...0ebcc6d39653eccc26f8432efbfc8d9_cgraph.svg | 2 +- ...7a0467b24102260fbb6b554c453c20a_cgraph.svg | 2 +- ...12143ed316d48978084c025ff8d9768_cgraph.svg | 2 +- ...3ed316d48978084c025ff8d9768_cgraph_org.svg | 2 +- ...0d617ebf4d6ba21bcda8d8d1faa2357_cgraph.svg | 2 +- ...ceee4128d92ca4412040b7104d1299d_cgraph.svg | 2 +- ...9fe1f7c36fe004ba83eef2ca82e7e30_cgraph.svg | 2 +- ...f7c36fe004ba83eef2ca82e7e30_cgraph_org.svg | 2 +- ...431981b54c0bae1b2956f716aee1dcf_cgraph.svg | 2 +- ...a6f1f44f7e83b0094fbcbe170788486_cgraph.svg | 2 +- ...f44f7e83b0094fbcbe170788486_cgraph_org.svg | 2 +- d4/dd7/house__robber_8cpp__incl.svg | 2 +- ...lassgeometry_1_1jarvis_1_1_convexhull.html | 179 +- .../classgeometry_1_1jarvis_1_1_convexhull.js | 6 +- ...306e48040a8570e164c58d1c530f870_cgraph.svg | 2 +- ...c46e86786ddd461464b07a77c4d5f1_cgraph.map} | 0 ...c46e86786ddd461464b07a77c4d5f1_cgraph.md5} | 0 ...c46e86786ddd461464b07a77c4d5f1_cgraph.svg} | 2 +- d4/de6/namespacepostfix__expression.html | 33 +- .../gcd__iterative__euclidean_8cpp__incl.svg | 2 +- d4/def/kohonen__som__topology_8cpp.html | 599 ++-- d4/def/kohonen__som__topology_8cpp.js | 17 +- ...283886819c7c140a023582b7269e2d0_cgraph.map | 14 +- ...283886819c7c140a023582b7269e2d0_cgraph.md5 | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 16 +- ...86819c7c140a023582b7269e2d0_cgraph_org.svg | 16 +- ...02662a56ebf67a21249270b017297e_cgraph.map} | 0 ...02662a56ebf67a21249270b017297e_cgraph.md5} | 0 ...02662a56ebf67a21249270b017297e_cgraph.svg} | 2 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.map | 14 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 | 2 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 16 +- ...7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg | 16 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 18 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 20 +- ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 20 +- ...efb079040c7aaa3a4917a0e486cba9_cgraph.map} | 0 ...efb079040c7aaa3a4917a0e486cba9_cgraph.md5} | 0 ...efb079040c7aaa3a4917a0e486cba9_cgraph.svg} | 2 +- ...7ab643f6a5002f991837de46f70653_cgraph.map} | 0 ...7ab643f6a5002f991837de46f70653_cgraph.md5} | 0 ...7ab643f6a5002f991837de46f70653_cgraph.svg} | 2 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.map | 14 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.md5 | 2 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.svg | 16 +- ...5dd5c30adda100e95f0423c786e_cgraph_org.svg | 16 +- ...1_1neural__network_1_1_neural_network.html | 1087 +++---- ...g_1_1neural__network_1_1_neural_network.js | 23 +- ...ee425af6fd83a033c021128b8253f52_cgraph.md5 | 1 - ...e1b52bb9f57486f9a436f35c9089c0_cgraph.map} | 22 +- ...be1b52bb9f57486f9a436f35c9089c0_cgraph.md5 | 1 + ...e1b52bb9f57486f9a436f35c9089c0_cgraph.svg} | 28 +- ...2bb9f57486f9a436f35c9089c0_cgraph_org.svg} | 24 +- ...1a45f3c3d8347d79103bf182d0570b_cgraph.map} | 6 +- ...61a45f3c3d8347d79103bf182d0570b_cgraph.md5 | 1 + ...1a45f3c3d8347d79103bf182d0570b_cgraph.svg} | 8 +- ...6494e26ff36d6e15c1022bb9a1ee848_cgraph.map | 26 +- ...6494e26ff36d6e15c1022bb9a1ee848_cgraph.md5 | 2 +- ...6494e26ff36d6e15c1022bb9a1ee848_cgraph.svg | 30 +- ...e26ff36d6e15c1022bb9a1ee848_cgraph_org.svg | 28 +- ...9eac1824d365dce715fb17c33cb96f_cgraph.map} | 8 +- ...b9eac1824d365dce715fb17c33cb96f_cgraph.md5 | 1 + ...9eac1824d365dce715fb17c33cb96f_cgraph.svg} | 14 +- ...1824d365dce715fb17c33cb96f_cgraph_org.svg} | 10 +- ...4c6f63ab965317f9471518ee931b89_cgraph.map} | 0 ...4c6f63ab965317f9471518ee931b89_cgraph.md5} | 0 ...4c6f63ab965317f9471518ee931b89_cgraph.svg} | 2 +- ...c4ff6b340d0e460d3015ad601a568b6_cgraph.md5 | 1 - ...f14e473bb0722c6490b9dc8da5982aa_cgraph.map | 2 +- ...f14e473bb0722c6490b9dc8da5982aa_cgraph.md5 | 2 +- ...f14e473bb0722c6490b9dc8da5982aa_cgraph.svg | 4 +- ...172a6791b9bd24f4232bab8d6b81fff_cgraph.map | 34 +- ...172a6791b9bd24f4232bab8d6b81fff_cgraph.md5 | 2 +- ...172a6791b9bd24f4232bab8d6b81fff_cgraph.svg | 38 +- ...6791b9bd24f4232bab8d6b81fff_cgraph_org.svg | 36 +- ...8ed20abf6ce3744535bd8b5bb9e741b_cgraph.svg | 2 +- ...1d30113d13304c664057118b92a5931_cgraph.map | 2 +- ...1d30113d13304c664057118b92a5931_cgraph.md5 | 2 +- ...1d30113d13304c664057118b92a5931_cgraph.svg | 4 +- ...151b0398a2536be60d950e10ffe9a8_cgraph.map} | 0 ...151b0398a2536be60d950e10ffe9a8_cgraph.md5} | 0 ...151b0398a2536be60d950e10ffe9a8_cgraph.svg} | 2 +- ...0c677fd6512665741ddd9b7983275d_cgraph.map} | 10 +- ...50c677fd6512665741ddd9b7983275d_cgraph.md5 | 1 + ...0c677fd6512665741ddd9b7983275d_cgraph.svg} | 16 +- ...7fd6512665741ddd9b7983275d_cgraph_org.svg} | 12 +- ...bf9023ab3d4cdb61cf707c7cdfc86b_cgraph.map} | 10 +- ...8bf9023ab3d4cdb61cf707c7cdfc86b_cgraph.md5 | 1 + ...bf9023ab3d4cdb61cf707c7cdfc86b_cgraph.svg} | 16 +- ...23ab3d4cdb61cf707c7cdfc86b_cgraph_org.svg} | 12 +- ...d983ebb3225a9901b713a0f05b44aba_cgraph.md5 | 1 - ...f8eb4423c57a00b0ab46de226bc6509_cgraph.md5 | 1 - ...130322a5abb1ff763b7c1a55405a35e_cgraph.md5 | 1 - ...d397b51fcf8f690b03e406ada8c9d13_cgraph.md5 | 1 - ...648ea4f40bd71123b5f907a681dd8e_cgraph.map} | 14 +- ...c648ea4f40bd71123b5f907a681dd8e_cgraph.md5 | 1 + ...648ea4f40bd71123b5f907a681dd8e_cgraph.svg} | 20 +- ...a4f40bd71123b5f907a681dd8e_cgraph_org.svg} | 16 +- d4/df4/trie__multiple__search_8cpp__incl.svg | 2 +- d4/df8/prime__numbers_8cpp__incl.svg | 2 +- d4/dfb/namespacecycle__sort.html | 35 +- d5/d02/namespacehorspool.html | 35 +- d5/d08/classgraph_1_1_graph__coll__graph.map | 7 - d5/d08/classgraph_1_1_graph__coll__graph.md5 | 1 - d5/d08/classgraph_1_1_graph__coll__graph.svg | 88 - ...rie__using__hashmap_1_1_trie_1_1_node.html | 49 +- d5/d15/classcll.html | 308 +- d5/d15/classcll.js | 14 - ...d_1_1is__unsigned_3_01uint128__t_01_4.html | 31 +- d5/d29/struct_min_heap_node.html | 88 +- d5/d29/struct_min_heap_node.js | 8 - d5/d2c/namespacelayers.html | 33 +- d5/d33/gram__schmidt_8cpp.html | 483 ++- ...6e459aff5eafffb5ad9ceb129b4d274_cgraph.map | 2 +- ...6e459aff5eafffb5ad9ceb129b4d274_cgraph.md5 | 2 +- ...6e459aff5eafffb5ad9ceb129b4d274_cgraph.svg | 4 +- ...31ca28f60c880802462335eedc5d91f_cgraph.map | 2 +- ...31ca28f60c880802462335eedc5d91f_cgraph.md5 | 2 +- ...31ca28f60c880802462335eedc5d91f_cgraph.svg | 4 +- ...28f60c880802462335eedc5d91f_cgraph_org.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...d4d308f46ca1d91e348ca260ec1d2fb_cgraph.map | 2 +- ...d4d308f46ca1d91e348ca260ec1d2fb_cgraph.md5 | 2 +- ...d4d308f46ca1d91e348ca260ec1d2fb_cgraph.svg | 4 +- d5/d39/namespaceactivations.html | 33 +- d5/d3c/namespacedata__structures.html | 75 +- d5/d45/sublist__search_8cpp.html | 315 +- d5/d45/sublist__search_8cpp.js | 4 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...224851353fc92bfbff6f499fa97_cgraph_org.svg | 2 +- ...faee403e2758aaab682ed6622ae218c_cgraph.svg | 2 +- ...ca8d0267008e09cfa50b4e2ddfbe53_cgraph.map} | 0 ...ca8d0267008e09cfa50b4e2ddfbe53_cgraph.md5} | 0 ...ca8d0267008e09cfa50b4e2ddfbe53_cgraph.svg} | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...7b867074164d5f45b0f3851269d_cgraph_org.svg | 2 +- ...1028bc215281d62e344af99da57fab2_cgraph.svg | 2 +- ...trie__using__hashmap_1_1_trie-members.html | 39 +- ...test__common__supersequence_8cpp__incl.svg | 2 +- d5/d4c/group__sorting.html | 331 +- d5/d4c/group__sorting.js | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...6b14fea48d9841e29b9fc26be6e05d7_cgraph.map | 4 +- ...6b14fea48d9841e29b9fc26be6e05d7_cgraph.md5 | 2 +- ...6b14fea48d9841e29b9fc26be6e05d7_cgraph.svg | 16 +- ...urve__key__exchange_1_1_point-members.html | 37 +- .../classgraph_1_1_rooted_tree-members.html | 45 +- d5/d58/class_test_cases.html | 873 +++-- ...3aa3d5bf666f327ee8e2d11d397b06e_cgraph.svg | 2 +- ...ae0148985f159b582a385cf399254e3_cgraph.svg | 2 +- ...2636e8b5b9e053374c45bfcf0603008_cgraph.svg | 2 +- ...9f95c09931625b41e3be1f88d1e28c5_cgraph.svg | 2 +- ...abea90c02f9159e4a784bbf736e1e23_cgraph.svg | 2 +- ...ersistent__seg__tree__lazy__prop_8cpp.html | 159 +- .../persistent__seg__tree__lazy__prop_8cpp.js | 4 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 16 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 104 +- ...7b867074164d5f45b0f3851269d_cgraph_org.svg | 106 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 18 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 112 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 114 +- .../random__pivot__quick__sort_8cpp__incl.svg | 2 +- d5/d5f/namespacegeometry.html | 33 +- d5/d5f/namespacegeometry.js | 4 +- ...nge__queries_1_1per_seg_tree_1_1_node.html | 51 +- ...range__queries_1_1per_seg_tree_1_1_node.js | 2 - d5/d67/bayes__theorem_8cpp.html | 81 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d5/d67/complex__numbers_8cpp.html | 243 +- d5/d67/complex__numbers_8cpp.js | 2 +- ...d5f25b573e870accdf26fd32b8484d_cgraph.map} | 0 ...d5f25b573e870accdf26fd32b8484d_cgraph.md5} | 0 ...d5f25b573e870accdf26fd32b8484d_cgraph.svg} | 2 +- ...a73e9d4e68af8cedb95bd0864054b89_cgraph.svg | 2 +- ...d4d5b8250b50703de888514c8e7a7a0_cgraph.map | 4 + ...d4d5b8250b50703de888514c8e7a7a0_cgraph.md5 | 1 + ...d4d5b8250b50703de888514c8e7a7a0_cgraph.svg | 37 + ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d5/d7a/largest__power_8cpp.html | 97 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d5/d83/lcm__sum_8cpp.html | 109 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d5/d85/xor__cipher_8cpp__incl.svg | 2 +- d5/d88/md__d_i_r_e_c_t_o_r_y.html | 614 ++-- d5/d89/namespacepalindrome__partitioning.html | 35 +- ...hers_1_1postfix__expression_1_1_stack.html | 49 +- d5/d8a/trie__using__hashmap_8cpp.html | 297 +- d5/d8a/trie__using__hashmap_8cpp.js | 4 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 22 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 90 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 24 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 88 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 90 +- d5/d8b/least__common__multiple_8cpp__incl.svg | 2 +- d5/d8e/sudoku__solve_8cpp__incl.svg | 2 +- d5/d90/palindrome__partitioning_8cpp.html | 207 +- ...2ee22882858d2b1cf04293f02ed839a_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d5/d91/namespacesorting.html | 703 ++-- ...9e1b21a1684585e9e50f9afe4d53a3_cgraph.map} | 0 ...9e1b21a1684585e9e50f9afe4d53a3_cgraph.md5} | 0 ...9e1b21a1684585e9e50f9afe4d53a3_cgraph.svg} | 2 +- ...40d913e42fb94176a0b2c8b29a80420_cgraph.svg | 2 +- ...7236b8d3df3832e1f1225576a122534_cgraph.svg | 2 +- ...d76603c54d3dc56146e92d10a043924_cgraph.svg | 2 +- ...0b66a1c652291b9a346ec7342967178_cgraph.map | 4 +- ...0b66a1c652291b9a346ec7342967178_cgraph.md5 | 2 +- ...0b66a1c652291b9a346ec7342967178_cgraph.svg | 16 +- ...b67c2f91c98cf4464f75b5882022de_cgraph.map} | 4 +- ...eb67c2f91c98cf4464f75b5882022de_cgraph.md5 | 1 + ...b67c2f91c98cf4464f75b5882022de_cgraph.svg} | 16 +- ...fe11bd4703eacd1dab93f25ec639c5_cgraph.map} | 0 ...fe11bd4703eacd1dab93f25ec639c5_cgraph.md5} | 0 ...fe11bd4703eacd1dab93f25ec639c5_cgraph.svg} | 2 +- ...fe6bac9e03f58abcc2ce26ef3de1b5f_cgraph.svg | 2 +- ...d4eb6ea3c35540d804d451f1716622d_cgraph.md5 | 1 - ...f59fe72dacc1f1218ef3c303d843168_cgraph.map | 3 + ...f59fe72dacc1f1218ef3c303d843168_cgraph.md5 | 1 + ...f59fe72dacc1f1218ef3c303d843168_cgraph.svg | 28 + ...26de383227859210f14dcf12201a079_cgraph.svg | 2 +- ...3a775d99dbbb94c130a973df0cfddcf_cgraph.map | 4 +- ...3a775d99dbbb94c130a973df0cfddcf_cgraph.md5 | 2 +- ...3a775d99dbbb94c130a973df0cfddcf_cgraph.svg | 18 +- ...97f4dd815654c4682f564afd718e824_cgraph.svg | 2 +- ...2c5b92cbfe73f63f6074c61b0a45331_cgraph.svg | 2 +- ...c6ee160142cd017f8c4b213437d0fd_cgraph.map} | 0 ...c6ee160142cd017f8c4b213437d0fd_cgraph.md5} | 0 ...c6ee160142cd017f8c4b213437d0fd_cgraph.svg} | 2 +- d5/d95/n__bonacci_8cpp__incl.svg | 2 +- d5/da1/structnode.html | 124 +- d5/da1/structnode.js | 19 +- d5/da7/namespacejarvis.html | 35 +- ...ta__structures_1_1list__array_1_1list.html | 315 +- ...data__structures_1_1list__array_1_1list.js | 6 +- ...9a712c8413b0d7861695ec019474469_cgraph.svg | 2 +- ...b4abfffc730e07fcbd5844e09add8cd_cgraph.map | 3 + ...b4abfffc730e07fcbd5844e09add8cd_cgraph.md5 | 1 + ...b4abfffc730e07fcbd5844e09add8cd_cgraph.svg | 29 + d5/dad/magic__number_8cpp__incl.svg | 2 +- d5/db0/adaline__learning_8cpp.html | 341 +- d5/db0/adaline__learning_8cpp.js | 2 +- ...79f7488a305f2571f2932b319931f82_cgraph.map | 13 +- ...79f7488a305f2571f2932b319931f82_cgraph.md5 | 2 +- ...79f7488a305f2571f2932b319931f82_cgraph.svg | 157 +- ...488a305f2571f2932b319931f82_cgraph_org.svg | 159 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 31 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 303 +- ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 305 +- ...2053d88ea1bcbbed9aca67ab4eeb499_cgraph.map | 11 +- ...2053d88ea1bcbbed9aca67ab4eeb499_cgraph.md5 | 2 +- ...2053d88ea1bcbbed9aca67ab4eeb499_cgraph.svg | 135 +- ...d88ea1bcbbed9aca67ab4eeb499_cgraph_org.svg | 137 +- ...92bdf1fdb0b9d414bcf7981d2d87aa9_cgraph.map | 13 +- ...92bdf1fdb0b9d414bcf7981d2d87aa9_cgraph.md5 | 2 +- ...92bdf1fdb0b9d414bcf7981d2d87aa9_cgraph.svg | 157 +- ...f1fdb0b9d414bcf7981d2d87aa9_cgraph_org.svg | 159 +- ...1inorder__traversal__of__bst_1_1_node.html | 47 +- d5/db8/namespacemincoins__topdown.html | 35 +- d5/dc3/integral__approximation_8cpp__incl.svg | 2 +- ...data__structures_1_1_node__coll__graph.map | 5 - ...data__structures_1_1_node__coll__graph.md5 | 1 - ...data__structures_1_1_node__coll__graph.svg | 57 - d5/dc8/postfix__evaluation_8cpp__incl.svg | 2 +- ...ries_1_1per_seg_tree_1_1_node-members.html | 35 +- ...ector__important__functions_8cpp__incl.svg | 2 +- d5/dcd/kohonen__som__topology_8cpp__incl.svg | 2 +- .../kohonen__som__topology_8cpp__incl_org.svg | 2 +- d5/dcd/sum__of__digits_8cpp__incl.svg | 2 +- d5/ddb/bogo__sort_8cpp.html | 157 +- d5/ddb/bogo__sort_8cpp.js | 4 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.map | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.md5 | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- d5/ddf/struct_btree-members.html | 33 +- d5/de0/classuint128__t-members.html | 137 +- d5/de2/structtower-members.html | 33 +- d5/dee/disjoint__set_8cpp__incl.svg | 2 +- d5/def/stairs__pattern_8cpp.html | 77 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d5/df4/merge__sort_8cpp.html | 39 +- d5/df6/check__amicable__pair_8cpp.html | 127 +- ...656a51b4c3bd7d63b7dcc75dc3e5576_cgraph.map | 2 +- ...656a51b4c3bd7d63b7dcc75dc3e5576_cgraph.md5 | 2 +- ...656a51b4c3bd7d63b7dcc75dc3e5576_cgraph.svg | 4 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.map | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.md5 | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 4 +- ...eb67e204ec7de02ad152c11df4d1e01_cgraph.map | 2 +- ...eb67e204ec7de02ad152c11df4d1e01_cgraph.md5 | 2 +- ...eb67e204ec7de02ad152c11df4d1e01_cgraph.svg | 4 +- ...queue__using__array_1_1_queue___array.html | 159 +- ...aaf88c9954ef3ab686f8e4bfbd87622_cgraph.map | 4 - ...aaf88c9954ef3ab686f8e4bfbd87622_cgraph.md5 | 1 - ...aaf88c9954ef3ab686f8e4bfbd87622_cgraph.svg | 39 - ...dc64488c36f84d927365fa8d1933663_cgraph.map | 4 - ...dc64488c36f84d927365fa8d1933663_cgraph.md5 | 1 - ...dc64488c36f84d927365fa8d1933663_cgraph.svg | 39 - ...88b7ea064739ea9fa66bf64bf4ae631_cgraph.map | 4 - ...88b7ea064739ea9fa66bf64bf4ae631_cgraph.md5 | 1 - ...88b7ea064739ea9fa66bf64bf4ae631_cgraph.svg | 39 - d6/d10/cut__rod_8cpp.html | 173 +- ...cc523a30c18c63eac58220c3c494cfa_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d6/d1a/dnf__sort_8cpp.html | 195 +- d6/d1a/dnf__sort_8cpp.js | 2 +- ...1767fe711db64fe57a2ac4987b11f0_cgraph.map} | 0 ...1767fe711db64fe57a2ac4987b11f0_cgraph.md5} | 0 ...1767fe711db64fe57a2ac4987b11f0_cgraph.svg} | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d6/d1d/bubble__sort_8cpp__incl.svg | 2 +- d6/d1f/class_complex-members.html | 47 +- d6/d20/lu__decomposition_8h__incl.svg | 2 +- d6/d26/classciphers_1_1_hill_cipher.html | 642 ++-- d6/d26/classciphers_1_1_hill_cipher.js | 11 +- ...b58750b978a93ac5e6eb29e3e570b7_cgraph.map} | 0 ...b58750b978a93ac5e6eb29e3e570b7_cgraph.md5} | 0 ...b58750b978a93ac5e6eb29e3e570b7_cgraph.svg} | 2 +- ...27acfac1dbff3f48a2b071d449d965b_cgraph.map | 2 +- ...27acfac1dbff3f48a2b071d449d965b_cgraph.md5 | 2 +- ...27acfac1dbff3f48a2b071d449d965b_cgraph.svg | 4 +- ...29be41c1ab78850963e4ce14e1d11d9_cgraph.svg | 2 +- ...16d0313141499d16f57c0c107f04395_cgraph.svg | 2 +- ...760f3665651a0a37937c79c62f219c0_cgraph.svg | 2 +- ...8bbb6e4a5749f6008b06602d5103917_cgraph.map | 2 +- ...8bbb6e4a5749f6008b06602d5103917_cgraph.md5 | 2 +- ...8bbb6e4a5749f6008b06602d5103917_cgraph.svg | 4 +- ...6cbcc7a458b3f3a2af0c4aa1126590_cgraph.map} | 0 ...6cbcc7a458b3f3a2af0c4aa1126590_cgraph.md5} | 0 ...6cbcc7a458b3f3a2af0c4aa1126590_cgraph.svg} | 2 +- ...667fa0860977f6d6d443fa1dbcd80aa_cgraph.map | 2 +- ...667fa0860977f6d6d443fa1dbcd80aa_cgraph.md5 | 2 +- ...667fa0860977f6d6d443fa1dbcd80aa_cgraph.svg | 4 +- ...77cad522fa44b8c985779a7188d2f41_cgraph.svg | 2 +- d6/d26/house__robber_8cpp.html | 185 +- ...e497c3e3f169afe5baaae6a5d40cbc8_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...search__tree_1_1bst__node__coll__graph.map | 4 - ...search__tree_1_1bst__node__coll__graph.md5 | 1 - ...search__tree_1_1bst__node__coll__graph.svg | 41 - d6/d2c/caesar__cipher_8cpp.html | 161 +- ...55e69511cd2006b5c4c80ae95b71056_cgraph.svg | 2 +- ...3381121289548640b1c27a58a8524c3_cgraph.svg | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d6/d2e/fenwick__tree_8cpp.html | 73 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d6/d30/classmachine__learning_1_1adaline.html | 302 +- d6/d30/classmachine__learning_1_1adaline.js | 2 +- ...acbe32aaab897e7939e5b0454035b8c_cgraph.svg | 2 +- ...4e3c6c037b67895014414c5d75465e5_cgraph.map | 19 +- ...4e3c6c037b67895014414c5d75465e5_cgraph.md5 | 2 +- ...4e3c6c037b67895014414c5d75465e5_cgraph.svg | 105 +- ...6c037b67895014414c5d75465e5_cgraph_org.svg | 105 +- ...d61f9ed872eef26bca39388cbda6a91_cgraph.map | 21 +- ...d61f9ed872eef26bca39388cbda6a91_cgraph.md5 | 2 +- ...d61f9ed872eef26bca39388cbda6a91_cgraph.svg | 107 +- ...9ed872eef26bca39388cbda6a91_cgraph_org.svg | 107 +- ...11242d9ad5b03a75911e29b04f78fd3_cgraph.map | 15 +- ...11242d9ad5b03a75911e29b04f78fd3_cgraph.md5 | 2 +- ...11242d9ad5b03a75911e29b04f78fd3_cgraph.svg | 131 +- ...8a9c2aaaa63b0f27ea176857e1e7d56_cgraph.svg | 2 +- ...stics_1_1stats__computer1__coll__graph.map | 4 - ...stics_1_1stats__computer1__coll__graph.md5 | 1 - ...stics_1_1stats__computer1__coll__graph.svg | 38 - d6/d38/newton__raphson__method_8cpp__incl.svg | 2 +- .../data__structures_2sparse__table_8cpp.html | 143 +- .../data__structures_2sparse__table_8cpp.js | 2 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- d6/d42/miller__rabin_8cpp.html | 293 +- d6/d42/miller__rabin_8cpp.js | 2 +- ...f9c31c1047aa3191676d64571d4c506_cgraph.map | 2 +- ...f9c31c1047aa3191676d64571d4c506_cgraph.md5 | 2 +- ...f9c31c1047aa3191676d64571d4c506_cgraph.svg | 4 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.map | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 4 +- ...ad42717780d6caaff9d3d6977f9_cgraph_org.svg | 4 +- ...01288288ef5ebe8e97414cc30797cce_cgraph.map | 2 +- ...01288288ef5ebe8e97414cc30797cce_cgraph.md5 | 2 +- ...01288288ef5ebe8e97414cc30797cce_cgraph.svg | 4 +- ...8288ef5ebe8e97414cc30797cce_cgraph_org.svg | 4 +- ...6c2c67ea416d0e80003a88623f98b29_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 4 +- ...iptic__curve__key__exchange_1_1_point.html | 73 +- ...lliptic__curve__key__exchange_1_1_point.js | 4 +- ...__queries_1_1per_seg_tree__coll__graph.map | 7 - ...__queries_1_1per_seg_tree__coll__graph.md5 | 1 - ...__queries_1_1per_seg_tree__coll__graph.svg | 178 - ...eries_1_1per_seg_tree__coll__graph_org.svg | 90 - d6/d4a/addition__rule_8cpp.html | 85 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d6/d4b/hamming__distance_8cpp__incl.svg | 2 +- .../gcd__recursive__euclidean_8cpp__incl.svg | 2 +- d6/d4e/namespaceciphers.html | 59 +- d6/d4e/namespaceciphers.js | 6 - d6/d53/namespaceword__break.html | 35 +- d6/d60/group__ode.html | 319 +- ...95d23bbdfcb80e83c9cda45c9ad5723_cgraph.svg | 2 +- ...6ff0710861ca39d957046c0b09b2985_cgraph.svg | 2 +- ...874d294ab00fe9ce8731c5b7991a089_cgraph.svg | 2 +- ...27bf009831ddc477c5fa8891d5cb35f_cgraph.svg | 2 +- ...c319db420c3d97a83e9dcca803b6812_cgraph.svg | 2 +- ...0509f8843e2bc42de2abbd00a14b7b9_cgraph.svg | 2 +- d6/d74/math_2armstrong__number_8cpp__incl.svg | 2 +- d6/d74/namespacekadane.html | 35 +- d6/d7a/golden__search__extrema_8cpp.html | 301 +- d6/d7a/golden__search__extrema_8cpp.js | 1 - ...283886819c7c140a023582b7269e2d0_cgraph.map | 8 + ...283886819c7c140a023582b7269e2d0_cgraph.md5 | 1 + ...283886819c7c140a023582b7269e2d0_cgraph.svg | 98 + ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.map | 7 + ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 | 1 + ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 83 + ...aa76a6d5fd4d333f9072beff1dc486b_cgraph.svg | 2 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.map | 8 + ...d0455dd5c30adda100e95f0423c786e_cgraph.md5 | 1 + ...d0455dd5c30adda100e95f0423c786e_cgraph.svg | 98 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d6/d7b/sudoku__solve_8cpp.html | 93 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d6/d80/double__hash__hash__table_8cpp.html | 183 +- d6/d80/double__hash__hash__table_8cpp.js | 11 +- d6/d8d/namespacemorse.html | 35 +- d6/d93/large__number_8h__dep__incl.svg | 2 +- d6/d9d/large__factorial_8cpp.html | 227 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...f93b60e229b6683e24c4754a7106ee8_cgraph.svg | 2 +- ...6aae4778fbe89a3d59fd61fbc050cfa_cgraph.svg | 2 +- ...1_ay_star_search_1_1_info__coll__graph.map | 4 - ...1_ay_star_search_1_1_info__coll__graph.md5 | 1 - ...1_ay_star_search_1_1_info__coll__graph.svg | 40 - d6/da2/namespacevigenere.html | 35 +- d6/da8/0__1__knapsack_8cpp__incl.svg | 2 +- d6/dab/namespacetree__234.html | 35 +- ...sothers_1_1lru__cache_1_1_l_r_u_cache.html | 157 +- ...dbf04bf7e1472c48639694f0b110602_cgraph.map | 12 - ...dbf04bf7e1472c48639694f0b110602_cgraph.md5 | 1 - ...dbf04bf7e1472c48639694f0b110602_cgraph.svg | 160 - ...d506b1c1a3cd5b93cc7e497626bfb53_cgraph.svg | 2 +- d6/db0/binomial__dist_8cpp.html | 161 +- ...9ae0a6a2bd200fd1eb0e31b2bf4cc76_cgraph.svg | 2 +- ...6ed6ce71415fb400b65f0656cef3d25_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...09e51f513cee647d41192ab0a872cdc_cgraph.svg | 2 +- .../ode__semi__implicit__euler_8cpp__incl.svg | 2 +- ...ata__structures_1_1_skip_list-members.html | 41 +- d6/db8/inv__sqrt_8cpp.html | 165 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d6/dbc/sparse__matrix_8cpp__incl.svg | 2 +- d6/dbd/jump__search_8cpp__incl.svg | 2 +- d6/dc0/interpolation__search2_8cpp__incl.svg | 2 +- ..._1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html | 183 +- ...th_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.js | 1 - ...431ec5c876e1154d8e1e5f89e1ab34a_cgraph.map | 6 +- ...431ec5c876e1154d8e1e5f89e1ab34a_cgraph.md5 | 2 +- ...431ec5c876e1154d8e1e5f89e1ab34a_cgraph.svg | 16 +- ...b95277f5f527beacc8d0f3bc91fcd08_cgraph.map | 8 +- ...b95277f5f527beacc8d0f3bc91fcd08_cgraph.md5 | 2 +- ...b95277f5f527beacc8d0f3bc91fcd08_cgraph.svg | 16 +- ...77f5f527beacc8d0f3bc91fcd08_cgraph_org.svg | 16 +- ...de201f4687740454302c444f507a926_cgraph.map | 4 +- ...de201f4687740454302c444f507a926_cgraph.md5 | 2 +- ...de201f4687740454302c444f507a926_cgraph.svg | 16 +- d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html | 438 +-- d6/dce/rabin__karp_8cpp.html | 65 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 2 +- d6/dd3/ode__midpoint__euler_8cpp.html | 179 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...13517b8e5de1b75592052db7f7e237f_cgraph.svg | 2 +- ...3adf7b092a87868917ee5fb4255192b_cgraph.svg | 2 +- d6/dd8/is__graph__bipartite_8cpp.html | 139 +- d6/dd8/is__graph__bipartite_8cpp.js | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 3 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 37 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 3 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 37 +- d6/dec/breadth__first__search_8cpp__incl.svg | 2 +- d6/df6/n__choose__r_8cpp__incl.svg | 2 +- ...al_3_01uint128__t_01_4__inherit__graph.svg | 2 +- d7/d00/list__array_8cpp.html | 137 +- d7/d00/list__array_8cpp.js | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d7/d07/bidirectional__dijkstra_8cpp.html | 567 ++-- d7/d07/bidirectional__dijkstra_8cpp.js | 6 +- ...2df3d52a403ad46523ab90d3a723c1_cgraph.map} | 0 ...2df3d52a403ad46523ab90d3a723c1_cgraph.md5} | 0 ...2df3d52a403ad46523ab90d3a723c1_cgraph.svg} | 2 +- ...f1b7277e1dd4190f25014b48487ce6_cgraph.map} | 0 ...f1b7277e1dd4190f25014b48487ce6_cgraph.md5} | 0 ...f1b7277e1dd4190f25014b48487ce6_cgraph.svg} | 2 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.svg | 2 +- ...172365aebde9be1997157f6f80e0cf_cgraph.map} | 0 ...172365aebde9be1997157f6f80e0cf_cgraph.md5} | 0 ...172365aebde9be1997157f6f80e0cf_cgraph.svg} | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d7/d0a/namespacetrie__using__hashmap.html | 35 +- ..._structures_1_1_skip_list__coll__graph.map | 4 - ..._structures_1_1_skip_list__coll__graph.md5 | 1 - ..._structures_1_1_skip_list__coll__graph.svg | 39 - d7/d1e/graph_2dijkstra_8cpp.html | 211 +- d7/d1e/graph_2dijkstra_8cpp.js | 7 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.map | 7 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 41 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 9 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 81 +- d7/d1f/realtime__stats_8cpp__incl.svg | 2 +- d7/d21/classstack__linked_list-members.html | 37 +- .../nqueen__print__all__solutions_8cpp.html | 169 +- ...bd5e11fab6dab282efccfb61beb0bd9_cgraph.svg | 2 +- d7/d2e/avltree_8cpp__incl.svg | 2 +- d7/d35/matrix__exponentiation_8cpp.html | 267 +- d7/d35/matrix__exponentiation_8cpp.js | 6 +- ...769b745458157ef2679949155684f3b_cgraph.map | 4 - ...769b745458157ef2679949155684f3b_cgraph.md5 | 1 - ...02a9fc90e79b05b863cc4efa26ae2ec_cgraph.map | 4 + ...02a9fc90e79b05b863cc4efa26ae2ec_cgraph.md5 | 1 + ...2a9fc90e79b05b863cc4efa26ae2ec_cgraph.svg} | 18 +- d7/d39/lu__decomposition_8h__dep__incl.svg | 2 +- ...t__implentation__usingarray_8cpp__incl.svg | 2 +- d7/d40/class_solution__coll__graph.map | 6 - d7/d40/class_solution__coll__graph.md5 | 1 - d7/d40/class_solution__coll__graph.svg | 80 - d7/d41/struct_min_heap_node__coll__graph.svg | 2 +- d7/d47/namespace_x_o_r.html | 35 +- ...d_1_1is__integral_3_01uint256__t_01_4.html | 31 +- d7/d4a/fibonacci__sum_8cpp__incl.svg | 2 +- d7/d4c/spiral__print_8cpp__incl.svg | 2 +- d7/d53/inv__sqrt_8cpp__incl.svg | 2 +- ...longest__increasing__subsequence_8cpp.html | 113 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...f9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg | 2 +- ...etwork_1_1_neural_network__coll__graph.map | 9 - ...etwork_1_1_neural_network__coll__graph.md5 | 1 - ...etwork_1_1_neural_network__coll__graph.svg | 123 - ...uctures_1_1tree__234_1_1_node-members.html | 63 +- .../shortest__common__supersequence_8cpp.html | 319 +- ...2ee8d7e67da9f6eb85146b08dad95e6_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...inorder__successor__of__bst_8cpp__incl.svg | 2 +- d7/d6a/bisection__method_8cpp.html | 149 +- d7/d6a/bisection__method_8cpp.js | 1 - ...003b5b2dcfff0769b957ab5c968b03d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d7/d73/abbreviation_8cpp.html | 299 +- d7/d73/abbreviation_8cpp.js | 2 +- ...e606aa4c764ad8d13e49eab002ec7b9_cgraph.md5 | 1 - ...e606aa4c764ad8d13e49eab002ec7b9_cgraph.svg | 75 - ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...60b8858720bf217df22d992d0fefaa_cgraph.map} | 7 +- ...d60b8858720bf217df22d992d0fefaa_cgraph.md5 | 1 + ...d60b8858720bf217df22d992d0fefaa_cgraph.svg | 60 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...53b2f647bee9c5b75ef8dd9ef685dc8_cgraph.svg | 2 +- d7/d75/postfix__evaluation_8cpp.html | 237 +- d7/d75/postfix__evaluation_8cpp.js | 2 +- ...21baa2002a64bc0bfc3e1b64800d734_cgraph.svg | 2 +- ...c27f949c9d6659be9f5bd2ccbe1360a_cgraph.svg | 2 +- ...9fd597e0ea394abe027ced4d2ea3338_cgraph.svg | 2 +- ...77f8c9cc594975756838d498c237cea_cgraph.svg | 2 +- ...38bd3a177a6d61da3859a281233bbe1_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...igned_3_01uint256__t_01_4__coll__graph.svg | 2 +- d7/d77/class_edge.html | 67 +- d7/d77/class_edge.js | 13 +- d7/d7a/namespacebinomial.html | 35 +- .../classstatistics_1_1stats__computer1.html | 119 +- d7/d7c/classstatistics_1_1stats__computer1.js | 6 +- ...57e942d49f4fd70f059f224b4ac07e1_cgraph.svg | 2 +- d7/d7f/section.html | 43 +- d7/d81/namespacebit__manipulation.html | 49 +- d7/d83/trie__tree_8cpp.html | 108 +- d7/d83/trie__tree_8cpp.js | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d7/d89/double__factorial_8cpp.html | 143 +- ...8ba20fed2ce427f6469c7689437829d_cgraph.map | 3 + ...8ba20fed2ce427f6469c7689437829d_cgraph.md5 | 1 + ...8ba20fed2ce427f6469c7689437829d_cgraph.svg | 28 + ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.map | 6 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 40 +- ...bbcebf3a2d0c67f4c3cfb5511a97981_cgraph.map | 4 +- ...bbcebf3a2d0c67f4c3cfb5511a97981_cgraph.md5 | 2 +- ...bbcebf3a2d0c67f4c3cfb5511a97981_cgraph.svg | 32 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 8 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 48 +- .../power__for__huge__numbers_8cpp__incl.svg | 2 +- d7/d92/sublist__search_8cpp__incl.svg | 2 +- d7/da4/cut__rod_8cpp__incl.svg | 2 +- d7/da7/adaline__learning_8cpp__incl.svg | 2 +- d7/da7/adaline__learning_8cpp__incl_org.svg | 2 +- ...al_3_01uint256__t_01_4__inherit__graph.svg | 2 +- d7/dae/decimal__to__binary_8cpp__incl.svg | 2 +- d7/daf/namespace_knapsack.html | 33 +- ...search_1_1_ay_star_search__coll__graph.map | 4 - ...search_1_1_ay_star_search__coll__graph.md5 | 1 - ...search_1_1_ay_star_search__coll__graph.svg | 43 - ...res_1_1tree__234_1_1_node__coll__graph.map | 6 - ...res_1_1tree__234_1_1_node__coll__graph.md5 | 1 - ...res_1_1tree__234_1_1_node__coll__graph.svg | 79 - d7/db9/hill__cipher_8cpp.html | 239 +- d7/db9/hill__cipher_8cpp.js | 4 +- ...4391124480d2a49f2dec900237b0712_cgraph.map | 4 +- ...4391124480d2a49f2dec900237b0712_cgraph.md5 | 2 +- ...4391124480d2a49f2dec900237b0712_cgraph.svg | 10 +- ...124480d2a49f2dec900237b0712_cgraph_org.svg | 10 +- ...147ad576f8a94a2a6b66948672b452b_cgraph.map | 4 +- ...147ad576f8a94a2a6b66948672b452b_cgraph.md5 | 2 +- ...147ad576f8a94a2a6b66948672b452b_cgraph.svg | 6 +- ...d576f8a94a2a6b66948672b452b_cgraph_org.svg | 6 +- ...bfcd756610834acac501f9eea1e2eb_cgraph.map} | 0 ...bfcd756610834acac501f9eea1e2eb_cgraph.md5} | 0 ...bfcd756610834acac501f9eea1e2eb_cgraph.svg} | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 10 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 10 +- d7/dba/cll_8h_source.html | 117 +- .../classgraph_1_1_graph__inherit__graph.svg | 2 +- d7/dce/graph__coloring_8cpp__incl.svg | 2 +- ...metic_3_01uint128__t_01_4__coll__graph.svg | 2 +- d7/de0/stack_8h.html | 35 +- d7/de0/stack_8h_source.html | 333 +- d7/def/trie__multiple__search_8cpp.html | 129 +- d7/def/trie__multiple__search_8cpp.js | 2 +- ...f9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg | 2 +- ...ve__tree__traversals_1_1_node-members.html | 33 +- d8/d01/struct_item-members.html | 33 +- d8/d10/structlist.html | 43 +- d8/d13/bubble__sort_8cpp.html | 123 +- d8/d13/bubble__sort_8cpp.js | 4 - d8/d14/namespacen__queens__optimized.html | 35 +- d8/d1d/namespacestrand.html | 35 +- d8/d20/classuint256__t-members.html | 139 +- ...l__network_1_1_neural_network-members.html | 61 +- .../classrange__queries_1_1per_seg_tree.html | 322 +- d8/d28/classrange__queries_1_1per_seg_tree.js | 7 +- ...fe4e431f3e09c274ecd7d2d58dcb865_cgraph.map | 4 - ...fe4e431f3e09c274ecd7d2d58dcb865_cgraph.md5 | 1 - ...fe4e431f3e09c274ecd7d2d58dcb865_cgraph.svg | 38 - ...487eda25123bc4d112e8430821a6c6_cgraph.map} | 2 +- ...4487eda25123bc4d112e8430821a6c6_cgraph.md5 | 1 + ...487eda25123bc4d112e8430821a6c6_cgraph.svg} | 10 +- ...d3f2465a7c5803a1ff16c5378bcc5e4_cgraph.map | 3 + ...d3f2465a7c5803a1ff16c5378bcc5e4_cgraph.md5 | 1 + ...d3f2465a7c5803a1ff16c5378bcc5e4_cgraph.svg | 29 + ...83bcabf5a8db8b0d8d156a4c1bcd4c3_cgraph.map | 5 - ...83bcabf5a8db8b0d8d156a4c1bcd4c3_cgraph.md5 | 1 - ...83bcabf5a8db8b0d8d156a4c1bcd4c3_cgraph.svg | 53 - ...e7f57935b3bb9446f11c239fd89ae79_cgraph.map | 2 +- ...e7f57935b3bb9446f11c239fd89ae79_cgraph.md5 | 2 +- ...e7f57935b3bb9446f11c239fd89ae79_cgraph.svg | 4 +- ...484002bcb701820d55f32ea5d525571_cgraph.map | 8 +- ...484002bcb701820d55f32ea5d525571_cgraph.md5 | 2 +- ...484002bcb701820d55f32ea5d525571_cgraph.svg | 18 +- ...02bcb701820d55f32ea5d525571_cgraph_org.svg | 18 +- ...8ae4b1835e5e8aec32f68c5059ed4d4_cgraph.map | 6 +- ...8ae4b1835e5e8aec32f68c5059ed4d4_cgraph.md5 | 2 +- ...8ae4b1835e5e8aec32f68c5059ed4d4_cgraph.svg | 18 +- ...16c0c87b29119f066041d6e71ab50e0_cgraph.md5 | 1 - ...87494e6cf012d28c4f5b9d1c15f9c5d_cgraph.map | 10 +- ...87494e6cf012d28c4f5b9d1c15f9c5d_cgraph.md5 | 2 +- ...87494e6cf012d28c4f5b9d1c15f9c5d_cgraph.svg | 98 +- ...4e6cf012d28c4f5b9d1c15f9c5d_cgraph_org.svg | 98 +- d8/d36/namespacecut__rod.html | 33 +- d8/d38/queue_8h_source.html | 207 +- d8/d38/structquery-members.html | 33 +- ...inverse__fermat__little__theorem_8cpp.html | 139 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d8/d55/class_cycle_check-members.html | 37 +- d8/d58/kadane2_8cpp__incl.svg | 2 +- d8/d61/class_trie__coll__graph.map | 4 - d8/d61/class_trie__coll__graph.md5 | 1 - d8/d61/class_trie__coll__graph.svg | 39 - d8/d61/radix__sort2_8cpp.html | 205 +- d8/d61/radix__sort2_8cpp.js | 4 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.svg | 2 +- ...df9406972cda58c209b30ebae295daa_cgraph.md5 | 1 - ...ead7d43b11505398daf9a894f122f9_cgraph.map} | 0 ...ead7d43b11505398daf9a894f122f9_cgraph.md5} | 0 ...ead7d43b11505398daf9a894f122f9_cgraph.svg} | 2 +- ...cfd94fa3765b53d4ec7893ffaee5f8_cgraph.map} | 2 +- ...0cfd94fa3765b53d4ec7893ffaee5f8_cgraph.md5 | 1 + ...cfd94fa3765b53d4ec7893ffaee5f8_cgraph.svg} | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d8/d69/classgraph_1_1_h_k_graph.html | 339 +- d8/d69/classgraph_1_1_h_k_graph.js | 2 - ...b49011c09cf90a116ab53bef61cd95a_cgraph.map | 4 - ...b49011c09cf90a116ab53bef61cd95a_cgraph.md5 | 1 - ...b49011c09cf90a116ab53bef61cd95a_cgraph.svg | 37 - ...491add14d9fc04f679114ca6d6f0f93_cgraph.map | 4 - ...491add14d9fc04f679114ca6d6f0f93_cgraph.md5 | 1 - ...491add14d9fc04f679114ca6d6f0f93_cgraph.svg | 37 - ...dbda80d02bdc26c3e8ff7330c9be75d_cgraph.map | 5 +- ...dbda80d02bdc26c3e8ff7330c9be75d_cgraph.md5 | 2 +- ...dbda80d02bdc26c3e8ff7330c9be75d_cgraph.svg | 65 +- ...794950cb3407b6b47d3dc986cf714c0_cgraph.map | 3 +- ...794950cb3407b6b47d3dc986cf714c0_cgraph.md5 | 2 +- ...794950cb3407b6b47d3dc986cf714c0_cgraph.svg | 27 +- d8/d6c/line__segment__intersection_8cpp.html | 67 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d8/d72/class_r_btree.html | 704 +++- d8/d72/class_r_btree.js | 16 - d8/d76/morse__code_8cpp.html | 495 ++- ...242e458904de8a242fcdaffe9e3ba1a_cgraph.svg | 2 +- ...5c66ec8cf4cef0a35c50cbab86965dc_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...31773fd11555d21f70d6914138d9535_cgraph.svg | 2 +- ...9f294b0dec08a4a11d477a32f9bd829_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d8/d77/namespacemachine__learning.html | 1478 +++++---- d8/d77/namespacemachine__learning.js | 58 +- ...2f435bca0839e721fc1574a61e8da3_cgraph.map} | 6 +- ...42f435bca0839e721fc1574a61e8da3_cgraph.md5 | 1 + ...2f435bca0839e721fc1574a61e8da3_cgraph.svg} | 10 +- ...5bca0839e721fc1574a61e8da3_cgraph_org.svg} | 8 +- ...5b9445c6ab65053b9bf9897a96af82d_cgraph.md5 | 1 - ...c29566568e0383dd7d374068cbe6b3_cgraph.map} | 2 +- ...cc29566568e0383dd7d374068cbe6b3_cgraph.md5 | 1 + ...c29566568e0383dd7d374068cbe6b3_cgraph.svg} | 4 +- ...b42d24ad7bedbfa8e5b59fe96987a44_cgraph.md5 | 1 - ...66857dab977a49f117029835b3b6d2_cgraph.map} | 2 +- ...466857dab977a49f117029835b3b6d2_cgraph.md5 | 1 + ...66857dab977a49f117029835b3b6d2_cgraph.svg} | 4 +- ...480fccfb39de20ca47f1bf51ecb6ec_cgraph.map} | 2 +- ...0480fccfb39de20ca47f1bf51ecb6ec_cgraph.md5 | 1 + ...480fccfb39de20ca47f1bf51ecb6ec_cgraph.svg} | 4 +- ...42906d42b80fc6b6b3ad17bf00fcb9_cgraph.map} | 2 +- ...342906d42b80fc6b6b3ad17bf00fcb9_cgraph.md5 | 1 + ...42906d42b80fc6b6b3ad17bf00fcb9_cgraph.svg} | 4 +- ...bf1f3c43271a5fc93101f6ae2e6269_cgraph.map} | 0 ...bf1f3c43271a5fc93101f6ae2e6269_cgraph.md5} | 0 ...bf1f3c43271a5fc93101f6ae2e6269_cgraph.svg} | 2 +- ...f42063207181529413d812ade52f58e_cgraph.md5 | 1 - ...ef38e5947aef609f908bfbfeaf11d75_cgraph.md5 | 1 - ...491744dcfc8844338d55065d0cd0c79_cgraph.md5 | 1 - ...260cb1be9b63d6e38107000ac4b7e7_cgraph.map} | 0 ...260cb1be9b63d6e38107000ac4b7e7_cgraph.md5} | 0 ...260cb1be9b63d6e38107000ac4b7e7_cgraph.svg} | 2 +- ...fde571b38f9483576594f66572958a_cgraph.map} | 2 +- ...9fde571b38f9483576594f66572958a_cgraph.md5 | 1 + ...fde571b38f9483576594f66572958a_cgraph.svg} | 4 +- ...225f0ded976096b45ffe13c75d33c05_cgraph.md5 | 1 - ...aac06ccf128b0a9c55c9ee1a8e5631_cgraph.map} | 0 ...aac06ccf128b0a9c55c9ee1a8e5631_cgraph.md5} | 0 ...aac06ccf128b0a9c55c9ee1a8e5631_cgraph.svg} | 2 +- ...2a53c88203fde278f1fe6c3afe5b07_cgraph.map} | 0 ...2a53c88203fde278f1fe6c3afe5b07_cgraph.md5} | 0 ...2a53c88203fde278f1fe6c3afe5b07_cgraph.svg} | 2 +- ...e7b35403af3612222d3b7a53074905_cgraph.map} | 0 ...e7b35403af3612222d3b7a53074905_cgraph.md5} | 0 ...e7b35403af3612222d3b7a53074905_cgraph.svg} | 2 +- ...32d152078e96311e43ac5e7183ea26_cgraph.map} | 2 +- ...332d152078e96311e43ac5e7183ea26_cgraph.md5 | 1 + ...32d152078e96311e43ac5e7183ea26_cgraph.svg} | 4 +- ...4010fe3a52a74e8b5b1aaadfe38b46f_cgraph.md5 | 1 - ...3d294e21a0c4fa33c53757df054576_cgraph.map} | 6 +- ...43d294e21a0c4fa33c53757df054576_cgraph.md5 | 1 + ...3d294e21a0c4fa33c53757df054576_cgraph.svg} | 10 +- ...4e21a0c4fa33c53757df054576_cgraph_org.svg} | 8 +- ...7d9b358f1ef2ba2a1d475a5452ec41f_cgraph.md5 | 1 - ...fa3e62b686aebdbad81c4f89913f43_cgraph.map} | 2 +- ...afa3e62b686aebdbad81c4f89913f43_cgraph.md5 | 1 + ...fa3e62b686aebdbad81c4f89913f43_cgraph.svg} | 4 +- ...c6a28f40512dbda75ab1a3969248898_cgraph.md5 | 1 - ...c731720947b4bc2ab047c141e7d0299_cgraph.md5 | 1 - ...68ad43698a1d69ba46ea3827d7d2c3_cgraph.map} | 4 +- ...868ad43698a1d69ba46ea3827d7d2c3_cgraph.md5 | 1 + ...68ad43698a1d69ba46ea3827d7d2c3_cgraph.svg} | 6 +- ...986b23760039711848155739c31b35_cgraph.map} | 0 ...986b23760039711848155739c31b35_cgraph.md5} | 0 ...986b23760039711848155739c31b35_cgraph.svg} | 2 +- ...01bf30591ca6b2c38ff4fed0ded23f_cgraph.map} | 0 ...01bf30591ca6b2c38ff4fed0ded23f_cgraph.md5} | 0 ...01bf30591ca6b2c38ff4fed0ded23f_cgraph.svg} | 2 +- d8/d89/namespacelinear__probing.html | 349 +- d8/d89/namespacelinear__probing.js | 9 +- ...6680b8a37d442c2f208faa286e33908_cgraph.svg | 2 +- ...b8a37d442c2f208faa286e33908_cgraph_org.svg | 2 +- ...6d34fd3511626a83ab00665d7bc34d1_cgraph.svg | 2 +- ...322209aaa91b7bbf16f96e1cc52b746_cgraph.svg | 2 +- ...a082dc1426a79f866cee6b370df37b0_cgraph.svg | 2 +- ...dc1426a79f866cee6b370df37b0_cgraph_org.svg | 2 +- ...5854f5aa216e61219154c62167ce8f0_cgraph.svg | 2 +- ...f5aa216e61219154c62167ce8f0_cgraph_org.svg | 2 +- ...cf8d033f8115f39f3c93cfb6cee0b28_cgraph.svg | 2 +- ...87b71d810901fab69c4ad9d4d0fa635_cgraph.svg | 2 +- d8/d8a/exponential__search_8cpp.html | 149 +- d8/d8a/exponential__search_8cpp.js | 4 +- d8/d8e/struct_node-members.html | 35 +- d8/d90/iterative__tree__traversals_8cpp.html | 422 ++- d8/d90/iterative__tree__traversals_8cpp.js | 4 +- d8/d93/namespacemagic__sequence.html | 35 +- d8/d95/vector__ops_8hpp.html | 177 +- d8/d95/vector__ops_8hpp.js | 44 +- d8/d95/vector__ops_8hpp_source.html | 1099 ++++--- d8/d96/gram__schmidt_8cpp__incl.svg | 2 +- ...connected__components__with__dsu_8cpp.html | 173 +- .../connected__components__with__dsu_8cpp.js | 5 +- ...69384d8a4197a9b24482ce7c321a85e_cgraph.svg | 2 +- ...7cb7472f310a798f555fe45cdf50145_cgraph.svg | 2 +- ...2d6698b71384a352ec4b81b31b13141_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...91ed94113c56191b75fe45f688d6e62_cgraph.svg | 2 +- ...ru__cache_1_1_l_r_u_cache__coll__graph.map | 6 - ...ru__cache_1_1_l_r_u_cache__coll__graph.md5 | 1 - ...ru__cache_1_1_l_r_u_cache__coll__graph.svg | 175 - ...cache_1_1_l_r_u_cache__coll__graph_org.svg | 87 - d8/da7/namespacedepth__first__search.html | 35 +- .../classstatistics_1_1stats__computer2.html | 111 +- d8/dab/classstatistics_1_1stats__computer2.js | 6 +- ...f2e84df4fc386bb3295016ef8fd156e_cgraph.svg | 2 +- d8/db1/binomial__calculate_8cpp.html | 147 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.svg | 2 +- ...e407a2a13362c4c64fbe509ff325978_cgraph.svg | 2 +- ...0f2228420376f4db7e1274f2b41667c_cgraph.svg | 2 +- d8/db9/structcompare-members.html | 31 +- ...sing__array_1_1_queue___array-members.html | 37 +- ...heavy__light__decomposition_8cpp__incl.svg | 2 +- ...y__light__decomposition_8cpp__incl_org.svg | 2 +- d8/dc6/namespacemanacher.html | 35 +- d8/dc8/struct_point.html | 65 +- d8/dc8/struct_point.js | 1 - d8/dcc/namespacestd.html | 2890 ++++++++--------- d8/dcc/namespacestd.js | 6 +- d8/dcd/namespacelru__cache.html | 35 +- d8/dd5/check__factorial_8cpp.html | 131 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d8/ddf/sieve__of__eratosthenes_8cpp.html | 135 +- d8/ddf/sieve__of__eratosthenes_8cpp.js | 2 +- ...35843bdf82d2a6cc8596ae8fd3b8df9_cgraph.svg | 2 +- ...ebd5e7686a8db363f937b2f30d3818_cgraph.map} | 0 ...ebd5e7686a8db363f937b2f30d3818_cgraph.md5} | 0 ...ebd5e7686a8db363f937b2f30d3818_cgraph.svg} | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.map | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- d8/de0/radix__sort2_8cpp__incl.svg | 2 +- d8/dee/avltree_8cpp.html | 362 +-- d8/dee/avltree_8cpp.js | 15 +- d8/df0/queue__using__array_8cpp.html | 127 +- d8/df0/queue__using__array_8cpp.js | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 6 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 72 +- d8/df6/jumpgame_8cpp__incl.svg | 2 +- d8/df7/quick__sort__3_8cpp__incl.svg | 2 +- d9/d00/factorial_8cpp.html | 75 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 32 +- ...9945c15826a9c1b5c141db314b7f8b4_cgraph.map | 3 + ...9945c15826a9c1b5c141db314b7f8b4_cgraph.md5 | 1 + ...9945c15826a9c1b5c141db314b7f8b4_cgraph.svg | 28 + d9/d02/linear__search_8cpp.html | 117 +- d9/d03/namespacestring__search.html | 253 +- ...1c673d56cbf67b1d2ee4d869185b7d9_cgraph.svg | 2 +- ...6a58225ce7d3fa9d4c2f5349a65ed93_cgraph.map | 2 +- ...6a58225ce7d3fa9d4c2f5349a65ed93_cgraph.md5 | 2 +- ...6a58225ce7d3fa9d4c2f5349a65ed93_cgraph.svg | 4 +- ...6573527312d5255e1495b879e8a34f_cgraph.map} | 0 ...6573527312d5255e1495b879e8a34f_cgraph.md5} | 0 ...6573527312d5255e1495b879e8a34f_cgraph.svg} | 2 +- ...b2cd81064717aedd62bfb096b1a73d8_cgraph.svg | 2 +- d9/d0e/brent__method__extrema_8cpp__incl.svg | 2 +- ...s__all__solution__optimised_8cpp__incl.svg | 2 +- ...ive__tree__traversals_1_1_binary_tree.html | 207 +- d9/d13/namespaceinversion.html | 33 +- ...smachine__learning_1_1adaline-members.html | 41 +- d9/d21/namespacewave__sort.html | 35 +- ...classgraph_1_1_lowest_common_ancestor.html | 161 +- .../classgraph_1_1_lowest_common_ancestor.js | 1 - ...2589cc39d6bbff6c997152f1b96e356_cgraph.map | 7 +- ...2589cc39d6bbff6c997152f1b96e356_cgraph.md5 | 2 +- ...2589cc39d6bbff6c997152f1b96e356_cgraph.svg | 71 +- ...0151e19512b48cc0b14ea121df00488_cgraph.svg | 2 +- ...0825a4fd4c41860b689d253dd2c8e93_cgraph.map | 9 +- ...0825a4fd4c41860b689d253dd2c8e93_cgraph.md5 | 2 +- ...0825a4fd4c41860b689d253dd2c8e93_cgraph.svg | 81 +- ...a4fd4c41860b689d253dd2c8e93_cgraph_org.svg | 81 +- d9/d24/poisson__dist_8cpp.html | 143 +- ...9a136b32707bdc7950fb9057b5fa1e1_cgraph.svg | 2 +- ...9c9e74079278ca10e3b97a8d5391c9a_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d9/d27/namespacelist__array.html | 35 +- d9/d2c/class_test_cases-members.html | 45 +- d9/d31/coin__change__topdown_8cpp.html | 125 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...816a4ae8a29c156b90377041000929a_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d9/d31/recursive__bubble__sort_8cpp__incl.svg | 2 +- ..._1heavy__light__decomposition_1_1_s_g.html | 122 +- ..._1_1heavy__light__decomposition_1_1_s_g.js | 1 - ...fda852e6e522707fd97f61cdb0a2591_cgraph.svg | 2 +- d9/d43/hopcroft__karp_8cpp__incl.svg | 2 +- d9/d44/magic__number_8cpp.html | 95 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d9/d49/kohonen__som__trace_8cpp.html | 527 ++- d9/d49/kohonen__som__trace_8cpp.js | 13 +- ...283886819c7c140a023582b7269e2d0_cgraph.map | 12 +- ...283886819c7c140a023582b7269e2d0_cgraph.md5 | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 14 +- ...86819c7c140a023582b7269e2d0_cgraph_org.svg | 14 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.map | 12 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 | 2 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 14 +- ...7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg | 14 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 16 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 18 +- ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 18 +- ...082f2e5bacec40266499da4547309a_cgraph.map} | 0 ...082f2e5bacec40266499da4547309a_cgraph.md5} | 0 ...082f2e5bacec40266499da4547309a_cgraph.svg} | 2 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.map | 12 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.md5 | 2 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.svg | 14 +- ...5dd5c30adda100e95f0423c786e_cgraph_org.svg | 14 +- ...54fe319e6033485a8a6cd6f0d8932d_cgraph.map} | 0 ...54fe319e6033485a8a6cd6f0d8932d_cgraph.md5} | 0 ...54fe319e6033485a8a6cd6f0d8932d_cgraph.svg} | 2 +- ...71600aa42a81bc14a4a602ea5ff00d_cgraph.map} | 0 ...71600aa42a81bc14a4a602ea5ff00d_cgraph.md5} | 0 ...71600aa42a81bc14a4a602ea5ff00d_cgraph.svg} | 2 +- d9/d49/structdata__structures_1_1_node.html | 80 +- ...4a6777e72b639c3ee6446a541db8e78_cgraph.map | 4 - ...4a6777e72b639c3ee6446a541db8e78_cgraph.md5 | 1 - ...4a6777e72b639c3ee6446a541db8e78_cgraph.svg | 38 - ...light__decomposition_1_1_tree-members.html | 49 +- d9/d4e/gnome__sort_8cpp__incl.svg | 2 +- d9/d55/namespacesparse__table.html | 37 +- ...tures_1_1linked__list_1_1list-members.html | 41 +- .../structgeometry_1_1jarvis_1_1_point.html | 39 +- d9/d5a/structgeometry_1_1jarvis_1_1_point.js | 5 - d9/d5d/extended__euclid__algorithm_8cpp.html | 175 +- ...792ac7c33aaf26b860ab55f5652ab25_cgraph.svg | 2 +- ...ba15ca55b3e7dcb91f3c65d72ba052d_cgraph.map | 4 +- ...ba15ca55b3e7dcb91f3c65d72ba052d_cgraph.md5 | 2 +- ...ba15ca55b3e7dcb91f3c65d72ba052d_cgraph.svg | 18 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 9 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 124 + d9/d60/namespacerat__maze.html | 35 +- d9/d66/group__machine__learning.html | 260 +- d9/d66/group__machine__learning.js | 7 +- ...f9186ccb682724a8792a2bf81e9b9e_cgraph.map} | 0 ...f9186ccb682724a8792a2bf81e9b9e_cgraph.md5} | 0 ...f9186ccb682724a8792a2bf81e9b9e_cgraph.svg} | 2 +- ...90175770bf0d5853c466e14993a08c_cgraph.map} | 0 ...90175770bf0d5853c466e14993a08c_cgraph.md5} | 0 ...90175770bf0d5853c466e14993a08c_cgraph.svg} | 2 +- ...208548f8b393528e5db01717e88e67_cgraph.map} | 0 ...208548f8b393528e5db01717e88e67_cgraph.md5} | 0 ...208548f8b393528e5db01717e88e67_cgraph.svg} | 2 +- ...5ce14f026d6d231bef29161bac2b485_cgraph.svg | 2 +- d9/d69/median__search_8cpp.html | 229 +- ...68847218f694e78bf433a0ff7648bae_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d9/d70/namespacequeue__using__array.html | 35 +- d9/d75/namespacednf__sort.html | 35 +- d9/d78/factorial_8cpp__incl.svg | 2 +- d9/d7d/primality__test_8cpp__incl.svg | 2 +- ...ed_3_01uint128__t_01_4__inherit__graph.svg | 2 +- .../palindrome__partitioning_8cpp__incl.svg | 2 +- d9/d89/fibonacci_8cpp.html | 169 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 4 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 32 +- ...f94f3212385cff0a5f19ff6b0cce8e7_cgraph.map | 3 + ...f94f3212385cff0a5f19ff6b0cce8e7_cgraph.md5 | 1 + ...f94f3212385cff0a5f19ff6b0cce8e7_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 6 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 85 + d9/d90/struct_btree.html | 39 +- d9/d90/struct_btree.js | 6 - d9/d92/chaining_8cpp.html | 155 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d9/d94/golden__search__extrema_8cpp__incl.svg | 2 +- d9/da4/class_fenwick_tree__coll__graph.map | 4 - d9/da4/class_fenwick_tree__coll__graph.md5 | 1 - d9/da4/class_fenwick_tree__coll__graph.svg | 38 - d9/dae/struct_queue__coll__graph.svg | 2 +- d9/db7/linked__list_8cpp__incl.svg | 2 +- ...e__force__string__searching_8cpp__incl.svg | 2 +- d9/dc9/namespacebase64__encoding.html | 35 +- d9/dca/namespacesearch.html | 47 +- d9/dca/namespacesearch.js | 4 +- d9/dcc/miller__rabin_8cpp__incl.svg | 2 +- .../namespacelinear__recurrence__matrix.html | 35 +- d9/dd7/interpolation__search_8cpp.html | 135 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d9/dd9/bisection__method_8cpp__incl.svg | 2 +- d9/ddb/tower__of__hanoi_8cpp__incl.svg | 2 +- d9/dde/classbinary__search__tree.html | 552 ++-- d9/dde/classbinary__search__tree.js | 6 +- ...6a863442c165503ac189f7b47599ec8_cgraph.md5 | 1 - ...23830316204664514f396a4eb5275a_cgraph.map} | 4 +- ...f23830316204664514f396a4eb5275a_cgraph.md5 | 1 + ...23830316204664514f396a4eb5275a_cgraph.svg} | 16 +- ...fcf37549bd002c174a45b0b4203c2bd_cgraph.map | 3 + ...fcf37549bd002c174a45b0b4203c2bd_cgraph.md5 | 1 + ...fcf37549bd002c174a45b0b4203c2bd_cgraph.svg | 29 + ...2b16f26928b5e994925100594a167a0_cgraph.svg | 2 +- ...3d1bf8e5ef0a952d2817f3cd22546c7_cgraph.md5 | 1 - ...64c1cf848f84a5b77462036a6d8c13_cgraph.map} | 4 +- ...764c1cf848f84a5b77462036a6d8c13_cgraph.md5 | 1 + ...64c1cf848f84a5b77462036a6d8c13_cgraph.svg} | 16 +- ...011e1b0863d79c3a7c11a0426bdcff_cgraph.map} | 4 +- ...c011e1b0863d79c3a7c11a0426bdcff_cgraph.md5 | 1 + ...011e1b0863d79c3a7c11a0426bdcff_cgraph.svg} | 16 +- ...bf5b410299df2320ddf2709dda61f63_cgraph.svg | 2 +- ...0030b0d7990c6fd450256d27b8f6c7b_cgraph.md5 | 1 - ...5f897af6aa732a9901454401c869bcb_cgraph.map | 3 + ...5f897af6aa732a9901454401c869bcb_cgraph.md5 | 1 + ...5f897af6aa732a9901454401c869bcb_cgraph.svg | 29 + ...168edf29316f2b436eac1fc416c52e0_cgraph.map | 4 +- ...168edf29316f2b436eac1fc416c52e0_cgraph.md5 | 2 +- ...168edf29316f2b436eac1fc416c52e0_cgraph.svg | 16 +- ...7c0a35845d27e0f6fc1f4eaa0333362_cgraph.map | 3 + ...7c0a35845d27e0f6fc1f4eaa0333362_cgraph.md5 | 1 + ...7c0a35845d27e0f6fc1f4eaa0333362_cgraph.svg | 29 + ...9771c2e1353e8ddfd4bb9d30b7a98fb_cgraph.svg | 2 +- ...d1e7e10efa74d741bf48cf032df3778_cgraph.map | 3 + ...d1e7e10efa74d741bf48cf032df3778_cgraph.md5 | 1 + ...d1e7e10efa74d741bf48cf032df3778_cgraph.svg | 29 + ...4f84b2eec9b9201af1840868ddb5fb2_cgraph.map | 3 + ...4f84b2eec9b9201af1840868ddb5fb2_cgraph.md5 | 1 + ...4f84b2eec9b9201af1840868ddb5fb2_cgraph.svg | 29 + ...81edd415324d372632c42dc7dbcb9e1_cgraph.map | 3 + ...81edd415324d372632c42dc7dbcb9e1_cgraph.md5 | 1 + ...81edd415324d372632c42dc7dbcb9e1_cgraph.svg | 29 + ...9912e8574538e86f9bd2c38e7e63d03_cgraph.svg | 2 +- ...9a2c7c187a7ca3142c77ce342ef3153_cgraph.map | 3 + ...9a2c7c187a7ca3142c77ce342ef3153_cgraph.md5 | 1 + ...9a2c7c187a7ca3142c77ce342ef3153_cgraph.svg | 29 + d9/dde/structdouble__hashing_1_1_entry.html | 45 +- d9/deb/cycle__sort_8cpp__incl.svg | 2 +- d9/dee/classdouble__linked__list.html | 241 +- d9/dee/classdouble__linked__list.js | 9 - d9/def/namespacesublist__search.html | 35 +- d9/df0/fast__integer__input_8cpp.html | 107 +- ...e097ac8509b717bdc8ab09ecd86ae82_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- d9/dfa/fibonacci__search_8cpp__incl.svg | 2 +- d9/dfd/comb__sort_8cpp.html | 193 +- ...f4e7569090083fb53d5cdeaf0e2974f_cgraph.svg | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...de08143e63105faba10e9ee8e745fd5_cgraph.svg | 2 +- d9/dfd/primes__up__to__billion_8cpp__incl.svg | 2 +- d9/dfd/uint128__t_8hpp__incl.svg | 2 +- da/d01/rat__maze_8cpp__incl.svg | 2 +- ..._1_1aystar__search_1_1_ay_star_search.html | 339 +- ...ng_1_1aystar__search_1_1_ay_star_search.js | 11 +- ...26aa9ad3d73707370d9fe83707aca4_cgraph.map} | 0 ...26aa9ad3d73707370d9fe83707aca4_cgraph.md5} | 0 ...26aa9ad3d73707370d9fe83707aca4_cgraph.svg} | 2 +- ...284e156fdd48fd0c41008c7e48f201_cgraph.map} | 10 +- ...8284e156fdd48fd0c41008c7e48f201_cgraph.md5 | 1 + ...284e156fdd48fd0c41008c7e48f201_cgraph.svg} | 56 +- ...bb772fd41005fdefa8bd32edbf00cc3_cgraph.md5 | 1 - da/d23/eulers__totient__function_8cpp.html | 129 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 4 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 1 + ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 37 + da/d24/sqrt__double_8cpp.html | 119 +- ...662282ad0740d2063ac404ca3bd74fc_cgraph.map | 3 + ...662282ad0740d2063ac404ca3bd74fc_cgraph.md5 | 1 + ...662282ad0740d2063ac404ca3bd74fc_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 32 +- da/d26/strand__sort_8cpp__incl.svg | 2 +- ...__using__hashmap_1_1_trie__coll__graph.map | 4 - ...__using__hashmap_1_1_trie__coll__graph.md5 | 1 - ...__using__hashmap_1_1_trie__coll__graph.svg | 41 - da/d35/sieve__of__eratosthenes_8cpp__incl.svg | 2 +- ...es_1_1sparse__table_1_1_sparse__table.html | 91 +- da/d41/uint128__t_8hpp.html | 824 ++++- da/d41/uint128__t_8hpp.js | 24 +- ...ff77262ffd6743df5b808d41382a6f3_cgraph.map | 2 +- ...ff77262ffd6743df5b808d41382a6f3_cgraph.md5 | 2 +- ...ff77262ffd6743df5b808d41382a6f3_cgraph.svg | 4 +- da/d41/uint128__t_8hpp_source.html | 2303 +++++++------ ...epth__first__search__with__stack_8cpp.html | 373 ++- .../depth__first__search__with__stack_8cpp.js | 4 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.svg | 2 +- ...38da9f508f6a9e87f123c9fb6f2ea9_cgraph.map} | 0 ...38da9f508f6a9e87f123c9fb6f2ea9_cgraph.md5} | 0 ...38da9f508f6a9e87f123c9fb6f2ea9_cgraph.svg} | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...iling__ciphers__in__factorial__n_8cpp.html | 149 +- ...d5e1d651d0d30bd682f176d8f2b83d0_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- da/d50/is__graph__bipartite_8cpp__incl.svg | 2 +- da/d52/minimum__edit__distance_8cpp.html | 231 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- da/d5a/class_complex.html | 261 +- da/d5a/class_complex.js | 6 +- ...cfc522c782726f49ee20af17b77f867_cgraph.svg | 2 +- ...ac9f529d54cacf2969f2c7179b4c4ac_cgraph.map | 5 + ...ac9f529d54cacf2969f2c7179b4c4ac_cgraph.md5 | 1 + ...ac9f529d54cacf2969f2c7179b4c4ac_cgraph.svg | 52 + ...38437c10eb798f176c384a695171b90_cgraph.svg | 2 +- ...1e03712837450549e0c9b4017533a41_cgraph.svg | 2 +- ...5b51b749ea4964104b9527af9d8f556_cgraph.svg | 2 +- ...non__recursive__merge__sort_8cpp__incl.svg | 2 +- ...uctsearch_1_1sublist__search_1_1_node.html | 43 +- ...ange__queries_1_1per_seg_tree-members.html | 47 +- ...mespaceoperations__on__datastructures.html | 43 +- ...namespaceoperations__on__datastructures.js | 12 +- ...r__search_1_1_ay_star_search_1_1_info.html | 143 +- ...tar__search_1_1_ay_star_search_1_1_info.js | 7 +- ...993dbca9c5b3ef9ac361dc7f62ce57_cgraph.map} | 0 ...993dbca9c5b3ef9ac361dc7f62ce57_cgraph.md5} | 0 ...993dbca9c5b3ef9ac361dc7f62ce57_cgraph.svg} | 2 +- ...ph_1_1_lowest_common_ancestor-members.html | 35 +- ...cted__components__with__dsu_8cpp__incl.svg | 2 +- da/d76/abbreviation_8cpp__incl.svg | 2 +- da/d77/spirograph_8cpp.html | 96 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 4 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 10 +- ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 10 +- da/d7b/primality__test_8cpp.html | 95 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- da/d82/namespacecycle__detection.html | 35 +- ..._1_1tree__234_1_1_tree234__coll__graph.map | 7 +- ..._1_1tree__234_1_1_tree234__coll__graph.md5 | 2 +- ..._1_1tree__234_1_1_tree234__coll__graph.svg | 78 +- da/d8a/paranthesis__matching_8cpp__incl.svg | 2 +- da/d8d/depth__first__search_8cpp.html | 131 +- da/d8d/depth__first__search_8cpp.js | 6 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 9 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 55 +- da/d9a/class_graph.html | 737 ++++- da/d9a/class_graph.js | 37 +- da/d9a/palindrome__of__number_8cpp.html | 77 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- da/da3/uint256__t_8hpp.html | 783 ++++- da/da3/uint256__t_8hpp.js | 24 +- da/da3/uint256__t_8hpp_source.html | 2235 +++++++------ ...queens__all__solution__optimised_8cpp.html | 219 +- ...4090463be4942a69ea91fe7386da905_cgraph.svg | 2 +- ...3c0547e4fd1708e6fb643b08327a60f_cgraph.svg | 2 +- ...e48455584a4faa33e83dd1891efd9b9_cgraph.svg | 2 +- da/db8/count__of__set__bits_8cpp.html | 111 +- ...f6a583b73a3e85c2d5121ed3d1c7d8a_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...t__palindromic__subsequence_8cpp__incl.svg | 2 +- ...igned_3_01uint128__t_01_4__coll__graph.svg | 2 +- da/dc3/linked__list_8cpp.html | 191 +- da/dc3/linked__list_8cpp.js | 4 +- ...1a372fe1e605bc0e0987dcdd7361180_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...ibonacci__matrix__exponentiation_8cpp.html | 213 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...decomposition_1_1_tree__inherit__graph.svg | 2 +- .../structquadratic__probing_1_1_entry.html | 45 +- ...hine__learning_1_1adaline__coll__graph.map | 4 - ...hine__learning_1_1adaline__coll__graph.md5 | 1 - ...hine__learning_1_1adaline__coll__graph.svg | 38 - ...rithm__for__fast__multiplication_8cpp.html | 281 +- ...a890d2f26855ada3b9f1d43aec70a86_cgraph.map | 2 +- ...a890d2f26855ada3b9f1d43aec70a86_cgraph.md5 | 2 +- ...a890d2f26855ada3b9f1d43aec70a86_cgraph.svg | 4 +- ...d1dbae365c7746295d3322e6f7f80b6_cgraph.map | 2 +- ...d1dbae365c7746295d3322e6f7f80b6_cgraph.md5 | 2 +- ...d1dbae365c7746295d3322e6f7f80b6_cgraph.svg | 4 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- da/dd3/namespacespirograph.html | 141 +- ...e83a64e8443fff1e5ffdc1c299c1e99_cgraph.map | 10 + ...e83a64e8443fff1e5ffdc1c299c1e99_cgraph.md5 | 1 + ...e83a64e8443fff1e5ffdc1c299c1e99_cgraph.svg | 127 + ...ca22dbe4563358960e907a40cd3e1ac_cgraph.svg | 2 +- da/dd4/namespacemedian__search.html | 35 +- da/dd9/happy__number_8cpp__incl.svg | 2 +- .../double__hash__hash__table_8cpp__incl.svg | 2 +- da/dda/namespaceradix__sort.html | 35 +- da/de7/decimal__to__hexadecimal_8cpp.html | 87 +- ...40291bc02cba5474a4cb46a9b9566fe_cgraph.svg | 2 +- da/df2/durand__kerner__roots_8cpp.html | 575 ++-- da/df2/durand__kerner__roots_8cpp.js | 8 +- ...283886819c7c140a023582b7269e2d0_cgraph.map | 6 +- ...283886819c7c140a023582b7269e2d0_cgraph.md5 | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 8 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.map | 6 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 | 2 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 8 +- ...35b320ace8677f9b331faf94f8b2fd_cgraph.map} | 4 +- ...c35b320ace8677f9b331faf94f8b2fd_cgraph.md5 | 1 + ...35b320ace8677f9b331faf94f8b2fd_cgraph.svg} | 6 +- ...38b9cfd2a39d856e0feba3b5d241ded_cgraph.md5 | 1 - ...ab49ba1969d7a5988f9bc2c8924569_cgraph.map} | 0 ...ab49ba1969d7a5988f9bc2c8924569_cgraph.md5} | 0 ...ab49ba1969d7a5988f9bc2c8924569_cgraph.svg} | 2 +- ...ar__search_1_1_ay_star_search-members.html | 43 +- ...ry__search__tree_1_1bst__node-members.html | 35 +- da/dfd/buzz__number_8cpp__incl.svg | 2 +- db/d01/brent__method__extrema_8cpp.html | 427 ++- ...283886819c7c140a023582b7269e2d0_cgraph.map | 7 + ...283886819c7c140a023582b7269e2d0_cgraph.md5 | 1 + ...283886819c7c140a023582b7269e2d0_cgraph.svg | 82 + ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.map | 6 + ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 | 1 + ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 67 + ...aa76a6d5fd4d333f9072beff1dc486b_cgraph.svg | 2 +- ...d0455dd5c30adda100e95f0423c786e_cgraph.map | 7 + ...d0455dd5c30adda100e95f0423c786e_cgraph.md5 | 1 + ...d0455dd5c30adda100e95f0423c786e_cgraph.svg | 82 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- db/d03/_s_t-example.html | 33 +- db/d03/namespacewildcard__matching.html | 35 +- db/d07/spiral__print_8cpp.html | 179 +- ...fff36db81326fb990a643ab198ee8a5_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- db/d0c/check__amicable__pair_8cpp__incl.svg | 2 +- db/d0d/prime__factorization_8cpp.html | 176 +- ...ece0145fb29a5cf48378c23dde2da46_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 3 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 31 +- ...fe577b9bce8f604f5e2f861c63c7099_cgraph.map | 4 - ...fe577b9bce8f604f5e2f861c63c7099_cgraph.md5 | 1 - ...fe577b9bce8f604f5e2f861c63c7099_cgraph.svg | 37 - ...__array_1_1_queue___array__coll__graph.map | 5 - ...__array_1_1_queue___array__coll__graph.md5 | 1 - ...__array_1_1_queue___array__coll__graph.svg | 56 - db/d16/0__1__knapsack_8cpp.html | 191 +- ...5edf30f336885e5b851f6b7199c6cd1_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- db/d18/stack_8h__incl.svg | 2 +- db/d19/structlinear__probing_1_1_entry.html | 45 +- db/d1e/classgraph_1_1_graph-members.html | 39 +- db/d27/n__bonacci_8cpp.html | 219 +- db/d27/n__bonacci_8cpp.js | 2 +- ...49b68f760be628d5975ab3eddec63d_cgraph.map} | 0 ...49b68f760be628d5975ab3eddec63d_cgraph.md5} | 0 ...49b68f760be628d5975ab3eddec63d_cgraph.svg} | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ..._1_1jarvis_1_1_convexhull__coll__graph.map | 5 - ..._1_1jarvis_1_1_convexhull__coll__graph.md5 | 1 - ..._1_1jarvis_1_1_convexhull__coll__graph.svg | 55 - db/d30/fast__power_8cpp__incl.svg | 2 +- ...arse__table_1_1_sparse__table-members.html | 35 +- db/d3c/tower__of__hanoi_8cpp.html | 159 +- ...037f72a5eac476535a6cfbbcb965417_cgraph.md5 | 2 +- ...037f72a5eac476535a6cfbbcb965417_cgraph.svg | 8 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 36 +- db/d3f/wave__sort_8cpp.html | 169 +- db/d3f/wave__sort_8cpp.js | 2 +- ...4f243b9dc13ace4ef77e30dbc56f12_cgraph.map} | 0 ...4f243b9dc13ace4ef77e30dbc56f12_cgraph.md5} | 0 ...4f243b9dc13ace4ef77e30dbc56f12_cgraph.svg} | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- db/d4e/depth__first__search_8cpp__incl.svg | 2 +- db/d51/fibonacci__fast_8cpp__incl.svg | 2 +- ...ulo__p_1_1_n_c_r_modulo_p__coll__graph.map | 5 - ...ulo__p_1_1_n_c_r_modulo_p__coll__graph.md5 | 1 - ...ulo__p_1_1_n_c_r_modulo_p__coll__graph.svg | 55 - db/d66/struct_item.html | 37 +- db/d66/struct_item.js | 5 - db/d6c/count__inversions_8cpp__incl.svg | 2 +- ...ed_3_01uint256__t_01_4__inherit__graph.svg | 2 +- .../namespaceheavy__light__decomposition.html | 33 +- .../quadratic__probing__hash__table_8cpp.html | 187 +- .../quadratic__probing__hash__table_8cpp.js | 11 +- ...ic_3_01uint128__t_01_4__inherit__graph.svg | 2 +- db/d82/classlarge__number.html | 644 ++-- db/d82/classlarge__number.js | 19 +- ...0119a83839e65962621b73df46a5337_cgraph.map | 4 - ...0119a83839e65962621b73df46a5337_cgraph.md5 | 1 - ...0119a83839e65962621b73df46a5337_cgraph.svg | 38 - ...f5571e66305cf68bb8283e4aeda58bc_cgraph.map | 4 +- ...f5571e66305cf68bb8283e4aeda58bc_cgraph.md5 | 2 +- ...f5571e66305cf68bb8283e4aeda58bc_cgraph.svg | 52 +- ...0c436d1a1c5e3795d6177d3815ad615_cgraph.map | 4 - ...0c436d1a1c5e3795d6177d3815ad615_cgraph.md5 | 1 - ...0c436d1a1c5e3795d6177d3815ad615_cgraph.svg | 37 - ...1e9b28cfddf1ad94668566e396e350_cgraph.map} | 4 +- ...71e9b28cfddf1ad94668566e396e350_cgraph.md5 | 1 + ...1e9b28cfddf1ad94668566e396e350_cgraph.svg} | 52 +- ...59c5c1a982949bbf98e1ea0f9afe6a9_cgraph.map | 1 - ...59c5c1a982949bbf98e1ea0f9afe6a9_cgraph.md5 | 2 +- ...59c5c1a982949bbf98e1ea0f9afe6a9_cgraph.svg | 23 +- ...5644405094740e34983cedfecb36cf_cgraph.map} | 6 +- ...b5644405094740e34983cedfecb36cf_cgraph.md5 | 1 + ...5644405094740e34983cedfecb36cf_cgraph.svg} | 74 +- ...1af3e0f425cdf7ea2039c9dcfe22f0b_cgraph.md5 | 1 - ...1af3e0f425cdf7ea2039c9dcfe22f0b_cgraph.svg | 185 -- ...09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.map | 4 - ...09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.md5 | 1 - ...09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.svg | 37 - ...27b399ed872731758ec33ebb102730e_cgraph.md5 | 1 - ...35a55607cf52c0b0d485f2129bd39ac_cgraph.map | 1 - ...35a55607cf52c0b0d485f2129bd39ac_cgraph.md5 | 2 +- ...35a55607cf52c0b0d485f2129bd39ac_cgraph.svg | 23 +- ...4598f1f2794b5e17e10c25e0501e41a_cgraph.map | 1 - ...4598f1f2794b5e17e10c25e0501e41a_cgraph.md5 | 2 +- ...4598f1f2794b5e17e10c25e0501e41a_cgraph.svg | 23 +- db/d8b/struct_node.html | 84 +- db/d8b/struct_node.js | 8 - .../lowest__common__ancestor_8cpp__incl.svg | 2 +- db/d8f/struct_btree__coll__graph.svg | 2 +- db/d91/binomial__calculate_8cpp__incl.svg | 2 +- db/d93/check__prime_8cpp.html | 117 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- db/d93/morse__code_8cpp__incl.svg | 2 +- db/d9a/classuint128__t.html | 1267 ++++---- db/d9a/classuint128__t.js | 55 +- ...b6612186d8f678452e011d08ee1f5ac_cgraph.svg | 2 +- ...9209a184db20a7ffc8e687fdb05be2_cgraph.map} | 2 +- ...79209a184db20a7ffc8e687fdb05be2_cgraph.md5 | 1 + ...9209a184db20a7ffc8e687fdb05be2_cgraph.svg} | 4 +- ...0ed88fe2054788cc6e0b6a8fdf66db_cgraph.map} | 2 +- ...00ed88fe2054788cc6e0b6a8fdf66db_cgraph.md5 | 1 + ...0ed88fe2054788cc6e0b6a8fdf66db_cgraph.svg} | 4 +- ...072a7e43da3600c345c81bc80c957ee_cgraph.map | 2 +- ...072a7e43da3600c345c81bc80c957ee_cgraph.md5 | 2 +- ...072a7e43da3600c345c81bc80c957ee_cgraph.svg | 4 +- ...9e50792c542a57392f9edd99b567845_cgraph.md5 | 1 - ...dfcc1adafb21f0449e8581730970f7d_cgraph.md5 | 1 - ...57a3c69c1e775a1bd3935c2bfbb02df_cgraph.svg | 2 +- ...f81f7f5f5c98f197822ec88e106c6c_cgraph.map} | 0 ...f81f7f5f5c98f197822ec88e106c6c_cgraph.md5} | 0 ...f81f7f5f5c98f197822ec88e106c6c_cgraph.svg} | 2 +- ...e08ef3c1d6dc512edd68ca68327f74_cgraph.map} | 0 ...e08ef3c1d6dc512edd68ca68327f74_cgraph.md5} | 0 ...e08ef3c1d6dc512edd68ca68327f74_cgraph.svg} | 2 +- ...fc6a8765039cacc829a5cd386b5a066_cgraph.map | 2 +- ...fc6a8765039cacc829a5cd386b5a066_cgraph.md5 | 2 +- ...fc6a8765039cacc829a5cd386b5a066_cgraph.svg | 4 +- db/da8/subset__sum_8cpp__incl.svg | 2 +- db/da9/classqueue.html | 177 +- db/da9/classqueue.js | 3 +- ...89d4af5532e0a801f560070da6e1f86_cgraph.svg | 2 +- ...6f48801df462ade003b50739196fa4c_cgraph.svg | 2 +- ...inear__probing__hash__table_8cpp__incl.svg | 2 +- db/dbc/tree__234_8cpp.html | 149 +- db/dbc/tree__234_8cpp.js | 4 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.map | 20 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.md5 | 2 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 114 +- ...224851353fc92bfbff6f499fa97_cgraph_org.svg | 114 +- ...7880ce913f3058a35ff106d5be9e243_cgraph.map | 25 + ...7880ce913f3058a35ff106d5be9e243_cgraph.md5 | 1 + ...7880ce913f3058a35ff106d5be9e243_cgraph.svg | 459 +++ ...ce913f3058a35ff106d5be9e243_cgraph_org.svg | 371 +++ ...1ac73779b0fcfbbdce3976c0ca57342_cgraph.map | 12 +- ...1ac73779b0fcfbbdce3976c0ca57342_cgraph.md5 | 2 +- ...1ac73779b0fcfbbdce3976c0ca57342_cgraph.svg | 100 +- db/dc0/namespacebacktracking.html | 404 ++- ...8540bcb5ef3473b2348cbc34748ec50_cgraph.md5 | 2 +- ...8540bcb5ef3473b2348cbc34748ec50_cgraph.svg | 8 +- ...cfb2d08840766ac4402196079308a36_cgraph.svg | 2 +- ...32e38e8912742cedf7b5a837168e03a_cgraph.svg | 2 +- ...1a76e21cb3934368d01cea7672d3906_cgraph.svg | 2 +- db/dc3/vector__cross__product_8cpp__incl.svg | 2 +- .../floyd__cycle__detection__algo_8cpp.html | 153 +- ...1ffc7a2c6bf530c8a496864e7a3ad88_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- db/dca/kadane2_8cpp.html | 107 +- ...3029007a422a914a85c0b0122f1c7b4_cgraph.svg | 2 +- db/dd3/ode__forward__euler_8cpp.html | 179 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...13517b8e5de1b75592052db7f7e237f_cgraph.svg | 2 +- ...3adf7b092a87868917ee5fb4255192b_cgraph.svg | 2 +- db/dd4/structlist__coll__graph.svg | 2 +- db/ddb/classhash__chain__coll__graph.map | 6 - db/ddb/classhash__chain__coll__graph.md5 | 1 - db/ddb/classhash__chain__coll__graph.svg | 72 - db/ddc/namespaceaystar__search.html | 35 +- db/df0/insertion__sort_8cpp__incl.svg | 2 +- ...star__search_1_1_eight_puzzle-members.html | 53 +- db/df3/happy__number_8cpp.html | 91 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...ures_1_1tree__234_1_1_tree234-members.html | 59 +- dc/d14/wildcard__matching_8cpp.html | 266 +- dc/d14/wildcard__matching_8cpp.js | 3 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- dc/d1a/pascal__triangle_8cpp.html | 151 +- dc/d1a/pascal__triangle_8cpp.js | 2 +- ...7a31d9cb2818d21b1ba12aead7f4c5c_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- ...ructdata__structures_1_1_node-members.html | 35 +- dc/d29/coin__change__topdown_8cpp__incl.svg | 2 +- ...__trailing__ciphers__in__factorial__n.html | 35 +- dc/d37/lu__decompose_8cpp__incl.svg | 2 +- ...inary__least__squares__regressor_8cpp.html | 989 +++--- ...rdinary__least__squares__regressor_8cpp.js | 28 +- ...e6c7bf2b09272578b9c5819ce0f36f_cgraph.map} | 0 ...e6c7bf2b09272578b9c5819ce0f36f_cgraph.md5} | 0 ...e6c7bf2b09272578b9c5819ce0f36f_cgraph.svg} | 2 +- ...7b3a99fd5974d3117e0b0ac0aad234_cgraph.map} | 0 ...7b3a99fd5974d3117e0b0ac0aad234_cgraph.md5} | 0 ...7b3a99fd5974d3117e0b0ac0aad234_cgraph.svg} | 2 +- ...8ff1d954e9b7de93eb20e2dd101a045_cgraph.md5 | 1 - ...535e20e97d85aa61271e0894cc0359_cgraph.map} | 0 ...535e20e97d85aa61271e0894cc0359_cgraph.md5} | 0 ...535e20e97d85aa61271e0894cc0359_cgraph.svg} | 2 +- ...261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.map | 10 +- ...261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.md5 | 2 +- ...261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.svg | 12 +- ...6a560dbdd0177633783b72db37dc19_cgraph.map} | 0 ...6a560dbdd0177633783b72db37dc19_cgraph.md5} | 0 ...6a560dbdd0177633783b72db37dc19_cgraph.svg} | 2 +- ...75a0fccad9b2d79be0275bfe8948d4_cgraph.map} | 0 ...75a0fccad9b2d79be0275bfe8948d4_cgraph.md5} | 0 ...75a0fccad9b2d79be0275bfe8948d4_cgraph.svg} | 2 +- ...8ab8f75d981088369b89b8be2182483_cgraph.md5 | 1 - ...dc683af581b51351e1023d2a01ef3b_cgraph.map} | 6 +- ...ddc683af581b51351e1023d2a01ef3b_cgraph.md5 | 1 + ...dc683af581b51351e1023d2a01ef3b_cgraph.svg} | 8 +- ...ad727903d7817c2758d25bcb52cbc8_cgraph.map} | 0 ...ad727903d7817c2758d25bcb52cbc8_cgraph.md5} | 0 ...ad727903d7817c2758d25bcb52cbc8_cgraph.svg} | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 10 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 12 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 12 +- ...243bdc6ae3c7169f01b85bb226e66a_cgraph.map} | 2 +- ...7243bdc6ae3c7169f01b85bb226e66a_cgraph.md5 | 1 + ...243bdc6ae3c7169f01b85bb226e66a_cgraph.svg} | 4 +- dc/d40/fast__integer__input_8cpp__incl.svg | 2 +- ...decimal__to__roman__numeral_8cpp__incl.svg | 2 +- ...egral_3_01uint256__t_01_4__coll__graph.svg | 2 +- dc/d5a/rat__maze_8cpp.html | 165 +- ...99107bfb4c6934cd4691868c66c0aa3_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...h_1_1_ay_star_search_1_1_info-members.html | 43 +- dc/d5f/qr__decompose_8h__dep__incl.svg | 2 +- dc/d61/classgraph_1_1_graph.html | 246 +- dc/d61/classgraph_1_1_graph.js | 3 +- ...55ec9e6a842238c7f4aac10b661981_cgraph.map} | 0 ...55ec9e6a842238c7f4aac10b661981_cgraph.md5} | 0 ...55ec9e6a842238c7f4aac10b661981_cgraph.svg} | 2 +- ...839fa14bff19d2deab4a618447c13e5_cgraph.map | 5 - ...839fa14bff19d2deab4a618447c13e5_cgraph.md5 | 1 - ...839fa14bff19d2deab4a618447c13e5_cgraph.svg | 52 - ...930d1470d132b19e430d1c71f94c904_cgraph.map | 4 - ...930d1470d132b19e430d1c71f94c904_cgraph.md5 | 1 - ...930d1470d132b19e430d1c71f94c904_cgraph.svg | 38 - dc/d64/md__coding_guidelines.html | 39 +- ...s__graph__bipartite_1_1_graph-members.html | 37 +- ...1_1is__arithmetic_3_01uint256__t_01_4.html | 31 +- dc/d79/wave__sort_8cpp__incl.svg | 2 +- dc/d7e/largest__power_8cpp__incl.svg | 2 +- ...al__network_1_1layers_1_1_dense_layer.html | 233 +- ...ural__network_1_1layers_1_1_dense_layer.js | 11 +- ...1046825be0b6dbb73fbe834aa49200e_cgraph.map | 4 +- ...1046825be0b6dbb73fbe834aa49200e_cgraph.md5 | 2 +- ...1046825be0b6dbb73fbe834aa49200e_cgraph.svg | 6 +- ...36ec31dbd35b1be2eb9a057677c704_cgraph.map} | 0 ...36ec31dbd35b1be2eb9a057677c704_cgraph.md5} | 0 ...36ec31dbd35b1be2eb9a057677c704_cgraph.svg} | 2 +- dc/d93/trie__modern_8cpp.html | 59 +- dc/d93/trie__modern_8cpp.js | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- dc/db4/md__r_e_v_i_e_w_e_r__c_o_d_e.html | 35 +- dc/db5/struct_queue.html | 206 +- dc/db5/struct_queue.js | 13 - dc/db5/text__search_8cpp.html | 95 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...ical_methods_2rungekutta_8cpp-example.html | 85 +- dc/dc5/ode__forward__euler_8cpp__incl.svg | 2 +- dc/dc5/paranthesis__matching_8cpp.html | 186 +- dc/dc5/paranthesis__matching_8cpp.js | 1 - dc/dc7/rungekutta_8cpp__incl.svg | 2 +- dc/dcf/vector__ops_8hpp__incl.svg | 2 +- ...earch_1_1comparison__operator-members.html | 31 +- ...__decomposition_1_1_h_l_d__coll__graph.map | 11 +- ...__decomposition_1_1_h_l_d__coll__graph.md5 | 2 +- ...__decomposition_1_1_h_l_d__coll__graph.svg | 242 +- ...composition_1_1_h_l_d__coll__graph_org.svg | 164 - dc/dd9/strand__sort_8cpp.html | 153 +- dc/dd9/strand__sort_8cpp.js | 2 +- ...ea2fe5dd38ed63610fdeaddf5785cd_cgraph.map} | 0 ...ea2fe5dd38ed63610fdeaddf5785cd_cgraph.md5} | 0 ...ea2fe5dd38ed63610fdeaddf5785cd_cgraph.svg} | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- dc/dda/fenwick__tree_8cpp__incl.svg | 2 +- dc/ddf/horspool_8cpp__incl.svg | 2 +- dc/de0/fibonacci__large_8cpp__incl.svg | 2 +- dc/de2/false__position_8cpp__incl.svg | 2 +- dc/dea/classgraph_1_1_h_k_graph-members.html | 45 +- ...rie__operations_1_1_tnode__coll__graph.map | 4 - ...rie__operations_1_1_tnode__coll__graph.md5 | 1 - ...rie__operations_1_1_tnode__coll__graph.svg | 48 - dc/dfa/heap__sort_8cpp__incl.svg | 2 +- dc/dfe/ternary__search_8cpp.html | 229 +- ...3d0099db95022f1eb90ddfd68f73ead_cgraph.map | 3 + ...3d0099db95022f1eb90ddfd68f73ead_cgraph.md5 | 1 + ...3d0099db95022f1eb90ddfd68f73ead_cgraph.svg | 28 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 56 +- ...f655a27eb82efa299bf9d0becf6e9c8_cgraph.map | 2 +- ...f655a27eb82efa299bf9d0becf6e9c8_cgraph.md5 | 2 +- ...f655a27eb82efa299bf9d0becf6e9c8_cgraph.svg | 40 +- dd/d05/manacher__algorithm_8cpp__incl.svg | 2 +- dd/d0c/hamiltons__cycle_8cpp.html | 255 +- dd/d0c/hamiltons__cycle_8cpp.js | 2 +- ...cc94918b6831f308d4fe4fa27f08299_cgraph.map | 2 +- ...cc94918b6831f308d4fe4fa27f08299_cgraph.md5 | 2 +- ...cc94918b6831f308d4fe4fa27f08299_cgraph.svg | 4 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 4 +- ...5d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map | 2 +- ...5d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 | 2 +- ...5d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg | 4 +- ...f824e347eecfeeb69ea0280f34f3e4_cgraph.map} | 0 ...f824e347eecfeeb69ea0280f34f3e4_cgraph.md5} | 0 ...f824e347eecfeeb69ea0280f34f3e4_cgraph.svg} | 2 +- ...7880ce913f3058a35ff106d5be9e243_cgraph.map | 2 +- ...7880ce913f3058a35ff106d5be9e243_cgraph.md5 | 2 +- ...7880ce913f3058a35ff106d5be9e243_cgraph.svg | 4 +- dd/d0d/insertion__sort_8cpp.html | 211 +- ...9914553f24088342c139645a02a8a49_cgraph.svg | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- dd/d0e/double__factorial_8cpp__incl.svg | 2 +- dd/d0f/text__search_8cpp__incl.svg | 2 +- dd/d12/vigenere__cipher_8cpp.html | 173 +- ...cfc3f9b20a0f230a2fcefd31dc6848e_cgraph.svg | 2 +- ...bd3880ea6820c232c1eddf47553c257_cgraph.svg | 2 +- ...1a3968e7947464bee7714f6d43b7002_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- dd/d1b/structquery.html | 39 +- dd/d1b/structquery.js | 6 - dd/d1c/classhash__chain.html | 236 +- dd/d1c/classhash__chain.js | 2 +- ...5aa5c6753cb8853152d469c375d946a_cgraph.svg | 2 +- ...b4b4de1a8c96f98a63a77f650a9dcff_cgraph.svg | 2 +- ...06964ad13587fc9a8b3fe8381d410ed_cgraph.map | 4 + ...06964ad13587fc9a8b3fe8381d410ed_cgraph.md5 | 1 + ...06964ad13587fc9a8b3fe8381d410ed_cgraph.svg | 37 + ...0c8b902a15b4fd062ed727ecf8f3595_cgraph.map | 4 - ...0c8b902a15b4fd062ed727ecf8f3595_cgraph.md5 | 1 - ...0c8b902a15b4fd062ed727ecf8f3595_cgraph.svg | 37 - dd/d24/namespacedynamic__programming.html | 97 +- ...a2215194e58786c34db1ccaf8031079_cgraph.svg | 2 +- dd/d29/false__position_8cpp.html | 187 +- ...d69b49dc37da1c02b3ab8c7fe783494_cgraph.svg | 2 +- ...5a6ec58b5064d63d4f0df3854496713_cgraph.svg | 2 +- ...5cb7bfb90abc898e042d624372c5345_cgraph.svg | 2 +- dd/d2f/class_trie.html | 293 +- dd/d2f/class_trie.js | 9 +- ...941759ecf94d67a27d4a610bc0f63d_cgraph.map} | 0 ...6941759ecf94d67a27d4a610bc0f63d_cgraph.md5 | 1 + ...941759ecf94d67a27d4a610bc0f63d_cgraph.svg} | 10 +- ...5216ffc56cb9f8cede982cecb872af4_cgraph.md5 | 1 - dd/d30/matrix__exponentiation_8cpp__incl.svg | 2 +- ...ata__structures_1_1tree__234_1_1_node.html | 415 ++- ...sdata__structures_1_1tree__234_1_1_node.js | 14 +- ...e809ae85ae00e937f67ddb76951b6bb_cgraph.svg | 2 +- dd/d43/uint256__t_8hpp__incl.svg | 2 +- dd/d47/namespacemath.html | 362 +-- dd/d47/namespacemath.js | 11 +- ...e2dff75c5de70455b90c799d6ad6967_cgraph.svg | 2 +- ...cd07701d73ed65cd616bcba02737f3d_cgraph.svg | 2 +- ...__key__exchange_1_1_point__coll__graph.svg | 2 +- dd/d4d/list__array_8cpp__incl.svg | 2 +- dd/d4f/class_solution.html | 168 +- dd/d4f/class_solution.js | 11 - dd/d51/classstack-members.html | 43 +- ...ructdouble__hashing_1_1_entry-members.html | 33 +- dd/d59/hamiltons__cycle_8cpp__incl.svg | 2 +- dd/d65/lu__decompose_8cpp.html | 193 +- dd/d65/lu__decompose_8cpp.js | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 2 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 2 +- ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 2 +- ...5c989afcc78e875031cd4273e62a3e_cgraph.map} | 0 ...5c989afcc78e875031cd4273e62a3e_cgraph.md5} | 0 ...5c989afcc78e875031cd4273e62a3e_cgraph.svg} | 2 +- dd/d69/namespacerange__queries.html | 41 +- dd/d69/namespacerange__queries.js | 8 +- .../namespaceiterative__tree__traversals.html | 35 +- .../namespaceinorder__successor__of__bst.html | 35 +- dd/d7a/classdouble__linked__list-members.html | 37 +- .../classstack__linked_list__coll__graph.svg | 2 +- dd/d81/namespacecaesar.html | 35 +- dd/d82/large__number_8h__incl.svg | 2 +- dd/d86/shell__sort2_8cpp__incl.svg | 2 +- dd/d91/class_fenwick_tree.html | 132 +- dd/d91/class_fenwick_tree.js | 4 +- ...15ff5c548b429b737ea09f75817d1f9_cgraph.svg | 2 +- ...e9ea4fcbe0786487f4535c1cfc7aa00_cgraph.svg | 2 +- ...0f8c261393ca09ec1ad716ac806ead6_cgraph.svg | 2 +- ...ddab1f03d4941212a82cc647b1adb17_cgraph.svg | 2 +- ...e1d6a3d49af9d9df33e2fb26cab1699_cgraph.svg | 2 +- ...sgraph_1_1_rooted_tree__inherit__graph.svg | 2 +- ...ng_1_1aystar__search_1_1_eight_puzzle.html | 415 ++- ...ning_1_1aystar__search_1_1_eight_puzzle.js | 13 +- ...02cf6197a255055cb734d626abc101_cgraph.map} | 0 ...02cf6197a255055cb734d626abc101_cgraph.md5} | 0 ...02cf6197a255055cb734d626abc101_cgraph.svg} | 2 +- ...a976171392d257ca0f814ed73e0658_cgraph.map} | 2 +- ...6a976171392d257ca0f814ed73e0658_cgraph.md5 | 1 + ...a976171392d257ca0f814ed73e0658_cgraph.svg} | 4 +- ...5c0486c7f29f323a2aced2ab33af420_cgraph.svg | 2 +- ...8cc0c234ebd261ee27bc3c391f837e3_cgraph.md5 | 1 - ...es_1_1list__array_1_1list__coll__graph.map | 5 - ...es_1_1list__array_1_1list__coll__graph.md5 | 1 - ...es_1_1list__array_1_1list__coll__graph.svg | 56 - dd/d9f/count__of__set__bits_8cpp__incl.svg | 2 +- dd/da0/todo.html | 33 +- dd/da8/pigeonhole__sort_8cpp.html | 167 +- dd/da8/pigeonhole__sort_8cpp.js | 2 +- ...4b8683a2b429de5cce57e6d733ec817_cgraph.svg | 2 +- ...58410412185a5f09199deaff7157a8d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...31ec5409537703d9c8a47350386b32a_cgraph.svg | 2 +- .../struct_segment_intersection-members.html | 33 +- dd/dad/power__of__two_8cpp__incl.svg | 2 +- dd/dae/namespacecount__of__set__bits.html | 35 +- ...tquadratic__probing_1_1_entry-members.html | 33 +- ...us_2sorting_2wiggle_sort_8cpp-example.html | 81 +- ...ueen__print__all__solutions_8cpp__incl.svg | 2 +- ...ructbinary__search__tree_1_1bst__node.html | 73 +- dd/dba/namespacedivide__and__conquer.html | 37 +- ...cci__matrix__exponentiation_8cpp__incl.svg | 2 +- ...line__segment__intersection_8cpp__incl.svg | 2 +- dd/df5/poisson__dist_8cpp__incl.svg | 2 +- ...ight__decomposition_1_1_h_l_d-members.html | 65 +- ...aph_1_1is__graph__bipartite_1_1_graph.html | 139 +- ...8c10df34357b2cd865c81e0c4f0bd8c_cgraph.map | 4 - ...8c10df34357b2cd865c81e0c4f0bd8c_cgraph.md5 | 1 - ...8c10df34357b2cd865c81e0c4f0bd8c_cgraph.svg | 38 - de/d02/knight__tour_8cpp__incl.svg | 2 +- de/d07/cycle__sort_8cpp.html | 233 +- de/d07/cycle__sort_8cpp.js | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...9a9d247691fce0d655fce75f1c04fa_cgraph.map} | 0 ...9a9d247691fce0d655fce75f1c04fa_cgraph.md5} | 0 ...9a9d247691fce0d655fce75f1c04fa_cgraph.svg} | 2 +- de/d0a/namespacemerge__insertion.html | 33 +- de/d0d/fibonacci__search_8cpp.html | 255 +- ...bc61b3903d9a53061bf31e5d110fe61_cgraph.svg | 2 +- ...aa09bef74ee063c1331de0883af4f4f_cgraph.map | 14 + ...aa09bef74ee063c1331de0883af4f4f_cgraph.md5 | 1 + ...aa09bef74ee063c1331de0883af4f4f_cgraph.svg | 187 ++ ...e144326104e57a3808aed7eb098db0d_cgraph.map | 14 + ...e144326104e57a3808aed7eb098db0d_cgraph.md5 | 1 + ...e144326104e57a3808aed7eb098db0d_cgraph.svg | 187 ++ ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ..._modulo__p_1_1_n_c_r_modulo_p-members.html | 37 +- de/d23/disjoint__set_8cpp.html | 163 +- de/d23/disjoint__set_8cpp.js | 4 +- ...fb0a7cd26a477e2d48ba7e0118bc985_cgraph.svg | 2 +- ...4481bb75386fbb0f958a388d4b9f757_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- de/d29/class_fenwick_tree-members.html | 39 +- de/d33/binary__search__tree2_8cpp__incl.svg | 2 +- ...s_1_1linked__list_1_1link__coll__graph.map | 4 - ...s_1_1linked__list_1_1link__coll__graph.md5 | 1 - ...s_1_1linked__list_1_1link__coll__graph.svg | 41 - de/d36/binary__exponent_8cpp__incl.svg | 2 +- de/d36/namespacen__bonacci.html | 35 +- de/d3d/minimum__edit__distance_8cpp__incl.svg | 2 +- de/d41/namespacekaratsuba__algorithm.html | 35 +- de/d47/string__fibonacci_8cpp.html | 169 +- ...8052eee05d43c2ebc5147c52bd50c35_cgraph.svg | 2 +- ...8055ee368a5d5b24de01bdde6bf8fca_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- de/d48/struct_trie_1_1_trie_node.html | 45 +- de/d48/struct_trie_1_1_trie_node.js | 5 - ...t__decomposition_1_1_tree__coll__graph.map | 8 - ...t__decomposition_1_1_tree__coll__graph.md5 | 1 - ...t__decomposition_1_1_tree__coll__graph.svg | 114 - de/d4c/saddleback__search_8cpp__incl.svg | 2 +- ...__of__binomial__coefficient_8cpp__incl.svg | 2 +- .../eulers__totient__function_8cpp__incl.svg | 2 +- ..._1_1per_seg_tree_1_1_node__coll__graph.map | 4 - ..._1_1per_seg_tree_1_1_node__coll__graph.md5 | 1 - ..._1_1per_seg_tree_1_1_node__coll__graph.svg | 42 - de/d69/knuth__morris__pratt_8cpp__incl.svg | 2 +- de/d6a/knuth__morris__pratt_8cpp.html | 89 +- de/d6a/knuth__morris__pratt_8cpp.js | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- .../namespacerandom__pivot__quick__sort.html | 35 +- de/d6c/palindrome__of__number_8cpp__incl.svg | 2 +- de/d75/qr__eigen__values_8cpp.html | 355 +- de/d75/qr__eigen__values_8cpp.js | 6 +- ...283886819c7c140a023582b7269e2d0_cgraph.map | 10 +- ...283886819c7c140a023582b7269e2d0_cgraph.md5 | 2 +- ...283886819c7c140a023582b7269e2d0_cgraph.svg | 12 +- ...86819c7c140a023582b7269e2d0_cgraph_org.svg | 12 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.map | 10 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 | 2 +- ...440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg | 12 +- ...7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg | 12 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.map | 12 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 | 2 +- ...c04138a5bfe5d72780bb7e82a18e627_cgraph.svg | 14 +- ...38a5bfe5d72780bb7e82a18e627_cgraph_org.svg | 14 +- ...bf469d5525a816b0d6ca812119093d_cgraph.map} | 0 ...bf469d5525a816b0d6ca812119093d_cgraph.md5} | 0 ...bf469d5525a816b0d6ca812119093d_cgraph.svg} | 2 +- ...metic_3_01uint256__t_01_4__coll__graph.svg | 2 +- de/d7b/merge__insertion__sort_8cpp.html | 231 +- ...cba4fbf287ab8cb978ed7f8fef886b1_cgraph.svg | 2 +- ...161278f18e83b671c6454b139cc5674_cgraph.map | 4 +- ...161278f18e83b671c6454b139cc5674_cgraph.md5 | 2 +- ...161278f18e83b671c6454b139cc5674_cgraph.svg | 64 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...4de4067a9a866ffd985c5b5055ccedf_cgraph.svg | 2 +- de/d7c/struct_trie_1_1_trie_node-members.html | 33 +- de/d83/namespaceis__graph__bipartite.html | 33 +- de/d85/decimal__to__roman__numeral_8cpp.html | 205 +- ...03fb4e1b08279fe4cd50fbbc2782c2d_cgraph.map | 4 +- ...03fb4e1b08279fe4cd50fbbc2782c2d_cgraph.md5 | 2 +- ...03fb4e1b08279fe4cd50fbbc2782c2d_cgraph.svg | 16 +- ...14743638eff1336f835310049aef979_cgraph.map | 4 +- ...14743638eff1336f835310049aef979_cgraph.md5 | 2 +- ...14743638eff1336f835310049aef979_cgraph.svg | 16 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 8 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 54 +- de/d8a/class_trie-members.html | 39 +- ...fix__expression_1_1_stack__coll__graph.map | 4 - ...fix__expression_1_1_stack__coll__graph.md5 | 1 - ...fix__expression_1_1_stack__coll__graph.svg | 39 - de/d91/structlist-members.html | 33 +- ...iterative__tree__traversals_8cpp__incl.svg | 2 +- de/d95/namespace_subsets.html | 35 +- de/d99/trie__tree_8cpp__incl.svg | 2 +- de/d9b/prime__numbers_8cpp.html | 97 +- de/d9b/prime__numbers_8cpp.js | 2 +- ...1b9728fd1db77516fee913763da90e_cgraph.map} | 0 ...1b9728fd1db77516fee913763da90e_cgraph.md5} | 0 ...1b9728fd1db77516fee913763da90e_cgraph.svg} | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- ...a__structures_1_1linked__list_1_1link.html | 77 +- ...ata__structures_1_1linked__list_1_1link.js | 2 +- de/dab/ncr__modulo__p_8cpp.html | 97 +- de/dab/ncr__modulo__p_8cpp.js | 2 +- ...0a3e6827f41c151e47451f5ff98b1f1_cgraph.map | 10 +- ...0a3e6827f41c151e47451f5ff98b1f1_cgraph.md5 | 2 +- ...0a3e6827f41c151e47451f5ff98b1f1_cgraph.svg | 14 +- ...6827f41c151e47451f5ff98b1f1_cgraph_org.svg | 16 +- de/db2/quick__sort_8cpp__incl.svg | 2 +- de/db4/namespacedisjoint__union.html | 35 +- de/db5/class_edge-members.html | 43 +- de/dbb/uint128__t_8hpp__dep__incl.svg | 2 +- de/dc3/binaryheap_8cpp.html | 79 +- de/dc3/binaryheap_8cpp.js | 3 +- de/dc3/fibonacci__sum_8cpp.html | 207 +- de/dc3/fibonacci__sum_8cpp.js | 1 - ...93fbaa7a94e3b7ca573111237bb3742_cgraph.svg | 2 +- ...cf5feaf168b88e74544da59ed830311_cgraph.svg | 2 +- ...c83cca09a3e4ff2a25c816a9303448e_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...db40ac4c74a7efc0680b83eeee138aa_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- de/dc8/classlarge__number-members.html | 63 +- de/dcf/binary__exponent_8cpp.html | 143 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 6 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 18 +- ...b48dce0725e63d19147944f41843c73_cgraph.map | 3 + ...b48dce0725e63d19147944f41843c73_cgraph.md5 | 1 + ...b48dce0725e63d19147944f41843c73_cgraph.svg | 28 + de/dd3/newton__raphson__method_8cpp.html | 123 +- ...003b5b2dcfff0769b957ab5c968b03d_cgraph.svg | 2 +- ...d3f7f41977394680af6ebbed96f3386_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- de/dde/lowest__common__ancestor_8cpp.html | 105 +- de/dde/lowest__common__ancestor_8cpp.js | 6 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- de/de4/fibonacci__large_8cpp.html | 157 +- de/de4/fibonacci__large_8cpp.js | 3 +- de/df7/bogo__sort_8cpp__incl.svg | 2 +- ...1sublist__search_1_1_node__coll__graph.svg | 2 +- df/d06/decimal__to__binary_8cpp.html | 137 +- df/d06/decimal__to__binary_8cpp.js | 1 - ...0df57491019f0ac39b492740fb388f7_cgraph.svg | 2 +- ...240f2e79074a2a248395258aebbfa11_cgraph.svg | 2 +- df/d0f/fibonacci_8cpp__incl.svg | 2 +- df/d10/namespacepancake__sort.html | 35 +- ...tures_1_1linked__list_1_1link-members.html | 35 +- df/d14/dnf__sort_8cpp__incl.svg | 2 +- .../elliptic__curve__key__exchange_8cpp.html | 287 +- df/d2c/elliptic__curve__key__exchange_8cpp.js | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...7b867074164d5f45b0f3851269d_cgraph_org.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 2 +- df/d36/minimax_8cpp__incl.svg | 2 +- df/d39/interpolation__search2_8cpp.html | 99 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- df/d3c/exponential__search_8cpp__incl.svg | 2 +- df/d42/binary__search__tree2_8cpp.html | 432 +-- df/d42/binary__search__tree2_8cpp.js | 5 +- ...6f35064850e891d6fda0093c0d9ee6e_cgraph.map | 4 +- ...6f35064850e891d6fda0093c0d9ee6e_cgraph.md5 | 2 +- ...6f35064850e891d6fda0093c0d9ee6e_cgraph.svg | 62 +- ...d42876440ac5346e2850a32497385c3_cgraph.map | 8 +- ...d42876440ac5346e2850a32497385c3_cgraph.md5 | 2 +- ...d42876440ac5346e2850a32497385c3_cgraph.svg | 52 +- ...c882f43e1e52948a7841a8bfb091350_cgraph.map | 10 +- ...c882f43e1e52948a7841a8bfb091350_cgraph.md5 | 2 +- ...c882f43e1e52948a7841a8bfb091350_cgraph.svg | 74 +- ...4b76f781fcbe1ad0e3397ace6bb1965_cgraph.map | 4 +- ...4b76f781fcbe1ad0e3397ace6bb1965_cgraph.md5 | 2 +- ...4b76f781fcbe1ad0e3397ace6bb1965_cgraph.svg | 62 +- ...856b68e2cba50d2e26a1cbe374e0365_cgraph.map | 6 +- ...856b68e2cba50d2e26a1cbe374e0365_cgraph.md5 | 2 +- ...856b68e2cba50d2e26a1cbe374e0365_cgraph.svg | 50 +- ...00b8d0f21aeb5fbddb6decf3bcb640a_cgraph.map | 4 +- ...00b8d0f21aeb5fbddb6decf3bcb640a_cgraph.md5 | 2 +- ...00b8d0f21aeb5fbddb6decf3bcb640a_cgraph.svg | 62 +- ...1333c3ea06dcad896ee204bbd407c4e_cgraph.map | 16 +- ...1333c3ea06dcad896ee204bbd407c4e_cgraph.md5 | 2 +- ...1333c3ea06dcad896ee204bbd407c4e_cgraph.svg | 100 +- ...2847a901160fd45b4044550e9921cb4_cgraph.map | 6 +- ...2847a901160fd45b4044550e9921cb4_cgraph.md5 | 2 +- ...2847a901160fd45b4044550e9921cb4_cgraph.svg | 50 +- .../namespacen__queens__all__solutions.html | 35 +- ...1_1lru__cache_1_1_l_r_u_cache-members.html | 41 +- df/d57/chaining_8cpp__incl.svg | 2 +- df/d64/jumpgame_8cpp.html | 109 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...205390325e8c999bd68b93fa5252755_cgraph.svg | 2 +- df/d66/vector__cross__product_8cpp.html | 191 +- df/d66/vector__cross__product_8cpp.js | 2 +- ...5732399c5c076976eae5b180a9f8c9_cgraph.map} | 0 ...5732399c5c076976eae5b180a9f8c9_cgraph.md5} | 0 ...5732399c5c076976eae5b180a9f8c9_cgraph.svg} | 2 +- ...b2a9757a87c18e1642d72410ecfaba8_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...ers_1_1elliptic__curve__key__exchange.html | 235 +- ...7f3d667241b88115a95282cdd719cb2_cgraph.svg | 2 +- ...667241b88115a95282cdd719cb2_cgraph_org.svg | 2 +- ...00616a4e40d3cd5cfb4da87d9ff9af0_cgraph.svg | 2 +- ...c5fe9c2032fb7582c38a20d1fa69bcf_cgraph.svg | 2 +- df/d72/modular__division_8cpp.html | 163 +- ...ddf1224851353fc92bfbff6f499fa97_cgraph.svg | 2 +- ...6cdf93153cbd1408bd74ac68961d179_cgraph.svg | 2 +- ...05e368ae121beb7e7ea35349ddcdac7_cgraph.svg | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- df/d74/namespacesubarray__sum.html | 35 +- df/d77/connected__components_8cpp__incl.svg | 2 +- df/d82/breadth__first__search_8cpp.html | 197 +- df/d82/breadth__first__search_8cpp.js | 2 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.map | 2 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.md5 | 2 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- .../classgraph_1_1_h_k_graph__coll__graph.map | 6 - .../classgraph_1_1_h_k_graph__coll__graph.md5 | 1 - .../classgraph_1_1_h_k_graph__coll__graph.svg | 73 - df/d86/rabin__karp_8cpp__incl.svg | 2 +- ...__structures_2sparse__table_8cpp__incl.svg | 2 +- df/d8e/namespacetrie__operations.html | 35 +- df/d92/wildcard__matching_8cpp__incl.svg | 2 +- df/d94/classhash__chain-members.html | 41 +- df/d94/subarray__sum_8cpp.html | 195 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- ...5687bbd9faf927fbd363c71e0baba5e_cgraph.map | 2 +- ...5687bbd9faf927fbd363c71e0baba5e_cgraph.md5 | 2 +- ...5687bbd9faf927fbd363c71e0baba5e_cgraph.svg | 4 +- ...d_1_1is__unsigned_3_01uint256__t_01_4.html | 31 +- ...raph__bipartite_1_1_graph__coll__graph.map | 5 - ...raph__bipartite_1_1_graph__coll__graph.md5 | 1 - ...raph__bipartite_1_1_graph__coll__graph.svg | 63 - df/dc8/successive__approximation_8cpp.html | 97 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- df/dcb/namespacestrings.html | 39 +- df/dce/namespacegraph.html | 392 ++- df/dce/namespacegraph.js | 33 +- ...30e0dca68cb6e4f671440819b35b6a_cgraph.map} | 0 ...30e0dca68cb6e4f671440819b35b6a_cgraph.md5} | 0 ...30e0dca68cb6e4f671440819b35b6a_cgraph.svg} | 2 +- ...e6017a54d445819ede9adcf33240e1a_cgraph.map | 5 - ...e6017a54d445819ede9adcf33240e1a_cgraph.md5 | 1 - ...e6017a54d445819ede9adcf33240e1a_cgraph.svg | 53 - ...ae80bc4c6a79d041b4f3a6589eb7fb8_cgraph.map | 3 + ...ae80bc4c6a79d041b4f3a6589eb7fb8_cgraph.md5 | 1 + ...ae80bc4c6a79d041b4f3a6589eb7fb8_cgraph.svg | 28 + ...8acac475cb48614279e7ea784c32fc3_cgraph.md5 | 1 - ...c1db5aad7502c6f08e4652f6edd463_cgraph.map} | 4 +- ...4c1db5aad7502c6f08e4652f6edd463_cgraph.md5 | 1 + ...c1db5aad7502c6f08e4652f6edd463_cgraph.svg} | 18 +- ...3ab16e96cec644109a58dfc9329bc2b_cgraph.map | 4 + ...3ab16e96cec644109a58dfc9329bc2b_cgraph.md5 | 1 + ...3ab16e96cec644109a58dfc9329bc2b_cgraph.svg | 43 + ...68530bfaed30e57290a76d5b4402d50_cgraph.map | 4 - ...68530bfaed30e57290a76d5b4402d50_cgraph.md5 | 1 - ...68530bfaed30e57290a76d5b4402d50_cgraph.svg | 37 - ...fc2ded2807582edf398e6d7c7114914_cgraph.map | 5 - ...fc2ded2807582edf398e6d7c7114914_cgraph.md5 | 1 - ...fc2ded2807582edf398e6d7c7114914_cgraph.svg | 52 - ...5428a3519267a28bba4b4310cfbb6ae_cgraph.map | 4 + ...5428a3519267a28bba4b4310cfbb6ae_cgraph.md5 | 1 + ...5428a3519267a28bba4b4310cfbb6ae_cgraph.svg | 44 + df/dd0/queue__using__two__stacks_8cpp.html | 123 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- df/dd4/stairs__pattern_8cpp__incl.svg | 2 +- df/dd5/binary__search_8cpp.html | 125 +- ...f9e6b7e6f15df4b525a2e7705ba3089_cgraph.svg | 2 +- df/dd7/structlinkedlist-members.html | 33 +- df/ddc/struct_node__coll__graph.svg | 2 +- df/ddd/connected__components_8cpp.html | 187 +- df/ddd/connected__components_8cpp.js | 6 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.map | 7 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 | 2 +- ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 69 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 9 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 113 +- df/de3/classqueue-members.html | 41 +- df/dea/namespacefalse__position.html | 35 +- df/def/power__for__huge__numbers_8cpp.html | 171 +- ...249a2af508aa94266023ce8aa81426f_cgraph.svg | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 2 +- df/dfb/minimax_8cpp.html | 69 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 12 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 66 +- dir_000002_000016.html | 28 +- dir_074119ce3a874b57120c49a0cc4bb5ad.html | 47 +- dir_0eaa691bd54ab0922ca7f50599de6d22.html | 37 +- dir_12552d7fa429bf94a2e32e5cf39f7e69.html | 71 +- dir_19b2bf9199a15c634a08b1ede1dd896a.html | 85 +- dir_296d53ceaeaa7e099814a6def439fe8a.html | 168 +- dir_296d53ceaeaa7e099814a6def439fe8a.js | 1 + dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html | 83 +- dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js | 4 +- dir_3343723ae086de42ee4ca9774da3a13f.html | 55 +- dir_35422be6552f1b3672c1b6c4aba2da64.html | 41 +- dir_4d6e05837bf820fb089a8a8cdf2f42b7.html | 61 +- dir_4d6e05837bf820fb089a8a8cdf2f42b7_dep.svg | 2 +- dir_73a3cc5065b223eb41b02873c0e19f0e.html | 49 +- dir_82e494173a87936756866de2fa774307.html | 47 +- dir_8a20dd5bfd5341a725342bf72b6b686f.html | 75 +- dir_8c4128baa09a573ad2b8b8c0061a04c9.html | 37 +- dir_93bc990c5cceb745f78af6949e9ef947.html | 37 +- dir_9510827d0b234b3cc54b29892f217477.html | 87 +- dir_9c6faab82c22511b50177aa2e38e2780.html | 101 +- dir_bb1b521853a9c46347182a9d10420771.html | 115 +- dir_bb1b521853a9c46347182a9d10420771.js | 2 +- dir_c11585dfcef32a26e29098facab6c144.html | 75 +- dir_e3380d2178455503f266746fb14246a5.html | 39 +- dir_e79632891301b850df87e9c0030293fa.html | 37 +- dir_ece9b94c107bbaa1dd68197a8c9983b9.html | 49 +- dir_f1797d0c2a0a12033e7d74efffeb14e1.html | 31 +- dir_f3c4fbc4e901afa0a54d0623c5574aa7.html | 45 +- doxygen.css | 40 +- examples.html | 34 +- files.html | 352 +- functions.html | 57 +- functions_a.html | 99 +- functions_b.html | 54 +- functions_c.html | 100 +- functions_d.html | 143 +- functions_e.html | 76 +- functions_f.html | 72 +- functions_func.html | 49 +- functions_func_a.html | 77 +- functions_func_b.html | 54 +- functions_func_c.html | 83 +- functions_func_d.html | 128 +- functions_func_e.html | 72 +- functions_func_f.html | 63 +- functions_func_g.html | 184 +- functions_func_h.html | 54 +- functions_func_i.html | 141 +- functions_func_k.html | 34 +- functions_func_l.html | 91 +- functions_func_m.html | 67 +- functions_func_n.html | 68 +- functions_func_o.html | 249 +- functions_func_p.html | 82 +- functions_func_q.html | 41 +- functions_func_r.html | 83 +- functions_func_s.html | 151 +- functions_func_t.html | 87 +- functions_func_u.html | 50 +- functions_func_v.html | 39 +- functions_func_~.html | 62 +- functions_g.html | 184 +- functions_h.html | 90 +- functions_i.html | 150 +- functions_k.html | 42 +- functions_l.html | 111 +- functions_m.html | 75 +- functions_n.html | 90 +- functions_o.html | 258 +- functions_p.html | 122 +- functions_q.html | 49 +- functions_r.html | 104 +- functions_rela.html | 54 +- functions_s.html | 182 +- functions_t.html | 120 +- functions_type.html | 36 +- functions_u.html | 54 +- functions_v.html | 53 +- functions_vars.html | 436 +-- functions_w.html | 38 +- functions_x.html | 34 +- functions_y.html | 34 +- functions_~.html | 62 +- globals.html | 43 +- globals_a.html | 63 +- globals_b.html | 79 +- globals_c.html | 86 +- globals_d.html | 58 +- globals_defs.html | 94 +- globals_e.html | 68 +- globals_f.html | 112 +- globals_func.html | 34 +- globals_func_a.html | 51 +- globals_func_b.html | 75 +- globals_func_c.html | 78 +- globals_func_d.html | 54 +- globals_func_e.html | 58 +- globals_func_f.html | 104 +- globals_func_g.html | 79 +- globals_func_h.html | 50 +- globals_func_i.html | 82 +- globals_func_j.html | 34 +- globals_func_l.html | 58 +- globals_func_m.html | 283 +- globals_func_n.html | 46 +- globals_func_o.html | 65 +- globals_func_p.html | 101 +- globals_func_q.html | 34 +- globals_func_r.html | 46 +- globals_func_s.html | 109 +- globals_func_t.html | 304 +- globals_func_u.html | 46 +- globals_g.html | 83 +- globals_h.html | 58 +- globals_i.html | 91 +- globals_j.html | 34 +- globals_l.html | 70 +- globals_m.html | 312 +- globals_n.html | 50 +- globals_o.html | 65 +- globals_p.html | 117 +- globals_q.html | 34 +- globals_r.html | 46 +- globals_s.html | 117 +- globals_t.html | 308 +- globals_type.html | 40 +- globals_u.html | 46 +- globals_vars.html | 109 +- globals_w.html | 34 +- graph_legend.html | 39 +- graph_legend.svg | 2 +- hierarchy.html | 114 +- hierarchy.js | 3 +- index.html | 53 +- inherit_graph_0.svg | 2 +- inherit_graph_1.svg | 2 +- inherit_graph_10.svg | 2 +- inherit_graph_11.svg | 2 +- inherit_graph_12.svg | 2 +- inherit_graph_13.svg | 2 +- inherit_graph_14.svg | 2 +- inherit_graph_15.svg | 2 +- inherit_graph_16.svg | 2 +- inherit_graph_17.svg | 2 +- inherit_graph_18.svg | 2 +- inherit_graph_19.svg | 2 +- inherit_graph_2.svg | 2 +- inherit_graph_20.svg | 2 +- inherit_graph_21.svg | 2 +- inherit_graph_22.svg | 2 +- inherit_graph_23.svg | 2 +- inherit_graph_24.svg | 2 +- inherit_graph_25.svg | 2 +- inherit_graph_26.svg | 2 +- inherit_graph_27.svg | 2 +- inherit_graph_28.svg | 2 +- inherit_graph_29.svg | 2 +- inherit_graph_3.svg | 2 +- inherit_graph_30.svg | 2 +- inherit_graph_31.svg | 2 +- inherit_graph_32.svg | 2 +- inherit_graph_33.svg | 2 +- inherit_graph_34.svg | 2 +- inherit_graph_35.svg | 2 +- inherit_graph_36.svg | 2 +- inherit_graph_37.svg | 2 +- inherit_graph_38.svg | 2 +- inherit_graph_39.svg | 2 +- inherit_graph_4.svg | 2 +- inherit_graph_40.svg | 2 +- inherit_graph_41.svg | 2 +- inherit_graph_42.svg | 2 +- inherit_graph_43.svg | 2 +- inherit_graph_44.svg | 2 +- inherit_graph_45.svg | 2 +- inherit_graph_46.svg | 2 +- inherit_graph_47.svg | 2 +- inherit_graph_48.svg | 2 +- inherit_graph_49.svg | 2 +- inherit_graph_5.svg | 2 +- inherit_graph_50.svg | 2 +- inherit_graph_51.map | 2 +- inherit_graph_51.md5 | 2 +- inherit_graph_51.svg | 17 +- inherit_graph_52.map | 2 +- inherit_graph_52.md5 | 2 +- inherit_graph_52.svg | 14 +- inherit_graph_53.map | 2 +- inherit_graph_53.md5 | 2 +- inherit_graph_53.svg | 16 +- inherit_graph_54.map | 2 +- inherit_graph_54.md5 | 2 +- inherit_graph_54.svg | 14 +- inherit_graph_55.map | 2 +- inherit_graph_55.md5 | 2 +- inherit_graph_55.svg | 16 +- inherit_graph_56.map | 2 +- inherit_graph_56.md5 | 2 +- inherit_graph_56.svg | 16 +- inherit_graph_57.map | 2 +- inherit_graph_57.md5 | 2 +- inherit_graph_57.svg | 17 +- inherit_graph_58.map | 2 +- inherit_graph_58.md5 | 2 +- inherit_graph_58.svg | 17 +- inherit_graph_59.map | 2 +- inherit_graph_59.md5 | 2 +- inherit_graph_59.svg | 17 +- inherit_graph_6.svg | 2 +- inherit_graph_60.map | 2 +- inherit_graph_60.md5 | 2 +- inherit_graph_60.svg | 14 +- inherit_graph_61.map | 2 +- inherit_graph_61.md5 | 2 +- inherit_graph_61.svg | 14 +- inherit_graph_62.map | 4 +- inherit_graph_62.md5 | 2 +- inherit_graph_62.svg | 52 +- inherit_graph_63.map | 4 +- inherit_graph_63.md5 | 2 +- inherit_graph_63.svg | 52 +- inherit_graph_64.map | 2 +- inherit_graph_64.md5 | 2 +- inherit_graph_64.svg | 17 +- inherit_graph_65.map | 2 +- inherit_graph_65.md5 | 2 +- inherit_graph_65.svg | 17 +- inherit_graph_66.map | 2 +- inherit_graph_66.md5 | 2 +- inherit_graph_66.svg | 17 +- inherit_graph_67.map | 2 +- inherit_graph_67.md5 | 2 +- inherit_graph_67.svg | 17 +- inherit_graph_68.map | 2 +- inherit_graph_68.md5 | 2 +- inherit_graph_68.svg | 14 +- inherit_graph_69.map | 2 +- inherit_graph_69.md5 | 2 +- inherit_graph_69.svg | 14 +- inherit_graph_7.svg | 2 +- inherit_graph_70.map | 2 +- inherit_graph_70.md5 | 2 +- inherit_graph_70.svg | 14 +- inherit_graph_71.map | 2 +- inherit_graph_71.md5 | 2 +- inherit_graph_71.svg | 14 +- inherit_graph_72.map | 2 +- inherit_graph_72.md5 | 2 +- inherit_graph_72.svg | 6 +- inherit_graph_73.map | 8 +- inherit_graph_73.md5 | 2 +- inherit_graph_73.svg | 108 +- inherit_graph_74.map | 8 +- inherit_graph_74.md5 | 2 +- inherit_graph_74.svg | 108 +- inherit_graph_75.map | 2 +- inherit_graph_75.md5 | 2 +- inherit_graph_75.svg | 14 +- inherit_graph_76.map | 2 +- inherit_graph_76.md5 | 2 +- inherit_graph_76.svg | 14 +- inherit_graph_77.map | 2 +- inherit_graph_77.md5 | 2 +- inherit_graph_77.svg | 14 +- inherit_graph_78.map | 2 +- inherit_graph_78.md5 | 2 +- inherit_graph_78.svg | 14 +- inherit_graph_79.map | 2 +- inherit_graph_79.md5 | 2 +- inherit_graph_79.svg | 6 +- inherit_graph_8.svg | 2 +- inherit_graph_80.map | 3 - inherit_graph_80.md5 | 1 - inherit_graph_80.svg | 22 - inherit_graph_9.svg | 2 +- inherits.html | 87 +- jquery.js | 4 +- menu.js | 86 +- modules.html | 31 +- modules.js | 2 +- namespacemembers.html | 472 +-- namespacemembers_func.html | 452 +-- namespacemembers_type.html | 32 +- namespacemembers_vars.html | 44 +- namespaces.html | 221 +- namespaces_dup.js | 54 +- navtree.css | 1 + navtree.js | 11 +- navtreedata.js | 22 +- navtreeindex0.js | 62 +- navtreeindex1.js | 30 +- navtreeindex10.js | 380 +-- navtreeindex11.js | 226 +- navtreeindex12.js | 162 +- navtreeindex13.js | 141 +- navtreeindex2.js | 332 +- navtreeindex3.js | 278 +- navtreeindex4.js | 256 +- navtreeindex5.js | 288 +- navtreeindex6.js | 264 +- navtreeindex7.js | 294 +- navtreeindex8.js | 306 +- navtreeindex9.js | 262 +- pages.html | 31 +- resize.js | 20 +- search/all_0.html | 6 +- search/all_1.html | 6 +- search/all_1.js | 20 +- search/all_10.html | 6 +- search/all_10.js | 154 +- search/all_11.html | 6 +- search/all_11.js | 271 +- search/all_12.html | 6 +- search/all_12.js | 54 +- search/all_13.html | 6 +- search/all_13.js | 260 +- search/all_14.html | 6 +- search/all_14.js | 551 ++-- search/all_15.html | 6 +- search/all_15.js | 284 +- search/all_16.html | 6 +- search/all_16.js | 147 +- search/all_17.html | 6 +- search/all_17.js | 89 +- search/all_18.html | 6 +- search/all_18.js | 184 +- search/all_19.html | 6 +- search/all_19.js | 12 +- search/all_1a.html | 6 +- search/all_1a.js | 8 +- search/all_1b.html | 6 +- search/all_1b.js | 6 +- search/all_1c.html | 6 +- search/all_1c.js | 194 +- search/all_2.html | 6 +- search/all_2.js | 238 +- search/all_3.html | 6 +- search/all_3.js | 247 +- search/all_4.html | 6 +- search/all_4.js | 278 +- search/all_5.html | 6 +- search/all_5.js | 262 +- search/all_6.html | 6 +- search/all_6.js | 148 +- search/all_7.html | 6 +- search/all_7.js | 278 +- search/all_8.html | 6 +- search/all_8.js | 218 +- search/all_9.html | 6 +- search/all_9.js | 102 +- search/all_a.html | 6 +- search/all_a.js | 450 +-- search/all_b.html | 6 +- search/all_b.js | 16 +- search/all_c.html | 6 +- search/all_c.js | 40 +- search/all_d.html | 6 +- search/all_d.js | 194 +- search/all_e.html | 6 +- search/all_e.js | 301 +- search/all_f.html | 6 +- search/all_f.js | 183 +- search/classes_0.html | 6 +- search/classes_0.js | 46 +- search/classes_1.html | 6 +- search/classes_1.js | 127 +- search/classes_10.html | 6 +- search/classes_10.js | 9 +- search/classes_11.html | 6 +- search/classes_11.js | 82 +- search/classes_12.html | 6 +- search/classes_12.js | 95 +- search/classes_13.html | 6 +- search/classes_13.js | 53 +- search/classes_14.html | 6 +- search/classes_14.js | 71 +- search/classes_15.html | 6 +- search/classes_15.js | 29 +- search/classes_16.html | 6 +- search/classes_16.js | 62 +- search/classes_17.html | 6 +- search/classes_17.js | 4 +- search/classes_18.html | 6 +- search/classes_18.js | 2 +- search/classes_2.html | 6 +- search/classes_2.js | 74 +- search/classes_3.html | 6 +- search/classes_3.js | 32 +- search/classes_4.html | 6 +- search/classes_4.js | 36 +- search/classes_5.html | 6 +- search/classes_5.js | 34 +- search/classes_6.html | 6 +- search/classes_6.js | 12 +- search/classes_7.html | 6 +- search/classes_7.js | 18 +- search/classes_8.html | 6 +- search/classes_8.js | 210 +- search/classes_9.html | 6 +- search/classes_9.js | 2 +- search/classes_a.html | 6 +- search/classes_a.js | 4 +- search/classes_b.html | 6 +- search/classes_b.js | 38 +- search/classes_c.html | 6 +- search/classes_c.js | 75 +- search/classes_d.html | 6 +- search/classes_d.js | 41 +- search/classes_e.html | 6 +- search/classes_e.js | 24 +- search/classes_f.html | 6 +- search/classes_f.js | 37 +- search/defines_0.html | 6 +- search/defines_0.js | 4 +- search/defines_1.html | 6 +- search/defines_1.js | 4 +- search/defines_2.html | 6 +- search/defines_2.js | 4 +- search/defines_3.html | 6 +- search/defines_3.js | 4 +- search/defines_4.html | 6 +- search/defines_4.js | 2 +- search/defines_5.html | 6 +- search/defines_5.js | 4 +- search/defines_6.html | 6 +- search/defines_6.js | 4 +- search/defines_7.html | 6 +- search/defines_7.js | 4 +- search/files_0.html | 6 +- search/files_0.js | 2 +- search/files_1.html | 6 +- search/files_1.js | 10 +- search/files_10.html | 6 +- search/files_10.js | 30 +- search/files_11.html | 6 +- search/files_11.js | 16 +- search/files_12.html | 6 +- search/files_12.js | 14 +- search/files_13.html | 6 +- search/files_13.js | 44 +- search/files_14.html | 6 +- search/files_14.js | 16 +- search/files_15.html | 6 +- search/files_15.js | 4 +- search/files_16.html | 6 +- search/files_16.js | 8 +- search/files_17.html | 6 +- search/files_17.js | 8 +- search/files_18.html | 6 +- search/files_18.js | 2 +- search/files_2.html | 6 +- search/files_2.js | 32 +- search/files_3.html | 6 +- search/files_3.js | 30 +- search/files_4.html | 6 +- search/files_4.js | 22 +- search/files_5.html | 6 +- search/files_5.js | 8 +- search/files_6.html | 6 +- search/files_6.js | 25 +- search/files_7.html | 6 +- search/files_7.js | 16 +- search/files_8.html | 6 +- search/files_8.js | 20 +- search/files_9.html | 6 +- search/files_9.js | 16 +- search/files_a.html | 6 +- search/files_a.js | 6 +- search/files_b.html | 6 +- search/files_b.js | 12 +- search/files_c.html | 6 +- search/files_c.js | 34 +- search/files_d.html | 6 +- search/files_d.js | 26 +- search/files_e.html | 6 +- search/files_e.js | 20 +- search/files_f.html | 6 +- search/files_f.js | 8 +- search/functions_0.html | 6 +- search/functions_0.js | 12 +- search/functions_1.html | 6 +- search/functions_1.js | 174 +- search/functions_10.html | 6 +- search/functions_10.js | 184 +- search/functions_11.html | 6 +- search/functions_11.js | 22 +- search/functions_12.html | 6 +- search/functions_12.js | 180 +- search/functions_13.html | 6 +- search/functions_13.js | 420 +-- search/functions_14.html | 6 +- search/functions_14.js | 208 +- search/functions_15.html | 6 +- search/functions_15.js | 96 +- search/functions_16.html | 6 +- search/functions_16.js | 46 +- search/functions_17.html | 6 +- search/functions_17.js | 152 +- search/functions_18.html | 6 +- search/functions_18.js | 6 +- search/functions_19.html | 6 +- search/functions_19.js | 2 +- search/functions_1a.html | 6 +- search/functions_1a.js | 4 +- search/functions_1b.html | 6 +- search/functions_1b.js | 194 +- search/functions_2.html | 6 +- search/functions_2.js | 132 +- search/functions_3.html | 6 +- search/functions_3.js | 180 +- search/functions_4.html | 6 +- search/functions_4.js | 206 +- search/functions_5.html | 6 +- search/functions_5.js | 120 +- search/functions_6.html | 6 +- search/functions_6.js | 229 +- search/functions_7.html | 6 +- search/functions_7.js | 186 +- search/functions_8.html | 6 +- search/functions_8.js | 48 +- search/functions_9.html | 6 +- search/functions_9.js | 230 +- search/functions_a.html | 6 +- search/functions_a.js | 6 +- search/functions_b.html | 6 +- search/functions_b.js | 20 +- search/functions_c.html | 6 +- search/functions_c.js | 116 +- search/functions_d.html | 6 +- search/functions_d.js | 200 +- search/functions_e.html | 6 +- search/functions_e.js | 120 +- search/functions_f.html | 6 +- search/functions_f.js | 130 +- search/groups_0.html | 6 +- search/groups_0.js | 2 +- search/groups_1.html | 6 +- search/groups_1.js | 4 +- search/groups_2.html | 6 +- search/groups_2.js | 2 +- search/namespaces_0.html | 6 +- search/namespaces_0.js | 6 +- search/namespaces_1.html | 6 +- search/namespaces_1.js | 10 +- search/namespaces_10.html | 6 +- search/namespaces_10.js | 10 +- search/namespaces_11.html | 6 +- search/namespaces_11.js | 38 +- search/namespaces_12.html | 6 +- search/namespaces_12.js | 6 +- search/namespaces_13.html | 6 +- search/namespaces_13.js | 2 +- search/namespaces_14.html | 6 +- search/namespaces_14.js | 4 +- search/namespaces_15.html | 6 +- search/namespaces_15.js | 8 +- search/namespaces_16.html | 6 +- search/namespaces_16.js | 2 +- search/namespaces_2.html | 6 +- search/namespaces_2.js | 16 +- search/namespaces_3.html | 6 +- search/namespaces_3.js | 14 +- search/namespaces_4.html | 6 +- search/namespaces_4.js | 4 +- search/namespaces_5.html | 6 +- search/namespaces_5.js | 6 +- search/namespaces_6.html | 6 +- search/namespaces_6.js | 8 +- search/namespaces_7.html | 6 +- search/namespaces_7.js | 8 +- search/namespaces_8.html | 6 +- search/namespaces_8.js | 2 +- search/namespaces_9.html | 6 +- search/namespaces_9.js | 6 +- search/namespaces_a.html | 6 +- search/namespaces_a.js | 14 +- search/namespaces_b.html | 6 +- search/namespaces_b.js | 20 +- search/namespaces_c.html | 6 +- search/namespaces_c.js | 14 +- search/namespaces_d.html | 6 +- search/namespaces_d.js | 4 +- search/namespaces_e.html | 6 +- search/namespaces_e.js | 6 +- search/namespaces_f.html | 6 +- search/namespaces_f.js | 6 +- search/pages_0.html | 6 +- search/pages_0.js | 2 +- search/pages_1.html | 6 +- search/pages_1.js | 6 +- search/pages_2.html | 6 +- search/pages_2.js | 2 +- search/pages_3.html | 6 +- search/pages_3.js | 2 +- search/pages_4.html | 6 +- search/pages_4.js | 4 +- search/related_0.html | 6 +- search/related_0.js | 10 +- search/search.css | 12 +- search/search.js | 66 +- search/typedefs_0.html | 6 +- search/typedefs_0.js | 2 +- search/typedefs_1.html | 6 +- search/typedefs_1.js | 2 +- search/typedefs_2.html | 6 +- search/typedefs_2.js | 2 +- search/typedefs_3.html | 6 +- search/typedefs_3.js | 4 +- search/typedefs_4.html | 6 +- search/typedefs_4.js | 2 +- search/variables_0.html | 6 +- search/variables_0.js | 4 +- search/variables_1.html | 6 +- search/variables_1.js | 12 +- search/variables_10.html | 6 +- search/variables_10.js | 10 +- search/variables_11.html | 6 +- search/variables_11.js | 22 +- search/variables_12.html | 6 +- search/variables_12.js | 20 +- search/variables_13.html | 6 +- search/variables_13.js | 2 +- search/variables_14.html | 6 +- search/variables_14.js | 8 +- search/variables_15.html | 6 +- search/variables_15.js | 6 +- search/variables_16.html | 6 +- search/variables_16.js | 2 +- search/variables_17.html | 6 +- search/variables_17.js | 2 +- search/variables_2.html | 6 +- search/variables_2.js | 2 +- search/variables_3.html | 6 +- search/variables_3.js | 8 +- search/variables_4.html | 6 +- search/variables_4.js | 8 +- search/variables_5.html | 6 +- search/variables_5.js | 4 +- search/variables_6.html | 6 +- search/variables_6.js | 10 +- search/variables_7.html | 6 +- search/variables_7.js | 2 +- search/variables_8.html | 6 +- search/variables_8.js | 20 +- search/variables_9.html | 6 +- search/variables_9.js | 8 +- search/variables_a.html | 6 +- search/variables_a.js | 2 +- search/variables_b.html | 6 +- search/variables_b.js | 10 +- search/variables_c.html | 6 +- search/variables_c.js | 18 +- search/variables_d.html | 6 +- search/variables_d.js | 10 +- search/variables_e.html | 6 +- search/variables_e.js | 26 +- search/variables_f.html | 6 +- search/variables_f.js | 4 +- tabs.css | 2 +- 3432 files changed, 71392 insertions(+), 72953 deletions(-) create mode 100644 d0/d46/finding__number__of__digits__in__a__number_8cpp.html create mode 100644 d0/d46/finding__number__of__digits__in__a__number_8cpp.js create mode 100644 d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg delete mode 100644 d0/dff/classmachine__learning_1_1aystar__search_1_1_eight_puzzle__coll__graph.map delete mode 100644 d0/dff/classmachine__learning_1_1aystar__search_1_1_eight_puzzle__coll__graph.md5 delete mode 100644 d0/dff/classmachine__learning_1_1aystar__search_1_1_eight_puzzle__coll__graph.svg delete mode 100644 d0/dff/structlinkedlist.js create mode 100644 d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.map create mode 100644 d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.md5 create mode 100644 d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.svg delete mode 100644 d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.map delete mode 100644 d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.md5 delete mode 100644 d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.svg create mode 100644 d1/d4a/finding__number__of__digits__in__a__number_8cpp__incl.map create mode 100644 d1/d4a/finding__number__of__digits__in__a__number_8cpp__incl.md5 create mode 100644 d1/d4a/finding__number__of__digits__in__a__number_8cpp__incl.svg delete mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a79ab4601c4a95c0902ac04e779e5f54d_cgraph.map delete mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a79ab4601c4a95c0902ac04e779e5f54d_cgraph.md5 delete mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a79ab4601c4a95c0902ac04e779e5f54d_cgraph.svg delete mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.map delete mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.md5 delete mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.svg create mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_aa339c31ec74cd86a4842a8b09653d460_cgraph.map create mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_aa339c31ec74cd86a4842a8b09653d460_cgraph.md5 create mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_aa339c31ec74cd86a4842a8b09653d460_cgraph.svg create mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae8de7aefcb6635d3dacdd174cd4890c4_cgraph.map create mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae8de7aefcb6635d3dacdd174cd4890c4_cgraph.md5 create mode 100644 d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae8de7aefcb6635d3dacdd174cd4890c4_cgraph.svg delete mode 100644 d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.map delete mode 100644 d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.md5 delete mode 100644 d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.svg delete mode 100644 d1/d77/structmst.js delete mode 100644 d1/d83/classuint256__t_a00d18c74d5cbf3c087665172079e67dd_cgraph.md5 rename d1/d83/{classuint256__t_a59a697fc2ee38e46506a80ddf405c188_cgraph.map => classuint256__t_a2cd43a4a92dc825a010a17578b3bdedb_cgraph.map} (90%) create mode 100644 d1/d83/classuint256__t_a2cd43a4a92dc825a010a17578b3bdedb_cgraph.md5 rename d1/d83/{classuint256__t_a59a697fc2ee38e46506a80ddf405c188_cgraph.svg => classuint256__t_a2cd43a4a92dc825a010a17578b3bdedb_cgraph.svg} (96%) rename d1/d83/{classuint256__t_ab9e5da2ffc16c77fc8ecb101db903b29_cgraph.map => classuint256__t_a4645040fe68ff01d83400f173fd2bb21_cgraph.map} (100%) rename d1/d83/{classuint256__t_ab9e5da2ffc16c77fc8ecb101db903b29_cgraph.md5 => classuint256__t_a4645040fe68ff01d83400f173fd2bb21_cgraph.md5} (100%) rename d1/d83/{classuint256__t_ab9e5da2ffc16c77fc8ecb101db903b29_cgraph.svg => classuint256__t_a4645040fe68ff01d83400f173fd2bb21_cgraph.svg} (97%) delete mode 100644 d1/d83/classuint256__t_a59a697fc2ee38e46506a80ddf405c188_cgraph.md5 rename d1/d83/{classuint256__t_af69316a7e4c2d17070de98d6a92b1c51_cgraph.map => classuint256__t_a8161d52d369e525f4e61129376adfcf1_cgraph.map} (100%) rename d1/d83/{classuint256__t_af69316a7e4c2d17070de98d6a92b1c51_cgraph.md5 => classuint256__t_a8161d52d369e525f4e61129376adfcf1_cgraph.md5} (100%) rename d1/d83/{classuint256__t_af69316a7e4c2d17070de98d6a92b1c51_cgraph.svg => classuint256__t_a8161d52d369e525f4e61129376adfcf1_cgraph.svg} (97%) rename d1/d83/{classuint256__t_a0590a8b45c2f7b31670606782614545e_cgraph.map => classuint256__t_a86aab081bb7db2771e4a4f30c3eed8e2_cgraph.map} (100%) rename d1/d83/{classuint256__t_a0590a8b45c2f7b31670606782614545e_cgraph.md5 => classuint256__t_a86aab081bb7db2771e4a4f30c3eed8e2_cgraph.md5} (100%) rename d1/d83/{classuint256__t_a0590a8b45c2f7b31670606782614545e_cgraph.svg => classuint256__t_a86aab081bb7db2771e4a4f30c3eed8e2_cgraph.svg} (97%) rename d1/d83/{classuint256__t_a00d18c74d5cbf3c087665172079e67dd_cgraph.map => classuint256__t_ac1b36e64de42f3622e7d6ec5efa273d4_cgraph.map} (90%) create mode 100644 d1/d83/classuint256__t_ac1b36e64de42f3622e7d6ec5efa273d4_cgraph.md5 rename d1/d83/{classuint256__t_a00d18c74d5cbf3c087665172079e67dd_cgraph.svg => classuint256__t_ac1b36e64de42f3622e7d6ec5efa273d4_cgraph.svg} (96%) delete mode 100644 d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg rename d1/daa/{random__pivot__quick__sort_8cpp_a80fcb0b18a1ff5588bb00c0ff3b7fb49_cgraph.map => random__pivot__quick__sort_8cpp_a3d1c39e1ff42c04fb8ec0c0b9411cd3e_cgraph.map} (100%) rename d1/daa/{random__pivot__quick__sort_8cpp_a80fcb0b18a1ff5588bb00c0ff3b7fb49_cgraph.md5 => random__pivot__quick__sort_8cpp_a3d1c39e1ff42c04fb8ec0c0b9411cd3e_cgraph.md5} (100%) rename d1/daa/{random__pivot__quick__sort_8cpp_a80fcb0b18a1ff5588bb00c0ff3b7fb49_cgraph.svg => random__pivot__quick__sort_8cpp_a3d1c39e1ff42c04fb8ec0c0b9411cd3e_cgraph.svg} (97%) rename d1/daa/{random__pivot__quick__sort_8cpp_ad29ec5b3d242892675ba76acad5300a3_cgraph.map => random__pivot__quick__sort_8cpp_a40675d2eb960c71ca31ec475ba90120d_cgraph.map} (100%) rename d1/daa/{random__pivot__quick__sort_8cpp_ad29ec5b3d242892675ba76acad5300a3_cgraph.md5 => random__pivot__quick__sort_8cpp_a40675d2eb960c71ca31ec475ba90120d_cgraph.md5} (100%) rename d1/daa/{random__pivot__quick__sort_8cpp_ad29ec5b3d242892675ba76acad5300a3_cgraph.svg => random__pivot__quick__sort_8cpp_a40675d2eb960c71ca31ec475ba90120d_cgraph.svg} (96%) rename d1/daa/{random__pivot__quick__sort_8cpp_a5c8eb5c4cb149b2f6c92582169532e92_cgraph.map => random__pivot__quick__sort_8cpp_a7d2e7465e7b5d54c2de6d5e9db1ea6a5_cgraph.map} (100%) rename d1/daa/{random__pivot__quick__sort_8cpp_a5c8eb5c4cb149b2f6c92582169532e92_cgraph.md5 => random__pivot__quick__sort_8cpp_a7d2e7465e7b5d54c2de6d5e9db1ea6a5_cgraph.md5} (100%) rename d1/daa/{random__pivot__quick__sort_8cpp_a5c8eb5c4cb149b2f6c92582169532e92_cgraph.svg => random__pivot__quick__sort_8cpp_a7d2e7465e7b5d54c2de6d5e9db1ea6a5_cgraph.svg} (99%) delete mode 100644 d1/db3/structcompare.js delete mode 100644 d1/dc5/classlarge__number__coll__graph.map delete mode 100644 d1/dc5/classlarge__number__coll__graph.md5 delete mode 100644 d1/dc5/classlarge__number__coll__graph.svg rename d1/dcc/{wiggle__sort_8cpp_a52955ecf8669ff6c5b9b1e66bd7db41d_cgraph.map => wiggle__sort_8cpp_a99eeded693ac073717282fae365957a1_cgraph.map} (100%) rename d1/dcc/{wiggle__sort_8cpp_a52955ecf8669ff6c5b9b1e66bd7db41d_cgraph.md5 => wiggle__sort_8cpp_a99eeded693ac073717282fae365957a1_cgraph.md5} (100%) rename d1/dcc/{wiggle__sort_8cpp_a52955ecf8669ff6c5b9b1e66bd7db41d_cgraph.svg => wiggle__sort_8cpp_a99eeded693ac073717282fae365957a1_cgraph.svg} (96%) delete mode 100644 d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph.map delete mode 100644 d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph.md5 delete mode 100644 d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph.svg delete mode 100644 d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph_org.svg create mode 100644 d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.map create mode 100644 d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.md5 create mode 100644 d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.svg create mode 100644 d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.map create mode 100644 d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.md5 create mode 100644 d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.svg rename d2/d3b/{namespaceqr__algorithm_a240edf2b6b5942c0e5f2c9d3e326797f_cgraph.map => namespaceqr__algorithm_a257425cb2365359da51c6fe6741834d8_cgraph.map} (100%) rename d2/d3b/{namespaceqr__algorithm_a240edf2b6b5942c0e5f2c9d3e326797f_cgraph.md5 => namespaceqr__algorithm_a257425cb2365359da51c6fe6741834d8_cgraph.md5} (100%) rename d2/d3b/{namespaceqr__algorithm_a240edf2b6b5942c0e5f2c9d3e326797f_cgraph.svg => namespaceqr__algorithm_a257425cb2365359da51c6fe6741834d8_cgraph.svg} (98%) rename d2/d3b/{namespaceqr__algorithm_a763896dbb4a7e95c4a1e614ac0819d66_cgraph.map => namespaceqr__algorithm_a28e2fa3e803abaea6c568dc45d69d8cc_cgraph.map} (79%) create mode 100644 d2/d3b/namespaceqr__algorithm_a28e2fa3e803abaea6c568dc45d69d8cc_cgraph.md5 rename d2/d3b/{namespaceqr__algorithm_a763896dbb4a7e95c4a1e614ac0819d66_cgraph.svg => namespaceqr__algorithm_a28e2fa3e803abaea6c568dc45d69d8cc_cgraph.svg} (96%) rename d2/d3b/{namespaceqr__algorithm_a763896dbb4a7e95c4a1e614ac0819d66_cgraph_org.svg => namespaceqr__algorithm_a28e2fa3e803abaea6c568dc45d69d8cc_cgraph_org.svg} (95%) rename d2/d3b/{namespaceqr__algorithm_a5422c76bfa322620de611083bd518d71_cgraph.map => namespaceqr__algorithm_a6d3c7dce1f142141f509d09f6c0e25dc_cgraph.map} (100%) rename d2/d3b/{namespaceqr__algorithm_a5422c76bfa322620de611083bd518d71_cgraph.md5 => namespaceqr__algorithm_a6d3c7dce1f142141f509d09f6c0e25dc_cgraph.md5} (100%) rename d2/d3b/{namespaceqr__algorithm_a5422c76bfa322620de611083bd518d71_cgraph.svg => namespaceqr__algorithm_a6d3c7dce1f142141f509d09f6c0e25dc_cgraph.svg} (96%) rename d2/d3b/{namespaceqr__algorithm_ab1ac74497ffb2101040cc1efe3546de8_cgraph.map => namespaceqr__algorithm_a73ce637634fc49e1d10d190eb388ebf1_cgraph.map} (86%) create mode 100644 d2/d3b/namespaceqr__algorithm_a73ce637634fc49e1d10d190eb388ebf1_cgraph.md5 rename d2/d3b/{namespaceqr__algorithm_ab1ac74497ffb2101040cc1efe3546de8_cgraph.svg => namespaceqr__algorithm_a73ce637634fc49e1d10d190eb388ebf1_cgraph.svg} (96%) delete mode 100644 d2/d3b/namespaceqr__algorithm_a763896dbb4a7e95c4a1e614ac0819d66_cgraph.md5 delete mode 100644 d2/d3b/namespaceqr__algorithm_ab1ac74497ffb2101040cc1efe3546de8_cgraph.md5 rename d2/d3b/{namespaceqr__algorithm_a7c63c78d6839b8ad73b77c161210b514_cgraph.map => namespaceqr__algorithm_adfbdf47277c8cfee229b05b72f1f7834_cgraph.map} (100%) rename d2/d3b/{namespaceqr__algorithm_a7c63c78d6839b8ad73b77c161210b514_cgraph.md5 => namespaceqr__algorithm_adfbdf47277c8cfee229b05b72f1f7834_cgraph.md5} (100%) rename d2/d3b/{namespaceqr__algorithm_a7c63c78d6839b8ad73b77c161210b514_cgraph.svg => namespaceqr__algorithm_adfbdf47277c8cfee229b05b72f1f7834_cgraph.svg} (98%) create mode 100644 d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.map create mode 100644 d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.md5 create mode 100644 d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.svg create mode 100644 d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.map create mode 100644 d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.md5 create mode 100644 d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.svg create mode 100644 d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.map create mode 100644 d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.md5 create mode 100644 d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.svg delete mode 100644 d2/dc4/classstack__linked_list.js rename d3/d22/{saddleback__search_8cpp_a0a2f1f1a4c93bb57e8c16b8d08f26916_cgraph.map => saddleback__search_8cpp_ad1e0ca34797d88490747c08eca70a2e6_cgraph.map} (100%) rename d3/d22/{saddleback__search_8cpp_a0a2f1f1a4c93bb57e8c16b8d08f26916_cgraph.md5 => saddleback__search_8cpp_ad1e0ca34797d88490747c08eca70a2e6_cgraph.md5} (100%) rename d3/d22/{saddleback__search_8cpp_a0a2f1f1a4c93bb57e8c16b8d08f26916_cgraph.svg => saddleback__search_8cpp_ad1e0ca34797d88490747c08eca70a2e6_cgraph.svg} (97%) delete mode 100644 d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie_a5f501b7f1240a58bc082187f22c2fe17_cgraph.md5 rename d3/d26/{classdata__structures_1_1trie__using__hashmap_1_1_trie_a5f501b7f1240a58bc082187f22c2fe17_cgraph.map => classdata__structures_1_1trie__using__hashmap_1_1_trie_a7bbe538c8015e8ce158e7ed43f605ebd_cgraph.map} (74%) create mode 100644 d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie_a7bbe538c8015e8ce158e7ed43f605ebd_cgraph.md5 rename d3/d26/{classdata__structures_1_1trie__using__hashmap_1_1_trie_a5f501b7f1240a58bc082187f22c2fe17_cgraph.svg => classdata__structures_1_1trie__using__hashmap_1_1_trie_a7bbe538c8015e8ce158e7ed43f605ebd_cgraph.svg} (81%) delete mode 100644 d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie_acbfd4a79adb242022fa2829740328c17_cgraph.md5 rename d3/d26/{classdata__structures_1_1trie__using__hashmap_1_1_trie_acbfd4a79adb242022fa2829740328c17_cgraph.map => classdata__structures_1_1trie__using__hashmap_1_1_trie_ae15fdc7f2b5023992d87a711d78566c4_cgraph.map} (62%) create mode 100644 d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie_ae15fdc7f2b5023992d87a711d78566c4_cgraph.md5 rename d3/d26/{classdata__structures_1_1trie__using__hashmap_1_1_trie_acbfd4a79adb242022fa2829740328c17_cgraph.svg => classdata__structures_1_1trie__using__hashmap_1_1_trie_ae15fdc7f2b5023992d87a711d78566c4_cgraph.svg} (82%) delete mode 100644 d3/d2a/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1comparison__operator.js delete mode 100644 d3/daa/structdata__structures_1_1sparse__table_1_1_sparse__table__coll__graph.map delete mode 100644 d3/daa/structdata__structures_1_1sparse__table_1_1_sparse__table__coll__graph.md5 delete mode 100644 d3/daa/structdata__structures_1_1sparse__table_1_1_sparse__table__coll__graph.svg delete mode 100644 d3/db3/lru__cache_8cpp_a6a3be6d8871b1f5dc03688da8f3ee9e6_cgraph_org.svg rename d3/dfe/{horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.map => horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.map} (89%) create mode 100644 d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.md5 create mode 100644 d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.svg delete mode 100644 d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.md5 delete mode 100644 d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.svg create mode 100644 d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.map create mode 100644 d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.md5 create mode 100644 d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.svg delete mode 100644 d4/d2c/struct_trie_1_1_trie_node__coll__graph.map delete mode 100644 d4/d2c/struct_trie_1_1_trie_node__coll__graph.md5 delete mode 100644 d4/d2c/struct_trie_1_1_trie_node__coll__graph.svg rename d4/d32/{inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.map => inorder__successor__of__bst_8cpp_a05fe8a029e155c43e4efa598d4d089d9_cgraph.map} (100%) rename d4/d32/{inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.md5 => inorder__successor__of__bst_8cpp_a05fe8a029e155c43e4efa598d4d089d9_cgraph.md5} (100%) rename d4/d32/{inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.svg => inorder__successor__of__bst_8cpp_a05fe8a029e155c43e4efa598d4d089d9_cgraph.svg} (96%) rename d4/d32/{inorder__successor__of__bst_8cpp_a9aa3fac9aa48a6568ecf89aaee190d43_cgraph.map => inorder__successor__of__bst_8cpp_a3923fb22b46e085376703cae0b44d690_cgraph.map} (100%) rename d4/d32/{inorder__successor__of__bst_8cpp_a9aa3fac9aa48a6568ecf89aaee190d43_cgraph.md5 => inorder__successor__of__bst_8cpp_a3923fb22b46e085376703cae0b44d690_cgraph.md5} (100%) rename d4/d32/{inorder__successor__of__bst_8cpp_a9aa3fac9aa48a6568ecf89aaee190d43_cgraph.svg => inorder__successor__of__bst_8cpp_a3923fb22b46e085376703cae0b44d690_cgraph.svg} (96%) rename d4/d32/{inorder__successor__of__bst_8cpp_a25667588088eb647887d1c2bff0efa8c_cgraph.map => inorder__successor__of__bst_8cpp_a72483e3f6933e004a8d86371e8a990db_cgraph.map} (100%) rename d4/d32/{inorder__successor__of__bst_8cpp_a25667588088eb647887d1c2bff0efa8c_cgraph.md5 => inorder__successor__of__bst_8cpp_a72483e3f6933e004a8d86371e8a990db_cgraph.md5} (100%) rename d4/d32/{inorder__successor__of__bst_8cpp_a25667588088eb647887d1c2bff0efa8c_cgraph.svg => inorder__successor__of__bst_8cpp_a72483e3f6933e004a8d86371e8a990db_cgraph.svg} (96%) rename d4/d32/{inorder__successor__of__bst_8cpp_a4852816cc9f28f7b9def0e5beb4e8545_cgraph.map => inorder__successor__of__bst_8cpp_a7f6f73a33beec448c27cc1d70b220702_cgraph.map} (100%) rename d4/d32/{inorder__successor__of__bst_8cpp_a4852816cc9f28f7b9def0e5beb4e8545_cgraph.md5 => inorder__successor__of__bst_8cpp_a7f6f73a33beec448c27cc1d70b220702_cgraph.md5} (100%) rename d4/d32/{inorder__successor__of__bst_8cpp_a4852816cc9f28f7b9def0e5beb4e8545_cgraph.svg => inorder__successor__of__bst_8cpp_a7f6f73a33beec448c27cc1d70b220702_cgraph.svg} (96%) rename d4/d32/{inorder__successor__of__bst_8cpp_a744afaca22fa7bb91c92209a26f23e8f_cgraph.map => inorder__successor__of__bst_8cpp_a824cbf1814854824cf05f062eea07b95_cgraph.map} (100%) rename d4/d32/{inorder__successor__of__bst_8cpp_a744afaca22fa7bb91c92209a26f23e8f_cgraph.md5 => inorder__successor__of__bst_8cpp_a824cbf1814854824cf05f062eea07b95_cgraph.md5} (100%) rename d4/d32/{inorder__successor__of__bst_8cpp_a744afaca22fa7bb91c92209a26f23e8f_cgraph.svg => inorder__successor__of__bst_8cpp_a824cbf1814854824cf05f062eea07b95_cgraph.svg} (96%) create mode 100644 d4/d39/group__open__addressing.js create mode 100644 d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.map create mode 100644 d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.md5 create mode 100644 d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.svg rename d4/d90/{classdata__structures_1_1_skip_list_a2249e3ab2f8a0f2334b90635202de4f2_cgraph.map => classdata__structures_1_1_skip_list_af2f3d4e15b1f47afac849c2e08a730f4_cgraph.map} (100%) rename d4/d90/{classdata__structures_1_1_skip_list_a2249e3ab2f8a0f2334b90635202de4f2_cgraph.md5 => classdata__structures_1_1_skip_list_af2f3d4e15b1f47afac849c2e08a730f4_cgraph.md5} (100%) rename d4/d90/{classdata__structures_1_1_skip_list_a2249e3ab2f8a0f2334b90635202de4f2_cgraph.svg => classdata__structures_1_1_skip_list_af2f3d4e15b1f47afac849c2e08a730f4_cgraph.svg} (96%) rename d4/d96/{range__queries_2sparse__table_8cpp_ad71ae7840af3a52e7ee56186bb0c3063_cgraph.map => range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.map} (100%) rename d4/d96/{range__queries_2sparse__table_8cpp_ad71ae7840af3a52e7ee56186bb0c3063_cgraph.md5 => range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.md5} (100%) rename d4/d96/{range__queries_2sparse__table_8cpp_ad71ae7840af3a52e7ee56186bb0c3063_cgraph.svg => range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.svg} (97%) rename d4/d96/{range__queries_2sparse__table_8cpp_a328ed1c01cccd07aeb1500c11b609be3_cgraph.map => range__queries_2sparse__table_8cpp_a803a2451e87021d14ae06f148383e6bc_cgraph.map} (100%) rename d4/d96/{range__queries_2sparse__table_8cpp_a328ed1c01cccd07aeb1500c11b609be3_cgraph.md5 => range__queries_2sparse__table_8cpp_a803a2451e87021d14ae06f148383e6bc_cgraph.md5} (100%) rename d4/d96/{range__queries_2sparse__table_8cpp_a328ed1c01cccd07aeb1500c11b609be3_cgraph.svg => range__queries_2sparse__table_8cpp_a803a2451e87021d14ae06f148383e6bc_cgraph.svg} (97%) delete mode 100644 d4/dcb/classstack__coll__graph.map delete mode 100644 d4/dcb/classstack__coll__graph.md5 delete mode 100644 d4/dcb/classstack__coll__graph.svg rename d4/dde/{classgeometry_1_1jarvis_1_1_convexhull_a878952f2eb3d1fae79d58c994fc10ab1_cgraph.map => classgeometry_1_1jarvis_1_1_convexhull_aeec46e86786ddd461464b07a77c4d5f1_cgraph.map} (100%) rename d4/dde/{classgeometry_1_1jarvis_1_1_convexhull_a878952f2eb3d1fae79d58c994fc10ab1_cgraph.md5 => classgeometry_1_1jarvis_1_1_convexhull_aeec46e86786ddd461464b07a77c4d5f1_cgraph.md5} (100%) rename d4/dde/{classgeometry_1_1jarvis_1_1_convexhull_a878952f2eb3d1fae79d58c994fc10ab1_cgraph.svg => classgeometry_1_1jarvis_1_1_convexhull_aeec46e86786ddd461464b07a77c4d5f1_cgraph.svg} (97%) rename d4/def/{kohonen__som__topology_8cpp_ab3081e021270ba21a9fd88646f6a6e26_cgraph.map => kohonen__som__topology_8cpp_a1302662a56ebf67a21249270b017297e_cgraph.map} (100%) rename d4/def/{kohonen__som__topology_8cpp_ab3081e021270ba21a9fd88646f6a6e26_cgraph.md5 => kohonen__som__topology_8cpp_a1302662a56ebf67a21249270b017297e_cgraph.md5} (100%) rename d4/def/{kohonen__som__topology_8cpp_ab3081e021270ba21a9fd88646f6a6e26_cgraph.svg => kohonen__som__topology_8cpp_a1302662a56ebf67a21249270b017297e_cgraph.svg} (97%) rename d4/def/{kohonen__som__topology_8cpp_a6b5e744876fd980a3451cbb385d4e755_cgraph.map => kohonen__som__topology_8cpp_a48efb079040c7aaa3a4917a0e486cba9_cgraph.map} (100%) rename d4/def/{kohonen__som__topology_8cpp_a6b5e744876fd980a3451cbb385d4e755_cgraph.md5 => kohonen__som__topology_8cpp_a48efb079040c7aaa3a4917a0e486cba9_cgraph.md5} (100%) rename d4/def/{kohonen__som__topology_8cpp_a6b5e744876fd980a3451cbb385d4e755_cgraph.svg => kohonen__som__topology_8cpp_a48efb079040c7aaa3a4917a0e486cba9_cgraph.svg} (97%) rename d4/def/{kohonen__som__topology_8cpp_a0e7435446ed7c763f7de79a468add2e0_cgraph.map => kohonen__som__topology_8cpp_a4b7ab643f6a5002f991837de46f70653_cgraph.map} (100%) rename d4/def/{kohonen__som__topology_8cpp_a0e7435446ed7c763f7de79a468add2e0_cgraph.md5 => kohonen__som__topology_8cpp_a4b7ab643f6a5002f991837de46f70653_cgraph.md5} (100%) rename d4/def/{kohonen__som__topology_8cpp_a0e7435446ed7c763f7de79a468add2e0_cgraph.svg => kohonen__som__topology_8cpp_a4b7ab643f6a5002f991837de46f70653_cgraph.svg} (97%) delete mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a0ee425af6fd83a033c021128b8253f52_cgraph.md5 rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a8f8eb4423c57a00b0ab46de226bc6509_cgraph.map => classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.map} (84%) create mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.md5 rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a8f8eb4423c57a00b0ab46de226bc6509_cgraph.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.svg} (97%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a8f8eb4423c57a00b0ab46de226bc6509_cgraph_org.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph_org.svg} (97%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_acd397b51fcf8f690b03e406ada8c9d13_cgraph.map => classmachine__learning_1_1neural__network_1_1_neural_network_a361a45f3c3d8347d79103bf182d0570b_cgraph.map} (87%) create mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a361a45f3c3d8347d79103bf182d0570b_cgraph.md5 rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_acd397b51fcf8f690b03e406ada8c9d13_cgraph.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a361a45f3c3d8347d79103bf182d0570b_cgraph.svg} (96%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_ac130322a5abb1ff763b7c1a55405a35e_cgraph.map => classmachine__learning_1_1neural__network_1_1_neural_network_a3b9eac1824d365dce715fb17c33cb96f_cgraph.map} (80%) create mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a3b9eac1824d365dce715fb17c33cb96f_cgraph.md5 rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_ac130322a5abb1ff763b7c1a55405a35e_cgraph.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a3b9eac1824d365dce715fb17c33cb96f_cgraph.svg} (96%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_ac130322a5abb1ff763b7c1a55405a35e_cgraph_org.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a3b9eac1824d365dce715fb17c33cb96f_cgraph_org.svg} (95%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a215d132aa38b9c9aab6716663a751b82_cgraph.map => classmachine__learning_1_1neural__network_1_1_neural_network_a4c4c6f63ab965317f9471518ee931b89_cgraph.map} (100%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a215d132aa38b9c9aab6716663a751b82_cgraph.md5 => classmachine__learning_1_1neural__network_1_1_neural_network_a4c4c6f63ab965317f9471518ee931b89_cgraph.md5} (100%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a8f984bfd3e32b9b71c33a4f62335c710_cgraph.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a4c4c6f63ab965317f9471518ee931b89_cgraph.svg} (97%) delete mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a4c4ff6b340d0e460d3015ad601a568b6_cgraph.md5 rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a8f984bfd3e32b9b71c33a4f62335c710_cgraph.map => classmachine__learning_1_1neural__network_1_1_neural_network_a62151b0398a2536be60d950e10ffe9a8_cgraph.map} (100%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a8f984bfd3e32b9b71c33a4f62335c710_cgraph.md5 => classmachine__learning_1_1neural__network_1_1_neural_network_a62151b0398a2536be60d950e10ffe9a8_cgraph.md5} (100%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a215d132aa38b9c9aab6716663a751b82_cgraph.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a62151b0398a2536be60d950e10ffe9a8_cgraph.svg} (97%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a8d983ebb3225a9901b713a0f05b44aba_cgraph.map => classmachine__learning_1_1neural__network_1_1_neural_network_a650c677fd6512665741ddd9b7983275d_cgraph.map} (91%) create mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a650c677fd6512665741ddd9b7983275d_cgraph.md5 rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a8d983ebb3225a9901b713a0f05b44aba_cgraph.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a650c677fd6512665741ddd9b7983275d_cgraph.svg} (97%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a8d983ebb3225a9901b713a0f05b44aba_cgraph_org.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a650c677fd6512665741ddd9b7983275d_cgraph_org.svg} (97%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a4c4ff6b340d0e460d3015ad601a568b6_cgraph.map => classmachine__learning_1_1neural__network_1_1_neural_network_a88bf9023ab3d4cdb61cf707c7cdfc86b_cgraph.map} (76%) create mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a88bf9023ab3d4cdb61cf707c7cdfc86b_cgraph.md5 rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a4c4ff6b340d0e460d3015ad601a568b6_cgraph.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a88bf9023ab3d4cdb61cf707c7cdfc86b_cgraph.svg} (95%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a4c4ff6b340d0e460d3015ad601a568b6_cgraph_org.svg => classmachine__learning_1_1neural__network_1_1_neural_network_a88bf9023ab3d4cdb61cf707c7cdfc86b_cgraph_org.svg} (94%) delete mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a8d983ebb3225a9901b713a0f05b44aba_cgraph.md5 delete mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a8f8eb4423c57a00b0ab46de226bc6509_cgraph.md5 delete mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_ac130322a5abb1ff763b7c1a55405a35e_cgraph.md5 delete mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_acd397b51fcf8f690b03e406ada8c9d13_cgraph.md5 rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a0ee425af6fd83a033c021128b8253f52_cgraph.map => classmachine__learning_1_1neural__network_1_1_neural_network_aec648ea4f40bd71123b5f907a681dd8e_cgraph.map} (80%) create mode 100644 d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_aec648ea4f40bd71123b5f907a681dd8e_cgraph.md5 rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a0ee425af6fd83a033c021128b8253f52_cgraph.svg => classmachine__learning_1_1neural__network_1_1_neural_network_aec648ea4f40bd71123b5f907a681dd8e_cgraph.svg} (96%) rename d4/df4/{classmachine__learning_1_1neural__network_1_1_neural_network_a0ee425af6fd83a033c021128b8253f52_cgraph_org.svg => classmachine__learning_1_1neural__network_1_1_neural_network_aec648ea4f40bd71123b5f907a681dd8e_cgraph_org.svg} (96%) delete mode 100644 d5/d08/classgraph_1_1_graph__coll__graph.map delete mode 100644 d5/d08/classgraph_1_1_graph__coll__graph.md5 delete mode 100644 d5/d08/classgraph_1_1_graph__coll__graph.svg delete mode 100644 d5/d15/classcll.js delete mode 100644 d5/d29/struct_min_heap_node.js rename d5/d45/{sublist__search_8cpp_ab4054b9ab80a5e609b6fcdf70f2e03b9_cgraph.map => sublist__search_8cpp_a70ca8d0267008e09cfa50b4e2ddfbe53_cgraph.map} (100%) rename d5/d45/{sublist__search_8cpp_ab4054b9ab80a5e609b6fcdf70f2e03b9_cgraph.md5 => sublist__search_8cpp_a70ca8d0267008e09cfa50b4e2ddfbe53_cgraph.md5} (100%) rename d5/d45/{sublist__search_8cpp_ab4054b9ab80a5e609b6fcdf70f2e03b9_cgraph.svg => sublist__search_8cpp_a70ca8d0267008e09cfa50b4e2ddfbe53_cgraph.svg} (96%) rename d5/d67/{complex__numbers_8cpp_af738b2a6921f0a6868bb7c5b4c0d18e0_cgraph.map => complex__numbers_8cpp_a44d5f25b573e870accdf26fd32b8484d_cgraph.map} (100%) rename d5/d67/{complex__numbers_8cpp_af738b2a6921f0a6868bb7c5b4c0d18e0_cgraph.md5 => complex__numbers_8cpp_a44d5f25b573e870accdf26fd32b8484d_cgraph.md5} (100%) rename d5/d67/{complex__numbers_8cpp_af738b2a6921f0a6868bb7c5b4c0d18e0_cgraph.svg => complex__numbers_8cpp_a44d5f25b573e870accdf26fd32b8484d_cgraph.svg} (97%) create mode 100644 d5/d67/complex__numbers_8cpp_a5d4d5b8250b50703de888514c8e7a7a0_cgraph.map create mode 100644 d5/d67/complex__numbers_8cpp_a5d4d5b8250b50703de888514c8e7a7a0_cgraph.md5 create mode 100644 d5/d67/complex__numbers_8cpp_a5d4d5b8250b50703de888514c8e7a7a0_cgraph.svg rename d5/d91/{namespacesorting_a2f6a7a66934f345f86038a280234e706_cgraph.map => namespacesorting_a0e9e1b21a1684585e9e50f9afe4d53a3_cgraph.map} (100%) rename d5/d91/{namespacesorting_a2f6a7a66934f345f86038a280234e706_cgraph.md5 => namespacesorting_a0e9e1b21a1684585e9e50f9afe4d53a3_cgraph.md5} (100%) rename d5/d91/{namespacesorting_a2f6a7a66934f345f86038a280234e706_cgraph.svg => namespacesorting_a0e9e1b21a1684585e9e50f9afe4d53a3_cgraph.svg} (98%) rename d5/d91/{namespacesorting_a9d4eb6ea3c35540d804d451f1716622d_cgraph.map => namespacesorting_a6eb67c2f91c98cf4464f75b5882022de_cgraph.map} (69%) create mode 100644 d5/d91/namespacesorting_a6eb67c2f91c98cf4464f75b5882022de_cgraph.md5 rename d5/d91/{namespacesorting_a9d4eb6ea3c35540d804d451f1716622d_cgraph.svg => namespacesorting_a6eb67c2f91c98cf4464f75b5882022de_cgraph.svg} (70%) rename d5/d91/{namespacesorting_aedfb88e2d6fff1871f038221fe5870fe_cgraph.map => namespacesorting_a7bfe11bd4703eacd1dab93f25ec639c5_cgraph.map} (100%) rename d5/d91/{namespacesorting_aedfb88e2d6fff1871f038221fe5870fe_cgraph.md5 => namespacesorting_a7bfe11bd4703eacd1dab93f25ec639c5_cgraph.md5} (100%) rename d5/d91/{namespacesorting_aedfb88e2d6fff1871f038221fe5870fe_cgraph.svg => namespacesorting_a7bfe11bd4703eacd1dab93f25ec639c5_cgraph.svg} (97%) delete mode 100644 d5/d91/namespacesorting_a9d4eb6ea3c35540d804d451f1716622d_cgraph.md5 create mode 100644 d5/d91/namespacesorting_a9f59fe72dacc1f1218ef3c303d843168_cgraph.map create mode 100644 d5/d91/namespacesorting_a9f59fe72dacc1f1218ef3c303d843168_cgraph.md5 create mode 100644 d5/d91/namespacesorting_a9f59fe72dacc1f1218ef3c303d843168_cgraph.svg rename d5/d91/{namespacesorting_a4c5bd73ffb6082f63dc57d8dcc76794f_cgraph.map => namespacesorting_affc6ee160142cd017f8c4b213437d0fd_cgraph.map} (100%) rename d5/d91/{namespacesorting_a4c5bd73ffb6082f63dc57d8dcc76794f_cgraph.md5 => namespacesorting_affc6ee160142cd017f8c4b213437d0fd_cgraph.md5} (100%) rename d5/d91/{namespacesorting_a4c5bd73ffb6082f63dc57d8dcc76794f_cgraph.svg => namespacesorting_affc6ee160142cd017f8c4b213437d0fd_cgraph.svg} (98%) create mode 100644 d5/dab/structdata__structures_1_1list__array_1_1list_a3b4abfffc730e07fcbd5844e09add8cd_cgraph.map create mode 100644 d5/dab/structdata__structures_1_1list__array_1_1list_a3b4abfffc730e07fcbd5844e09add8cd_cgraph.md5 create mode 100644 d5/dab/structdata__structures_1_1list__array_1_1list_a3b4abfffc730e07fcbd5844e09add8cd_cgraph.svg delete mode 100644 d5/dc3/structdata__structures_1_1_node__coll__graph.map delete mode 100644 d5/dc3/structdata__structures_1_1_node__coll__graph.md5 delete mode 100644 d5/dc3/structdata__structures_1_1_node__coll__graph.svg delete mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a2aaf88c9954ef3ab686f8e4bfbd87622_cgraph.map delete mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a2aaf88c9954ef3ab686f8e4bfbd87622_cgraph.md5 delete mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a2aaf88c9954ef3ab686f8e4bfbd87622_cgraph.svg delete mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a4dc64488c36f84d927365fa8d1933663_cgraph.map delete mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a4dc64488c36f84d927365fa8d1933663_cgraph.md5 delete mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a4dc64488c36f84d927365fa8d1933663_cgraph.svg delete mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a688b7ea064739ea9fa66bf64bf4ae631_cgraph.map delete mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a688b7ea064739ea9fa66bf64bf4ae631_cgraph.md5 delete mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a688b7ea064739ea9fa66bf64bf4ae631_cgraph.svg rename d6/d1a/{dnf__sort_8cpp_a60688fc307dbb4b71969dfc191e1e67b_cgraph.map => dnf__sort_8cpp_a621767fe711db64fe57a2ac4987b11f0_cgraph.map} (100%) rename d6/d1a/{dnf__sort_8cpp_a60688fc307dbb4b71969dfc191e1e67b_cgraph.md5 => dnf__sort_8cpp_a621767fe711db64fe57a2ac4987b11f0_cgraph.md5} (100%) rename d6/d1a/{dnf__sort_8cpp_a60688fc307dbb4b71969dfc191e1e67b_cgraph.svg => dnf__sort_8cpp_a621767fe711db64fe57a2ac4987b11f0_cgraph.svg} (98%) rename d6/d26/{classciphers_1_1_hill_cipher_a5a4cdbd4d4dad9efe2ed309bd466dd4b_cgraph.map => classciphers_1_1_hill_cipher_a2eb58750b978a93ac5e6eb29e3e570b7_cgraph.map} (100%) rename d6/d26/{classciphers_1_1_hill_cipher_a5a4cdbd4d4dad9efe2ed309bd466dd4b_cgraph.md5 => classciphers_1_1_hill_cipher_a2eb58750b978a93ac5e6eb29e3e570b7_cgraph.md5} (100%) rename d6/d26/{classciphers_1_1_hill_cipher_a5a4cdbd4d4dad9efe2ed309bd466dd4b_cgraph.svg => classciphers_1_1_hill_cipher_a2eb58750b978a93ac5e6eb29e3e570b7_cgraph.svg} (97%) rename d6/d26/{classciphers_1_1_hill_cipher_a40efd842a5cc44c233641ac2df13b0c0_cgraph.map => classciphers_1_1_hill_cipher_ad36cbcc7a458b3f3a2af0c4aa1126590_cgraph.map} (100%) rename d6/d26/{classciphers_1_1_hill_cipher_a40efd842a5cc44c233641ac2df13b0c0_cgraph.md5 => classciphers_1_1_hill_cipher_ad36cbcc7a458b3f3a2af0c4aa1126590_cgraph.md5} (100%) rename d6/d26/{classciphers_1_1_hill_cipher_a40efd842a5cc44c233641ac2df13b0c0_cgraph.svg => classciphers_1_1_hill_cipher_ad36cbcc7a458b3f3a2af0c4aa1126590_cgraph.svg} (97%) delete mode 100644 d6/d2b/structbinary__search__tree_1_1bst__node__coll__graph.map delete mode 100644 d6/d2b/structbinary__search__tree_1_1bst__node__coll__graph.md5 delete mode 100644 d6/d2b/structbinary__search__tree_1_1bst__node__coll__graph.svg delete mode 100644 d6/d38/classstatistics_1_1stats__computer1__coll__graph.map delete mode 100644 d6/d38/classstatistics_1_1stats__computer1__coll__graph.md5 delete mode 100644 d6/d38/classstatistics_1_1stats__computer1__coll__graph.svg delete mode 100644 d6/d47/classrange__queries_1_1per_seg_tree__coll__graph.map delete mode 100644 d6/d47/classrange__queries_1_1per_seg_tree__coll__graph.md5 delete mode 100644 d6/d47/classrange__queries_1_1per_seg_tree__coll__graph.svg delete mode 100644 d6/d47/classrange__queries_1_1per_seg_tree__coll__graph_org.svg create mode 100644 d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map create mode 100644 d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 create mode 100644 d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg create mode 100644 d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map create mode 100644 d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 create mode 100644 d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg create mode 100644 d6/d7a/golden__search__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.map create mode 100644 d6/d7a/golden__search__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 create mode 100644 d6/d7a/golden__search__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg delete mode 100644 d6/d9e/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info__coll__graph.map delete mode 100644 d6/d9e/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info__coll__graph.md5 delete mode 100644 d6/d9e/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info__coll__graph.svg delete mode 100644 d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.map delete mode 100644 d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.md5 delete mode 100644 d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.svg rename d7/d07/{bidirectional__dijkstra_8cpp_aa3848a7213562b47084585499d3642a5_cgraph.map => bidirectional__dijkstra_8cpp_a1b2df3d52a403ad46523ab90d3a723c1_cgraph.map} (100%) rename d7/d07/{bidirectional__dijkstra_8cpp_aa3848a7213562b47084585499d3642a5_cgraph.md5 => bidirectional__dijkstra_8cpp_a1b2df3d52a403ad46523ab90d3a723c1_cgraph.md5} (100%) rename d7/d07/{bidirectional__dijkstra_8cpp_aa3848a7213562b47084585499d3642a5_cgraph.svg => bidirectional__dijkstra_8cpp_a1b2df3d52a403ad46523ab90d3a723c1_cgraph.svg} (97%) rename d7/d07/{bidirectional__dijkstra_8cpp_ab322409d0015c023d91c67b5b2679257_cgraph.map => bidirectional__dijkstra_8cpp_a22f1b7277e1dd4190f25014b48487ce6_cgraph.map} (100%) rename d7/d07/{bidirectional__dijkstra_8cpp_ab322409d0015c023d91c67b5b2679257_cgraph.md5 => bidirectional__dijkstra_8cpp_a22f1b7277e1dd4190f25014b48487ce6_cgraph.md5} (100%) rename d7/d07/{bidirectional__dijkstra_8cpp_ab322409d0015c023d91c67b5b2679257_cgraph.svg => bidirectional__dijkstra_8cpp_a22f1b7277e1dd4190f25014b48487ce6_cgraph.svg} (96%) rename d7/d07/{bidirectional__dijkstra_8cpp_a6f92fe022b7e5d453f7257d763b6f3e2_cgraph.map => bidirectional__dijkstra_8cpp_a69172365aebde9be1997157f6f80e0cf_cgraph.map} (100%) rename d7/d07/{bidirectional__dijkstra_8cpp_a6f92fe022b7e5d453f7257d763b6f3e2_cgraph.md5 => bidirectional__dijkstra_8cpp_a69172365aebde9be1997157f6f80e0cf_cgraph.md5} (100%) rename d7/d07/{bidirectional__dijkstra_8cpp_a6f92fe022b7e5d453f7257d763b6f3e2_cgraph.svg => bidirectional__dijkstra_8cpp_a69172365aebde9be1997157f6f80e0cf_cgraph.svg} (96%) delete mode 100644 d7/d0b/classdata__structures_1_1_skip_list__coll__graph.map delete mode 100644 d7/d0b/classdata__structures_1_1_skip_list__coll__graph.md5 delete mode 100644 d7/d0b/classdata__structures_1_1_skip_list__coll__graph.svg delete mode 100644 d7/d35/matrix__exponentiation_8cpp_a5769b745458157ef2679949155684f3b_cgraph.map delete mode 100644 d7/d35/matrix__exponentiation_8cpp_a5769b745458157ef2679949155684f3b_cgraph.md5 create mode 100644 d7/d35/matrix__exponentiation_8cpp_a702a9fc90e79b05b863cc4efa26ae2ec_cgraph.map create mode 100644 d7/d35/matrix__exponentiation_8cpp_a702a9fc90e79b05b863cc4efa26ae2ec_cgraph.md5 rename d7/d35/{matrix__exponentiation_8cpp_a5769b745458157ef2679949155684f3b_cgraph.svg => matrix__exponentiation_8cpp_a702a9fc90e79b05b863cc4efa26ae2ec_cgraph.svg} (66%) delete mode 100644 d7/d40/class_solution__coll__graph.map delete mode 100644 d7/d40/class_solution__coll__graph.md5 delete mode 100644 d7/d40/class_solution__coll__graph.svg delete mode 100644 d7/d59/classmachine__learning_1_1neural__network_1_1_neural_network__coll__graph.map delete mode 100644 d7/d59/classmachine__learning_1_1neural__network_1_1_neural_network__coll__graph.md5 delete mode 100644 d7/d59/classmachine__learning_1_1neural__network_1_1_neural_network__coll__graph.svg delete mode 100644 d7/d73/abbreviation_8cpp_a4e606aa4c764ad8d13e49eab002ec7b9_cgraph.md5 delete mode 100644 d7/d73/abbreviation_8cpp_a4e606aa4c764ad8d13e49eab002ec7b9_cgraph.svg rename d7/d73/{abbreviation_8cpp_a4e606aa4c764ad8d13e49eab002ec7b9_cgraph.map => abbreviation_8cpp_add60b8858720bf217df22d992d0fefaa_cgraph.map} (58%) create mode 100644 d7/d73/abbreviation_8cpp_add60b8858720bf217df22d992d0fefaa_cgraph.md5 create mode 100644 d7/d73/abbreviation_8cpp_add60b8858720bf217df22d992d0fefaa_cgraph.svg create mode 100644 d7/d89/double__factorial_8cpp_a68ba20fed2ce427f6469c7689437829d_cgraph.map create mode 100644 d7/d89/double__factorial_8cpp_a68ba20fed2ce427f6469c7689437829d_cgraph.md5 create mode 100644 d7/d89/double__factorial_8cpp_a68ba20fed2ce427f6469c7689437829d_cgraph.svg delete mode 100644 d7/db3/classmachine__learning_1_1aystar__search_1_1_ay_star_search__coll__graph.map delete mode 100644 d7/db3/classmachine__learning_1_1aystar__search_1_1_ay_star_search__coll__graph.md5 delete mode 100644 d7/db3/classmachine__learning_1_1aystar__search_1_1_ay_star_search__coll__graph.svg delete mode 100644 d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.map delete mode 100644 d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.md5 delete mode 100644 d7/db5/classdata__structures_1_1tree__234_1_1_node__coll__graph.svg rename d7/db9/{hill__cipher_8cpp_aeff09ac6b8f060c828354394a3189519_cgraph.map => hill__cipher_8cpp_a34bfcd756610834acac501f9eea1e2eb_cgraph.map} (100%) rename d7/db9/{hill__cipher_8cpp_aeff09ac6b8f060c828354394a3189519_cgraph.md5 => hill__cipher_8cpp_a34bfcd756610834acac501f9eea1e2eb_cgraph.md5} (100%) rename d7/db9/{hill__cipher_8cpp_aeff09ac6b8f060c828354394a3189519_cgraph.svg => hill__cipher_8cpp_a34bfcd756610834acac501f9eea1e2eb_cgraph.svg} (98%) delete mode 100644 d8/d13/bubble__sort_8cpp.js delete mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_a0fe4e431f3e09c274ecd7d2d58dcb865_cgraph.map delete mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_a0fe4e431f3e09c274ecd7d2d58dcb865_cgraph.md5 delete mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_a0fe4e431f3e09c274ecd7d2d58dcb865_cgraph.svg rename d8/d28/{classrange__queries_1_1per_seg_tree_af16c0c87b29119f066041d6e71ab50e0_cgraph.map => classrange__queries_1_1per_seg_tree_a24487eda25123bc4d112e8430821a6c6_cgraph.map} (91%) create mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_a24487eda25123bc4d112e8430821a6c6_cgraph.md5 rename d8/d28/{classrange__queries_1_1per_seg_tree_af16c0c87b29119f066041d6e71ab50e0_cgraph.svg => classrange__queries_1_1per_seg_tree_a24487eda25123bc4d112e8430821a6c6_cgraph.svg} (88%) create mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_a6d3f2465a7c5803a1ff16c5378bcc5e4_cgraph.map create mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_a6d3f2465a7c5803a1ff16c5378bcc5e4_cgraph.md5 create mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_a6d3f2465a7c5803a1ff16c5378bcc5e4_cgraph.svg delete mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_ac83bcabf5a8db8b0d8d156a4c1bcd4c3_cgraph.map delete mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_ac83bcabf5a8db8b0d8d156a4c1bcd4c3_cgraph.md5 delete mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_ac83bcabf5a8db8b0d8d156a4c1bcd4c3_cgraph.svg delete mode 100644 d8/d28/classrange__queries_1_1per_seg_tree_af16c0c87b29119f066041d6e71ab50e0_cgraph.md5 delete mode 100644 d8/d61/class_trie__coll__graph.map delete mode 100644 d8/d61/class_trie__coll__graph.md5 delete mode 100644 d8/d61/class_trie__coll__graph.svg delete mode 100644 d8/d61/radix__sort2_8cpp_a8df9406972cda58c209b30ebae295daa_cgraph.md5 rename d8/d61/{radix__sort2_8cpp_a302672a25ef4561eb41b4f9ef8e518b2_cgraph.map => radix__sort2_8cpp_a98ead7d43b11505398daf9a894f122f9_cgraph.map} (100%) rename d8/d61/{radix__sort2_8cpp_a302672a25ef4561eb41b4f9ef8e518b2_cgraph.md5 => radix__sort2_8cpp_a98ead7d43b11505398daf9a894f122f9_cgraph.md5} (100%) rename d8/d61/{radix__sort2_8cpp_a302672a25ef4561eb41b4f9ef8e518b2_cgraph.svg => radix__sort2_8cpp_a98ead7d43b11505398daf9a894f122f9_cgraph.svg} (97%) rename d8/d61/{radix__sort2_8cpp_a8df9406972cda58c209b30ebae295daa_cgraph.map => radix__sort2_8cpp_ae0cfd94fa3765b53d4ec7893ffaee5f8_cgraph.map} (93%) create mode 100644 d8/d61/radix__sort2_8cpp_ae0cfd94fa3765b53d4ec7893ffaee5f8_cgraph.md5 rename d8/d61/{radix__sort2_8cpp_a8df9406972cda58c209b30ebae295daa_cgraph.svg => radix__sort2_8cpp_ae0cfd94fa3765b53d4ec7893ffaee5f8_cgraph.svg} (97%) delete mode 100644 d8/d69/classgraph_1_1_h_k_graph_a3b49011c09cf90a116ab53bef61cd95a_cgraph.map delete mode 100644 d8/d69/classgraph_1_1_h_k_graph_a3b49011c09cf90a116ab53bef61cd95a_cgraph.md5 delete mode 100644 d8/d69/classgraph_1_1_h_k_graph_a3b49011c09cf90a116ab53bef61cd95a_cgraph.svg delete mode 100644 d8/d69/classgraph_1_1_h_k_graph_a7491add14d9fc04f679114ca6d6f0f93_cgraph.map delete mode 100644 d8/d69/classgraph_1_1_h_k_graph_a7491add14d9fc04f679114ca6d6f0f93_cgraph.md5 delete mode 100644 d8/d69/classgraph_1_1_h_k_graph_a7491add14d9fc04f679114ca6d6f0f93_cgraph.svg delete mode 100644 d8/d72/class_r_btree.js rename d8/d77/{namespacemachine__learning_acc6a28f40512dbda75ab1a3969248898_cgraph.map => namespacemachine__learning_a042f435bca0839e721fc1574a61e8da3_cgraph.map} (90%) create mode 100644 d8/d77/namespacemachine__learning_a042f435bca0839e721fc1574a61e8da3_cgraph.md5 rename d8/d77/{namespacemachine__learning_acc6a28f40512dbda75ab1a3969248898_cgraph.svg => namespacemachine__learning_a042f435bca0839e721fc1574a61e8da3_cgraph.svg} (97%) rename d8/d77/{namespacemachine__learning_acc6a28f40512dbda75ab1a3969248898_cgraph_org.svg => namespacemachine__learning_a042f435bca0839e721fc1574a61e8da3_cgraph_org.svg} (97%) delete mode 100644 d8/d77/namespacemachine__learning_a05b9445c6ab65053b9bf9897a96af82d_cgraph.md5 rename d8/d77/{namespacemachine__learning_a5f42063207181529413d812ade52f58e_cgraph.map => namespacemachine__learning_a0cc29566568e0383dd7d374068cbe6b3_cgraph.map} (92%) create mode 100644 d8/d77/namespacemachine__learning_a0cc29566568e0383dd7d374068cbe6b3_cgraph.md5 rename d8/d77/{namespacemachine__learning_a5f42063207181529413d812ade52f58e_cgraph.svg => namespacemachine__learning_a0cc29566568e0383dd7d374068cbe6b3_cgraph.svg} (97%) delete mode 100644 d8/d77/namespacemachine__learning_a1b42d24ad7bedbfa8e5b59fe96987a44_cgraph.md5 rename d8/d77/{namespacemachine__learning_a9225f0ded976096b45ffe13c75d33c05_cgraph.map => namespacemachine__learning_a2466857dab977a49f117029835b3b6d2_cgraph.map} (92%) create mode 100644 d8/d77/namespacemachine__learning_a2466857dab977a49f117029835b3b6d2_cgraph.md5 rename d8/d77/{namespacemachine__learning_a9225f0ded976096b45ffe13c75d33c05_cgraph.svg => namespacemachine__learning_a2466857dab977a49f117029835b3b6d2_cgraph.svg} (97%) rename d8/d77/{namespacemachine__learning_a1b42d24ad7bedbfa8e5b59fe96987a44_cgraph.map => namespacemachine__learning_a50480fccfb39de20ca47f1bf51ecb6ec_cgraph.map} (95%) create mode 100644 d8/d77/namespacemachine__learning_a50480fccfb39de20ca47f1bf51ecb6ec_cgraph.md5 rename d8/d77/{namespacemachine__learning_a1b42d24ad7bedbfa8e5b59fe96987a44_cgraph.svg => namespacemachine__learning_a50480fccfb39de20ca47f1bf51ecb6ec_cgraph.svg} (98%) rename d8/d77/{namespacemachine__learning_a7491744dcfc8844338d55065d0cd0c79_cgraph.map => namespacemachine__learning_a5342906d42b80fc6b6b3ad17bf00fcb9_cgraph.map} (92%) create mode 100644 d8/d77/namespacemachine__learning_a5342906d42b80fc6b6b3ad17bf00fcb9_cgraph.md5 rename d8/d77/{namespacemachine__learning_a7491744dcfc8844338d55065d0cd0c79_cgraph.svg => namespacemachine__learning_a5342906d42b80fc6b6b3ad17bf00fcb9_cgraph.svg} (97%) rename d8/d77/{namespacemachine__learning_a8e8b54aaa62ad7f906aec0756ca3a500_cgraph.map => namespacemachine__learning_a54bf1f3c43271a5fc93101f6ae2e6269_cgraph.map} (100%) rename d8/d77/{namespacemachine__learning_a8e8b54aaa62ad7f906aec0756ca3a500_cgraph.md5 => namespacemachine__learning_a54bf1f3c43271a5fc93101f6ae2e6269_cgraph.md5} (100%) rename d8/d77/{namespacemachine__learning_ad0302cde64c0479379be18286962f6df_cgraph.svg => namespacemachine__learning_a54bf1f3c43271a5fc93101f6ae2e6269_cgraph.svg} (97%) delete mode 100644 d8/d77/namespacemachine__learning_a5f42063207181529413d812ade52f58e_cgraph.md5 delete mode 100644 d8/d77/namespacemachine__learning_a6ef38e5947aef609f908bfbfeaf11d75_cgraph.md5 delete mode 100644 d8/d77/namespacemachine__learning_a7491744dcfc8844338d55065d0cd0c79_cgraph.md5 rename d8/d77/{namespacemachine__learning_ad0302cde64c0479379be18286962f6df_cgraph.map => namespacemachine__learning_a84260cb1be9b63d6e38107000ac4b7e7_cgraph.map} (100%) rename d8/d77/{namespacemachine__learning_ad0302cde64c0479379be18286962f6df_cgraph.md5 => namespacemachine__learning_a84260cb1be9b63d6e38107000ac4b7e7_cgraph.md5} (100%) rename d8/d77/{namespacemachine__learning_a8e8b54aaa62ad7f906aec0756ca3a500_cgraph.svg => namespacemachine__learning_a84260cb1be9b63d6e38107000ac4b7e7_cgraph.svg} (97%) rename d8/d77/{namespacemachine__learning_ac7d9b358f1ef2ba2a1d475a5452ec41f_cgraph.map => namespacemachine__learning_a89fde571b38f9483576594f66572958a_cgraph.map} (87%) create mode 100644 d8/d77/namespacemachine__learning_a89fde571b38f9483576594f66572958a_cgraph.md5 rename d8/d77/{namespacemachine__learning_ac7d9b358f1ef2ba2a1d475a5452ec41f_cgraph.svg => namespacemachine__learning_a89fde571b38f9483576594f66572958a_cgraph.svg} (95%) delete mode 100644 d8/d77/namespacemachine__learning_a9225f0ded976096b45ffe13c75d33c05_cgraph.md5 rename d8/d77/{namespacemachine__learning_a361674452869413536ee501f053129a8_cgraph.map => namespacemachine__learning_aa6aac06ccf128b0a9c55c9ee1a8e5631_cgraph.map} (100%) rename d8/d77/{namespacemachine__learning_a361674452869413536ee501f053129a8_cgraph.md5 => namespacemachine__learning_aa6aac06ccf128b0a9c55c9ee1a8e5631_cgraph.md5} (100%) rename d8/d77/{namespacemachine__learning_a361674452869413536ee501f053129a8_cgraph.svg => namespacemachine__learning_aa6aac06ccf128b0a9c55c9ee1a8e5631_cgraph.svg} (98%) rename d8/d77/{namespacemachine__learning_a1d577f5d95b774ae97eb6838852d0df5_cgraph.map => namespacemachine__learning_aa72a53c88203fde278f1fe6c3afe5b07_cgraph.map} (100%) rename d8/d77/{namespacemachine__learning_a1d577f5d95b774ae97eb6838852d0df5_cgraph.md5 => namespacemachine__learning_aa72a53c88203fde278f1fe6c3afe5b07_cgraph.md5} (100%) rename d8/d77/{namespacemachine__learning_a1d577f5d95b774ae97eb6838852d0df5_cgraph.svg => namespacemachine__learning_aa72a53c88203fde278f1fe6c3afe5b07_cgraph.svg} (97%) rename d8/d77/{namespacemachine__learning_a73ee7ed3546ab9e8792a92336d0d14ab_cgraph.map => namespacemachine__learning_abee7b35403af3612222d3b7a53074905_cgraph.map} (100%) rename d8/d77/{namespacemachine__learning_a73ee7ed3546ab9e8792a92336d0d14ab_cgraph.md5 => namespacemachine__learning_abee7b35403af3612222d3b7a53074905_cgraph.md5} (100%) rename d8/d77/{namespacemachine__learning_a73ee7ed3546ab9e8792a92336d0d14ab_cgraph.svg => namespacemachine__learning_abee7b35403af3612222d3b7a53074905_cgraph.svg} (97%) rename d8/d77/{namespacemachine__learning_a05b9445c6ab65053b9bf9897a96af82d_cgraph.map => namespacemachine__learning_ac332d152078e96311e43ac5e7183ea26_cgraph.map} (94%) create mode 100644 d8/d77/namespacemachine__learning_ac332d152078e96311e43ac5e7183ea26_cgraph.md5 rename d8/d77/{namespacemachine__learning_a05b9445c6ab65053b9bf9897a96af82d_cgraph.svg => namespacemachine__learning_ac332d152078e96311e43ac5e7183ea26_cgraph.svg} (97%) delete mode 100644 d8/d77/namespacemachine__learning_ac4010fe3a52a74e8b5b1aaadfe38b46f_cgraph.md5 rename d8/d77/{namespacemachine__learning_adc731720947b4bc2ab047c141e7d0299_cgraph.map => namespacemachine__learning_ac43d294e21a0c4fa33c53757df054576_cgraph.map} (90%) create mode 100644 d8/d77/namespacemachine__learning_ac43d294e21a0c4fa33c53757df054576_cgraph.md5 rename d8/d77/{namespacemachine__learning_adc731720947b4bc2ab047c141e7d0299_cgraph.svg => namespacemachine__learning_ac43d294e21a0c4fa33c53757df054576_cgraph.svg} (97%) rename d8/d77/{namespacemachine__learning_adc731720947b4bc2ab047c141e7d0299_cgraph_org.svg => namespacemachine__learning_ac43d294e21a0c4fa33c53757df054576_cgraph_org.svg} (97%) delete mode 100644 d8/d77/namespacemachine__learning_ac7d9b358f1ef2ba2a1d475a5452ec41f_cgraph.md5 rename d8/d77/{namespacemachine__learning_a6ef38e5947aef609f908bfbfeaf11d75_cgraph.map => namespacemachine__learning_acafa3e62b686aebdbad81c4f89913f43_cgraph.map} (92%) create mode 100644 d8/d77/namespacemachine__learning_acafa3e62b686aebdbad81c4f89913f43_cgraph.md5 rename d8/d77/{namespacemachine__learning_a6ef38e5947aef609f908bfbfeaf11d75_cgraph.svg => namespacemachine__learning_acafa3e62b686aebdbad81c4f89913f43_cgraph.svg} (97%) delete mode 100644 d8/d77/namespacemachine__learning_acc6a28f40512dbda75ab1a3969248898_cgraph.md5 delete mode 100644 d8/d77/namespacemachine__learning_adc731720947b4bc2ab047c141e7d0299_cgraph.md5 rename d8/d77/{namespacemachine__learning_ac4010fe3a52a74e8b5b1aaadfe38b46f_cgraph.map => namespacemachine__learning_ae868ad43698a1d69ba46ea3827d7d2c3_cgraph.map} (93%) create mode 100644 d8/d77/namespacemachine__learning_ae868ad43698a1d69ba46ea3827d7d2c3_cgraph.md5 rename d8/d77/{namespacemachine__learning_ac4010fe3a52a74e8b5b1aaadfe38b46f_cgraph.svg => namespacemachine__learning_ae868ad43698a1d69ba46ea3827d7d2c3_cgraph.svg} (97%) rename d8/d77/{namespacemachine__learning_a2a282c162e12f193c58232f26f0fa62d_cgraph.map => namespacemachine__learning_af4986b23760039711848155739c31b35_cgraph.map} (100%) rename d8/d77/{namespacemachine__learning_a2a282c162e12f193c58232f26f0fa62d_cgraph.md5 => namespacemachine__learning_af4986b23760039711848155739c31b35_cgraph.md5} (100%) rename d8/d77/{namespacemachine__learning_a2a282c162e12f193c58232f26f0fa62d_cgraph.svg => namespacemachine__learning_af4986b23760039711848155739c31b35_cgraph.svg} (96%) rename d8/d77/{namespacemachine__learning_a62a418f243cd52b49f59015dddff188e_cgraph.map => namespacemachine__learning_af801bf30591ca6b2c38ff4fed0ded23f_cgraph.map} (100%) rename d8/d77/{namespacemachine__learning_a62a418f243cd52b49f59015dddff188e_cgraph.md5 => namespacemachine__learning_af801bf30591ca6b2c38ff4fed0ded23f_cgraph.md5} (100%) rename d8/d77/{namespacemachine__learning_a62a418f243cd52b49f59015dddff188e_cgraph.svg => namespacemachine__learning_af801bf30591ca6b2c38ff4fed0ded23f_cgraph.svg} (99%) delete mode 100644 d8/da6/classothers_1_1lru__cache_1_1_l_r_u_cache__coll__graph.map delete mode 100644 d8/da6/classothers_1_1lru__cache_1_1_l_r_u_cache__coll__graph.md5 delete mode 100644 d8/da6/classothers_1_1lru__cache_1_1_l_r_u_cache__coll__graph.svg delete mode 100644 d8/da6/classothers_1_1lru__cache_1_1_l_r_u_cache__coll__graph_org.svg rename d8/ddf/{sieve__of__eratosthenes_8cpp_a60fa6579eab0db3c1c0ab1bf6d651be3_cgraph.map => sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.map} (100%) rename d8/ddf/{sieve__of__eratosthenes_8cpp_a60fa6579eab0db3c1c0ab1bf6d651be3_cgraph.md5 => sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.md5} (100%) rename d8/ddf/{sieve__of__eratosthenes_8cpp_a60fa6579eab0db3c1c0ab1bf6d651be3_cgraph.svg => sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.svg} (96%) create mode 100644 d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.map create mode 100644 d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.md5 create mode 100644 d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.svg rename d9/d03/{namespacestring__search_aa422aab133d4ed5e5d6022a7f701271f_cgraph.map => namespacestring__search_a996573527312d5255e1495b879e8a34f_cgraph.map} (100%) rename d9/d03/{namespacestring__search_aa422aab133d4ed5e5d6022a7f701271f_cgraph.md5 => namespacestring__search_a996573527312d5255e1495b879e8a34f_cgraph.md5} (100%) rename d9/d03/{namespacestring__search_aa422aab133d4ed5e5d6022a7f701271f_cgraph.svg => namespacestring__search_a996573527312d5255e1495b879e8a34f_cgraph.svg} (96%) rename d9/d49/{kohonen__som__trace_8cpp_a412b7afa156306b1f8788643c91a1c60_cgraph.map => kohonen__som__trace_8cpp_a53082f2e5bacec40266499da4547309a_cgraph.map} (100%) rename d9/d49/{kohonen__som__trace_8cpp_a412b7afa156306b1f8788643c91a1c60_cgraph.md5 => kohonen__som__trace_8cpp_a53082f2e5bacec40266499da4547309a_cgraph.md5} (100%) rename d9/d49/{kohonen__som__trace_8cpp_a412b7afa156306b1f8788643c91a1c60_cgraph.svg => kohonen__som__trace_8cpp_a53082f2e5bacec40266499da4547309a_cgraph.svg} (97%) rename d9/d49/{kohonen__som__trace_8cpp_a9ab8c79ffb674a63f151f282faeb723b_cgraph.map => kohonen__som__trace_8cpp_a7154fe319e6033485a8a6cd6f0d8932d_cgraph.map} (100%) rename d9/d49/{kohonen__som__trace_8cpp_a9ab8c79ffb674a63f151f282faeb723b_cgraph.md5 => kohonen__som__trace_8cpp_a7154fe319e6033485a8a6cd6f0d8932d_cgraph.md5} (100%) rename d9/d49/{kohonen__som__trace_8cpp_a9ab8c79ffb674a63f151f282faeb723b_cgraph.svg => kohonen__som__trace_8cpp_a7154fe319e6033485a8a6cd6f0d8932d_cgraph.svg} (97%) rename d9/d49/{kohonen__som__trace_8cpp_ab47fb569e63648bd76e7edfdacc02dbd_cgraph.map => kohonen__som__trace_8cpp_ae571600aa42a81bc14a4a602ea5ff00d_cgraph.map} (100%) rename d9/d49/{kohonen__som__trace_8cpp_ab47fb569e63648bd76e7edfdacc02dbd_cgraph.md5 => kohonen__som__trace_8cpp_ae571600aa42a81bc14a4a602ea5ff00d_cgraph.md5} (100%) rename d9/d49/{kohonen__som__trace_8cpp_ab47fb569e63648bd76e7edfdacc02dbd_cgraph.svg => kohonen__som__trace_8cpp_ae571600aa42a81bc14a4a602ea5ff00d_cgraph.svg} (97%) delete mode 100644 d9/d49/structdata__structures_1_1_node_a54a6777e72b639c3ee6446a541db8e78_cgraph.map delete mode 100644 d9/d49/structdata__structures_1_1_node_a54a6777e72b639c3ee6446a541db8e78_cgraph.md5 delete mode 100644 d9/d49/structdata__structures_1_1_node_a54a6777e72b639c3ee6446a541db8e78_cgraph.svg delete mode 100644 d9/d5a/structgeometry_1_1jarvis_1_1_point.js create mode 100644 d9/d5d/extended__euclid__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d9/d5d/extended__euclid__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d9/d5d/extended__euclid__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg rename d9/d66/{group__machine__learning_gab53c14440b2b2dd3172c66afc5c2f63f_cgraph.map => group__machine__learning_ga60f9186ccb682724a8792a2bf81e9b9e_cgraph.map} (100%) rename d9/d66/{group__machine__learning_gab53c14440b2b2dd3172c66afc5c2f63f_cgraph.md5 => group__machine__learning_ga60f9186ccb682724a8792a2bf81e9b9e_cgraph.md5} (100%) rename d9/d66/{group__machine__learning_gab53c14440b2b2dd3172c66afc5c2f63f_cgraph.svg => group__machine__learning_ga60f9186ccb682724a8792a2bf81e9b9e_cgraph.svg} (98%) rename d9/d66/{group__machine__learning_ga6c606bc85a3e9fd9d010f874ad760336_cgraph.map => group__machine__learning_gabc90175770bf0d5853c466e14993a08c_cgraph.map} (100%) rename d9/d66/{group__machine__learning_ga6c606bc85a3e9fd9d010f874ad760336_cgraph.md5 => group__machine__learning_gabc90175770bf0d5853c466e14993a08c_cgraph.md5} (100%) rename d9/d66/{group__machine__learning_ga6c606bc85a3e9fd9d010f874ad760336_cgraph.svg => group__machine__learning_gabc90175770bf0d5853c466e14993a08c_cgraph.svg} (98%) rename d9/d66/{group__machine__learning_ga72699c805c19a6cc47a937a6f3378afa_cgraph.map => group__machine__learning_gae0208548f8b393528e5db01717e88e67_cgraph.map} (100%) rename d9/d66/{group__machine__learning_ga72699c805c19a6cc47a937a6f3378afa_cgraph.md5 => group__machine__learning_gae0208548f8b393528e5db01717e88e67_cgraph.md5} (100%) rename d9/d66/{group__machine__learning_ga72699c805c19a6cc47a937a6f3378afa_cgraph.svg => group__machine__learning_gae0208548f8b393528e5db01717e88e67_cgraph.svg} (98%) create mode 100644 d9/d89/fibonacci_8cpp_aaf94f3212385cff0a5f19ff6b0cce8e7_cgraph.map create mode 100644 d9/d89/fibonacci_8cpp_aaf94f3212385cff0a5f19ff6b0cce8e7_cgraph.md5 create mode 100644 d9/d89/fibonacci_8cpp_aaf94f3212385cff0a5f19ff6b0cce8e7_cgraph.svg create mode 100644 d9/d89/fibonacci_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d9/d89/fibonacci_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d9/d89/fibonacci_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg delete mode 100644 d9/d90/struct_btree.js delete mode 100644 d9/da4/class_fenwick_tree__coll__graph.map delete mode 100644 d9/da4/class_fenwick_tree__coll__graph.md5 delete mode 100644 d9/da4/class_fenwick_tree__coll__graph.svg delete mode 100644 d9/dde/classbinary__search__tree_a06a863442c165503ac189f7b47599ec8_cgraph.md5 rename d9/dde/{classbinary__search__tree_a06a863442c165503ac189f7b47599ec8_cgraph.map => classbinary__search__tree_a1f23830316204664514f396a4eb5275a_cgraph.map} (83%) create mode 100644 d9/dde/classbinary__search__tree_a1f23830316204664514f396a4eb5275a_cgraph.md5 rename d9/dde/{classbinary__search__tree_a06a863442c165503ac189f7b47599ec8_cgraph.svg => classbinary__search__tree_a1f23830316204664514f396a4eb5275a_cgraph.svg} (75%) create mode 100644 d9/dde/classbinary__search__tree_a2fcf37549bd002c174a45b0b4203c2bd_cgraph.map create mode 100644 d9/dde/classbinary__search__tree_a2fcf37549bd002c174a45b0b4203c2bd_cgraph.md5 create mode 100644 d9/dde/classbinary__search__tree_a2fcf37549bd002c174a45b0b4203c2bd_cgraph.svg delete mode 100644 d9/dde/classbinary__search__tree_a53d1bf8e5ef0a952d2817f3cd22546c7_cgraph.md5 rename d9/dde/{classbinary__search__tree_a53d1bf8e5ef0a952d2817f3cd22546c7_cgraph.map => classbinary__search__tree_a5764c1cf848f84a5b77462036a6d8c13_cgraph.map} (82%) create mode 100644 d9/dde/classbinary__search__tree_a5764c1cf848f84a5b77462036a6d8c13_cgraph.md5 rename d9/dde/{classbinary__search__tree_a53d1bf8e5ef0a952d2817f3cd22546c7_cgraph.svg => classbinary__search__tree_a5764c1cf848f84a5b77462036a6d8c13_cgraph.svg} (75%) rename d9/dde/{classbinary__search__tree_a70030b0d7990c6fd450256d27b8f6c7b_cgraph.map => classbinary__search__tree_a5c011e1b0863d79c3a7c11a0426bdcff_cgraph.map} (82%) create mode 100644 d9/dde/classbinary__search__tree_a5c011e1b0863d79c3a7c11a0426bdcff_cgraph.md5 rename d9/dde/{classbinary__search__tree_a70030b0d7990c6fd450256d27b8f6c7b_cgraph.svg => classbinary__search__tree_a5c011e1b0863d79c3a7c11a0426bdcff_cgraph.svg} (75%) delete mode 100644 d9/dde/classbinary__search__tree_a70030b0d7990c6fd450256d27b8f6c7b_cgraph.md5 create mode 100644 d9/dde/classbinary__search__tree_a75f897af6aa732a9901454401c869bcb_cgraph.map create mode 100644 d9/dde/classbinary__search__tree_a75f897af6aa732a9901454401c869bcb_cgraph.md5 create mode 100644 d9/dde/classbinary__search__tree_a75f897af6aa732a9901454401c869bcb_cgraph.svg create mode 100644 d9/dde/classbinary__search__tree_a87c0a35845d27e0f6fc1f4eaa0333362_cgraph.map create mode 100644 d9/dde/classbinary__search__tree_a87c0a35845d27e0f6fc1f4eaa0333362_cgraph.md5 create mode 100644 d9/dde/classbinary__search__tree_a87c0a35845d27e0f6fc1f4eaa0333362_cgraph.svg create mode 100644 d9/dde/classbinary__search__tree_a9d1e7e10efa74d741bf48cf032df3778_cgraph.map create mode 100644 d9/dde/classbinary__search__tree_a9d1e7e10efa74d741bf48cf032df3778_cgraph.md5 create mode 100644 d9/dde/classbinary__search__tree_a9d1e7e10efa74d741bf48cf032df3778_cgraph.svg create mode 100644 d9/dde/classbinary__search__tree_aa4f84b2eec9b9201af1840868ddb5fb2_cgraph.map create mode 100644 d9/dde/classbinary__search__tree_aa4f84b2eec9b9201af1840868ddb5fb2_cgraph.md5 create mode 100644 d9/dde/classbinary__search__tree_aa4f84b2eec9b9201af1840868ddb5fb2_cgraph.svg create mode 100644 d9/dde/classbinary__search__tree_ab81edd415324d372632c42dc7dbcb9e1_cgraph.map create mode 100644 d9/dde/classbinary__search__tree_ab81edd415324d372632c42dc7dbcb9e1_cgraph.md5 create mode 100644 d9/dde/classbinary__search__tree_ab81edd415324d372632c42dc7dbcb9e1_cgraph.svg create mode 100644 d9/dde/classbinary__search__tree_af9a2c7c187a7ca3142c77ce342ef3153_cgraph.map create mode 100644 d9/dde/classbinary__search__tree_af9a2c7c187a7ca3142c77ce342ef3153_cgraph.md5 create mode 100644 d9/dde/classbinary__search__tree_af9a2c7c187a7ca3142c77ce342ef3153_cgraph.svg delete mode 100644 d9/dee/classdouble__linked__list.js rename da/d02/{classmachine__learning_1_1aystar__search_1_1_ay_star_search_afaeb1cde711f5198dc3dd213dedbd726_cgraph.map => classmachine__learning_1_1aystar__search_1_1_ay_star_search_a0a26aa9ad3d73707370d9fe83707aca4_cgraph.map} (100%) rename da/d02/{classmachine__learning_1_1aystar__search_1_1_ay_star_search_afaeb1cde711f5198dc3dd213dedbd726_cgraph.md5 => classmachine__learning_1_1aystar__search_1_1_ay_star_search_a0a26aa9ad3d73707370d9fe83707aca4_cgraph.md5} (100%) rename da/d02/{classmachine__learning_1_1aystar__search_1_1_ay_star_search_afaeb1cde711f5198dc3dd213dedbd726_cgraph.svg => classmachine__learning_1_1aystar__search_1_1_ay_star_search_a0a26aa9ad3d73707370d9fe83707aca4_cgraph.svg} (97%) rename da/d02/{classmachine__learning_1_1aystar__search_1_1_ay_star_search_a5bb772fd41005fdefa8bd32edbf00cc3_cgraph.map => classmachine__learning_1_1aystar__search_1_1_ay_star_search_a48284e156fdd48fd0c41008c7e48f201_cgraph.map} (82%) create mode 100644 da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search_a48284e156fdd48fd0c41008c7e48f201_cgraph.md5 rename da/d02/{classmachine__learning_1_1aystar__search_1_1_ay_star_search_a5bb772fd41005fdefa8bd32edbf00cc3_cgraph.svg => classmachine__learning_1_1aystar__search_1_1_ay_star_search_a48284e156fdd48fd0c41008c7e48f201_cgraph.svg} (77%) delete mode 100644 da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search_a5bb772fd41005fdefa8bd32edbf00cc3_cgraph.md5 create mode 100644 da/d23/eulers__totient__function_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map create mode 100644 da/d23/eulers__totient__function_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 create mode 100644 da/d23/eulers__totient__function_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg create mode 100644 da/d24/sqrt__double_8cpp_ae662282ad0740d2063ac404ca3bd74fc_cgraph.map create mode 100644 da/d24/sqrt__double_8cpp_ae662282ad0740d2063ac404ca3bd74fc_cgraph.md5 create mode 100644 da/d24/sqrt__double_8cpp_ae662282ad0740d2063ac404ca3bd74fc_cgraph.svg delete mode 100644 da/d32/classdata__structures_1_1trie__using__hashmap_1_1_trie__coll__graph.map delete mode 100644 da/d32/classdata__structures_1_1trie__using__hashmap_1_1_trie__coll__graph.md5 delete mode 100644 da/d32/classdata__structures_1_1trie__using__hashmap_1_1_trie__coll__graph.svg rename da/d4b/{depth__first__search__with__stack_8cpp_ae198aeaad22ccd56712b7380bd62f777_cgraph.map => depth__first__search__with__stack_8cpp_a5738da9f508f6a9e87f123c9fb6f2ea9_cgraph.map} (100%) rename da/d4b/{depth__first__search__with__stack_8cpp_ae198aeaad22ccd56712b7380bd62f777_cgraph.md5 => depth__first__search__with__stack_8cpp_a5738da9f508f6a9e87f123c9fb6f2ea9_cgraph.md5} (100%) rename da/d4b/{depth__first__search__with__stack_8cpp_ae198aeaad22ccd56712b7380bd62f777_cgraph.svg => depth__first__search__with__stack_8cpp_a5738da9f508f6a9e87f123c9fb6f2ea9_cgraph.svg} (99%) create mode 100644 da/d5a/class_complex_a4ac9f529d54cacf2969f2c7179b4c4ac_cgraph.map create mode 100644 da/d5a/class_complex_a4ac9f529d54cacf2969f2c7179b4c4ac_cgraph.md5 create mode 100644 da/d5a/class_complex_a4ac9f529d54cacf2969f2c7179b4c4ac_cgraph.svg rename da/d70/{structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info_aea763e487cf100668d4eff160e40c3fa_cgraph.map => structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info_ad3993dbca9c5b3ef9ac361dc7f62ce57_cgraph.map} (100%) rename da/d70/{structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info_aea763e487cf100668d4eff160e40c3fa_cgraph.md5 => structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info_ad3993dbca9c5b3ef9ac361dc7f62ce57_cgraph.md5} (100%) rename da/d70/{structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info_aea763e487cf100668d4eff160e40c3fa_cgraph.svg => structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info_ad3993dbca9c5b3ef9ac361dc7f62ce57_cgraph.svg} (97%) delete mode 100644 da/dd3/classmachine__learning_1_1adaline__coll__graph.map delete mode 100644 da/dd3/classmachine__learning_1_1adaline__coll__graph.md5 delete mode 100644 da/dd3/classmachine__learning_1_1adaline__coll__graph.svg create mode 100644 da/dd3/namespacespirograph_a8e83a64e8443fff1e5ffdc1c299c1e99_cgraph.map create mode 100644 da/dd3/namespacespirograph_a8e83a64e8443fff1e5ffdc1c299c1e99_cgraph.md5 create mode 100644 da/dd3/namespacespirograph_a8e83a64e8443fff1e5ffdc1c299c1e99_cgraph.svg rename da/df2/{durand__kerner__roots_8cpp_ac38b9cfd2a39d856e0feba3b5d241ded_cgraph.map => durand__kerner__roots_8cpp_a2c35b320ace8677f9b331faf94f8b2fd_cgraph.map} (94%) create mode 100644 da/df2/durand__kerner__roots_8cpp_a2c35b320ace8677f9b331faf94f8b2fd_cgraph.md5 rename da/df2/{durand__kerner__roots_8cpp_ac38b9cfd2a39d856e0feba3b5d241ded_cgraph.svg => durand__kerner__roots_8cpp_a2c35b320ace8677f9b331faf94f8b2fd_cgraph.svg} (98%) delete mode 100644 da/df2/durand__kerner__roots_8cpp_ac38b9cfd2a39d856e0feba3b5d241ded_cgraph.md5 rename da/df2/{durand__kerner__roots_8cpp_a51637ff89e55ca749993d3e84b95d153_cgraph.map => durand__kerner__roots_8cpp_ae2ab49ba1969d7a5988f9bc2c8924569_cgraph.map} (100%) rename da/df2/{durand__kerner__roots_8cpp_a51637ff89e55ca749993d3e84b95d153_cgraph.md5 => durand__kerner__roots_8cpp_ae2ab49ba1969d7a5988f9bc2c8924569_cgraph.md5} (100%) rename da/df2/{durand__kerner__roots_8cpp_a51637ff89e55ca749993d3e84b95d153_cgraph.svg => durand__kerner__roots_8cpp_ae2ab49ba1969d7a5988f9bc2c8924569_cgraph.svg} (98%) create mode 100644 db/d01/brent__method__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map create mode 100644 db/d01/brent__method__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 create mode 100644 db/d01/brent__method__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg create mode 100644 db/d01/brent__method__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map create mode 100644 db/d01/brent__method__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 create mode 100644 db/d01/brent__method__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg create mode 100644 db/d01/brent__method__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.map create mode 100644 db/d01/brent__method__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 create mode 100644 db/d01/brent__method__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg delete mode 100644 db/d0d/prime__factorization_8cpp_affe577b9bce8f604f5e2f861c63c7099_cgraph.map delete mode 100644 db/d0d/prime__factorization_8cpp_affe577b9bce8f604f5e2f861c63c7099_cgraph.md5 delete mode 100644 db/d0d/prime__factorization_8cpp_affe577b9bce8f604f5e2f861c63c7099_cgraph.svg delete mode 100644 db/d0f/classdata__structures_1_1queue__using__array_1_1_queue___array__coll__graph.map delete mode 100644 db/d0f/classdata__structures_1_1queue__using__array_1_1_queue___array__coll__graph.md5 delete mode 100644 db/d0f/classdata__structures_1_1queue__using__array_1_1_queue___array__coll__graph.svg rename db/d27/{n__bonacci_8cpp_a767bc5427e0ebaf88ab5a7572a7d852e_cgraph.map => n__bonacci_8cpp_a6849b68f760be628d5975ab3eddec63d_cgraph.map} (100%) rename db/d27/{n__bonacci_8cpp_a767bc5427e0ebaf88ab5a7572a7d852e_cgraph.md5 => n__bonacci_8cpp_a6849b68f760be628d5975ab3eddec63d_cgraph.md5} (100%) rename db/d27/{n__bonacci_8cpp_a767bc5427e0ebaf88ab5a7572a7d852e_cgraph.svg => n__bonacci_8cpp_a6849b68f760be628d5975ab3eddec63d_cgraph.svg} (96%) delete mode 100644 db/d29/classgeometry_1_1jarvis_1_1_convexhull__coll__graph.map delete mode 100644 db/d29/classgeometry_1_1jarvis_1_1_convexhull__coll__graph.md5 delete mode 100644 db/d29/classgeometry_1_1jarvis_1_1_convexhull__coll__graph.svg rename db/d3f/{wave__sort_8cpp_aa3e61ec7fbcf7f9b52de306e6dd6a41c_cgraph.map => wave__sort_8cpp_a7d4f243b9dc13ace4ef77e30dbc56f12_cgraph.map} (100%) rename db/d3f/{wave__sort_8cpp_aa3e61ec7fbcf7f9b52de306e6dd6a41c_cgraph.md5 => wave__sort_8cpp_a7d4f243b9dc13ace4ef77e30dbc56f12_cgraph.md5} (100%) rename db/d3f/{wave__sort_8cpp_aa3e61ec7fbcf7f9b52de306e6dd6a41c_cgraph.svg => wave__sort_8cpp_a7d4f243b9dc13ace4ef77e30dbc56f12_cgraph.svg} (98%) delete mode 100644 db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.map delete mode 100644 db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.md5 delete mode 100644 db/d66/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p__coll__graph.svg delete mode 100644 db/d66/struct_item.js delete mode 100644 db/d82/classlarge__number_a10119a83839e65962621b73df46a5337_cgraph.map delete mode 100644 db/d82/classlarge__number_a10119a83839e65962621b73df46a5337_cgraph.md5 delete mode 100644 db/d82/classlarge__number_a10119a83839e65962621b73df46a5337_cgraph.svg delete mode 100644 db/d82/classlarge__number_a60c436d1a1c5e3795d6177d3815ad615_cgraph.map delete mode 100644 db/d82/classlarge__number_a60c436d1a1c5e3795d6177d3815ad615_cgraph.md5 delete mode 100644 db/d82/classlarge__number_a60c436d1a1c5e3795d6177d3815ad615_cgraph.svg rename db/d82/{classlarge__number_ab1af3e0f425cdf7ea2039c9dcfe22f0b_cgraph.map => classlarge__number_a771e9b28cfddf1ad94668566e396e350_cgraph.map} (53%) create mode 100644 db/d82/classlarge__number_a771e9b28cfddf1ad94668566e396e350_cgraph.md5 rename db/d82/{classlarge__number_ab1af3e0f425cdf7ea2039c9dcfe22f0b_cgraph_org.svg => classlarge__number_a771e9b28cfddf1ad94668566e396e350_cgraph.svg} (60%) rename db/d82/{classlarge__number_ac27b399ed872731758ec33ebb102730e_cgraph.map => classlarge__number_aab5644405094740e34983cedfecb36cf_cgraph.map} (55%) create mode 100644 db/d82/classlarge__number_aab5644405094740e34983cedfecb36cf_cgraph.md5 rename db/d82/{classlarge__number_ac27b399ed872731758ec33ebb102730e_cgraph.svg => classlarge__number_aab5644405094740e34983cedfecb36cf_cgraph.svg} (61%) delete mode 100644 db/d82/classlarge__number_ab1af3e0f425cdf7ea2039c9dcfe22f0b_cgraph.md5 delete mode 100644 db/d82/classlarge__number_ab1af3e0f425cdf7ea2039c9dcfe22f0b_cgraph.svg delete mode 100644 db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.map delete mode 100644 db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.md5 delete mode 100644 db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.svg delete mode 100644 db/d82/classlarge__number_ac27b399ed872731758ec33ebb102730e_cgraph.md5 delete mode 100644 db/d8b/struct_node.js rename db/d9a/{classuint128__t_a59e50792c542a57392f9edd99b567845_cgraph.map => classuint128__t_a279209a184db20a7ffc8e687fdb05be2_cgraph.map} (87%) create mode 100644 db/d9a/classuint128__t_a279209a184db20a7ffc8e687fdb05be2_cgraph.md5 rename db/d9a/{classuint128__t_a59e50792c542a57392f9edd99b567845_cgraph.svg => classuint128__t_a279209a184db20a7ffc8e687fdb05be2_cgraph.svg} (95%) rename db/d9a/{classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.map => classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.map} (87%) create mode 100644 db/d9a/classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.md5 rename db/d9a/{classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.svg => classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.svg} (95%) delete mode 100644 db/d9a/classuint128__t_a59e50792c542a57392f9edd99b567845_cgraph.md5 delete mode 100644 db/d9a/classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.md5 rename db/d9a/{classuint128__t_ab044d69154b2eedc2874ad67886bd009_cgraph.map => classuint128__t_a8bf81f7f5f5c98f197822ec88e106c6c_cgraph.map} (100%) rename db/d9a/{classuint128__t_ab044d69154b2eedc2874ad67886bd009_cgraph.md5 => classuint128__t_a8bf81f7f5f5c98f197822ec88e106c6c_cgraph.md5} (100%) rename db/d9a/{classuint128__t_ab044d69154b2eedc2874ad67886bd009_cgraph.svg => classuint128__t_a8bf81f7f5f5c98f197822ec88e106c6c_cgraph.svg} (96%) rename db/d9a/{classuint128__t_af5eddcc1c4c1e19fc5bd4341842340f6_cgraph.map => classuint128__t_abae08ef3c1d6dc512edd68ca68327f74_cgraph.map} (100%) rename db/d9a/{classuint128__t_af5eddcc1c4c1e19fc5bd4341842340f6_cgraph.md5 => classuint128__t_abae08ef3c1d6dc512edd68ca68327f74_cgraph.md5} (100%) rename db/d9a/{classuint128__t_af5eddcc1c4c1e19fc5bd4341842340f6_cgraph.svg => classuint128__t_abae08ef3c1d6dc512edd68ca68327f74_cgraph.svg} (97%) create mode 100644 db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.map create mode 100644 db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 create mode 100644 db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg create mode 100644 db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph_org.svg delete mode 100644 db/ddb/classhash__chain__coll__graph.map delete mode 100644 db/ddb/classhash__chain__coll__graph.md5 delete mode 100644 db/ddb/classhash__chain__coll__graph.svg rename dc/d38/{ordinary__least__squares__regressor_8cpp_a67249e31221231cf3aaf3cfd870372d0_cgraph.map => ordinary__least__squares__regressor_8cpp_a01e6c7bf2b09272578b9c5819ce0f36f_cgraph.map} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a67249e31221231cf3aaf3cfd870372d0_cgraph.md5 => ordinary__least__squares__regressor_8cpp_a01e6c7bf2b09272578b9c5819ce0f36f_cgraph.md5} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a67249e31221231cf3aaf3cfd870372d0_cgraph.svg => ordinary__least__squares__regressor_8cpp_a01e6c7bf2b09272578b9c5819ce0f36f_cgraph.svg} (97%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a9b2b5da35a6ba8ae203c33739ef0b91d_cgraph.map => ordinary__least__squares__regressor_8cpp_a207b3a99fd5974d3117e0b0ac0aad234_cgraph.map} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a9b2b5da35a6ba8ae203c33739ef0b91d_cgraph.md5 => ordinary__least__squares__regressor_8cpp_a207b3a99fd5974d3117e0b0ac0aad234_cgraph.md5} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_aecef32c2a4f39a3f7398949256d180a6_cgraph.svg => ordinary__least__squares__regressor_8cpp_a207b3a99fd5974d3117e0b0ac0aad234_cgraph.svg} (96%) delete mode 100644 dc/d38/ordinary__least__squares__regressor_8cpp_a38ff1d954e9b7de93eb20e2dd101a045_cgraph.md5 rename dc/d38/{ordinary__least__squares__regressor_8cpp_aecef32c2a4f39a3f7398949256d180a6_cgraph.map => ordinary__least__squares__regressor_8cpp_a42535e20e97d85aa61271e0894cc0359_cgraph.map} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_aecef32c2a4f39a3f7398949256d180a6_cgraph.md5 => ordinary__least__squares__regressor_8cpp_a42535e20e97d85aa61271e0894cc0359_cgraph.md5} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a9b2b5da35a6ba8ae203c33739ef0b91d_cgraph.svg => ordinary__least__squares__regressor_8cpp_a42535e20e97d85aa61271e0894cc0359_cgraph.svg} (96%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a31be3fe36e76b87d5616ff8e7918cd24_cgraph.map => ordinary__least__squares__regressor_8cpp_a4a6a560dbdd0177633783b72db37dc19_cgraph.map} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a31be3fe36e76b87d5616ff8e7918cd24_cgraph.md5 => ordinary__least__squares__regressor_8cpp_a4a6a560dbdd0177633783b72db37dc19_cgraph.md5} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a31be3fe36e76b87d5616ff8e7918cd24_cgraph.svg => ordinary__least__squares__regressor_8cpp_a4a6a560dbdd0177633783b72db37dc19_cgraph.svg} (97%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a98eb5807f21b783c341cab402ced6732_cgraph.map => ordinary__least__squares__regressor_8cpp_a7075a0fccad9b2d79be0275bfe8948d4_cgraph.map} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a98eb5807f21b783c341cab402ced6732_cgraph.md5 => ordinary__least__squares__regressor_8cpp_a7075a0fccad9b2d79be0275bfe8948d4_cgraph.md5} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a98eb5807f21b783c341cab402ced6732_cgraph.svg => ordinary__least__squares__regressor_8cpp_a7075a0fccad9b2d79be0275bfe8948d4_cgraph.svg} (98%) delete mode 100644 dc/d38/ordinary__least__squares__regressor_8cpp_a98ab8f75d981088369b89b8be2182483_cgraph.md5 rename dc/d38/{ordinary__least__squares__regressor_8cpp_a38ff1d954e9b7de93eb20e2dd101a045_cgraph.map => ordinary__least__squares__regressor_8cpp_aaddc683af581b51351e1023d2a01ef3b_cgraph.map} (84%) create mode 100644 dc/d38/ordinary__least__squares__regressor_8cpp_aaddc683af581b51351e1023d2a01ef3b_cgraph.md5 rename dc/d38/{ordinary__least__squares__regressor_8cpp_a38ff1d954e9b7de93eb20e2dd101a045_cgraph.svg => ordinary__least__squares__regressor_8cpp_aaddc683af581b51351e1023d2a01ef3b_cgraph.svg} (95%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_aa799b4cec1681219887d89d037cfab50_cgraph.map => ordinary__least__squares__regressor_8cpp_ab1ad727903d7817c2758d25bcb52cbc8_cgraph.map} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_aa799b4cec1681219887d89d037cfab50_cgraph.md5 => ordinary__least__squares__regressor_8cpp_ab1ad727903d7817c2758d25bcb52cbc8_cgraph.md5} (100%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_aa799b4cec1681219887d89d037cfab50_cgraph.svg => ordinary__least__squares__regressor_8cpp_ab1ad727903d7817c2758d25bcb52cbc8_cgraph.svg} (98%) rename dc/d38/{ordinary__least__squares__regressor_8cpp_a98ab8f75d981088369b89b8be2182483_cgraph.map => ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.map} (86%) create mode 100644 dc/d38/ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.md5 rename dc/d38/{ordinary__least__squares__regressor_8cpp_a98ab8f75d981088369b89b8be2182483_cgraph.svg => ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.svg} (94%) rename dc/d61/{classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.map => classgraph_1_1_graph_a3755ec9e6a842238c7f4aac10b661981_cgraph.map} (100%) rename dc/d61/{classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.md5 => classgraph_1_1_graph_a3755ec9e6a842238c7f4aac10b661981_cgraph.md5} (100%) rename dc/d61/{classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.svg => classgraph_1_1_graph_a3755ec9e6a842238c7f4aac10b661981_cgraph.svg} (98%) delete mode 100644 dc/d61/classgraph_1_1_graph_a8839fa14bff19d2deab4a618447c13e5_cgraph.map delete mode 100644 dc/d61/classgraph_1_1_graph_a8839fa14bff19d2deab4a618447c13e5_cgraph.md5 delete mode 100644 dc/d61/classgraph_1_1_graph_a8839fa14bff19d2deab4a618447c13e5_cgraph.svg delete mode 100644 dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.map delete mode 100644 dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.md5 delete mode 100644 dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.svg rename dc/d93/{classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a35ab6f1b2840f89a858ca36b78739b69_cgraph.map => classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_af136ec31dbd35b1be2eb9a057677c704_cgraph.map} (100%) rename dc/d93/{classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a35ab6f1b2840f89a858ca36b78739b69_cgraph.md5 => classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_af136ec31dbd35b1be2eb9a057677c704_cgraph.md5} (100%) rename dc/d93/{classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a35ab6f1b2840f89a858ca36b78739b69_cgraph.svg => classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_af136ec31dbd35b1be2eb9a057677c704_cgraph.svg} (97%) delete mode 100644 dc/db5/struct_queue.js delete mode 100644 dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph_org.svg rename dc/dd9/{strand__sort_8cpp_ad75dc6a599ecfe31dadfaf449ee565f6_cgraph.map => strand__sort_8cpp_a2bea2fe5dd38ed63610fdeaddf5785cd_cgraph.map} (100%) rename dc/dd9/{strand__sort_8cpp_ad75dc6a599ecfe31dadfaf449ee565f6_cgraph.md5 => strand__sort_8cpp_a2bea2fe5dd38ed63610fdeaddf5785cd_cgraph.md5} (100%) rename dc/dd9/{strand__sort_8cpp_ad75dc6a599ecfe31dadfaf449ee565f6_cgraph.svg => strand__sort_8cpp_a2bea2fe5dd38ed63610fdeaddf5785cd_cgraph.svg} (99%) delete mode 100644 dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.map delete mode 100644 dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.md5 delete mode 100644 dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.svg create mode 100644 dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.map create mode 100644 dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.md5 create mode 100644 dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.svg rename dd/d0c/{hamiltons__cycle_8cpp_a0ceb473236b5dc53a85e281ef528dd96_cgraph.map => hamiltons__cycle_8cpp_abcf824e347eecfeeb69ea0280f34f3e4_cgraph.map} (100%) rename dd/d0c/{hamiltons__cycle_8cpp_a0ceb473236b5dc53a85e281ef528dd96_cgraph.md5 => hamiltons__cycle_8cpp_abcf824e347eecfeeb69ea0280f34f3e4_cgraph.md5} (100%) rename dd/d0c/{hamiltons__cycle_8cpp_a0ceb473236b5dc53a85e281ef528dd96_cgraph.svg => hamiltons__cycle_8cpp_abcf824e347eecfeeb69ea0280f34f3e4_cgraph.svg} (97%) delete mode 100644 dd/d1b/structquery.js create mode 100644 dd/d1c/classhash__chain_a706964ad13587fc9a8b3fe8381d410ed_cgraph.map create mode 100644 dd/d1c/classhash__chain_a706964ad13587fc9a8b3fe8381d410ed_cgraph.md5 create mode 100644 dd/d1c/classhash__chain_a706964ad13587fc9a8b3fe8381d410ed_cgraph.svg delete mode 100644 dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.map delete mode 100644 dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.md5 delete mode 100644 dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.svg rename dd/d2f/{class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.map => class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.map} (100%) create mode 100644 dd/d2f/class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.md5 rename dd/d2f/{class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.svg => class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.svg} (88%) delete mode 100644 dd/d2f/class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.md5 delete mode 100644 dd/d4f/class_solution.js rename dd/d65/{lu__decompose_8cpp_a9459fcd1f020373d73eae2bad43786d0_cgraph.map => lu__decompose_8cpp_a575c989afcc78e875031cd4273e62a3e_cgraph.map} (100%) rename dd/d65/{lu__decompose_8cpp_a9459fcd1f020373d73eae2bad43786d0_cgraph.md5 => lu__decompose_8cpp_a575c989afcc78e875031cd4273e62a3e_cgraph.md5} (100%) rename dd/d65/{lu__decompose_8cpp_a9459fcd1f020373d73eae2bad43786d0_cgraph.svg => lu__decompose_8cpp_a575c989afcc78e875031cd4273e62a3e_cgraph.svg} (98%) rename dd/d9c/{classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a2ac8dff819bc37f2136951a5bc9fc799_cgraph.map => classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a1802cf6197a255055cb734d626abc101_cgraph.map} (100%) rename dd/d9c/{classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a2ac8dff819bc37f2136951a5bc9fc799_cgraph.md5 => classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a1802cf6197a255055cb734d626abc101_cgraph.md5} (100%) rename dd/d9c/{classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a2ac8dff819bc37f2136951a5bc9fc799_cgraph.svg => classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a1802cf6197a255055cb734d626abc101_cgraph.svg} (96%) rename dd/d9c/{classmachine__learning_1_1aystar__search_1_1_eight_puzzle_af8cc0c234ebd261ee27bc3c391f837e3_cgraph.map => classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a26a976171392d257ca0f814ed73e0658_cgraph.map} (89%) create mode 100644 dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a26a976171392d257ca0f814ed73e0658_cgraph.md5 rename dd/d9c/{classmachine__learning_1_1aystar__search_1_1_eight_puzzle_af8cc0c234ebd261ee27bc3c391f837e3_cgraph.svg => classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a26a976171392d257ca0f814ed73e0658_cgraph.svg} (96%) delete mode 100644 dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_af8cc0c234ebd261ee27bc3c391f837e3_cgraph.md5 delete mode 100644 dd/d9d/structdata__structures_1_1list__array_1_1list__coll__graph.map delete mode 100644 dd/d9d/structdata__structures_1_1list__array_1_1list__coll__graph.md5 delete mode 100644 dd/d9d/structdata__structures_1_1list__array_1_1list__coll__graph.svg delete mode 100644 de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.map delete mode 100644 de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.md5 delete mode 100644 de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.svg rename de/d07/{cycle__sort_8cpp_ad0cfe2e54b1d3f9d0ca648265d917c6a_cgraph.map => cycle__sort_8cpp_ae79a9d247691fce0d655fce75f1c04fa_cgraph.map} (100%) rename de/d07/{cycle__sort_8cpp_ad0cfe2e54b1d3f9d0ca648265d917c6a_cgraph.md5 => cycle__sort_8cpp_ae79a9d247691fce0d655fce75f1c04fa_cgraph.md5} (100%) rename de/d07/{cycle__sort_8cpp_ad0cfe2e54b1d3f9d0ca648265d917c6a_cgraph.svg => cycle__sort_8cpp_ae79a9d247691fce0d655fce75f1c04fa_cgraph.svg} (98%) create mode 100644 de/d0d/fibonacci__search_8cpp_a2aa09bef74ee063c1331de0883af4f4f_cgraph.map create mode 100644 de/d0d/fibonacci__search_8cpp_a2aa09bef74ee063c1331de0883af4f4f_cgraph.md5 create mode 100644 de/d0d/fibonacci__search_8cpp_a2aa09bef74ee063c1331de0883af4f4f_cgraph.svg create mode 100644 de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.map create mode 100644 de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.md5 create mode 100644 de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.svg delete mode 100644 de/d33/classdata__structures_1_1linked__list_1_1link__coll__graph.map delete mode 100644 de/d33/classdata__structures_1_1linked__list_1_1link__coll__graph.md5 delete mode 100644 de/d33/classdata__structures_1_1linked__list_1_1link__coll__graph.svg delete mode 100644 de/d48/struct_trie_1_1_trie_node.js delete mode 100644 de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.map delete mode 100644 de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.md5 delete mode 100644 de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.svg delete mode 100644 de/d61/classrange__queries_1_1per_seg_tree_1_1_node__coll__graph.map delete mode 100644 de/d61/classrange__queries_1_1per_seg_tree_1_1_node__coll__graph.md5 delete mode 100644 de/d61/classrange__queries_1_1per_seg_tree_1_1_node__coll__graph.svg rename de/d75/{qr__eigen__values_8cpp_a33cb0a68c36aa26fd599c7c66da86ed7_cgraph.map => qr__eigen__values_8cpp_a9bbf469d5525a816b0d6ca812119093d_cgraph.map} (100%) rename de/d75/{qr__eigen__values_8cpp_a33cb0a68c36aa26fd599c7c66da86ed7_cgraph.md5 => qr__eigen__values_8cpp_a9bbf469d5525a816b0d6ca812119093d_cgraph.md5} (100%) rename de/d75/{qr__eigen__values_8cpp_a33cb0a68c36aa26fd599c7c66da86ed7_cgraph.svg => qr__eigen__values_8cpp_a9bbf469d5525a816b0d6ca812119093d_cgraph.svg} (96%) delete mode 100644 de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.map delete mode 100644 de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.md5 delete mode 100644 de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.svg rename de/d9b/{prime__numbers_8cpp_a3b91f208e8365c95a295cfe3e67df5c3_cgraph.map => prime__numbers_8cpp_a541b9728fd1db77516fee913763da90e_cgraph.map} (100%) rename de/d9b/{prime__numbers_8cpp_a3b91f208e8365c95a295cfe3e67df5c3_cgraph.md5 => prime__numbers_8cpp_a541b9728fd1db77516fee913763da90e_cgraph.md5} (100%) rename de/d9b/{prime__numbers_8cpp_a3b91f208e8365c95a295cfe3e67df5c3_cgraph.svg => prime__numbers_8cpp_a541b9728fd1db77516fee913763da90e_cgraph.svg} (96%) create mode 100644 de/dcf/binary__exponent_8cpp_aeb48dce0725e63d19147944f41843c73_cgraph.map create mode 100644 de/dcf/binary__exponent_8cpp_aeb48dce0725e63d19147944f41843c73_cgraph.md5 create mode 100644 de/dcf/binary__exponent_8cpp_aeb48dce0725e63d19147944f41843c73_cgraph.svg rename df/d66/{vector__cross__product_8cpp_abed307975124243d63fe2e118254defe_cgraph.map => vector__cross__product_8cpp_a225732399c5c076976eae5b180a9f8c9_cgraph.map} (100%) rename df/d66/{vector__cross__product_8cpp_abed307975124243d63fe2e118254defe_cgraph.md5 => vector__cross__product_8cpp_a225732399c5c076976eae5b180a9f8c9_cgraph.md5} (100%) rename df/d66/{vector__cross__product_8cpp_abed307975124243d63fe2e118254defe_cgraph.svg => vector__cross__product_8cpp_a225732399c5c076976eae5b180a9f8c9_cgraph.svg} (96%) delete mode 100644 df/d82/classgraph_1_1_h_k_graph__coll__graph.map delete mode 100644 df/d82/classgraph_1_1_h_k_graph__coll__graph.md5 delete mode 100644 df/d82/classgraph_1_1_h_k_graph__coll__graph.svg delete mode 100644 df/db7/classgraph_1_1is__graph__bipartite_1_1_graph__coll__graph.map delete mode 100644 df/db7/classgraph_1_1is__graph__bipartite_1_1_graph__coll__graph.md5 delete mode 100644 df/db7/classgraph_1_1is__graph__bipartite_1_1_graph__coll__graph.svg rename df/dce/{namespacegraph_a454891267187a5ec6c6e3f3ad5203ff1_cgraph.map => namespacegraph_a0e30e0dca68cb6e4f671440819b35b6a_cgraph.map} (100%) rename df/dce/{namespacegraph_a454891267187a5ec6c6e3f3ad5203ff1_cgraph.md5 => namespacegraph_a0e30e0dca68cb6e4f671440819b35b6a_cgraph.md5} (100%) rename df/dce/{namespacegraph_a454891267187a5ec6c6e3f3ad5203ff1_cgraph.svg => namespacegraph_a0e30e0dca68cb6e4f671440819b35b6a_cgraph.svg} (96%) delete mode 100644 df/dce/namespacegraph_a2e6017a54d445819ede9adcf33240e1a_cgraph.map delete mode 100644 df/dce/namespacegraph_a2e6017a54d445819ede9adcf33240e1a_cgraph.md5 delete mode 100644 df/dce/namespacegraph_a2e6017a54d445819ede9adcf33240e1a_cgraph.svg create mode 100644 df/dce/namespacegraph_a3ae80bc4c6a79d041b4f3a6589eb7fb8_cgraph.map create mode 100644 df/dce/namespacegraph_a3ae80bc4c6a79d041b4f3a6589eb7fb8_cgraph.md5 create mode 100644 df/dce/namespacegraph_a3ae80bc4c6a79d041b4f3a6589eb7fb8_cgraph.svg delete mode 100644 df/dce/namespacegraph_a48acac475cb48614279e7ea784c32fc3_cgraph.md5 rename df/dce/{namespacegraph_a48acac475cb48614279e7ea784c32fc3_cgraph.map => namespacegraph_a64c1db5aad7502c6f08e4652f6edd463_cgraph.map} (65%) create mode 100644 df/dce/namespacegraph_a64c1db5aad7502c6f08e4652f6edd463_cgraph.md5 rename df/dce/{namespacegraph_a48acac475cb48614279e7ea784c32fc3_cgraph.svg => namespacegraph_a64c1db5aad7502c6f08e4652f6edd463_cgraph.svg} (69%) create mode 100644 df/dce/namespacegraph_a83ab16e96cec644109a58dfc9329bc2b_cgraph.map create mode 100644 df/dce/namespacegraph_a83ab16e96cec644109a58dfc9329bc2b_cgraph.md5 create mode 100644 df/dce/namespacegraph_a83ab16e96cec644109a58dfc9329bc2b_cgraph.svg delete mode 100644 df/dce/namespacegraph_a868530bfaed30e57290a76d5b4402d50_cgraph.map delete mode 100644 df/dce/namespacegraph_a868530bfaed30e57290a76d5b4402d50_cgraph.md5 delete mode 100644 df/dce/namespacegraph_a868530bfaed30e57290a76d5b4402d50_cgraph.svg delete mode 100644 df/dce/namespacegraph_a9fc2ded2807582edf398e6d7c7114914_cgraph.map delete mode 100644 df/dce/namespacegraph_a9fc2ded2807582edf398e6d7c7114914_cgraph.md5 delete mode 100644 df/dce/namespacegraph_a9fc2ded2807582edf398e6d7c7114914_cgraph.svg create mode 100644 df/dce/namespacegraph_ab5428a3519267a28bba4b4310cfbb6ae_cgraph.map create mode 100644 df/dce/namespacegraph_ab5428a3519267a28bba4b4310cfbb6ae_cgraph.md5 create mode 100644 df/dce/namespacegraph_ab5428a3519267a28bba4b4310cfbb6ae_cgraph.svg delete mode 100644 inherit_graph_80.map delete mode 100644 inherit_graph_80.md5 delete mode 100644 inherit_graph_80.svg diff --git a/annotated.html b/annotated.html index 12fabaec4..bae880eaa 100644 --- a/annotated.html +++ b/annotated.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Class List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,16 +90,15 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable();
-
-
Class List
+
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
[detail level 1234]
- + - + @@ -118,28 +117,28 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable(); - - + + - - + + - - - + + + - + - - - - + + + + @@ -155,19 +154,19 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable(); - - + + - + - + - + @@ -177,11 +176,11 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable(); - - - + + + - + @@ -206,8 +205,8 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable(); - - + + @@ -226,7 +225,7 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable(); diff --git a/annotated_dup.js b/annotated_dup.js index 9e8d3b3cf..fbd78f48f 100644 --- a/annotated_dup.js +++ b/annotated_dup.js @@ -36,8 +36,8 @@ var annotated_dup = ] ], [ "geometry", "d5/d5f/namespacegeometry.html", [ [ "jarvis", null, [ - [ "Point", "d9/d5a/structgeometry_1_1jarvis_1_1_point.html", "d9/d5a/structgeometry_1_1jarvis_1_1_point" ], - [ "Convexhull", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull" ] + [ "Convexhull", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull" ], + [ "Point", "d9/d5a/structgeometry_1_1jarvis_1_1_point.html", null ] ] ] ] ], [ "graph", "df/dce/namespacegraph.html", [ @@ -46,16 +46,16 @@ var annotated_dup = ] ], [ "Graph", "dc/d61/classgraph_1_1_graph.html", "dc/d61/classgraph_1_1_graph" ], [ "HKGraph", "d8/d69/classgraph_1_1_h_k_graph.html", "d8/d69/classgraph_1_1_h_k_graph" ], - [ "RootedTree", "d0/d58/classgraph_1_1_rooted_tree.html", "d0/d58/classgraph_1_1_rooted_tree" ], - [ "LowestCommonAncestor", "d9/d23/classgraph_1_1_lowest_common_ancestor.html", "d9/d23/classgraph_1_1_lowest_common_ancestor" ] + [ "LowestCommonAncestor", "d9/d23/classgraph_1_1_lowest_common_ancestor.html", "d9/d23/classgraph_1_1_lowest_common_ancestor" ], + [ "RootedTree", "d0/d58/classgraph_1_1_rooted_tree.html", "d0/d58/classgraph_1_1_rooted_tree" ] ] ], [ "linear_probing", "d8/d89/namespacelinear__probing.html", [ [ "Entry", "db/d19/structlinear__probing_1_1_entry.html", "db/d19/structlinear__probing_1_1_entry" ] ] ], [ "machine_learning", "d8/d77/namespacemachine__learning.html", [ [ "aystar_search", null, [ - [ "EightPuzzle", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle" ], - [ "AyStarSearch", "da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html", "da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search" ] + [ "AyStarSearch", "da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html", "da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search" ], + [ "EightPuzzle", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle" ] ] ], [ "neural_network", null, [ [ "layers", null, [ @@ -80,8 +80,8 @@ var annotated_dup = ] ], [ "others", "d0/d6f/namespaceothers.html", [ [ "iterative_tree_traversals", null, [ - [ "Node", "d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node.html", "d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node" ], - [ "BinaryTree", "d9/d12/classothers_1_1iterative__tree__traversals_1_1_binary_tree.html", "d9/d12/classothers_1_1iterative__tree__traversals_1_1_binary_tree" ] + [ "BinaryTree", "d9/d12/classothers_1_1iterative__tree__traversals_1_1_binary_tree.html", "d9/d12/classothers_1_1iterative__tree__traversals_1_1_binary_tree" ], + [ "Node", "d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node.html", "d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node" ] ] ], [ "lru_cache", null, [ [ "LRUCache", "d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html", "d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache" ] @@ -95,9 +95,9 @@ var annotated_dup = ] ], [ "range_queries", "dd/d69/namespacerange__queries.html", [ [ "heavy_light_decomposition", null, [ - [ "Tree", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree" ], + [ "HLD", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d" ], [ "SG", "d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html", "d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g" ], - [ "HLD", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d" ] + [ "Tree", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree" ] ] ], [ "perSegTree", "d8/d28/classrange__queries_1_1per_seg_tree.html", "d8/d28/classrange__queries_1_1per_seg_tree" ] ] ], @@ -111,42 +111,42 @@ var annotated_dup = [ "stats_computer2", "d8/dab/classstatistics_1_1stats__computer2.html", "d8/dab/classstatistics_1_1stats__computer2" ] ] ], [ "std", "d8/dcc/namespacestd.html", [ - [ "is_integral< uint128_t >", "d2/dd4/structstd_1_1is__integral_3_01uint128__t_01_4.html", null ], [ "is_arithmetic< uint128_t >", "d2/dfc/structstd_1_1is__arithmetic_3_01uint128__t_01_4.html", null ], - [ "is_unsigned< uint128_t >", "d5/d25/structstd_1_1is__unsigned_3_01uint128__t_01_4.html", null ], - [ "is_integral< uint256_t >", "d7/d47/structstd_1_1is__integral_3_01uint256__t_01_4.html", null ], [ "is_arithmetic< uint256_t >", "dc/d6d/structstd_1_1is__arithmetic_3_01uint256__t_01_4.html", null ], + [ "is_integral< uint128_t >", "d2/dd4/structstd_1_1is__integral_3_01uint128__t_01_4.html", null ], + [ "is_integral< uint256_t >", "d7/d47/structstd_1_1is__integral_3_01uint256__t_01_4.html", null ], + [ "is_unsigned< uint128_t >", "d5/d25/structstd_1_1is__unsigned_3_01uint128__t_01_4.html", null ], [ "is_unsigned< uint256_t >", "df/d99/structstd_1_1is__unsigned_3_01uint256__t_01_4.html", null ] ] ], [ "binary_search_tree", "d9/dde/classbinary__search__tree.html", "d9/dde/classbinary__search__tree" ], - [ "Btree", "d9/d90/struct_btree.html", "d9/d90/struct_btree" ], - [ "cll", "d5/d15/classcll.html", "d5/d15/classcll" ], - [ "compare", "d1/db3/structcompare.html", "d1/db3/structcompare" ], + [ "Btree", "d9/d90/struct_btree.html", null ], + [ "cll", "d5/d15/classcll.html", null ], + [ "compare", "d1/db3/structcompare.html", null ], [ "Complex", "da/d5a/class_complex.html", "da/d5a/class_complex" ], [ "CycleCheck", "d3/dbb/class_cycle_check.html", "d3/dbb/class_cycle_check" ], - [ "double_linked_list", "d9/dee/classdouble__linked__list.html", "d9/dee/classdouble__linked__list" ], + [ "double_linked_list", "d9/dee/classdouble__linked__list.html", null ], [ "Edge", "d7/d77/class_edge.html", "d7/d77/class_edge" ], [ "FenwickTree", "dd/d91/class_fenwick_tree.html", "dd/d91/class_fenwick_tree" ], [ "Graph", "da/d9a/class_graph.html", "da/d9a/class_graph" ], [ "hash_chain", "dd/d1c/classhash__chain.html", "dd/d1c/classhash__chain" ], - [ "Item", "db/d66/struct_item.html", "db/d66/struct_item" ], + [ "Item", "db/d66/struct_item.html", null ], [ "large_number", "db/d82/classlarge__number.html", "db/d82/classlarge__number" ], - [ "linkedlist", "d0/dff/structlinkedlist.html", "d0/dff/structlinkedlist" ], + [ "linkedlist", "d0/dff/structlinkedlist.html", null ], [ "list", "d8/d10/structlist.html", "d8/d10/structlist" ], [ "MinHeap", "d2/d05/class_min_heap.html", "d2/d05/class_min_heap" ], - [ "MinHeapNode", "d5/d29/struct_min_heap_node.html", "d5/d29/struct_min_heap_node" ], - [ "mst", "d1/d77/structmst.html", "d1/d77/structmst" ], + [ "MinHeapNode", "d5/d29/struct_min_heap_node.html", null ], + [ "mst", "d1/d77/structmst.html", null ], [ "node", "d5/da1/structnode.html", "d5/da1/structnode" ], - [ "Node", "db/d8b/struct_node.html", "db/d8b/struct_node" ], + [ "Node", "db/d8b/struct_node.html", null ], [ "Point", "d8/dc8/struct_point.html", "d8/dc8/struct_point" ], - [ "query", "dd/d1b/structquery.html", "dd/d1b/structquery" ], - [ "Queue", "dc/db5/struct_queue.html", "dc/db5/struct_queue" ], + [ "query", "dd/d1b/structquery.html", null ], [ "queue", "db/da9/classqueue.html", "db/da9/classqueue" ], - [ "RBtree", "d8/d72/class_r_btree.html", "d8/d72/class_r_btree" ], + [ "Queue", "dc/db5/struct_queue.html", null ], + [ "RBtree", "d8/d72/class_r_btree.html", null ], [ "SegmentIntersection", "d4/db4/struct_segment_intersection.html", "d4/db4/struct_segment_intersection" ], - [ "Solution", "dd/d4f/class_solution.html", "dd/d4f/class_solution" ], + [ "Solution", "dd/d4f/class_solution.html", null ], [ "stack", "d1/dc2/classstack.html", "d1/dc2/classstack" ], - [ "stack_linkedList", "d2/dc4/classstack__linked_list.html", "d2/dc4/classstack__linked_list" ], + [ "stack_linkedList", "d2/dc4/classstack__linked_list.html", null ], [ "TestCases", "d5/d58/class_test_cases.html", "d5/d58/class_test_cases" ], [ "tower", "d2/d2c/structtower.html", "d2/d2c/structtower" ], [ "Trie", "dd/d2f/class_trie.html", "dd/d2f/class_trie" ], diff --git a/classes.html b/classes.html index 22c6f4638..a2c37d9b6 100644 --- a/classes.html +++ b/classes.html @@ -2,8 +2,8 @@ - - + +Algorithms_in_C++: Class Index @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
 NciphersBase64 Encoding and Decoding
 NciphersBase64 Encoding and Decoding
 Nelliptic_curve_key_exchangeNamespace elliptic_curve_key_exchange
 CHillCipherImplementation of Hill Cipher algorithm
 CHillCipherImplementation of Hill Cipher algorithm
 Ndata_structuresData Structures algorithms
 Nlinked_list
 CNode
 CSkipList
 CtrieTrie implementation for small-case English alphabets a-z
 Ndouble_hashingAn implementation of hash table using double hashing algorithm
 CtrieTrie implementation for small-case English alphabets a-z
 Ndouble_hashingAn implementation of hash table using double hashing algorithm
 CEntry
 NgeometryGeometry algorithms
 Njarvis
 NgraphGraph Algorithms
 Nis_graph_bipartite
 CGraph
 CHKGraphRepresents Bipartite graph for Hopcroft Karp implementation
 CRootedTree
 CLowestCommonAncestor
 Nlinear_probingAn implementation of hash table using linear probing algorithm
 CLowestCommonAncestor
 CRootedTree
 Nlinear_probingAn implementation of hash table using linear probing algorithm
 CEntry
 Nmachine_learningA* search algorithm
 Nmachine_learningA* search algorithm
 Naystar_search
 Nneural_network
 NothersFor vector
 Niterative_tree_traversals
 Nlru_cache
 Npostfix_expression
 Nquadratic_probingAn implementation of hash table using quadratic probing algorithm
 Nquadratic_probingAn implementation of hash table using quadratic probing algorithm
 CEntry
 Nrange_queriesAlgorithms and Data Structures that support range queries and updates
 Nheavy_light_decomposition
 CperSegTreeRange query here is range sum, but the code can be modified to make different queries like range max or min
 NsearchFor std::vector
 Cstats_computer1
 Cstats_computer2
 NstdSTL namespace
 Cis_integral< uint128_t >
 Cis_arithmetic< uint128_t >
 Cis_unsigned< uint128_t >
 Cis_arithmetic< uint128_t >
 Cis_arithmetic< uint256_t >
 Cis_integral< uint128_t >
 Cis_integral< uint256_t >
 Cis_arithmetic< uint256_t >
 Cis_unsigned< uint128_t >
 Cis_unsigned< uint256_t >
 Cbinary_search_treeThe Binary Search Tree class
 Cbst_nodeA struct to represent a node in the Binary Search Tree
 CNode
 CPoint
 Cquery
 CQueue
 Cqueue
 Cqueue
 CQueue
 CRBtree
 CSegmentIntersection
 CSolution
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,65 +90,64 @@ $(document).ready(function(){initNavTree('classes.html',''); initResizable(); })
-
-
Class Index
+
Class Index
A | B | C | D | E | F | G | H | I | L | M | N | P | Q | R | S | T | U
-
A
+
A
adaline (machine_learning)
AyStarSearch (machine_learning::aystar_search)
-
B
+
B
binary_search_tree
BinaryTree (others::iterative_tree_traversals)
binary_search_tree::bst_node
Btree
-
C
+
C
cll
compare
AyStarSearch::comparison_operator (machine_learning::aystar_search)
Complex
Convexhull (geometry::jarvis)
CycleCheck
-
D
+
D
DenseLayer (machine_learning::neural_network::layers)
double_linked_list
-
E
+
E
Edge
EightPuzzle (machine_learning::aystar_search)
Entry (double_hashing)
Entry (linear_probing)
Entry (quadratic_probing)
-
F
+
F
FenwickTree
-
G
+
G
Graph
Graph (graph)
Graph (graph::is_graph_bipartite)
-
H
+
H
hash_chain
HillCipher (ciphers)
HKGraph (graph)
HLD (range_queries::heavy_light_decomposition)
-
I
+
I
AyStarSearch::Info (machine_learning::aystar_search)
is_arithmetic< uint128_t > (std)
is_arithmetic< uint256_t > (std)
is_integral< uint128_t > (std)
is_integral< uint256_t > (std)
is_unsigned< uint128_t > (std)
is_unsigned< uint256_t > (std)
Item
-
L
+
L
large_number
link (data_structures::linked_list)
linkedlist
list (data_structures::linked_list)
list (data_structures::list_array)
list
LowestCommonAncestor (graph)
LRUCache (others::lru_cache)
-
M
+
M
MinHeap
MinHeapNode
mst
-
N
+
N
NCRModuloP (math::ncr_modulo_p)
NeuralNetwork (machine_learning::neural_network)
Node (data_structures)
Node (data_structures::tree_234)
Trie::Node (data_structures::trie_using_hashmap)
node
Node
Node (operations_on_datastructures::inorder_traversal_of_bst)
Node (others::iterative_tree_traversals)
perSegTree::Node (range_queries)
Node (search::sublist_search)
-
P
+
P
perSegTree (range_queries)
Point (ciphers::elliptic_curve_key_exchange)
Point (geometry::jarvis)
Point
-
Q
-
query
Queue
queue
Queue_Array (data_structures::queue_using_array)
+
Q
+
query
queue
Queue
Queue_Array (data_structures::queue_using_array)
-
R
+
R
RBtree
RootedTree (graph)
-
S
+
S
SegmentIntersection
SG (range_queries::heavy_light_decomposition)
SkipList (data_structures)
Solution
Sparse_table (data_structures::sparse_table)
Stack (others::postfix_expression)
stack
stack_linkedList
stats_computer1 (statistics)
stats_computer2 (statistics)
-
T
+
T
TestCases
Tnode (operations_on_datastructures::trie_operations)
tower
Tree (range_queries::heavy_light_decomposition)
Tree234 (data_structures::tree_234)
trie (data_structures)
Trie (data_structures::trie_using_hashmap)
Trie
Trie::TrieNode
-
U
+
U
uint128_t
uint256_t
@@ -156,7 +155,7 @@ $(document).ready(function(){initNavTree('classes.html',''); initResizable(); }) diff --git a/d0/d01/smallest__circle_8cpp.html b/d0/d01/smallest__circle_8cpp.html index d8a3c1532..5238f5e29 100644 --- a/d0/d01/smallest__circle_8cpp.html +++ b/d0/d01/smallest__circle_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: others/smallest_circle.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d0/d01/smallest__circle_8cpp.html','..
Classes | Functions
-
-
smallest_circle.cpp File Reference
+
smallest_circle.cpp File Reference
-

Get centre and radius of the smallest circle that circumscribes given set of points. +

Get centre and radius of the smallest circle that circumscribes given set of points. More...

#include <cmath>
#include <iostream>
@@ -110,12 +109,12 @@ Include dependency graph for smallest_circle.cpp:
-

+

Classes

struct  Point
 
- @@ -135,10 +134,10 @@ Functions

+

Functions

double LenghtLine (const Point &A, const Point &B)
 
 

Detailed Description

-

Get centre and radius of the smallest circle that circumscribes given set of points.

-
See also
other implementation
+

Get centre and radius of the smallest circle that circumscribes given set of points.

+
See also
other implementation

Function Documentation

- +

◆ circle()

@@ -153,7 +152,7 @@ Functions
-

Find the centre and radius of a circle enclosing a set of points.
+

Find the centre and radius of a circle enclosing a set of points.
The function returns the radius of the circle and prints the coordinated of the centre of the circle.

Parameters
@@ -161,71 +160,71 @@ The function returns the radius of the circle and prints the coordinated of the
Returns
radius of the circle
-
87  {
-
88  double minR = INFINITY;
-
89  double R;
-
90  Point C;
-
91  Point minC;
-
92 
-
93  /* This code is invalid and does not give correct result for TEST 3 */
-
94  // for each point in the list
-
95  for (size_t i = 0; i < P.size() - 2; i++)
-
96  // for every subsequent point in the list
-
97  for (size_t j = i + 1; j < P.size(); j++)
-
98  // for every subsequent point in the list
-
99  for (size_t k = j + 1; k < P.size(); k++) {
-
100  // here, we now have picked three points from the given set of
-
101  // points that we can use
-
102  // viz., P[i], P[j] and P[k]
-
103  C.x = -0.5 * ((P[i].y * (P[j].x * P[j].x + P[j].y * P[j].y -
-
104  P[k].x * P[k].x - P[k].y * P[k].y) +
-
105  P[j].y * (P[k].x * P[k].x + P[k].y * P[k].y -
-
106  P[i].x * P[i].x - P[i].y * P[i].y) +
-
107  P[k].y * (P[i].x * P[i].x + P[i].y * P[i].y -
-
108  P[j].x * P[j].x - P[j].y * P[j].y)) /
-
109  (P[i].x * (P[j].y - P[k].y) +
-
110  P[j].x * (P[k].y - P[i].y) +
-
111  P[k].x * (P[i].y - P[j].y)));
-
112  C.y = 0.5 * ((P[i].x * (P[j].x * P[j].x + P[j].y * P[j].y -
-
113  P[k].x * P[k].x - P[k].y * P[k].y) +
-
114  P[j].x * (P[k].x * P[k].x + P[k].y * P[k].y -
-
115  P[i].x * P[i].x - P[i].y * P[i].y) +
-
116  P[k].x * (P[i].x * P[i].x + P[i].y * P[i].y -
-
117  P[j].x * P[j].x - P[j].y * P[j].y)) /
-
118  (P[i].x * (P[j].y - P[k].y) +
-
119  P[j].x * (P[k].y - P[i].y) +
-
120  P[k].x * (P[i].y - P[j].y)));
-
121  R = (LenghtLine(P[i], P[j]) * LenghtLine(P[j], P[k]) *
-
122  LenghtLine(P[k], P[i])) /
-
123  (4 * TriangleArea(P[i], P[j], P[k]));
-
124  if (!PointInCircle(P, C, R)) {
-
125  continue;
-
126  }
-
127  if (R <= minR) {
-
128  minR = R;
-
129  minC = C;
-
130  }
-
131  }
-
132 
-
133  // for each point in the list
-
134  for (size_t i = 0; i < P.size() - 1; i++)
-
135  // for every subsequent point in the list
-
136  for (size_t j = i + 1; j < P.size(); j++) {
-
137  // check for diameterically opposite points
-
138  C.x = (P[i].x + P[j].x) / 2;
-
139  C.y = (P[i].y + P[j].y) / 2;
-
140  R = LenghtLine(C, P[i]);
-
141  if (!PointInCircle(P, C, R)) {
-
142  continue;
-
143  }
-
144  if (R <= minR) {
-
145  minR = R;
-
146  minC = C;
-
147  }
-
148  }
-
149  std::cout << minC.x << " " << minC.y << std::endl;
-
150  return minR;
-
151 }
+
87 {
+
88 double minR = INFINITY;
+
89 double R;
+
90 Point C;
+
91 Point minC;
+
92
+
93 /* This code is invalid and does not give correct result for TEST 3 */
+
94 // for each point in the list
+
95 for (size_t i = 0; i < P.size() - 2; i++)
+
96 // for every subsequent point in the list
+
97 for (size_t j = i + 1; j < P.size(); j++)
+
98 // for every subsequent point in the list
+
99 for (size_t k = j + 1; k < P.size(); k++) {
+
100 // here, we now have picked three points from the given set of
+
101 // points that we can use
+
102 // viz., P[i], P[j] and P[k]
+
103 C.x = -0.5 * ((P[i].y * (P[j].x * P[j].x + P[j].y * P[j].y -
+
104 P[k].x * P[k].x - P[k].y * P[k].y) +
+
105 P[j].y * (P[k].x * P[k].x + P[k].y * P[k].y -
+
106 P[i].x * P[i].x - P[i].y * P[i].y) +
+
107 P[k].y * (P[i].x * P[i].x + P[i].y * P[i].y -
+
108 P[j].x * P[j].x - P[j].y * P[j].y)) /
+
109 (P[i].x * (P[j].y - P[k].y) +
+
110 P[j].x * (P[k].y - P[i].y) +
+
111 P[k].x * (P[i].y - P[j].y)));
+
112 C.y = 0.5 * ((P[i].x * (P[j].x * P[j].x + P[j].y * P[j].y -
+
113 P[k].x * P[k].x - P[k].y * P[k].y) +
+
114 P[j].x * (P[k].x * P[k].x + P[k].y * P[k].y -
+
115 P[i].x * P[i].x - P[i].y * P[i].y) +
+
116 P[k].x * (P[i].x * P[i].x + P[i].y * P[i].y -
+
117 P[j].x * P[j].x - P[j].y * P[j].y)) /
+
118 (P[i].x * (P[j].y - P[k].y) +
+
119 P[j].x * (P[k].y - P[i].y) +
+
120 P[k].x * (P[i].y - P[j].y)));
+
121 R = (LenghtLine(P[i], P[j]) * LenghtLine(P[j], P[k]) *
+
122 LenghtLine(P[k], P[i])) /
+
123 (4 * TriangleArea(P[i], P[j], P[k]));
+
124 if (!PointInCircle(P, C, R)) {
+
125 continue;
+
126 }
+
127 if (R <= minR) {
+
128 minR = R;
+
129 minC = C;
+
130 }
+
131 }
+
132
+
133 // for each point in the list
+
134 for (size_t i = 0; i < P.size() - 1; i++)
+
135 // for every subsequent point in the list
+
136 for (size_t j = i + 1; j < P.size(); j++) {
+
137 // check for diameterically opposite points
+
138 C.x = (P[i].x + P[j].x) / 2;
+
139 C.y = (P[i].y + P[j].y) / 2;
+
140 R = LenghtLine(C, P[i]);
+
141 if (!PointInCircle(P, C, R)) {
+
142 continue;
+
143 }
+
144 if (R <= minR) {
+
145 minR = R;
+
146 minC = C;
+
147 }
+
148 }
+
149 std::cout << minC.x << " " << minC.y << std::endl;
+
150 return minR;
+
151}
T endl(T... args)
T size(T... args)
@@ -243,7 +242,7 @@ Here is the call graph for this function:
- +

◆ LenghtLine()

@@ -268,7 +267,7 @@ Here is the call graph for this function:
[in]Pvector of points
-

Compute the Euclidian distance between two points \(A\equiv(x_1,y_1)\) and \(B\equiv(x_2,y_2)\) using the formula:

+

Compute the Euclidian distance between two points \(A\equiv(x_1,y_1)\) and \(B\equiv(x_2,y_2)\) using the formula:

\[d=\sqrt{\left(x_1-x_2\right)^2+\left(y_1-y_2\right)^2}\]

Parameters
@@ -279,11 +278,11 @@ Here is the call graph for this function:
Returns
ditance
-
37  {
-
38  double dx = B.x - A.x;
-
39  double dy = B.y - A.y;
-
40  return std::sqrt((dx * dx) + (dy * dy));
-
41 }
+
37 {
+
38 double dx = B.x - A.x;
+
39 double dy = B.y - A.y;
+
40 return std::sqrt((dx * dx) + (dy * dy));
+
41}
T sqrt(T... args)
Here is the call graph for this function:
@@ -294,7 +293,7 @@ Here is the call graph for this function:
- +

◆ main()

@@ -309,15 +308,15 @@ Here is the call graph for this function:
-

Main program

-
198  {
-
199  test();
-
200  std::cout << std::endl;
-
201  test2();
-
202  std::cout << std::endl;
-
203  test3();
-
204  return 0;
-
205 }
+

Main program

+
198 {
+
199 test();
+ +
201 test2();
+ +
203 test3();
+
204 return 0;
+
205}
void test2()
Definition: smallest_circle.cpp:173
void test3()
Definition: smallest_circle.cpp:188
void test()
Definition: smallest_circle.cpp:158
@@ -330,7 +329,7 @@ Here is the call graph for this function:
- +

◆ PointInCircle()

@@ -361,7 +360,7 @@ Here is the call graph for this function:
-

Check if a set of points lie within given circle. This is true if the distance of all the points from the centre of the circle is less than the radius of the circle

Parameters
+

Check if a set of points lie within given circle. This is true if the distance of all the points from the centre of the circle is less than the radius of the circle

Parameters
@@ -372,13 +371,13 @@ Here is the call graph for this function:
Returns
True if P lies on or within the circle
False if P lies outside the circle
-
72  {
-
73  for (size_t i = 0; i < P.size(); i++) {
-
74  if (LenghtLine(P[i], Center) > R)
-
75  return false;
-
76  }
-
77  return true;
-
78 }
+
72 {
+
73 for (size_t i = 0; i < P.size(); i++) {
+
74 if (LenghtLine(P[i], Center) > R)
+
75 return false;
+
76 }
+
77 return true;
+
78}
Here is the call graph for this function:
@@ -388,7 +387,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -402,19 +401,19 @@ Here is the call graph for this function:
[in]Pset of points to check
[in]Centercoordinates to centre of the circle
-

Test case: result should be:
+

Test case: result should be:
Circle with
radius 3.318493136080724
centre at (3.0454545454545454, 1.3181818181818181)

-
158  {
- -
160  Pv.push_back(Point(0, 0));
-
161  Pv.push_back(Point(5, 4));
-
162  Pv.push_back(Point(1, 3));
-
163  Pv.push_back(Point(4, 1));
-
164  Pv.push_back(Point(3, -2));
-
165  std::cout << circle(Pv) << std::endl;
-
166 }
+
158 {
+ +
160 Pv.push_back(Point(0, 0));
+
161 Pv.push_back(Point(5, 4));
+
162 Pv.push_back(Point(1, 3));
+
163 Pv.push_back(Point(4, 1));
+
164 Pv.push_back(Point(3, -2));
+
165 std::cout << circle(Pv) << std::endl;
+
166}
struct ciphers::elliptic_curve_key_exchange::Point Point
Definition of struct Point.
T push_back(T... args)
double circle(const std::vector< Point > &P)
Definition: smallest_circle.cpp:87
@@ -428,7 +427,7 @@ Here is the call graph for this function:
- +

◆ test2()

@@ -442,18 +441,18 @@ Here is the call graph for this function:
-

Test case: result should be:
+

Test case: result should be:
Circle with
radius 1.4142135623730951
centre at (1.0, 1.0)

-
173  {
- -
175  Pv.push_back(Point(0, 0));
-
176  Pv.push_back(Point(0, 2));
-
177  Pv.push_back(Point(2, 2));
-
178  Pv.push_back(Point(2, 0));
-
179  std::cout << circle(Pv) << std::endl;
-
180 }
+
173 {
+ +
175 Pv.push_back(Point(0, 0));
+
176 Pv.push_back(Point(0, 2));
+
177 Pv.push_back(Point(2, 2));
+
178 Pv.push_back(Point(2, 0));
+
179 std::cout << circle(Pv) << std::endl;
+
180}
Here is the call graph for this function:
@@ -463,7 +462,7 @@ Here is the call graph for this function:
- +

◆ test3()

@@ -477,18 +476,18 @@ Here is the call graph for this function:
-

Test case: result should be:
+

Test case: result should be:
Circle with
radius 1.821078397711709
centre at (2.142857142857143, 1.7857142857142856)

Todo:
This test fails
-
188  {
- -
190  Pv.push_back(Point(0.5, 1));
-
191  Pv.push_back(Point(3.5, 3));
-
192  Pv.push_back(Point(2.5, 0));
-
193  Pv.push_back(Point(2, 1.5));
-
194  std::cout << circle(Pv) << std::endl;
-
195 }
+
188 {
+ +
190 Pv.push_back(Point(0.5, 1));
+
191 Pv.push_back(Point(3.5, 3));
+
192 Pv.push_back(Point(2.5, 0));
+
193 Pv.push_back(Point(2, 1.5));
+
194 std::cout << circle(Pv) << std::endl;
+
195}
Here is the call graph for this function:
@@ -498,7 +497,7 @@ Here is the call graph for this function:
- +

◆ TriangleArea()

@@ -529,7 +528,7 @@ Here is the call graph for this function:
-

Compute the area of triangle formed by three points using Heron's formula. If the lengths of the sides of the triangle are \(a,\,b,\,c\) and \(s=\displaystyle\frac{a+b+c}{2}\) is the semi-perimeter then the area is given by

+

Compute the area of triangle formed by three points using Heron's formula. If the lengths of the sides of the triangle are \(a,\,b,\,c\) and \(s=\displaystyle\frac{a+b+c}{2}\) is the semi-perimeter then the area is given by

\[A=\sqrt{s(s-a)(s-b)(s-c)}\]

Parameters
@@ -541,13 +540,13 @@ Here is the call graph for this function:
Returns
area of triangle
-
54  {
-
55  double a = LenghtLine(A, B);
-
56  double b = LenghtLine(B, C);
-
57  double c = LenghtLine(C, A);
-
58  double p = (a + b + c) / 2;
-
59  return std::sqrt(p * (p - a) * (p - b) * (p - c));
-
60 }
+
54 {
+
55 double a = LenghtLine(A, B);
+
56 double b = LenghtLine(B, C);
+
57 double c = LenghtLine(C, A);
+
58 double p = (a + b + c) / 2;
+
59 return std::sqrt(p * (p - a) * (p - b) * (p - c));
+
60}
Here is the call graph for this function:
@@ -563,7 +562,7 @@ Here is the call graph for this function:
diff --git a/d0/d01/smallest__circle_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg b/d0/d01/smallest__circle_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg index 394b3c129..69dace74a 100644 --- a/d0/d01/smallest__circle_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg +++ b/d0/d01/smallest__circle_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg @@ -1,7 +1,7 @@ - diff --git a/d0/d01/smallest__circle_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg b/d0/d01/smallest__circle_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg index 969318fe6..4b999ebe7 100644 --- a/d0/d01/smallest__circle_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg +++ b/d0/d01/smallest__circle_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - diff --git a/d0/d01/smallest__circle_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg b/d0/d01/smallest__circle_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg index 28be3747c..faa0bf584 100644 --- a/d0/d01/smallest__circle_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg +++ b/d0/d01/smallest__circle_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg @@ -1,7 +1,7 @@ - - - diff --git a/d0/d01/smallest__circle_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph_org.svg b/d0/d01/smallest__circle_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph_org.svg index 395beb307..ee07e374b 100644 --- a/d0/d01/smallest__circle_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph_org.svg +++ b/d0/d01/smallest__circle_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph_org.svg @@ -1,7 +1,7 @@ - - diff --git a/d0/d01/smallest__circle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg b/d0/d01/smallest__circle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg index 1ff0482f5..847b37aa3 100644 --- a/d0/d01/smallest__circle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg +++ b/d0/d01/smallest__circle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: math/realtime_stats.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,8 +94,7 @@ $(document).ready(function(){initNavTree('d0/d08/realtime__stats_8cpp.html','../ Classes | Namespaces | Functions -
-
realtime_stats.cpp File Reference
+
realtime_stats.cpp File Reference
@@ -111,20 +110,20 @@ Include dependency graph for realtime_stats.cpp:
-

+

Classes

class  statistics::stats_computer1< T >
 
class  statistics::stats_computer2< T >
 
- - +

+

Namespaces

 statistics
namespace  statistics
 Statistical algorithms.
 
- @@ -132,10 +131,10 @@ Functions

+

Functions

void test_function (const float *test_data, const int number_of_samples)
 
 

Detailed Description

-

Compute statistics for data entered in rreal-time.

-

This algorithm is really beneficial to compute statistics on data read in realtime. For example, devices reading biometrics data. The algorithm is simple enough to be easily implemented in an embedded system.

Author
Krishna Vedala
+

Compute statistics for data entered in rreal-time.

+

This algorithm is really beneficial to compute statistics on data read in realtime. For example, devices reading biometrics data. The algorithm is simple enough to be easily implemented in an embedded system.

Author
Krishna Vedala

Function Documentation

- +

◆ main()

@@ -160,43 +159,43 @@ Functions
-

Main function

-
158  {
-
159  const float test_data1[] = {3, 4, 5, -1.4, -3.6, 1.9, 1.};
-
160  test_function(test_data1, sizeof(test_data1) / sizeof(test_data1[0]));
-
161 
-
162  std::cout
-
163  << "Enter data. Any non-numeric data will terminate the data input."
-
164  << std::endl;
-
165 
-
166  stats_computer1<float> stats1;
-
167  stats_computer2<float> stats2;
-
168 
-
169  while (1) {
-
170  double val;
-
171  std::cout << "Enter number: ";
-
172  std::cin >> val;
-
173 
-
174  // check for failure to read input. Happens for
-
175  // non-numeric data
-
176  if (std::cin.fail())
-
177  break;
-
178 
-
179  stats1.new_val(val);
-
180  stats2.new_val(val);
-
181 
-
182  std::cout << "\tMethod 1:"
-
183  << "\tMean: " << stats1.mean()
-
184  << "\t Variance: " << stats1.variance()
-
185  << "\t Std: " << stats1.std() << std::endl;
-
186  std::cout << "\tMethod 2:"
-
187  << "\tMean: " << stats2.mean()
-
188  << "\t Variance: " << stats2.variance()
-
189  << "\t Std: " << stats2.std() << std::endl;
-
190  }
-
191 
-
192  return 0;
-
193 }
+

Main function

+
158 {
+
159 const float test_data1[] = {3, 4, 5, -1.4, -3.6, 1.9, 1.};
+
160 test_function(test_data1, sizeof(test_data1) / sizeof(test_data1[0]));
+
161
+ +
163 << "Enter data. Any non-numeric data will terminate the data input."
+
164 << std::endl;
+
165
+ + +
168
+
169 while (1) {
+
170 double val;
+
171 std::cout << "Enter number: ";
+
172 std::cin >> val;
+
173
+
174 // check for failure to read input. Happens for
+
175 // non-numeric data
+
176 if (std::cin.fail())
+
177 break;
+
178
+
179 stats1.new_val(val);
+
180 stats2.new_val(val);
+
181
+
182 std::cout << "\tMethod 1:"
+
183 << "\tMean: " << stats1.mean()
+
184 << "\t Variance: " << stats1.variance()
+
185 << "\t Std: " << stats1.std() << std::endl;
+
186 std::cout << "\tMethod 2:"
+
187 << "\tMean: " << stats2.mean()
+
188 << "\t Variance: " << stats2.variance()
+
189 << "\t Std: " << stats2.std() << std::endl;
+
190 }
+
191
+
192 return 0;
+
193}
Definition: realtime_stats.cpp:27
@@ -220,7 +219,7 @@ Here is the call graph for this function:
- +

◆ test_function()

@@ -245,50 +244,50 @@ Here is the call graph for this function:
-

Test the algorithm implementation

Parameters
+

Test the algorithm implementation

Parameters
[in]test_dataarray of data to test the algorithms
-
118  {
-
119  float mean = 0.f, variance = 0.f;
-
120 
-
121  stats_computer1<float> stats01;
-
122  stats_computer2<float> stats02;
-
123 
-
124  for (int i = 0; i < number_of_samples; i++) {
-
125  stats01.new_val(test_data[i]);
-
126  stats02.new_val(test_data[i]);
-
127  mean += test_data[i];
-
128  }
-
129 
-
130  mean /= number_of_samples;
-
131 
-
132  for (int i = 0; i < number_of_samples; i++) {
-
133  float temp = test_data[i] - mean;
-
134  variance += temp * temp;
-
135  }
-
136  variance /= number_of_samples;
-
137 
-
138  std::cout << "<<<<<<<< Test Function >>>>>>>>" << std::endl
-
139  << "Expected: Mean: " << mean << "\t Variance: " << variance
-
140  << std::endl;
-
141  std::cout << "\tMethod 1:"
-
142  << "\tMean: " << stats01.mean()
-
143  << "\t Variance: " << stats01.variance()
-
144  << "\t Std: " << stats01.std() << std::endl;
-
145  std::cout << "\tMethod 2:"
-
146  << "\tMean: " << stats02.mean()
-
147  << "\t Variance: " << stats02.variance()
-
148  << "\t Std: " << stats02.std() << std::endl;
-
149 
-
150  assert(std::abs(stats01.mean() - mean) < 0.01);
-
151  assert(std::abs(stats02.mean() - mean) < 0.01);
-
152  assert(std::abs(stats02.variance() - variance) < 0.01);
-
153 
-
154  std::cout << "(Tests passed)" << std::endl;
-
155 }
+
118 {
+
119 float mean = 0.f, variance = 0.f;
+
120
+ + +
123
+
124 for (int i = 0; i < number_of_samples; i++) {
+
125 stats01.new_val(test_data[i]);
+
126 stats02.new_val(test_data[i]);
+
127 mean += test_data[i];
+
128 }
+
129
+
130 mean /= number_of_samples;
+
131
+
132 for (int i = 0; i < number_of_samples; i++) {
+
133 float temp = test_data[i] - mean;
+
134 variance += temp * temp;
+
135 }
+
136 variance /= number_of_samples;
+
137
+
138 std::cout << "<<<<<<<< Test Function >>>>>>>>" << std::endl
+
139 << "Expected: Mean: " << mean << "\t Variance: " << variance
+
140 << std::endl;
+
141 std::cout << "\tMethod 1:"
+
142 << "\tMean: " << stats01.mean()
+
143 << "\t Variance: " << stats01.variance()
+
144 << "\t Std: " << stats01.std() << std::endl;
+
145 std::cout << "\tMethod 2:"
+
146 << "\tMean: " << stats02.mean()
+
147 << "\t Variance: " << stats02.variance()
+
148 << "\t Std: " << stats02.std() << std::endl;
+
149
+
150 assert(std::abs(stats01.mean() - mean) < 0.01);
+
151 assert(std::abs(stats02.mean() - mean) < 0.01);
+
152 assert(std::abs(stats02.variance() - variance) < 0.01);
+
153
+
154 std::cout << "(Tests passed)" << std::endl;
+
155}
Here is the call graph for this function:
@@ -304,7 +303,7 @@ Here is the call graph for this function:
diff --git a/d0/d08/realtime__stats_8cpp.js b/d0/d08/realtime__stats_8cpp.js index af9f2b0bf..713c79d54 100644 --- a/d0/d08/realtime__stats_8cpp.js +++ b/d0/d08/realtime__stats_8cpp.js @@ -1,7 +1,7 @@ var realtime__stats_8cpp = [ - [ "stats_computer1", "d7/d7c/classstatistics_1_1stats__computer1.html", "d7/d7c/classstatistics_1_1stats__computer1" ], - [ "stats_computer2", "d8/dab/classstatistics_1_1stats__computer2.html", "d8/dab/classstatistics_1_1stats__computer2" ], + [ "statistics::stats_computer1< T >", "d7/d7c/classstatistics_1_1stats__computer1.html", "d7/d7c/classstatistics_1_1stats__computer1" ], + [ "statistics::stats_computer2< T >", "d8/dab/classstatistics_1_1stats__computer2.html", "d8/dab/classstatistics_1_1stats__computer2" ], [ "main", "d0/d08/realtime__stats_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], [ "test_function", "d0/d08/realtime__stats_8cpp.html#aa54c915581fcc495489175a4386d59fd", null ] ]; \ No newline at end of file diff --git a/d0/d08/realtime__stats_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d0/d08/realtime__stats_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg index 494416195..110fe5323 100644 --- a/d0/d08/realtime__stats_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg +++ b/d0/d08/realtime__stats_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -1,7 +1,7 @@ - diff --git a/d0/d08/realtime__stats_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg b/d0/d08/realtime__stats_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg index 58164b4fa..fc1fab43f 100644 --- a/d0/d08/realtime__stats_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg +++ b/d0/d08/realtime__stats_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d1/d77/structmst.html','../../'); init
-
-
mst Member List
+
mst Member List

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

- +
key (defined in mst)mst
near (defined in mst)mst
near (defined in mst)mst
visited (defined in mst)mst
diff --git a/d0/d1f/structnode__coll__graph.map b/d0/d1f/structnode__coll__graph.map index 2a2ed3c9d..ecb3e02bb 100644 --- a/d0/d1f/structnode__coll__graph.map +++ b/d0/d1f/structnode__coll__graph.map @@ -1,3 +1,4 @@ - + + diff --git a/d0/d1f/structnode__coll__graph.md5 b/d0/d1f/structnode__coll__graph.md5 index 36ff390a2..89d446b1d 100644 --- a/d0/d1f/structnode__coll__graph.md5 +++ b/d0/d1f/structnode__coll__graph.md5 @@ -1 +1 @@ -f6a4569b959d550a9a80e5d43cc05a9a \ No newline at end of file +b47e95560f5cdce3c44b6e2747eb7274 \ No newline at end of file diff --git a/d0/d1f/structnode__coll__graph.svg b/d0/d1f/structnode__coll__graph.svg index b973b64ad..efa4d419d 100644 --- a/d0/d1f/structnode__coll__graph.svg +++ b/d0/d1f/structnode__coll__graph.svg @@ -1,34 +1,55 @@ - - - + + node< Kind > - + Node1 - -node< Kind > + +node< Kind > - + + +Node2 + + +node< Kind > + + + + -Node1->Node1 - - - left -link -next -parent -prev -right +Node2->Node1 + + + left +link +next +parent +prev +right + + + +Node2->Node2 + + + left +link +next +parent +prev +right diff --git a/d0/d24/classgraph_1_1_rooted_tree__coll__graph.map b/d0/d24/classgraph_1_1_rooted_tree__coll__graph.map index 821b3837a..4b166f97a 100644 --- a/d0/d24/classgraph_1_1_rooted_tree__coll__graph.map +++ b/d0/d24/classgraph_1_1_rooted_tree__coll__graph.map @@ -1,8 +1,4 @@ - - - - - - + + diff --git a/d0/d24/classgraph_1_1_rooted_tree__coll__graph.md5 b/d0/d24/classgraph_1_1_rooted_tree__coll__graph.md5 index e3a765f3d..5a7e69154 100644 --- a/d0/d24/classgraph_1_1_rooted_tree__coll__graph.md5 +++ b/d0/d24/classgraph_1_1_rooted_tree__coll__graph.md5 @@ -1 +1 @@ -47627de4d082c3cad65ec7919eba8e88 \ No newline at end of file +c3f0587b7ce635ad22cbbaae6da2b585 \ No newline at end of file diff --git a/d0/d24/classgraph_1_1_rooted_tree__coll__graph.svg b/d0/d24/classgraph_1_1_rooted_tree__coll__graph.svg index 1bb48f677..0190e2b5d 100644 --- a/d0/d24/classgraph_1_1_rooted_tree__coll__graph.svg +++ b/d0/d24/classgraph_1_1_rooted_tree__coll__graph.svg @@ -1,14 +1,14 @@ - - - + + graph::RootedTree - + Node1 @@ -22,90 +22,16 @@ Node2 - -graph::Graph< T > + +graph::Graph< T > Node2->Node1 - - - - - -Node3 - - -std::vector< std::vector -< int > > - - - - - -Node3->Node2 - - - neighbors - - - -Node4 - - -std::vector< int > - - - - - -Node4->Node1 - - - level -parent - - - -Node4->Node3 - - - elements - - - -Node5 - - -std::map< T, std::list -< T > > - - - - - -Node5->Node2 - - - adjacency_list - - - -Node6 - - -T - - - - - -Node6->Node5 - - - keys + + diff --git a/d0/d2c/class_r_btree__coll__graph.svg b/d0/d2c/class_r_btree__coll__graph.svg index f0baac551..f9eed4527 100644 --- a/d0/d2c/class_r_btree__coll__graph.svg +++ b/d0/d2c/class_r_btree__coll__graph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: neural_network Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d0/d2e/namespaceneural__network.html',
-
-
neural_network Namespace Reference
+
neural_network Namespace Reference

Neural Network or Multilayer Perceptron. More...

Detailed Description

-

Neural Network or Multilayer Perceptron.

+

Neural Network or Multilayer Perceptron.

diff --git a/d0/d3e/classdata__structures_1_1trie.html b/d0/d3e/classdata__structures_1_1trie.html index eafd2a732..36ab53218 100644 --- a/d0/d3e/classdata__structures_1_1trie.html +++ b/d0/d3e/classdata__structures_1_1trie.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: data_structures::trie Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -96,18 +96,17 @@ $(document).ready(function(){initNavTree('d0/d3e/classdata__structures_1_1trie.h Private Attributes | Static Private Attributes | List of all members -
-
data_structures::trie Class Reference
+
data_structures::trie Class Reference
-

Trie implementation for small-case English alphabets a-z +

Trie implementation for small-case English alphabets a-z More...

- - + @@ -117,7 +116,7 @@ Public Member Functions

+

Public Member Functions

trie ()=default
trie ()=default
 Class default constructor.
 
void insert (const std::string &str)
bool deleteString (const std::string &str, int index)
 
- @@ -125,28 +124,28 @@ Private Member Functions

+

Private Member Functions

uint8_t char_to_int (const char &ch) const
 Convert a character to integer for indexing. More...
bool search (const std::shared_ptr< trie > &root, const std::string &str, int index)
 
- - + - +

+

Private Attributes

-std::array< std::shared_ptr< trie >, NUM_CHARS<< 1 > arr
+std::array< std::shared_ptr< trie >, NUM_CHARS<< 1 > arr
 Recursive tree nodes as an array of shared-pointers.
 
-bool isEndofWord = false
+bool isEndofWord = false
 identifier if a node is terminal node
 
- - +

+

Static Private Attributes

-static constexpr uint8_t NUM_CHARS = 26
+static constexpr uint8_t NUM_CHARS = 26
 Number of alphabets.
 

Detailed Description

-

Trie implementation for small-case English alphabets a-z

+

Trie implementation for small-case English alphabets a-z

Member Function Documentation

- +

◆ char_to_int()

@@ -178,17 +177,17 @@ static constexpr uint8_t 
Returns
unsigned integer index
-
38  {
-
39  if (ch >= 'A' && ch <= 'Z') {
-
40  return ch - 'A';
-
41  } else if (ch >= 'a' && ch <= 'z') {
-
42  return ch - 'a' + NUM_CHARS;
-
43  }
-
44 
-
45  std::cerr << "Invalid character present. Exiting...";
-
46  std::exit(EXIT_FAILURE);
-
47  return 0;
-
48  }
+
38 {
+
39 if (ch >= 'A' && ch <= 'Z') {
+
40 return ch - 'A';
+
41 } else if (ch >= 'a' && ch <= 'z') {
+
42 return ch - 'a' + NUM_CHARS;
+
43 }
+
44
+
45 std::cerr << "Invalid character present. Exiting...";
+
46 std::exit(EXIT_FAILURE);
+
47 return 0;
+
48 }
static constexpr uint8_t NUM_CHARS
Number of alphabets.
Definition: trie_tree.cpp:27
T exit(T... args)
@@ -201,7 +200,7 @@ Here is the call graph for this function:
- +

◆ deleteString()

@@ -234,7 +233,7 @@ Here is the call graph for this function:
-

removes the string if it is not a prefix of any other string, if it is then just sets the ::data_structure::trie::isEndofWord to false, else removes the given string

Note
the function ::data_structure::trie::deleteString might be erroneous
+

removes the string if it is not a prefix of any other string, if it is then just sets the ::data_structure::trie::isEndofWord to false, else removes the given string

Note
the function ::data_structure::trie::deleteString might be erroneous
Todo:
review the function ::data_structure::trie::deleteString and the commented lines
Parameters
@@ -246,43 +245,43 @@ Here is the call graph for this function:
Returns
true if successful
false if unsuccessful
-
134  {
-
135  if (index == str.length()) {
-
136  if (!isEndofWord) {
-
137  return false;
-
138  }
-
139  isEndofWord = false;
-
140  // following lines - possible source of error?
-
141  // for (int i = 0; i < NUM_CHARS; i++)
-
142  // if (!arr[i])
-
143  // return false;
-
144  return true;
-
145  }
-
146  int j = char_to_int(str[index]);
-
147  if (!arr[j]) {
-
148  return false;
-
149  }
-
150  bool var = deleteString(str, index + 1);
-
151  if (var) {
-
152  arr[j].reset();
-
153  if (isEndofWord) {
-
154  return false;
-
155  } else {
-
156  int i = 0;
-
157  for (i = 0; i < NUM_CHARS; i++) {
-
158  if (arr[i]) {
-
159  return false;
-
160  }
-
161  }
-
162  return true;
-
163  }
-
164  }
-
165 
-
166  /* should not return here */
-
167  std::cout << __func__ << ":" << __LINE__
-
168  << "Should not reach this line\n";
-
169  return false;
-
170  }
+
134 {
+
135 if (index == str.length()) {
+
136 if (!isEndofWord) {
+
137 return false;
+
138 }
+
139 isEndofWord = false;
+
140 // following lines - possible source of error?
+
141 // for (int i = 0; i < NUM_CHARS; i++)
+
142 // if (!arr[i])
+
143 // return false;
+
144 return true;
+
145 }
+
146 int j = char_to_int(str[index]);
+
147 if (!arr[j]) {
+
148 return false;
+
149 }
+
150 bool var = deleteString(str, index + 1);
+
151 if (var) {
+
152 arr[j].reset();
+
153 if (isEndofWord) {
+
154 return false;
+
155 } else {
+
156 int i = 0;
+
157 for (i = 0; i < NUM_CHARS; i++) {
+
158 if (arr[i]) {
+
159 return false;
+
160 }
+
161 }
+
162 return true;
+
163 }
+
164 }
+
165
+
166 /* should not return here */
+
167 std::cout << __func__ << ":" << __LINE__
+
168 << "Should not reach this line\n";
+
169 return false;
+
170 }
std::array< std::shared_ptr< trie >, NUM_CHARS<< 1 > arr
Recursive tree nodes as an array of shared-pointers.
Definition: trie_tree.cpp:29
bool isEndofWord
identifier if a node is terminal node
Definition: trie_tree.cpp:30
uint8_t char_to_int(const char &ch) const
Convert a character to integer for indexing.
Definition: trie_tree.cpp:38
@@ -297,7 +296,7 @@ Here is the call graph for this function:
- +

◆ insert()

@@ -320,41 +319,41 @@ Here is the call graph for this function:
-

insert string into the trie

Parameters
+

insert string into the trie

Parameters
strString to insert in the tree
-
77  {
-
78  std::shared_ptr<trie> root(nullptr);
-
79 
-
80  for (const char& ch : str) {
-
81  int j = char_to_int(ch);
-
82  if (root) {
-
83  if (root->arr[j]) {
-
84  root = root->arr[j];
-
85  } else {
-
86  std::shared_ptr<trie> temp(new trie());
-
87  root->arr[j] = temp;
-
88  root = temp;
-
89  }
-
90  } else if (arr[j]) {
-
91  root = arr[j];
-
92  } else {
-
93  std::shared_ptr<trie> temp(new trie());
-
94  arr[j] = temp;
-
95  root = temp;
-
96  }
-
97  }
-
98  root->isEndofWord = true;
-
99  }
+
77 {
+
78 std::shared_ptr<trie> root(nullptr);
+
79
+
80 for (const char& ch : str) {
+
81 int j = char_to_int(ch);
+
82 if (root) {
+
83 if (root->arr[j]) {
+
84 root = root->arr[j];
+
85 } else {
+
86 std::shared_ptr<trie> temp(new trie());
+
87 root->arr[j] = temp;
+
88 root = temp;
+
89 }
+
90 } else if (arr[j]) {
+
91 root = arr[j];
+
92 } else {
+
93 std::shared_ptr<trie> temp(new trie());
+
94 arr[j] = temp;
+
95 root = temp;
+
96 }
+
97 }
+
98 root->isEndofWord = true;
+
99 }
trie()=default
Class default constructor.
- +

◆ search() [1/2]

@@ -393,7 +392,7 @@ Here is the call graph for this function:
-

search a string exists inside a given root trie

Parameters
+

search a string exists inside a given root trie

Parameters
@@ -403,24 +402,24 @@ Here is the call graph for this function:
Returns
true if found
false if not found
-
57  {
-
58  if (index == str.length()) {
-
59  if (!root->isEndofWord) {
-
60  return false;
-
61  }
-
62  return true;
-
63  }
-
64  int j = char_to_int(str[index]);
-
65  if (!root->arr[j]) {
-
66  return false;
-
67  }
-
68  return search(root->arr[j], str, index + 1);
-
69  }
+
57 {
+
58 if (index == str.length()) {
+
59 if (!root->isEndofWord) {
+
60 return false;
+
61 }
+
62 return true;
+
63 }
+
64 int j = char_to_int(str[index]);
+
65 if (!root->arr[j]) {
+
66 return false;
+
67 }
+
68 return search(root->arr[j], str, index + 1);
+
69 }
bool search(const std::shared_ptr< trie > &root, const std::string &str, int index)
Definition: trie_tree.cpp:56
- +

◆ search() [2/2]

@@ -453,7 +452,7 @@ Here is the call graph for this function:
strstring to search for
indexstart index to search from
-

search a string exists inside the trie

Parameters
+

search a string exists inside the trie

Parameters
@@ -463,19 +462,19 @@ Here is the call graph for this function:
Returns
true if found
false if not found
-
107  {
-
108  if (index == str.length()) {
-
109  if (!isEndofWord) {
-
110  return false;
-
111  }
-
112  return true;
-
113  }
-
114  int j = char_to_int(str[index]);
-
115  if (!arr[j]) {
-
116  return false;
-
117  }
-
118  return search(arr[j], str, index + 1);
-
119  }
+
107 {
+
108 if (index == str.length()) {
+
109 if (!isEndofWord) {
+
110 return false;
+
111 }
+
112 return true;
+
113 }
+
114 int j = char_to_int(str[index]);
+
115 if (!arr[j]) {
+
116 return false;
+
117 }
+
118 return search(arr[j], str, index + 1);
+
119 }
Here is the call graph for this function:
@@ -494,7 +493,7 @@ Here is the call graph for this function:
diff --git a/d0/d3e/classdata__structures_1_1trie_a499f87fd833203ef9492b4870aa6d42d_cgraph.svg b/d0/d3e/classdata__structures_1_1trie_a499f87fd833203ef9492b4870aa6d42d_cgraph.svg index e77e5e739..1e25c14c1 100644 --- a/d0/d3e/classdata__structures_1_1trie_a499f87fd833203ef9492b4870aa6d42d_cgraph.svg +++ b/d0/d3e/classdata__structures_1_1trie_a499f87fd833203ef9492b4870aa6d42d_cgraph.svg @@ -1,7 +1,7 @@ - - - + + +Node1->Node1 + + + Node2 @@ -45,7 +51,7 @@ - + Node1->Node4 diff --git a/d0/d46/finding__number__of__digits__in__a__number_8cpp.html b/d0/d46/finding__number__of__digits__in__a__number_8cpp.html new file mode 100644 index 000000000..ac33a1368 --- /dev/null +++ b/d0/d46/finding__number__of__digits__in__a__number_8cpp.html @@ -0,0 +1,261 @@ + + + + + + + +Algorithms_in_C++: math/finding_number_of_digits_in_a_number.cpp File Reference + + + + + + + + + + + + + + + +
+
+
strstring to search for
indexstart index to search from
+ + + + + +
+
Algorithms_in_C++ 1.0.0 +
+
Set of algorithms implemented in C++.
+
+
+ + + + + + + + +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
finding_number_of_digits_in_a_number.cpp File Reference
+
+
+ +

[Program to count digits in an integer](https://www.geeksforgeeks.org/program-count-digits-integer-3-different-methods) +More...

+
#include <cassert>
+#include <iostream>
+
+Include dependency graph for finding_number_of_digits_in_a_number.cpp:
+
+
+
+
+
+ + + + + + + + + + +

+Functions

uint64_t finding_number_of_digits_in_a_number (uint64_t n)
 for IO operations More...
 
static void test ()
 Self-test implementations. More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

[Program to count digits in an integer](https://www.geeksforgeeks.org/program-count-digits-integer-3-different-methods)

+
Author
aminos 🇮🇳
+

It is a very basic math of finding number of digits in a given number i.e, we can use it by inputting values whether it can be a positive/negative value, let's say: an integer. There is also a second method: by using "K = floor(log10(N) + 1)", but it's only applicable for numbers (not integers). For more details, refer to the Algorithms-Explanation repository.

+

Function Documentation

+ +

◆ finding_number_of_digits_in_a_number()

+ +
+
+ + + + + + + + +
uint64_t finding_number_of_digits_in_a_number (uint64_t n)
+
+ +

for IO operations

+

for assert

+

The main function that checks the number of digits in a number.

Parameters
+ + +
nthe number to check its digits
+
+
+
Returns
the digits count
+

< the variable used for the digits count

+
27 {
+
28 uint64_t count = 0; ///< the variable used for the digits count
+
29
+
30 // iterate until `n` becomes 0
+
31 // remove last digit from `n` in each iteration
+
32 // increase `count` by 1 in each iteration
+
33 while (n != 0) {
+
34 // we can also use `n = n / 10`
+
35 n /= 10;
+
36 // each time the loop is running, `count` will be incremented by 1.
+
37 ++count;
+
38 }
+
39
+
40 return count;
+
41}
+
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + +
int main (void )
+
+ +

Main function.

+
Returns
0 on exit
+
63 {
+
64 test(); // run self-test implementations
+
65 return 0;
+
66}
+
static void test()
Self-test implementations.
Definition: finding_number_of_digits_in_a_number.cpp:47
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test()

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

Self-test implementations.

+
Returns
void
+
47 {
+
48 assert(finding_number_of_digits_in_a_number(5492) == 4);
+ +
50 assert(finding_number_of_digits_in_a_number(10000) == 5);
+ +
52 assert(finding_number_of_digits_in_a_number(100000) == 6);
+ + +
55
+
56 std::cout << "All tests have successfully passed!\n";
+
57}
+ +
uint64_t finding_number_of_digits_in_a_number(uint64_t n)
for IO operations
Definition: finding_number_of_digits_in_a_number.cpp:27
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d0/d46/finding__number__of__digits__in__a__number_8cpp.js b/d0/d46/finding__number__of__digits__in__a__number_8cpp.js new file mode 100644 index 000000000..c0cf9cae0 --- /dev/null +++ b/d0/d46/finding__number__of__digits__in__a__number_8cpp.js @@ -0,0 +1,6 @@ +var finding__number__of__digits__in__a__number_8cpp = +[ + [ "finding_number_of_digits_in_a_number", "d0/d46/finding__number__of__digits__in__a__number_8cpp.html#a8a3b522a675ab4cdec2d275f6f7798a1", null ], + [ "main", "d0/d46/finding__number__of__digits__in__a__number_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "test", "d0/d46/finding__number__of__digits__in__a__number_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] +]; \ No newline at end of file diff --git a/d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..20de22964 --- /dev/null +++ b/d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..280cf9b7b --- /dev/null +++ b/d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +a77ae5d31e83e6b30fa2f4d9726c1a23 \ No newline at end of file diff --git a/d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..bce336eef --- /dev/null +++ b/d0/d46/finding__number__of__digits__in__a__number_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,38 @@ + + + + + + +test + + + +Node1 + + +test + + + + + +Node2 + + +finding_number_of_digits +_in_a_number + + + + + +Node1->Node2 + + + + + diff --git a/d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..409e8c881 --- /dev/null +++ b/d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..fa45fff73 --- /dev/null +++ b/d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +7e348189bb432c44671b8f6f7fba747b \ No newline at end of file diff --git a/d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..0ce3e121c --- /dev/null +++ b/d0/d46/finding__number__of__digits__in__a__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,53 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test + + + + + +Node1->Node2 + + + + + +Node3 + + +finding_number_of_digits +_in_a_number + + + + + +Node2->Node3 + + + + + diff --git a/d0/d4c/structothers_1_1iterative__tree__traversals_1_1_node__coll__graph.svg b/d0/d4c/structothers_1_1iterative__tree__traversals_1_1_node__coll__graph.svg index cc4ba45b5..3f0b91b16 100644 --- a/d0/d4c/structothers_1_1iterative__tree__traversals_1_1_node__coll__graph.svg +++ b/d0/d4c/structothers_1_1iterative__tree__traversals_1_1_node__coll__graph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: wiggle_sort Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d0/d52/namespacewiggle__sort.html','..
-
-
wiggle_sort Namespace Reference
+
wiggle_sort Namespace Reference
-

Functions for Wiggle Sort algorithm. +

Functions for Wiggle Sort algorithm. More...

Detailed Description

-

Functions for Wiggle Sort algorithm.

+

Functions for Wiggle Sort algorithm.

diff --git a/d0/d55/classcll-members.html b/d0/d55/classcll-members.html index 7d75a9cdd..ca39cbca5 100644 --- a/d0/d55/classcll-members.html +++ b/d0/d55/classcll-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,30 +90,29 @@ $(document).ready(function(){initNavTree('d5/d15/classcll.html','../../'); initR
-
-
cll Member List
+
cll Member List

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

- + - + - + - + - +
cll() (defined in cll)cll
display() (defined in cll)cll
display() (defined in cll)cll
find_item(int item_to_find) (defined in cll)cll
get_size() (defined in cll)cll
get_size() (defined in cll)cll
head (defined in cll)cllprotected
insert_front(int new_data) (defined in cll)cll
insert_front(int new_data) (defined in cll)cll
insert_tail(int new_data) (defined in cll)cll
operator*() (defined in cll)cll
operator*() (defined in cll)cll
operator++() (defined in cll)cll
total (defined in cll)cllprotected
total (defined in cll)cllprotected
~cll() (defined in cll)cll
diff --git a/d0/d58/classgraph_1_1_rooted_tree.html b/d0/d58/classgraph_1_1_rooted_tree.html index 1bb22c56d..77911d077 100644 --- a/d0/d58/classgraph_1_1_rooted_tree.html +++ b/d0/d58/classgraph_1_1_rooted_tree.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: graph::RootedTree Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -95,8 +95,7 @@ $(document).ready(function(){initNavTree('d0/d58/classgraph_1_1_rooted_tree.html Public Attributes | Protected Member Functions | List of all members -
-
graph::RootedTree Class Reference
+
graph::RootedTree Class Reference
@@ -108,11 +107,11 @@ Inheritance diagram for graph::RootedTree:
Collaboration diagram for graph::RootedTree:
-
+
[legend]
- @@ -120,44 +119,44 @@ Public Member Functions - - + +

+

Public Member Functions

 RootedTree (const std::vector< std::pair< int, int > > &undirected_edges, int root_)
 Constructs the tree by calculating parent for every vertex. Assumes a valid description of a tree is provided. More...
- Public Member Functions inherited from graph::Graph< T >
void add_edge (T u, T v, bool bidir=true)
 
std::map< T, bool > breadth_first_search (T src)
 
std::map< T, bool > breadth_first_search (T src)
 
 Graph (size_t N, const std::vector< std::pair< int, int > > &undirected_edges)
 Populate the adjacency list for each vertex in the graph. Assumes that evey edge is a pair of valid vertex indices. More...
 
int number_of_vertices () const
 
- - + - + - + - +

+

Public Attributes

-std::vector< int > parent
+std::vector< int > parent
 Stores parent of every vertex and for root its own index. The root is technically not its own parent, but it's very practical for the lowest common ancestor algorithm.
 
-std::vector< int > level
+std::vector< int > level
 Stores the distance from the root.
 
-int root
+int root
 Index of the root vertex.
 
- Public Attributes inherited from graph::Graph< T >
-std::vector< std::vector< int > > neighbors
+std::vector< std::vector< int > > neighbors
 for each vertex it stores a list indicies of its neighbors
 
-

+

Protected Member Functions

void populate_parents ()
 Calculate the parents for all the vertices in the tree. Implements the breadth first search algorithm starting from the root vertex searching the entire tree and labeling parents for all vertices. More...
 

Detailed Description

-

Representation of a rooted tree. For every vertex its parent is precalculated.

+

Representation of a rooted tree. For every vertex its parent is precalculated.

Constructor & Destructor Documentation

- +

◆ RootedTree()

@@ -199,9 +198,9 @@ Protected Member Functions -
95  : Graph(undirected_edges.size() + 1, undirected_edges), root(root_) {
- -
97  }
+
95 : Graph(undirected_edges.size() + 1, undirected_edges), root(root_) {
+ +
97 }
Definition: bellman_ford.cpp:13
int root
Index of the root vertex.
Definition: lowest_common_ancestor.cpp:108
void populate_parents()
Calculate the parents for all the vertices in the tree. Implements the breadth first search algorithm...
Definition: lowest_common_ancestor.cpp:117
@@ -210,7 +209,7 @@ Protected Member Functions

Member Function Documentation

- +

◆ populate_parents()

@@ -235,28 +234,28 @@ Protected Member Functions

Calculate the parents for all the vertices in the tree. Implements the breadth first search algorithm starting from the root vertex searching the entire tree and labeling parents for all vertices.

Returns
none
-
117  {
-
118  // Initialize the vector with -1 which indicates the vertex
-
119  // wasn't yet visited.
- - -
122  parent[root] = root;
-
123  level[root] = 0;
-
124  std::queue<int> queue_of_vertices;
-
125  queue_of_vertices.push(root);
-
126  while (!queue_of_vertices.empty()) {
-
127  int vertex = queue_of_vertices.front();
-
128  queue_of_vertices.pop();
-
129  for (int neighbor : neighbors[vertex]) {
-
130  // As long as the vertex was not yet visited.
-
131  if (parent[neighbor] == -1) {
-
132  parent[neighbor] = vertex;
-
133  level[neighbor] = level[vertex] + 1;
-
134  queue_of_vertices.push(neighbor);
-
135  }
-
136  }
-
137  }
-
138  }
+
117 {
+
118 // Initialize the vector with -1 which indicates the vertex
+
119 // wasn't yet visited.
+ + +
122 parent[root] = root;
+
123 level[root] = 0;
+
124 std::queue<int> queue_of_vertices;
+
125 queue_of_vertices.push(root);
+
126 while (!queue_of_vertices.empty()) {
+
127 int vertex = queue_of_vertices.front();
+
128 queue_of_vertices.pop();
+
129 for (int neighbor : neighbors[vertex]) {
+
130 // As long as the vertex was not yet visited.
+
131 if (parent[neighbor] == -1) {
+
132 parent[neighbor] = vertex;
+
133 level[neighbor] = level[vertex] + 1;
+
134 queue_of_vertices.push(neighbor);
+
135 }
+
136 }
+
137 }
+
138 }
std::vector< std::vector< int > > neighbors
for each vertex it stores a list indicies of its neighbors
Definition: lowest_common_ancestor.cpp:77
int number_of_vertices() const
Definition: lowest_common_ancestor.cpp:74
std::vector< int > level
Stores the distance from the root.
Definition: lowest_common_ancestor.cpp:106
@@ -266,11 +265,11 @@ Protected Member Functions
T pop(T... args)
T push(T... args)
- +
Here is the call graph for this function:
-
+
@@ -285,7 +284,7 @@ Here is the call graph for this function:
diff --git a/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.map b/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.map index 75179e1bb..02f6ba50f 100644 --- a/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.map +++ b/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.map @@ -3,7 +3,6 @@ - - - + + diff --git a/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.md5 b/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.md5 index 8e1aae6ac..3841874b0 100644 --- a/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.md5 +++ b/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.md5 @@ -1 +1 @@ -bc920f285b3152dc7c7b711077dbe589 \ No newline at end of file +5140188bde807e8ce6c880ee55e7f442 \ No newline at end of file diff --git a/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.svg b/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.svg index c7ab1c7f6..7421524bc 100644 --- a/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.svg +++ b/d0/d58/classgraph_1_1_rooted_tree_ae6928f3ebd491541e9570e746b877c1e_cgraph.svg @@ -1,14 +1,14 @@ - - + graph::RootedTree::populate_parents - + Node1 @@ -65,50 +65,35 @@ + + +Node5 + + +std::queue::pop + + + + + +Node1->Node5 + + + Node6 - - -std::queue::pop + + +std::queue::push Node1->Node6 - - - - - -Node7 - - -std::queue::push - - - - - -Node1->Node7 - - -Node5 - - -std::vector::size - - - - - -Node4->Node5 - - - diff --git a/d0/d59/uint256__t_8hpp__dep__incl.svg b/d0/d59/uint256__t_8hpp__dep__incl.svg index d2cbc37e1..946da7326 100644 --- a/d0/d59/uint256__t_8hpp__dep__incl.svg +++ b/d0/d59/uint256__t_8hpp__dep__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: data_structures/skip_list.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -95,8 +95,7 @@ $(document).ready(function(){initNavTree('d0/d5a/skip__list_8cpp.html','../../') Namespaces | Functions | Variables
-
-
skip_list.cpp File Reference
+
skip_list.cpp File Reference
@@ -115,43 +114,43 @@ Include dependency graph for skip_list.cpp:
-

+

Classes

struct  data_structures::Node
 
class  data_structures::SkipList
 
- - +

+

Namespaces

 data_structures
namespace  data_structures
 Data Structures algorithms.
 
-

+

Functions

int main ()
 
- - + - +

+

Variables

-constexpr int data_structures::MAX_LEVEL = 2
+constexpr int data_structures::MAX_LEVEL = 2
 Maximum level of skip list.
 
-constexpr float data_structures::PROBABILITY = 0.5
+constexpr float data_structures::PROBABILITY = 0.5
 Current probability for "coin toss".
 

Detailed Description

-

Data structure for fast searching and insertion in \(O(\log n)\) time.

-

A skip list is a data structure that is used for storing a sorted list of items with a help of hierarchy of linked lists that connect increasingly sparse subsequences of the items

-

References used: GeeksForGeek, OpenGenus for PseudoCode and Code

Author
enqidu
+

Data structure for fast searching and insertion in \(O(\log n)\) time.

+

A skip list is a data structure that is used for storing a sorted list of items with a help of hierarchy of linked lists that connect increasingly sparse subsequences of the items

+

References used: GeeksForGeek, OpenGenus for PseudoCode and Code

Author
enqidu
-Krishna Vedala
+Krishna Vedala

Function Documentation

- +

◆ main()

@@ -166,21 +165,21 @@ constexpr float 
-

Main function: Creates and inserts random 2^[number of levels] elements into the skip lists and than displays it

-
212  {
-
213  std::srand(std::time(nullptr));
-
214 
- -
216 
-
217  for (int j = 0; j < (1 << (data_structures::MAX_LEVEL + 1)); j++) {
-
218  int k = (std::rand() % (1 << (data_structures::MAX_LEVEL + 2)) + 1);
-
219  lst.insertElement(k, &j);
-
220  }
-
221 
-
222  lst.displayList();
-
223 
-
224  return 0;
-
225 }
+

Main function: Creates and inserts random 2^[number of levels] elements into the skip lists and than displays it

+
212 {
+
213 std::srand(std::time(nullptr));
+
214
+ +
216
+
217 for (int j = 0; j < (1 << (data_structures::MAX_LEVEL + 1)); j++) {
+
218 int k = (std::rand() % (1 << (data_structures::MAX_LEVEL + 2)) + 1);
+
219 lst.insertElement(k, &j);
+
220 }
+
221
+
222 lst.displayList();
+
223
+
224 return 0;
+
225}
Definition: skip_list.cpp:55
void insertElement(int key, void *value)
Definition: skip_list.cpp:90
void displayList()
Definition: skip_list.cpp:191
@@ -203,7 +202,7 @@ Here is the call graph for this function:
diff --git a/d0/d5a/skip__list_8cpp.js b/d0/d5a/skip__list_8cpp.js index b69229858..22e01fb32 100644 --- a/d0/d5a/skip__list_8cpp.js +++ b/d0/d5a/skip__list_8cpp.js @@ -1,7 +1,7 @@ var skip__list_8cpp = [ - [ "Node", "d9/d49/structdata__structures_1_1_node.html", "d9/d49/structdata__structures_1_1_node" ], - [ "SkipList", "d4/d90/classdata__structures_1_1_skip_list.html", "d4/d90/classdata__structures_1_1_skip_list" ], + [ "data_structures::Node", "d9/d49/structdata__structures_1_1_node.html", "d9/d49/structdata__structures_1_1_node" ], + [ "data_structures::SkipList", "d4/d90/classdata__structures_1_1_skip_list.html", "d4/d90/classdata__structures_1_1_skip_list" ], [ "main", "d0/d5a/skip__list_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "MAX_LEVEL", "d0/d5a/skip__list_8cpp.html#ac0d7e0be24da9f41bcb19745873c436a", null ], [ "PROBABILITY", "d0/d5a/skip__list_8cpp.html#a903639d8e6f955dd8d5c263781455d61", null ] diff --git a/d0/d5a/skip__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d0/d5a/skip__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index a5d5a85d7..29e8a0a9e 100644 --- a/d0/d5a/skip__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d0/d5a/skip__list_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: operations_on_datastructures::trie_operations::Tnode Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -95,34 +95,26 @@ $(document).ready(function(){initNavTree('d0/d5f/classoperations__on__datastruct Private Attributes | Static Private Attributes | List of all members -
-
operations_on_datastructures::trie_operations::Tnode Class Reference
+
operations_on_datastructures::trie_operations::Tnode Class Reference

Class defining the structure of trie node and containing the methods to perform operations on them. More...

-
-Collaboration diagram for operations_on_datastructures::trie_operations::Tnode:
-
-
-
-
[legend]
- - + - - - + - - + @@ -154,28 +146,124 @@ Public Member Functions

+

Public Member Functions

Tnode (const Tnode &node)
 Tnode (const Tnode &node)
 
+
Tnodeoperator= (const Tnode &node)=default
 
+
 
 Tnode (Tnode &&)=default
 
+
Tnodeoperator= (Tnode &&)=default
 
 
uint8_t numberOfChildren (Tnode *node)
 Function to count the number of children a node in the trie has. More...
 
 Function to display the 3 suggestions with highest frequency of search hits. More...
 
- - - -

+

Private Attributes

+
std::vector< Tnode * > english
 
+
bool endOfWord
 
+
uint32_t frequency
 
- -

+

Static Private Attributes

+
static constexpr uint8_t ENGLISH_ALPHABET_SIZE = 26
 

Detailed Description

-

Class defining the structure of trie node and containing the methods to perform operations on them.

-

Member Function Documentation

- +

Class defining the structure of trie node and containing the methods to perform operations on them.

+

Constructor & Destructor Documentation

+ +

◆ Tnode() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
operations_on_datastructures::trie_operations::Tnode::Tnode ()
+
+inline
+
+
47 {
+
48 english.resize(ENGLISH_ALPHABET_SIZE, nullptr);
+
49 endOfWord = false;
+
50 frequency = 0;
+
51 }
+
+
+
+ +

◆ Tnode() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
operations_on_datastructures::trie_operations::Tnode::Tnode (const Tnodenode)
+
+inline
+
+
53 {
+
54 english = node.english;
+
55 endOfWord = node.endOfWord;
+
56 frequency = node.frequency;
+
57 }
+
Definition: avltree.cpp:13
+
+
+
+ +

◆ ~Tnode()

+ +
+
+ + + + + +
+ + + + + + + +
operations_on_datastructures::trie_operations::Tnode::~Tnode ()
+
+inline
+
+
90 {
+
91 int i = 0;
+
92 for (i = 0; i < ENGLISH_ALPHABET_SIZE; i++) {
+
93 if (english[i]) {
+
94 delete english[i];
+
95 }
+
96 }
+
97 }
+
+
+
+

Member Function Documentation

+

◆ Delete()

@@ -198,66 +286,66 @@ static constexpr uint8_t E -
150  {
-
151  Tnode *cur_pos = this,
-
152  *delete_from = this; // Current pointer pointing to root
-
153  int letter_index = 0, delete_from_index = 0, i = 0, n = entry.size();
-
154 
-
155  for (i = 0; i < n; i++) {
-
156  // To ignore case
-
157  letter_index = tolower(entry[i]) - 97;
-
158 
-
159  // Display error message when given entry is not present in the tree
-
160  if (cur_pos->english[letter_index] == nullptr) {
-
161  std::cout << "Entry not Found" << std::endl;
-
162  return;
-
163  }
-
164  // If the current node is end of word for the current prefix or if it
-
165  // has 2 or more branches It cannot be deleted while deleting the
-
166  // required entry.
-
167  if (numberOfChildren(cur_pos) > 1 || cur_pos->endOfWord) {
-
168  delete_from = cur_pos; // denotes the beginning of the shortest
-
169  // suffix that is allowed to be deleted
-
170  delete_from_index = i - 1; // Beginning index of the suffix
-
171  // corresponding to the 'entry'
-
172  }
-
173 
-
174  // Traversing through the entry
-
175  cur_pos = cur_pos->english[letter_index];
-
176  }
-
177 
-
178  // cur_pos now points to the last char of entry. Display message if that
-
179  // entry does not exist
-
180  if (!cur_pos->endOfWord) {
-
181  std::cout << "Entry not Found" << std::endl;
-
182  return;
-
183  }
-
184 
-
185  // If cur_pos is not a leaf node, unmark end of word and assign 0 to it's
-
186  // frequency for deletion
-
187  if (numberOfChildren(cur_pos)) {
-
188  cur_pos->endOfWord = false;
-
189  cur_pos->frequency = 0;
-
190  return;
-
191  }
-
192 
-
193  // The first character of the suffix to be deleted
-
194  letter_index = tolower(entry[delete_from_index + 1]) - 97;
-
195  // Point cur_pos to the next node
-
196  cur_pos = delete_from->english[letter_index];
-
197  // Sever the connection from the main trie
-
198  delete_from->english[letter_index] = nullptr;
-
199 
-
200  // If number of characters in the suffix are more than 1, recursively delete
-
201  // each character starting from cur_pos using the helper function
-
202  if (n > delete_from_index + 2) {
-
203  DeleteFrom(cur_pos, entry, delete_from_index + 2);
-
204  }
-
205  // If the suffix is only 1 char in length
-
206  else {
-
207  delete cur_pos;
-
208  }
-
209 }
+
150 {
+
151 Tnode *cur_pos = this,
+
152 *delete_from = this; // Current pointer pointing to root
+
153 int letter_index = 0, delete_from_index = 0, i = 0, n = entry.size();
+
154
+
155 for (i = 0; i < n; i++) {
+
156 // To ignore case
+
157 letter_index = tolower(entry[i]) - 97;
+
158
+
159 // Display error message when given entry is not present in the tree
+
160 if (cur_pos->english[letter_index] == nullptr) {
+
161 std::cout << "Entry not Found" << std::endl;
+
162 return;
+
163 }
+
164 // If the current node is end of word for the current prefix or if it
+
165 // has 2 or more branches It cannot be deleted while deleting the
+
166 // required entry.
+
167 if (numberOfChildren(cur_pos) > 1 || cur_pos->endOfWord) {
+
168 delete_from = cur_pos; // denotes the beginning of the shortest
+
169 // suffix that is allowed to be deleted
+
170 delete_from_index = i - 1; // Beginning index of the suffix
+
171 // corresponding to the 'entry'
+
172 }
+
173
+
174 // Traversing through the entry
+
175 cur_pos = cur_pos->english[letter_index];
+
176 }
+
177
+
178 // cur_pos now points to the last char of entry. Display message if that
+
179 // entry does not exist
+
180 if (!cur_pos->endOfWord) {
+
181 std::cout << "Entry not Found" << std::endl;
+
182 return;
+
183 }
+
184
+
185 // If cur_pos is not a leaf node, unmark end of word and assign 0 to it's
+
186 // frequency for deletion
+
187 if (numberOfChildren(cur_pos)) {
+
188 cur_pos->endOfWord = false;
+
189 cur_pos->frequency = 0;
+
190 return;
+
191 }
+
192
+
193 // The first character of the suffix to be deleted
+
194 letter_index = tolower(entry[delete_from_index + 1]) - 97;
+
195 // Point cur_pos to the next node
+
196 cur_pos = delete_from->english[letter_index];
+
197 // Sever the connection from the main trie
+
198 delete_from->english[letter_index] = nullptr;
+
199
+
200 // If number of characters in the suffix are more than 1, recursively delete
+
201 // each character starting from cur_pos using the helper function
+
202 if (n > delete_from_index + 2) {
+
203 DeleteFrom(cur_pos, entry, delete_from_index + 2);
+
204 }
+
205 // If the suffix is only 1 char in length
+
206 else {
+
207 delete cur_pos;
+
208 }
+
209}
void DeleteFrom(Tnode *delete_from, std::string delete_string, int remove_index)
Function recursively deletes the substring character by character iterating through the string to be ...
Definition: trie_multiple_search.cpp:134
uint8_t numberOfChildren(Tnode *node)
Function to count the number of children a node in the trie has.
Definition: trie_multiple_search.cpp:69
@@ -267,13 +355,13 @@ static constexpr uint8_t E
Here is the call graph for this function:
-
+
- +

◆ DeleteFrom()

@@ -314,26 +402,26 @@ Here is the call graph for this function:
-
135  {
-
136  if (delete_string.size() == remove_index) {
-
137  int letter_index = tolower(delete_string[remove_index]) - 97;
-
138 
-
139  DeleteFrom(delete_from->english[letter_index], delete_string,
-
140  remove_index + 1);
-
141 
-
142  delete delete_from;
-
143  }
-
144 }
+
135 {
+
136 if (delete_string.size() == remove_index) {
+
137 int letter_index = tolower(delete_string[remove_index]) - 97;
+
138
+
139 DeleteFrom(delete_from->english[letter_index], delete_string,
+
140 remove_index + 1);
+
141
+
142 delete delete_from;
+
143 }
+
144}
Here is the call graph for this function:
-
+
- +

◆ Insert()

@@ -356,29 +444,29 @@ Here is the call graph for this function:
-
104  {
-
105  Tnode *cur_pos = this;
-
106  int letter_index = 0;
-
107 
-
108  for (auto &i : entry) {
-
109  // To ignore case
-
110  letter_index = tolower(i) - 97;
-
111 
-
112  // Allocate a node for each character of entry if not present in the
-
113  // trie
-
114  if (cur_pos->english[letter_index] == nullptr) {
-
115  cur_pos->english[letter_index] = new Tnode();
-
116  }
-
117 
-
118  cur_pos = cur_pos->english[letter_index];
-
119  }
-
120  // cur_pos points to the last char, mark it as end of word
-
121  cur_pos->endOfWord = true;
-
122 }
+
104 {
+
105 Tnode *cur_pos = this;
+
106 int letter_index = 0;
+
107
+
108 for (auto &i : entry) {
+
109 // To ignore case
+
110 letter_index = tolower(i) - 97;
+
111
+
112 // Allocate a node for each character of entry if not present in the
+
113 // trie
+
114 if (cur_pos->english[letter_index] == nullptr) {
+
115 cur_pos->english[letter_index] = new Tnode();
+
116 }
+
117
+
118 cur_pos = cur_pos->english[letter_index];
+
119 }
+
120 // cur_pos points to the last char, mark it as end of word
+
121 cur_pos->endOfWord = true;
+
122}
- +

◆ numberOfChildren()

@@ -410,12 +498,11 @@ Here is the call graph for this function:
Returns
count of the number of children of the given node (max 26)
-
69  {
-
70  return ENGLISH_ALPHABET_SIZE -
-
71  std::count(node->english.begin(), node->english.end(), nullptr);
-
72  }
+
69 {
+
70 return ENGLISH_ALPHABET_SIZE -
+
71 std::count(node->english.begin(), node->english.end(), nullptr);
+
72 }
T count(T... args)
-
Definition: avltree.cpp:13
Here is the call graph for this function:
@@ -425,7 +512,7 @@ Here is the call graph for this function:
- +

◆ SearchFreqSuggestions()

@@ -448,56 +535,56 @@ Here is the call graph for this function:
-
365  {
-
366  Tnode *cur_pos = nullptr, *prev_pos = nullptr;
-
367  cur_pos = prev_pos = this; // maintaining 2 pointers, initialized to root
-
368  int letter_index = 0;
-
369  std::string prefix =
-
370  ""; // variable storing the updated value of longest common prefix
- -
372  suggestions; // max heap to store (frequency, word) in descending order
-
373  // of freq
-
374 
- -
376  &suggestions;
-
377 
-
378  for (auto &i : key) {
-
379  letter_index = tolower(i) - 97;
-
380  prev_pos = cur_pos; // Previous pointer updated to point to the last
-
381  // char of the longest common prefix
-
382 
-
383  // When the node for the character does not exist, longest prefix has
-
384  // been determined and SuggestFreqAutocomplete is called
-
385  if (cur_pos->english[letter_index] == nullptr) {
-
386  SuggestFreqAutocomplete(prev_pos, prefix, Suggestions);
-
387  // To display the top 3 results
-
388  SelectionTop_3(Suggestions);
-
389  std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - "
-
390  << std::endl;
-
391  return;
-
392  }
-
393  // Updating the longest common prefix
-
394  prefix += char(tolower(i));
-
395  cur_pos = cur_pos->english[letter_index];
-
396  }
-
397  // If the key is a valid entry of trie, display it @ top of the suggestions
-
398  if (cur_pos->endOfWord) {
-
399  (cur_pos->frequency)++;
-
400  std::cout << key << std::endl;
-
401  }
-
402 
-
403  (void)prev_pos; // Idiom to ignore previous pointer
-
404 
-
405  // Call for Suggestions when the search key is present as an entry/a prefix
-
406  // in the trie
-
407  SuggestFreqAutocomplete(cur_pos, prefix, Suggestions);
-
408  // Display the top 3 results
-
409  SelectionTop_3(Suggestions);
-
410 
-
411  std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - "
-
412  << std::endl;
-
413  return;
-
414 }
+
365 {
+
366 Tnode *cur_pos = nullptr, *prev_pos = nullptr;
+
367 cur_pos = prev_pos = this; // maintaining 2 pointers, initialized to root
+
368 int letter_index = 0;
+
369 std::string prefix =
+
370 ""; // variable storing the updated value of longest common prefix
+ +
372 suggestions; // max heap to store (frequency, word) in descending order
+
373 // of freq
+
374
+ +
376 &suggestions;
+
377
+
378 for (auto &i : key) {
+
379 letter_index = tolower(i) - 97;
+
380 prev_pos = cur_pos; // Previous pointer updated to point to the last
+
381 // char of the longest common prefix
+
382
+
383 // When the node for the character does not exist, longest prefix has
+
384 // been determined and SuggestFreqAutocomplete is called
+
385 if (cur_pos->english[letter_index] == nullptr) {
+
386 SuggestFreqAutocomplete(prev_pos, prefix, Suggestions);
+
387 // To display the top 3 results
+
388 SelectionTop_3(Suggestions);
+
389 std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - "
+
390 << std::endl;
+
391 return;
+
392 }
+
393 // Updating the longest common prefix
+
394 prefix += char(tolower(i));
+
395 cur_pos = cur_pos->english[letter_index];
+
396 }
+
397 // If the key is a valid entry of trie, display it @ top of the suggestions
+
398 if (cur_pos->endOfWord) {
+
399 (cur_pos->frequency)++;
+
400 std::cout << key << std::endl;
+
401 }
+
402
+
403 (void)prev_pos; // Idiom to ignore previous pointer
+
404
+
405 // Call for Suggestions when the search key is present as an entry/a prefix
+
406 // in the trie
+
407 SuggestFreqAutocomplete(cur_pos, prefix, Suggestions);
+
408 // Display the top 3 results
+
409 SelectionTop_3(Suggestions);
+
410
+
411 std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - "
+
412 << std::endl;
+
413 return;
+
414}
void SuggestFreqAutocomplete(Tnode *new_root, const std::string &prefix, std::priority_queue< std::pair< int, std::string > > *suggestions)
Recursive function to suggest most frequently searched entries of trie which have a given common pref...
Definition: trie_multiple_search.cpp:337
void SelectionTop_3(std::priority_queue< std::pair< int, std::string > > *suggestions)
Function to display the 3 suggestions with highest frequency of search hits.
Definition: trie_multiple_search.cpp:317
@@ -505,13 +592,13 @@ Here is the call graph for this function:
Here is the call graph for this function:
-
+
- +

◆ SearchPresence()

@@ -537,31 +624,31 @@ Here is the call graph for this function:
Returns
true if the key is found
false if the key is not found
-
217  {
-
218  Tnode *cur_pos = this;
-
219  int letter_index = 0;
-
220 
-
221  for (auto &i : key) {
-
222  letter_index = tolower(i) - 97;
-
223  // If any character in the order of the key is absent, word not found!
-
224  if (cur_pos->english[letter_index] == nullptr) {
-
225  return false;
-
226  }
-
227  cur_pos = cur_pos->english[letter_index];
-
228  }
-
229  // Word is only present in the trie if the key is a valid complete entry and
-
230  // not just a prefix.
-
231  if (cur_pos->endOfWord) {
-
232  (cur_pos->frequency)++;
-
233  return true;
-
234  } else {
-
235  return false;
-
236  }
-
237 }
+
217 {
+
218 Tnode *cur_pos = this;
+
219 int letter_index = 0;
+
220
+
221 for (auto &i : key) {
+
222 letter_index = tolower(i) - 97;
+
223 // If any character in the order of the key is absent, word not found!
+
224 if (cur_pos->english[letter_index] == nullptr) {
+
225 return false;
+
226 }
+
227 cur_pos = cur_pos->english[letter_index];
+
228 }
+
229 // Word is only present in the trie if the key is a valid complete entry and
+
230 // not just a prefix.
+
231 if (cur_pos->endOfWord) {
+
232 (cur_pos->frequency)++;
+
233 return true;
+
234 } else {
+
235 return false;
+
236 }
+
237}
- +

◆ SearchSuggestions()

@@ -584,56 +671,56 @@ false if the key is not found -
271  {
-
272  Tnode *cur_pos = nullptr, *prev_pos = nullptr;
-
273  cur_pos = prev_pos = this; // maintaining 2 pointers, initialized to root
-
274  int letter_index = 0;
-
275  std::string prefix =
-
276  ""; // variable storing the updated value of longest common prefix
-
277 
-
278  for (auto &i : key) {
-
279  letter_index = tolower(i) - 97;
-
280  prev_pos = cur_pos; // Previous pointer updated to point to the last
-
281  // char of the longest common prefix
-
282 
-
283  // When the node for the character does not exist, longest prefix has
-
284  // been determined and SuggestAutocomplete is called
-
285  if (cur_pos->english[letter_index] == nullptr) {
-
286  SuggestAutocomplete(prev_pos, prefix);
-
287  std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - "
-
288  << std::endl;
-
289  return;
-
290  }
-
291  // Updating the longest common prefix
-
292  prefix += char(tolower(i));
-
293  cur_pos = cur_pos->english[letter_index];
-
294  }
-
295  // If the key is a valid entry of trie, display it @ top of the suggestions
-
296  if (cur_pos->endOfWord) {
-
297  std::cout << key << std::endl;
-
298  (cur_pos->frequency)++;
-
299  }
-
300 
-
301  (void)prev_pos; // Idiom to ignore previous pointer
-
302 
-
303  // Call for suggestions when the search key is present as an entry/a prefix
-
304  // in the trie
-
305  SuggestAutocomplete(cur_pos, prefix);
-
306  std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - "
-
307  << std::endl;
-
308  return;
-
309 }
+
271 {
+
272 Tnode *cur_pos = nullptr, *prev_pos = nullptr;
+
273 cur_pos = prev_pos = this; // maintaining 2 pointers, initialized to root
+
274 int letter_index = 0;
+
275 std::string prefix =
+
276 ""; // variable storing the updated value of longest common prefix
+
277
+
278 for (auto &i : key) {
+
279 letter_index = tolower(i) - 97;
+
280 prev_pos = cur_pos; // Previous pointer updated to point to the last
+
281 // char of the longest common prefix
+
282
+
283 // When the node for the character does not exist, longest prefix has
+
284 // been determined and SuggestAutocomplete is called
+
285 if (cur_pos->english[letter_index] == nullptr) {
+
286 SuggestAutocomplete(prev_pos, prefix);
+
287 std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - "
+
288 << std::endl;
+
289 return;
+
290 }
+
291 // Updating the longest common prefix
+
292 prefix += char(tolower(i));
+
293 cur_pos = cur_pos->english[letter_index];
+
294 }
+
295 // If the key is a valid entry of trie, display it @ top of the suggestions
+
296 if (cur_pos->endOfWord) {
+
297 std::cout << key << std::endl;
+
298 (cur_pos->frequency)++;
+
299 }
+
300
+
301 (void)prev_pos; // Idiom to ignore previous pointer
+
302
+
303 // Call for suggestions when the search key is present as an entry/a prefix
+
304 // in the trie
+
305 SuggestAutocomplete(cur_pos, prefix);
+
306 std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - "
+
307 << std::endl;
+
308 return;
+
309}
void SuggestAutocomplete(Tnode *new_root, const std::string &prefix)
Recursive function to suggest all the entries of trie which have a given common prefix.
Definition: trie_multiple_search.cpp:246
Here is the call graph for this function:
-
+
- +

◆ SelectionTop_3()

@@ -656,15 +743,15 @@ Here is the call graph for this function:
-
318  {
-
319  // Display Either top 3 or total number of suggestions, whichever is smaller
-
320  int n = suggestions->size(), Top = 0;
-
321  Top = n < 3 ? n : 3;
-
322  while (Top--) {
-
323  std::cout << suggestions->top().second << std::endl;
-
324  suggestions->pop();
-
325  }
-
326 }
+
318 {
+
319 // Display Either top 3 or total number of suggestions, whichever is smaller
+
320 int n = suggestions->size(), Top = 0;
+
321 Top = n < 3 ? n : 3;
+
322 while (Top--) {
+
323 std::cout << suggestions->top().second << std::endl;
+
324 suggestions->pop();
+
325 }
+
326}
T pop(T... args)
T top(T... args)
@@ -676,7 +763,7 @@ Here is the call graph for this function:
- +

◆ SuggestAutocomplete()

@@ -710,32 +797,32 @@ Here is the call graph for this function:
-
246  {
-
247  // Iterate through all 26 nodes as we have to print all strings with the
-
248  // given prefix
-
249  int i = 0;
-
250  for (i = 0; i < ENGLISH_ALPHABET_SIZE; i++) {
-
251  if (new_root->english[i] != nullptr) {
-
252  // Print the sugestion only if it's a valid complete entry and not
-
253  // just a prefix
-
254  if (new_root->english[i]->endOfWord) {
-
255  std::cout << prefix + char(i + 97) << std::endl;
-
256  }
-
257 
-
258  SuggestAutocomplete(new_root->english[i], prefix + char(i + 97));
-
259  }
-
260  }
-
261 }
+
246 {
+
247 // Iterate through all 26 nodes as we have to print all strings with the
+
248 // given prefix
+
249 int i = 0;
+
250 for (i = 0; i < ENGLISH_ALPHABET_SIZE; i++) {
+
251 if (new_root->english[i] != nullptr) {
+
252 // Print the sugestion only if it's a valid complete entry and not
+
253 // just a prefix
+
254 if (new_root->english[i]->endOfWord) {
+
255 std::cout << prefix + char(i + 97) << std::endl;
+
256 }
+
257
+
258 SuggestAutocomplete(new_root->english[i], prefix + char(i + 97));
+
259 }
+
260 }
+
261}
Here is the call graph for this function:
-
+
- +

◆ SuggestFreqAutocomplete()

@@ -776,28 +863,28 @@ Here is the call graph for this function:
-
339  {
-
340  int i = 0;
-
341  for (i = 0; i < ENGLISH_ALPHABET_SIZE; i++) {
-
342  if (new_root->english[i] != nullptr) {
-
343  // Add to sugestions only if it's a valid complete entry and not
-
344  // just a prefix
-
345  if (new_root->english[i]->endOfWord) {
-
346  suggestions->push(std::make_pair(
-
347  new_root->english[i]->frequency, prefix + char(i + 97)));
-
348  }
-
349 
-
350  SuggestFreqAutocomplete(new_root->english[i], prefix + char(i + 97),
-
351  suggestions);
-
352  }
-
353  }
-
354 }
+
339 {
+
340 int i = 0;
+
341 for (i = 0; i < ENGLISH_ALPHABET_SIZE; i++) {
+
342 if (new_root->english[i] != nullptr) {
+
343 // Add to sugestions only if it's a valid complete entry and not
+
344 // just a prefix
+
345 if (new_root->english[i]->endOfWord) {
+
346 suggestions->push(std::make_pair(
+
347 new_root->english[i]->frequency, prefix + char(i + 97)));
+
348 }
+
349
+
350 SuggestFreqAutocomplete(new_root->english[i], prefix + char(i + 97),
+
351 suggestions);
+
352 }
+
353 }
+
354}
T make_pair(T... args)
T push(T... args)
Here is the call graph for this function:
-
+
@@ -812,7 +899,7 @@ Here is the call graph for this function:
diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.js b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.js index adf1d9b7e..73cf0637d 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.js +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.js @@ -1,23 +1,13 @@ var classoperations__on__datastructures_1_1trie__operations_1_1_tnode = [ - [ "Tnode", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#aef1ef6608e5876312d9ae7f36f469ba7", null ], - [ "Tnode", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a6f73ac06a639956cdef90f8c8dbe9187", null ], - [ "Tnode", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#abc70a8b526aff96d49daa987f00ff252", null ], - [ "~Tnode", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a5f02156cd1a2a1ba48fb6ba2283afbf1", null ], [ "Delete", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#aefd24626ac47277431c9b8604e064340", null ], [ "DeleteFrom", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#adef6940391f981ab86767775176b7169", null ], [ "Insert", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a7ecb75b985b1ffc575a880274f855b1c", null ], [ "numberOfChildren", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#afca808362c13273ca8c8ae7d58e8eee0", null ], - [ "operator=", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a30edc883a96fda01d596eb33a8cc6194", null ], - [ "operator=", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#af58f175cd8a2d29d43b67e1fb7727807", null ], [ "SearchFreqSuggestions", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a7c5ab271d8042540f64ef16d259d1503", null ], [ "SearchPresence", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a4a624fcdf3c3beb2025d69f2cfda8023", null ], [ "SearchSuggestions", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a18b70172ca4fb2811dbfb9a86e48b34c", null ], [ "SelectionTop_3", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#aacafb8c9f3ebac7ac6c01d9645bb67b6", null ], [ "SuggestAutocomplete", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a097913c4badec2b60d50a171ecc299fe", null ], - [ "SuggestFreqAutocomplete", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a9e556f52c837190ecf4265b1f05cfe9c", null ], - [ "endOfWord", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#afa9dab736046a4140e94bb9104074cd6", null ], - [ "english", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#aa4aac1c6bed58a84472906b63f20da83", null ], - [ "ENGLISH_ALPHABET_SIZE", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a0f310c3d4d7b82e5ee1036771cade702", null ], - [ "frequency", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a7bab9bb47215cd674471c94b0b448014", null ] + [ "SuggestFreqAutocomplete", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html#a9e556f52c837190ecf4265b1f05cfe9c", null ] ]; \ No newline at end of file diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.map b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.map index 38c6367a9..15cc72620 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.map +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.md5 b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.md5 index aaf542a80..92291df3e 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.md5 +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.md5 @@ -1 +1 @@ -4dc362092b725827593070a06bc92802 \ No newline at end of file +270bc1db15b7a22c08b636bad4651395 \ No newline at end of file diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.svg b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.svg index ccd125b69..f96e25316 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.svg +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a097913c4badec2b60d50a171ecc299fe_cgraph.svg @@ -1,14 +1,14 @@ - - - + + operations_on_datastructures::trie_operations::Tnode::SuggestAutocomplete - + Node1 @@ -20,6 +20,12 @@ + + +Node1->Node1 + + + Node2 diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.map b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.map index f9b59105a..638036d79 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.map +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.md5 b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.md5 index 5c54470d6..efbc8ebb4 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.md5 +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.md5 @@ -1 +1 @@ -1b56d965ec89882e03d1dfdfc45b1f5b \ No newline at end of file +c2b800c820352a7d9889647592d0345d \ No newline at end of file diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.svg b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.svg index d8a69ae0f..3a9f072a5 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.svg +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a18b70172ca4fb2811dbfb9a86e48b34c_cgraph.svg @@ -1,22 +1,22 @@ - - - + + operations_on_datastructures::trie_operations::Tnode::SearchSuggestions - + Node1 - -operations_on_datastructures -::trie_operations::Tnode -::SearchSuggestions + +operations_on_datastructures +::trie_operations::Tnode +::SearchSuggestions @@ -24,16 +24,16 @@ Node2 - -std::endl + +std::endl Node1->Node2 - - + + @@ -49,14 +49,20 @@ Node1->Node3 - - + + Node3->Node2 - - + + + + + +Node3->Node3 + + diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.map b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.map index eb8f24966..e4c60d1eb 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.map +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.map @@ -2,6 +2,6 @@ - - + + diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.md5 b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.md5 index f365f1784..3299f50ab 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.md5 +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.md5 @@ -1 +1 @@ -9560fdc5328217f634d0b9e15b5d4a83 \ No newline at end of file +84ab290794e554d0cab82e3e564daaa0 \ No newline at end of file diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.svg b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.svg index 05cc2d2b4..b3f88623d 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.svg +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a7c5ab271d8042540f64ef16d259d1503_cgraph.svg @@ -1,22 +1,22 @@ - - - + + operations_on_datastructures::trie_operations::Tnode::SearchFreqSuggestions - + Node1 - -operations_on_datastructures -::trie_operations::Tnode -::SearchFreqSuggestions + +operations_on_datastructures +::trie_operations::Tnode +::SearchFreqSuggestions @@ -24,33 +24,33 @@ Node2 - -std::endl + +std::endl Node1->Node2 - - + + Node3 - -operations_on_datastructures -::trie_operations::Tnode -::SelectionTop_3 + +operations_on_datastructures +::trie_operations::Tnode +::SelectionTop_3 Node1->Node3 - - + + @@ -66,14 +66,20 @@ Node1->Node4 - - + + Node3->Node2 - - + + + + + +Node4->Node4 + + diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.map b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.map index 411ad3ccb..b32c7d603 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.map +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.md5 b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.md5 index 01323c329..8fe9250f7 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.md5 +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.md5 @@ -1 +1 @@ -7d072479b315bff761932d5892d062f3 \ No newline at end of file +896cfcadabf7afb2d9202c9550110287 \ No newline at end of file diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.svg b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.svg index 105a17e81..49e0b6724 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.svg +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_a9e556f52c837190ecf4265b1f05cfe9c_cgraph.svg @@ -1,14 +1,14 @@ - - - + + operations_on_datastructures::trie_operations::Tnode::SuggestFreqAutocomplete - + Node1 @@ -20,6 +20,12 @@ + + +Node1->Node1 + + + Node2 diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aacafb8c9f3ebac7ac6c01d9645bb67b6_cgraph.svg b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aacafb8c9f3ebac7ac6c01d9645bb67b6_cgraph.svg index 0b5b3ab6f..dc9602046 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aacafb8c9f3ebac7ac6c01d9645bb67b6_cgraph.svg +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aacafb8c9f3ebac7ac6c01d9645bb67b6_cgraph.svg @@ -1,7 +1,7 @@ - - - + + diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_adef6940391f981ab86767775176b7169_cgraph.md5 b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_adef6940391f981ab86767775176b7169_cgraph.md5 index aa0fabcab..3f2f8b710 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_adef6940391f981ab86767775176b7169_cgraph.md5 +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_adef6940391f981ab86767775176b7169_cgraph.md5 @@ -1 +1 @@ -de89ac9917d9bdc55b999049ad92c6e6 \ No newline at end of file +ab250400f33229485d9c85b5013a1515 \ No newline at end of file diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_adef6940391f981ab86767775176b7169_cgraph.svg b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_adef6940391f981ab86767775176b7169_cgraph.svg index e97af6502..0f63e00a4 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_adef6940391f981ab86767775176b7169_cgraph.svg +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_adef6940391f981ab86767775176b7169_cgraph.svg @@ -1,14 +1,14 @@ - - - + + operations_on_datastructures::trie_operations::Tnode::DeleteFrom - + Node1 @@ -20,6 +20,12 @@ + + +Node1->Node1 + + + Node2 @@ -30,7 +36,7 @@ - + Node1->Node2 diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.map b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.map index b090ed02f..3f7ff412a 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.map +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.map @@ -1,8 +1,8 @@ - - - - - - + + + + + + diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.md5 b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.md5 index 8dcc295fc..423dd7cb4 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.md5 +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.md5 @@ -1 +1 @@ -be1f9f8c5aeb532103bd014af22fc6fd \ No newline at end of file +826521cf28b67c6d7ee998ab138e9f2a \ No newline at end of file diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.svg b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.svg index 590bad4c8..30a2040ce 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.svg +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_aefd24626ac47277431c9b8604e064340_cgraph.svg @@ -1,14 +1,14 @@ - - - + + operations_on_datastructures::trie_operations::Tnode::Delete - + Node1 @@ -47,7 +47,7 @@ - + Node1->Node3 @@ -62,7 +62,7 @@ - + Node1->Node4 @@ -79,13 +79,19 @@ - + Node1->Node5 - + +Node2->Node2 + + + + + Node2->Node3 @@ -100,7 +106,7 @@ - + Node5->Node6 diff --git a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_afca808362c13273ca8c8ae7d58e8eee0_cgraph.svg b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_afca808362c13273ca8c8ae7d58e8eee0_cgraph.svg index bc7ad9b0a..d9d8909d7 100644 --- a/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_afca808362c13273ca8c8ae7d58e8eee0_cgraph.svg +++ b/d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode_afca808362c13273ca8c8ae7d58e8eee0_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,29 +90,28 @@ $(document).ready(function(){initNavTree('dc/db5/struct_queue.html','../../'); i
-
-
Queue Member List
+
Queue Member List

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

- + - + - + - + - +
createNode(int val) (defined in Queue)Queueinline
dequeue() (defined in Queue)Queueinline
dequeue() (defined in Queue)Queueinline
enqueue(int val) (defined in Queue)Queueinline
front (defined in Queue)Queue
front (defined in Queue)Queue
front (defined in Queue)Queueprivate
Queue()=default (defined in Queue)Queue
Queue()=default (defined in Queue)Queue
rear (defined in Queue)Queue
rear (defined in Queue)Queueprivate
rear (defined in Queue)Queueprivate
t (defined in Queue)Queue
traverse() (defined in Queue)Queueinline
traverse() (defined in Queue)Queueinline
diff --git a/d0/d65/namespacedouble__hashing.html b/d0/d65/namespacedouble__hashing.html index 4cd224d91..3af553283 100644 --- a/d0/d65/namespacedouble__hashing.html +++ b/d0/d65/namespacedouble__hashing.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: double_hashing Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -95,26 +95,25 @@ $(document).ready(function(){initNavTree('d0/d65/namespacedouble__hashing.html', Typedefs | Functions | Variables -
-
double_hashing Namespace Reference
+
double_hashing Namespace Reference
-

An implementation of hash table using double hashing algorithm. +

An implementation of hash table using double hashing algorithm. More...

-

+

Classes

struct  Entry
 
- - - + +

+

Typedefs

-using Entry = struct Entry
 
+using Entry = Entry
 
- @@ -142,31 +141,31 @@ Functions

+

Functions

bool putProber (const Entry &entry, int key)
 
void removalInfo (int key)
 
- - - - - - -

+

Variables

+
int notPresent
 
+
std::vector< Entrytable
 
+
int totalSize
 
+
int tomb = -1
 
+
int size
 
+
bool rehashing
 

Detailed Description

-

An implementation of hash table using double hashing algorithm.

+

An implementation of hash table using double hashing algorithm.

Function Documentation

- +

◆ add()

@@ -181,22 +180,22 @@ bool rehashing
-

Checks for load factor here

Parameters
+

Checks for load factor here

Parameters
keykey value to add to the table
-
185  {
-
186  // auto* entry = new Entry();
-
187  // entry->key = key;
-
188  int index = doubleHash(key, false);
-
189  table[index].key = key;
-
190  // Load factor greater than 0.5 causes resizing
-
191  if (++size / static_cast<double>(totalSize) >= 0.5) {
-
192  rehash();
-
193  }
-
194 }
+
185 {
+
186 // auto* entry = new Entry();
+
187 // entry->key = key;
+
188 int index = doubleHash(key, false);
+
189 table[index].key = key;
+
190 // Load factor greater than 0.5 causes resizing
+
191 if (++size / static_cast<double>(totalSize) >= 0.5) {
+
192 rehash();
+
193 }
+
194}
int doubleHash(int key, bool searching)
Performs double hashing to resolve collisions.
Definition: double_hash_hash_table.cpp:71
void rehash()
Definition: double_hash_hash_table.cpp:161
@@ -208,7 +207,7 @@ Here is the call graph for this function:
- +

◆ addInfo()

@@ -223,23 +222,23 @@ Here is the call graph for this function:
-

Information about the adding process

Parameters
+

Information about the adding process

Parameters
keykey value to add to table
-
212  {
-
213  std::cout << "Initial table: ";
-
214  display();
-
215  std::cout << std::endl;
-
216  std::cout << "hash of " << key << " is " << hashFxn(key) << " % "
-
217  << totalSize << " == " << hashFxn(key) % totalSize;
-
218  std::cout << std::endl;
-
219  add(key);
-
220  std::cout << "New table: ";
-
221  display();
-
222 }
+
212 {
+
213 std::cout << "Initial table: ";
+
214 display();
+ +
216 std::cout << "hash of " << key << " is " << hashFxn(key) << " % "
+
217 << totalSize << " == " << hashFxn(key) % totalSize;
+ +
219 add(key);
+
220 std::cout << "New table: ";
+
221 display();
+
222}
T endl(T... args)
size_t hashFxn(int key)
Hash a key. Uses the STL library's std::hash() function.
Definition: double_hash_hash_table.cpp:47
@@ -254,7 +253,7 @@ Here is the call graph for this function:
- +

◆ display()

@@ -268,21 +267,21 @@ Here is the call graph for this function:
-

Displays the table

Returns
None
-
143  {
-
144  for (int i = 0; i < totalSize; i++) {
-
145  if (table[i].key == notPresent) {
-
146  std::cout << " Empty ";
-
147  } else if (table[i].key == tomb) {
-
148  std::cout << " Tomb ";
-
149  } else {
-
150  std::cout << " ";
-
151  std::cout << table[i].key;
-
152  std::cout << " ";
-
153  }
-
154  }
-
155  std::cout << std::endl;
-
156 }
+

Displays the table

Returns
None
+
143 {
+
144 for (int i = 0; i < totalSize; i++) {
+
145 if (table[i].key == notPresent) {
+
146 std::cout << " Empty ";
+
147 } else if (table[i].key == tomb) {
+
148 std::cout << " Tomb ";
+
149 } else {
+
150 std::cout << " ";
+
151 std::cout << table[i].key;
+
152 std::cout << " ";
+
153 }
+
154 }
+ +
156}
Here is the call graph for this function:
@@ -292,7 +291,7 @@ Here is the call graph for this function:
- +

◆ doubleHash()

@@ -329,48 +328,48 @@ Here is the call graph for this function:
Returns
Index of key when found
new hash if no conflicts present
-
71  {
-
72  int hash = static_cast<int>(hashFxn(key));
-
73  int i = 0;
-
74  Entry entry;
-
75  do {
-
76  int index =
-
77  static_cast<int>(hash + (i * otherHashFxn(key))) % totalSize;
-
78  entry = table[index];
-
79  if (searching) {
-
80  if (entry.key == notPresent) {
-
81  return notPresent;
-
82  }
-
83  if (searchingProber(entry, key)) {
-
84  std::cout << "Found key!" << std::endl;
-
85  return index;
-
86  }
-
87  std::cout << "Found tombstone or equal hash, checking next"
-
88  << std::endl;
-
89  i++;
-
90  } else {
-
91  if (putProber(entry, key)) {
-
92  if (!rehashing) {
-
93  std::cout << "Spot found!" << std::endl;
-
94  }
-
95  return index;
-
96  }
-
97  if (!rehashing) {
-
98  std::cout << "Spot taken, looking at next (next index:"
-
99  << " "
-
100  << static_cast<int>(hash + (i * otherHashFxn(key))) %
-
101  totalSize
-
102  << ")" << std::endl;
-
103  }
-
104  i++;
-
105  }
-
106  if (i == totalSize * 100) {
-
107  std::cout << "DoubleHash probe failed" << std::endl;
-
108  return notPresent;
-
109  }
-
110  } while (entry.key != notPresent);
-
111  return notPresent;
-
112 }
+
71 {
+
72 int hash = static_cast<int>(hashFxn(key));
+
73 int i = 0;
+
74 Entry entry;
+
75 do {
+
76 int index =
+
77 static_cast<int>(hash + (i * otherHashFxn(key))) % totalSize;
+
78 entry = table[index];
+
79 if (searching) {
+
80 if (entry.key == notPresent) {
+
81 return notPresent;
+
82 }
+
83 if (searchingProber(entry, key)) {
+
84 std::cout << "Found key!" << std::endl;
+
85 return index;
+
86 }
+
87 std::cout << "Found tombstone or equal hash, checking next"
+
88 << std::endl;
+
89 i++;
+
90 } else {
+
91 if (putProber(entry, key)) {
+
92 if (!rehashing) {
+
93 std::cout << "Spot found!" << std::endl;
+
94 }
+
95 return index;
+
96 }
+
97 if (!rehashing) {
+
98 std::cout << "Spot taken, looking at next (next index:"
+
99 << " "
+
100 << static_cast<int>(hash + (i * otherHashFxn(key))) %
+
101 totalSize
+
102 << ")" << std::endl;
+
103 }
+
104 i++;
+
105 }
+
106 if (i == totalSize * 100) {
+
107 std::cout << "DoubleHash probe failed" << std::endl;
+
108 return notPresent;
+
109 }
+
110 } while (entry.key != notPresent);
+
111 return notPresent;
+
112}
bool searchingProber(const Entry &entry, int key)
Definition: double_hash_hash_table.cpp:133
size_t otherHashFxn(int key)
Used for second hash function.
Definition: double_hash_hash_table.cpp:58
bool putProber(const Entry &entry, int key)
Definition: double_hash_hash_table.cpp:120
@@ -385,7 +384,7 @@ Here is the call graph for this function:
- +

◆ hashFxn()

@@ -409,15 +408,15 @@ Here is the call graph for this function:
Returns
hash value of the key
-
47  {
-
48  std::hash<int> hash;
-
49  return hash(key);
-
50 }
+
47 {
+
48 std::hash<int> hash;
+
49 return hash(key);
+
50}
- +

◆ otherHashFxn()

@@ -441,14 +440,14 @@ Here is the call graph for this function:
Returns
hash value of the key
-
58  {
-
59  std::hash<int> hash;
-
60  return 1 + (7 - (hash(key) % 7));
-
61 }
+
58 {
+
59 std::hash<int> hash;
+
60 return 1 + (7 - (hash(key) % 7));
+
61}
- +

◆ putProber()

@@ -473,7 +472,7 @@ Here is the call graph for this function:
-

Finds empty spot in a vector

Parameters
+

Finds empty spot in a vector

Parameters
@@ -483,16 +482,16 @@ Here is the call graph for this function:
Returns
true if key is not present or is a toumb
false is already occupied
-
120  {
-
121  if (entry.key == notPresent || entry.key == tomb) {
-
122  return true;
-
123  }
-
124  return false;
-
125 }
+
120 {
+
121 if (entry.key == notPresent || entry.key == tomb) {
+
122 return true;
+
123 }
+
124 return false;
+
125}
- +

◆ rehash()

@@ -506,27 +505,27 @@ Here is the call graph for this function:
entryvector to search in
keykey to search for
-

Rehashes the table into a bigger table

Returns
None
-
161  {
-
162  // Necessary so wall of add info isn't printed all at once
-
163  rehashing = true;
-
164  int oldSize = totalSize;
-
165  std::vector<Entry> oldTable(table);
-
166  // Really this should use the next prime number greater than totalSize * 2
-
167  table = std::vector<Entry>(totalSize * 2);
-
168  totalSize *= 2;
-
169  for (int i = 0; i < oldSize; i++) {
-
170  if (oldTable[i].key != -1 && oldTable[i].key != notPresent) {
-
171  size--; // Size stays the same (add increments size)
-
172  add(oldTable[i].key);
-
173  }
-
174  }
-
175  // delete[] oldTable;
-
176  // oldTable.reset();
-
177 
-
178  rehashing = false;
-
179  std::cout << "Table was rehashed, new size is: " << totalSize << std::endl;
-
180 }
+

Rehashes the table into a bigger table

Returns
None
+
161 {
+
162 // Necessary so wall of add info isn't printed all at once
+
163 rehashing = true;
+
164 int oldSize = totalSize;
+
165 std::vector<Entry> oldTable(table);
+
166 // Really this should use the next prime number greater than totalSize * 2
+
167 table = std::vector<Entry>(totalSize * 2);
+
168 totalSize *= 2;
+
169 for (int i = 0; i < oldSize; i++) {
+
170 if (oldTable[i].key != -1 && oldTable[i].key != notPresent) {
+
171 size--; // Size stays the same (add increments size)
+
172 add(oldTable[i].key);
+
173 }
+
174 }
+
175 // delete[] oldTable;
+
176 // oldTable.reset();
+
177
+
178 rehashing = false;
+
179 std::cout << "Table was rehashed, new size is: " << totalSize << std::endl;
+
180}
Here is the call graph for this function:
@@ -537,7 +536,7 @@ Here is the call graph for this function:
- +

◆ removalInfo()

@@ -552,23 +551,23 @@ Here is the call graph for this function:
-

Information about removal process

Parameters
+

Information about removal process

Parameters
keykey value to remove from table
-
227  {
-
228  std::cout << "Initial table: ";
-
229  display();
-
230  std::cout << std::endl;
-
231  std::cout << "hash of " << key << " is " << hashFxn(key) << " % "
-
232  << totalSize << " == " << hashFxn(key) % totalSize;
-
233  std::cout << std::endl;
-
234  remove(key);
-
235  std::cout << "New table: ";
-
236  display();
-
237 }
+
227 {
+
228 std::cout << "Initial table: ";
+
229 display();
+ +
231 std::cout << "hash of " << key << " is " << hashFxn(key) << " % "
+
232 << totalSize << " == " << hashFxn(key) % totalSize;
+ +
234 remove(key);
+
235 std::cout << "New table: ";
+
236 display();
+
237}
void remove(int key)
Definition: double_hash_hash_table.cpp:199
Here is the call graph for this function:
@@ -579,7 +578,7 @@ Here is the call graph for this function:
- +

◆ remove()

@@ -594,21 +593,21 @@ Here is the call graph for this function:
-

Removes key. Leaves tombstone upon removal.

Parameters
+

Removes key. Leaves tombstone upon removal.

Parameters
keykey value to remove
-
199  {
-
200  int index = doubleHash(key, true);
-
201  if (index == notPresent) {
-
202  std::cout << "key not found" << std::endl;
-
203  }
-
204  table[index].key = tomb;
-
205  std::cout << "Removal successful, leaving tombstone" << std::endl;
-
206  size--;
-
207 }
+
199 {
+
200 int index = doubleHash(key, true);
+
201 if (index == notPresent) {
+
202 std::cout << "key not found" << std::endl;
+
203 }
+
204 table[index].key = tomb;
+
205 std::cout << "Removal successful, leaving tombstone" << std::endl;
+
206 size--;
+
207}
Here is the call graph for this function:
@@ -618,7 +617,7 @@ Here is the call graph for this function:
- +

◆ searchingProber()

@@ -643,7 +642,7 @@ Here is the call graph for this function:
-

Looks for a matching key

Parameters
+

Looks for a matching key

Parameters
@@ -653,12 +652,12 @@ Here is the call graph for this function:
Returns
true if found
false if not found
-
133  {
-
134  if (entry.key == key) {
-
135  return true;
-
136  }
-
137  return false;
-
138 }
+
133 {
+
134 if (entry.key == key) {
+
135 return true;
+
136 }
+
137 return false;
+
138}
@@ -668,7 +667,7 @@ Here is the call graph for this function: diff --git a/d0/d65/namespacedouble__hashing.js b/d0/d65/namespacedouble__hashing.js index 6bca93436..0500a1fc0 100644 --- a/d0/d65/namespacedouble__hashing.js +++ b/d0/d65/namespacedouble__hashing.js @@ -1,7 +1,6 @@ var namespacedouble__hashing = [ [ "Entry", "d9/dde/structdouble__hashing_1_1_entry.html", "d9/dde/structdouble__hashing_1_1_entry" ], - [ "Entry", "d0/d65/namespacedouble__hashing.html#a4b68c58d0e039662991f8e220129efd9", null ], [ "add", "d0/d65/namespacedouble__hashing.html#a79a9c914a6c68275b3640303d7faad8a", null ], [ "addInfo", "d0/d65/namespacedouble__hashing.html#a9c652b2e467e5d250dfe3bed83b12560", null ], [ "display", "d0/d65/namespacedouble__hashing.html#a1e901418c759627557eff359b8db38cd", null ], @@ -12,11 +11,5 @@ var namespacedouble__hashing = [ "rehash", "d0/d65/namespacedouble__hashing.html#af4981819aae8bc7e7beeaef02615e30d", null ], [ "removalInfo", "d0/d65/namespacedouble__hashing.html#a5d06e4598569526294f10104875f6824", null ], [ "remove", "d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931", null ], - [ "searchingProber", "d0/d65/namespacedouble__hashing.html#a29f543e2626bad58907661e1e45028a6", null ], - [ "notPresent", "d0/d65/namespacedouble__hashing.html#a77d33a0c49294b9ec22ad86eeff79585", null ], - [ "rehashing", "d0/d65/namespacedouble__hashing.html#ae5d042a7f6038a2ec9e5718d0c7fb31f", null ], - [ "size", "d0/d65/namespacedouble__hashing.html#a5f5323b52037218cf5ae888778b7f980", null ], - [ "table", "d0/d65/namespacedouble__hashing.html#a0e2ff0f9cfc7b54e60a6561f792d8b26", null ], - [ "tomb", "d0/d65/namespacedouble__hashing.html#a4e9a7219d34e781e4e73d74a968b26c1", null ], - [ "totalSize", "d0/d65/namespacedouble__hashing.html#a60a52265027518b25655d730f960013a", null ] + [ "searchingProber", "d0/d65/namespacedouble__hashing.html#a29f543e2626bad58907661e1e45028a6", null ] ]; \ No newline at end of file diff --git a/d0/d65/namespacedouble__hashing_a1e901418c759627557eff359b8db38cd_cgraph.svg b/d0/d65/namespacedouble__hashing_a1e901418c759627557eff359b8db38cd_cgraph.svg index 19f16fbdc..82a585923 100644 --- a/d0/d65/namespacedouble__hashing_a1e901418c759627557eff359b8db38cd_cgraph.svg +++ b/d0/d65/namespacedouble__hashing_a1e901418c759627557eff359b8db38cd_cgraph.svg @@ -1,7 +1,7 @@ - - diff --git a/d0/d65/namespacedouble__hashing_a28083ecac6eb94b643281875c8665931_cgraph_org.svg b/d0/d65/namespacedouble__hashing_a28083ecac6eb94b643281875c8665931_cgraph_org.svg index cc46761c5..ac5ba79f5 100644 --- a/d0/d65/namespacedouble__hashing_a28083ecac6eb94b643281875c8665931_cgraph_org.svg +++ b/d0/d65/namespacedouble__hashing_a28083ecac6eb94b643281875c8665931_cgraph_org.svg @@ -1,7 +1,7 @@ - - diff --git a/d0/d65/namespacedouble__hashing_a5d06e4598569526294f10104875f6824_cgraph_org.svg b/d0/d65/namespacedouble__hashing_a5d06e4598569526294f10104875f6824_cgraph_org.svg index 208d8d382..38a35fb1f 100644 --- a/d0/d65/namespacedouble__hashing_a5d06e4598569526294f10104875f6824_cgraph_org.svg +++ b/d0/d65/namespacedouble__hashing_a5d06e4598569526294f10104875f6824_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - diff --git a/d0/d65/namespacedouble__hashing_a9c652b2e467e5d250dfe3bed83b12560_cgraph_org.svg b/d0/d65/namespacedouble__hashing_a9c652b2e467e5d250dfe3bed83b12560_cgraph_org.svg index 6408355ab..36f423863 100644 --- a/d0/d65/namespacedouble__hashing_a9c652b2e467e5d250dfe3bed83b12560_cgraph_org.svg +++ b/d0/d65/namespacedouble__hashing_a9c652b2e467e5d250dfe3bed83b12560_cgraph_org.svg @@ -1,7 +1,7 @@ - - diff --git a/d0/d65/namespacedouble__hashing_af4981819aae8bc7e7beeaef02615e30d_cgraph_org.svg b/d0/d65/namespacedouble__hashing_af4981819aae8bc7e7beeaef02615e30d_cgraph_org.svg index 311ada952..bef64c2f5 100644 --- a/d0/d65/namespacedouble__hashing_af4981819aae8bc7e7beeaef02615e30d_cgraph_org.svg +++ b/d0/d65/namespacedouble__hashing_af4981819aae8bc7e7beeaef02615e30d_cgraph_org.svg @@ -1,7 +1,7 @@ - - - + +Algorithms_in_C++: math/modular_exponentiation.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
entryvector to search in
keykey value to search
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('d0/d6d/modular__exponentiation_8cpp.ht -
-
modular_exponentiation.cpp File Reference
+
modular_exponentiation.cpp File Reference
@@ -109,13 +108,13 @@ Include dependency graph for modular_exponentiation.cpp:
- - +

+

Namespaces

 math
namespace  math
 for IO operations
 
- @@ -127,12 +126,12 @@ Functions

+

Functions

uint64_t math::power (uint64_t a, uint64_t b, uint64_t c)
 This function calculates a raised to exponent b under modulo c using modular exponentiation. More...
 

Detailed Description

-

C++ Program for Modular Exponentiation Iteratively.

-

The task is to calculate the value of an integer a raised to an integer exponent b under modulo c.

Note
The time complexity of this approach is O(log b).
+

C++ Program for Modular Exponentiation Iteratively.

+

The task is to calculate the value of an integer a raised to an integer exponent b under modulo c.

Note
The time complexity of this approach is O(log b).

Example: (4^3) % 5 (where ^ stands for exponentiation and % for modulo) (4*4*4) % 5 (4 % 5) * ( (4*4) % 5 ) 4 * (16 % 5) 4 * 1 4 We can also verify the result as 4^3 is 64 and 64 modulo 5 is 4

-
Author
Shri2206
+
Author
Shri2206

Function Documentation

- +

◆ main()

@@ -150,10 +149,10 @@ Functions

Main function.

Returns
0 on exit
-
86  {
-
87  test(); // execute the tests
-
88  return 0;
-
89 }
+
86 {
+
87 test(); // execute the tests
+
88 return 0;
+
89}
static void test()
Definition: modular_exponentiation.cpp:60
Here is the call graph for this function:
@@ -164,7 +163,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -186,28 +185,28 @@ Here is the call graph for this function:
-

Function for testing power function. test cases and assert statement.

Returns
void
-
60  {
-
61  uint32_t test_case_1 = math::power(2, 5, 13);
-
62  assert(test_case_1 == 6);
-
63  std::cout << "Test 1 Passed!" << std::endl;
-
64 
-
65  uint32_t test_case_2 = math::power(14, 7, 15);
-
66  assert(test_case_2 == 14);
-
67  std::cout << "Test 2 Passed!" << std::endl;
-
68 
-
69  uint64_t test_case_3 = math::power(8, 15, 41);
-
70  assert(test_case_3 == 32);
-
71  std::cout << "Test 3 Passed!" << std::endl;
-
72 
-
73  uint64_t test_case_4 = math::power(27, 2, 5);
-
74  assert(test_case_4 == 4);
-
75  std::cout << "Test 4 Passed!" << std::endl;
-
76 
-
77  uint16_t test_case_5 = math::power(7, 3, 6);
-
78  assert(test_case_5 == 1);
-
79  std::cout << "Test 5 Passed!" << std::endl;
-
80 }
+

Function for testing power function. test cases and assert statement.

Returns
void
+
60 {
+
61 uint32_t test_case_1 = math::power(2, 5, 13);
+
62 assert(test_case_1 == 6);
+
63 std::cout << "Test 1 Passed!" << std::endl;
+
64
+
65 uint32_t test_case_2 = math::power(14, 7, 15);
+
66 assert(test_case_2 == 14);
+
67 std::cout << "Test 2 Passed!" << std::endl;
+
68
+
69 uint64_t test_case_3 = math::power(8, 15, 41);
+
70 assert(test_case_3 == 32);
+
71 std::cout << "Test 3 Passed!" << std::endl;
+
72
+
73 uint64_t test_case_4 = math::power(27, 2, 5);
+
74 assert(test_case_4 == 4);
+
75 std::cout << "Test 4 Passed!" << std::endl;
+
76
+
77 uint16_t test_case_5 = math::power(7, 3, 6);
+
78 assert(test_case_5 == 1);
+
79 std::cout << "Test 5 Passed!" << std::endl;
+
80}
T endl(T... args)
uint64_t power(uint64_t a, uint64_t b, uint64_t c)
This function calculates a raised to exponent b under modulo c using modular exponentiation.
Definition: modular_exponentiation.cpp:35
@@ -226,7 +225,7 @@ Here is the call graph for this function:
diff --git a/d0/d6d/modular__exponentiation_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d0/d6d/modular__exponentiation_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 69306dd2b..5e94a41e9 100644 --- a/d0/d6d/modular__exponentiation_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d0/d6d/modular__exponentiation_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: others Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,28 +90,27 @@ $(document).ready(function(){initNavTree('d0/d6f/namespaceothers.html','../../')
-
-
others Namespace Reference
+
others Namespace Reference

for vector More...

Detailed Description

-

for vector

-

Other algorithms.

-

for std::unordered_map

-

for reverse for assert for I/O operations for stack

-

Other algorithms

-

for assert for IO Operations for std::list

-

Other algorithms

+

for vector

+

Other algorithms.

+

for std::unordered_map

+

for reverse for assert for I/O operations for stack

+

Other algorithms

+

for assert for IO Operations for std::list

+

Other algorithms

diff --git a/d0/d6f/namespaceothers.js b/d0/d6f/namespaceothers.js index 5daddf217..042dab671 100644 --- a/d0/d6f/namespaceothers.js +++ b/d0/d6f/namespaceothers.js @@ -1,8 +1,8 @@ var namespaceothers = [ [ "iterative_tree_traversals", null, [ - [ "Node", "d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node.html", "d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node" ], - [ "BinaryTree", "d9/d12/classothers_1_1iterative__tree__traversals_1_1_binary_tree.html", "d9/d12/classothers_1_1iterative__tree__traversals_1_1_binary_tree" ] + [ "BinaryTree", "d9/d12/classothers_1_1iterative__tree__traversals_1_1_binary_tree.html", "d9/d12/classothers_1_1iterative__tree__traversals_1_1_binary_tree" ], + [ "Node", "d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node.html", "d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node" ] ] ], [ "lru_cache", null, [ [ "LRUCache", "d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html", "d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache" ] diff --git a/d0/d77/linear__search_8cpp__incl.svg b/d0/d77/linear__search_8cpp__incl.svg index 03cc5f507..a3dd2102a 100644 --- a/d0/d77/linear__search_8cpp__incl.svg +++ b/d0/d77/linear__search_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: dynamic_programming/longest_palindromic_subsequence.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d0/d77/longest__palindromic__subsequen
-
-
longest_palindromic_subsequence.cpp File Reference
+
longest_palindromic_subsequence.cpp File Reference
@@ -110,7 +109,7 @@ Include dependency graph for longest_palindromic_subsequence.cpp:
- @@ -120,11 +119,11 @@ Functions

+

Functions

std::string lps (std::string a)
 
 

Detailed Description

-

Program to find the Longest Palindormic Subsequence of a string.

-

Palindrome string sequence of characters which reads the same backward as forward Subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.

-
Author
Anjali Jha
+

Program to find the Longest Palindormic Subsequence of a string.

+

Palindrome string sequence of characters which reads the same backward as forward Subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.

+
Author
Anjali Jha

Function Documentation

- +

◆ lps()

@@ -139,55 +138,55 @@ Functions
-

Function that returns the longest palindromic subsequence of a string

-
25  {
-
26  std::string b = a;
-
27  reverse(b.begin(), b.end());
-
28  int m = a.length();
-
29  std::vector<std::vector<int> > res(m + 1);
-
30 
-
31  // Finding the length of the longest
-
32  // palindromic subsequence and storing
-
33  // in a 2D array in bottoms-up manner
-
34  for (int i = 0; i <= m; i++) {
-
35  for (int j = 0; j <= m; j++) {
-
36  if (i == 0 || j == 0) {
-
37  res[i][j] = 0;
-
38  } else if (a[i - 1] == b[j - 1]) {
-
39  res[i][j] = res[i - 1][j - 1] + 1;
-
40  } else {
-
41  res[i][j] = std::max(res[i - 1][j], res[i][j - 1]);
-
42  }
-
43  }
-
44  }
-
45  // Length of longest palindromic subsequence
-
46  int idx = res[m][m];
-
47  // Creating string of index+1 length
-
48  std::string ans(idx + 1, '\0');
-
49  int i = m, j = m;
-
50 
-
51  // starting from right-most bottom-most corner
-
52  // and storing them one by one in ans
-
53  while (i > 0 && j > 0) {
-
54  // if current characters in a and b are same
-
55  // then it is a part of the ans
-
56  if (a[i - 1] == b[j - 1]) {
-
57  ans[idx - 1] = a[i - 1];
-
58  i--;
-
59  j--;
-
60  idx--;
-
61  }
-
62  // If they are not same, find the larger of the
-
63  // two and move in that direction
-
64  else if (res[i - 1][j] > res[i][j - 1]) {
-
65  i--;
-
66  } else {
-
67  j--;
-
68  }
-
69  }
-
70 
-
71  return ans;
-
72 }
+

Function that returns the longest palindromic subsequence of a string

+
25 {
+
26 std::string b = a;
+
27 reverse(b.begin(), b.end());
+
28 int m = a.length();
+ +
30
+
31 // Finding the length of the longest
+
32 // palindromic subsequence and storing
+
33 // in a 2D array in bottoms-up manner
+
34 for (int i = 0; i <= m; i++) {
+
35 for (int j = 0; j <= m; j++) {
+
36 if (i == 0 || j == 0) {
+
37 res[i][j] = 0;
+
38 } else if (a[i - 1] == b[j - 1]) {
+
39 res[i][j] = res[i - 1][j - 1] + 1;
+
40 } else {
+
41 res[i][j] = std::max(res[i - 1][j], res[i][j - 1]);
+
42 }
+
43 }
+
44 }
+
45 // Length of longest palindromic subsequence
+
46 int idx = res[m][m];
+
47 // Creating string of index+1 length
+
48 std::string ans(idx + 1, '\0');
+
49 int i = m, j = m;
+
50
+
51 // starting from right-most bottom-most corner
+
52 // and storing them one by one in ans
+
53 while (i > 0 && j > 0) {
+
54 // if current characters in a and b are same
+
55 // then it is a part of the ans
+
56 if (a[i - 1] == b[j - 1]) {
+
57 ans[idx - 1] = a[i - 1];
+
58 i--;
+
59 j--;
+
60 idx--;
+
61 }
+
62 // If they are not same, find the larger of the
+
63 // two and move in that direction
+
64 else if (res[i - 1][j] > res[i][j - 1]) {
+
65 i--;
+
66 } else {
+
67 j--;
+
68 }
+
69 }
+
70
+
71 return ans;
+
72}
T begin(T... args)
T end(T... args)
@@ -204,7 +203,7 @@ Here is the call graph for this function:
- +

◆ main()

@@ -219,11 +218,11 @@ Here is the call graph for this function:
-

Main Function

-
87  {
-
88  test(); // execute the tests
-
89  return 0;
-
90 }
+

Main Function

+
87 {
+
88 test(); // execute the tests
+
89 return 0;
+
90}
void test()
Definition: longest_palindromic_subsequence.cpp:75
Here is the call graph for this function:
@@ -234,7 +233,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -248,15 +247,15 @@ Here is the call graph for this function:
-

Test function

-
75  {
-
76  // lps("radar") return "radar"
-
77  assert(lps("radar") == "radar");
-
78  // lps("abbcbaa") return "abcba"
-
79  assert(lps("abbcbaa") == "abcba");
-
80  // lps("bbbab") return "bbbb"
-
81  assert(lps("bbbab") == "bbbb");
-
82 }
+

Test function

+
75 {
+
76 // lps("radar") return "radar"
+
77 assert(lps("radar") == "radar");
+
78 // lps("abbcbaa") return "abcba"
+
79 assert(lps("abbcbaa") == "abcba");
+
80 // lps("bbbab") return "bbbb"
+
81 assert(lps("bbbab") == "bbbb");
+
82}
std::string lps(std::string a)
Definition: longest_palindromic_subsequence.cpp:25
Here is the call graph for this function:
@@ -273,7 +272,7 @@ Here is the call graph for this function:
diff --git a/d0/d77/longest__palindromic__subsequence_8cpp_a6f73ddd8cd83d784036f131dfc6540c4_cgraph.svg b/d0/d77/longest__palindromic__subsequence_8cpp_a6f73ddd8cd83d784036f131dfc6540c4_cgraph.svg index 7252dd5b1..b2366e522 100644 --- a/d0/d77/longest__palindromic__subsequence_8cpp_a6f73ddd8cd83d784036f131dfc6540c4_cgraph.svg +++ b/d0/d77/longest__palindromic__subsequence_8cpp_a6f73ddd8cd83d784036f131dfc6540c4_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,28 +90,27 @@ $(document).ready(function(){initNavTree('d7/d7c/classstatistics_1_1stats__compu
-
-
statistics::stats_computer1< T > Member List
+
statistics::stats_computer1< T > Member List
diff --git a/d0/d83/n__queens_8cpp__incl.svg b/d0/d83/n__queens_8cpp__incl.svg index 976a87299..28c3a73ce 100644 --- a/d0/d83/n__queens_8cpp__incl.svg +++ b/d0/d83/n__queens_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: math/number_of_positive_divisors.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d0/da2/number__of__positive__divisors_
-
-
number_of_positive_divisors.cpp File Reference
+
number_of_positive_divisors.cpp File Reference
@@ -108,7 +107,7 @@ Include dependency graph for number_of_positive_divisors.cpp:
- @@ -118,18 +117,18 @@ Functions

+

Functions

int number_of_positive_divisors (int n)
 
 

Detailed Description

-

C++ Program to calculate the number of positive divisors.

-

This algorithm uses the prime factorization approach. Any positive integer can be written as a product of its prime factors.
+

C++ Program to calculate the number of positive divisors.

+

This algorithm uses the prime factorization approach. Any positive integer can be written as a product of its prime factors.
Let \(N = p_1^{e_1} \times p_2^{e_2} \times\cdots\times p_k^{e_k}\) where \(p_1,\, p_2,\, \dots,\, p_k\) are distinct prime factors of \(N\) and \(e_1,\, e_2,\, \dots,\, e_k\) are respective positive integer exponents.
Each positive divisor of \(N\) is in the form \(p_1^{g_1}\times p_2^{g_2}\times\cdots\times p_k^{g_k}\) where \(0\le g_i\le e_i\) are integers for all \(1\le i\le k\).
Finally, there are \((e_1+1) \times (e_2+1)\times\cdots\times (e_k+1)\) positive divisors of \(N\) since we can choose every \(g_i\) independently.

-

Example:
+

Example:
\(N = 36 = (3^2 \cdot 2^2)\)
\(\mbox{number_of_positive_divisors}(36) = (2+1) \cdot (2+1) = 9\).
list of positive divisors of 36 = 1, 2, 3, 4, 6, 9, 12, 18, 36.

-

Similarly, for N = -36 the number of positive divisors remain same.

+

Similarly, for N = -36 the number of positive divisors remain same.

Function Documentation

- +

◆ main()

@@ -144,19 +143,19 @@ list of positive divisors of 36 = 1, 2, 3, 4, 6, 9, 12, 18, 36.

-

Main function

-
81  {
-
82  tests();
-
83  int n;
-
84  std::cin >> n;
-
85  if (n == 0) {
-
86  std::cout << "All non-zero numbers are divisors of 0 !" << std::endl;
-
87  } else {
-
88  std::cout << "Number of positive divisors is : ";
- -
90  }
-
91  return 0;
-
92 }
+

Main function

+
81 {
+
82 tests();
+
83 int n;
+
84 std::cin >> n;
+
85 if (n == 0) {
+
86 std::cout << "All non-zero numbers are divisors of 0 !" << std::endl;
+
87 } else {
+
88 std::cout << "Number of positive divisors is : ";
+ +
90 }
+
91 return 0;
+
92}
T endl(T... args)
@@ -171,7 +170,7 @@ Here is the call graph for this function:
- +

◆ number_of_positive_divisors()

@@ -186,50 +185,50 @@ Here is the call graph for this function:
-

Function to compute the number of positive divisors.

Parameters
+

Function to compute the number of positive divisors.

Parameters
nnumber to compute divisors for
Returns
number of positive divisors of n (or 1 if n = 0)
-
33  {
-
34  if (n < 0) {
-
35  n = -n; // take the absolute value of n
-
36  }
-
37 
-
38  int number_of_divisors = 1;
-
39 
-
40  for (int i = 2; i * i <= n; i++) {
-
41  // This part is doing the prime factorization.
-
42  // Note that we cannot find a composite divisor of n unless we would
-
43  // already previously find the corresponding prime divisor and dvided
-
44  // n by that prime. Therefore, all the divisors found here will
-
45  // actually be primes.
-
46  // The loop terminates early when it is left with a number n which
-
47  // does not have a divisor smaller or equal to sqrt(n) - that means
-
48  // the remaining number is a prime itself.
-
49  int prime_exponent = 0;
-
50  while (n % i == 0) {
-
51  // Repeatedly divide n by the prime divisor n to compute
-
52  // the exponent (e_i in the algorithm description).
-
53  prime_exponent++;
-
54  n /= i;
-
55  }
-
56  number_of_divisors *= prime_exponent + 1;
-
57  }
-
58  if (n > 1) {
-
59  // In case the remaining number n is a prime number itself
-
60  // (essentially p_k^1) the final answer is also multiplied by (e_k+1).
-
61  number_of_divisors *= 2;
-
62  }
-
63 
-
64  return number_of_divisors;
-
65 }
+
33 {
+
34 if (n < 0) {
+
35 n = -n; // take the absolute value of n
+
36 }
+
37
+
38 int number_of_divisors = 1;
+
39
+
40 for (int i = 2; i * i <= n; i++) {
+
41 // This part is doing the prime factorization.
+
42 // Note that we cannot find a composite divisor of n unless we would
+
43 // already previously find the corresponding prime divisor and dvided
+
44 // n by that prime. Therefore, all the divisors found here will
+
45 // actually be primes.
+
46 // The loop terminates early when it is left with a number n which
+
47 // does not have a divisor smaller or equal to sqrt(n) - that means
+
48 // the remaining number is a prime itself.
+
49 int prime_exponent = 0;
+
50 while (n % i == 0) {
+
51 // Repeatedly divide n by the prime divisor n to compute
+
52 // the exponent (e_i in the algorithm description).
+
53 prime_exponent++;
+
54 n /= i;
+
55 }
+
56 number_of_divisors *= prime_exponent + 1;
+
57 }
+
58 if (n > 1) {
+
59 // In case the remaining number n is a prime number itself
+
60 // (essentially p_k^1) the final answer is also multiplied by (e_k+1).
+
61 number_of_divisors *= 2;
+
62 }
+
63
+
64 return number_of_divisors;
+
65}
- +

◆ tests()

@@ -243,14 +242,14 @@ Here is the call graph for this function:
-

Test implementations

-
70  {
-
71  assert(number_of_positive_divisors(36) == 9);
-
72  assert(number_of_positive_divisors(-36) == 9);
-
73  assert(number_of_positive_divisors(1) == 1);
-
74  assert(number_of_positive_divisors(2011) == 2); // 2011 is a prime
-
75  assert(number_of_positive_divisors(756) == 24); // 756 = 2^2 * 3^3 * 7
-
76 }
+

Test implementations

+
70 {
+
71 assert(number_of_positive_divisors(36) == 9);
+
72 assert(number_of_positive_divisors(-36) == 9);
+
73 assert(number_of_positive_divisors(1) == 1);
+
74 assert(number_of_positive_divisors(2011) == 2); // 2011 is a prime
+
75 assert(number_of_positive_divisors(756) == 24); // 756 = 2^2 * 3^3 * 7
+
76}
Here is the call graph for this function:
@@ -266,7 +265,7 @@ Here is the call graph for this function:
diff --git a/d0/da2/number__of__positive__divisors_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg b/d0/da2/number__of__positive__divisors_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg index e4ab4fdce..6f8ddb080 100644 --- a/d0/da2/number__of__positive__divisors_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg +++ b/d0/da2/number__of__positive__divisors_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - + + Algorithms_in_C++: sorting/non_recursive_merge_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('d0/db6/non__recursive__merge__sort_8cp -
-
non_recursive_merge_sort.cpp File Reference
+
non_recursive_merge_sort.cpp File Reference
#include <cstddef>
@@ -107,13 +106,13 @@ Include dependency graph for non_recursive_merge_sort.cpp:
- - +

+

Namespaces

 sorting
namespace  sorting
 Sorting algorithms.
 
- @@ -131,20 +130,67 @@ Functions - +

+

Functions

template<class Iterator >
void sorting::merge (Iterator l, Iterator r, const Iterator e, char b[])
void sorting::non_recursive_merge_sort (const Iterator first, const Iterator last)
 bottom-up merge sort which sorts elements in a non-decreasing order More...
 
-int main (int argc, char **argv)
int main (int argc, char **argv)
 

Detailed Description

-

Copyright 2020

Author
Albirair
+

Copyright 2020

Author
Albirair

A generic implementation of non-recursive merge sort.

-
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+
94 {
+
95 int size;
+
96 std::cout << "Enter the number of elements : ";
+
97 std::cin >> size;
+
98 int* arr = new int[size];
+
99 for (int i = 0; i < size; ++i) {
+
100 std::cout << "arr[" << i << "] = ";
+
101 std::cin >> arr[i];
+
102 }
+
103 non_recursive_merge_sort(arr, size);
+
104 std::cout << "Sorted array\n";
+
105 for (int i = 0; i < size; ++i)
+
106 std::cout << "arr[" << i << "] = " << arr[i] << '\n';
+
107 delete[] arr;
+
108 return 0;
+
109}
+ + +
void non_recursive_merge_sort(const Iterator first, const Iterator last)
bottom-up merge sort which sorts elements in a non-decreasing order
Definition: non_recursive_merge_sort.cpp:86
+
+
+
+ diff --git a/d0/db6/non__recursive__merge__sort_8cpp.js b/d0/db6/non__recursive__merge__sort_8cpp.js index 2ccf11480..df65ebc4b 100644 --- a/d0/db6/non__recursive__merge__sort_8cpp.js +++ b/d0/db6/non__recursive__merge__sort_8cpp.js @@ -1,6 +1,5 @@ var non__recursive__merge__sort_8cpp = [ - [ "main", "d0/db6/non__recursive__merge__sort_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], [ "merge", "d0/db6/non__recursive__merge__sort_8cpp.html#aa26de383227859210f14dcf12201a079", null ], [ "non_recursive_merge_sort", "d0/db6/non__recursive__merge__sort_8cpp.html#ae97f4dd815654c4682f564afd718e824", null ], [ "non_recursive_merge_sort", "d0/db6/non__recursive__merge__sort_8cpp.html#a140d913e42fb94176a0b2c8b29a80420", null ], diff --git a/d0/db7/smallest__circle_8cpp__incl.svg b/d0/db7/smallest__circle_8cpp__incl.svg index 7ecb16a3e..471712c29 100644 --- a/d0/db7/smallest__circle_8cpp__incl.svg +++ b/d0/db7/smallest__circle_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,24 +90,23 @@ $(document).ready(function(){initNavTree('d8/dc8/struct_point.html','../../'); i
-
-
Point Member List
+
Point Member List

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

- + - +
Point(double a=0.f, double b=0.f)Pointinlineexplicit
x (defined in Point)Point
x (defined in Point)Point
xPoint
yPoint
yPoint
yPoint
diff --git a/d0/dcc/modular__division_8cpp__incl.svg b/d0/dcc/modular__division_8cpp__incl.svg index 4d1e8211a..7bb2a37b0 100644 --- a/d0/dcc/modular__division_8cpp__incl.svg +++ b/d0/dcc/modular__division_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,33 +90,32 @@ $(document).ready(function(){initNavTree('d6/d26/classciphers_1_1_hill_cipher.ht
-
-
ciphers::HillCipher Member List
+
ciphers::HillCipher Member List

This is the complete list of members for ciphers::HillCipher, including all inherited members.

- + - - - - - + + + + + - - - + + + - +
codec(const std::string &text, const matrix< int > &key)ciphers::HillCipherinlineprivatestatic
decrypt_text(const std::string &text, const matrix< int > &decrypt_key)ciphers::HillCipherinlinestatic
decrypt_text(const std::string &text, const matrix< int > &decrypt_key)ciphers::HillCipherinlinestatic
encrypt_text(const std::string &text, const matrix< int > &encrypt_key)ciphers::HillCipherinlinestatic
gcd(T a, T b)ciphers::HillCipherinlineprivatestatic
generate_decryption_key(matrix< int > const &encrypt_key)ciphers::HillCipherinlinestatic
generate_encryption_key(size_t size, int limit1=0, int limit2=10)ciphers::HillCipherinlinestatic
generate_keys(size_t size, int limit1=0, int limit2=10)ciphers::HillCipherinlinestatic
get_char_idx(const char ch)ciphers::HillCipherinlineprivatestatic
gcd(T a, T b)ciphers::HillCipherinlineprivatestatic
generate_decryption_key(matrix< int > const &encrypt_key)ciphers::HillCipherinlinestatic
generate_encryption_key(size_t size, int limit1=0, int limit2=10)ciphers::HillCipherinlinestatic
generate_keys(size_t size, int limit1=0, int limit2=10)ciphers::HillCipherinlinestatic
get_char_idx(const char ch)ciphers::HillCipherinlineprivatestatic
get_idx_char(const uint8_t idx)ciphers::HillCipherinlineprivatestatic
get_inverse(matrix< T > const &A)ciphers::HillCipherinlineprivatestatic
mat_mul(const std::valarray< uint8_t > &vector, const matrix< int > &key)ciphers::HillCipherinlineprivatestatic
modulo(int a, int b) (defined in ciphers::HillCipher)ciphers::HillCipherinlineprivatestatic
get_inverse(matrix< T > const &A)ciphers::HillCipherinlineprivatestatic
mat_mul(const std::valarray< uint8_t > &vector, const matrix< int > &key)ciphers::HillCipherinlineprivatestatic
modulo(int a, int b) (defined in ciphers::HillCipher)ciphers::HillCipherinlineprivatestatic
rand_range(T1 a, T1 b)ciphers::HillCipherinlineprivatestatic
rand_range(matrix< T2 > *M, T1 a, T1 b)ciphers::HillCipherinlineprivatestatic
rand_range(matrix< T2 > *M, T1 a, T1 b)ciphers::HillCipherinlineprivatestatic
diff --git a/d0/dd5/ode__midpoint__euler_8cpp__incl.svg b/d0/dd5/ode__midpoint__euler_8cpp__incl.svg index 7e6653118..007583b4b 100644 --- a/d0/dd5/ode__midpoint__euler_8cpp__incl.svg +++ b/d0/dd5/ode__midpoint__euler_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: saddleback Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d0/dda/namespacesaddleback.html','../.
-
-
saddleback Namespace Reference
+
saddleback Namespace Reference
-

Function for implementing Saddleback Algorithm. +

Function for implementing Saddleback Algorithm. More...

Detailed Description

-

Function for implementing Saddleback Algorithm.

+

Function for implementing Saddleback Algorithm.

diff --git a/d0/de2/gaussian__elimination_8cpp.html b/d0/de2/gaussian__elimination_8cpp.html index c9712e1dd..78641f7c6 100644 --- a/d0/de2/gaussian__elimination_8cpp.html +++ b/d0/de2/gaussian__elimination_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: numerical_methods/gaussian_elimination.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('d0/de2/gaussian__elimination_8cpp.html
-
-
gaussian_elimination.cpp File Reference
+
gaussian_elimination.cpp File Reference
-

Gaussian elimination method +

Gaussian elimination method More...

#include <iostream>
@@ -107,15 +106,15 @@ Include dependency graph for gaussian_elimination.cpp:
-

+

Functions

int main ()
 

Detailed Description

-

Gaussian elimination method

+

Function Documentation

- +

◆ main()

@@ -130,80 +129,80 @@ Functions
-

Main function

-
9  {
-
10  int mat_size, i, j, step;
-
11 
-
12  std::cout << "Matrix size: ";
-
13  std::cin >> mat_size;
-
14 
-
15  // create a 2D matrix by dynamic memory allocation
-
16  double **mat = new double *[mat_size + 1], **x = new double *[mat_size];
-
17  for (i = 0; i <= mat_size; i++) {
-
18  mat[i] = new double[mat_size + 1];
-
19  if (i < mat_size)
-
20  x[i] = new double[mat_size + 1];
-
21  }
-
22 
-
23  // get the matrix elements from user
-
24  std::cout << std::endl << "Enter value of the matrix: " << std::endl;
-
25  for (i = 0; i < mat_size; i++) {
-
26  for (j = 0; j <= mat_size; j++) {
-
27  std::cin >>
-
28  mat[i][j]; // Enter (mat_size*mat_size) value of the matrix.
-
29  }
-
30  }
-
31 
-
32  // perform Gaussian elimination
-
33  for (step = 0; step < mat_size - 1; step++) {
-
34  for (i = step; i < mat_size - 1; i++) {
-
35  double a = (mat[i + 1][step] / mat[step][step]);
-
36 
-
37  for (j = step; j <= mat_size; j++)
-
38  mat[i + 1][j] = mat[i + 1][j] - (a * mat[step][j]);
-
39  }
-
40  }
-
41 
- -
43  << "Matrix using Gaussian Elimination method: " << std::endl;
-
44  for (i = 0; i < mat_size; i++) {
-
45  for (j = 0; j <= mat_size; j++) {
-
46  x[i][j] = mat[i][j];
-
47  std::cout << mat[i][j] << " ";
-
48  }
- -
50  }
- -
52  << "Value of the Gaussian Elimination method: " << std::endl;
-
53  for (i = mat_size - 1; i >= 0; i--) {
-
54  double sum = 0;
-
55  for (j = mat_size - 1; j > i; j--) {
-
56  x[i][j] = x[j][j] * x[i][j];
-
57  sum = x[i][j] + sum;
-
58  }
-
59  if (x[i][i] == 0)
-
60  x[i][i] = 0;
-
61  else
-
62  x[i][i] = (x[i][mat_size] - sum) / (x[i][i]);
-
63 
-
64  std::cout << "x" << i << "= " << x[i][i] << std::endl;
-
65  }
-
66 
-
67  for (i = 0; i <= mat_size; i++) {
-
68  delete[] mat[i];
-
69  if (i < mat_size)
-
70  delete[] x[i];
-
71  }
-
72  delete[] mat;
-
73  delete[] x;
-
74 
-
75  return 0;
-
76 }
+

Main function

+
9 {
+
10 int mat_size, i, j, step;
+
11
+
12 std::cout << "Matrix size: ";
+ +
14
+
15 // create a 2D matrix by dynamic memory allocation
+
16 double **mat = new double *[mat_size + 1], **x = new double *[mat_size];
+
17 for (i = 0; i <= mat_size; i++) {
+
18 mat[i] = new double[mat_size + 1];
+
19 if (i < mat_size)
+
20 x[i] = new double[mat_size + 1];
+
21 }
+
22
+
23 // get the matrix elements from user
+
24 std::cout << std::endl << "Enter value of the matrix: " << std::endl;
+
25 for (i = 0; i < mat_size; i++) {
+
26 for (j = 0; j <= mat_size; j++) {
+
27 std::cin >>
+
28 mat[i][j]; // Enter (mat_size*mat_size) value of the matrix.
+
29 }
+
30 }
+
31
+
32 // perform Gaussian elimination
+
33 for (step = 0; step < mat_size - 1; step++) {
+
34 for (i = step; i < mat_size - 1; i++) {
+
35 double a = (mat[i + 1][step] / mat[step][step]);
+
36
+
37 for (j = step; j <= mat_size; j++)
+
38 mat[i + 1][j] = mat[i + 1][j] - (a * mat[step][j]);
+
39 }
+
40 }
+
41
+ +
43 << "Matrix using Gaussian Elimination method: " << std::endl;
+
44 for (i = 0; i < mat_size; i++) {
+
45 for (j = 0; j <= mat_size; j++) {
+
46 x[i][j] = mat[i][j];
+
47 std::cout << mat[i][j] << " ";
+
48 }
+ +
50 }
+ +
52 << "Value of the Gaussian Elimination method: " << std::endl;
+
53 for (i = mat_size - 1; i >= 0; i--) {
+
54 double sum = 0;
+
55 for (j = mat_size - 1; j > i; j--) {
+
56 x[i][j] = x[j][j] * x[i][j];
+
57 sum = x[i][j] + sum;
+
58 }
+
59 if (x[i][i] == 0)
+
60 x[i][i] = 0;
+
61 else
+
62 x[i][i] = (x[i][mat_size] - sum) / (x[i][i]);
+
63
+
64 std::cout << "x" << i << "= " << x[i][i] << std::endl;
+
65 }
+
66
+
67 for (i = 0; i <= mat_size; i++) {
+
68 delete[] mat[i];
+
69 if (i < mat_size)
+
70 delete[] x[i];
+
71 }
+
72 delete[] mat;
+
73 delete[] x;
+
74
+
75 return 0;
+
76}
T endl(T... args)
ll mat_size
Definition: matrix_exponentiation.cpp:45
-
T sum(const std::vector< std::valarray< T >> &A)
Definition: vector_ops.hpp:232
+
T sum(const std::vector< std::valarray< T > > &A)
Definition: vector_ops.hpp:232
Here is the call graph for this function:
@@ -219,7 +218,7 @@ Here is the call graph for this function:
diff --git a/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 17e0c0cb4..56adcfba2 100644 --- a/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 7498b479b..cde93f8f0 100644 --- a/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -f62ad0e82dde8c908ac83d24c6f82e9f \ No newline at end of file +0d8dcf2fc52ef686fb3bd07832c3cf4c \ No newline at end of file diff --git a/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 3554e43ff..4531a5891 100644 --- a/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d0/de2/gaussian__elimination_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + machine_learning::sum diff --git a/d0/df8/namespaceabbreviation.html b/d0/df8/namespaceabbreviation.html index c06af4c2b..4a7670953 100644 --- a/d0/df8/namespaceabbreviation.html +++ b/d0/df8/namespaceabbreviation.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: abbreviation Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d0/df8/namespaceabbreviation.html','..
-
-
abbreviation Namespace Reference
+
abbreviation Namespace Reference
-

Functions for Abbreviation implementation. +

Functions for Abbreviation implementation. More...

Detailed Description

-

Functions for Abbreviation implementation.

+

Functions for Abbreviation implementation.

diff --git a/d0/dfc/sqrt__double_8cpp__incl.svg b/d0/dfc/sqrt__double_8cpp__incl.svg index fa8234bef..27a41c397 100644 --- a/d0/dfc/sqrt__double_8cpp__incl.svg +++ b/d0/dfc/sqrt__double_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - - - diff --git a/d0/dff/classmachine__learning_1_1aystar__search_1_1_eight_puzzle__coll__graph.md5 b/d0/dff/classmachine__learning_1_1aystar__search_1_1_eight_puzzle__coll__graph.md5 deleted file mode 100644 index 48407e518..000000000 --- a/d0/dff/classmachine__learning_1_1aystar__search_1_1_eight_puzzle__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -b0ee1a79160cce85a740663fe5f978cf \ No newline at end of file diff --git a/d0/dff/classmachine__learning_1_1aystar__search_1_1_eight_puzzle__coll__graph.svg b/d0/dff/classmachine__learning_1_1aystar__search_1_1_eight_puzzle__coll__graph.svg deleted file mode 100644 index 177e7d473..000000000 --- a/d0/dff/classmachine__learning_1_1aystar__search_1_1_eight_puzzle__coll__graph.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - -machine_learning::aystar_search::EightPuzzle< N > - - - -Node1 - - -machine_learning::aystar -_search::EightPuzzle< N > - - - - - -Node2 - - -std::vector< std::pair -< int8_t, int8_t > > - - - - - -Node2->Node1 - - - moves - - - -Node3 - - -std::pair< int8_t, - int8_t > - - - - - -Node3->Node2 - - - elements - - - -Node4 - - -std::array< std::array -< uint32_t, 3 >, 3 > - - - - - -Node4->Node1 - - - board - - - diff --git a/d0/dff/structlinkedlist.html b/d0/dff/structlinkedlist.html index 63f2ad4ba..9f6353d0d 100644 --- a/d0/dff/structlinkedlist.html +++ b/d0/dff/structlinkedlist.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: linkedlist Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('d0/dff/structlinkedlist.html','../../' -
-
linkedlist Struct Reference
+
linkedlist Struct Reference
@@ -104,12 +103,12 @@ Collaboration diagram for linkedlist:
[legend]
- - -

+

Public Attributes

+
int data
 
+
linkedlistnext
 
@@ -122,7 +121,7 @@ int data diff --git a/d0/dff/structlinkedlist.js b/d0/dff/structlinkedlist.js deleted file mode 100644 index 22f574184..000000000 --- a/d0/dff/structlinkedlist.js +++ /dev/null @@ -1,5 +0,0 @@ -var structlinkedlist = -[ - [ "data", "d0/dff/structlinkedlist.html#a4e025f2bca6ab3ae7b0408a416d53d93", null ], - [ "next", "d0/dff/structlinkedlist.html#a698c32a2f4e48b98bb540f518d2937a0", null ] -]; \ No newline at end of file diff --git a/d1/d06/ternary__search_8cpp__incl.svg b/d1/d06/ternary__search_8cpp__incl.svg index 66e082be9..79e15d11a 100644 --- a/d1/d06/ternary__search_8cpp__incl.svg +++ b/d1/d06/ternary__search_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,27 +90,26 @@ $(document).ready(function(){initNavTree('dd/d4f/class_solution.html','../../');
-
-
Solution Member List
+
Solution Member List

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

- + - + - + - +
bridge (defined in Solution)Solutionprivate
dfs(int current_node, int parent) (defined in Solution)Solutioninlineprivate
dfs(int current_node, int parent) (defined in Solution)Solutioninlineprivate
graph (defined in Solution)Solutionprivate
in_time (defined in Solution)Solutionprivate
in_time (defined in Solution)Solutionprivate
out_time (defined in Solution)Solutionprivate
search_bridges(int n, const std::vector< std::vector< int >> &connections) (defined in Solution)Solutioninline
search_bridges(int n, const std::vector< std::vector< int > > &connections) (defined in Solution)Solutioninline
timer (defined in Solution)Solutionprivate
visited (defined in Solution)Solutionprivate
visited (defined in Solution)Solutionprivate
diff --git a/d1/d11/gcd__of__n__numbers_8cpp.html b/d1/d11/gcd__of__n__numbers_8cpp.html index 5f72151dd..a28e9d716 100644 --- a/d1/d11/gcd__of__n__numbers_8cpp.html +++ b/d1/d11/gcd__of__n__numbers_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: math/gcd_of_n_numbers.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d1/d11/gcd__of__n__numbers_8cpp.html',
-
-
gcd_of_n_numbers.cpp File Reference
+
gcd_of_n_numbers.cpp File Reference
@@ -107,7 +106,7 @@ Include dependency graph for gcd_of_n_numbers.cpp:
- @@ -115,10 +114,10 @@ Functions

+

Functions

int gcd (int *a, int n)
 
 

Detailed Description

-

This program aims at calculating the GCD of n numbers by division method.

+

This program aims at calculating the GCD of n numbers by division method.

See also
gcd_iterative_euclidean.cpp, gcd_recursive_euclidean.cpp

Function Documentation

- +

◆ gcd()

@@ -143,7 +142,7 @@ Functions
-

Compute GCD using division algorithm

+

Compute GCD using division algorithm

Parameters
@@ -151,22 +150,28 @@ Functions
[in]aarray of integers to compute GCD for
-
15  {
-
16  int j = 1; // to access all elements of the array starting from 1
-
17  int gcd = a[0];
-
18  while (j < n) {
-
19  if (a[j] % gcd == 0) // value of gcd is as needed so far
-
20  j++; // so we check for next element
-
21  else
-
22  gcd = a[j] % gcd; // calculating GCD by division method
-
23  }
-
24  return gcd;
-
25 }
+
15 {
+
16 int j = 1; // to access all elements of the array starting from 1
+
17 int gcd = a[0];
+
18 while (j < n) {
+
19 if (a[j] % gcd == 0) // value of gcd is as needed so far
+
20 j++; // so we check for next element
+
21 else
+
22 gcd = a[j] % gcd; // calculating GCD by division method
+
23 }
+
24 return gcd;
+
25}
int gcd(int *a, int n)
Definition: gcd_of_n_numbers.cpp:15
-
+
+Here is the call graph for this function:
+
+
- + +
+
+

◆ main()

@@ -181,28 +186,28 @@ Functions
-

Main function

-
28  {
-
29  int n;
-
30  std::cout << "Enter value of n:" << std::endl;
-
31  std::cin >> n;
-
32  int *a = new int[n];
-
33  int i;
-
34  std::cout << "Enter the n numbers:" << std::endl;
-
35  for (i = 0; i < n; i++) std::cin >> a[i];
-
36 
-
37  std::cout << "GCD of entered n numbers:" << gcd(a, n) << std::endl;
-
38 
-
39  delete[] a;
-
40  return 0;
-
41 }
+

Main function

+
28 {
+
29 int n;
+
30 std::cout << "Enter value of n:" << std::endl;
+
31 std::cin >> n;
+
32 int *a = new int[n];
+
33 int i;
+
34 std::cout << "Enter the n numbers:" << std::endl;
+
35 for (i = 0; i < n; i++) std::cin >> a[i];
+
36
+
37 std::cout << "GCD of entered n numbers:" << gcd(a, n) << std::endl;
+
38
+
39 delete[] a;
+
40 return 0;
+
41}
T endl(T... args)
Here is the call graph for this function:
-
+
@@ -214,7 +219,7 @@ Here is the call graph for this function:
diff --git a/d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.map b/d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.map new file mode 100644 index 000000000..9d5066e1b --- /dev/null +++ b/d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.md5 b/d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.md5 new file mode 100644 index 000000000..6cdeba598 --- /dev/null +++ b/d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.md5 @@ -0,0 +1 @@ +63194f545c045f973d0472cef162735b \ No newline at end of file diff --git a/d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.svg b/d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.svg new file mode 100644 index 000000000..9e8e853e8 --- /dev/null +++ b/d1/d11/gcd__of__n__numbers_8cpp_a25034543c20f271da04fb24ad2b2747a_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +gcd + + + +Node1 + + +gcd + + + + + +Node1->Node1 + + + + + diff --git a/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 6b88433ba..2a9ad2d1c 100644 --- a/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,5 +1,5 @@ - + - + diff --git a/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 9e1b6233b..30063db61 100644 --- a/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -0ddf9ef62ee351d711f1122bd1b3e94b \ No newline at end of file +c9de74e50041c92b10a823bacb20486f \ No newline at end of file diff --git a/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 3c8198e3a..9c3cf3eea 100644 --- a/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d1/d11/gcd__of__n__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,20 +1,20 @@ - - - + + main - + Node1 - -main + +main @@ -22,16 +22,16 @@ Node2 - -std::endl + +std::endl Node1->Node2 - - + + @@ -45,8 +45,14 @@ Node1->Node3 - - + + + + + +Node3->Node3 + + diff --git a/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.map b/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.map deleted file mode 100644 index 855ba8a8d..000000000 --- a/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.md5 b/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.md5 deleted file mode 100644 index 95b0d7764..000000000 --- a/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -884a0c769e9e126da41bafbfcd37ea9d \ No newline at end of file diff --git a/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.svg b/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.svg deleted file mode 100644 index 8bcd27f18..000000000 --- a/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - -data_structures::linked_list::list - - - -Node1 - - -data_structures::linked -_list::list - - - - - -Node2 - - -std::shared_ptr< data -_structures::linked_list -::link > - - - - - -Node2->Node1 - - - first -last - - - diff --git a/d1/d1d/class_graph-members.html b/d1/d1d/class_graph-members.html index 36b84ef5a..bc8a0e948 100644 --- a/d1/d1d/class_graph-members.html +++ b/d1/d1d/class_graph-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,60 +90,59 @@ $(document).ready(function(){initNavTree('da/d9a/class_graph.html','../../'); in
-
-
Graph Member List
+
Graph Member List

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

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
addEdge(int src, int dst, int weight) (defined in Graph)Graphinline
addEdge(int src, int dst, int weight) (defined in Graph)Graphinline
addEdge(int src, int dst, int weight) (defined in Graph)Graphinline
addEdge(Edge const &edge)Graphinline
addEdge(unsigned int source, unsigned int destination)Graphinline
addEdge(unsigned int source, unsigned int destination)Graphinline
addEdge(int src, int dst, int weight) (defined in Graph)Graphinline
addVertices(unsigned int num=1)Graphinline
addVertices(unsigned int num=1)Graphinline
bfs(int source, int sink) (defined in Graph)Graphinlineprivate
capacity (defined in Graph)Graphprivate
capacity (defined in Graph)Graphprivate
edge_participated (defined in Graph)Graphprivate
edgeNum (defined in Graph)Graph
edgeNum (defined in Graph)Graph
edges (defined in Graph)Graph
edges (defined in Graph)Graph
edges (defined in Graph)Graph
ford_fulkerson() (defined in Graph)Graphinline
getAdjList() constGraphinline
getAdjList() constGraphinline
getVertices() constGraphinline
Graph(int V, int E) (defined in Graph)Graphinline
Graph(int V, int E) (defined in Graph)Graphinline
Graph(int V) (defined in Graph)Graphinline
Graph() (defined in Graph)Graphinline
Graph() (defined in Graph)Graphinline
Graph(Graph &&)=default (defined in Graph)Graph
Graph(Graph const &)=default (defined in Graph)Graph
Graph(Graph const &)=default (defined in Graph)Graph
Graph(unsigned int vertices, AdjList adjList)Graphinline
Graph(unsigned int vertices, AdjList &&adjList)Graphinline
Graph(unsigned int vertices, AdjList &&adjList)Graphinline
Graph(unsigned int vertices, std::vector< Edge > const &edges)Graphinline
Graph(const int V) (defined in Graph)Graphinline
Graph(const int V) (defined in Graph)Graphinline
m_adjList (defined in Graph)Graphprivate
m_vertices (defined in Graph)Graphprivate
m_vertices (defined in Graph)Graphprivate
max_flow (defined in Graph)Graphprivate
operator=(Graph &&)=default (defined in Graph)Graph
operator=(Graph &&)=default (defined in Graph)Graph
operator=(Graph const &)=default (defined in Graph)Graph
parent (defined in Graph)Graphprivate
parent (defined in Graph)Graphprivate
print_flow_info() (defined in Graph)Graphinline
residual_capacity (defined in Graph)Graphprivate
residual_capacity (defined in Graph)Graphprivate
set_graph() (defined in Graph)Graphinline
sink (defined in Graph)Graphprivate
sink (defined in Graph)Graphprivate
source (defined in Graph)Graphprivate
total_edges (defined in Graph)Graphprivate
total_edges (defined in Graph)Graphprivate
total_nodes (defined in Graph)Graphprivate
vertexNum (defined in Graph)Graph
vertexNum (defined in Graph)Graph
visited (defined in Graph)Graphprivate
~Graph() (defined in Graph)Graphinline
~Graph() (defined in Graph)Graphinline
~Graph()=default (defined in Graph)Graph
diff --git a/d1/d1d/pascal__triangle_8cpp__incl.svg b/d1/d1d/pascal__triangle_8cpp__incl.svg index d5aee41ad..289caf0bb 100644 --- a/d1/d1d/pascal__triangle_8cpp__incl.svg +++ b/d1/d1d/pascal__triangle_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,39 +90,38 @@ $(document).ready(function(){initNavTree('d0/d5f/classoperations__on__datastruct
-
-
operations_on_datastructures::trie_operations::Tnode Member List
+
operations_on_datastructures::trie_operations::Tnode Member List

This is the complete list of members for operations_on_datastructures::trie_operations::Tnode, including all inherited members.

- + - + - + - + - + - + - + - + - + - +
Delete(std::string entry)operations_on_datastructures::trie_operations::Tnode
DeleteFrom(Tnode *delete_from, std::string delete_string, int remove_index)operations_on_datastructures::trie_operations::Tnode
DeleteFrom(Tnode *delete_from, std::string delete_string, int remove_index)operations_on_datastructures::trie_operations::Tnode
endOfWord (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeprivate
english (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeprivate
english (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeprivate
ENGLISH_ALPHABET_SIZE (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeprivatestatic
frequency (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeprivate
frequency (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeprivate
Insert(const std::string &entry)operations_on_datastructures::trie_operations::Tnode
numberOfChildren(Tnode *node)operations_on_datastructures::trie_operations::Tnodeinline
numberOfChildren(Tnode *node)operations_on_datastructures::trie_operations::Tnodeinline
operator=(const Tnode &node)=default (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnode
operator=(Tnode &&)=default (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnode
operator=(Tnode &&)=default (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnode
SearchFreqSuggestions(const std::string &key)operations_on_datastructures::trie_operations::Tnode
SearchPresence(const std::string &key)operations_on_datastructures::trie_operations::Tnode
SearchPresence(const std::string &key)operations_on_datastructures::trie_operations::Tnode
SearchSuggestions(const std::string &key)operations_on_datastructures::trie_operations::Tnode
SelectionTop_3(std::priority_queue< std::pair< int, std::string > > *suggestions)operations_on_datastructures::trie_operations::Tnode
SelectionTop_3(std::priority_queue< std::pair< int, std::string > > *suggestions)operations_on_datastructures::trie_operations::Tnode
SuggestAutocomplete(Tnode *new_root, const std::string &prefix)operations_on_datastructures::trie_operations::Tnode
SuggestFreqAutocomplete(Tnode *new_root, const std::string &prefix, std::priority_queue< std::pair< int, std::string > > *suggestions)operations_on_datastructures::trie_operations::Tnode
SuggestFreqAutocomplete(Tnode *new_root, const std::string &prefix, std::priority_queue< std::pair< int, std::string > > *suggestions)operations_on_datastructures::trie_operations::Tnode
Tnode() (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeinline
Tnode(const Tnode &node) (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeinline
Tnode(const Tnode &node) (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeinline
Tnode(Tnode &&)=default (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnode
~Tnode() (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeinline
~Tnode() (defined in operations_on_datastructures::trie_operations::Tnode)operations_on_datastructures::trie_operations::Tnodeinline
diff --git a/d1/d21/quick__sort_8cpp.html b/d1/d21/quick__sort_8cpp.html index 739e36af6..4f25d630a 100644 --- a/d1/d21/quick__sort_8cpp.html +++ b/d1/d21/quick__sort_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: sorting/quick_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('d1/d21/quick__sort_8cpp.html','../../' -
-
quick_sort.cpp File Reference
+
quick_sort.cpp File Reference
@@ -109,36 +108,35 @@ Include dependency graph for quick_sort.cpp:
- - +

+

Namespaces

 sorting
namespace  sorting
 Sorting algorithms.
 
- - +

+

Functions

int sorting::partition (int arr[], int low, int high)
 
void sorting::quickSort (int arr[], int low, int high)
 
-void show (int arr[], int size)
void show (int arr[], int size)
 
int main ()
 

Detailed Description

-

Quick sort algorithm.

-

Implementation Details - Quick Sort is a divide and conquer algorithm. It picks and element as pivot and partition the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways.

+

Quick sort algorithm.

+

Implementation Details - Quick Sort is a divide and conquer algorithm. It picks and element as pivot and partition the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways.

  1. Always pick the first element as pivot
  2. Always pick the last element as pivot (implemented below)
  3. Pick a random element as pivot
  4. Pick median as pivot
-

The key process in quickSort is partition(). Target of partition is, given an array and an element x(say) of array as pivot, put x at it's correct position in sorted array and put all smaller elements (samller than x) before x, and put all greater elements (greater than x) after x. All this should be done in linear time

+

The key process in quickSort is partition(). Target of partition is, given an array and an element x(say) of array as pivot, put x at it's correct position in sorted array and put all smaller elements (samller than x) before x, and put all greater elements (greater than x) after x. All this should be done in linear time

Function Documentation

- +

◆ main()

@@ -153,40 +151,72 @@ void show (int arr[],
-

Driver program to test above functions

-
82  {
-
83  int size;
-
84  std::cout << "\nEnter the number of elements : ";
-
85 
-
86  std::cin >> size;
-
87 
-
88  int *arr = new int[size];
-
89 
-
90  std::cout << "\nEnter the unsorted elements : ";
-
91 
-
92  for (int i = 0; i < size; ++i) {
-
93  std::cout << "\n";
-
94  std::cin >> arr[i];
-
95  }
-
96  quickSort(arr, 0, size);
-
97  std::cout << "Sorted array\n";
-
98  show(arr, size);
-
99  delete[] arr;
-
100  return 0;
-
101 }
+

Driver program to test above functions

+
82 {
+
83 int size;
+
84 std::cout << "\nEnter the number of elements : ";
+
85
+
86 std::cin >> size;
+
87
+
88 int *arr = new int[size];
+
89
+
90 std::cout << "\nEnter the unsorted elements : ";
+
91
+
92 for (int i = 0; i < size; ++i) {
+
93 std::cout << "\n";
+
94 std::cin >> arr[i];
+
95 }
+
96 quickSort(arr, 0, size);
+
97 std::cout << "Sorted array\n";
+
98 show(arr, size);
+
99 delete[] arr;
+
100 return 0;
+
101}
void quickSort(int arr[], int low, int high)
Definition: quick_sort.cpp:63
+ +

◆ show()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void show (int arr[],
int size 
)
+
+
76 {
+
77 for (int i = 0; i < size; i++) std::cout << arr[i] << " ";
+
78 std::cout << "\n";
+
79}
+
+
+
diff --git a/d1/d21/quick__sort_8cpp.js b/d1/d21/quick__sort_8cpp.js index 1de69d3fc..a97ca95d4 100644 --- a/d1/d21/quick__sort_8cpp.js +++ b/d1/d21/quick__sort_8cpp.js @@ -2,6 +2,5 @@ var quick__sort_8cpp = [ [ "main", "d1/d21/quick__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "partition", "d1/d21/quick__sort_8cpp.html#a7e7f25f31c50523990437abf2ac3907e", null ], - [ "quickSort", "d1/d21/quick__sort_8cpp.html#a50b66a1c652291b9a346ec7342967178", null ], - [ "show", "d1/d21/quick__sort_8cpp.html#ad34859945724cc7de3cc71936715aec6", null ] + [ "quickSort", "d1/d21/quick__sort_8cpp.html#a50b66a1c652291b9a346ec7342967178", null ] ]; \ No newline at end of file diff --git a/d1/d2a/knight__tour_8cpp.html b/d1/d2a/knight__tour_8cpp.html index 6f4d74fef..9794d4bb0 100644 --- a/d1/d2a/knight__tour_8cpp.html +++ b/d1/d2a/knight__tour_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: backtracking/knight_tour.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d1/d2a/knight__tour_8cpp.html','../../ -
-
knight_tour.cpp File Reference
+
knight_tour.cpp File Reference
-

Knight's tour algorithm +

Knight's tour algorithm More...

#include <iostream>
#include <array>
@@ -109,13 +108,13 @@ Include dependency graph for knight_tour.cpp:
- - +

+

Namespaces

 backtracking
namespace  backtracking
 Backtracking algorithms.
 
- @@ -127,13 +126,13 @@ Functions

+

Functions

template<size_t V>
bool backtracking::issafe (int x, int y, const std::array< std::array< int, V >, V > &sol)
 

Detailed Description

-

Knight's tour algorithm

-

A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path, the tour is closed; otherwise, it is open.

-
Author
Nikhil Arora
+

Knight's tour algorithm

+

A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path, the tour is closed; otherwise, it is open.

+
Author
Nikhil Arora
-David Leal
+David Leal

Function Documentation

- +

◆ main()

@@ -148,33 +147,33 @@ Functions
-

Main function

-
80  {
-
81  const int n = 8;
-
82  std::array <std::array <int, n>, n> sol = { 0 };
-
83 
-
84  int i, j;
-
85  for (i = 0; i < n; i++) {
-
86  for (j = 0; j < n; j++) { sol[i][j] = -1; }
-
87  }
-
88 
-
89  std::array <int, n> xmov = { 2, 1, -1, -2, -2, -1, 1, 2 };
-
90  std::array <int, n> ymov = { 1, 2, 2, 1, -1, -2, -2, -1 };
-
91 
-
92  sol[0][0] = 0;
-
93 
-
94  bool flag = backtracking::solve<n>(0, 0, 1, sol, xmov, ymov);
-
95  if (flag == false) {
-
96  std::cout << "Error: Solution does not exist\n";
-
97  }
-
98  else {
-
99  for (i = 0; i < n; i++) {
-
100  for (j = 0; j < n; j++) { std::cout << sol[i][j] << " "; }
-
101  std::cout << "\n";
-
102  }
-
103  }
-
104  return 0;
-
105 }
+

Main function

+
80 {
+
81 const int n = 8;
+
82 std::array <std::array <int, n>, n> sol = { 0 };
+
83
+
84 int i, j;
+
85 for (i = 0; i < n; i++) {
+
86 for (j = 0; j < n; j++) { sol[i][j] = -1; }
+
87 }
+
88
+
89 std::array <int, n> xmov = { 2, 1, -1, -2, -2, -1, 1, 2 };
+
90 std::array <int, n> ymov = { 1, 2, 2, 1, -1, -2, -2, -1 };
+
91
+
92 sol[0][0] = 0;
+
93
+
94 bool flag = backtracking::solve<n>(0, 0, 1, sol, xmov, ymov);
+
95 if (flag == false) {
+
96 std::cout << "Error: Solution does not exist\n";
+
97 }
+
98 else {
+
99 for (i = 0; i < n; i++) {
+
100 for (j = 0; j < n; j++) { std::cout << sol[i][j] << " "; }
+
101 std::cout << "\n";
+
102 }
+
103 }
+
104 return 0;
+
105}
@@ -186,7 +185,7 @@ Functions diff --git a/d1/d33/caesar__cipher_8cpp__incl.svg b/d1/d33/caesar__cipher_8cpp__incl.svg index 9b94774f1..90ac7f141 100644 --- a/d1/d33/caesar__cipher_8cpp__incl.svg +++ b/d1/d33/caesar__cipher_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + + + diff --git a/d1/d4a/finding__number__of__digits__in__a__number_8cpp__incl.md5 b/d1/d4a/finding__number__of__digits__in__a__number_8cpp__incl.md5 new file mode 100644 index 000000000..76614c6fa --- /dev/null +++ b/d1/d4a/finding__number__of__digits__in__a__number_8cpp__incl.md5 @@ -0,0 +1 @@ +5a75851214136af8a42dcc6699ea35dc \ No newline at end of file diff --git a/d1/d4a/finding__number__of__digits__in__a__number_8cpp__incl.svg b/d1/d4a/finding__number__of__digits__in__a__number_8cpp__incl.svg new file mode 100644 index 000000000..ffecc293e --- /dev/null +++ b/d1/d4a/finding__number__of__digits__in__a__number_8cpp__incl.svg @@ -0,0 +1,53 @@ + + + + + + +math/finding_number_of_digits_in_a_number.cpp + + + +Node1 + + +math/finding_number +_of_digits_in_a_number.cpp + + + + + +Node2 + + +cassert + + + + + +Node1->Node2 + + + + + +Node3 + + +iostream + + + + + +Node1->Node3 + + + + + diff --git a/d1/d4b/ordinary__least__squares__regressor_8cpp__incl.svg b/d1/d4b/ordinary__least__squares__regressor_8cpp__incl.svg index b002929c0..e78dc05ac 100644 --- a/d1/d4b/ordinary__least__squares__regressor_8cpp__incl.svg +++ b/d1/d4b/ordinary__least__squares__regressor_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: range_queries::heavy_light_decomposition::Tree< X > Class Template Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -96,8 +96,7 @@ $(document).ready(function(){initNavTree('d1/d51/classrange__queries_1_1heavy__l Private Attributes | Friends | List of all members -
-
range_queries::heavy_light_decomposition::Tree< X > Class Template Reference
+
range_queries::heavy_light_decomposition::Tree< X > Class Template Reference
@@ -109,14 +108,8 @@ Inheritance diagram for range_queries::heavy_light_decomposition::Tree< X >
[legend]
-
-Collaboration diagram for range_queries::heavy_light_decomposition::Tree< X >:
-
-
-
-
[legend]
- @@ -143,7 +136,7 @@ Public Member Functions

+

Public Member Functions

 Tree (int nodes)
 Class parameterized constructor, resizes the and initializes the data members. More...
 The function returns the least common ancestor of two nodes. More...
 
- @@ -152,53 +145,51 @@ Private Member Functions

+

Private Member Functions

void dfs_size (int u, int p=-1)
 Utility function to compute sub-tree sizes. More...
 Utility function to populate the t_par vector. More...
 
- - + - + - + - + - + - + - + - +

+

Private Attributes

-std::vector< std::list< int > > t_adj
+std::vector< std::list< int > > t_adj
 an adjacency list to stores the tree edges
 
-const int t_nodes
+const int t_nodes
 number of nodes
 
-const int t_maxlift
+const int t_maxlift
 maximum possible height of the tree
 
-std::vector< std::vector< int > > t_par
+std::vector< std::vector< int > > t_par
 a matrix to store every node's 2^kth parent
 
-std::vector< int > t_depth
+std::vector< int > t_depth
 a vector to store the depth of a node,
 
-std::vector< int > t_size
+std::vector< int > t_size
 a vector to store the subtree size rooted at node
 
-int t_root
+int t_root
 the root of the tree
 
-std::vector< X > t_val
+std::vector< X > t_val
 values of nodes
 
- -

+

Friends

+
template<typename T >
class HLD
 

Detailed Description

-

template<typename X>
-class range_queries::heavy_light_decomposition::Tree< X >

- -

A Basic Tree, which supports binary lifting.

+
template<typename X>
+class range_queries::heavy_light_decomposition::Tree< X >

A Basic Tree, which supports binary lifting.

Template Parameters
@@ -207,7 +198,7 @@ class range_queries::heavy_light_decomposition::Tree< X >

Deleting the default constructor An instance can only be created with the number of nodes Defaults: t_node indexing are zero based t_root is 0 depth of root_node is 0 Supports: lift :- lift a node k units up the tree kth_ancestor :- returns the kth ancestor lca :- returns the least common ancestor

Constructor & Destructor Documentation

- +

◆ Tree()

@@ -240,16 +231,15 @@ template<typename X >
thedata type of the values stored in the tree nodes
-
141  : t_nodes(nodes), t_maxlift(static_cast<int>(floor(log2(nodes))) + 1) {
-
142  /* Initialize and resize all the vectors */
-
143  t_root = 0; /* Default */
- - -
146  t_depth.assign(t_nodes, 0);
-
147  t_size.assign(t_nodes, 1);
- -
149  }
-
T assign(T... args)
+
141 : t_nodes(nodes), t_maxlift(static_cast<int>(floor(log2(nodes))) + 1) {
+
142 /* Initialize and resize all the vectors */
+
143 t_root = 0; /* Default */
+
144 t_adj.resize(t_nodes);
+ +
146 t_depth.assign(t_nodes, 0);
+
147 t_size.assign(t_nodes, 1);
+
148 t_val.resize(t_nodes);
+
149 }
std::vector< int > t_depth
a vector to store the depth of a node,
Definition: heavy_light_decomposition.cpp:88
std::vector< X > t_val
values of nodes
Definition: heavy_light_decomposition.cpp:92
std::vector< std::vector< int > > t_par
a matrix to store every node's 2^kth parent
Definition: heavy_light_decomposition.cpp:87
@@ -259,19 +249,12 @@ template<typename X >
std::vector< int > t_size
a vector to store the subtree size rooted at node
Definition: heavy_light_decomposition.cpp:89
const int t_nodes
number of nodes
Definition: heavy_light_decomposition.cpp:84
T floor(T... args)
-
T resize(T... args)
- -
-Here is the call graph for this function:
-
-
-
-
- + +

Member Function Documentation

- +

◆ add_edge()

@@ -316,21 +299,14 @@ template<typename X >
Returns
void
-
157  {
-
158  t_adj[u].push_back(v);
-
159  t_adj[v].push_back(u);
-
160  }
-
T push_back(T... args)
-
-Here is the call graph for this function:
-
-
+
157 {
+
158 t_adj[u].push_back(v);
+
159 t_adj[v].push_back(u);
+
160 }
+
- - - - +

◆ change_root()

@@ -364,11 +340,11 @@ template<typename X >
Returns
void
-
167 { t_root = new_root; }
+
167{ t_root = new_root; }
- +

◆ dfs_lca()

@@ -413,28 +389,34 @@ template<typename X >
Returns
void
-
116  {
-
117  t_par[u][0] = p;
-
118  if (p != -1) {
-
119  t_depth[u] = 1 + t_depth[p];
-
120  }
-
121  for (int k = 1; k < t_maxlift; k++) {
-
122  if (t_par[u][k - 1] != -1) {
-
123  t_par[u][k] = t_par[t_par[u][k - 1]][k - 1];
-
124  }
-
125  }
-
126 
-
127  for (const int &v : t_adj[u]) {
-
128  if (v ^ p) {
-
129  dfs_lca(v, u);
-
130  }
-
131  }
-
132  }
+
116 {
+
117 t_par[u][0] = p;
+
118 if (p != -1) {
+
119 t_depth[u] = 1 + t_depth[p];
+
120 }
+
121 for (int k = 1; k < t_maxlift; k++) {
+
122 if (t_par[u][k - 1] != -1) {
+
123 t_par[u][k] = t_par[t_par[u][k - 1]][k - 1];
+
124 }
+
125 }
+
126
+
127 for (const int &v : t_adj[u]) {
+
128 if (v ^ p) {
+
129 dfs_lca(v, u);
+
130 }
+
131 }
+
132 }
void dfs_lca(int u, int p=-1)
Utility function to populate the t_par vector.
Definition: heavy_light_decomposition.cpp:116
-
+
+Here is the call graph for this function:
+
+
- + + + +

◆ dfs_size()

@@ -480,19 +462,25 @@ template<typename X >
Returns
void
-
101  {
-
102  for (const int &v : t_adj[u]) {
-
103  if (v ^ p) {
-
104  dfs_size(v, u);
-
105  t_size[u] += t_size[v];
-
106  }
-
107  }
-
108  }
+
101 {
+
102 for (const int &v : t_adj[u]) {
+
103 if (v ^ p) {
+
104 dfs_size(v, u);
+
105 t_size[u] += t_size[v];
+
106 }
+
107 }
+
108 }
void dfs_size(int u, int p=-1)
Utility function to compute sub-tree sizes.
Definition: heavy_light_decomposition.cpp:101
-
+
+Here is the call graph for this function:
+
+
- + + + +

◆ init()

@@ -519,21 +507,21 @@ template<typename X >

This function must be called after the tree adjacency list and node values are populated The function initializes the required parameters, and populates the segment tree.

Returns
void
-
186  {
-
187  assert(t_nodes > 0);
-
188  dfs_size(t_root);
-
189  dfs_lca(t_root);
-
190  }
+
186 {
+
187 assert(t_nodes > 0);
+ + +
190 }
Here is the call graph for this function:
-
+
- +

◆ kth_ancestor()

@@ -578,10 +566,10 @@ template<typename X >
Returns
the kth ancestor of node
-
218  {
-
219  lift(&p, dist);
-
220  return p;
-
221  }
+
218 {
+
219 lift(&p, dist);
+
220 return p;
+
221 }
void lift(int *const p, int dist)
The function lifts a node, k units up the tree. The lifting is done in place, and the result is store...
Definition: heavy_light_decomposition.cpp:200
Here is the call graph for this function:
@@ -592,7 +580,7 @@ Here is the call graph for this function:
- +

◆ lca()

@@ -637,25 +625,25 @@ template<typename X >
Returns
the least common ancestor of node a, and node b
-
229  {
-
230  assert(a >= 0 and b >= 0 and a < t_nodes and b < t_nodes);
-
231  if (t_depth[a] > t_depth[b]) {
-
232  lift(&a, t_depth[a] - t_depth[b]);
-
233  }
-
234  if (t_depth[b] > t_depth[a]) {
-
235  lift(&b, t_depth[b] - t_depth[a]);
-
236  }
-
237  if (a == b) {
-
238  return a;
-
239  }
-
240  for (int k = t_maxlift - 1; k >= 0; k--) {
-
241  if (t_par[a][k] != t_par[b][k]) {
-
242  a = t_par[a][k];
-
243  b = t_par[b][k];
-
244  }
-
245  }
-
246  return t_par[a][0];
-
247  }
+
229 {
+
230 assert(a >= 0 and b >= 0 and a < t_nodes and b < t_nodes);
+
231 if (t_depth[a] > t_depth[b]) {
+
232 lift(&a, t_depth[a] - t_depth[b]);
+
233 }
+
234 if (t_depth[b] > t_depth[a]) {
+
235 lift(&b, t_depth[b] - t_depth[a]);
+
236 }
+
237 if (a == b) {
+
238 return a;
+
239 }
+
240 for (int k = t_maxlift - 1; k >= 0; k--) {
+
241 if (t_par[a][k] != t_par[b][k]) {
+
242 a = t_par[a][k];
+
243 b = t_par[b][k];
+
244 }
+
245 }
+
246 return t_par[a][0];
+
247 }
Here is the call graph for this function:
@@ -665,7 +653,7 @@ Here is the call graph for this function:
- +

◆ lift()

@@ -710,21 +698,21 @@ template<typename X >
Returns
void
-
200  {
-
201  for (int k = 0; k < t_maxlift; k++) {
-
202  if (*p == -1) {
-
203  return;
-
204  }
-
205  if (dist & 1) {
-
206  *p = t_par[*p][k];
-
207  }
-
208  dist >>= 1;
-
209  }
-
210  }
+
200 {
+
201 for (int k = 0; k < t_maxlift; k++) {
+
202 if (*p == -1) {
+
203 return;
+
204 }
+
205 if (dist & 1) {
+
206 *p = t_par[*p][k];
+
207 }
+
208 dist >>= 1;
+
209 }
+
210 }
- +

◆ set_node_val()

@@ -758,10 +746,10 @@ template<typename X >
Returns
void
-
175  {
-
176  assert(static_cast<int>(node_val.size()) == t_nodes);
-
177  t_val = node_val;
-
178  }
+
175 {
+
176 assert(static_cast<int>(node_val.size()) == t_nodes);
+
177 t_val = node_val;
+
178 }
T size(T... args)
Here is the call graph for this function:
@@ -781,7 +769,7 @@ Here is the call graph for this function:
diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.js b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.js index 1c9170851..da6020f34 100644 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.js +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.js @@ -10,7 +10,6 @@ var classrange__queries_1_1heavy__light__decomposition_1_1_tree = [ "lca", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ae2b407e64aaf9878fbee7ee6efe9c7d4", null ], [ "lift", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ac7761255f2ba06b398b9aae5e4dce5f3", null ], [ "set_node_val", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a04cd96efaba147b19d3afc769b90ff70", null ], - [ "HLD", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#afcdadbdea1e2391cebbb17d2c1ae2f0b", null ], [ "t_adj", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab1aeaefa1bd97b867c652ba916fbdb43", null ], [ "t_depth", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#a0efd0b9c564092f443ca97030d866ef1", null ], [ "t_maxlift", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html#ab2ab020f798d00be2613ecf63074b7c1", null ], diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a04cd96efaba147b19d3afc769b90ff70_cgraph.svg b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a04cd96efaba147b19d3afc769b90ff70_cgraph.svg index 31af6cb8d..aff3cfa60 100644 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a04cd96efaba147b19d3afc769b90ff70_cgraph.svg +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a04cd96efaba147b19d3afc769b90ff70_cgraph.svg @@ -1,7 +1,7 @@ - - - - diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a79ab4601c4a95c0902ac04e779e5f54d_cgraph.md5 b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a79ab4601c4a95c0902ac04e779e5f54d_cgraph.md5 deleted file mode 100644 index 5e81216cd..000000000 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a79ab4601c4a95c0902ac04e779e5f54d_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -d7dc869b3ab041c99ebc389f6d275089 \ No newline at end of file diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a79ab4601c4a95c0902ac04e779e5f54d_cgraph.svg b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a79ab4601c4a95c0902ac04e779e5f54d_cgraph.svg deleted file mode 100644 index 8d2720722..000000000 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a79ab4601c4a95c0902ac04e779e5f54d_cgraph.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -range_queries::heavy_light_decomposition::Tree::add_edge - - - -Node1 - - -range_queries::heavy -_light_decomposition -::Tree::add_edge - - - - - -Node2 - - -std::vector::push_back - - - - - -Node1->Node2 - - - - - diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.map b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.map deleted file mode 100644 index 5738c859f..000000000 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.map +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.md5 b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.md5 deleted file mode 100644 index 382e7b3ff..000000000 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -61c0a4773a48d5c4a57a34196fbc1b6d \ No newline at end of file diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.svg b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.svg deleted file mode 100644 index f5b61d5ab..000000000 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a835fb2bbb27307b8cacad9b287968bc1_cgraph.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - -range_queries::heavy_light_decomposition::Tree::Tree - - - -Node1 - - -range_queries::heavy -_light_decomposition -::Tree::Tree - - - - - -Node2 - - -std::vector::assign - - - - - -Node1->Node2 - - - - - -Node3 - - -std::vector::resize - - - - - -Node1->Node3 - - - - - diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a8f7bca1746d40f21ad832fcea59aa6c6_cgraph.svg b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a8f7bca1746d40f21ad832fcea59aa6c6_cgraph.svg index 7c6da874d..c487e630f 100644 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a8f7bca1746d40f21ad832fcea59aa6c6_cgraph.svg +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_a8f7bca1746d40f21ad832fcea59aa6c6_cgraph.svg @@ -1,7 +1,7 @@ - + + diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_aa339c31ec74cd86a4842a8b09653d460_cgraph.md5 b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_aa339c31ec74cd86a4842a8b09653d460_cgraph.md5 new file mode 100644 index 000000000..659d59e1e --- /dev/null +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_aa339c31ec74cd86a4842a8b09653d460_cgraph.md5 @@ -0,0 +1 @@ +0a4f1b21c1e4b7ce0a4a4048205a2ddc \ No newline at end of file diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_aa339c31ec74cd86a4842a8b09653d460_cgraph.svg b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_aa339c31ec74cd86a4842a8b09653d460_cgraph.svg new file mode 100644 index 000000000..12dec0d01 --- /dev/null +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_aa339c31ec74cd86a4842a8b09653d460_cgraph.svg @@ -0,0 +1,30 @@ + + + + + + +range_queries::heavy_light_decomposition::Tree::dfs_size + + + +Node1 + + +range_queries::heavy +_light_decomposition +::Tree::dfs_size + + + + + +Node1->Node1 + + + + + diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.map b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.map index 9b1272353..def149731 100644 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.map +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.md5 b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.md5 index 9639bddc3..bb34d1280 100644 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.md5 +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.md5 @@ -1 +1 @@ -41e2a595a15a8cfb2d32c9b139971bf2 \ No newline at end of file +c8dcad78aea294fb2f8875485054ec76 \ No newline at end of file diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.svg b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.svg index 150c5ed7a..d0176e6dc 100644 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.svg +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ad22d760a5a33545a70e7ea5e1786c8dc_cgraph.svg @@ -1,22 +1,22 @@ - - - + + range_queries::heavy_light_decomposition::Tree::init - + Node1 - -range_queries::heavy -_light_decomposition -::Tree::init + +range_queries::heavy +_light_decomposition +::Tree::init @@ -24,18 +24,18 @@ Node2 - -range_queries::heavy -_light_decomposition -::Tree::dfs_lca + +range_queries::heavy +_light_decomposition +::Tree::dfs_lca Node1->Node2 - - + + @@ -49,10 +49,22 @@ - + Node1->Node3 - - + + + + + +Node2->Node2 + + + + + +Node3->Node3 + + diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae2b407e64aaf9878fbee7ee6efe9c7d4_cgraph.svg b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae2b407e64aaf9878fbee7ee6efe9c7d4_cgraph.svg index 644cb1710..6c7b45523 100644 --- a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae2b407e64aaf9878fbee7ee6efe9c7d4_cgraph.svg +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae2b407e64aaf9878fbee7ee6efe9c7d4_cgraph.svg @@ -1,7 +1,7 @@ - + + diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae8de7aefcb6635d3dacdd174cd4890c4_cgraph.md5 b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae8de7aefcb6635d3dacdd174cd4890c4_cgraph.md5 new file mode 100644 index 000000000..322fd63c6 --- /dev/null +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae8de7aefcb6635d3dacdd174cd4890c4_cgraph.md5 @@ -0,0 +1 @@ +68d41660285659f320d68143912e27ff \ No newline at end of file diff --git a/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae8de7aefcb6635d3dacdd174cd4890c4_cgraph.svg b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae8de7aefcb6635d3dacdd174cd4890c4_cgraph.svg new file mode 100644 index 000000000..19e5077a0 --- /dev/null +++ b/d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree_ae8de7aefcb6635d3dacdd174cd4890c4_cgraph.svg @@ -0,0 +1,30 @@ + + + + + + +range_queries::heavy_light_decomposition::Tree::dfs_lca + + + +Node1 + + +range_queries::heavy +_light_decomposition +::Tree::dfs_lca + + + + + +Node1->Node1 + + + + + diff --git a/d1/d52/lcm__sum_8cpp__incl.svg b/d1/d52/lcm__sum_8cpp__incl.svg index 809be7f65..00f6ce061 100644 --- a/d1/d52/lcm__sum_8cpp__incl.svg +++ b/d1/d52/lcm__sum_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: modular_division Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d1/d64/namespacemodular__division.html
-
-
modular_division Namespace Reference
+
modular_division Namespace Reference
-

Functions for Modular Division implementation. +

Functions for Modular Division implementation. More...

Detailed Description

-

Functions for Modular Division implementation.

+

Functions for Modular Division implementation.

diff --git a/d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.map b/d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.map deleted file mode 100644 index 45698ce7e..000000000 --- a/d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.md5 b/d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.md5 deleted file mode 100644 index a24f7939d..000000000 --- a/d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -cc7656369f63f8b4fa9956e3ff7de06d \ No newline at end of file diff --git a/d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.svg b/d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.svg deleted file mode 100644 index a1fbba418..000000000 --- a/d1/d67/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__coll__graph.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - -range_queries::heavy_light_decomposition::SG< X > - - - -Node1 - - -range_queries::heavy -_light_decomposition -::SG< X > - - - - - -Node2 - - -std::vector< X > - - - - - -Node2->Node1 - - - s_tree - - - diff --git a/d1/d6d/lru__cache_8cpp__incl.svg b/d1/d6d/lru__cache_8cpp__incl.svg index 7ed240fb7..596aad4d1 100644 --- a/d1/d6d/lru__cache_8cpp__incl.svg +++ b/d1/d6d/lru__cache_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - - - - - - + + + diff --git a/d1/d71/classgraph_1_1_lowest_common_ancestor__coll__graph.md5 b/d1/d71/classgraph_1_1_lowest_common_ancestor__coll__graph.md5 index 102875f3a..12d39f709 100644 --- a/d1/d71/classgraph_1_1_lowest_common_ancestor__coll__graph.md5 +++ b/d1/d71/classgraph_1_1_lowest_common_ancestor__coll__graph.md5 @@ -1 +1 @@ -0072e1bc0c7fb2e941efdf7ad16b4971 \ No newline at end of file +2a36df6d8cd3fea89c84c08fbb62223d \ No newline at end of file diff --git a/d1/d71/classgraph_1_1_lowest_common_ancestor__coll__graph.svg b/d1/d71/classgraph_1_1_lowest_common_ancestor__coll__graph.svg index 81f030fd3..99016ea5f 100644 --- a/d1/d71/classgraph_1_1_lowest_common_ancestor__coll__graph.svg +++ b/d1/d71/classgraph_1_1_lowest_common_ancestor__coll__graph.svg @@ -1,134 +1,53 @@ - - - + + graph::LowestCommonAncestor - + Node1 - -graph::LowestCommonAncestor + +graph::LowestCommonAncestor Node2 - - -std::vector< std::vector -< int > > + + +graph::RootedTree Node2->Node1 - - - up - - - -Node5 - - -graph::Graph< T > - - - - - -Node2->Node5 - - - neighbors + + + tree Node3 - - -std::vector< int > + + +graph::Graph< T > Node3->Node2 - - - elements - - - -Node4 - - -graph::RootedTree - - - - - -Node3->Node4 - - - level -parent - - - -Node4->Node1 - - - tree - - - -Node5->Node4 - - - - - -Node6 - - -std::map< T, std::list -< T > > - - - - - -Node6->Node5 - - - adjacency_list - - - -Node7 - - -T - - - - - -Node7->Node6 - - - keys + + diff --git a/d1/d73/jarvis__algorithm_8cpp__incl.svg b/d1/d73/jarvis__algorithm_8cpp__incl.svg index 768b0bc01..caaca3898 100644 --- a/d1/d73/jarvis__algorithm_8cpp__incl.svg +++ b/d1/d73/jarvis__algorithm_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: others/buzz_number.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d1/d76/buzz__number_8cpp.html','../../
-
-
buzz_number.cpp File Reference
+
buzz_number.cpp File Reference
@@ -107,15 +106,15 @@ Include dependency graph for buzz_number.cpp:
-

+

Functions

int main ()
 

Detailed Description

-

A buzz number is a number that is either divisible by 7 or has last digit as 7.

+

A buzz number is a number that is either divisible by 7 or has last digit as 7.

Function Documentation

- +

◆ main()

@@ -130,19 +129,19 @@ Functions
-

main function

-
9  {
-
10  int n, t;
-
11  std::cin >> t;
-
12  while (t--) {
-
13  std::cin >> n;
-
14  if ((n % 7 == 0) || (n % 10 == 7))
-
15  std::cout << n << " is a buzz number" << std::endl;
-
16  else
-
17  std::cout << n << " is not a buzz number" << std::endl;
-
18  }
-
19  return 0;
-
20 }
+

main function

+
9 {
+
10 int n, t;
+
11 std::cin >> t;
+
12 while (t--) {
+
13 std::cin >> n;
+
14 if ((n % 7 == 0) || (n % 10 == 7))
+
15 std::cout << n << " is a buzz number" << std::endl;
+
16 else
+
17 std::cout << n << " is not a buzz number" << std::endl;
+
18 }
+
19 return 0;
+
20}
T endl(T... args)
@@ -161,7 +160,7 @@ Here is the call graph for this function:
diff --git a/d1/d76/buzz__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d1/d76/buzz__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index a39b40afa..6a539567b 100644 --- a/d1/d76/buzz__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d1/d76/buzz__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: mst Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,20 +93,19 @@ $(document).ready(function(){initNavTree('d1/d77/structmst.html','../../'); init -
-
mst Struct Reference
+
mst Struct Reference
- - - -

+

Public Attributes

+
bool visited
 
+
int key
 
+
int near
 
@@ -119,7 +118,7 @@ int near diff --git a/d1/d77/structmst.js b/d1/d77/structmst.js deleted file mode 100644 index 0d625e316..000000000 --- a/d1/d77/structmst.js +++ /dev/null @@ -1,6 +0,0 @@ -var structmst = -[ - [ "key", "d1/d77/structmst.html#a59feb15588a49aac1c243bf649b97c72", null ], - [ "near", "d1/d77/structmst.html#a2ce945d2bf94acc77bde387c30d02af1", null ], - [ "visited", "d1/d77/structmst.html#a53e13cb8fe7481d6173bfa72ac509590", null ] -]; \ No newline at end of file diff --git a/d1/d7d/gcd__of__n__numbers_8cpp__incl.svg b/d1/d7d/gcd__of__n__numbers_8cpp__incl.svg index 87a56a86b..7b764fb5b 100644 --- a/d1/d7d/gcd__of__n__numbers_8cpp__incl.svg +++ b/d1/d7d/gcd__of__n__numbers_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: uint256_t Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -96,8 +96,7 @@ $(document).ready(function(){initNavTree('d1/d83/classuint256__t.html','../../') Private Attributes | Friends | List of all members -
-
uint256_t Class Reference
+
uint256_t Class Reference
@@ -112,7 +111,7 @@ Collaboration diagram for uint256_t:
[legend]
- @@ -133,8 +132,8 @@ Public Member Functions - + @@ -159,20 +158,20 @@ Public Member Functions - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -180,16 +179,16 @@ Public Member Functions - - - - - - - - - - + + + + + + + + + + @@ -203,9 +202,9 @@ Public Member Functions - - - + + + @@ -213,9 +212,9 @@ Public Member Functions - - - + + + @@ -223,16 +222,16 @@ Public Member Functions - - - - - - - - - - + + + + + + + + + + @@ -240,13 +239,13 @@ Public Member Functions - - - - - - - + + + + + + + @@ -254,13 +253,13 @@ Public Member Functions - - - - - - - + + + + + + + @@ -330,18 +329,18 @@ Public Member Functions - - - - + + + + - - - - + + + + @@ -349,13 +348,13 @@ Public Member Functions - - - - - - - + + + + + + + @@ -363,13 +362,13 @@ Public Member Functions - - - - - - - + + + + + + + @@ -377,39 +376,39 @@ Public Member Functions - - - - - - - + + + + + + +

+

Public Member Functions

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
 uint256_t (T low)
 uint256_t (const uint64_t high, const uint64_t low)
 Parameterized constructor. More...
 
~uint256_t ()=default
~uint256_t ()=default
 Destructor for uint256_t.
 
uint32_t _lez ()
uint128_t upper () const
 returns upper 128-bit integer part More...
 
uint256_toperator= (const uint256_t &p)=default
 operator = for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator= (const T &p)
 operator = for other types More...
 
uint256_toperator= (const std::string &p)
 operator = for type string More...
 
-uint256_toperator= (uint256_t &&p)=default
 Move assignment operator.
 
uint256_toperator= (const uint256_t &p)=default
 operator = for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator= (const T &p)
 operator = for other types More...
 
uint256_toperator= (const std::string &p)
 operator = for type string More...
 
+uint256_toperator= (uint256_t &&p)=default
 Move assignment operator.
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator+ (const T &p)
 operator + for uint256_t and other integer types. More...
uint256_t operator+ (const uint256_t &p)
 operator + for uint256_t and other integer types. More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator+= (const T &p)
 operator += for uint256_t and other integer types. More...
 
uint256_toperator+= (const uint256_t &p)
 operator += for uint256_t More...
 
uint256_toperator++ ()
 pre-increment operator More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator+= (const T &p)
 operator += for uint256_t and other integer types. More...
 
uint256_toperator+= (const uint256_t &p)
 operator += for uint256_t More...
 
uint256_toperator++ ()
 pre-increment operator More...
 
uint256_t operator++ (int)
 post-increment operator More...
 
uint256_t operator- ()
 operator - using twos complement More...
 
uint256_toperator-- ()
 operator – (pre-decrement) More...
 
uint256_toperator-- ()
 operator – (pre-decrement) More...
 
uint256_t operator-- (int p)
 operator – (post-decrement) More...
 
uint256_t operator-= (const T p)
 operator -= for uint256_t and other integer types. More...
 
uint256_toperator-= (const uint256_t &p)
 operator -= for uint256_t More...
 
uint256_toperator-= (const uint256_t &p)
 operator -= for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator* (const T &p)
 operator * for uint256_t and other integer types. More...
uint256_t operator* (const uint256_t &p)
 operator * for uint256_t and other integer types. More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator*= (const T &p)
 operator *= for uint256_t and other integer types. More...
 
uint256_toperator*= (const uint256_t &p)
 operator *= for uint256_t and other integer types. More...
 
std::pair< uint256_t, uint256_tdivide (const uint256_t &p)
 divide function for uint256_t and other integer types. More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator*= (const T &p)
 operator *= for uint256_t and other integer types. More...
 
uint256_toperator*= (const uint256_t &p)
 operator *= for uint256_t and other integer types. More...
 
std::pair< uint256_t, uint256_tdivide (const uint256_t &p)
 divide function for uint256_t and other integer types. More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator/ (const T &p)
 operator / for uint256_t and other integer types. More...
uint256_t operator/ (const uint256_t &p)
 operator / for uint256_t and other integer types. More...
 
uint256_toperator/= (const uint256_t &p)
 operator /= for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator/= (const T &p)
 operator /= for uint256_t and other integer types. More...
 
uint256_toperator/= (const uint256_t &p)
 operator /= for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator/= (const T &p)
 operator /= for uint256_t and other integer types. More...
 
uint256_t operator% (const uint256_t &p)
 operator % for uint256_t More...
 
uint256_t operator% (const T &p)
 operator % for uint256_t and other integer types. More...
 
uint256_toperator%= (const uint256_t &p)
 operator %= for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator%= (const T &p)
 operator %= for uint256_t More...
 
uint256_toperator%= (const uint256_t &p)
 operator %= for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator%= (const T &p)
 operator %= for uint256_t More...
 
bool operator< (const uint256_t &other)
 operator < for uint256_t More...
 
uint256_t operator<< (const T &p)
 operator << for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator<<= (const T &p)
 operator <<= for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator<<= (const T &p)
 operator <<= for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator>> (const T &p)
 operator >> for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator>>= (const T &p)
 operator >>= for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator>>= (const T &p)
 operator >>= for uint256_t More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator& (const T &p)
 operator & for other types (bitwise operator) More...
uint256_t operator& (const uint256_t &p)
 operator & for uint256_t (bitwise operator) More...
 
uint256_toperator&= (const uint256_t &p)
 operator &= for uint256_t (bitwise operator) More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator&= (const T p)
 operator &= for other types (bitwise operator) More...
 
uint256_toperator&= (const uint256_t &p)
 operator &= for uint256_t (bitwise operator) More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator&= (const T p)
 operator &= for other types (bitwise operator) More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator| (const T &p)
 operator | for other types (bitwise operator) More...
uint256_t operator| (const uint256_t &p)
 operator | for uint256_t (bitwise operator) More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator|= (const T &p)
 operator |= for other types (bitwise operator) More...
 
uint256_toperator|= (const uint256_t &p)
 operator |= for uint256_t (bitwise operator) More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator|= (const T &p)
 operator |= for other types (bitwise operator) More...
 
uint256_toperator|= (const uint256_t &p)
 operator |= for uint256_t (bitwise operator) More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator^ (const T &p)
 operator ^ for other types (bitwise operator) More...
uint256_t operator^ (const uint256_t &p)
 operator ^ for uint256_t (bitwise operator) More...
 
uint256_toperator^= (const uint256_t &p)
 operator ^= for uint256_t (bitwise operator) More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator^= (const T &p)
 operator ^= for other types (bitwise operator) More...
 
uint256_toperator^= (const uint256_t &p)
 operator ^= for uint256_t (bitwise operator) More...
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_toperator^= (const T &p)
 operator ^= for other types (bitwise operator) More...
 
-

+

Private Member Functions

void __get_integer_from_string (const std::string &str)
 First and second half of 256 bit number. More...
 
- - -

+

Private Attributes

+
uint128_t f {}
 
+
uint128_t s {}
 
- - - - + + +

+

Friends

std::ostreamoperator<< (std::ostream &op, uint256_t p)
 operator << for printing uint256_t integer More...
 
std::ostreamoperator<< (std::ostream &op, uint256_t p)
 operator << for printing uint256_t integer More...
 

Detailed Description

-

class for 256-bit unsigned integer

+

class for 256-bit unsigned integer

Constructor & Destructor Documentation

- +

◆ uint256_t() [1/6]

@@ -448,11 +447,11 @@ template<typename T , typename = typename std::enable_if< -
75 : s(low), f(0) {}
+
75: s(low), f(0) {}
- +

◆ uint256_t() [2/6]

@@ -483,9 +482,9 @@ template<typename T , typename = typename std::enable_if< -
81  {
- -
83  }
+
81 {
+ +
83 }
void __get_integer_from_string(const std::string &str)
First and second half of 256 bit number.
Definition: uint256_t.hpp:43
Here is the call graph for this function:
@@ -496,7 +495,7 @@ Here is the call graph for this function:
- +

◆ uint256_t() [3/6]

@@ -530,7 +529,7 @@ Here is the call graph for this function:
- +

◆ uint256_t() [4/6]

@@ -561,12 +560,12 @@ Here is the call graph for this function:
-
96  : f(std::move(num.f)), s(std::move(num.s)) {}
+
96 : f(std::move(num.f)), s(std::move(num.s)) {}
T move(T... args)
- +

◆ uint256_t() [5/6]

@@ -608,11 +607,11 @@ Here is the call graph for this function:
-
104  : f(std::move(high)), s(std::move(low)) {}
+
104 : f(std::move(high)), s(std::move(low)) {}
- +

◆ uint256_t() [6/6]

@@ -654,12 +653,12 @@ Here is the call graph for this function:
-
111 : f(high), s(low) {}
+
111: f(high), s(low) {}

Member Function Documentation

- +

◆ __get_integer_from_string()

@@ -684,34 +683,34 @@ Here is the call graph for this function:

First and second half of 256 bit number.

-

Get integer from given string.

-

Create an integer from a given string

Parameters
+

Get integer from given string.

+

Create an integer from a given string

Parameters
strinteger string, can be hexadecimal (starting on 0x... or number)
Returns
void
-
43  {
-
44  this->f = this->s = uint128_t(0);
-
45  if (str.size() > 1 && str[1] == 'x') {
-
46  for (auto i = 2; i < str.size(); ++i) {
-
47  *this *= 16LL;
-
48  if (str[i] >= '0' && str[i] <= '9') {
-
49  *this += (str[i] - '0');
-
50  } else if (str[i] >= 'A' && str[i] <= 'F') {
-
51  *this += (str[i] - 'A' + 10);
-
52  } else if (str[i] >= 'a' && str[i] <= 'f') {
-
53  *this += (str[i] - 'a' + 10);
-
54  }
-
55  }
-
56  } else {
-
57  for (auto &x : str) {
-
58  *this *= 10LL;
-
59  *this += (x - '0');
-
60  }
-
61  }
-
62  }
+
43 {
+
44 this->f = this->s = uint128_t(0);
+
45 if (str.size() > 1 && str[1] == 'x') {
+
46 for (auto i = 2; i < str.size(); ++i) {
+
47 *this *= 16LL;
+
48 if (str[i] >= '0' && str[i] <= '9') {
+
49 *this += (str[i] - '0');
+
50 } else if (str[i] >= 'A' && str[i] <= 'F') {
+
51 *this += (str[i] - 'A' + 10);
+
52 } else if (str[i] >= 'a' && str[i] <= 'f') {
+
53 *this += (str[i] - 'a' + 10);
+
54 }
+
55 }
+
56 } else {
+
57 for (auto &x : str) {
+
58 *this *= 10LL;
+
59 *this += (x - '0');
+
60 }
+
61 }
+
62 }
class for 128-bit unsigned integer
Definition: uint128_t.hpp:59
T size(T... args)
@@ -723,7 +722,7 @@ Here is the call graph for this function:
- +

◆ _lez()

@@ -747,13 +746,13 @@ Here is the call graph for this function:

Leading zeroes in binary.

-

Calculates leading zeros in 256-bit integer

Returns
Integer denoting leading zeroes
-
123  {
-
124  if (f) {
-
125  return f._lez();
-
126  }
-
127  return 128 + s._lez();
-
128  }
+

Calculates leading zeros in 256-bit integer

Returns
Integer denoting leading zeroes
+
123 {
+
124 if (f) {
+
125 return f._lez();
+
126 }
+
127 return 128 + s._lez();
+
128 }
uint32_t _lez()
Leading zeroes in binary.
Definition: uint128_t.hpp:139
Here is the call graph for this function:
@@ -764,7 +763,7 @@ Here is the call graph for this function:
- +

◆ _trz()

@@ -788,13 +787,13 @@ Here is the call graph for this function:

Trailing zeroes in binary.

-

Calculates leading zeros in 256-bit integer

Returns
Integer denoting Trailing zeroes
-
135  {
-
136  if (s) {
-
137  return s._trz();
-
138  }
-
139  return 128 + f._trz();
-
140  }
+

Calculates leading zeros in 256-bit integer

Returns
Integer denoting Trailing zeroes
+
135 {
+
136 if (s) {
+
137 return s._trz();
+
138 }
+
139 return 128 + f._trz();
+
140 }
uint32_t _trz()
Trailing zeroes in binary.
Definition: uint128_t.hpp:162
Here is the call graph for this function:
@@ -805,8 +804,8 @@ Here is the call graph for this function:
- -

◆ divide()

+ +

◆ divide()

@@ -815,7 +814,7 @@ Here is the call graph for this function:
- + @@ -830,54 +829,54 @@ Here is the call graph for this function:

divide function for uint256_t and other integer types.

-

divide this value and

Parameters
+

divide this value and

Parameters
std::pair<uint256_t, uint256_t> uint256_t::divide std::pair< uint256_t, uint256_t > uint256_t::divide ( const uint256_t p)
p256-bit unsigned integer
Returns
pair denoting quotient and remainder.
-
421  {
-
422  if (*this < p) { // if this is less than divisor
-
423  return {uint256_t(0), *this};
-
424  } else if (*this == p) { // if this is equal to divisor
-
425  return {uint256_t(1), uint256_t(0)};
-
426  }
-
427  uint256_t tmp = p, tmp2 = *this;
-
428  uint16_t left = tmp._lez() - _lez();
-
429  tmp <<= left;
-
430  uint256_t quotient(0);
-
431  uint256_t zero(0);
-
432  while (left >= 0 && tmp2 >= p) {
-
433  uint16_t shf = tmp2._lez() - tmp._lez();
-
434  if (shf) {
-
435  tmp >>= shf;
-
436  quotient <<= shf;
-
437  left -= shf;
-
438  }
-
439  if (tmp2 < tmp) {
-
440  tmp >>= 1;
-
441  quotient <<= 1;
-
442  --left;
-
443  }
-
444  tmp2 -= tmp;
-
445  ++quotient;
-
446  }
-
447  return {quotient << left, tmp2};
-
448  }
+
421 {
+
422 if (*this < p) { // if this is less than divisor
+
423 return {uint256_t(0), *this};
+
424 } else if (*this == p) { // if this is equal to divisor
+
425 return {uint256_t(1), uint256_t(0)};
+
426 }
+
427 uint256_t tmp = p, tmp2 = *this;
+
428 uint16_t left = tmp._lez() - _lez();
+
429 tmp <<= left;
+
430 uint256_t quotient(0);
+
431 uint256_t zero(0);
+
432 while (left >= 0 && tmp2 >= p) {
+
433 uint16_t shf = tmp2._lez() - tmp._lez();
+
434 if (shf) {
+
435 tmp >>= shf;
+
436 quotient <<= shf;
+
437 left -= shf;
+
438 }
+
439 if (tmp2 < tmp) {
+
440 tmp >>= 1;
+
441 quotient <<= 1;
+
442 --left;
+
443 }
+
444 tmp2 -= tmp;
+
445 ++quotient;
+
446 }
+
447 return {quotient << left, tmp2};
+
448 }
class for 256-bit unsigned integer
Definition: uint256_t.hpp:33
uint32_t _lez()
Leading zeroes in binary.
Definition: uint256_t.hpp:123
T left(T... args)
Here is the call graph for this function:
-
+
- +

◆ lower()

@@ -902,11 +901,11 @@ Here is the call graph for this function:

returns lower 128-bit integer part

Returns
returns lower 128-bit integer part
-
169 { return s; }
+
169{ return s; }
- +

◆ operator bool()

@@ -931,11 +930,11 @@ Here is the call graph for this function:

casting operator to boolean value

Returns
true if value of this is non-zero, else false
-
146 { return f || s; }
+
146{ return f || s; }
- +

◆ operator T()

@@ -968,13 +967,13 @@ template<typename T , typename = typename std::enable_if<
Returns
integer value casted to mentioned type
-
155  {
-
156  return static_cast<T>(s);
-
157  }
+
155 {
+
156 return static_cast<T>(s);
+
157 }
- +

◆ operator uint128_t()

@@ -999,11 +998,11 @@ template<typename T , typename = typename std::enable_if<

casting operator to uint128_t

Returns
returns lower 128-bit integer part
-
163 { return s; }
+
163{ return s; }
- +

◆ operator!()

@@ -1028,11 +1027,11 @@ template<typename T , typename = typename std::enable_if<

operator ! for uint256_t

Returns
true if this has zero value, else false
-
596 { return !f && !s; }
+
596{ return !f && !s; }
- +

◆ operator!=() [1/2]

@@ -1072,13 +1071,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is not equal to other, else false
-
690  {
-
691  return *this != uint256_t(other);
-
692  }
+
690 {
+
691 return *this != uint256_t(other);
+
692 }
- +

◆ operator!=() [2/2]

@@ -1110,13 +1109,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is not equal than other, else false
-
588  {
-
589  return !((*this) == other);
-
590  }
+
588 {
+
589 return !((*this) == other);
+
590 }
- +

◆ operator%() [1/2]

@@ -1156,15 +1155,15 @@ template<typename T , typename = typename std::enable_if<
Returns
unsigned 256-bit remainder.
-
509  {
-
510  uint256_t tmp = *this;
-
511  tmp %= uint256_t(p);
-
512  return tmp;
-
513  }
+
509 {
+
510 uint256_t tmp = *this;
+
511 tmp %= uint256_t(p);
+
512 return tmp;
+
513 }
- +

◆ operator%() [2/2]

@@ -1196,8 +1195,8 @@ template<typename T , typename = typename std::enable_if<
Returns
unsigned 256-bit remainder.
-
499 { return divide(p).second; }
-
std::pair< uint256_t, uint256_t > divide(const uint256_t &p)
divide function for uint256_t and other integer types.
Definition: uint256_t.hpp:421
+
499{ return divide(p).second; }
+
std::pair< uint256_t, uint256_t > divide(const uint256_t &p)
divide function for uint256_t and other integer types.
Definition: uint256_t.hpp:421
Here is the call graph for this function:
@@ -1207,8 +1206,8 @@ Here is the call graph for this function:
- -

◆ operator%=() [1/2]

+ +

◆ operator%=() [1/2]

@@ -1219,7 +1218,7 @@ template<typename T , typename = typename std::enable_if< - + @@ -1247,15 +1246,15 @@ template<typename T , typename = typename std::enable_if<
Returns
this set as unsigned 256-bit remainder.
-
533  {
-
534  *this %= uint256_t(p);
-
535  return *this;
-
536  }
+
533 {
+
534 *this %= uint256_t(p);
+
535 return *this;
+
536 }
- -

◆ operator%=() [2/2]

+ +

◆ operator%=() [2/2]

@@ -1264,7 +1263,7 @@ template<typename T , typename = typename std::enable_if<
@@ -42,21 +41,22 @@
uint256_t& uint256_t::operator%= uint256_t & uint256_t::operator%= ( const T &  p) - + @@ -1286,20 +1285,20 @@ template<typename T , typename = typename std::enable_if<
Returns
this set as unsigned 256-bit remainder.
-
520  {
-
521  *this = divide(p).second;
-
522  return *this;
-
523  }
+
520 {
+
521 *this = divide(p).second;
+
522 return *this;
+
523 }
Here is the call graph for this function:
-
+
- +

◆ operator&() [1/2]

@@ -1339,13 +1338,13 @@ template<typename T , typename = typename std::enable_if<
Returns
value of this & p (& is bit-wise operator)
-
811  {
-
812  return *this & uint256_t(p);
-
813  }
+
811 {
+
812 return *this & uint256_t(p);
+
813 }
- +

◆ operator&() [2/2]

@@ -1377,13 +1376,13 @@ template<typename T , typename = typename std::enable_if<
Returns
value of this & p (& is bit-wise operator)
-
820  {
-
821  return {f & p.f, s & p.s};
-
822  }
+
820 {
+
821 return {f & p.f, s & p.s};
+
822 }
- +

◆ operator&&() [1/2]

@@ -1423,13 +1422,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is both values are non-zero, else false
-
702  {
-
703  return (s || f) && (b);
-
704  }
+
702 {
+
703 return (s || f) && (b);
+
704 }
- +

◆ operator&&() [2/2]

@@ -1461,14 +1460,14 @@ template<typename T , typename = typename std::enable_if<
Returns
true if both of the values are not zero, else false
-
603  {
-
604  return (s || f) && (b.s || b.f);
-
605  }
+
603 {
+
604 return (s || f) && (b.s || b.f);
+
605 }
- -

◆ operator&=() [1/2]

+ +

◆ operator&=() [1/2]

@@ -1479,7 +1478,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator%= uint256_t & uint256_t::operator%= ( const uint256_t p) - + @@ -1507,15 +1506,15 @@ template<typename T , typename = typename std::enable_if<
Returns
this = this & p (& is bit-wise operator)
-
843  {
-
844  s &= p.s;
-
845  return *this;
-
846  }
+
843 {
+
844 s &= p.s;
+
845 return *this;
+
846 }
- -

◆ operator&=() [2/2]

+ +

◆ operator&=() [2/2]

@@ -1524,7 +1523,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator&= uint256_t & uint256_t::operator&= ( const T  p) - + @@ -1546,15 +1545,15 @@ template<typename T , typename = typename std::enable_if<
Returns
this = this & p (& is bit-wise operator)
-
829  {
-
830  f &= p.f;
-
831  s &= p.s;
-
832  return *this;
-
833  }
+
829 {
+
830 f &= p.f;
+
831 s &= p.s;
+
832 return *this;
+
833 }
- +

◆ operator()()

@@ -1579,11 +1578,11 @@ template<typename T , typename = typename std::enable_if<

operator () for uint256_t

Returns
true if this value is non-zero, else false
-
620 { return s || f; }
+
620{ return s || f; }
- +

◆ operator*() [1/2]

@@ -1623,13 +1622,13 @@ template<typename T , typename = typename std::enable_if<
Returns
multiplication of this and p, returning uint256_t integer
-
362  {
-
363  return *this * uint256_t(p);
-
364  }
+
362 {
+
363 return *this * uint256_t(p);
+
364 }
- +

◆ operator*() [2/2]

@@ -1661,18 +1660,18 @@ template<typename T , typename = typename std::enable_if<
Returns
multiplication of this and p, returning uint256_t integer
-
371  {
-
372  uint128_t f_first(s.upper()), f_second(s.lower()), s_first(p.s.upper()),
-
373  s_second(p.s.lower());
-
374  uint128_t fi = f_first * s_first, se = f_first * s_second,
-
375  th = s_first * f_second, fo = s_second * f_second;
-
376  uint128_t tmp = se << 64, tmp2 = th << 64;
-
377  int cc = (tmp + tmp2 < tmp);
-
378  tmp += tmp2;
-
379  cc += (tmp + fo < tmp);
-
380  return {f * p.s + s * p.f + fi + se.upper() + th.upper() + cc,
-
381  tmp + fo};
-
382  }
+
371 {
+
372 uint128_t f_first(s.upper()), f_second(s.lower()), s_first(p.s.upper()),
+
373 s_second(p.s.lower());
+
374 uint128_t fi = f_first * s_first, se = f_first * s_second,
+
375 th = s_first * f_second, fo = s_second * f_second;
+
376 uint128_t tmp = se << 64, tmp2 = th << 64;
+
377 int cc = (tmp + tmp2 < tmp);
+
378 tmp += tmp2;
+
379 cc += (tmp + fo < tmp);
+
380 return {f * p.s + s * p.f + fi + se.upper() + th.upper() + cc,
+
381 tmp + fo};
+
382 }
uint64_t upper() const
returns upper 64-bit integer part
Definition: uint128_t.hpp:207
uint64_t lower() const
returns lower 64-bit integer part
Definition: uint128_t.hpp:201
@@ -1684,8 +1683,8 @@ Here is the call graph for this function:
- -

◆ operator*=() [1/2]

+ +

◆ operator*=() [1/2]

@@ -1696,7 +1695,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator&= uint256_t & uint256_t::operator&= ( const uint256_t p) - + @@ -1724,14 +1723,14 @@ template<typename T , typename = typename std::enable_if<
Returns
multiplication of this and p, returning this
-
392  {
-
393  return (*this *= uint256_t(p));
-
394  }
+
392 {
+
393 return (*this *= uint256_t(p));
+
394 }
- -

◆ operator*=() [2/2]

+ +

◆ operator*=() [2/2]

@@ -1740,7 +1739,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator*= uint256_t & uint256_t::operator*= ( const T &  p) - + @@ -1762,29 +1761,29 @@ template<typename T , typename = typename std::enable_if<
Returns
multiplication of this and p, returning this
-
401  {
-
402  uint128_t f_first(s.upper()), f_second(s.lower()), s_first(p.s.upper()),
-
403  s_second(p.s.lower());
-
404  uint128_t fi = f_first * s_first, se = f_first * s_second,
-
405  th = s_first * f_second, fo = s_second * f_second;
-
406  uint128_t tmp = se << 64, tmp2 = th << 64;
-
407  int cc = (tmp + tmp2 < tmp);
-
408  tmp += tmp2;
-
409  cc += (tmp + fo < tmp);
-
410  f = f * p.s + s * p.f + fi + se.upper() + th.upper() + cc;
-
411  s = tmp + fo;
-
412  return *this;
-
413  }
+
401 {
+
402 uint128_t f_first(s.upper()), f_second(s.lower()), s_first(p.s.upper()),
+
403 s_second(p.s.lower());
+
404 uint128_t fi = f_first * s_first, se = f_first * s_second,
+
405 th = s_first * f_second, fo = s_second * f_second;
+
406 uint128_t tmp = se << 64, tmp2 = th << 64;
+
407 int cc = (tmp + tmp2 < tmp);
+
408 tmp += tmp2;
+
409 cc += (tmp + fo < tmp);
+
410 f = f * p.s + s * p.f + fi + se.upper() + th.upper() + cc;
+
411 s = tmp + fo;
+
412 return *this;
+
413 }
Here is the call graph for this function:
-
+
- +

◆ operator+() [1/2]

@@ -1824,14 +1823,14 @@ template<typename T , typename = typename std::enable_if<
Returns
addition of this and p, returning uint256_t integer
-
220  {
-
221  bool app = s + p < s;
-
222  return uint256_t(f + app, s + p);
-
223  }
+
220 {
+
221 bool app = s + p < s;
+
222 return uint256_t(f + app, s + p);
+
223 }
- +

◆ operator+() [2/2]

@@ -1863,15 +1862,15 @@ template<typename T , typename = typename std::enable_if<
Returns
addition of this and p, returning uint256_t integer
-
230  {
-
231  bool app = (s + p.s < s);
-
232  return {f + app + p.f, s + p.s};
-
233  }
+
230 {
+
231 bool app = (s + p.s < s);
+
232 return {f + app + p.f, s + p.s};
+
233 }
- -

◆ operator++() [1/2]

+ +

◆ operator++() [1/2]

@@ -1880,7 +1879,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator*= uint256_t & uint256_t::operator*= ( const uint256_t p) - + @@ -1895,14 +1894,14 @@ template<typename T , typename = typename std::enable_if<

pre-increment operator

Returns
incremented value of this.
-
266  {
-
267  *this += 1;
-
268  return *this;
-
269  }
+
266 {
+
267 *this += 1;
+
268 return *this;
+
269 }
- +

◆ operator++() [2/2]

@@ -1928,15 +1927,15 @@ template<typename T , typename = typename std::enable_if<

post-increment operator

Returns
incremented value of this.
-
275  {
-
276  ++*this;
-
277  return *this;
-
278  }
+
275 {
+
276 ++*this;
+
277 return *this;
+
278 }
- -

◆ operator+=() [1/2]

+ +

◆ operator+=() [1/2]

@@ -1947,7 +1946,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator++ uint256_t & uint256_t::operator++ ( ) - + @@ -1975,17 +1974,17 @@ template<typename T , typename = typename std::enable_if<
Returns
addition of this and p, returning this
-
243  {
-
244  bool app = (p + s < s);
-
245  this->f += app;
-
246  this->s += p;
-
247  return *this;
-
248  }
+
243 {
+
244 bool app = (p + s < s);
+
245 this->f += app;
+
246 this->s += p;
+
247 return *this;
+
248 }
- -

◆ operator+=() [2/2]

+ +

◆ operator+=() [2/2]

@@ -1994,7 +1993,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator+= uint256_t & uint256_t::operator+= ( const T &  p) - + @@ -2016,16 +2015,16 @@ template<typename T , typename = typename std::enable_if<
Returns
addition of this and p, returning this
-
255  {
-
256  bool app = (s + p.s < s);
-
257  f = f + app + p.f;
-
258  s = s + p.s;
-
259  return *this;
-
260  }
+
255 {
+
256 bool app = (s + p.s < s);
+
257 f = f + app + p.f;
+
258 s = s + p.s;
+
259 return *this;
+
260 }
- +

◆ operator-() [1/3]

@@ -2050,11 +2049,11 @@ template<typename T , typename = typename std::enable_if<

operator - using twos complement

Returns
2's complement of this.
-
307 { return ~*this + uint256_t(1); }
+
307{ return ~*this + uint256_t(1); }
- +

◆ operator-() [2/3]

@@ -2094,14 +2093,14 @@ template<typename T , typename = typename std::enable_if<
Returns
subtraction of this and p, returning uint256_t integer
-
288  {
-
289  bool app = (p > s);
-
290  return uint256_t(f - app, s - p);
-
291  }
+
288 {
+
289 bool app = (p > s);
+
290 return uint256_t(f - app, s - p);
+
291 }
- +

◆ operator-() [3/3]

@@ -2133,15 +2132,15 @@ template<typename T , typename = typename std::enable_if<
Returns
subtraction of this and p, returning uint256_t integer
-
298  {
-
299  bool app = s < p.s;
-
300  return {f - p.f - app, s - p.s};
-
301  }
+
298 {
+
299 bool app = s < p.s;
+
300 return {f - p.f - app, s - p.s};
+
301 }
- -

◆ operator--() [1/2]

+ +

◆ operator--() [1/2]

@@ -2150,7 +2149,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator+= uint256_t & uint256_t::operator+= ( const uint256_t p) - + @@ -2165,14 +2164,14 @@ template<typename T , typename = typename std::enable_if<

operator – (pre-decrement)

Returns
decremented value of this
-
313  {
-
314  *this -= 1;
-
315  return *this;
-
316  }
+
313 {
+
314 *this -= 1;
+
315 return *this;
+
316 }
- +

◆ operator--() [2/2]

@@ -2198,14 +2197,14 @@ template<typename T , typename = typename std::enable_if<

operator – (post-decrement)

Returns
decremented value of this
-
322  {
-
323  --*this;
-
324  return *this;
-
325  }
+
322 {
+
323 --*this;
+
324 return *this;
+
325 }
- +

◆ operator-=() [1/2]

@@ -2245,17 +2244,17 @@ template<typename T , typename = typename std::enable_if<
Returns
subtraction of this and p, returning this
-
335  {
-
336  bool app = (p > s);
-
337  f = f - app;
-
338  s = s - p;
-
339  return *this;
-
340  }
+
335 {
+
336 bool app = (p > s);
+
337 f = f - app;
+
338 s = s - p;
+
339 return *this;
+
340 }
- -

◆ operator-=() [2/2]

+ +

◆ operator-=() [2/2]

@@ -2264,7 +2263,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator-- uint256_t & uint256_t::operator-- ( ) - + @@ -2286,16 +2285,16 @@ template<typename T , typename = typename std::enable_if<
Returns
subtraction of this and p, returning this
-
347  {
-
348  bool app = s < p.s;
-
349  f = f - app - p.f;
-
350  s = s - p.s;
-
351  return *this;
-
352  }
+
347 {
+
348 bool app = s < p.s;
+
349 f = f - app - p.f;
+
350 s = s - p.s;
+
351 return *this;
+
352 }
- +

◆ operator/() [1/2]

@@ -2335,15 +2334,15 @@ template<typename T , typename = typename std::enable_if<
Returns
unsigned 256-bit quotient.
-
458  {
-
459  uint256_t tmp = *this;
-
460  tmp /= uint256_t(p);
-
461  return tmp;
-
462  }
+
458 {
+
459 uint256_t tmp = *this;
+
460 tmp /= uint256_t(p);
+
461 return tmp;
+
462 }
- +

◆ operator/() [2/2]

@@ -2375,7 +2374,7 @@ template<typename T , typename = typename std::enable_if<
Returns
unsigned 256-bit quotient.
-
469 { return divide(p).first; }
+
469{ return divide(p).first; }
Here is the call graph for this function:
@@ -2385,8 +2384,8 @@ Here is the call graph for this function:
- -

◆ operator/=() [1/2]

+ +

◆ operator/=() [1/2]

@@ -2397,7 +2396,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator-= uint256_t & uint256_t::operator-= ( const uint256_t p) - + @@ -2425,15 +2424,15 @@ template<typename T , typename = typename std::enable_if<
Returns
this set as unsigned 256-bit quotient.
-
489  {
-
490  *this /= uint256_t(p);
-
491  return *this;
-
492  }
+
489 {
+
490 *this /= uint256_t(p);
+
491 return *this;
+
492 }
- -

◆ operator/=() [2/2]

+ +

◆ operator/=() [2/2]

@@ -2442,7 +2441,7 @@ template<typename T , typename = typename std::enable_if<
@@ -42,21 +41,22 @@
uint256_t& uint256_t::operator/= uint256_t & uint256_t::operator/= ( const T &  p) - + @@ -2464,20 +2463,20 @@ template<typename T , typename = typename std::enable_if<
Returns
this set as unsigned 256-bit quotient.
-
476  {
-
477  *this = divide(p).first;
-
478  return *this;
-
479  }
+
476 {
+
477 *this = divide(p).first;
+
478 return *this;
+
479 }
Here is the call graph for this function:
-
+
- +

◆ operator<() [1/2]

@@ -2517,13 +2516,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is less than other, else false
-
630  {
-
631  return *this < uint256_t(other);
-
632  }
+
630 {
+
631 return *this < uint256_t(other);
+
632 }
- +

◆ operator<() [2/2]

@@ -2555,13 +2554,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is less than other, else false
-
543  {
-
544  return f < other.f || (f == other.f && s < other.s);
-
545  }
+
543 {
+
544 return f < other.f || (f == other.f && s < other.s);
+
545 }
- +

◆ operator<<()

@@ -2601,20 +2600,20 @@ template<typename T , typename = typename std::enable_if<
Returns
value of this shifted by p to left
-
733  {
-
734  if (!p) {
-
735  return {this->f, this->s};
-
736  } else if (p >= 128) {
-
737  return uint256_t((this->s << (p - 128)), uint128_t(0));
-
738  }
-
739  return uint256_t((this->f << p) + (this->s >> (128 - p)),
-
740  (this->s << p));
-
741  }
+
733 {
+
734 if (!p) {
+
735 return {this->f, this->s};
+
736 } else if (p >= 128) {
+
737 return uint256_t((this->s << (p - 128)), uint128_t(0));
+
738 }
+
739 return uint256_t((this->f << p) + (this->s >> (128 - p)),
+
740 (this->s << p));
+
741 }
- -

◆ operator<<=()

+ +

◆ operator<<=()

@@ -2625,7 +2624,7 @@ template<typename T , typename = typename std::enable_if<
@@ -42,21 +41,22 @@
uint256_t& uint256_t::operator/= uint256_t & uint256_t::operator/= ( const uint256_t p) - + @@ -2653,22 +2652,22 @@ template<typename T , typename = typename std::enable_if<
Returns
this shifted by p to left
-
751  {
-
752  if (p) {
-
753  if (p >= 128) {
-
754  this->f = (this->s << (p - 128));
-
755  this->s = uint128_t(0);
-
756  } else {
-
757  f = ((this->s >> (128 - p)) + (this->f << p));
-
758  s = (this->s << p);
-
759  }
-
760  }
-
761  return *this;
-
762  }
+
751 {
+
752 if (p) {
+
753 if (p >= 128) {
+
754 this->f = (this->s << (p - 128));
+
755 this->s = uint128_t(0);
+
756 } else {
+
757 f = ((this->s >> (128 - p)) + (this->f << p));
+
758 s = (this->s << p);
+
759 }
+
760 }
+
761 return *this;
+
762 }
- +

◆ operator<=() [1/2]

@@ -2708,13 +2707,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is less than or equal to other, else false
-
642  {
-
643  return *this <= uint256_t(other);
-
644  }
+
642 {
+
643 return *this <= uint256_t(other);
+
644 }
- +

◆ operator<=() [2/2]

@@ -2746,14 +2745,14 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is less than or equal to other, else false
-
552  {
-
553  return f < other.f || (f == other.f && s <= other.s);
-
554  }
+
552 {
+
553 return f < other.f || (f == other.f && s <= other.s);
+
554 }
- -

◆ operator=() [1/3]

+ +

◆ operator=() [1/3]

@@ -2762,7 +2761,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator<<= uint256_t & uint256_t::operator<<= ( const T &  p) - + @@ -2784,21 +2783,21 @@ template<typename T , typename = typename std::enable_if<
Returns
this pointer with it's value equal to p
-
202  {
- -
204  return *this;
-
205  }
+
202 {
+ +
204 return *this;
+
205 }
Here is the call graph for this function:
-
+
- -

◆ operator=() [2/3]

+ +

◆ operator=() [2/3]

@@ -2809,7 +2808,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator= uint256_t & uint256_t::operator= ( const std::string p) - + @@ -2837,15 +2836,15 @@ template<typename T , typename = typename std::enable_if<
Returns
this pointer with it's value equal to p
-
192  {
-
193  this->s = p;
-
194  return *this;
-
195  }
+
192 {
+
193 this->s = p;
+
194 return *this;
+
195 }
- -

◆ operator=() [3/3]

+ +

◆ operator=() [3/3]

@@ -2854,7 +2853,7 @@ template<typename T , typename = typename std::enable_if<
Returns
0 on exit
-
80  {
-
81  test(); // executing tests
-
82  return 0;
-
83 }
+
80 {
+
81 test(); // executing tests
+
82 return 0;
+
83}
static void test()
Test implementations.
Definition: n_choose_r.cpp:52
Here is the call graph for this function:
@@ -182,7 +181,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -207,27 +206,27 @@ Here is the call graph for this function:

Test implementations.

Returns
void
-
52  {
-
53  // First test on 5 choose 2
-
54  uint8_t t = math::n_choose_r(5, 2);
-
55  assert(((void)"10 is the answer but function says otherwise.\n", t == 10));
-
56  std::cout << "First test passes." << std::endl;
-
57  // Second test on 5 choose 3
-
58  t = math::n_choose_r(5, 3);
-
59  assert(
-
60  ((void)"10 is the answer but the function says otherwise.\n", t == 10));
-
61  std::cout << "Second test passes." << std::endl;
-
62  // Third test on 3 choose 2
-
63  t = math::n_choose_r(3, 2);
-
64  assert(
-
65  ((void)"3 is the answer but the function says otherwise.\n", t == 3));
-
66  std::cout << "Third test passes." << std::endl;
-
67  // Fourth test on 10 choose 4
-
68  t = math::n_choose_r(10, 4);
-
69  assert(((void)"210 is the answer but the function says otherwise.\n",
-
70  t == 210));
-
71  std::cout << "Fourth test passes." << std::endl;
-
72 }
+
52 {
+
53 // First test on 5 choose 2
+
54 uint8_t t = math::n_choose_r(5, 2);
+
55 assert(((void)"10 is the answer but function says otherwise.\n", t == 10));
+
56 std::cout << "First test passes." << std::endl;
+
57 // Second test on 5 choose 3
+
58 t = math::n_choose_r(5, 3);
+
59 assert(
+
60 ((void)"10 is the answer but the function says otherwise.\n", t == 10));
+
61 std::cout << "Second test passes." << std::endl;
+
62 // Third test on 3 choose 2
+
63 t = math::n_choose_r(3, 2);
+
64 assert(
+
65 ((void)"3 is the answer but the function says otherwise.\n", t == 3));
+
66 std::cout << "Third test passes." << std::endl;
+
67 // Fourth test on 10 choose 4
+
68 t = math::n_choose_r(10, 4);
+
69 assert(((void)"210 is the answer but the function says otherwise.\n",
+
70 t == 210));
+
71 std::cout << "Fourth test passes." << std::endl;
+
72}
T endl(T... args)
T n_choose_r(T n, T r)
This is the function implementation of .
Definition: n_choose_r.cpp:35
@@ -246,7 +245,7 @@ Here is the call graph for this function:
diff --git a/d1/dbb/n__choose__r_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d1/dbb/n__choose__r_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg index bc88c7b71..03478df7b 100644 --- a/d1/dbb/n__choose__r_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg +++ b/d1/dbb/n__choose__r_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: numerical_methods/lu_decomposition.h File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
uint256_t& uint256_t::operator= uint256_t & uint256_t::operator= ( const T &  p) - + @@ -2879,7 +2878,7 @@ template<typename T , typename = typename std::enable_if< - +

◆ operator==() [1/2]

@@ -2919,13 +2918,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is equal to other, else false
-
678  {
-
679  return *this == uint256_t(other);
-
680  }
+
678 {
+
679 return *this == uint256_t(other);
+
680 }
- +

◆ operator==() [2/2]

@@ -2957,13 +2956,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is equal than other, else false
-
579  {
-
580  return f == other.f && s == other.s;
-
581  }
+
579 {
+
580 return f == other.f && s == other.s;
+
581 }
- +

◆ operator>() [1/2]

@@ -3003,13 +3002,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is greater than other, else false
-
654  {
-
655  return *this > uint256_t(other);
-
656  }
+
654 {
+
655 return *this > uint256_t(other);
+
656 }
- +

◆ operator>() [2/2]

@@ -3041,13 +3040,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is greater than other, else false
-
561  {
-
562  return f > other.f || (f == other.f && s > other.s);
-
563  }
+
561 {
+
562 return f > other.f || (f == other.f && s > other.s);
+
563 }
- +

◆ operator>=() [1/2]

@@ -3087,13 +3086,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is greater than or equal other, else false
-
666  {
-
667  return *this >= uint256_t(other);
-
668  }
+
666 {
+
667 return *this >= uint256_t(other);
+
668 }
- +

◆ operator>=() [2/2]

@@ -3125,13 +3124,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is greater than or equal than other, else false
-
570  {
-
571  return (f > other.f) || (f == other.f && s >= other.s);
-
572  }
+
570 {
+
571 return (f > other.f) || (f == other.f && s >= other.s);
+
572 }
- +

◆ operator>>()

@@ -3171,20 +3170,20 @@ template<typename T , typename = typename std::enable_if<
Returns
value of this shifted by p to right
-
772  {
-
773  if (!p) {
-
774  return {this->f, this->s};
-
775  } else if (p >= 128) {
-
776  return uint256_t(uint128_t(0), (this->f >> (p - 128)));
-
777  }
-
778  return uint256_t((this->f >> p),
-
779  (this->s >> p) + (this->f << (128 - p)));
-
780  }
+
772 {
+
773 if (!p) {
+
774 return {this->f, this->s};
+
775 } else if (p >= 128) {
+
776 return uint256_t(uint128_t(0), (this->f >> (p - 128)));
+
777 }
+
778 return uint256_t((this->f >> p),
+
779 (this->s >> p) + (this->f << (128 - p)));
+
780 }
- -

◆ operator>>=()

+ +

◆ operator>>=()

@@ -3195,7 +3194,7 @@ template<typename T , typename = typename std::enable_if<
@@ -42,21 +41,22 @@
uint256_t& uint256_t::operator= uint256_t & uint256_t::operator= ( const uint256_t p) - + @@ -3223,22 +3222,22 @@ template<typename T , typename = typename std::enable_if<
Returns
this shifted by p to right
-
790  {
-
791  if (p) {
-
792  if (p >= 128) {
-
793  f = uint128_t(0);
-
794  s = (this->f >> (p - 128));
-
795  } else {
-
796  s = (this->s >> p) + (this->f << (128 - p));
-
797  f = (this->f >> p);
-
798  }
-
799  }
-
800  return *this;
-
801  }
+
790 {
+
791 if (p) {
+
792 if (p >= 128) {
+
793 f = uint128_t(0);
+
794 s = (this->f >> (p - 128));
+
795 } else {
+
796 s = (this->s >> p) + (this->f << (128 - p));
+
797 f = (this->f >> p);
+
798 }
+
799 }
+
800 return *this;
+
801 }
- +

◆ operator^() [1/2]

@@ -3278,13 +3277,13 @@ template<typename T , typename = typename std::enable_if<
Returns
value of this ^ p (^ is bit-wise XOR operator)
-
901  {
-
902  return uint256_t(f, s ^ p);
-
903  }
+
901 {
+
902 return uint256_t(f, s ^ p);
+
903 }
- +

◆ operator^() [2/2]

@@ -3316,14 +3315,14 @@ template<typename T , typename = typename std::enable_if<
Returns
value of this ^ p (^ is bit-wise XOR operator)
-
910  {
-
911  return {this->f ^ p.f, this->s ^ p.s};
-
912  }
+
910 {
+
911 return {this->f ^ p.f, this->s ^ p.s};
+
912 }
- -

◆ operator^=() [1/2]

+ +

◆ operator^=() [1/2]

@@ -3334,7 +3333,7 @@ template<typename T , typename = typename std::enable_if<
-

Initialize the pInd (partition index) from the start of the array.

    +

    Initialize the pInd (partition index) from the start of the array.

    • Loop through the array from start to less than end. (from start to < end). (Inside the loop) :-
      • Check if the current element (arr[i]) is less than the pivot element in each iteration.
      • If current element in the iteration is less than the pivot element, then swap the elements at current index (i) and partition index (pInd) and increment the partition index by one.
      • @@ -183,10 +182,10 @@ Functions
      • At the end of the loop, swap the pivot element with partition index element.
      • Return the partition index from the function.
      -
      Author
      Nitin Sharma
      +
      Author
      Nitin Sharma

      Function Documentation

      - -

      ◆ generateUnsortedArray()

      + +

      ◆ generateUnsortedArray()

      @@ -194,7 +193,7 @@ Functions template<size_t size>
uint256_t& uint256_t::operator>>= uint256_t & uint256_t::operator>>= ( const T &  p) - + @@ -3362,15 +3361,15 @@ template<typename T , typename = typename std::enable_if<
Returns
this = this ^ p (^ is bit-wise XOR operator)
-
933  {
-
934  s ^= p;
-
935  return *this;
-
936  }
+
933 {
+
934 s ^= p;
+
935 return *this;
+
936 }
- -

◆ operator^=() [2/2]

+ +

◆ operator^=() [2/2]

@@ -3379,7 +3378,7 @@ template<typename T , typename = typename std::enable_if<

for using the vector container

-

asserting the test functions for io operations

-

The change() function is used to return the updated iterative value corresponding to the given function

Parameters
+

asserting the test functions for io operations

+

The change() function is used to return the updated iterative value corresponding to the given function

Parameters
uint256_t& uint256_t::operator^= uint256_t & uint256_t::operator^= ( const T &  p) - + @@ -3401,15 +3400,15 @@ template<typename T , typename = typename std::enable_if<
Returns
this = this ^ p (^ is bit-wise XOR operator)
-
919  {
-
920  f ^= p.f;
-
921  s ^= p.s;
-
922  return *this;
-
923  }
+
919 {
+
920 f ^= p.f;
+
921 s ^= p.s;
+
922 return *this;
+
923 }
- +

◆ operator|() [1/2]

@@ -3449,13 +3448,13 @@ template<typename T , typename = typename std::enable_if<
Returns
value of this | p (| is bit-wise operator)
-
856  {
-
857  return *this | uint256_t(p);
-
858  }
+
856 {
+
857 return *this | uint256_t(p);
+
858 }
- +

◆ operator|() [2/2]

@@ -3487,14 +3486,14 @@ template<typename T , typename = typename std::enable_if<
Returns
value of this | p (| is bit-wise OR operator)
-
865  {
-
866  return {this->f | p.f, this->s | p.s};
-
867  }
+
865 {
+
866 return {this->f | p.f, this->s | p.s};
+
867 }
- -

◆ operator|=() [1/2]

+ +

◆ operator|=() [1/2]

@@ -3505,7 +3504,7 @@ template<typename T , typename = typename std::enable_if<
@@ -42,21 +41,22 @@
uint256_t& uint256_t::operator^= uint256_t & uint256_t::operator^= ( const uint256_t p) - + @@ -3533,15 +3532,15 @@ template<typename T , typename = typename std::enable_if<
Returns
this = this | p (| is bit-wise OR operator)
-
877  {
-
878  s |= p;
-
879  return *this;
-
880  }
+
877 {
+
878 s |= p;
+
879 return *this;
+
880 }
- -

◆ operator|=() [2/2]

+ +

◆ operator|=() [2/2]

@@ -3550,7 +3549,7 @@ template<typename T , typename = typename std::enable_if<
uint256_t& uint256_t::operator|= uint256_t & uint256_t::operator|= ( const T &  p) - + @@ -3572,15 +3571,15 @@ template<typename T , typename = typename std::enable_if<
Returns
this = this | p (| is bit-wise OR operator)
-
887  {
-
888  f |= p.f;
-
889  s |= p.s;
-
890  return *this;
-
891  }
+
887 {
+
888 f |= p.f;
+
889 s |= p.s;
+
890 return *this;
+
891 }
- +

◆ operator||() [1/2]

@@ -3620,13 +3619,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if this is either one of the values are non-zero, else false
-
715  {
-
716  return (s || f) || (b);
-
717  }
+
715 {
+
716 return (s || f) || (b);
+
717 }
- +

◆ operator||() [2/2]

@@ -3658,13 +3657,13 @@ template<typename T , typename = typename std::enable_if<
Returns
true if one of the values are not zero, else false
-
612  {
-
613  return (s || f) || (b.s || b.f);
-
614  }
+
612 {
+
613 return (s || f) || (b.s || b.f);
+
614 }
- +

◆ operator~()

@@ -3689,11 +3688,11 @@ template<typename T , typename = typename std::enable_if<

operator ~ for uint256_t

Returns
1's complement of this number
-
723 { return {~f, ~s}; }
+
723{ return {~f, ~s}; }
- +

◆ upper()

@@ -3718,13 +3717,13 @@ template<typename T , typename = typename std::enable_if<

returns upper 128-bit integer part

Returns
returns upper 128-bit integer part
-
175 { return f; }
+
175{ return f; }

Friends And Related Function Documentation

- -

◆ operator<<

+ +

◆ operator<<

@@ -3733,7 +3732,7 @@ template<typename T , typename = typename std::enable_if<
@@ -42,21 +41,22 @@
uint256_t& uint256_t::operator|= uint256_t & uint256_t::operator|= ( const uint256_t p) - + @@ -3758,7 +3757,7 @@ template<typename T , typename = typename std::enable_if<

operator << for printing uint256_t integer

-

Prints the uint256_t integer in decimal form

Note
Note that this operator is costly since it uses strings to print the value
+

Prints the uint256_t integer in decimal form

Note
Note that this operator is costly since it uses strings to print the value
Parameters
std::ostream& operator<< std::ostream & operator<< ( std::ostream op,
@@ -3767,31 +3766,31 @@ template<typename T , typename = typename std::enable_if<
Returns
op, ostream object.
-
947  {
-
948  if (!p.f) {
-
949  op << p.s;
-
950  } else {
-
951  std::string out = "0", p_2 = "1";
-
952  uint128_t L(1);
-
953  for (uint64_t i = 0; i < 128; ++i) {
-
954  if ((p.s & L)) {
-
955  out = add(out, p_2);
-
956  }
-
957  p_2 = add(p_2, p_2);
-
958  L <<= 1;
-
959  }
-
960  L = uint128_t(1);
-
961  for (int i = 0; i < 128; ++i) {
-
962  if ((p.f & L)) {
-
963  out = add(out, p_2);
-
964  }
-
965  p_2 = add(p_2, p_2);
-
966  L <<= 1;
-
967  }
-
968  op << out;
-
969  }
-
970  return op;
-
971  }
+
947 {
+
948 if (!p.f) {
+
949 op << p.s;
+
950 } else {
+
951 std::string out = "0", p_2 = "1";
+
952 uint128_t L(1);
+
953 for (uint64_t i = 0; i < 128; ++i) {
+
954 if ((p.s & L)) {
+
955 out = add(out, p_2);
+
956 }
+
957 p_2 = add(p_2, p_2);
+
958 L <<= 1;
+
959 }
+
960 L = uint128_t(1);
+
961 for (int i = 0; i < 128; ++i) {
+
962 if ((p.f & L)) {
+
963 out = add(out, p_2);
+
964 }
+
965 p_2 = add(p_2, p_2);
+
966 L <<= 1;
+
967 }
+
968 op << out;
+
969 }
+
970 return op;
+
971 }
std::string add(const std::string &first, const std::string &second)
Adding two string.
Definition: uint128_t.hpp:37
@@ -3806,7 +3805,7 @@ template<typename T , typename = typename std::enable_if< diff --git a/d1/d83/classuint256__t.js b/d1/d83/classuint256__t.js index dc853fea1..3b13e51a1 100644 --- a/d1/d83/classuint256__t.js +++ b/d1/d83/classuint256__t.js @@ -1,6 +1,5 @@ var classuint256__t = [ - [ "uint256_t", "d1/d83/classuint256__t.html#a5a8bb7ec6b907388a048c7705bd3620f", null ], [ "uint256_t", "d1/d83/classuint256__t.html#aed0f8c3d5be23644c4bcb2fd2551e1dc", null ], [ "uint256_t", "d1/d83/classuint256__t.html#a1fa3d95584d071add9b46597d3747b39", null ], [ "uint256_t", "d1/d83/classuint256__t.html#a42bf7490b31d8c750a67fd9bb6f2df2e", null ], @@ -11,7 +10,7 @@ var classuint256__t = [ "__get_integer_from_string", "d1/d83/classuint256__t.html#afee82fa5052e9d8c946b9205b943cec4", null ], [ "_lez", "d1/d83/classuint256__t.html#a033d66c965e8d1fbc5bafb59ad60e163", null ], [ "_trz", "d1/d83/classuint256__t.html#a9ddd133cee83f3a2ab6ed60a7ccbc250", null ], - [ "divide", "d1/d83/classuint256__t.html#af69316a7e4c2d17070de98d6a92b1c51", null ], + [ "divide", "d1/d83/classuint256__t.html#a8161d52d369e525f4e61129376adfcf1", null ], [ "lower", "d1/d83/classuint256__t.html#aa4cf08fa6a33f17594b5a842866f39a1", null ], [ "operator bool", "d1/d83/classuint256__t.html#a28aa5786bbfce1b00398a8d38691bdaa", null ], [ "operator T", "d1/d83/classuint256__t.html#a9e1b39a46ea16bc6587e25e294c6c363", null ], @@ -21,46 +20,46 @@ var classuint256__t = [ "operator!=", "d1/d83/classuint256__t.html#aae68a7bd17c14a926fb77758b5c8e547", null ], [ "operator%", "d1/d83/classuint256__t.html#a7bd9693b88c4df08b1f8d1fd81c597cc", null ], [ "operator%", "d1/d83/classuint256__t.html#ad4928175eaaaa2b559bc945affe63ad2", null ], - [ "operator%=", "d1/d83/classuint256__t.html#a95c3c34b77c6f9623cbded3e577cf7ba", null ], - [ "operator%=", "d1/d83/classuint256__t.html#a59a697fc2ee38e46506a80ddf405c188", null ], + [ "operator%=", "d1/d83/classuint256__t.html#a76914bc727eab927a3941ef71275327d", null ], + [ "operator%=", "d1/d83/classuint256__t.html#a2cd43a4a92dc825a010a17578b3bdedb", null ], [ "operator&", "d1/d83/classuint256__t.html#a6eadaa829087e07eebafca3981566bb8", null ], [ "operator&", "d1/d83/classuint256__t.html#a9bc6cc460108306a59281ce4ca216839", null ], [ "operator&&", "d1/d83/classuint256__t.html#a303287d7bc8686dcb47fcb04720ad409", null ], [ "operator&&", "d1/d83/classuint256__t.html#aa0e532832640e9fe273b35c481b18963", null ], - [ "operator&=", "d1/d83/classuint256__t.html#a97a35127d5b71fd8cd1954f113f4b59c", null ], - [ "operator&=", "d1/d83/classuint256__t.html#aa8f1a0b696f71eb3a10981ffd3a9df7b", null ], + [ "operator&=", "d1/d83/classuint256__t.html#afa79020c27caea31236d04ecaa0e5ef5", null ], + [ "operator&=", "d1/d83/classuint256__t.html#a357cdfee6a79e0484cd1e07511eb9f2d", null ], [ "operator()", "d1/d83/classuint256__t.html#a7ac99dea14428200f0101452293e2b3b", null ], [ "operator*", "d1/d83/classuint256__t.html#aaca9288fd28fc07e1386f1586bd51616", null ], [ "operator*", "d1/d83/classuint256__t.html#aa9e585b186e71d7cbe9c1d7387c38967", null ], - [ "operator*=", "d1/d83/classuint256__t.html#a4c84702c149b17c2e162eac3137fcac5", null ], - [ "operator*=", "d1/d83/classuint256__t.html#ab9e5da2ffc16c77fc8ecb101db903b29", null ], + [ "operator*=", "d1/d83/classuint256__t.html#af2193ff0d0e93143fb71f4847df16028", null ], + [ "operator*=", "d1/d83/classuint256__t.html#a4645040fe68ff01d83400f173fd2bb21", null ], [ "operator+", "d1/d83/classuint256__t.html#a20dc3a017b1a740c4bafd3f146a90b0f", null ], [ "operator+", "d1/d83/classuint256__t.html#af18e2e3d7ed635c4056062bc906fef75", null ], - [ "operator++", "d1/d83/classuint256__t.html#a7db1d4e2c2d2149fa40064b7dd66e89e", null ], + [ "operator++", "d1/d83/classuint256__t.html#af0ad4080bb5ddc16b54a7e87911005c9", null ], [ "operator++", "d1/d83/classuint256__t.html#a7bbe36e2ebd52df5efab118897b3050c", null ], - [ "operator+=", "d1/d83/classuint256__t.html#af984e2ad69cc95b52a360aba2260c576", null ], - [ "operator+=", "d1/d83/classuint256__t.html#ac71efa9f4d6b8e211bbc57023408c185", null ], + [ "operator+=", "d1/d83/classuint256__t.html#a5363ec0f36de1a8a9c985907db4e95d1", null ], + [ "operator+=", "d1/d83/classuint256__t.html#ac75a46fe3625caf10e07db1eb75a1d6e", null ], [ "operator-", "d1/d83/classuint256__t.html#a406c951a07d8173685dbe384c6ab6a06", null ], [ "operator-", "d1/d83/classuint256__t.html#a88978d00fa6a624c50c2737dc2c294b4", null ], [ "operator-", "d1/d83/classuint256__t.html#ab909ef62a0c85121e7d743c016fb723d", null ], - [ "operator--", "d1/d83/classuint256__t.html#a7db2a2c972751ea40a07240bad8821da", null ], + [ "operator--", "d1/d83/classuint256__t.html#a9f6f3e39783c893473315bada864a183", null ], [ "operator--", "d1/d83/classuint256__t.html#a28d26847f9b19a4f86c187791cb0db13", null ], [ "operator-=", "d1/d83/classuint256__t.html#acd3970c633eb2c597874e2712392f0c7", null ], - [ "operator-=", "d1/d83/classuint256__t.html#acae473393b42428a2eb27fb918f395dc", null ], + [ "operator-=", "d1/d83/classuint256__t.html#a5e84ed2a2f99cee81ede4a0107702a45", null ], [ "operator/", "d1/d83/classuint256__t.html#acac9901ab133caa57d058a377d873bf6", null ], [ "operator/", "d1/d83/classuint256__t.html#a4fdeb4d4bf8cca4ee99b8487e59831df", null ], - [ "operator/=", "d1/d83/classuint256__t.html#a9ca3427fbc9bf1aaf35caf3096868172", null ], - [ "operator/=", "d1/d83/classuint256__t.html#a00d18c74d5cbf3c087665172079e67dd", null ], + [ "operator/=", "d1/d83/classuint256__t.html#abc793979ec70bb8e5cf177d83649a259", null ], + [ "operator/=", "d1/d83/classuint256__t.html#ac1b36e64de42f3622e7d6ec5efa273d4", null ], [ "operator<", "d1/d83/classuint256__t.html#ac6bdcf64653af8173987bf7217e99056", null ], [ "operator<", "d1/d83/classuint256__t.html#afe9f4828d73dd51a080585dd0b99af96", null ], [ "operator<<", "d1/d83/classuint256__t.html#a4831263abc4430c363fdabce6e6e96d5", null ], - [ "operator<<=", "d1/d83/classuint256__t.html#acd41a6bd322252c01aa1e223039db281", null ], + [ "operator<<=", "d1/d83/classuint256__t.html#a0d96ce2d022dc30c2f303ab0698f52f5", null ], [ "operator<=", "d1/d83/classuint256__t.html#a2029e9777f999bffef6004429b4f19f2", null ], [ "operator<=", "d1/d83/classuint256__t.html#a19c88f8f2736750822b82ef9a7096d88", null ], - [ "operator=", "d1/d83/classuint256__t.html#a0590a8b45c2f7b31670606782614545e", null ], - [ "operator=", "d1/d83/classuint256__t.html#ababad4c4dd412bcfd248914d7e17d9ea", null ], - [ "operator=", "d1/d83/classuint256__t.html#ad5ba734dc60992a6907f2d3462db370a", null ], - [ "operator=", "d1/d83/classuint256__t.html#adcef109e6a0f4b122bc9f892e2184642", null ], + [ "operator=", "d1/d83/classuint256__t.html#a86aab081bb7db2771e4a4f30c3eed8e2", null ], + [ "operator=", "d1/d83/classuint256__t.html#addff5645f6005e7b50a6ad0731e4f19c", null ], + [ "operator=", "d1/d83/classuint256__t.html#a4c6db67d21c4927a45a4e1e7c2357bfc", null ], + [ "operator=", "d1/d83/classuint256__t.html#a6c5e025f901f6af4b748f98013350638", null ], [ "operator==", "d1/d83/classuint256__t.html#a9879f7ec85fc148e1931fcb492ddc484", null ], [ "operator==", "d1/d83/classuint256__t.html#a90ce75bec5b525de55bbf92c564a2261", null ], [ "operator>", "d1/d83/classuint256__t.html#ad74d33215517459c2b33ace7a9c6bc13", null ], @@ -68,20 +67,18 @@ var classuint256__t = [ "operator>=", "d1/d83/classuint256__t.html#aff4d49cf84de64301b169ad974f00bad", null ], [ "operator>=", "d1/d83/classuint256__t.html#adf09395f9113a69a05fed7e25b46c8ad", null ], [ "operator>>", "d1/d83/classuint256__t.html#a47a19142e86b7369e18da1fc0a713c51", null ], - [ "operator>>=", "d1/d83/classuint256__t.html#a27d7755f4d0a18c28e9eb69789922dd3", null ], + [ "operator>>=", "d1/d83/classuint256__t.html#ad9ce2370b1497efbcc426793048e1f78", null ], [ "operator^", "d1/d83/classuint256__t.html#acb61fe17d064c61adc02defa651f9a5e", null ], [ "operator^", "d1/d83/classuint256__t.html#a74d1e1dd8cd2b31e00813ed939943be7", null ], - [ "operator^=", "d1/d83/classuint256__t.html#a7ceeb4bb4c315ae1209802683cb0aef8", null ], - [ "operator^=", "d1/d83/classuint256__t.html#aba42be2ed3bcc8e0678126faff84a65f", null ], + [ "operator^=", "d1/d83/classuint256__t.html#a3dc4d3ab175f5f2a3172eb8d99a60fc3", null ], + [ "operator^=", "d1/d83/classuint256__t.html#ac92ac0b2368990fbbaf3cca3ee8247d7", null ], [ "operator|", "d1/d83/classuint256__t.html#acefecc3b1a4044f2be5ab46eea0099bf", null ], [ "operator|", "d1/d83/classuint256__t.html#a2d7c8a1a5ecaf3e0dcb4bf6b6cff2da2", null ], - [ "operator|=", "d1/d83/classuint256__t.html#a712aacd8110aae61ff02dc2ada25aaa6", null ], - [ "operator|=", "d1/d83/classuint256__t.html#a7119f33b963a450dd251bb1b4cc519fc", null ], + [ "operator|=", "d1/d83/classuint256__t.html#af0a6e09fcf1cbf234ed32df6d7265a0b", null ], + [ "operator|=", "d1/d83/classuint256__t.html#aa28ae272e9176557133a10dffa3b94dc", null ], [ "operator||", "d1/d83/classuint256__t.html#a4886747ffff15cdeb6bc93712629f9e7", null ], [ "operator||", "d1/d83/classuint256__t.html#a41f4bb928c4ee067732503395b65f9d7", null ], [ "operator~", "d1/d83/classuint256__t.html#a6eec1f632aebfc44fee8a74c395e10c2", null ], [ "upper", "d1/d83/classuint256__t.html#aecb2883133c8c8b9fcfb77ab69b03ab5", null ], - [ "operator<<", "d1/d83/classuint256__t.html#a67eb551c5c3a516bcfcded5a026ce735", null ], - [ "f", "d1/d83/classuint256__t.html#af851e5851d1b5762df325ccec4029ad8", null ], - [ "s", "d1/d83/classuint256__t.html#a4e6aa3f3ca9da9eb3a36cd4542ae51bb", null ] + [ "operator<<", "d1/d83/classuint256__t.html#a91badfd31be84b12cbb6d85ebc04d13a", null ] ]; \ No newline at end of file diff --git a/d1/d83/classuint256__t_a00d18c74d5cbf3c087665172079e67dd_cgraph.md5 b/d1/d83/classuint256__t_a00d18c74d5cbf3c087665172079e67dd_cgraph.md5 deleted file mode 100644 index 32f4d1f76..000000000 --- a/d1/d83/classuint256__t_a00d18c74d5cbf3c087665172079e67dd_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -a634a101ec8e4759c8c3da454687a000 \ No newline at end of file diff --git a/d1/d83/classuint256__t_a033d66c965e8d1fbc5bafb59ad60e163_cgraph.svg b/d1/d83/classuint256__t_a033d66c965e8d1fbc5bafb59ad60e163_cgraph.svg index 4da9e1e56..e4f7ad75d 100644 --- a/d1/d83/classuint256__t_a033d66c965e8d1fbc5bafb59ad60e163_cgraph.svg +++ b/d1/d83/classuint256__t_a033d66c965e8d1fbc5bafb59ad60e163_cgraph.svg @@ -1,7 +1,7 @@ - - - + diff --git a/d1/d83/classuint256__t_a2cd43a4a92dc825a010a17578b3bdedb_cgraph.md5 b/d1/d83/classuint256__t_a2cd43a4a92dc825a010a17578b3bdedb_cgraph.md5 new file mode 100644 index 000000000..e3e934157 --- /dev/null +++ b/d1/d83/classuint256__t_a2cd43a4a92dc825a010a17578b3bdedb_cgraph.md5 @@ -0,0 +1 @@ +5459a54f828d6d8bb73fde689e6243ee \ No newline at end of file diff --git a/d1/d83/classuint256__t_a59a697fc2ee38e46506a80ddf405c188_cgraph.svg b/d1/d83/classuint256__t_a2cd43a4a92dc825a010a17578b3bdedb_cgraph.svg similarity index 96% rename from d1/d83/classuint256__t_a59a697fc2ee38e46506a80ddf405c188_cgraph.svg rename to d1/d83/classuint256__t_a2cd43a4a92dc825a010a17578b3bdedb_cgraph.svg index ef56d2132..9eac15eeb 100644 --- a/d1/d83/classuint256__t_a59a697fc2ee38e46506a80ddf405c188_cgraph.svg +++ b/d1/d83/classuint256__t_a2cd43a4a92dc825a010a17578b3bdedb_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + uint256_t::divide diff --git a/d1/d83/classuint256__t_ab9e5da2ffc16c77fc8ecb101db903b29_cgraph.map b/d1/d83/classuint256__t_a4645040fe68ff01d83400f173fd2bb21_cgraph.map similarity index 100% rename from d1/d83/classuint256__t_ab9e5da2ffc16c77fc8ecb101db903b29_cgraph.map rename to d1/d83/classuint256__t_a4645040fe68ff01d83400f173fd2bb21_cgraph.map diff --git a/d1/d83/classuint256__t_ab9e5da2ffc16c77fc8ecb101db903b29_cgraph.md5 b/d1/d83/classuint256__t_a4645040fe68ff01d83400f173fd2bb21_cgraph.md5 similarity index 100% rename from d1/d83/classuint256__t_ab9e5da2ffc16c77fc8ecb101db903b29_cgraph.md5 rename to d1/d83/classuint256__t_a4645040fe68ff01d83400f173fd2bb21_cgraph.md5 diff --git a/d1/d83/classuint256__t_ab9e5da2ffc16c77fc8ecb101db903b29_cgraph.svg b/d1/d83/classuint256__t_a4645040fe68ff01d83400f173fd2bb21_cgraph.svg similarity index 97% rename from d1/d83/classuint256__t_ab9e5da2ffc16c77fc8ecb101db903b29_cgraph.svg rename to d1/d83/classuint256__t_a4645040fe68ff01d83400f173fd2bb21_cgraph.svg index 150872893..59117fc5e 100644 --- a/d1/d83/classuint256__t_ab9e5da2ffc16c77fc8ecb101db903b29_cgraph.svg +++ b/d1/d83/classuint256__t_a4645040fe68ff01d83400f173fd2bb21_cgraph.svg @@ -1,7 +1,7 @@ - - + diff --git a/d1/d83/classuint256__t_a4fdeb4d4bf8cca4ee99b8487e59831df_cgraph.md5 b/d1/d83/classuint256__t_a4fdeb4d4bf8cca4ee99b8487e59831df_cgraph.md5 index ace0a7fdc..5c5724a84 100644 --- a/d1/d83/classuint256__t_a4fdeb4d4bf8cca4ee99b8487e59831df_cgraph.md5 +++ b/d1/d83/classuint256__t_a4fdeb4d4bf8cca4ee99b8487e59831df_cgraph.md5 @@ -1 +1 @@ -bcb26ce7d5cafe069fc654b22ce8828c \ No newline at end of file +22fa3c4a0ef3c22be50917bf48653879 \ No newline at end of file diff --git a/d1/d83/classuint256__t_a4fdeb4d4bf8cca4ee99b8487e59831df_cgraph.svg b/d1/d83/classuint256__t_a4fdeb4d4bf8cca4ee99b8487e59831df_cgraph.svg index c6ca84239..5bd5d5e23 100644 --- a/d1/d83/classuint256__t_a4fdeb4d4bf8cca4ee99b8487e59831df_cgraph.svg +++ b/d1/d83/classuint256__t_a4fdeb4d4bf8cca4ee99b8487e59831df_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + uint256_t::divide diff --git a/d1/d83/classuint256__t_a59a697fc2ee38e46506a80ddf405c188_cgraph.md5 b/d1/d83/classuint256__t_a59a697fc2ee38e46506a80ddf405c188_cgraph.md5 deleted file mode 100644 index 0c4a532b9..000000000 --- a/d1/d83/classuint256__t_a59a697fc2ee38e46506a80ddf405c188_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -8951b8ab028d234fe22419d8ba152fa5 \ No newline at end of file diff --git a/d1/d83/classuint256__t_af69316a7e4c2d17070de98d6a92b1c51_cgraph.map b/d1/d83/classuint256__t_a8161d52d369e525f4e61129376adfcf1_cgraph.map similarity index 100% rename from d1/d83/classuint256__t_af69316a7e4c2d17070de98d6a92b1c51_cgraph.map rename to d1/d83/classuint256__t_a8161d52d369e525f4e61129376adfcf1_cgraph.map diff --git a/d1/d83/classuint256__t_af69316a7e4c2d17070de98d6a92b1c51_cgraph.md5 b/d1/d83/classuint256__t_a8161d52d369e525f4e61129376adfcf1_cgraph.md5 similarity index 100% rename from d1/d83/classuint256__t_af69316a7e4c2d17070de98d6a92b1c51_cgraph.md5 rename to d1/d83/classuint256__t_a8161d52d369e525f4e61129376adfcf1_cgraph.md5 diff --git a/d1/d83/classuint256__t_af69316a7e4c2d17070de98d6a92b1c51_cgraph.svg b/d1/d83/classuint256__t_a8161d52d369e525f4e61129376adfcf1_cgraph.svg similarity index 97% rename from d1/d83/classuint256__t_af69316a7e4c2d17070de98d6a92b1c51_cgraph.svg rename to d1/d83/classuint256__t_a8161d52d369e525f4e61129376adfcf1_cgraph.svg index 34500d220..c804b6034 100644 --- a/d1/d83/classuint256__t_af69316a7e4c2d17070de98d6a92b1c51_cgraph.svg +++ b/d1/d83/classuint256__t_a8161d52d369e525f4e61129376adfcf1_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + diff --git a/d1/d83/classuint256__t_ac1b36e64de42f3622e7d6ec5efa273d4_cgraph.md5 b/d1/d83/classuint256__t_ac1b36e64de42f3622e7d6ec5efa273d4_cgraph.md5 new file mode 100644 index 000000000..6bf6f0406 --- /dev/null +++ b/d1/d83/classuint256__t_ac1b36e64de42f3622e7d6ec5efa273d4_cgraph.md5 @@ -0,0 +1 @@ +88abb28c97df95571079b8285f70e198 \ No newline at end of file diff --git a/d1/d83/classuint256__t_a00d18c74d5cbf3c087665172079e67dd_cgraph.svg b/d1/d83/classuint256__t_ac1b36e64de42f3622e7d6ec5efa273d4_cgraph.svg similarity index 96% rename from d1/d83/classuint256__t_a00d18c74d5cbf3c087665172079e67dd_cgraph.svg rename to d1/d83/classuint256__t_ac1b36e64de42f3622e7d6ec5efa273d4_cgraph.svg index b0438ee09..1c99e96a7 100644 --- a/d1/d83/classuint256__t_a00d18c74d5cbf3c087665172079e67dd_cgraph.svg +++ b/d1/d83/classuint256__t_ac1b36e64de42f3622e7d6ec5efa273d4_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + uint256_t::divide diff --git a/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.map b/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.map index 5c0686de3..6d2cffb20 100644 --- a/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.map +++ b/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.map @@ -1,6 +1,6 @@ - + diff --git a/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.md5 b/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.md5 index 421cd979d..470acdddb 100644 --- a/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.md5 +++ b/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.md5 @@ -1 +1 @@ -73496ad6d25800c5db6aaf2c9e34daf9 \ No newline at end of file +db4530d1673a70a3f4a6f6dd4bf70889 \ No newline at end of file diff --git a/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.svg b/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.svg index f67186ce4..0edb0d9db 100644 --- a/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.svg +++ b/d1/d83/classuint256__t_ad4928175eaaaa2b559bc945affe63ad2_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + uint256_t::divide diff --git a/d1/d83/classuint256__t_afee82fa5052e9d8c946b9205b943cec4_cgraph.svg b/d1/d83/classuint256__t_afee82fa5052e9d8c946b9205b943cec4_cgraph.svg index 94bb8d6bd..3856146e0 100644 --- a/d1/d83/classuint256__t_afee82fa5052e9d8c946b9205b943cec4_cgraph.svg +++ b/d1/d83/classuint256__t_afee82fa5052e9d8c946b9205b943cec4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
opostream object
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,28 +90,27 @@ $(document).ready(function(){initNavTree('d0/d3e/classdata__structures_1_1trie.h
-
-
data_structures::trie Member List
+
data_structures::trie Member List

This is the complete list of members for data_structures::trie, including all inherited members.

- + - + - + - +
arrdata_structures::trieprivate
char_to_int(const char &ch) constdata_structures::trieinlineprivate
char_to_int(const char &ch) constdata_structures::trieinlineprivate
deleteString(const std::string &str, int index)data_structures::trieinline
insert(const std::string &str)data_structures::trieinline
insert(const std::string &str)data_structures::trieinline
isEndofWorddata_structures::trieprivate
NUM_CHARSdata_structures::trieprivatestatic
NUM_CHARSdata_structures::trieprivatestatic
search(const std::shared_ptr< trie > &root, const std::string &str, int index)data_structures::trieinlineprivate
search(const std::string &str, int index)data_structures::trieinline
search(const std::string &str, int index)data_structures::trieinline
trie()=defaultdata_structures::trie
diff --git a/d1/d90/subarray__sum_8cpp__incl.svg b/d1/d90/subarray__sum_8cpp__incl.svg index 0794c5a3a..11abf5c8f 100644 --- a/d1/d90/subarray__sum_8cpp__incl.svg +++ b/d1/d90/subarray__sum_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: graph/hopcroft_karp.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('d1/d9a/hopcroft__karp_8cpp.html','../. Classes | Namespaces | Functions -
-
hopcroft_karp.cpp File Reference
+
hopcroft_karp.cpp File Reference
-

Implementation of Hopcroft–Karp algorithm. +

Implementation of Hopcroft–Karp algorithm. More...

#include <iostream>
#include <cstdlib>
@@ -115,19 +114,19 @@ Include dependency graph for hopcroft_karp.cpp:
-

+

Classes

class  graph::HKGraph
 Represents Bipartite graph for Hopcroft Karp implementation. More...
 
- - +

+

Namespaces

 graph
namespace  graph
 Graph Algorithms.
 
- @@ -136,29 +135,29 @@ Functions

+

Functions

void tests ()
 
 

Detailed Description

-

Implementation of Hopcroft–Karp algorithm.

-

The Hopcroft–Karp algorithm is an algorithm that takes as input a bipartite graph and produces as output a maximum cardinality matching, it runs in O(E√V) time in worst case.

+

Implementation of Hopcroft–Karp algorithm.

+

The Hopcroft–Karp algorithm is an algorithm that takes as input a bipartite graph and produces as output a maximum cardinality matching, it runs in O(E√V) time in worst case.

Bipartite graph

-

A bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets U and V such that every edge connects a vertex in U to one in V. Vertex sets U and V are usually called the parts of the graph. Equivalently, a bipartite graph is a graph that does not contain any odd-length cycles.

+

A bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets U and V such that every edge connects a vertex in U to one in V. Vertex sets U and V are usually called the parts of the graph. Equivalently, a bipartite graph is a graph that does not contain any odd-length cycles.

Matching and Not-Matching edges

-

Given a matching M, edges that are part of matching are called Matching edges and edges that are not part of M (or connect free nodes) are called Not-Matching edges.

+

Given a matching M, edges that are part of matching are called Matching edges and edges that are not part of M (or connect free nodes) are called Not-Matching edges.

Maximum cardinality matching

-

Given a bipartite graphs G = ( V = ( X , Y ) , E ) whose partition has the parts X and Y, with E denoting the edges of the graph, the goal is to find a matching with as many edges as possible. Equivalently, a matching that covers as many vertices as possible.

+

Given a bipartite graphs G = ( V = ( X , Y ) , E ) whose partition has the parts X and Y, with E denoting the edges of the graph, the goal is to find a matching with as many edges as possible. Equivalently, a matching that covers as many vertices as possible.

Augmenting paths

-

Given a matching M, an augmenting path is an alternating path that starts from and ends on free vertices. All single edge paths that start and end with free vertices are augmenting paths.

+

Given a matching M, an augmenting path is an alternating path that starts from and ends on free vertices. All single edge paths that start and end with free vertices are augmenting paths.

Concept

-

A matching M is not maximum if there exists an augmenting path. It is also true other way, i.e, a matching is maximum if no augmenting path exists.

+

A matching M is not maximum if there exists an augmenting path. It is also true other way, i.e, a matching is maximum if no augmenting path exists.

Algorithm

-

1) Initialize the Maximal Matching M as empty. 2) While there exists an Augmenting Path P Remove matching edges of P from M and add not-matching edges of P to M (This increases size of M by 1 as P starts and ends with a free vertex i.e. a node that is not part of matching.) 3) Return M.

-
Author
Krishna Pal Deora
+

1) Initialize the Maximal Matching M as empty. 2) While there exists an Augmenting Path P Remove matching edges of P from M and add not-matching edges of P to M (This increases size of M by 1 as P starts and ends with a free vertex i.e. a node that is not part of matching.) 3) Return M.

+
Author
Krishna Pal Deora

Function Documentation

- +

◆ main()

@@ -176,25 +175,25 @@ Algorithm

Main function.

Returns
0 on exit
-
307 {
-
308  tests(); // perform self-tests
-
309 
-
310  int v1 = 0, v2 = 0, e = 0;
-
311  std::cin >> v1 >> v2 >> e; // vertices of left side, right side and edges
-
312  HKGraph g(v1, v2);
-
313  int u = 0, v = 0;
-
314  for (int i = 0; i < e; ++i)
-
315  {
-
316  std::cin >> u >> v;
-
317  g.addEdge(u, v);
-
318  }
-
319 
-
320  int res = g.hopcroftKarpAlgorithm();
-
321  std::cout << "Maximum matching is " << res <<"\n";
-
322 
-
323  return 0;
-
324 
-
325 }
+
307{
+
308 tests(); // perform self-tests
+
309
+
310 int v1 = 0, v2 = 0, e = 0;
+
311 std::cin >> v1 >> v2 >> e; // vertices of left side, right side and edges
+
312 HKGraph g(v1, v2);
+
313 int u = 0, v = 0;
+
314 for (int i = 0; i < e; ++i)
+
315 {
+
316 std::cin >> u >> v;
+
317 g.addEdge(u, v);
+
318 }
+
319
+
320 int res = g.hopcroftKarpAlgorithm();
+
321 std::cout << "Maximum matching is " << res <<"\n";
+
322
+
323 return 0;
+
324
+
325}
Represents Bipartite graph for Hopcroft Karp implementation.
Definition: hopcroft_karp.cpp:67
@@ -202,13 +201,13 @@ Algorithm
Here is the call graph for this function:
-
+
- +

◆ tests()

@@ -222,57 +221,57 @@ Here is the call graph for this function:
-

Self-test implementation

Returns
none
-
255  {
-
256  // Sample test case 1
-
257  int v1a = 3, v1b = 5, e1 = 2; // vertices of left side, right side and edges
-
258  HKGraph g1(v1a, v1b); // execute the algorithm
-
259 
-
260  g1.addEdge(0,1);
-
261  g1.addEdge(1,4);
-
262 
-
263  int expected_res1 = 0; // for the above sample data, this is the expected output
-
264  int res1 = g1.hopcroftKarpAlgorithm();
-
265 
-
266  assert(res1 == expected_res1); // assert check to ensure that the algorithm executed correctly for test 1
-
267 
-
268  // Sample test case 2
-
269  int v2a = 4, v2b = 4, e2 = 6; // vertices of left side, right side and edges
-
270  HKGraph g2(v2a, v2b); // execute the algorithm
-
271 
-
272  g2.addEdge(1,1);
-
273  g2.addEdge(1,3);
-
274  g2.addEdge(2,3);
-
275  g2.addEdge(3,4);
-
276  g2.addEdge(4,3);
-
277  g2.addEdge(4,2);
-
278 
-
279  int expected_res2 = 0; // for the above sample data, this is the expected output
-
280  int res2 = g2.hopcroftKarpAlgorithm();
-
281 
-
282  assert(res2 == expected_res2); // assert check to ensure that the algorithm executed correctly for test 2
-
283 
-
284  // Sample test case 3
-
285  int v3a = 6, v3b = 6, e3 = 4; // vertices of left side, right side and edges
-
286  HKGraph g3(v3a, v3b); // execute the algorithm
-
287 
-
288  g3.addEdge(0,1);
-
289  g3.addEdge(1,4);
-
290  g3.addEdge(1,5);
-
291  g3.addEdge(5,0);
-
292 
-
293  int expected_res3 = 0; // for the above sample data, this is the expected output
-
294  int res3 = g3.hopcroftKarpAlgorithm();
-
295 
-
296  assert(res3 == expected_res3); // assert check to ensure that the algorithm executed correctly for test 3
-
297 
-
298 
-
299 
-
300 }
+

Self-test implementation

Returns
none
+
255 {
+
256 // Sample test case 1
+
257 int v1a = 3, v1b = 5, e1 = 2; // vertices of left side, right side and edges
+
258 HKGraph g1(v1a, v1b); // execute the algorithm
+
259
+
260 g1.addEdge(0,1);
+
261 g1.addEdge(1,4);
+
262
+
263 int expected_res1 = 0; // for the above sample data, this is the expected output
+
264 int res1 = g1.hopcroftKarpAlgorithm();
+
265
+
266 assert(res1 == expected_res1); // assert check to ensure that the algorithm executed correctly for test 1
+
267
+
268 // Sample test case 2
+
269 int v2a = 4, v2b = 4, e2 = 6; // vertices of left side, right side and edges
+
270 HKGraph g2(v2a, v2b); // execute the algorithm
+
271
+
272 g2.addEdge(1,1);
+
273 g2.addEdge(1,3);
+
274 g2.addEdge(2,3);
+
275 g2.addEdge(3,4);
+
276 g2.addEdge(4,3);
+
277 g2.addEdge(4,2);
+
278
+
279 int expected_res2 = 0; // for the above sample data, this is the expected output
+
280 int res2 = g2.hopcroftKarpAlgorithm();
+
281
+
282 assert(res2 == expected_res2); // assert check to ensure that the algorithm executed correctly for test 2
+
283
+
284 // Sample test case 3
+
285 int v3a = 6, v3b = 6, e3 = 4; // vertices of left side, right side and edges
+
286 HKGraph g3(v3a, v3b); // execute the algorithm
+
287
+
288 g3.addEdge(0,1);
+
289 g3.addEdge(1,4);
+
290 g3.addEdge(1,5);
+
291 g3.addEdge(5,0);
+
292
+
293 int expected_res3 = 0; // for the above sample data, this is the expected output
+
294 int res3 = g3.hopcroftKarpAlgorithm();
+
295
+
296 assert(res3 == expected_res3); // assert check to ensure that the algorithm executed correctly for test 3
+
297
+
298
+
299
+
300}
Here is the call graph for this function:
-
+
@@ -284,7 +283,7 @@ Here is the call graph for this function:
diff --git a/d1/d9a/hopcroft__karp_8cpp.js b/d1/d9a/hopcroft__karp_8cpp.js index c5f05fa1a..212f35d48 100644 --- a/d1/d9a/hopcroft__karp_8cpp.js +++ b/d1/d9a/hopcroft__karp_8cpp.js @@ -1,6 +1,6 @@ var hopcroft__karp_8cpp = [ - [ "HKGraph", "d8/d69/classgraph_1_1_h_k_graph.html", "d8/d69/classgraph_1_1_h_k_graph" ], + [ "graph::HKGraph", "d8/d69/classgraph_1_1_h_k_graph.html", "d8/d69/classgraph_1_1_h_k_graph" ], [ "main", "d1/d9a/hopcroft__karp_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "tests", "d1/d9a/hopcroft__karp_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9", null ] ]; \ No newline at end of file diff --git a/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.map b/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.map index 1c1adad98..4a70cd202 100644 --- a/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.map +++ b/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.map @@ -1,9 +1,7 @@ - - - - - + + + diff --git a/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 b/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 index ce602f3d2..1421a1d43 100644 --- a/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 +++ b/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 @@ -1 +1 @@ -419a8bf7cbe88704d5a9b06319e81efb \ No newline at end of file +534a33e5daa1a50fe5288dc58554c2a5 \ No newline at end of file diff --git a/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg b/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg index 4ae10186b..17a8afc66 100644 --- a/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg +++ b/d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg @@ -1,20 +1,20 @@ - - - + + tests - + Node1 - -tests + +tests @@ -22,98 +22,68 @@ Node2 - -graph::HKGraph::addEdge + +graph::HKGraph::addEdge Node1->Node2 - - - - - -Node4 - - -graph::HKGraph::hopcroft -KarpAlgorithm - - - - - -Node1->Node4 - - + + Node3 - - -std::vector::push_back + + +graph::HKGraph::hopcroft +KarpAlgorithm - + -Node2->Node3 - - +Node1->Node3 + + + + + +Node4 + + +graph::HKGraph::bfs + + + + + +Node3->Node4 + + Node5 - - -graph::HKGraph::bfs + + +graph::HKGraph::dfs - + -Node4->Node5 - - +Node3->Node5 + + - - -Node7 - - -graph::HKGraph::dfs - - - - - -Node4->Node7 - - - - - -Node6 - - -std::vector::end - - - - + -Node5->Node6 - - - - - -Node7->Node6 - - +Node5->Node5 + + diff --git a/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 7b6ac46ba..7734b1ff4 100644 --- a/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,10 +1,8 @@ - - - - - - + + + + diff --git a/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 2cacb1180..b64f3d36c 100644 --- a/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -a0d5a38cc5fee67eca81aa0294d0349d \ No newline at end of file +3cd89b90428da094b5ee440de29552e9 \ No newline at end of file diff --git a/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index fd87d8619..e1958702b 100644 --- a/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,66 +1,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + main - + Node1 - -main + +main @@ -68,167 +22,95 @@ var sectionId = 'dynsection-1'; Node2 - -graph::HKGraph::addEdge + +graph::HKGraph::addEdge Node1->Node2 - - - - - -Node4 - - -graph::HKGraph::hopcroft -KarpAlgorithm - - - - - -Node1->Node4 - - - - - -Node8 - - -tests - - - - - -Node1->Node8 - - + + Node3 - - -std::vector::push_back + + +graph::HKGraph::hopcroft +KarpAlgorithm - + -Node2->Node3 - - - - - -Node5 - - -graph::HKGraph::bfs - - - - - -Node4->Node5 - - - - - -Node7 - - -graph::HKGraph::dfs - - - - - -Node4->Node7 - - +Node1->Node3 + + Node6 - - -std::vector::end + + +tests - + + +Node1->Node6 + + + + + +Node4 + + +graph::HKGraph::bfs + + + + + +Node3->Node4 + + + + + +Node5 + + +graph::HKGraph::dfs + + + + + +Node3->Node5 + + + + -Node5->Node6 - - +Node5->Node5 + + - + -Node7->Node6 - - +Node6->Node2 + + - - -Node8->Node2 - - - - - -Node8->Node4 - - + + +Node6->Node3 + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg b/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg deleted file mode 100644 index cd015e233..000000000 --- a/d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - -main - - - -Node1 - - -main - - - - - -Node2 - - -graph::HKGraph::addEdge - - - - - -Node1->Node2 - - - - - -Node4 - - -graph::HKGraph::hopcroft -KarpAlgorithm - - - - - -Node1->Node4 - - - - - -Node8 - - -tests - - - - - -Node1->Node8 - - - - - -Node3 - - -std::vector::push_back - - - - - -Node2->Node3 - - - - - -Node5 - - -graph::HKGraph::bfs - - - - - -Node4->Node5 - - - - - -Node7 - - -graph::HKGraph::dfs - - - - - -Node4->Node7 - - - - - -Node6 - - -std::vector::end - - - - - -Node5->Node6 - - - - - -Node7->Node6 - - - - - -Node8->Node2 - - - - - -Node8->Node4 - - - - - diff --git a/d1/da1/decimal__to__hexadecimal_8cpp__incl.svg b/d1/da1/decimal__to__hexadecimal_8cpp__incl.svg index df7fd2b85..d01f4cfed 100644 --- a/d1/da1/decimal__to__hexadecimal_8cpp__incl.svg +++ b/d1/da1/decimal__to__hexadecimal_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: numerical_methods/rungekutta.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d1/da6/rungekutta_8cpp.html','../../') -
-
rungekutta.cpp File Reference
+
rungekutta.cpp File Reference
-

Runge Kutta fourth order method implementation +

Runge Kutta fourth order method implementation More...

#include <cassert>
#include <iostream>
@@ -110,16 +109,16 @@ Include dependency graph for rungekutta.cpp:
- - + - - + +

+

Namespaces

 numerical_methods
namespace  numerical_methods
 for io operations
 
 runge_kutta
 Functions for Runge Kutta fourth order method.
namespace  runge_kutta
 Functions for Runge Kutta fourth order method.
 
- @@ -136,11 +135,11 @@ Functions

+

Functions

double numerical_methods::runge_kutta::rungeKutta (double init_x, const double &init_y, const double &x, const double &h)
 the Runge Kutta method finds the value of integration of a function in the given limits. the lower limit of integration as the initial value and the upper limit is the given x More...
 

Detailed Description

-

Runge Kutta fourth order method implementation

-
Author
Rudra Prasad Das
+

Runge Kutta fourth order method implementation

+
Author
Rudra Prasad Das

It solves the unknown value of y for a given value of x only first order differential equations can be solved

Function Documentation

- +

◆ change()

@@ -175,8 +174,8 @@ Functions
@@ -186,11 +185,11 @@ Functions
Returns
the computed function value at that call
Examples
/Users/runner/work/C-Plus-Plus/C-Plus-Plus/numerical_methods/rungekutta.cpp.
-
33 { return ((x - y) / 2.0); }
+
33{ return ((x - y) / 2.0); }
- +

◆ main()

@@ -208,10 +207,10 @@ Functions

Main function.

Returns
0 on exit
-
130  {
-
131  test(); // Execute the tests
-
132  return 0;
-
133 }
+
130 {
+
131 test(); // Execute the tests
+
132 return 0;
+
133}
static void test()
Tests to check algorithm implementation.
Definition: rungekutta.cpp:100
Here is the call graph for this function:
@@ -222,7 +221,7 @@ Here is the call graph for this function:
- +

◆ rungeKutta()

@@ -273,44 +272,44 @@ Here is the call graph for this function:
Returns
the value of y at thr required value of x from the initial conditions
Examples
/Users/runner/work/C-Plus-Plus/C-Plus-Plus/numerical_methods/rungekutta.cpp.
-
58  {
-
59  // Count number of iterations
-
60  // using step size or
-
61  // step height h
-
62 
-
63  // n calucates the number of iterations
-
64  // k1, k2, k3, k4 are the Runge Kutta variables
-
65  // used for calculation of y at each iteration
-
66 
-
67  auto n = static_cast<uint64_t>((x - init_x) / h);
-
68  // used a vector container for the variables
-
69  std::vector<double> k(4, 0.0);
-
70 
-
71  // Iterate for number of iterations
-
72 
-
73  double y = init_y;
-
74  for (int i = 1; i <= n; ++i) {
-
75  // Apply Runge Kutta Formulas
-
76  // to find next value of y
-
77  k[0] = h * change(init_x, y);
-
78  k[1] = h * change(init_x + 0.5 * h, y + 0.5 * k[0]);
-
79  k[2] = h * change(init_x + 0.5 * h, y + 0.5 * k[1]);
-
80  k[3] = h * change(init_x + h, y + k[2]);
-
81 
-
82  // Update next value of y
-
83 
-
84  y += (1.0 / 6.0) * (k[0] + 2 * k[1] + 2 * k[2] + k[3]);
-
85 
-
86  // Update next value of x
-
87 
-
88  init_x += h;
-
89  }
-
90 
-
91  return y;
-
92 }
+
58 {
+
59 // Count number of iterations
+
60 // using step size or
+
61 // step height h
+
62
+
63 // n calucates the number of iterations
+
64 // k1, k2, k3, k4 are the Runge Kutta variables
+
65 // used for calculation of y at each iteration
+
66
+
67 auto n = static_cast<uint64_t>((x - init_x) / h);
+
68 // used a vector container for the variables
+
69 std::vector<double> k(4, 0.0);
+
70
+
71 // Iterate for number of iterations
+
72
+
73 double y = init_y;
+
74 for (int i = 1; i <= n; ++i) {
+
75 // Apply Runge Kutta Formulas
+
76 // to find next value of y
+
77 k[0] = h * change(init_x, y);
+
78 k[1] = h * change(init_x + 0.5 * h, y + 0.5 * k[0]);
+
79 k[2] = h * change(init_x + 0.5 * h, y + 0.5 * k[1]);
+
80 k[3] = h * change(init_x + h, y + k[2]);
+
81
+
82 // Update next value of y
+
83
+
84 y += (1.0 / 6.0) * (k[0] + 2 * k[1] + 2 * k[2] + k[3]);
+
85
+
86 // Update next value of x
+
87
+
88 init_x += h;
+
89 }
+
90
+
91 return y;
+
92}
int h(int key)
Definition: hash_search.cpp:45
static double change(double x, double y)
for using the vector container
Definition: rungekutta.cpp:33
- +
Here is the call graph for this function:
@@ -320,7 +319,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -345,31 +344,31 @@ Here is the call graph for this function:

Tests to check algorithm implementation.

Returns
void
-
100  {
-
101  std::cout << "The Runge Kutta function will be tested on the basis of "
-
102  "precomputed values\n";
-
103 
-
104  std::cout << "Test 1...."
-
105  << "\n";
- -
107  2, 3, 4, 0.2); // Tests the function with pre calculated values
-
108  assert(valfirst == 3.10363932323749570);
-
109  std::cout << "Passed Test 1\n";
-
110 
-
111  std::cout << "Test 2...."
-
112  << "\n";
- -
114  1, 2, 5, 0.1); // The value of step changed
-
115  assert(valsec == 3.40600589380261409);
-
116  std::cout << "Passed Test 2\n";
-
117 
-
118  std::cout << "Test 3...."
-
119  << "\n";
- -
121  -1, 3, 4, 0.1); // Tested with negative value
-
122  assert(valthird == 2.49251005860244268);
-
123  std::cout << "Passed Test 3\n";
-
124 }
+
100 {
+
101 std::cout << "The Runge Kutta function will be tested on the basis of "
+
102 "precomputed values\n";
+
103
+
104 std::cout << "Test 1...."
+
105 << "\n";
+ +
107 2, 3, 4, 0.2); // Tests the function with pre calculated values
+
108 assert(valfirst == 3.10363932323749570);
+
109 std::cout << "Passed Test 1\n";
+
110
+
111 std::cout << "Test 2...."
+
112 << "\n";
+ +
114 1, 2, 5, 0.1); // The value of step changed
+
115 assert(valsec == 3.40600589380261409);
+
116 std::cout << "Passed Test 2\n";
+
117
+
118 std::cout << "Test 3...."
+
119 << "\n";
+ +
121 -1, 3, 4, 0.1); // Tested with negative value
+
122 assert(valthird == 2.49251005860244268);
+
123 std::cout << "Passed Test 3\n";
+
124}
double rungeKutta(double init_x, const double &init_y, const double &x, const double &h)
the Runge Kutta method finds the value of integration of a function in the given limits....
Definition: rungekutta.cpp:57
@@ -381,7 +380,7 @@ Here is the call graph for this function:
diff --git a/d1/da6/rungekutta_8cpp_a7b9f40c7b5e9749cc550f19be3dc8856_cgraph.svg b/d1/da6/rungekutta_8cpp_a7b9f40c7b5e9749cc550f19be3dc8856_cgraph.svg index baf01f00c..cc4c8f453 100644 --- a/d1/da6/rungekutta_8cpp_a7b9f40c7b5e9749cc550f19be3dc8856_cgraph.svg +++ b/d1/da6/rungekutta_8cpp_a7b9f40c7b5e9749cc550f19be3dc8856_cgraph.svg @@ -1,7 +1,7 @@ - - - - + +Algorithms_in_C++: sorting/random_pivot_quick_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
xis the value corresponding to the x coordinate
yis the value corresponding to the y coordinate
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('d1/daa/random__pivot__quick__sort_8cpp Classes | Namespaces | Functions -
-
random_pivot_quick_sort.cpp File Reference
+
random_pivot_quick_sort.cpp File Reference
-

Implementation of the Random Pivot Quick Sort algorithm. +

Implementation of the Random Pivot Quick Sort algorithm. More...

#include <algorithm>
#include <array>
@@ -114,22 +113,22 @@ Include dependency graph for random_pivot_quick_sort.cpp:
-

+

Classes

class  TestCases
 class encapsulating the necessary test cases More...
 
- - + - - + +

+

Namespaces

 sorting
namespace  sorting
 Sorting algorithms.
 
 random_pivot_quick_sort
 Functions for the Random Pivot Quick Sort implementation.
namespace  random_pivot_quick_sort
 Functions for the Random Pivot Quick Sort implementation.
 
- @@ -138,18 +137,18 @@ Functions - - - - - - - - - - - - + + + + + + + + + + + + @@ -158,7 +157,7 @@ Functions

+

Functions

template<size_t T>
void sorting::random_pivot_quick_sort::showArray (std::array< int64_t, T > arr)
int64_t sorting::random_pivot_quick_sort::getRandomIndex (int64_t start, int64_t end)
 Takes the start and end indices of an array and returns a random int64_teger between the range of those two for selecting pivot element. More...
 
template<size_t size>
std::tuple< int64_t, std::array< int64_t, size > > sorting::random_pivot_quick_sort::partition (std::array< int64_t, size > arr, int64_t start, int64_t end)
 A partition function which handles the partition logic of quick sort. More...
 
template<size_t size>
std::array< int64_t, size > sorting::random_pivot_quick_sort::quickSortRP (std::array< int64_t, size > arr, int64_t start, int64_t end)
 Random pivot quick sort function. This function is the starting point of the algorithm. More...
 
template<size_t size>
std::array< int64_t, size > sorting::random_pivot_quick_sort::generateUnsortedArray (int64_t from, int64_t to)
 A function utility to generate unsorted array of given size and range. More...
 
template<size_t size>
std::tuple< int64_t, std::array< int64_t, size > > sorting::random_pivot_quick_sort::partition (std::array< int64_t, size > arr, int64_t start, int64_t end)
 A partition function which handles the partition logic of quick sort. More...
 
template<size_t size>
std::array< int64_t, size > sorting::random_pivot_quick_sort::quickSortRP (std::array< int64_t, size > arr, int64_t start, int64_t end)
 Random pivot quick sort function. This function is the starting point of the algorithm. More...
 
template<size_t size>
std::array< int64_t, size > sorting::random_pivot_quick_sort::generateUnsortedArray (int64_t from, int64_t to)
 A function utility to generate unsorted array of given size and range. More...
 
static void test ()
 Self-test implementations. More...
 
 

Detailed Description

-

Implementation of the Random Pivot Quick Sort algorithm.

+

Implementation of the Random Pivot Quick Sort algorithm.

  • A random pivot quick sort algorithm is pretty much same as quick sort with a difference of having a logic of selecting next pivot element from the input array.
  • Where in quick sort is fast, but still can give you the time complexity of O(n^2) in worst case.
  • @@ -174,7 +173,7 @@ Functions
- + @@ -228,20 +227,20 @@ template<size_t size>
Returns
std::array<int64_t , size> Unsorted array of specified size.
-
160  {
-
161  srand(time(nullptr));
-
162  std::array<int64_t, size> unsortedArray{};
-
163  assert(from < to);
-
164  int64_t i = 0;
-
165  while (i < size) {
-
166  int64_t randomNum = from + rand() % (to - from + 1);
-
167  if (randomNum) {
-
168  unsortedArray[i] = randomNum;
-
169  i++;
-
170  }
-
171  }
-
172  return unsortedArray;
-
173 }
+
160 {
+
161 srand(time(nullptr));
+
162 std::array<int64_t, size> unsortedArray{};
+
163 assert(from < to);
+
164 int64_t i = 0;
+
165 while (i < size) {
+
166 int64_t randomNum = from + rand() % (to - from + 1);
+
167 if (randomNum) {
+
168 unsortedArray[i] = randomNum;
+
169 i++;
+
170 }
+
171 }
+
172 return unsortedArray;
+
173}
T rand(T... args)
T srand(T... args)
@@ -249,13 +248,13 @@ template<size_t size>
Here is the call graph for this function:
-
+
- +

◆ getRandomIndex()

@@ -290,11 +289,11 @@ Here is the call graph for this function:
Returns
int64_t A random number between start and end index.
-
88  {
-
89  srand(time(nullptr)); // Initialize random number generator.
-
90  int64_t randomPivotIndex = start + rand() % (end - start + 1);
-
91  return randomPivotIndex;
-
92 }
+
88 {
+
89 srand(time(nullptr)); // Initialize random number generator.
+
90 int64_t randomPivotIndex = start + rand() % (end - start + 1);
+
91 return randomPivotIndex;
+
92}
T end(T... args)
Here is the call graph for this function:
@@ -305,7 +304,7 @@ Here is the call graph for this function:
- +

◆ main()

@@ -340,26 +339,26 @@ Here is the call graph for this function:
Returns
0 on exit
-
323  {
-
324  test(); // Executes various test cases.
-
325 
-
326  const int64_t inputSize = 10;
-
327  std::array<int64_t, inputSize> unsorted_array =
-
328  sorting::random_pivot_quick_sort::generateUnsortedArray<inputSize>(
-
329  50, 1000);
-
330  std::cout << "Unsorted array is : " << std::endl;
- -
332 
-
333  std::array<int64_t, inputSize> sorted_array =
- -
335  unsorted_array, 0, unsorted_array.size() - 1);
-
336  std::cout << "Sorted array is : " << std::endl;
- -
338  return 0;
-
339 }
+
323 {
+
324 test(); // Executes various test cases.
+
325
+
326 const int64_t inputSize = 10;
+
327 std::array<int64_t, inputSize> unsorted_array =
+
328 sorting::random_pivot_quick_sort::generateUnsortedArray<inputSize>(
+
329 50, 1000);
+
330 std::cout << "Unsorted array is : " << std::endl;
+ +
332
+
333 std::array<int64_t, inputSize> sorted_array =
+ +
335 unsorted_array, 0, unsorted_array.size() - 1);
+
336 std::cout << "Sorted array is : " << std::endl;
+ +
338 return 0;
+
339}
T endl(T... args)
-
std::array< int64_t, size > quickSortRP(std::array< int64_t, size > arr, int64_t start, int64_t end)
Random pivot quick sort function. This function is the starting point of the algorithm.
Definition: random_pivot_quick_sort.cpp:130
+
std::array< int64_t, size > quickSortRP(std::array< int64_t, size > arr, int64_t start, int64_t end)
Random pivot quick sort function. This function is the starting point of the algorithm.
Definition: random_pivot_quick_sort.cpp:130
static void test()
Self-test implementations.
Definition: random_pivot_quick_sort.cpp:312
void showArray(std::array< int64_t, T > arr)
Utility function to print the array.
Definition: random_pivot_quick_sort.cpp:73
T size(T... args)
@@ -372,8 +371,8 @@ Here is the call graph for this function:
- -

◆ partition()

+ +

◆ partition()

@@ -381,7 +380,7 @@ Here is the call graph for this function:
template<size_t size>
std::array<int64_t, size> sorting::random_pivot_quick_sort::generateUnsortedArray std::array< int64_t, size > sorting::random_pivot_quick_sort::generateUnsortedArray ( int64_t  from,
- + @@ -420,36 +419,36 @@ template<size_t size>
std::tuple<int64_t, std::array<int64_t, size> > sorting::random_pivot_quick_sort::partition std::tuple< int64_t, std::array< int64_t, size > > sorting::random_pivot_quick_sort::partition ( std::array< int64_t, size >  arr,
-
Returns
std::tuple<int64_t , std::array<int64_t , size>> A tuple of pivot index and pivot sorted array.
-
104  {
-
105  int64_t pivot = arr[end]; // Randomly selected element will be here from
-
106  // caller function (quickSortRP()).
-
107  int64_t pInd = start;
-
108 
-
109  for (int64_t i = start; i < end; i++) {
-
110  if (arr[i] <= pivot) {
-
111  std::swap(arr[i], arr[pInd]); // swapping the elements from current
-
112  // index to pInd.
-
113  pInd++;
-
114  }
-
115  }
-
116  std::swap(arr[pInd],
-
117  arr[end]); // swapping the pivot element to its sorted position
-
118  return std::make_tuple(pInd, arr);
-
119 }
+
Returns
std::tuple<int64_t , std::array<int64_t , size>> A tuple of pivot index and pivot sorted array.
+
104 {
+
105 int64_t pivot = arr[end]; // Randomly selected element will be here from
+
106 // caller function (quickSortRP()).
+
107 int64_t pInd = start;
+
108
+
109 for (int64_t i = start; i < end; i++) {
+
110 if (arr[i] <= pivot) {
+
111 std::swap(arr[i], arr[pInd]); // swapping the elements from current
+
112 // index to pInd.
+
113 pInd++;
+
114 }
+
115 }
+
116 std::swap(arr[pInd],
+
117 arr[end]); // swapping the pivot element to its sorted position
+
118 return std::make_tuple(pInd, arr);
+
119}
T make_tuple(T... args)
T swap(T... args)
Here is the call graph for this function:
-
+
- -

◆ quickSortRP()

+ +

◆ quickSortRP()

@@ -457,7 +456,7 @@ Here is the call graph for this function:
template<size_t size>
- + @@ -497,39 +496,39 @@ template<size_t size>
Returns
std::array<int64_t , size> A fully sorted array in ascending order.
-
131  {
-
132  if (start < end) {
-
133  int64_t randomIndex = getRandomIndex(start, end);
-
134 
-
135  // switching the pivot with right most bound.
-
136  std::swap(arr[end], arr[randomIndex]);
-
137 
-
138  int64_t pivotIndex = 0;
-
139  // getting pivot index and pivot sorted array.
-
140  std::tie(pivotIndex, arr) = partition(arr, start, end);
-
141 
-
142  // Recursively calling
-
143  std::array<int64_t, arr.size()> rightSortingLeft =
-
144  quickSortRP(arr, start, pivotIndex - 1);
-
145  std::array<int64_t, arr.size()> full_sorted =
-
146  quickSortRP(rightSortingLeft, pivotIndex + 1, end);
-
147  arr = full_sorted;
-
148  }
-
149  return arr;
-
150 }
+
131 {
+
132 if (start < end) {
+
133 int64_t randomIndex = getRandomIndex(start, end);
+
134
+
135 // switching the pivot with right most bound.
+
136 std::swap(arr[end], arr[randomIndex]);
+
137
+
138 int64_t pivotIndex = 0;
+
139 // getting pivot index and pivot sorted array.
+
140 std::tie(pivotIndex, arr) = partition(arr, start, end);
+
141
+
142 // Recursively calling
+
143 std::array<int64_t, arr.size()> rightSortingLeft =
+
144 quickSortRP(arr, start, pivotIndex - 1);
+
145 std::array<int64_t, arr.size()> full_sorted =
+
146 quickSortRP(rightSortingLeft, pivotIndex + 1, end);
+
147 arr = full_sorted;
+
148 }
+
149 return arr;
+
150}
T partition(T... args)
int64_t getRandomIndex(int64_t start, int64_t end)
Takes the start and end indices of an array and returns a random int64_teger between the range of tho...
Definition: random_pivot_quick_sort.cpp:88
T tie(T... args)
Here is the call graph for this function:
-
+
- +

◆ showArray()

@@ -561,12 +560,12 @@ template<size_t T>
Returns
void
-
73  {
-
74  for (int64_t i = 0; i < arr.size(); i++) {
-
75  std::cout << arr[i] << " ";
-
76  }
- -
78 }
+
73 {
+
74 for (int64_t i = 0; i < arr.size(); i++) {
+
75 std::cout << arr[i] << " ";
+
76 }
+ +
78}
Here is the call graph for this function:
@@ -576,7 +575,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -601,10 +600,10 @@ Here is the call graph for this function:

Self-test implementations.

Returns
void
-
312  {
-
313  TestCases tc = TestCases();
-
314  tc.runTests();
-
315 }
+
312 {
+
313 TestCases tc = TestCases();
+
314 tc.runTests();
+
315}
class encapsulating the necessary test cases
Definition: inorder_successor_of_bst.cpp:225
void runTests()
Executes test cases.
Definition: inorder_successor_of_bst.cpp:243
@@ -622,7 +621,7 @@ Here is the call graph for this function:
diff --git a/d1/daa/random__pivot__quick__sort_8cpp.js b/d1/daa/random__pivot__quick__sort_8cpp.js index 1515af380..f87da1b8c 100644 --- a/d1/daa/random__pivot__quick__sort_8cpp.js +++ b/d1/daa/random__pivot__quick__sort_8cpp.js @@ -1,11 +1,11 @@ var random__pivot__quick__sort_8cpp = [ [ "TestCases", "d5/d58/class_test_cases.html", "d5/d58/class_test_cases" ], - [ "generateUnsortedArray", "d1/daa/random__pivot__quick__sort_8cpp.html#ad29ec5b3d242892675ba76acad5300a3", null ], + [ "generateUnsortedArray", "d1/daa/random__pivot__quick__sort_8cpp.html#a40675d2eb960c71ca31ec475ba90120d", null ], [ "getRandomIndex", "d1/daa/random__pivot__quick__sort_8cpp.html#aac5657b4fe2251cd21073f44233f6ea5", null ], [ "main", "d1/daa/random__pivot__quick__sort_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ], - [ "partition", "d1/daa/random__pivot__quick__sort_8cpp.html#a80fcb0b18a1ff5588bb00c0ff3b7fb49", null ], - [ "quickSortRP", "d1/daa/random__pivot__quick__sort_8cpp.html#a5c8eb5c4cb149b2f6c92582169532e92", null ], + [ "partition", "d1/daa/random__pivot__quick__sort_8cpp.html#a3d1c39e1ff42c04fb8ec0c0b9411cd3e", null ], + [ "quickSortRP", "d1/daa/random__pivot__quick__sort_8cpp.html#a7d2e7465e7b5d54c2de6d5e9db1ea6a5", null ], [ "showArray", "d1/daa/random__pivot__quick__sort_8cpp.html#ac3281dc34a9cfd7beb332419b8a0aa10", null ], [ "test", "d1/daa/random__pivot__quick__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/d1/daa/random__pivot__quick__sort_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d1/daa/random__pivot__quick__sort_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg index 047163926..1c5dac4c9 100644 --- a/d1/daa/random__pivot__quick__sort_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg +++ b/d1/daa/random__pivot__quick__sort_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -1,7 +1,7 @@ - diff --git a/d1/daa/random__pivot__quick__sort_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg b/d1/daa/random__pivot__quick__sort_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg index ae58aa686..cfe08367e 100644 --- a/d1/daa/random__pivot__quick__sort_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg +++ b/d1/daa/random__pivot__quick__sort_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - - diff --git a/d1/daa/random__pivot__quick__sort_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg b/d1/daa/random__pivot__quick__sort_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg index ceccd406a..7df869692 100644 --- a/d1/daa/random__pivot__quick__sort_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg +++ b/d1/daa/random__pivot__quick__sort_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - - - + + Algorithms_in_C++: compare Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
std::array<int64_t, size> sorting::random_pivot_quick_sort::quickSortRP std::array< int64_t, size > sorting::random_pivot_quick_sort::quickSortRP ( std::array< int64_t, size >  arr,
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,17 +93,55 @@ $(document).ready(function(){initNavTree('d1/db3/structcompare.html','../../'); -
-
compare Struct Reference
+
compare Struct Reference
- - +

+

Public Member Functions

-bool operator() (MinHeapNode *l, MinHeapNode *r)
bool operator() (MinHeapNode *l, MinHeapNode *r)
 
+

Member Function Documentation

+ +

◆ operator()()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool compare::operator() (MinHeapNodel,
MinHeapNoder 
)
+
+inline
+
+
31 {
+
32 return (l->freq > r->freq);
+
33 }
+
+
+

The documentation for this struct was generated from the following file:
  • greedy_algorithms/huffman.cpp
@@ -113,7 +151,7 @@ bool 
operator() (
    - +
diff --git a/d1/db3/structcompare.js b/d1/db3/structcompare.js deleted file mode 100644 index 07fcbfaef..000000000 --- a/d1/db3/structcompare.js +++ /dev/null @@ -1,4 +0,0 @@ -var structcompare = -[ - [ "operator()", "d1/db3/structcompare.html#a8471ed92f607eeb23021dc4afde9bae0", null ] -]; \ No newline at end of file diff --git a/d1/dbb/n__choose__r_8cpp.html b/d1/dbb/n__choose__r_8cpp.html index 2909ea7c0..6e5234691 100644 --- a/d1/dbb/n__choose__r_8cpp.html +++ b/d1/dbb/n__choose__r_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: math/n_choose_r.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d1/dbb/n__choose__r_8cpp.html','../../ -
-
n_choose_r.cpp File Reference
+
n_choose_r.cpp File Reference
-

Combinations n choose r function implementation +

Combinations n choose r function implementation More...

#include <cassert>
#include <iostream>
@@ -109,13 +108,13 @@ Include dependency graph for n_choose_r.cpp:
- - +

+

Namespaces

 math
namespace  math
 for IO operations
 
- @@ -129,11 +128,11 @@ Functions

+

Functions

template<class T >
math::n_choose_r (T n, T r)
 

Detailed Description

-

Combinations n choose r function implementation

-

A very basic and efficient method of calculating choosing r from n different choices. \( \binom{n}{r} = \frac{n!}{r! (n-r)!} \)

-
Author
Tajmeet Singh
+

Combinations n choose r function implementation

+

A very basic and efficient method of calculating choosing r from n different choices. \( \binom{n}{r} = \frac{n!}{r! (n-r)!} \)

+
Author
Tajmeet Singh

Function Documentation

- +

◆ main()

@@ -168,10 +167,10 @@ Functions
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d1/dbe/lu__decomposition_8h.html','../ -
-
lu_decomposition.h File Reference
+
lu_decomposition.h File Reference
-

Functions associated with LU Decomposition of a square matrix. +

Functions associated with LU Decomposition of a square matrix. More...

#include <iostream>
#include <valarray>
@@ -118,13 +117,13 @@ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

-

+

Typedefs

template<typename T >
using matrix = std::vector< std::valarray< T > >
 
- @@ -134,10 +133,10 @@ Functions

+

Functions

template<typename T >
int lu_decomposition (const matrix< T > &A, matrix< double > *L, matrix< double > *U)
 

Detailed Description

-

Functions associated with LU Decomposition of a square matrix.

-
Author
Krishna Vedala
+

Functions associated with LU Decomposition of a square matrix.

+
Author
Krishna Vedala

Typedef Documentation

- +

◆ matrix

@@ -150,12 +149,12 @@ template<typename T >
-

Define matrix type as a std::vector of std::valarray

+

Define matrix type as a std::vector of std::valarray

Function Documentation

- +

◆ determinant_lu()

@@ -172,7 +171,7 @@ template<typename T >
-

Compute determinant of an NxN square matrix using LU decomposition. Using LU decomposition, the determinant is given by the product of diagonal elements of matrices L and U.

+

Compute determinant of an NxN square matrix using LU decomposition. Using LU decomposition, the determinant is given by the product of diagonal elements of matrices L and U.

Template Parameters
@@ -186,23 +185,23 @@ template<typename T >
Returns
determinant of matrix A
-
90  {
- - -
93 
-
94  if (lu_decomposition(A, &L, &U) < 0)
-
95  return 0;
-
96 
-
97  double result = 1.f;
-
98  for (size_t i = 0; i < A.size(); i++) {
-
99  result *= L[i][i] * U[i][i];
-
100  }
-
101  return result;
-
102 }
+
90 {
+ + +
93
+
94 if (lu_decomposition(A, &L, &U) < 0)
+
95 return 0;
+
96
+
97 double result = 1.f;
+
98 for (size_t i = 0; i < A.size(); i++) {
+
99 result *= L[i][i] * U[i][i];
+
100 }
+
101 return result;
+
102}
uint64_t result(uint64_t n)
Definition: fibonacci_sum.cpp:76
int lu_decomposition(const matrix< T > &A, matrix< double > *L, matrix< double > *U)
Definition: lu_decomposition.h:29
T size(T... args)
- +
Here is the call graph for this function:
@@ -213,7 +212,7 @@ Here is the call graph for this function:
- +

◆ lu_decomposition()

@@ -246,7 +245,7 @@ template<typename T >
Tdatatype of input matrix - int, unsigned int, double, etc
-

Perform LU decomposition on matrix

Parameters
+

Perform LU decomposition on matrix

Parameters
@@ -257,56 +256,56 @@ template<typename T >
Returns
0 if no errors
negative if error occurred
-
29  {
-
30  int row, col, j;
-
31  int mat_size = A.size();
-
32 
-
33  if (mat_size != A[0].size()) {
-
34  // check matrix is a square matrix
-
35  std::cerr << "Not a square matrix!\n";
-
36  return -1;
-
37  }
-
38 
-
39  // regularize each row
-
40  for (row = 0; row < mat_size; row++) {
-
41  // Upper triangular matrix
-
42 #ifdef _OPENMP
-
43 #pragma omp for
-
44 #endif
-
45  for (col = row; col < mat_size; col++) {
-
46  // Summation of L[i,j] * U[j,k]
-
47  double lu_sum = 0.;
-
48  for (j = 0; j < row; j++) {
-
49  lu_sum += L[0][row][j] * U[0][j][col];
-
50  }
-
51 
-
52  // Evaluate U[i,k]
-
53  U[0][row][col] = A[row][col] - lu_sum;
-
54  }
-
55 
-
56  // Lower triangular matrix
-
57 #ifdef _OPENMP
-
58 #pragma omp for
-
59 #endif
-
60  for (col = row; col < mat_size; col++) {
-
61  if (row == col) {
-
62  L[0][row][col] = 1.;
-
63  continue;
-
64  }
-
65 
-
66  // Summation of L[i,j] * U[j,k]
-
67  double lu_sum = 0.;
-
68  for (j = 0; j < row; j++) {
-
69  lu_sum += L[0][col][j] * U[0][j][row];
-
70  }
-
71 
-
72  // Evaluate U[i,k]
-
73  L[0][col][row] = (A[col][row] - lu_sum) / U[0][row][row];
-
74  }
-
75  }
-
76 
-
77  return 0;
-
78 }
+
29 {
+
30 int row, col, j;
+
31 int mat_size = A.size();
+
32
+
33 if (mat_size != A[0].size()) {
+
34 // check matrix is a square matrix
+
35 std::cerr << "Not a square matrix!\n";
+
36 return -1;
+
37 }
+
38
+
39 // regularize each row
+
40 for (row = 0; row < mat_size; row++) {
+
41 // Upper triangular matrix
+
42#ifdef _OPENMP
+
43#pragma omp for
+
44#endif
+
45 for (col = row; col < mat_size; col++) {
+
46 // Summation of L[i,j] * U[j,k]
+
47 double lu_sum = 0.;
+
48 for (j = 0; j < row; j++) {
+
49 lu_sum += L[0][row][j] * U[0][j][col];
+
50 }
+
51
+
52 // Evaluate U[i,k]
+
53 U[0][row][col] = A[row][col] - lu_sum;
+
54 }
+
55
+
56 // Lower triangular matrix
+
57#ifdef _OPENMP
+
58#pragma omp for
+
59#endif
+
60 for (col = row; col < mat_size; col++) {
+
61 if (row == col) {
+
62 L[0][row][col] = 1.;
+
63 continue;
+
64 }
+
65
+
66 // Summation of L[i,j] * U[j,k]
+
67 double lu_sum = 0.;
+
68 for (j = 0; j < row; j++) {
+
69 lu_sum += L[0][col][j] * U[0][j][row];
+
70 }
+
71
+
72 // Evaluate U[i,k]
+
73 L[0][col][row] = (A[col][row] - lu_sum) / U[0][row][row];
+
74 }
+
75 }
+
76
+
77 return 0;
+
78}
ll mat_size
Definition: matrix_exponentiation.cpp:45
@@ -324,7 +323,7 @@ Here is the call graph for this function:
diff --git a/d1/dbe/lu__decomposition_8h_a3108d43bd32c6fb3b3c158476c51ba7f_cgraph.svg b/d1/dbe/lu__decomposition_8h_a3108d43bd32c6fb3b3c158476c51ba7f_cgraph.svg index f97644e97..f4e31cfbd 100644 --- a/d1/dbe/lu__decomposition_8h_a3108d43bd32c6fb3b3c158476c51ba7f_cgraph.svg +++ b/d1/dbe/lu__decomposition_8h_a3108d43bd32c6fb3b3c158476c51ba7f_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: numerical_methods/lu_decomposition.h Source File @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
[in]Amatrix to decompose
[out]Loutput L matrix
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,118 +90,117 @@ $(document).ready(function(){initNavTree('d1/dbe/lu__decomposition_8h_source.htm
-
-
lu_decomposition.h
+
lu_decomposition.h
-Go to the documentation of this file.
1 /**
-
2  * @file lu_decomposition.h
-
3  * @author [Krishna Vedala](https://github.com/kvedala)
-
4  * @brief Functions associated with [LU
-
5  * Decomposition](https://en.wikipedia.org/wiki/LU_decomposition)
-
6  * of a square matrix.
-
7  */
-
8 #pragma once
-
9 
-
10 #include <iostream>
-
11 #include <valarray>
-
12 #include <vector>
-
13 #ifdef _OPENMP
-
14 #include <omp.h>
-
15 #endif
-
16 
-
17 /** Define matrix type as a `std::vector` of `std::valarray` */
-
18 template <typename T>
- -
20 
-
21 /** Perform LU decomposition on matrix
-
22  * \param[in] A matrix to decompose
-
23  * \param[out] L output L matrix
-
24  * \param[out] U output U matrix
-
25  * \returns 0 if no errors
-
26  * \returns negative if error occurred
-
27  */
-
28 template <typename T>
- -
30  int row, col, j;
-
31  int mat_size = A.size();
-
32 
-
33  if (mat_size != A[0].size()) {
-
34  // check matrix is a square matrix
-
35  std::cerr << "Not a square matrix!\n";
-
36  return -1;
-
37  }
-
38 
-
39  // regularize each row
-
40  for (row = 0; row < mat_size; row++) {
-
41  // Upper triangular matrix
-
42 #ifdef _OPENMP
-
43 #pragma omp for
-
44 #endif
-
45  for (col = row; col < mat_size; col++) {
-
46  // Summation of L[i,j] * U[j,k]
-
47  double lu_sum = 0.;
-
48  for (j = 0; j < row; j++) {
-
49  lu_sum += L[0][row][j] * U[0][j][col];
-
50  }
-
51 
-
52  // Evaluate U[i,k]
-
53  U[0][row][col] = A[row][col] - lu_sum;
-
54  }
-
55 
-
56  // Lower triangular matrix
-
57 #ifdef _OPENMP
-
58 #pragma omp for
-
59 #endif
-
60  for (col = row; col < mat_size; col++) {
-
61  if (row == col) {
-
62  L[0][row][col] = 1.;
-
63  continue;
-
64  }
-
65 
-
66  // Summation of L[i,j] * U[j,k]
-
67  double lu_sum = 0.;
-
68  for (j = 0; j < row; j++) {
-
69  lu_sum += L[0][col][j] * U[0][j][row];
-
70  }
-
71 
-
72  // Evaluate U[i,k]
-
73  L[0][col][row] = (A[col][row] - lu_sum) / U[0][row][row];
-
74  }
-
75  }
-
76 
-
77  return 0;
-
78 }
-
79 
-
80 /**
-
81  * Compute determinant of an NxN square matrix using LU decomposition.
-
82  * Using LU decomposition, the determinant is given by the product of diagonal
-
83  * elements of matrices L and U.
-
84  *
-
85  * @tparam T datatype of input matrix - int, unsigned int, double, etc
-
86  * @param A input square matrix
-
87  * @return determinant of matrix A
-
88  */
-
89 template <typename T>
-
90 double determinant_lu(const matrix<T> &A) {
- - -
93 
-
94  if (lu_decomposition(A, &L, &U) < 0)
-
95  return 0;
-
96 
-
97  double result = 1.f;
-
98  for (size_t i = 0; i < A.size(); i++) {
-
99  result *= L[i][i] * U[i][i];
-
100  }
-
101  return result;
-
102 }
+Go to the documentation of this file.
1/**
+
2 * @file lu_decomposition.h
+
3 * @author [Krishna Vedala](https://github.com/kvedala)
+
4 * @brief Functions associated with [LU
+
5 * Decomposition](https://en.wikipedia.org/wiki/LU_decomposition)
+
6 * of a square matrix.
+
7 */
+
8#pragma once
+
9
+
10#include <iostream>
+
11#include <valarray>
+
12#include <vector>
+
13#ifdef _OPENMP
+
14#include <omp.h>
+
15#endif
+
16
+
17/** Define matrix type as a `std::vector` of `std::valarray` */
+
18template <typename T>
+ +
20
+
21/** Perform LU decomposition on matrix
+
22 * \param[in] A matrix to decompose
+
23 * \param[out] L output L matrix
+
24 * \param[out] U output U matrix
+
25 * \returns 0 if no errors
+
26 * \returns negative if error occurred
+
27 */
+
28template <typename T>
+ +
30 int row, col, j;
+
31 int mat_size = A.size();
+
32
+
33 if (mat_size != A[0].size()) {
+
34 // check matrix is a square matrix
+
35 std::cerr << "Not a square matrix!\n";
+
36 return -1;
+
37 }
+
38
+
39 // regularize each row
+
40 for (row = 0; row < mat_size; row++) {
+
41 // Upper triangular matrix
+
42#ifdef _OPENMP
+
43#pragma omp for
+
44#endif
+
45 for (col = row; col < mat_size; col++) {
+
46 // Summation of L[i,j] * U[j,k]
+
47 double lu_sum = 0.;
+
48 for (j = 0; j < row; j++) {
+
49 lu_sum += L[0][row][j] * U[0][j][col];
+
50 }
+
51
+
52 // Evaluate U[i,k]
+
53 U[0][row][col] = A[row][col] - lu_sum;
+
54 }
+
55
+
56 // Lower triangular matrix
+
57#ifdef _OPENMP
+
58#pragma omp for
+
59#endif
+
60 for (col = row; col < mat_size; col++) {
+
61 if (row == col) {
+
62 L[0][row][col] = 1.;
+
63 continue;
+
64 }
+
65
+
66 // Summation of L[i,j] * U[j,k]
+
67 double lu_sum = 0.;
+
68 for (j = 0; j < row; j++) {
+
69 lu_sum += L[0][col][j] * U[0][j][row];
+
70 }
+
71
+
72 // Evaluate U[i,k]
+
73 L[0][col][row] = (A[col][row] - lu_sum) / U[0][row][row];
+
74 }
+
75 }
+
76
+
77 return 0;
+
78}
+
79
+
80/**
+
81 * Compute determinant of an NxN square matrix using LU decomposition.
+
82 * Using LU decomposition, the determinant is given by the product of diagonal
+
83 * elements of matrices L and U.
+
84 *
+
85 * @tparam T datatype of input matrix - int, unsigned int, double, etc
+
86 * @param A input square matrix
+
87 * @return determinant of matrix A
+
88 */
+
89template <typename T>
+
90double determinant_lu(const matrix<T> &A) {
+ + +
93
+
94 if (lu_decomposition(A, &L, &U) < 0)
+
95 return 0;
+
96
+
97 double result = 1.f;
+
98 for (size_t i = 0; i < A.size(); i++) {
+
99 result *= L[i][i] * U[i][i];
+
100 }
+
101 return result;
+
102}
double determinant_lu(const matrix< T > &A)
Definition: lu_decomposition.h:90
int lu_decomposition(const matrix< T > &A, matrix< double > *L, matrix< double > *U)
Definition: lu_decomposition.h:29
ll mat_size
Definition: matrix_exponentiation.cpp:45
T size(T... args)
- +
@@ -209,7 +208,7 @@ $(document).ready(function(){initNavTree('d1/dbe/lu__decomposition_8h_source.htm diff --git a/d1/dc0/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node-members.html b/d1/dc0/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node-members.html index 9f129e4c3..9f3f089ac 100644 --- a/d1/dc0/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node-members.html +++ b/d1/dc0/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d5/db5/classoperations__on__datastruct
-
-
operations_on_datastructures::inorder_traversal_of_bst::Node Member List
+
operations_on_datastructures::inorder_traversal_of_bst::Node Member List
diff --git a/d1/dc2/class_graph__coll__graph.map b/d1/dc2/class_graph__coll__graph.map index e1f8a35ba..6ef9133d2 100644 --- a/d1/dc2/class_graph__coll__graph.map +++ b/d1/dc2/class_graph__coll__graph.map @@ -1,11 +1,6 @@ - - - - - - - - - + + + + diff --git a/d1/dc2/class_graph__coll__graph.md5 b/d1/dc2/class_graph__coll__graph.md5 index fc9294efe..ce65fe1c9 100644 --- a/d1/dc2/class_graph__coll__graph.md5 +++ b/d1/dc2/class_graph__coll__graph.md5 @@ -1 +1 @@ -6f05d770f3cfca949dd8074d8313e07e \ No newline at end of file +02f728180ea5163b348e1e4c49e0431c \ No newline at end of file diff --git a/d1/dc2/class_graph__coll__graph.svg b/d1/dc2/class_graph__coll__graph.svg index e3bf79b57..a8c55db3d 100644 --- a/d1/dc2/class_graph__coll__graph.svg +++ b/d1/dc2/class_graph__coll__graph.svg @@ -1,164 +1,73 @@ - - - + + Graph - + Node1 - -Graph + +Graph Node2 - - -std::map< unsigned - int, std::vector< unsigned - int > > + + +Edge Node2->Node1 - - - m_adjList + + + edges Node3 - - -std::vector< unsigned - int > + + +std::map< unsigned + int, std::vector< unsigned + int > > - + -Node3->Node2 - - - elements +Node3->Node1 + + + m_adjList Node4 - -std::vector< std::vector -< int > > + +std::vector< unsigned + int > - + -Node4->Node1 - - - capacity -residual_capacity - - - -Node5 - - -std::vector< int > - - - - - -Node5->Node1 - - - parent - - - -Node5->Node4 - - - elements - - - -Node6 - - -std::bitset< MAXN > - - - - - -Node6->Node1 - - - visited - - - -Node7 - - -std::vector< std::tuple -< int, int, int > > - - - - - -Node7->Node1 - - - edge_participated - - - -Node8 - - -std::tuple< int, int, - int > - - - - - -Node8->Node7 - - - elements - - - -Node9 - - -Edge - - - - - -Node9->Node1 - - - edges +Node4->Node3 + + + elements diff --git a/d1/dc2/classstack.html b/d1/dc2/classstack.html index ba1587fa6..34cc37bbd 100644 --- a/d1/dc2/classstack.html +++ b/d1/dc2/classstack.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: stack< Type > Class Template Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,20 +94,13 @@ $(document).ready(function(){initNavTree('d1/dc2/classstack.html','../../'); ini Public Member Functions | Private Attributes | List of all members -
-
stack< Type > Class Template Reference
+
stack< Type > Class Template Reference

#include <stack.h>

-
-Collaboration diagram for stack< Type >:
-
-
-
-
[legend]
- @@ -127,30 +120,28 @@ Public Member Functions - - + +

+

Public Member Functions

void display ()
 
 
void clear ()
 
stack< Type > & operator= (const stack< Type > &otherStack)
 
stack< Type > & operator= (const stack< Type > &otherStack)
 
- - +

+

Private Attributes

node< Type > * stackTop
 
-int size
+int size
 size of stack
 

Detailed Description

-

template<class Type>
-class stack< Type >

- -

Definition of the stack class

Template Parameters
+
template<class Type>
+class stack< Type >

Definition of the stack class

Template Parameters
Typetype of data nodes of the linked list in the stack should contain

Constructor & Destructor Documentation

- +

◆ stack() [1/2]

@@ -174,17 +165,17 @@ template<class Type >
-

Default constructor

-
41  {
-
42  stackTop = nullptr;
-
43  size = 0;
-
44  }
+

Default constructor

+
41 {
+
42 stackTop = nullptr;
+
43 size = 0;
+
44 }
node< Type > * stackTop
Definition: stack.h:146
int size
size of stack
Definition: stack.h:147
- +

◆ stack() [2/2]

@@ -209,40 +200,40 @@ template<class Type >
-

Copy constructor

-
47  {
-
48  node<Type> *newNode, *current, *last;
-
49 
-
50  /* If stack is no empty, make it empty */
-
51  if (stackTop != nullptr) {
-
52  stackTop = nullptr;
-
53  }
-
54  if (otherStack.stackTop == nullptr) {
-
55  stackTop = nullptr;
-
56  } else {
-
57  current = otherStack.stackTop;
-
58  stackTop = new node<Type>;
-
59  stackTop->data = current->data;
-
60  stackTop->next = nullptr;
-
61  last = stackTop;
-
62  current = current->next;
-
63  /* Copy the remaining stack */
-
64  while (current != nullptr) {
-
65  newNode = new node<Type>;
-
66  newNode->data = current->data;
-
67  newNode->next = nullptr;
-
68  last->next = newNode;
-
69  last = newNode;
-
70  current = current->next;
-
71  }
-
72  }
-
73  size = otherStack.size;
-
74  }
- +

Copy constructor

+
47 {
+
48 node<Type> *newNode, *current, *last;
+
49
+
50 /* If stack is no empty, make it empty */
+
51 if (stackTop != nullptr) {
+
52 stackTop = nullptr;
+
53 }
+
54 if (otherStack.stackTop == nullptr) {
+
55 stackTop = nullptr;
+
56 } else {
+
57 current = otherStack.stackTop;
+
58 stackTop = new node<Type>;
+
59 stackTop->data = current->data;
+
60 stackTop->next = nullptr;
+
61 last = stackTop;
+
62 current = current->next;
+
63 /* Copy the remaining stack */
+
64 while (current != nullptr) {
+
65 newNode = new node<Type>;
+
66 newNode->data = current->data;
+
67 newNode->next = nullptr;
+
68 last->next = newNode;
+
69 last = newNode;
+
70 current = current->next;
+
71 }
+
72 }
+
73 size = otherStack.size;
+
74 }
+
Definition: avltree.cpp:13
- +

◆ ~stack()

@@ -266,13 +257,13 @@ template<class Type >
-

Destructor

-
77 {}
+

Destructor

+
77{}

Member Function Documentation

- +

◆ clear()

@@ -296,12 +287,12 @@ template<class Type >
-

Clear stack

-
112 { stackTop = nullptr; }
+

Clear stack

+
112{ stackTop = nullptr; }
- +

◆ display()

@@ -325,17 +316,17 @@ template<class Type >
-

Show stack

-
29  {
-
30  node<Type> *current = stackTop;
-
31  std::cout << "Top --> ";
-
32  while (current != nullptr) {
-
33  std::cout << current->data << " ";
-
34  current = current->next;
-
35  }
- -
37  std::cout << "Size of stack: " << size << std::endl;
-
38  }
+

Show stack

+
29 {
+
30 node<Type> *current = stackTop;
+
31 std::cout << "Top --> ";
+
32 while (current != nullptr) {
+
33 std::cout << current->data << " ";
+
34 current = current->next;
+
35 }
+ +
37 std::cout << "Size of stack: " << size << std::endl;
+
38 }
T endl(T... args)
@@ -347,7 +338,7 @@ Here is the call graph for this function:
- +

◆ isEmptyStack()

@@ -371,13 +362,13 @@ template<class Type >
-

Determine whether the stack is empty

-
80 { return (stackTop == nullptr); }
+

Determine whether the stack is empty

+
80{ return (stackTop == nullptr); }
- -

◆ operator=()

+ +

◆ operator=()

@@ -388,7 +379,7 @@ template<class Type >
- + @@ -401,40 +392,40 @@ template<class Type >
stack<Type>& stack< Type >::operator= stack< Type > & stack< Type >::operator= ( const stack< Type > &  otherStack)
-

Overload "=" the assignment operator

-
115  {
-
116  node<Type> *newNode, *current, *last;
-
117 
-
118  /* If stack is no empty, make it empty */
-
119  if (stackTop != nullptr) {
-
120  stackTop = nullptr;
-
121  }
-
122  if (otherStack.stackTop == nullptr) {
-
123  stackTop = nullptr;
-
124  } else {
-
125  current = otherStack.stackTop;
-
126  stackTop = new node<Type>;
-
127  stackTop->data = current->data;
-
128  stackTop->next = nullptr;
-
129  last = stackTop;
-
130  current = current->next;
-
131  /* Copy the remaining stack */
-
132  while (current != nullptr) {
-
133  newNode = new node<Type>;
-
134  newNode->data = current->data;
-
135  newNode->next = nullptr;
-
136  last->next = newNode;
-
137  last = newNode;
-
138  current = current->next;
-
139  }
-
140  }
-
141  size = otherStack.size;
-
142  return *this;
-
143  }
+

Overload "=" the assignment operator

+
115 {
+
116 node<Type> *newNode, *current, *last;
+
117
+
118 /* If stack is no empty, make it empty */
+
119 if (stackTop != nullptr) {
+
120 stackTop = nullptr;
+
121 }
+
122 if (otherStack.stackTop == nullptr) {
+
123 stackTop = nullptr;
+
124 } else {
+
125 current = otherStack.stackTop;
+
126 stackTop = new node<Type>;
+
127 stackTop->data = current->data;
+
128 stackTop->next = nullptr;
+
129 last = stackTop;
+
130 current = current->next;
+
131 /* Copy the remaining stack */
+
132 while (current != nullptr) {
+
133 newNode = new node<Type>;
+
134 newNode->data = current->data;
+
135 newNode->next = nullptr;
+
136 last->next = newNode;
+
137 last = newNode;
+
138 current = current->next;
+
139 }
+
140 }
+
141 size = otherStack.size;
+
142 return *this;
+
143 }
- +

◆ pop()

@@ -458,18 +449,18 @@ template<class Type >
-

Remove the top element of the stack

-
99  {
-
100  node<Type> *temp;
-
101  if (!isEmptyStack()) {
-
102  temp = stackTop;
-
103  stackTop = stackTop->next;
-
104  delete temp;
-
105  size--;
-
106  } else {
-
107  std::cout << "Stack is empty !" << std::endl;
-
108  }
-
109  }
+

Remove the top element of the stack

+
99 {
+
100 node<Type> *temp;
+
101 if (!isEmptyStack()) {
+
102 temp = stackTop;
+
103 stackTop = stackTop->next;
+
104 delete temp;
+
105 size--;
+
106 } else {
+
107 std::cout << "Stack is empty !" << std::endl;
+
108 }
+
109 }
bool isEmptyStack()
Definition: stack.h:80
Here is the call graph for this function:
@@ -480,7 +471,7 @@ Here is the call graph for this function:
- +

◆ push()

@@ -505,19 +496,19 @@ template<class Type >
-

Add new item to the stack

-
83  {
-
84  node<Type> *newNode;
-
85  newNode = new node<Type>;
-
86  newNode->data = item;
-
87  newNode->next = stackTop;
-
88  stackTop = newNode;
-
89  size++;
-
90  }
+

Add new item to the stack

+
83 {
+
84 node<Type> *newNode;
+
85 newNode = new node<Type>;
+
86 newNode->data = item;
+
87 newNode->next = stackTop;
+
88 stackTop = newNode;
+
89 size++;
+
90 }
- +

◆ top()

@@ -541,16 +532,16 @@ template<class Type >
-

Return the top element of the stack

-
93  {
-
94  assert(stackTop != nullptr);
-
95  return stackTop->data;
-
96  }
+

Return the top element of the stack

+
93 {
+
94 assert(stackTop != nullptr);
+
95 return stackTop->data;
+
96 }

Member Data Documentation

- +

◆ stackTop

@@ -571,7 +562,7 @@ template<class Type >
-

Pointer to the stack

+

Pointer to the stack

@@ -584,7 +575,7 @@ template<class Type > diff --git a/d1/dc2/classstack.js b/d1/dc2/classstack.js index ab23df053..5c68dbc82 100644 --- a/d1/dc2/classstack.js +++ b/d1/dc2/classstack.js @@ -6,7 +6,7 @@ var classstack = [ "clear", "d1/dc2/classstack.html#a5cc5efbbd4ea14b3e378580f1388423b", null ], [ "display", "d1/dc2/classstack.html#a67f65710c376f67d1ba3bde45a9cb628", null ], [ "isEmptyStack", "d1/dc2/classstack.html#a066e4505155b009913c47b2648b1067a", null ], - [ "operator=", "d1/dc2/classstack.html#a61370d5fbaf9ec6bca4a8c114c1058e1", null ], + [ "operator=", "d1/dc2/classstack.html#a2b4d767447067c8bebca791b747733a1", null ], [ "pop", "d1/dc2/classstack.html#a6cd4b95d5de00d41b2491392338384dc", null ], [ "push", "d1/dc2/classstack.html#a5705c3926dcf5fd3f9c964467a50b81d", null ], [ "top", "d1/dc2/classstack.html#a21c0bb6ce7dcfe445cc12031977ea344", null ], diff --git a/d1/dc2/classstack_a67f65710c376f67d1ba3bde45a9cb628_cgraph.svg b/d1/dc2/classstack_a67f65710c376f67d1ba3bde45a9cb628_cgraph.svg index 3b3310399..89c45a690 100644 --- a/d1/dc2/classstack_a67f65710c376f67d1ba3bde45a9cb628_cgraph.svg +++ b/d1/dc2/classstack_a67f65710c376f67d1ba3bde45a9cb628_cgraph.svg @@ -1,7 +1,7 @@ - - - - - diff --git a/d1/dc5/classlarge__number__coll__graph.md5 b/d1/dc5/classlarge__number__coll__graph.md5 deleted file mode 100644 index becda9998..000000000 --- a/d1/dc5/classlarge__number__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -c68087782a272b8630582c0797597137 \ No newline at end of file diff --git a/d1/dc5/classlarge__number__coll__graph.svg b/d1/dc5/classlarge__number__coll__graph.svg deleted file mode 100644 index d0de67915..000000000 --- a/d1/dc5/classlarge__number__coll__graph.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -large_number - - - -Node1 - - -large_number - - - - - -Node2 - - -std::vector< unsigned - char > - - - - - -Node2->Node1 - - - _digits - - - diff --git a/d1/dc7/linear__probing__hash__table_8cpp.html b/d1/dc7/linear__probing__hash__table_8cpp.html index 8b9e3f87f..34bede283 100644 --- a/d1/dc7/linear__probing__hash__table_8cpp.html +++ b/d1/dc7/linear__probing__hash__table_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: hashing/linear_probing_hash_table.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -96,12 +96,11 @@ $(document).ready(function(){initNavTree('d1/dc7/linear__probing__hash__table_8c Typedefs | Functions | Variables -
-
linear_probing_hash_table.cpp File Reference
+
linear_probing_hash_table.cpp File Reference
-

Storage mechanism using linear probing hash keys. +

Storage mechanism using linear probing hash keys. More...

#include <iostream>
#include <vector>
@@ -112,24 +111,24 @@ Include dependency graph for linear_probing_hash_table.cpp:
-

+

Classes

struct  linear_probing::Entry
 
- - - + +

+

Namespaces

 linear_probing
 An implementation of hash table using linear probing algorithm.
namespace  linear_probing
 An implementation of hash table using linear probing algorithm.
 
- - - + +

+

Typedefs

-using linear_probing::Entry = struct Entry
 
+using linear_probing::Entry = Entry
 
- @@ -155,35 +154,35 @@ Functions

+

Functions

bool linear_probing::putProber (const Entry &entry, int key)
 
int main ()
 
- - - - - - -

+

Variables

+
int linear_probing::notPresent
 
+
std::vector< Entrylinear_probing::table
 
+
int linear_probing::totalSize
 
+
int linear_probing::tomb = -1
 
+
int linear_probing::size
 
+
bool linear_probing::rehashing
 

Detailed Description

-

Storage mechanism using linear probing hash keys.

-
Author
achance6
+

Storage mechanism using linear probing hash keys.

+
Author
achance6
-Krishna Vedala
+Krishna Vedala
Note
The implementation can be optimized by using OOP style.

Function Documentation

- +

◆ main()

@@ -198,61 +197,61 @@ bool linear_probing::rehas
-

Main function

Returns
0 on success
-
224  {
-
225  int cmd = 0, hash = 0, key = 0;
-
226  std::cout << "Enter the initial size of Hash Table. = ";
-
227  std::cin >> totalSize;
-
228  table = std::vector<Entry>(totalSize);
-
229  bool loop = true;
-
230  while (loop) {
-
231  std::cout << std::endl;
-
232  std::cout << "PLEASE CHOOSE -" << std::endl;
-
233  std::cout << "1. Add key. (Numeric only)" << std::endl;
-
234  std::cout << "2. Remove key." << std::endl;
-
235  std::cout << "3. Find key." << std::endl;
-
236  std::cout << "4. Generate Hash. (Numeric only)" << std::endl;
-
237  std::cout << "5. Display Hash table." << std::endl;
-
238  std::cout << "6. Exit." << std::endl;
-
239  std::cin >> cmd;
-
240  switch (cmd) {
-
241  case 1:
-
242  std::cout << "Enter key to add = ";
-
243  std::cin >> key;
- -
245  break;
-
246  case 2:
-
247  std::cout << "Enter key to remove = ";
-
248  std::cin >> key;
- -
250  break;
-
251  case 3: {
-
252  std::cout << "Enter key to search = ";
-
253  std::cin >> key;
-
254  Entry entry = table[linear_probing::linearProbe(key, true)];
-
255  if (entry.key == linear_probing::notPresent) {
-
256  std::cout << "Key not present";
-
257  }
-
258  break;
-
259  }
-
260  case 4:
-
261  std::cout << "Enter element to generate hash = ";
-
262  std::cin >> key;
-
263  std::cout << "Hash of " << key
-
264  << " is = " << linear_probing::hashFxn(key);
-
265  break;
-
266  case 5:
- -
268  break;
-
269  default:
-
270  loop = false;
-
271  break;
-
272  // delete[] table;
-
273  }
-
274  std::cout << std::endl;
-
275  }
-
276  return 0;
-
277 }
+

Main function

Returns
0 on success
+
224 {
+
225 int cmd = 0, hash = 0, key = 0;
+
226 std::cout << "Enter the initial size of Hash Table. = ";
+
227 std::cin >> totalSize;
+
228 table = std::vector<Entry>(totalSize);
+
229 bool loop = true;
+
230 while (loop) {
+ +
232 std::cout << "PLEASE CHOOSE -" << std::endl;
+
233 std::cout << "1. Add key. (Numeric only)" << std::endl;
+
234 std::cout << "2. Remove key." << std::endl;
+
235 std::cout << "3. Find key." << std::endl;
+
236 std::cout << "4. Generate Hash. (Numeric only)" << std::endl;
+
237 std::cout << "5. Display Hash table." << std::endl;
+
238 std::cout << "6. Exit." << std::endl;
+
239 std::cin >> cmd;
+
240 switch (cmd) {
+
241 case 1:
+
242 std::cout << "Enter key to add = ";
+
243 std::cin >> key;
+ +
245 break;
+
246 case 2:
+
247 std::cout << "Enter key to remove = ";
+
248 std::cin >> key;
+ +
250 break;
+
251 case 3: {
+
252 std::cout << "Enter key to search = ";
+
253 std::cin >> key;
+
254 Entry entry = table[linear_probing::linearProbe(key, true)];
+
255 if (entry.key == linear_probing::notPresent) {
+
256 std::cout << "Key not present";
+
257 }
+
258 break;
+
259 }
+
260 case 4:
+
261 std::cout << "Enter element to generate hash = ";
+
262 std::cin >> key;
+
263 std::cout << "Hash of " << key
+
264 << " is = " << linear_probing::hashFxn(key);
+
265 break;
+
266 case 5:
+ +
268 break;
+
269 default:
+
270 loop = false;
+
271 break;
+
272 // delete[] table;
+
273 }
+ +
275 }
+
276 return 0;
+
277}
T endl(T... args)
@@ -273,7 +272,7 @@ bool linear_probing::rehas diff --git a/d1/dc7/linear__probing__hash__table_8cpp.js b/d1/dc7/linear__probing__hash__table_8cpp.js index ab88e2553..aed52176a 100644 --- a/d1/dc7/linear__probing__hash__table_8cpp.js +++ b/d1/dc7/linear__probing__hash__table_8cpp.js @@ -1,7 +1,6 @@ var linear__probing__hash__table_8cpp = [ - [ "Entry", "db/d19/structlinear__probing_1_1_entry.html", "db/d19/structlinear__probing_1_1_entry" ], - [ "Entry", "d1/dc7/linear__probing__hash__table_8cpp.html#a2de838f453df67b72411eefb7faf833c", null ], + [ "linear_probing::Entry", "db/d19/structlinear__probing_1_1_entry.html", "db/d19/structlinear__probing_1_1_entry" ], [ "add", "d1/dc7/linear__probing__hash__table_8cpp.html#a16d34fd3511626a83ab00665d7bc34d1", null ], [ "addInfo", "d1/dc7/linear__probing__hash__table_8cpp.html#a16680b8a37d442c2f208faa286e33908", null ], [ "display", "d1/dc7/linear__probing__hash__table_8cpp.html#ad87b71d810901fab69c4ad9d4d0fa635", null ], @@ -12,11 +11,5 @@ var linear__probing__hash__table_8cpp = [ "rehash", "d1/dc7/linear__probing__hash__table_8cpp.html#a6a082dc1426a79f866cee6b370df37b0", null ], [ "removalInfo", "d1/dc7/linear__probing__hash__table_8cpp.html#a75854f5aa216e61219154c62167ce8f0", null ], [ "remove", "d1/dc7/linear__probing__hash__table_8cpp.html#abcf8d033f8115f39f3c93cfb6cee0b28", null ], - [ "searchingProber", "d1/dc7/linear__probing__hash__table_8cpp.html#a942fc8407b8001890ea26830cdcd9d77", null ], - [ "notPresent", "d1/dc7/linear__probing__hash__table_8cpp.html#addfce7597f6a42f796fa597ae40eecc9", null ], - [ "rehashing", "d1/dc7/linear__probing__hash__table_8cpp.html#a5ff22c1a04290e24ef3ba3d6a3a06386", null ], - [ "size", "d1/dc7/linear__probing__hash__table_8cpp.html#a8e81b17f2f8403c982368da3dac1ae87", null ], - [ "table", "d1/dc7/linear__probing__hash__table_8cpp.html#acb1dc3f09cf07c2633580a1c46c9f0a8", null ], - [ "tomb", "d1/dc7/linear__probing__hash__table_8cpp.html#a62fbd519adacd4e05706f34a7e551288", null ], - [ "totalSize", "d1/dc7/linear__probing__hash__table_8cpp.html#a4fdb68db9f02ae4156e1845563004f8e", null ] + [ "searchingProber", "d1/dc7/linear__probing__hash__table_8cpp.html#a942fc8407b8001890ea26830cdcd9d77", null ] ]; \ No newline at end of file diff --git a/d1/dcc/wiggle__sort_8cpp.html b/d1/dcc/wiggle__sort_8cpp.html index 663d10c7b..e3332fed1 100644 --- a/d1/dcc/wiggle__sort_8cpp.html +++ b/d1/dcc/wiggle__sort_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: sorting/wiggle_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d1/dcc/wiggle__sort_8cpp.html','../../ -
-
wiggle_sort.cpp File Reference
+
wiggle_sort.cpp File Reference
-

Wiggle Sort Algorithm Implementation +

Wiggle Sort Algorithm Implementation More...

#include <algorithm>
#include <cassert>
@@ -112,21 +111,21 @@ Include dependency graph for wiggle_sort.cpp:
- - + - - + +

+

Namespaces

 sorting
namespace  sorting
 Sorting algorithms.
 
 wiggle_sort
 Functions for Wiggle Sort algorithm.
namespace  wiggle_sort
 Functions for Wiggle Sort algorithm.
 
- - - - - + + + + @@ -137,12 +136,12 @@ Functions

+

Functions

template<typename T >
std::vector< T > sorting::wiggle_sort::wiggleSort (const std::vector< T > &arr)
 Function used for sorting the elements in wave form. More...
 
template<typename T >
std::vector< T > sorting::wiggle_sort::wiggleSort (const std::vector< T > &arr)
 Function used for sorting the elements in wave form. More...
 
template<typename T >
static void displayElements (const std::vector< T > &arr)
 Utility function used for printing the elements. Prints elements of the array after they're sorted using wiggle sort algorithm. More...
 

Detailed Description

-

Wiggle Sort Algorithm Implementation

-
Author
Roshan Kanwar
+

Wiggle Sort Algorithm Implementation

+
Author
Roshan Kanwar

Wiggle Sort sorts the array into a wave like array. An array ‘arr[0..n-1]’ is sorted in wave form, if arr[0] >= arr[1] <= arr[2] >= arr[3] <= arr[4] >= …..

Function Documentation

- -

◆ wiggleSort()

+ +

◆ wiggleSort()

@@ -150,7 +149,7 @@ Functions template<typename T >
- + @@ -160,7 +159,7 @@ template<typename T >

Function used for sorting the elements in wave form.

-

Checking whether the even indexed elements are greater than their adjacent odd elements. Traversing all even indexed elements of the input arr. If current element is smaller than the previous odd element, swap them. If current element is smaller than the next odd element, swap them.

+

Checking whether the even indexed elements are greater than their adjacent odd elements. Traversing all even indexed elements of the input arr. If current element is smaller than the previous odd element, swap them. If current element is smaller than the next odd element, swap them.

Parameters
std::vector<T> sorting::wiggle_sort::wiggleSort std::vector< T > sorting::wiggle_sort::wiggleSort ( const std::vector< T > &  arr)
@@ -169,32 +168,32 @@ template<typename T >
Examples
/Users/runner/work/C-Plus-Plus/C-Plus-Plus/sorting/wiggle_sort.cpp.
-
53  {
-
54  uint32_t size = arr.size();
-
55 
-
56  std::vector<T> out(
-
57  arr); // create a copy of input vector. this way, the original input
-
58  // vector does not get modified. a sorted array is is returned.
-
59 
-
60  for (int i = 0; i < size; i += 2) {
-
61  if (i > 0 && out[i - 1] > out[i]) {
-
62  std::swap(out[i], out[i - 1]); // swapping the two values
-
63  }
-
64 
-
65  if (i < size - 1 && out[i] < out[i + 1]) {
-
66  std::swap(out[i], out[i + 1]); // swapping the two values
-
67  }
-
68  }
-
69 
-
70  return out; // returns the sorted vector
-
71 }
+
53 {
+
54 uint32_t size = arr.size();
+
55
+ +
57 arr); // create a copy of input vector. this way, the original input
+
58 // vector does not get modified. a sorted array is is returned.
+
59
+
60 for (int i = 0; i < size; i += 2) {
+
61 if (i > 0 && out[i - 1] > out[i]) {
+
62 std::swap(out[i], out[i - 1]); // swapping the two values
+
63 }
+
64
+
65 if (i < size - 1 && out[i] < out[i + 1]) {
+
66 std::swap(out[i], out[i + 1]); // swapping the two values
+
67 }
+
68 }
+
69
+
70 return out; // returns the sorted vector
+
71}
T size(T... args)
T swap(T... args)
Here is the call graph for this function:
-
+
@@ -206,7 +205,7 @@ Here is the call graph for this function:
diff --git a/d1/dcc/wiggle__sort_8cpp.js b/d1/dcc/wiggle__sort_8cpp.js index 4071afff3..5aa145621 100644 --- a/d1/dcc/wiggle__sort_8cpp.js +++ b/d1/dcc/wiggle__sort_8cpp.js @@ -3,5 +3,5 @@ var wiggle__sort_8cpp = [ "displayElements", "d5/d4c/group__sorting.html#ga135e4c638e3bcf548bd122b5f49a3e72", null ], [ "main", "d5/d4c/group__sorting.html#gae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "test", "d5/d4c/group__sorting.html#gaa8dca7b867074164d5f45b0f3851269d", null ], - [ "wiggleSort", "d1/dcc/wiggle__sort_8cpp.html#a52955ecf8669ff6c5b9b1e66bd7db41d", null ] + [ "wiggleSort", "d1/dcc/wiggle__sort_8cpp.html#a99eeded693ac073717282fae365957a1", null ] ]; \ No newline at end of file diff --git a/d1/dcc/wiggle__sort_8cpp_a52955ecf8669ff6c5b9b1e66bd7db41d_cgraph.map b/d1/dcc/wiggle__sort_8cpp_a99eeded693ac073717282fae365957a1_cgraph.map similarity index 100% rename from d1/dcc/wiggle__sort_8cpp_a52955ecf8669ff6c5b9b1e66bd7db41d_cgraph.map rename to d1/dcc/wiggle__sort_8cpp_a99eeded693ac073717282fae365957a1_cgraph.map diff --git a/d1/dcc/wiggle__sort_8cpp_a52955ecf8669ff6c5b9b1e66bd7db41d_cgraph.md5 b/d1/dcc/wiggle__sort_8cpp_a99eeded693ac073717282fae365957a1_cgraph.md5 similarity index 100% rename from d1/dcc/wiggle__sort_8cpp_a52955ecf8669ff6c5b9b1e66bd7db41d_cgraph.md5 rename to d1/dcc/wiggle__sort_8cpp_a99eeded693ac073717282fae365957a1_cgraph.md5 diff --git a/d1/dcc/wiggle__sort_8cpp_a52955ecf8669ff6c5b9b1e66bd7db41d_cgraph.svg b/d1/dcc/wiggle__sort_8cpp_a99eeded693ac073717282fae365957a1_cgraph.svg similarity index 96% rename from d1/dcc/wiggle__sort_8cpp_a52955ecf8669ff6c5b9b1e66bd7db41d_cgraph.svg rename to d1/dcc/wiggle__sort_8cpp_a99eeded693ac073717282fae365957a1_cgraph.svg index 452ce34a1..a7f53ed07 100644 --- a/d1/dcc/wiggle__sort_8cpp_a52955ecf8669ff6c5b9b1e66bd7db41d_cgraph.svg +++ b/d1/dcc/wiggle__sort_8cpp_a99eeded693ac073717282fae365957a1_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - diff --git a/d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph.md5 b/d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph.md5 deleted file mode 100644 index 5f8277dcd..000000000 --- a/d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -8b095fcd513f19169738408080fd7cc2 \ No newline at end of file diff --git a/d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph.svg b/d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph.svg deleted file mode 100644 index 0d5346665..000000000 --- a/d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph.svg +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -data_structures::trie_using_hashmap::Trie::Node - - - -Node1 - - -data_structures::trie -_using_hashmap::Trie::Node - - - - - -Node2 - - -std::unordered_map -< char16_t, std::shared -_ptr< data_structures:: -trie_using_hashmap::Trie -::Node > > - - - - - -Node2->Node1 - - - children - - - -Node3 - - -std::shared_ptr< data -_structures::trie_using -_hashmap::Trie::Node > - - - - - -Node3->Node2 - - - elements - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph_org.svg b/d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph_org.svg deleted file mode 100644 index 83f52ebb8..000000000 --- a/d1/dda/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node__coll__graph_org.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - -data_structures::trie_using_hashmap::Trie::Node - - - -Node1 - - -data_structures::trie -_using_hashmap::Trie::Node - - - - - -Node2 - - -std::unordered_map -< char16_t, std::shared -_ptr< data_structures:: -trie_using_hashmap::Trie -::Node > > - - - - - -Node2->Node1 - - - children - - - -Node3 - - -std::shared_ptr< data -_structures::trie_using -_hashmap::Trie::Node > - - - - - -Node3->Node2 - - - elements - - - diff --git a/d1/de0/namespacenumerical__methods.html b/d1/de0/namespacenumerical__methods.html index e41aed942..8b6f82311 100644 --- a/d1/de0/namespacenumerical__methods.html +++ b/d1/de0/namespacenumerical__methods.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: numerical_methods Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
arrinput array (unsorted elements)
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,25 +90,24 @@ $(document).ready(function(){initNavTree('d1/de0/namespacenumerical__methods.htm
-
-
numerical_methods Namespace Reference
+
numerical_methods Namespace Reference

for io operations More...

Detailed Description

-

for io operations

-

Numerical Methods.

-

for math operations

-

Numerical methods

+

for io operations

+

Numerical Methods.

+

for math operations

+

Numerical methods

diff --git a/d1/de6/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__inherit__graph.svg b/d1/de6/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__inherit__graph.svg index 5d2246f7b..e5afc6359 100644 --- a/d1/de6/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__inherit__graph.svg +++ b/d1/de6/classrange__queries_1_1heavy__light__decomposition_1_1_s_g__inherit__graph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,24 +90,23 @@ $(document).ready(function(){initNavTree('d4/dde/classgeometry_1_1jarvis_1_1_con
-
-
geometry::jarvis::Convexhull Member List
+
geometry::jarvis::Convexhull Member List

This is the complete list of members for geometry::jarvis::Convexhull, including all inherited members.

- + - +
Convexhull(const std::vector< Point > &pointList)geometry::jarvis::Convexhullinlineexplicit
getConvexHull() constgeometry::jarvis::Convexhullinline
getConvexHull() constgeometry::jarvis::Convexhullinline
orientation(const Point &p, const Point &q, const Point &r)geometry::jarvis::Convexhullinlinestatic
points (defined in geometry::jarvis::Convexhull)geometry::jarvis::Convexhullprivate
points (defined in geometry::jarvis::Convexhull)geometry::jarvis::Convexhullprivate
size (defined in geometry::jarvis::Convexhull)geometry::jarvis::Convexhullprivate
diff --git a/d1/de9/integral__approximation_8cpp.html b/d1/de9/integral__approximation_8cpp.html index 02a1c66a2..fff7136c7 100644 --- a/d1/de9/integral__approximation_8cpp.html +++ b/d1/de9/integral__approximation_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: math/integral_approximation.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d1/de9/integral__approximation_8cpp.ht -
-
integral_approximation.cpp File Reference
+
integral_approximation.cpp File Reference
-

Compute integral approximation of the function using Riemann sum +

Compute integral approximation of the function using Riemann sum More...

#include <cassert>
#include <cmath>
@@ -111,13 +110,13 @@ Include dependency graph for integral_approximation.cpp:
- - +

+

Namespaces

 math
namespace  math
 for IO operations
 
- @@ -125,20 +124,19 @@ Functions - +

+

Functions

double math::integral_approx (double lb, double ub, const std::function< double(double)> &func, double delta=.0001)
 Computes integral approximation. More...
void math::test_eval (double approx, double expected, double threshold)
 Wrapper to evaluate if the approximated value is within .XX% threshold of the exact value. More...
 
-static void test ()
static void test ()
 
int main ()
 Main function. More...
 

Detailed Description

-

Compute integral approximation of the function using Riemann sum

-

In mathematics, a Riemann sum is a certain kind of approximation of an integral by a finite sum. It is named after nineteenth-century German mathematician Bernhard Riemann. One very common application is approximating the area of functions or lines on a graph and the length of curves and other approximations. The sum is calculated by partitioning the region into shapes (rectangles, trapezoids, parabolas, or cubics) that form a region similar to the region being measured, then calculating the area for each of these shapes, and finally adding all of these small areas together. This approach can be used to find a numerical approximation for a definite integral even if the fundamental theorem of calculus does not make it easy to find a closed-form solution. Because the region filled by the small shapes is usually not the same shape as the region being measured, the Riemann sum will differ from the area being measured. This error can be reduced by dividing up the region more finely, using smaller and smaller shapes. As the shapes get smaller and smaller, the sum approaches the Riemann integral.

Author
Benjamin Walton
+

Compute integral approximation of the function using Riemann sum

+

In mathematics, a Riemann sum is a certain kind of approximation of an integral by a finite sum. It is named after nineteenth-century German mathematician Bernhard Riemann. One very common application is approximating the area of functions or lines on a graph and the length of curves and other approximations. The sum is calculated by partitioning the region into shapes (rectangles, trapezoids, parabolas, or cubics) that form a region similar to the region being measured, then calculating the area for each of these shapes, and finally adding all of these small areas together. This approach can be used to find a numerical approximation for a definite integral even if the fundamental theorem of calculus does not make it easy to find a closed-form solution. Because the region filled by the small shapes is usually not the same shape as the region being measured, the Riemann sum will differ from the area being measured. This error can be reduced by dividing up the region more finely, using smaller and smaller shapes. As the shapes get smaller and smaller, the sum approaches the Riemann integral.

Author
Benjamin Walton
-Shiqi Sheng
+Shiqi Sheng

Function Documentation

- +

◆ main()

@@ -156,21 +154,107 @@ static void test ()Main function.

Returns
0 on exit
-
122  {
-
123  test(); // run self-test implementations
-
124  return 0;
-
125 }
+
122 {
+
123 test(); // run self-test implementations
+
124 return 0;
+
125}
void test()
Definition: caesar_cipher.cpp:100
+ +

◆ test()

+ +
+
+ + + + + +
+ + + + + + + +
static void test ()
+
+static
+
+
64 {
+
65 double test_1 = math::integral_approx(
+
66 3.24, 7.56, [](const double x) { return log(x) + exp(x) + x; });
+
67 std::cout << "Test Case 1" << std::endl;
+
68 std::cout << "function: log(x) + e^x + x" << std::endl;
+
69 std::cout << "range: [3.24, 7.56]" << std::endl;
+
70 std::cout << "value: " << test_1 << std::endl;
+
71 math::test_eval(test_1, 1924.80384023549, .001);
+
72 std::cout << "Test 1 Passed!" << std::endl;
+
73 std::cout << "=====================" << std::endl;
+
74
+
75 double test_2 = math::integral_approx(0.023, 3.69, [](const double x) {
+
76 return x * x + cos(x) + exp(x) + log(x) * log(x);
+
77 });
+
78 std::cout << "Test Case 2" << std::endl;
+
79 std::cout << "function: x^2 + cos(x) + e^x + log^2(x)" << std::endl;
+
80 std::cout << "range: [.023, 3.69]" << std::endl;
+
81 std::cout << "value: " << test_2 << std::endl;
+
82 math::test_eval(test_2, 58.71291345202729, .001);
+
83 std::cout << "Test 2 Passed!" << std::endl;
+
84 std::cout << "=====================" << std::endl;
+
85
+
86 double test_3 = math::integral_approx(
+
87 10.78, 24.899, [](const double x) { return x * x * x - x * x + 378; });
+
88 std::cout << "Test Case 3" << std::endl;
+
89 std::cout << "function: x^3 - x^2 + 378" << std::endl;
+
90 std::cout << "range: [10.78, 24.899]" << std::endl;
+
91 std::cout << "value: " << test_3 << std::endl;
+
92 math::test_eval(test_3, 93320.65915078377, .001);
+
93 std::cout << "Test 3 Passed!" << std::endl;
+
94 std::cout << "=====================" << std::endl;
+
95
+
96 double test_4 = math::integral_approx(
+
97 .101, .505,
+
98 [](const double x) { return cos(x) * tan(x) * x * x + exp(x); },
+
99 .00001);
+
100 std::cout << "Test Case 4" << std::endl;
+
101 std::cout << "function: cos(x)*tan(x)*x^2 + e^x" << std::endl;
+
102 std::cout << "range: [.101, .505]" << std::endl;
+
103 std::cout << "value: " << test_4 << std::endl;
+
104 math::test_eval(test_4, 0.566485986311631, .001);
+
105 std::cout << "Test 4 Passed!" << std::endl;
+
106 std::cout << "=====================" << std::endl;
+
107
+
108 double test_5 = math::integral_approx(
+
109 -1, 1, [](const double x) { return exp(-1 / (x * x)); });
+
110 std::cout << "Test Case 5" << std::endl;
+
111 std::cout << "function: e^(-1/x^2)" << std::endl;
+
112 std::cout << "range: [-1, 1]" << std::endl;
+
113 std::cout << "value: " << test_5 << std::endl;
+
114 math::test_eval(test_5, 0.1781477117815607, .001);
+
115 std::cout << "Test 5 Passed!" << std::endl;
+
116}
+ +
T cos(T... args)
+
T endl(T... args)
+
T log(T... args)
+
uint256_t exp(uint256_t number, uint256_t power, const uint256_t &mod)
This function calculates number raised to exponent power under modulo mod using Modular Exponentiatio...
Definition: elliptic_curve_key_exchange.cpp:78
+
void test_eval(double approx, double expected, double threshold)
Wrapper to evaluate if the approximated value is within .XX% threshold of the exact value.
Definition: integral_approximation.cpp:51
+
double integral_approx(double lb, double ub, const std::function< double(double)> &func, double delta=.0001)
Computes integral approximation.
Definition: integral_approximation.cpp:31
+
T tan(T... args)
+
+
+
diff --git a/d1/de9/integral__approximation_8cpp.js b/d1/de9/integral__approximation_8cpp.js index 85cb1d7d4..86a4251a5 100644 --- a/d1/de9/integral__approximation_8cpp.js +++ b/d1/de9/integral__approximation_8cpp.js @@ -2,6 +2,5 @@ var integral__approximation_8cpp = [ [ "integral_approx", "d1/de9/integral__approximation_8cpp.html#aec65db4e5c7317323227f026fe50ef11", null ], [ "main", "d1/de9/integral__approximation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "test", "d1/de9/integral__approximation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ], [ "test_eval", "d1/de9/integral__approximation_8cpp.html#a50936ee98f4d40f17823befc65a32aec", null ] ]; \ No newline at end of file diff --git a/d1/deb/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node-members.html b/d1/deb/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node-members.html index 51aae69de..55debd287 100644 --- a/d1/deb/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node-members.html +++ b/d1/deb/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,21 +90,20 @@ $(document).ready(function(){initNavTree('d5/d12/structdata__structures_1_1trie_
-
-
data_structures::trie_using_hashmap::Trie::Node Member List
+
data_structures::trie_using_hashmap::Trie::Node Member List
diff --git a/d1/def/classdata__structures_1_1linked__list_1_1list.html b/d1/def/classdata__structures_1_1linked__list_1_1list.html index 4375b22d1..5349c6c8c 100644 --- a/d1/def/classdata__structures_1_1linked__list_1_1list.html +++ b/d1/def/classdata__structures_1_1linked__list_1_1list.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: data_structures::linked_list::list Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,18 +94,11 @@ $(document).ready(function(){initNavTree('d1/def/classdata__structures_1_1linked Public Member Functions | Private Attributes | List of all members -
-
data_structures::linked_list::list Class Reference
+
data_structures::linked_list::list Class Reference
-
-Collaboration diagram for data_structures::linked_list::list:
-
-
-
-
[legend]
- @@ -121,25 +114,25 @@ Public Member Functions -

+

Public Member Functions

 list ()
 
 
std::shared_ptr< linksearch (int find_elem)
 
+
void reverse ()
 
- - + - +

+

Private Attributes

-std::shared_ptr< linkfirst
+std::shared_ptr< linkfirst
 link before the actual first element
 
-std::shared_ptr< linklast
+std::shared_ptr< linklast
 last link on the list
 

Detailed Description

-

A list class containing a sequence of links

+

A list class containing a sequence of links

Constructor & Destructor Documentation

- +

◆ list()

@@ -161,20 +154,20 @@ Private Attributes
-

List constructor. Initializes the first and last link.

-
89  {
-
90  // Initialize the first link
-
91  first = std::make_shared<link>();
-
92  // Initialize the last link with the first link
-
93  last = nullptr;
-
94  }
+

List constructor. Initializes the first and last link.

+
89 {
+
90 // Initialize the first link
+
91 first = std::make_shared<link>();
+
92 // Initialize the last link with the first link
+
93 last = nullptr;
+
94 }
std::shared_ptr< link > first
link before the actual first element
Definition: linked_list.cpp:83
std::shared_ptr< link > last
last link on the list
Definition: linked_list.cpp:84

Member Function Documentation

- +

◆ display()

@@ -188,18 +181,18 @@ Private Attributes
-

function displays all the elements in the list

Returns
'void'
-
181  {
-
182  if (isEmpty()) {
-
183  std::cout << "List is Empty!";
-
184  return;
-
185  }
- -
187  while (t->succ() != nullptr) {
-
188  std::cout << t->succ()->val() << "\t";
-
189  t = t->succ();
-
190  }
-
191 }
+

function displays all the elements in the list

Returns
'void'
+
181 {
+
182 if (isEmpty()) {
+
183 std::cout << "List is Empty!";
+
184 return;
+
185 }
+ +
187 while (t->succ() != nullptr) {
+
188 std::cout << t->succ()->val() << "\t";
+
189 t = t->succ();
+
190 }
+
191}
bool isEmpty()
Definition: linked_list.cpp:111
@@ -212,7 +205,7 @@ Here is the call graph for this function:
- +

◆ erase()

@@ -227,36 +220,36 @@ Here is the call graph for this function:
-

function erases old element from the list

Parameters
+

function erases old element from the list

Parameters
old_elemto be erased from the list
-
152  {
-
153  if (isEmpty()) {
-
154  std::cout << "List is Empty!";
-
155  return;
-
156  }
- -
158  std::shared_ptr<link> to_be_removed = nullptr;
-
159  while (t != last && t->succ()->val() != old_elem) {
-
160  t = t->succ();
-
161  }
-
162  if (t == last) {
-
163  std::cout << "Element not found\n";
-
164  return;
-
165  }
-
166  to_be_removed = t->succ();
-
167  t->succ() = t->succ()->succ();
-
168  to_be_removed.reset();
-
169  if (t->succ() == nullptr) {
-
170  last = t;
-
171  }
-
172  if (first == last){
-
173  last = nullptr;
-
174  }
-
175 }
+
152 {
+
153 if (isEmpty()) {
+
154 std::cout << "List is Empty!";
+
155 return;
+
156 }
+ +
158 std::shared_ptr<link> to_be_removed = nullptr;
+
159 while (t != last && t->succ()->val() != old_elem) {
+
160 t = t->succ();
+
161 }
+
162 if (t == last) {
+
163 std::cout << "Element not found\n";
+
164 return;
+
165 }
+
166 to_be_removed = t->succ();
+
167 t->succ() = t->succ()->succ();
+
168 to_be_removed.reset();
+
169 if (t->succ() == nullptr) {
+
170 last = t;
+
171 }
+
172 if (first == last){
+
173 last = nullptr;
+
174 }
+
175}
T reset(T... args)
Here is the call graph for this function:
@@ -267,7 +260,7 @@ Here is the call graph for this function:
- +

◆ isEmpty()

@@ -281,20 +274,20 @@ Here is the call graph for this function:
-

function checks if list is empty

Returns
true if list is empty
+

function checks if list is empty

Returns
true if list is empty
false if list is not empty
-
111  {
-
112  if (last == nullptr) {
-
113  return true;
-
114  } else {
-
115  return false;
-
116  }
-
117 }
+
111 {
+
112 if (last == nullptr) {
+
113 return true;
+
114 } else {
+
115 return false;
+
116 }
+
117}
- +

◆ push_back()

@@ -309,21 +302,21 @@ false if list is not empty
-

function adds new element to the end of the list

Parameters
+

function adds new element to the end of the list

Parameters
new_elemto be added to the end of the list
-
123  {
-
124  if (isEmpty()) {
-
125  first->succ() = std::make_shared<link>(new_elem);
-
126  last = first->succ();
-
127  } else {
-
128  last->succ() = std::make_shared<link>(new_elem);
-
129  last = last->succ();
-
130  }
-
131 }
+
123 {
+
124 if (isEmpty()) {
+
125 first->succ() = std::make_shared<link>(new_elem);
+
126 last = first->succ();
+
127 } else {
+
128 last->succ() = std::make_shared<link>(new_elem);
+
129 last = last->succ();
+
130 }
+
131}
Here is the call graph for this function:
@@ -333,7 +326,7 @@ Here is the call graph for this function:
- +

◆ push_front()

@@ -348,22 +341,22 @@ Here is the call graph for this function:
-

function adds new element to the beginning of the list

Parameters
+

function adds new element to the beginning of the list

Parameters
new_elemto be added to front of the list
-
137  {
-
138  if (isEmpty()) {
-
139  first->succ() = std::make_shared<link>(new_elem);
-
140  last = first->succ();
-
141  } else {
-
142  std::shared_ptr<link> t = std::make_shared<link>(new_elem);
-
143  t->succ() = first->succ();
-
144  first->succ() = t;
-
145  }
-
146 }
+
137 {
+
138 if (isEmpty()) {
+
139 first->succ() = std::make_shared<link>(new_elem);
+
140 last = first->succ();
+
141 } else {
+
142 std::shared_ptr<link> t = std::make_shared<link>(new_elem);
+
143 t->succ() = first->succ();
+
144 first->succ() = t;
+
145 }
+
146}
Here is the call graph for this function:
@@ -373,7 +366,7 @@ Here is the call graph for this function:
- +

◆ search()

@@ -388,29 +381,29 @@ Here is the call graph for this function:
-

function searchs for

Parameters
+

function searchs for

Parameters
find_elemin the list
find_elemto be searched for in the list
-
197  {
-
198  if (isEmpty()) {
-
199  std::cout << "List is Empty!";
-
200  return nullptr;
-
201  }
- -
203  while (t != last && t->succ()->val() != find_elem) {
-
204  t = t->succ();
-
205  }
-
206  if (t == last) {
-
207  std::cout << "Element not found\n";
-
208  return nullptr;
-
209  }
-
210  std::cout << "Element was found\n";
-
211  return t->succ();
-
212 }
+
197 {
+
198 if (isEmpty()) {
+
199 std::cout << "List is Empty!";
+
200 return nullptr;
+
201 }
+ +
203 while (t != last && t->succ()->val() != find_elem) {
+
204 t = t->succ();
+
205 }
+
206 if (t == last) {
+
207 std::cout << "Element not found\n";
+
208 return nullptr;
+
209 }
+
210 std::cout << "Element was found\n";
+
211 return t->succ();
+
212}
Here is the call graph for this function:
@@ -429,7 +422,7 @@ Here is the call graph for this function:
diff --git a/d1/def/classdata__structures_1_1linked__list_1_1list.js b/d1/def/classdata__structures_1_1linked__list_1_1list.js index 02427629c..8369cb94d 100644 --- a/d1/def/classdata__structures_1_1linked__list_1_1list.js +++ b/d1/def/classdata__structures_1_1linked__list_1_1list.js @@ -6,7 +6,6 @@ var classdata__structures_1_1linked__list_1_1list = [ "isEmpty", "d1/def/classdata__structures_1_1linked__list_1_1list.html#ae8424a4fce3d483f7c85d6f6a5c79a1a", null ], [ "push_back", "d1/def/classdata__structures_1_1linked__list_1_1list.html#ad585670a392c7e842c992d088093dff5", null ], [ "push_front", "d1/def/classdata__structures_1_1linked__list_1_1list.html#a9c73f393e984f93f33852334d1a04be0", null ], - [ "reverse", "d1/def/classdata__structures_1_1linked__list_1_1list.html#af0981944884c6dc19361ff67451261c9", null ], [ "search", "d1/def/classdata__structures_1_1linked__list_1_1list.html#a098be172c737f236763afdb8cada4835", null ], [ "first", "d1/def/classdata__structures_1_1linked__list_1_1list.html#aa3801cea564a3b3bb7b03abfffdcf1e1", null ], [ "last", "d1/def/classdata__structures_1_1linked__list_1_1list.html#ae8a5aa5c6dbbc5b882030b52619dd1a3", null ] diff --git a/d1/def/classdata__structures_1_1linked__list_1_1list_a098be172c737f236763afdb8cada4835_cgraph.svg b/d1/def/classdata__structures_1_1linked__list_1_1list_a098be172c737f236763afdb8cada4835_cgraph.svg index 7d1d2c462..feaa46cd9 100644 --- a/d1/def/classdata__structures_1_1linked__list_1_1list_a098be172c737f236763afdb8cada4835_cgraph.svg +++ b/d1/def/classdata__structures_1_1linked__list_1_1list_a098be172c737f236763afdb8cada4835_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,38 +90,37 @@ $(document).ready(function(){initNavTree('d5/da1/structnode.html','../../'); ini
-
-
node< Kind > Member List
+
node< Kind > Member List

This is the complete list of members for node< Kind >, including all inherited members.

- + - + - + - + - + - + - + - + - +
color (defined in node< Kind >)node< Kind >
data (defined in node< Kind >)node< Kind >
data (defined in node< Kind >)node< Kind >
data (defined in node< Kind >)node< Kind >
datanode< Kind >
datanode< Kind >
height (defined in node< Kind >)node< Kind >
key (defined in node< Kind >)node< Kind >
key (defined in node< Kind >)node< Kind >
left (defined in node< Kind >)node< Kind >
left (defined in node< Kind >)node< Kind >
left (defined in node< Kind >)node< Kind >
link (defined in node< Kind >)node< Kind >
next (defined in node< Kind >)node< Kind >
next (defined in node< Kind >)node< Kind >
next (defined in node< Kind >)node< Kind >
next (defined in node< Kind >)node< Kind >
next (defined in node< Kind >)node< Kind >
nextnode< Kind >
node(int d) (defined in node< Kind >)node< Kind >inline
node(int d) (defined in node< Kind >)node< Kind >inline
parent (defined in node< Kind >)node< Kind >
prev (defined in node< Kind >)node< Kind >
prev (defined in node< Kind >)node< Kind >
right (defined in node< Kind >)node< Kind >
right (defined in node< Kind >)node< Kind >
right (defined in node< Kind >)node< Kind >
val (defined in node< Kind >)node< Kind >
diff --git a/d1/df3/hash__search_8cpp.html b/d1/df3/hash__search_8cpp.html index ed02a0734..fa4f510fb 100644 --- a/d1/df3/hash__search_8cpp.html +++ b/d1/df3/hash__search_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: search/hash_search.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -96,8 +96,7 @@ $(document).ready(function(){initNavTree('d1/df3/hash__search_8cpp.html','../../ Typedefs | Functions | Variables -
-
hash_search.cpp File Reference
+
hash_search.cpp File Reference
@@ -112,32 +111,32 @@ Include dependency graph for hash_search.cpp:
-

+

Classes

struct  list
 
- - + - +

+

Macros

-#define MAX   6
+#define MAX   6
 Determines how much data.
 
-#define HASHMAX   5
+#define HASHMAX   5
 Determines the length of the hash table.
 
- - +

+

Typedefs

typedef struct list node
 
-typedef struct listlink
+typedef struct listlink
 pointer to nodes
 
- @@ -148,25 +147,25 @@ Functions

+

Functions

int h (int key)
 
int main ()
 
- - + - +

+

Variables

-int data [MAX] = {1, 10, 15, 5, 8, 7}
+int data [MAX] = {1, 10, 15, 5, 8, 7}
 test data
 
-node hashtab [HASHMAX]
+node hashtab [HASHMAX]
 array of nodes
 

Detailed Description

-

Hash Search Algorithm - Best Time Complexity Ω(1)

+

Hash Search Algorithm - Best Time Complexity Ω(1)

In this algorithm, we use the method of division and reservation remainder to construct the hash function, and use the method of chain address to solve the conflict, that is, we link a chain list after the data, and store all the records whose keywords are synonyms in the same linear chain list.

Warning
This program is only for educational purposes. It has serious flaws in implementation with regards to memory management resulting in large amounts of memory leaks.
Todo:
fix the program for memory leaks and better structure in C++ and not C fashion

Typedef Documentation

- +

◆ node

Function Documentation

-
+

◆ create_list()

@@ -197,7 +196,7 @@ int  -

The same after the remainder will be added after the same hash header To avoid conflict, zipper method is used Insert elements into the linked list in the header

Parameters
+

The same after the remainder will be added after the same hash header To avoid conflict, zipper method is used Insert elements into the linked list in the header

Parameters
[in]keykey to add to list
@@ -205,21 +204,21 @@ int 
Warning
dynamic memory allocated to n never gets freed.
Todo:
fix memory leak
-
55  { // Construct hash table
-
56  link p, n;
-
57  int index;
-
58  n = (link)malloc(sizeof(node));
-
59  n->key = key;
-
60  n->next = NULL;
-
61  index = h(key);
-
62  p = hashtab[index].next;
-
63  if (p != NULL) {
-
64  n->next = p;
-
65  hashtab[index].next = n;
-
66  } else {
-
67  hashtab[index].next = n;
-
68  }
-
69 }
+
55 { // Construct hash table
+
56 link p, n;
+
57 int index;
+
58 n = (link)malloc(sizeof(node));
+
59 n->key = key;
+
60 n->next = NULL;
+
61 index = h(key);
+
62 p = hashtab[index].next;
+
63 if (p != NULL) {
+
64 n->next = p;
+
65 hashtab[index].next = n;
+
66 } else {
+
67 hashtab[index].next = n;
+
68 }
+
69}
int h(int key)
Definition: hash_search.cpp:45
struct list * link
pointer to nodes
node hashtab[HASHMAX]
array of nodes
Definition: hash_search.cpp:35
@@ -235,7 +234,7 @@ Here is the call graph for this function:
- +

◆ h()

@@ -250,7 +249,7 @@ Here is the call graph for this function:
-

Mode of hash detection : Division method

Parameters
+

Mode of hash detection : Division method

Parameters
[in]keyto hash
@@ -259,12 +258,12 @@ Here is the call graph for this function:
Returns
hash value for key
Examples
/Users/runner/work/C-Plus-Plus/C-Plus-Plus/numerical_methods/rungekutta.cpp.
-
45 { return key % HASHMAX; }
+
45{ return key % HASHMAX; }
#define HASHMAX
Determines the length of the hash table.
Definition: hash_search.cpp:22
- +

◆ hash_search()

@@ -289,30 +288,30 @@ Here is the call graph for this function:
-

Input the key to be searched, and get the hash header position through the H (int key) function, then one-dimensional linear search. If found

Returns
element depth and number of searches If not found
+

Input the key to be searched, and get the hash header position through the H (int key) function, then one-dimensional linear search. If found

Returns
element depth and number of searches If not found
-1
-
76  { // Hash lookup function
-
77  link pointer;
-
78  int index;
-
79 
-
80  *counter = 0;
-
81  index = h(key);
-
82  pointer = hashtab[index].next;
-
83 
-
84  std::cout << "data[" << index << "]:";
-
85 
-
86  while (pointer != NULL) {
-
87  counter[0]++;
-
88  std::cout << "data[" << pointer->key << "]:";
-
89  if (pointer->key == key)
-
90  return 1;
-
91  else
-
92  pointer = pointer->next;
-
93  }
-
94 
-
95  return 0;
-
96 }
+
76 { // Hash lookup function
+
77 link pointer;
+
78 int index;
+
79
+
80 *counter = 0;
+
81 index = h(key);
+
82 pointer = hashtab[index].next;
+
83
+
84 std::cout << "data[" << index << "]:";
+
85
+
86 while (pointer != NULL) {
+
87 counter[0]++;
+
88 std::cout << "data[" << pointer->key << "]:";
+
89 if (pointer->key == key)
+
90 return 1;
+
91 else
+
92 pointer = pointer->next;
+
93 }
+
94
+
95 return 0;
+
96}
Here is the call graph for this function:
@@ -323,7 +322,7 @@ Here is the call graph for this function:
- +

◆ main()

@@ -338,48 +337,48 @@ Here is the call graph for this function:
-

main function

-
99  {
-
100  link p;
-
101  int key, index, i, counter; // Key is the value to be found
-
102  index = 0;
-
103 
-
104  // You can write the input mode here
-
105  while (index < MAX) { // Construct hash table
-
106  create_list(data[index]);
-
107  index++;
-
108  }
-
109 
-
110  for (i = 0; i < HASHMAX; i++) { // Output hash table
-
111  std::cout << "hashtab [" << i << "]\n";
-
112 
-
113  p = hashtab[i].next;
-
114 
-
115  while (p != NULL) {
-
116  std::cout << "please int key:";
-
117  if (p->key > 0)
-
118  std::cout << "[" << p->key << "]";
-
119  p = p->next;
-
120  }
-
121  std::cout << std::endl;
-
122  }
-
123 
-
124  while (key != -1) {
-
125  // You can write the input mode here
-
126  // test key = 10
-
127  key = 10;
-
128  if (hash_search(key, &counter))
-
129  std::cout << "search time = " << counter << std::endl;
-
130  else
-
131  std::cout << "no found!\n";
-
132  key = -1; // Exit test
-
133  /* The test sample is returned as:
-
134  * data[0]:data[5]:data[15]:data[10]:search time = 3 The search is
-
135  * successful. There are 10 in this set of data */
-
136  }
-
137 
-
138  return 0;
-
139 }
+

main function

+
99 {
+
100 link p;
+
101 int key, index, i, counter; // Key is the value to be found
+
102 index = 0;
+
103
+
104 // You can write the input mode here
+
105 while (index < MAX) { // Construct hash table
+
106 create_list(data[index]);
+
107 index++;
+
108 }
+
109
+
110 for (i = 0; i < HASHMAX; i++) { // Output hash table
+
111 std::cout << "hashtab [" << i << "]\n";
+
112
+
113 p = hashtab[i].next;
+
114
+
115 while (p != NULL) {
+
116 std::cout << "please int key:";
+
117 if (p->key > 0)
+
118 std::cout << "[" << p->key << "]";
+
119 p = p->next;
+
120 }
+ +
122 }
+
123
+
124 while (key != -1) {
+
125 // You can write the input mode here
+
126 // test key = 10
+
127 key = 10;
+
128 if (hash_search(key, &counter))
+
129 std::cout << "search time = " << counter << std::endl;
+
130 else
+
131 std::cout << "no found!\n";
+
132 key = -1; // Exit test
+
133 /* The test sample is returned as:
+
134 * data[0]:data[5]:data[15]:data[10]:search time = 3 The search is
+
135 * successful. There are 10 in this set of data */
+
136 }
+
137
+
138 return 0;
+
139}
T endl(T... args)
int hash_search(int key, int *counter)
Definition: hash_search.cpp:76
#define MAX
Determines how much data.
Definition: hash_search.cpp:21
@@ -400,7 +399,7 @@ Here is the call graph for this function:
diff --git a/d1/df3/hash__search_8cpp_a36ea13c16028f18ef2d5ff47f3fda7a2_cgraph.svg b/d1/df3/hash__search_8cpp_a36ea13c16028f18ef2d5ff47f3fda7a2_cgraph.svg index 9d1eff35f..eb80ff8d3 100644 --- a/d1/df3/hash__search_8cpp_a36ea13c16028f18ef2d5ff47f3fda7a2_cgraph.svg +++ b/d1/df3/hash__search_8cpp_a36ea13c16028f18ef2d5ff47f3fda7a2_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - + + Algorithms_in_C++: MinHeap Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,19 +94,17 @@ $(document).ready(function(){initNavTree('d2/d05/class_min_heap.html','../../'); Public Member Functions | Private Attributes | List of all members -
-
MinHeap Class Reference
+
MinHeap Class Reference
- - + @@ -123,25 +121,25 @@ int 

+

Public Member Functions

 MinHeap (int cap)
 
void MinHeapify (int)
 
-int parent (int i)
int parent (int i)
 
int left (int i)
 
parent (int i)void insertKey (int k)
 
- - + - + - +

+

Private Attributes

-int * harr
+int * harr
 pointer to array of elements in heap
 
-int capacity
+int capacity
 maximum possible size of min heap
 
-int heap_size
+int heap_size
 Current number of elements in min heap.
 

Detailed Description

-

A class for Min Heap

+

A class for Min Heap

Constructor & Destructor Documentation

- +

◆ MinHeap()

@@ -164,25 +162,51 @@ int  -

Constructor: Builds a heap from a given array a[] of given size

Parameters
+

Constructor: Builds a heap from a given array a[] of given size

Parameters
[in]capacityinitial heap capacity
-
19  {
-
20  heap_size = 0;
-
21  capacity = cap;
-
22  harr = new int[cap];
-
23  }
+
19 {
+
20 heap_size = 0;
+
21 capacity = cap;
+
22 harr = new int[cap];
+
23 }
int * harr
pointer to array of elements in heap
Definition: binaryheap.cpp:11
int capacity
maximum possible size of min heap
Definition: binaryheap.cpp:12
int heap_size
Current number of elements in min heap.
Definition: binaryheap.cpp:13
+ +

◆ ~MinHeap()

+ +
+
+ + + + + +
+ + + + + + + +
MinHeap::~MinHeap ()
+
+inline
+
+
51{ delete[] harr; }
+
+
+

Member Function Documentation

- +

◆ decreaseKey()

@@ -207,15 +231,15 @@ int  -

Decreases key value of key at index i to new_val

-

Decreases value of key at index 'i' to new_val. It is assumed that new_val is smaller than harr[i].

-
76  {
-
77  harr[i] = new_val;
-
78  while (i != 0 && harr[parent(i)] > harr[i]) {
-
79  std::swap(harr[i], harr[parent(i)]);
-
80  i = parent(i);
-
81  }
-
82 }
+

Decreases key value of key at index i to new_val

+

Decreases value of key at index 'i' to new_val. It is assumed that new_val is smaller than harr[i].

+
76 {
+
77 harr[i] = new_val;
+
78 while (i != 0 && harr[parent(i)] > harr[i]) {
+
79 std::swap(harr[i], harr[parent(i)]);
+
80 i = parent(i);
+
81 }
+
82}
T swap(T... args)
Here is the call graph for this function:
@@ -226,7 +250,7 @@ Here is the call graph for this function:
- +

◆ deleteKey()

@@ -241,12 +265,12 @@ Here is the call graph for this function:
-

Deletes a key stored at index i

-

This function deletes key at index i. It first reduced value to minus infinite, then calls extractMin()

-
105  {
-
106  decreaseKey(i, INT_MIN);
-
107  extractMin();
-
108 }
+

Deletes a key stored at index i

+

This function deletes key at index i. It first reduced value to minus infinite, then calls extractMin()

+
105 {
+
106 decreaseKey(i, INT_MIN);
+
107 extractMin();
+
108}
int extractMin()
Definition: binaryheap.cpp:85
void decreaseKey(int i, int new_val)
Definition: binaryheap.cpp:76
@@ -258,7 +282,7 @@ Here is the call graph for this function:
- +

◆ extractMin()

@@ -272,28 +296,28 @@ Here is the call graph for this function:
-

to extract the root which is the minimum element

-
85  {
-
86  if (heap_size <= 0)
-
87  return INT_MAX;
-
88  if (heap_size == 1) {
-
89  heap_size--;
-
90  return harr[0];
-
91  }
-
92 
-
93  // Store the minimum value, and remove it from heap
-
94  int root = harr[0];
-
95  harr[0] = harr[heap_size - 1];
-
96  heap_size--;
-
97  MinHeapify(0);
-
98 
-
99  return root;
-
100 }
+

to extract the root which is the minimum element

+
85 {
+
86 if (heap_size <= 0)
+
87 return INT_MAX;
+
88 if (heap_size == 1) {
+
89 heap_size--;
+
90 return harr[0];
+
91 }
+
92
+
93 // Store the minimum value, and remove it from heap
+
94 int root = harr[0];
+
95 harr[0] = harr[heap_size - 1];
+
96 heap_size--;
+
97 MinHeapify(0);
+
98
+
99 return root;
+
100}
void MinHeapify(int)
Definition: binaryheap.cpp:113
- +

◆ getMin()

@@ -315,12 +339,12 @@ Here is the call graph for this function:
-

Returns the minimum key (key at root) from min heap

-
43 { return harr[0]; }
+

Returns the minimum key (key at root) from min heap

+
43{ return harr[0]; }
- +

◆ insertKey()

@@ -335,24 +359,24 @@ Here is the call graph for this function:
-

Inserts a new key 'k'

-
55  {
-
56  if (heap_size == capacity) {
-
57  std::cout << "\nOverflow: Could not insertKey\n";
-
58  return;
-
59  }
-
60 
-
61  // First insert the new key at the end
-
62  heap_size++;
-
63  int i = heap_size - 1;
-
64  harr[i] = k;
-
65 
-
66  // Fix the min heap property if it is violated
-
67  while (i != 0 && harr[parent(i)] > harr[i]) {
-
68  std::swap(harr[i], harr[parent(i)]);
-
69  i = parent(i);
-
70  }
-
71 }
+

Inserts a new key 'k'

+
55 {
+
56 if (heap_size == capacity) {
+
57 std::cout << "\nOverflow: Could not insertKey\n";
+
58 return;
+
59 }
+
60
+
61 // First insert the new key at the end
+
62 heap_size++;
+
63 int i = heap_size - 1;
+
64 harr[i] = k;
+
65
+
66 // Fix the min heap property if it is violated
+
67 while (i != 0 && harr[parent(i)] > harr[i]) {
+
68 std::swap(harr[i], harr[parent(i)]);
+
69 i = parent(i);
+
70 }
+
71}
Here is the call graph for this function:
@@ -363,7 +387,7 @@ Here is the call graph for this function:
- +

◆ left()

@@ -386,12 +410,12 @@ Here is the call graph for this function:
-

to get index of left child of node at index i

-
31 { return (2 * i + 1); }
+

to get index of left child of node at index i

+
31{ return (2 * i + 1); }
- +

◆ MinHeapify()

@@ -406,21 +430,21 @@ Here is the call graph for this function:
-

to heapify a subtree with the root at given index

-

A recursive method to heapify a subtree with the root at given index This method assumes that the subtrees are already heapified

-
113  {
-
114  int l = left(i);
-
115  int r = right(i);
-
116  int smallest = i;
-
117  if (l < heap_size && harr[l] < harr[i])
-
118  smallest = l;
-
119  if (r < heap_size && harr[r] < harr[smallest])
-
120  smallest = r;
-
121  if (smallest != i) {
-
122  std::swap(harr[i], harr[smallest]);
-
123  MinHeapify(smallest);
-
124  }
-
125 }
+

to heapify a subtree with the root at given index

+

A recursive method to heapify a subtree with the root at given index This method assumes that the subtrees are already heapified

+
113 {
+
114 int l = left(i);
+
115 int r = right(i);
+
116 int smallest = i;
+
117 if (l < heap_size && harr[l] < harr[i])
+
118 smallest = l;
+
119 if (r < heap_size && harr[r] < harr[smallest])
+
120 smallest = r;
+
121 if (smallest != i) {
+
122 std::swap(harr[i], harr[smallest]);
+
123 MinHeapify(smallest);
+
124 }
+
125}
int left(int i)
Definition: binaryheap.cpp:31
int right(int i)
Definition: binaryheap.cpp:34
@@ -432,7 +456,34 @@ Here is the call graph for this function:
- + +

◆ parent()

+ +
+
+ + + + + +
+ + + + + + + + +
int MinHeap::parent (int i)
+
+inline
+
+
28{ return (i - 1) / 2; }
+
+
+
+

◆ right()

@@ -455,8 +506,8 @@ Here is the call graph for this function:
-

to get index of right child of node at index i

-
34 { return (2 * i + 2); }
+

to get index of right child of node at index i

+
34{ return (2 * i + 2); }
@@ -469,7 +520,7 @@ Here is the call graph for this function: diff --git a/d2/d05/class_min_heap.js b/d2/d05/class_min_heap.js index 42dd37a04..04700e8c9 100644 --- a/d2/d05/class_min_heap.js +++ b/d2/d05/class_min_heap.js @@ -1,7 +1,6 @@ var class_min_heap = [ [ "MinHeap", "d2/d05/class_min_heap.html#a078cb888e642bb1f95dd0e03f0a35820", null ], - [ "~MinHeap", "d2/d05/class_min_heap.html#a2759e717e45edcd6ca7096ff03d65dbd", null ], [ "decreaseKey", "d2/d05/class_min_heap.html#aa7f726cc6327955d22871592227432f5", null ], [ "deleteKey", "d2/d05/class_min_heap.html#a37ac126eabb0c3ce04047172abccca29", null ], [ "extractMin", "d2/d05/class_min_heap.html#a4014f1edaed0bd7db0c0d2ca53228980", null ], @@ -9,7 +8,6 @@ var class_min_heap = [ "insertKey", "d2/d05/class_min_heap.html#aef78f3384f5a0ae880ad0883d2d44b82", null ], [ "left", "d2/d05/class_min_heap.html#aa8c6c141e3de664819686aa637e1afca", null ], [ "MinHeapify", "d2/d05/class_min_heap.html#aaef438c1056492cb62c4a4d9035b5cad", null ], - [ "parent", "d2/d05/class_min_heap.html#a0e893f9deb4be4cf4f9990e736483e81", null ], [ "right", "d2/d05/class_min_heap.html#ac760b85cf90265b8d674b942a43fb70e", null ], [ "capacity", "d2/d05/class_min_heap.html#a88b4aa3e66392a3eabbf2517a9a79a02", null ], [ "harr", "d2/d05/class_min_heap.html#a34a93a87967308eb516328c0aca3c48e", null ], diff --git a/d2/d05/class_min_heap_a37ac126eabb0c3ce04047172abccca29_cgraph.svg b/d2/d05/class_min_heap_a37ac126eabb0c3ce04047172abccca29_cgraph.svg index 12a6ba610..091eefe68 100644 --- a/d2/d05/class_min_heap_a37ac126eabb0c3ce04047172abccca29_cgraph.svg +++ b/d2/d05/class_min_heap_a37ac126eabb0c3ce04047172abccca29_cgraph.svg @@ -1,7 +1,7 @@ - - - + + +Node1->Node1 + + + Node2 @@ -43,7 +49,7 @@ - + Node1->Node3 @@ -58,7 +64,7 @@ - + Node1->Node4 diff --git a/d2/d05/class_min_heap_aef78f3384f5a0ae880ad0883d2d44b82_cgraph.svg b/d2/d05/class_min_heap_aef78f3384f5a0ae880ad0883d2d44b82_cgraph.svg index d5eb38bbc..af59c5a31 100644 --- a/d2/d05/class_min_heap_aef78f3384f5a0ae880ad0883d2d44b82_cgraph.svg +++ b/d2/d05/class_min_heap_aef78f3384f5a0ae880ad0883d2d44b82_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: math/fast_power.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d2/d0b/fast__power_8cpp.html','../../'
-
-
fast_power.cpp File Reference
+
fast_power.cpp File Reference
@@ -112,7 +111,7 @@ Include dependency graph for fast_power.cpp:
- @@ -124,14 +123,14 @@ Functions

+

Functions

template<typename T >
double fast_power_recursive (T a, T b)
 

Detailed Description

-

Faster computation for \(a^b\).

-

Program that computes \(a^b\) in \(O(logN)\) time. It is based on formula that:

    +

    Faster computation for \(a^b\).

    +

    Program that computes \(a^b\) in \(O(logN)\) time. It is based on formula that:

    1. if \(b\) is even: \(a^b = a^\frac{b}{2} \cdot a^\frac{b}{2} = {a^\frac{b}{2}}^2\)
    2. if \(b\) is odd: \(a^b = a^\frac{b-1}{2} \cdot a^\frac{b-1}{2} \cdot a = {a^\frac{b-1}{2}}^2 \cdot a\)
    -

    We can compute \(a^b\) recursively using above algorithm.

    +

    We can compute \(a^b\) recursively using above algorithm.

    Function Documentation

    - +

    ◆ fast_power_linear()

    @@ -158,27 +157,33 @@ template<typename T >
-

Same algorithm with little different formula. It still calculates in \(O(\log N)\)

-
50  {
-
51  // negative power. a^b = 1 / (a^-b)
-
52  if (b < 0)
-
53  return 1.0 / fast_power_linear(a, -b);
-
54 
-
55  double result = 1;
-
56  while (b) {
-
57  if (b & 1)
-
58  result = result * a;
-
59  a = a * a;
-
60  b = b >> 1;
-
61  }
-
62  return result;
-
63 }
+

Same algorithm with little different formula. It still calculates in \(O(\log N)\)

+
50 {
+
51 // negative power. a^b = 1 / (a^-b)
+
52 if (b < 0)
+
53 return 1.0 / fast_power_linear(a, -b);
+
54
+
55 double result = 1;
+
56 while (b) {
+
57 if (b & 1)
+
58 result = result * a;
+
59 a = a * a;
+
60 b = b >> 1;
+
61 }
+
62 return result;
+
63}
double fast_power_linear(T a, T b)
Definition: fast_power.cpp:50
uint64_t result(uint64_t n)
Definition: fibonacci_sum.cpp:76
-
+
+Here is the call graph for this function:
+
+
- + +
+ +

◆ fast_power_recursive()

@@ -205,30 +210,36 @@ template<typename T >
-

algorithm implementation for \(a^b\)

-
26  {
-
27  // negative power. a^b = 1 / (a^-b)
-
28  if (b < 0)
-
29  return 1.0 / fast_power_recursive(a, -b);
-
30 
-
31  if (b == 0)
-
32  return 1;
-
33  T bottom = fast_power_recursive(a, b >> 1);
-
34  // Since it is integer division b/2 = (b-1)/2 where b is odd.
-
35  // Therefore, case2 is easily solved by integer division.
-
36 
-
37  double result;
-
38  if ((b & 1) == 0) // case1
-
39  result = bottom * bottom;
-
40  else // case2
-
41  result = bottom * bottom * a;
-
42  return result;
-
43 }
+

algorithm implementation for \(a^b\)

+
26 {
+
27 // negative power. a^b = 1 / (a^-b)
+
28 if (b < 0)
+
29 return 1.0 / fast_power_recursive(a, -b);
+
30
+
31 if (b == 0)
+
32 return 1;
+
33 T bottom = fast_power_recursive(a, b >> 1);
+
34 // Since it is integer division b/2 = (b-1)/2 where b is odd.
+
35 // Therefore, case2 is easily solved by integer division.
+
36
+
37 double result;
+
38 if ((b & 1) == 0) // case1
+
39 result = bottom * bottom;
+
40 else // case2
+
41 result = bottom * bottom * a;
+
42 return result;
+
43}
double fast_power_recursive(T a, T b)
Definition: fast_power.cpp:26
-
+
+Here is the call graph for this function:
+
+
- + +
+ +

◆ main()

@@ -243,33 +254,33 @@ template<typename T >
-

Main function

-
68  {
-
69  std::srand(std::time(nullptr));
- -
71 
-
72  std::cout << "Testing..." << std::endl;
-
73  for (int i = 0; i < 20; i++) {
-
74  int a = std::rand() % 20 - 10;
-
75  int b = std::rand() % 20 - 10;
-
76  std::cout << std::endl << "Calculating " << a << "^" << b << std::endl;
-
77  assert(fast_power_recursive(a, b) == std::pow(a, b));
-
78  assert(fast_power_linear(a, b) == std::pow(a, b));
-
79 
-
80  std::cout << "------ " << a << "^" << b << " = "
-
81  << fast_power_recursive(a, b) << std::endl;
-
82  }
-
83 
-
84  int64_t a, b;
-
85  std::cin >> a >> b;
-
86 
-
87  std::cout << a << "^" << b << " = " << fast_power_recursive(a, b)
-
88  << std::endl;
-
89 
-
90  std::cout << a << "^" << b << " = " << fast_power_linear(a, b) << std::endl;
-
91 
-
92  return 0;
-
93 }
+

Main function

+
68 {
+
69 std::srand(std::time(nullptr));
+ +
71
+
72 std::cout << "Testing..." << std::endl;
+
73 for (int i = 0; i < 20; i++) {
+
74 int a = std::rand() % 20 - 10;
+
75 int b = std::rand() % 20 - 10;
+
76 std::cout << std::endl << "Calculating " << a << "^" << b << std::endl;
+
77 assert(fast_power_recursive(a, b) == std::pow(a, b));
+
78 assert(fast_power_linear(a, b) == std::pow(a, b));
+
79
+
80 std::cout << "------ " << a << "^" << b << " = "
+ +
82 }
+
83
+
84 int64_t a, b;
+
85 std::cin >> a >> b;
+
86
+
87 std::cout << a << "^" << b << " = " << fast_power_recursive(a, b)
+
88 << std::endl;
+
89
+
90 std::cout << a << "^" << b << " = " << fast_power_linear(a, b) << std::endl;
+
91
+
92 return 0;
+
93}
T endl(T... args)
@@ -281,7 +292,7 @@ template<typename T >
Here is the call graph for this function:
-
+
@@ -293,7 +304,7 @@ Here is the call graph for this function:
diff --git a/d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.map b/d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.map new file mode 100644 index 000000000..138fddfd3 --- /dev/null +++ b/d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.md5 b/d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.md5 new file mode 100644 index 000000000..f12d5da80 --- /dev/null +++ b/d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.md5 @@ -0,0 +1 @@ +7dfd783cca35f56e6d31f17a29441df7 \ No newline at end of file diff --git a/d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.svg b/d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.svg new file mode 100644 index 000000000..1bc77b38a --- /dev/null +++ b/d2/d0b/fast__power_8cpp_a0d4e3f0099a6975b74a314a35bd0f94d_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +fast_power_linear + + + +Node1 + + +fast_power_linear + + + + + +Node1->Node1 + + + + + diff --git a/d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.map b/d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.map new file mode 100644 index 000000000..7964034c5 --- /dev/null +++ b/d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.md5 b/d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.md5 new file mode 100644 index 000000000..19ee9bd9d --- /dev/null +++ b/d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.md5 @@ -0,0 +1 @@ +1e0f9ce815c7f0cb158b0ea0e9da2edc \ No newline at end of file diff --git a/d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.svg b/d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.svg new file mode 100644 index 000000000..271db9eb5 --- /dev/null +++ b/d2/d0b/fast__power_8cpp_a8399b847626e5bba983cab7c7918b445_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +fast_power_recursive + + + +Node1 + + +fast_power_recursive + + + + + +Node1->Node1 + + + + + diff --git a/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 5191ae2f5..a22adaa38 100644 --- a/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,11 +1,11 @@ - + - - - - - - - + + + + + + + diff --git a/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index ecf1bd49d..077b9b900 100644 --- a/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -fa1a81d740baf5ba17494df738a82c77 \ No newline at end of file +bc301cb7031051dd2e6b1aeef86e41fd \ No newline at end of file diff --git a/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index bb0315b23..4660f1d2a 100644 --- a/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d2/d0b/fast__power_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,14 +1,14 @@ - - - + + main - + Node1 @@ -22,31 +22,31 @@ Node2 - -std::endl + +std::endl Node1->Node2 - - + + Node3 - -fast_power_linear + +fast_power_linear Node1->Node3 - - + + @@ -58,7 +58,7 @@ - + Node1->Node4 @@ -73,7 +73,7 @@ - + Node1->Node5 @@ -88,7 +88,7 @@ - + Node1->Node6 @@ -103,7 +103,7 @@ - + Node1->Node7 @@ -119,7 +119,7 @@ - + Node1->Node8 @@ -134,10 +134,22 @@ - + Node1->Node9 + + +Node3->Node3 + + + + + +Node4->Node4 + + + diff --git a/d2/d1a/vigenere__cipher_8cpp__incl.svg b/d2/d1a/vigenere__cipher_8cpp__incl.svg index 3bc267783..18b6d61b2 100644 --- a/d2/d1a/vigenere__cipher_8cpp__incl.svg +++ b/d2/d1a/vigenere__cipher_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: sorting/gnome_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d2/d21/gnome__sort_8cpp.html','../../' -
-
gnome_sort.cpp File Reference
+
gnome_sort.cpp File Reference
-

Implementation of gnome sort algorithm. +

Implementation of gnome sort algorithm. More...

#include <algorithm>
#include <array>
@@ -111,34 +110,34 @@ Include dependency graph for gnome_sort.cpp:
- - +

+

Namespaces

 sorting
namespace  sorting
 Sorting algorithms.
 
- - - - + + +

+

Functions

template<typename T >
void sorting::gnomeSort (T *arr, int size)
 
template<typename T , size_t size>
std::array< T, size > sorting::gnomeSort (std::array< T, size > arr)
 
template<typename T , size_t size>
std::array< T, size > sorting::gnomeSort (std::array< T, size > arr)
 
static void test ()
 
int main ()
 

Detailed Description

-

Implementation of gnome sort algorithm.

-
Author
beqakd
+

Implementation of gnome sort algorithm.

+
Author
beqakd
-Krishna Vedala
+Krishna Vedala

Gnome sort algorithm is not the best one but it is widely used. The algorithm iteratively checks the order of pairs in the array. If they are on right order it moves to the next successive pair, otherwise it swaps elements. This operation is repeated until no more swaps are made thus indicating the values to be in ascending order.

-

The time Complexity of the algorithm is \(O(n^2)\) and in some cases it can be \(O(n)\).

+

The time Complexity of the algorithm is \(O(n^2)\) and in some cases it can be \(O(n)\).

Function Documentation

- +

◆ main()

@@ -153,11 +152,11 @@ Functions
-

Our main function with example of sort method.

-
130  {
-
131  test();
-
132  return 0;
-
133 }
+

Our main function with example of sort method.

+
130 {
+
131 test();
+
132 return 0;
+
133}
static void test()
Definition: gnome_sort.cpp:85
Here is the call graph for this function:
@@ -168,7 +167,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -190,48 +189,48 @@ Here is the call graph for this function:
-

Test function

-
85  {
-
86  // Example 1. Creating array of int,
-
87  std::cout << "Test 1 - as a C-array...";
-
88  const int size = 6;
-
89  std::array<int, size> arr = {-22, 100, 150, 35, -10, 99};
- -
91  size); // pass array data as a C-style array pointer
-
92  assert(std::is_sorted(std::begin(arr), std::end(arr)));
-
93  std::cout << " Passed\n";
-
94  for (int i = 0; i < size; i++) {
-
95  std::cout << arr[i] << ", ";
-
96  }
- -
98 
-
99  // Example 2. Creating array of doubles.
-
100  std::cout << "\nTest 2 - as a std::array...";
-
101  std::array<double, size> double_arr = {-100.2, 10.2, 20.0, 9.0, 7.5, 7.2};
-
102  std::array<double, size> sorted_arr = sorting::gnomeSort(double_arr);
-
103  assert(std::is_sorted(std::begin(sorted_arr), std::end(sorted_arr)));
-
104  std::cout << " Passed\n";
-
105  for (int i = 0; i < size; i++) {
-
106  std::cout << double_arr[i] << ", ";
-
107  }
-
108  std::cout << std::endl;
-
109 
-
110  // Example 3. Creating random array of float.
-
111  std::cout << "\nTest 3 - 200 random numbers as a std::array...";
-
112  const int size2 = 200;
-
113  std::array<float, size2> rand_arr{};
-
114 
-
115  for (auto &a : rand_arr) {
-
116  // generate random numbers between -5.0 and 4.99
-
117  a = float(std::rand() % 1000 - 500) / 100.f;
-
118  }
-
119 
-
120  std::array<float, size2> float_arr = sorting::gnomeSort(rand_arr);
-
121  assert(std::is_sorted(std::begin(float_arr), std::end(float_arr)));
-
122  std::cout << " Passed\n";
-
123  // for (int i = 0; i < size; i++) std::cout << double_arr[i] << ", ";
-
124  std::cout << std::endl;
-
125 }
+

Test function

+
85 {
+
86 // Example 1. Creating array of int,
+
87 std::cout << "Test 1 - as a C-array...";
+
88 const int size = 6;
+
89 std::array<int, size> arr = {-22, 100, 150, 35, -10, 99};
+ +
91 size); // pass array data as a C-style array pointer
+
92 assert(std::is_sorted(std::begin(arr), std::end(arr)));
+
93 std::cout << " Passed\n";
+
94 for (int i = 0; i < size; i++) {
+
95 std::cout << arr[i] << ", ";
+
96 }
+ +
98
+
99 // Example 2. Creating array of doubles.
+
100 std::cout << "\nTest 2 - as a std::array...";
+
101 std::array<double, size> double_arr = {-100.2, 10.2, 20.0, 9.0, 7.5, 7.2};
+
102 std::array<double, size> sorted_arr = sorting::gnomeSort(double_arr);
+
103 assert(std::is_sorted(std::begin(sorted_arr), std::end(sorted_arr)));
+
104 std::cout << " Passed\n";
+
105 for (int i = 0; i < size; i++) {
+
106 std::cout << double_arr[i] << ", ";
+
107 }
+ +
109
+
110 // Example 3. Creating random array of float.
+
111 std::cout << "\nTest 3 - 200 random numbers as a std::array...";
+
112 const int size2 = 200;
+
113 std::array<float, size2> rand_arr{};
+
114
+
115 for (auto &a : rand_arr) {
+
116 // generate random numbers between -5.0 and 4.99
+
117 a = float(std::rand() % 1000 - 500) / 100.f;
+
118 }
+
119
+
120 std::array<float, size2> float_arr = sorting::gnomeSort(rand_arr);
+
121 assert(std::is_sorted(std::begin(float_arr), std::end(float_arr)));
+
122 std::cout << " Passed\n";
+
123 // for (int i = 0; i < size; i++) std::cout << double_arr[i] << ", ";
+ +
125}
T begin(T... args)
@@ -250,7 +249,7 @@ Here is the call graph for this function:
diff --git a/d2/d21/gnome__sort_8cpp.js b/d2/d21/gnome__sort_8cpp.js index 2e78f7bde..f127bdddc 100644 --- a/d2/d21/gnome__sort_8cpp.js +++ b/d2/d21/gnome__sort_8cpp.js @@ -1,6 +1,6 @@ var gnome__sort_8cpp = [ - [ "gnomeSort", "d2/d21/gnome__sort_8cpp.html#a70a6a99d554280c326f80355c4d2c494", null ], + [ "gnomeSort", "d2/d21/gnome__sort_8cpp.html#aa3677f87b5b4756bc77e9e34c5f27935", null ], [ "gnomeSort", "d2/d21/gnome__sort_8cpp.html#a2f8bc626eb57acae24a94636a23af6a1", null ], [ "main", "d2/d21/gnome__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "test", "d2/d21/gnome__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] diff --git a/d2/d21/gnome__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d2/d21/gnome__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 300ff3497..b1bbe450c 100644 --- a/d2/d21/gnome__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d2/d21/gnome__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: search/jump_search.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('d2/d22/jump__search_8cpp.html','../../
-
-
jump_search.cpp File Reference
+
jump_search.cpp File Reference
-

C++ program to implement Jump Search +

C++ program to implement Jump Search More...

#include <algorithm>
#include <cmath>
@@ -109,18 +108,17 @@ Include dependency graph for jump_search.cpp:
- - +

+

Functions

int jumpSearch (int arr[], int x, int n)
 
-int main ()
int main ()
 

Detailed Description

-

C++ program to implement Jump Search

+

C++ program to implement Jump Search

Function Documentation

- +

◆ jumpSearch()

@@ -151,37 +149,37 @@ int main ()
-

jump search implementation

-
12  {
-
13  // Finding block size to be jumped
-
14  int step = std::sqrt(n);
-
15 
-
16  // Finding the block where element is
-
17  // present (if it is present)
-
18  int prev = 0;
-
19  while (arr[std::min(step, n) - 1] < x) {
-
20  prev = step;
-
21  step += std::sqrt(n);
-
22  if (prev >= n)
-
23  return -1;
-
24  }
-
25 
-
26  // Doing a linear search for x in block
-
27  // beginning with prev.
-
28  while (arr[prev] < x) {
-
29  prev++;
-
30 
-
31  // If we reached next block or end of
-
32  // array, element is not present.
-
33  if (prev == std::min(step, n))
-
34  return -1;
-
35  }
-
36  // If element is found
-
37  if (arr[prev] == x)
-
38  return prev;
-
39 
-
40  return -1;
-
41 }
+

jump search implementation

+
12 {
+
13 // Finding block size to be jumped
+
14 int step = std::sqrt(n);
+
15
+
16 // Finding the block where element is
+
17 // present (if it is present)
+
18 int prev = 0;
+
19 while (arr[std::min(step, n) - 1] < x) {
+
20 prev = step;
+
21 step += std::sqrt(n);
+
22 if (prev >= n)
+
23 return -1;
+
24 }
+
25
+
26 // Doing a linear search for x in block
+
27 // beginning with prev.
+
28 while (arr[prev] < x) {
+
29 prev++;
+
30
+
31 // If we reached next block or end of
+
32 // array, element is not present.
+
33 if (prev == std::min(step, n))
+
34 return -1;
+
35 }
+
36 // If element is found
+
37 if (arr[prev] == x)
+
38 return prev;
+
39
+
40 return -1;
+
41}
T min(T... args)
T prev(T... args)
T sqrt(T... args)
@@ -192,6 +190,38 @@ Here is the call graph for this function:
+
+ + +

◆ main()

+ +
+
+ + + + + + + + +
int main (void )
+
+
44 {
+
45 int arr[] = {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610};
+
46 int x = 55;
+
47 int n = sizeof(arr) / sizeof(arr[0]);
+
48
+
49 // Find the index of 'x' using Jump Search
+
50 int index = jumpSearch(arr, x, n);
+
51
+
52 // Print the index where 'x' is located
+
53 std::cout << "\nNumber " << x << " is at index " << index;
+
54 return 0;
+
55}
+ +
int jumpSearch(int arr[], int x, int n)
Definition: jump_search.cpp:12
+
@@ -200,7 +230,7 @@ Here is the call graph for this function: diff --git a/d2/d22/jump__search_8cpp.js b/d2/d22/jump__search_8cpp.js index cab15a289..3b2d743ea 100644 --- a/d2/d22/jump__search_8cpp.js +++ b/d2/d22/jump__search_8cpp.js @@ -1,5 +1,4 @@ var jump__search_8cpp = [ - [ "jumpSearch", "d2/d22/jump__search_8cpp.html#ab49fd8f401bfc71f63b74711390cccf0", null ], - [ "main", "d2/d22/jump__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] + [ "jumpSearch", "d2/d22/jump__search_8cpp.html#ab49fd8f401bfc71f63b74711390cccf0", null ] ]; \ No newline at end of file diff --git a/d2/d22/jump__search_8cpp_ab49fd8f401bfc71f63b74711390cccf0_cgraph.svg b/d2/d22/jump__search_8cpp_ab49fd8f401bfc71f63b74711390cccf0_cgraph.svg index 2f4012703..ac758be1a 100644 --- a/d2/d22/jump__search_8cpp_ab49fd8f401bfc71f63b74711390cccf0_cgraph.svg +++ b/d2/d22/jump__search_8cpp_ab49fd8f401bfc71f63b74711390cccf0_cgraph.svg @@ -1,7 +1,7 @@ - - diff --git a/d2/d23/neural__network_8cpp__incl_org.svg b/d2/d23/neural__network_8cpp__incl_org.svg index b51997bb2..a2c690be7 100644 --- a/d2/d23/neural__network_8cpp__incl_org.svg +++ b/d2/d23/neural__network_8cpp__incl_org.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: sorting/count_inversions.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d2/d26/count__inversions_8cpp.html','. -
-
count_inversions.cpp File Reference
+
count_inversions.cpp File Reference
-

Counting Inversions using Merge Sort +

Counting Inversions using Merge Sort More...

#include <cassert>
#include <cstdint>
@@ -111,16 +110,16 @@ Include dependency graph for count_inversions.cpp:
- - + - +

+

Namespaces

 sorting
namespace  sorting
 Sorting algorithms.
 
 inversion
namespace  inversion
 Functions for counting inversions using Merge Sort algorithm.
 
- @@ -146,12 +145,12 @@ Functions

+

Functions

template<typename T >
uint32_t sorting::inversion::merge (T *arr, T *temp, uint32_t left, uint32_t mid, uint32_t right)
 

Detailed Description

-

Counting Inversions using Merge Sort

-

Program to count the number of inversions in an array using merge-sort.

-

The count of inversions help to determine how close the array is to be sorted in ASCENDING order.

-

two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j

-

Time Complexity --> O(n.log n)

-

Space Complexity --> O(n) ; additional array temp[1..n]

+

Counting Inversions using Merge Sort

+

Program to count the number of inversions in an array using merge-sort.

+

The count of inversions help to determine how close the array is to be sorted in ASCENDING order.

+

two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j

+

Time Complexity --> O(n.log n)

+

Space Complexity --> O(n) ; additional array temp[1..n]

Algorithm

    @@ -161,9 +160,9 @@ Algorithm
  1. The base case of recursion is when there is only one element in the given half.
  2. Print the answer
-
Author
Rakshit Raj
+
Author
Rakshit Raj

Function Documentation

- +

◆ countInversion()

@@ -192,7 +191,7 @@ template<class T >

Function countInversion() returns the number of inversion present in the input array. Inversions are an estimate of how close or far off the array is to being sorted.

-

Number of inversions in a sorted array is 0. Number of inversion in an array[1...n] sorted in non-ascending order is n(n-1)/2, since each pair of elements contitute an inversion.

+

Number of inversions in a sorted array is 0. Number of inversion in an array[1...n] sorted in non-ascending order is n(n-1)/2, since each pair of elements contitute an inversion.

Parameters
@@ -201,12 +200,12 @@ template<class T >
Returns
number of inversions in input array, sorts the array
-
164  {
-
165  std::vector<T> temp;
-
166  temp.reserve(size);
-
167  temp.assign(size, 0);
-
168  return mergeSort(arr, temp.data(), 0, size - 1);
-
169 }
+
164 {
+
165 std::vector<T> temp;
+
166 temp.reserve(size);
+
167 temp.assign(size, 0);
+
168 return mergeSort(arr, temp.data(), 0, size - 1);
+
169}
T assign(T... args)
T data(T... args)
void mergeSort(int *arr, int l, int r)
Definition: merge_sort.cpp:71
@@ -221,7 +220,7 @@ Here is the call graph for this function:
- +

◆ main()

@@ -239,11 +238,11 @@ Here is the call graph for this function:

Main function.

Returns
0 on exit
-
271  {
-
272  test(); // Run test implementations
-
273  // body(); // test your own array
-
274  return 0;
-
275 }
+
271 {
+
272 test(); // Run test implementations
+
273 // body(); // test your own array
+
274 return 0;
+
275}
static void test()
Test implementations.
Definition: count_inversions.cpp:194
Here is the call graph for this function:
@@ -254,7 +253,7 @@ Here is the call graph for this function:
- +

◆ merge()

@@ -301,8 +300,8 @@ template<typename T >

Function to merge two sub-arrays.

-

merge() function is called from mergeSort() to merge the array after it split for sorting by the mergeSort() funtion.

-

In this case the merge fuction will also count and return inversions detected when merging the sub arrays.

+

merge() function is called from mergeSort() to merge the array after it split for sorting by the mergeSort() funtion.

+

In this case the merge fuction will also count and return inversions detected when merging the sub arrays.

Parameters
arr- array, data member of std::vector<int>, input for counting inversions
@@ -314,40 +313,40 @@ template<typename T >
Returns
number of inversions found in merge step
-
85  {
-
86  uint32_t i = left; /* i --> index of left sub-array */
-
87  uint32_t j = mid + 1; /* j --> index for right sub-array */
-
88  uint32_t k = left; /* k --> index for resultant array temp */
-
89  uint32_t inv_count = 0; // inversion count
-
90 
-
91  while ((i <= mid) && (j <= right)) {
-
92  if (arr[i] <= arr[j]) {
-
93  temp[k++] = arr[i++];
-
94  } else {
-
95  temp[k++] = arr[j++];
-
96  inv_count +=
-
97  (mid - i +
-
98  1); // tricky; may vary depending on selection of sub-array
-
99  }
-
100  }
-
101  // Add remaining elements from the larger subarray to the end of temp
-
102  while (i <= mid) {
-
103  temp[k++] = arr[i++];
-
104  }
-
105  while (j <= right) {
-
106  temp[k++] = arr[j++];
-
107  }
-
108  // Copy temp[] to arr[]
-
109  for (k = left; k <= right; k++) {
-
110  arr[k] = temp[k];
-
111  }
-
112  return inv_count;
-
113 }
+
85 {
+
86 uint32_t i = left; /* i --> index of left sub-array */
+
87 uint32_t j = mid + 1; /* j --> index for right sub-array */
+
88 uint32_t k = left; /* k --> index for resultant array temp */
+
89 uint32_t inv_count = 0; // inversion count
+
90
+
91 while ((i <= mid) && (j <= right)) {
+
92 if (arr[i] <= arr[j]) {
+
93 temp[k++] = arr[i++];
+
94 } else {
+
95 temp[k++] = arr[j++];
+
96 inv_count +=
+
97 (mid - i +
+
98 1); // tricky; may vary depending on selection of sub-array
+
99 }
+
100 }
+
101 // Add remaining elements from the larger subarray to the end of temp
+
102 while (i <= mid) {
+
103 temp[k++] = arr[i++];
+
104 }
+
105 while (j <= right) {
+
106 temp[k++] = arr[j++];
+
107 }
+
108 // Copy temp[] to arr[]
+
109 for (k = left; k <= right; k++) {
+
110 arr[k] = temp[k];
+
111 }
+
112 return inv_count;
+
113}
T left(T... args)
- +

◆ mergeSort()

@@ -388,7 +387,7 @@ template<typename T >

Implement merge Sort and count inverions while merging.

-

The mergeSort() function implements Merge Sort, a Divide and conquer algorithm, it divides the input array into two halves and calls itself for each sub-array and then calls the merge() function to merge the two halves.

+

The mergeSort() function implements Merge Sort, a Divide and conquer algorithm, it divides the input array into two halves and calls itself for each sub-array and then calls the merge() function to merge the two halves.

Parameters
arrinput array, data-menber of vector
@@ -399,31 +398,31 @@ template<typename T >
Returns
number of inversions in array
-
132  {
-
133  uint32_t mid = 0, inv_count = 0;
-
134  if (right > left) {
-
135  // midpoint to split the array
-
136  mid = (right + left) / 2;
-
137  // Add inversions in left and right sub-arrays
-
138  inv_count += mergeSort(arr, temp, left, mid); // left sub-array
-
139  inv_count += mergeSort(arr, temp, mid + 1, right);
-
140 
-
141  // inversions in the merge step
-
142  inv_count += merge(arr, temp, left, mid, right);
-
143  }
-
144  return inv_count;
-
145 }
+
132 {
+
133 uint32_t mid = 0, inv_count = 0;
+
134 if (right > left) {
+
135 // midpoint to split the array
+
136 mid = (right + left) / 2;
+
137 // Add inversions in left and right sub-arrays
+
138 inv_count += mergeSort(arr, temp, left, mid); // left sub-array
+
139 inv_count += mergeSort(arr, temp, mid + 1, right);
+
140
+
141 // inversions in the merge step
+
142 inv_count += merge(arr, temp, left, mid, right);
+
143 }
+
144 return inv_count;
+
145}
void merge(int *arr, int l, int m, int r)
Definition: merge_sort.cpp:33
Here is the call graph for this function:
-
+
- +

◆ show()

@@ -460,18 +459,18 @@ template<typename T >
Returns
void
-
179  {
-
180  std::cout << "Printing array: \n";
-
181  for (uint32_t i = 0; i < array_size; i++) {
-
182  std::cout << " " << arr[i];
-
183  }
-
184  std::cout << "\n";
-
185 }
+
179 {
+
180 std::cout << "Printing array: \n";
+
181 for (uint32_t i = 0; i < array_size; i++) {
+
182 std::cout << " " << arr[i];
+
183 }
+
184 std::cout << "\n";
+
185}
- +

◆ test()

@@ -496,39 +495,39 @@ template<typename T >

Test implementations.

Returns
void
-
194  {
-
195  // Test 1
-
196  std::vector<uint64_t> arr1 = {
-
197  100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84,
-
198  83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,
-
199  66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50,
-
200  49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33,
-
201  32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16,
-
202  15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
-
203  uint32_t size1 = arr1.size();
-
204  uint32_t inv_count1 = 4950;
-
205  uint32_t result1 = sorting::inversion::countInversion(arr1.data(), size1);
-
206  assert(inv_count1 == result1);
-
207  // Test 2
-
208  std::vector<int> arr2 = {22, 66, 75, 23, 11, 87, 2, 44, 98, 43};
-
209  uint32_t size2 = arr2.size();
-
210  uint32_t inv_count2 = 20;
-
211  uint32_t result2 = sorting::inversion::countInversion(arr2.data(), size2);
-
212  assert(inv_count2 == result2);
-
213  // Test 3
-
214  std::vector<double> arr3 = {33.1, 45.2, 65.4, 76.5, 1.0,
-
215  2.9, 5.4, 7.7, 88.9, 12.4};
-
216  uint32_t size3 = arr3.size();
-
217  uint32_t inv_count3 = 21;
-
218  uint32_t result3 = sorting::inversion::countInversion(arr3.data(), size3);
-
219  assert(inv_count3 == result3);
-
220  // Test 4
-
221  std::vector<char> arr4 = {'a', 'b', 'c', 'd', 'e'};
-
222  uint32_t size4 = arr4.size();
-
223  uint32_t inv_count4 = 0;
-
224  uint32_t result4 = sorting::inversion::countInversion(arr4.data(), size4);
-
225  assert(inv_count4 == result4);
-
226 }
+
194 {
+
195 // Test 1
+
196 std::vector<uint64_t> arr1 = {
+
197 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84,
+
198 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,
+
199 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50,
+
200 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33,
+
201 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16,
+
202 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
+
203 uint32_t size1 = arr1.size();
+
204 uint32_t inv_count1 = 4950;
+
205 uint32_t result1 = sorting::inversion::countInversion(arr1.data(), size1);
+
206 assert(inv_count1 == result1);
+
207 // Test 2
+
208 std::vector<int> arr2 = {22, 66, 75, 23, 11, 87, 2, 44, 98, 43};
+
209 uint32_t size2 = arr2.size();
+
210 uint32_t inv_count2 = 20;
+
211 uint32_t result2 = sorting::inversion::countInversion(arr2.data(), size2);
+
212 assert(inv_count2 == result2);
+
213 // Test 3
+
214 std::vector<double> arr3 = {33.1, 45.2, 65.4, 76.5, 1.0,
+
215 2.9, 5.4, 7.7, 88.9, 12.4};
+
216 uint32_t size3 = arr3.size();
+
217 uint32_t inv_count3 = 21;
+
218 uint32_t result3 = sorting::inversion::countInversion(arr3.data(), size3);
+
219 assert(inv_count3 == result3);
+
220 // Test 4
+
221 std::vector<char> arr4 = {'a', 'b', 'c', 'd', 'e'};
+
222 uint32_t size4 = arr4.size();
+
223 uint32_t inv_count4 = 0;
+
224 uint32_t result4 = sorting::inversion::countInversion(arr4.data(), size4);
+
225 assert(inv_count4 == result4);
+
226}
uint32_t countInversion(T *arr, const uint32_t size)
Function countInversion() returns the number of inversion present in the input array....
Definition: count_inversions.cpp:164
T size(T... args)
@@ -546,7 +545,7 @@ Here is the call graph for this function:
diff --git a/d2/d26/count__inversions_8cpp_a3332498eabf6579ef059c0d0e9f4ec80_cgraph.svg b/d2/d26/count__inversions_8cpp_a3332498eabf6579ef059c0d0e9f4ec80_cgraph.svg index 7ea4d7538..564b80c60 100644 --- a/d2/d26/count__inversions_8cpp_a3332498eabf6579ef059c0d0e9f4ec80_cgraph.svg +++ b/d2/d26/count__inversions_8cpp_a3332498eabf6579ef059c0d0e9f4ec80_cgraph.svg @@ -1,7 +1,7 @@ - - - - + - + - + diff --git a/d2/d26/count__inversions_8cpp_ae97a486e14101c4822ea8dc47f0d1661_cgraph.md5 b/d2/d26/count__inversions_8cpp_ae97a486e14101c4822ea8dc47f0d1661_cgraph.md5 index 41266ce21..7472704b4 100644 --- a/d2/d26/count__inversions_8cpp_ae97a486e14101c4822ea8dc47f0d1661_cgraph.md5 +++ b/d2/d26/count__inversions_8cpp_ae97a486e14101c4822ea8dc47f0d1661_cgraph.md5 @@ -1 +1 @@ -5f4a2e9fee943e5cad1ba066050e900c \ No newline at end of file +63b0853ea5b2ae46e9a34f1d91b0c83b \ No newline at end of file diff --git a/d2/d26/count__inversions_8cpp_ae97a486e14101c4822ea8dc47f0d1661_cgraph.svg b/d2/d26/count__inversions_8cpp_ae97a486e14101c4822ea8dc47f0d1661_cgraph.svg index dbd579f42..e5e225730 100644 --- a/d2/d26/count__inversions_8cpp_ae97a486e14101c4822ea8dc47f0d1661_cgraph.svg +++ b/d2/d26/count__inversions_8cpp_ae97a486e14101c4822ea8dc47f0d1661_cgraph.svg @@ -1,21 +1,21 @@ - - - + + sorting::inversion::mergeSort - + Node1 - -sorting::inversion -::mergeSort + +sorting::inversion +::mergeSort @@ -23,16 +23,16 @@ Node2 - -sorting::merge + +sorting::merge Node1->Node2 - - + + @@ -46,23 +46,29 @@ Node1->Node4 - - + + Node3 - -std::move + +std::move Node2->Node3 - - + + + + + +Node4->Node4 + + diff --git a/d2/d2c/structtower.html b/d2/d2c/structtower.html index 86be015ac..31e127367 100644 --- a/d2/d2c/structtower.html +++ b/d2/d2c/structtower.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: tower Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
@@ -42,21 +41,22 @@
arr- array to be sorted
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,24 +93,23 @@ $(document).ready(function(){initNavTree('d2/d2c/structtower.html','../../'); in -
-
tower Struct Reference
+
tower Struct Reference
- - + - +

+

Public Attributes

-int values [10]
+int values [10]
 Values in the tower.
 
-int top
+int top
 top tower ID
 

Detailed Description

-

Define the state of tower

+

Define the state of tower


The documentation for this struct was generated from the following file: @@ -120,7 +119,7 @@ int 
    - +
diff --git a/d2/d36/structgeometry_1_1jarvis_1_1_point-members.html b/d2/d36/structgeometry_1_1jarvis_1_1_point-members.html index 20ec960de..a88f6cd68 100644 --- a/d2/d36/structgeometry_1_1jarvis_1_1_point-members.html +++ b/d2/d36/structgeometry_1_1jarvis_1_1_point-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,21 +90,20 @@ $(document).ready(function(){initNavTree('d9/d5a/structgeometry_1_1jarvis_1_1_po
-
-
geometry::jarvis::Point Member List
+
geometry::jarvis::Point Member List

This is the complete list of members for geometry::jarvis::Point, including all inherited members.

- +
x (defined in geometry::jarvis::Point)geometry::jarvis::Point
y (defined in geometry::jarvis::Point)geometry::jarvis::Point
y (defined in geometry::jarvis::Point)geometry::jarvis::Point
diff --git a/d2/d38/pancake__sort_8cpp__incl.svg b/d2/d38/pancake__sort_8cpp__incl.svg index 400926c13..32663226c 100644 --- a/d2/d38/pancake__sort_8cpp__incl.svg +++ b/d2/d38/pancake__sort_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: qr_algorithm Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,50 +92,49 @@ $(document).ready(function(){initNavTree('d2/d3b/namespaceqr__algorithm.html','.
-
-
qr_algorithm Namespace Reference
+
qr_algorithm Namespace Reference
-

Functions to compute QR decomposition of any rectangular matrix. +

Functions to compute QR decomposition of any rectangular matrix. More...

- - - - - - - + + + + + + - - - - - - - - + + + + + + + +

+

Functions

template<typename T >
std::ostreamoperator<< (std::ostream &out, std::valarray< std::valarray< T >> const &v)
 
template<typename T >
std::ostreamoperator<< (std::ostream &out, std::valarray< T > const &v)
 
template<typename T >
std::ostreamoperator<< (std::ostream &out, std::valarray< std::valarray< T > > const &v)
 
template<typename T >
std::ostreamoperator<< (std::ostream &out, std::valarray< T > const &v)
 
template<typename T >
double vector_dot (const std::valarray< T > &a, const std::valarray< T > &b)
 
template<typename T >
double vector_mag (const std::valarray< T > &a)
 
template<typename T >
std::valarray< T > vector_proj (const std::valarray< T > &a, const std::valarray< T > &b)
 
template<typename T >
void qr_decompose (const std::valarray< std::valarray< T >> &A, std::valarray< std::valarray< T >> *Q, std::valarray< std::valarray< T >> *R)
 
std::valarray< double > eigen_values (std::valarray< std::valarray< double >> *A, bool print_intermediates=false)
 
template<typename T >
std::valarray< T > vector_proj (const std::valarray< T > &a, const std::valarray< T > &b)
 
template<typename T >
void qr_decompose (const std::valarray< std::valarray< T > > &A, std::valarray< std::valarray< T > > *Q, std::valarray< std::valarray< T > > *R)
 
std::valarray< double > eigen_values (std::valarray< std::valarray< double > > *A, bool print_intermediates=false)
 

Detailed Description

-

Functions to compute QR decomposition of any rectangular matrix.

+

Functions to compute QR decomposition of any rectangular matrix.

Function Documentation

- -

◆ eigen_values()

+ +

◆ eigen_values()

- + - + @@ -151,7 +150,7 @@ Functions
std::valarray<double> qr_algorithm::eigen_values std::valarray< double > qr_algorithm::eigen_values (std::valarray< std::valarray< double >> * std::valarray< std::valarray< double > > *  A,
-

Compute eigen values using iterative shifted QR decomposition algorithm as follows:

    +

    Compute eigen values using iterative shifted QR decomposition algorithm as follows:

    1. Use last diagonal element of A as eigen value approximation \(c\)
    2. Shift diagonals of matrix \(A' = A - cI\)
    3. Decompose matrix \(A'=QR\)
    4. @@ -177,90 +176,90 @@ Functions -
      99  {
      -
      100  int rows = A->size();
      -
      101  int columns = rows;
      -
      102  int counter = 0, num_eigs = rows - 1;
      -
      103  double last_eig = 0;
      -
      104 
      - - -
      107 
      -
      108  /* number of eigen values = matrix size */
      -
      109  std::valarray<double> eigen_vals(rows);
      -
      110  for (int i = 0; i < rows; i++) {
      -
      111  Q[i] = std::valarray<double>(columns);
      -
      112  R[i] = std::valarray<double>(columns);
      -
      113  }
      -
      114 
      -
      115  /* continue till all eigen values are found */
      -
      116  while (num_eigs > 0) {
      -
      117  /* iterate with QR decomposition */
      -
      118  while (std::abs(A[0][num_eigs][num_eigs - 1]) >
      - -
      120  // initial approximation = last diagonal element
      -
      121  last_eig = A[0][num_eigs][num_eigs];
      -
      122  for (int i = 0; i < rows; i++) {
      -
      123  A[0][i][i] -= last_eig; /* A - cI */
      -
      124  }
      -
      125 
      -
      126  qr_decompose(*A, &Q, &R);
      -
      127 
      -
      128  if (print_intermediates) {
      -
      129  std::cout << *A << "\n";
      -
      130  std::cout << Q << "\n";
      -
      131  std::cout << R << "\n";
      -
      132  printf("-------------------- %d ---------------------\n",
      -
      133  ++counter);
      -
      134  }
      -
      135 
      -
      136  // new approximation A' = R * Q
      -
      137  mat_mul(R, Q, A);
      -
      138 
      -
      139  for (int i = 0; i < rows; i++) {
      -
      140  A[0][i][i] += last_eig; /* A + cI */
      -
      141  }
      -
      142  }
      -
      143 
      -
      144  /* store the converged eigen value */
      -
      145  eigen_vals[num_eigs] = last_eig;
      -
      146  // A[0][num_eigs][num_eigs];
      -
      147  if (print_intermediates) {
      -
      148  std::cout << "========================\n";
      -
      149  std::cout << "Eigen value: " << last_eig << ",\n";
      -
      150  std::cout << "========================\n";
      -
      151  }
      -
      152 
      -
      153  num_eigs--;
      -
      154  rows--;
      -
      155  columns--;
      -
      156  }
      -
      157  eigen_vals[0] = A[0][0][0];
      -
      158 
      -
      159  if (print_intermediates) {
      -
      160  std::cout << Q << "\n";
      -
      161  std::cout << R << "\n";
      -
      162  }
      -
      163 
      -
      164  return eigen_vals;
      -
      165 }
      +
      99 {
      +
      100 int rows = A->size();
      +
      101 int columns = rows;
      +
      102 int counter = 0, num_eigs = rows - 1;
      +
      103 double last_eig = 0;
      +
      104
      + + +
      107
      +
      108 /* number of eigen values = matrix size */
      +
      109 std::valarray<double> eigen_vals(rows);
      +
      110 for (int i = 0; i < rows; i++) {
      +
      111 Q[i] = std::valarray<double>(columns);
      +
      112 R[i] = std::valarray<double>(columns);
      +
      113 }
      +
      114
      +
      115 /* continue till all eigen values are found */
      +
      116 while (num_eigs > 0) {
      +
      117 /* iterate with QR decomposition */
      +
      118 while (std::abs(A[0][num_eigs][num_eigs - 1]) >
      + +
      120 // initial approximation = last diagonal element
      +
      121 last_eig = A[0][num_eigs][num_eigs];
      +
      122 for (int i = 0; i < rows; i++) {
      +
      123 A[0][i][i] -= last_eig; /* A - cI */
      +
      124 }
      +
      125
      +
      126 qr_decompose(*A, &Q, &R);
      +
      127
      +
      128 if (print_intermediates) {
      +
      129 std::cout << *A << "\n";
      +
      130 std::cout << Q << "\n";
      +
      131 std::cout << R << "\n";
      +
      132 printf("-------------------- %d ---------------------\n",
      +
      133 ++counter);
      +
      134 }
      +
      135
      +
      136 // new approximation A' = R * Q
      +
      137 mat_mul(R, Q, A);
      +
      138
      +
      139 for (int i = 0; i < rows; i++) {
      +
      140 A[0][i][i] += last_eig; /* A + cI */
      +
      141 }
      +
      142 }
      +
      143
      +
      144 /* store the converged eigen value */
      +
      145 eigen_vals[num_eigs] = last_eig;
      +
      146 // A[0][num_eigs][num_eigs];
      +
      147 if (print_intermediates) {
      +
      148 std::cout << "========================\n";
      +
      149 std::cout << "Eigen value: " << last_eig << ",\n";
      +
      150 std::cout << "========================\n";
      +
      151 }
      +
      152
      +
      153 num_eigs--;
      +
      154 rows--;
      +
      155 columns--;
      +
      156 }
      +
      157 eigen_vals[0] = A[0][0][0];
      +
      158
      +
      159 if (print_intermediates) {
      +
      160 std::cout << Q << "\n";
      +
      161 std::cout << R << "\n";
      +
      162 }
      +
      163
      +
      164 return eigen_vals;
      +
      165}
      T printf(T... args)
      -
      void qr_decompose(const std::valarray< std::valarray< T >> &A, std::valarray< std::valarray< T >> *Q, std::valarray< std::valarray< T >> *R)
      Definition: qr_decompose.h:146
      +
      void qr_decompose(const std::valarray< std::valarray< T > > &A, std::valarray< std::valarray< T > > *Q, std::valarray< std::valarray< T > > *R)
      Definition: qr_decompose.h:146
      -
      void mat_mul(const std::valarray< std::valarray< double >> &A, const std::valarray< std::valarray< double >> &B, std::valarray< std::valarray< double >> *OUT)
      Definition: qr_eigen_values.cpp:54
      +
      void mat_mul(const std::valarray< std::valarray< double > > &A, const std::valarray< std::valarray< double > > &B, std::valarray< std::valarray< double > > *OUT)
      Definition: qr_eigen_values.cpp:54
      Here is the call graph for this function:
      -
      +
      - -

      ◆ operator<<() [1/2]

      + +

      ◆ operator<<() [1/2]

      @@ -268,7 +267,7 @@ Here is the call graph for this function:
      template<typename T >
      - + @@ -276,7 +275,7 @@ template<typename T > - + @@ -286,21 +285,21 @@ template<typename T >
      std::ostream& qr_algorithm::operator<< std::ostream & qr_algorithm::operator<< ( std::ostream out,
      std::valarray< std::valarray< T >> const & std::valarray< std::valarray< T > > const &  v 
-

operator to print a matrix

-
34  {
-
35  const int width = 12;
-
36  const char separator = ' ';
-
37 
-
38  out.precision(4);
-
39  for (size_t row = 0; row < v.size(); row++) {
-
40  for (size_t col = 0; col < v[row].size(); col++)
-
41  out << std::right << std::setw(width) << std::setfill(separator)
-
42  << v[row][col];
-
43  out << std::endl;
-
44  }
-
45 
-
46  return out;
-
47 }
+

operator to print a matrix

+
34 {
+
35 const int width = 12;
+
36 const char separator = ' ';
+
37
+
38 out.precision(4);
+
39 for (size_t row = 0; row < v.size(); row++) {
+
40 for (size_t col = 0; col < v[row].size(); col++)
+
41 out << std::right << std::setw(width) << std::setfill(separator)
+
42 << v[row][col];
+
43 out << std::endl;
+
44 }
+
45
+
46 return out;
+
47}
T endl(T... args)
T right(T... args)
T precision(T... args)
@@ -309,14 +308,14 @@ template<typename T >
Here is the call graph for this function:
-
+
- -

◆ operator<<() [2/2]

+ +

◆ operator<<() [2/2]

@@ -324,7 +323,7 @@ Here is the call graph for this function:
template<typename T >
- + @@ -342,30 +341,30 @@ template<typename T >
std::ostream& qr_algorithm::operator<< std::ostream & qr_algorithm::operator<< ( std::ostream out,
-

operator to print a vector

-
53  {
-
54  const int width = 10;
-
55  const char separator = ' ';
-
56 
-
57  out.precision(4);
-
58  for (size_t row = 0; row < v.size(); row++) {
-
59  out << std::right << std::setw(width) << std::setfill(separator)
-
60  << v[row];
-
61  }
-
62 
-
63  return out;
-
64 }
+

operator to print a vector

+
53 {
+
54 const int width = 10;
+
55 const char separator = ' ';
+
56
+
57 out.precision(4);
+
58 for (size_t row = 0; row < v.size(); row++) {
+
59 out << std::right << std::setw(width) << std::setfill(separator)
+
60 << v[row];
+
61 }
+
62
+
63 return out;
+
64}
Here is the call graph for this function:
-
+
- -

◆ qr_decompose()

+ +

◆ qr_decompose()

@@ -375,19 +374,19 @@ template<typename T >
void qr_algorithm::qr_decompose ( - const std::valarray< std::valarray< T >> &  + const std::valarray< std::valarray< T > > &  A, - std::valarray< std::valarray< T >> *  + std::valarray< std::valarray< T > > *  Q, - std::valarray< std::valarray< T >> *  + std::valarray< std::valarray< T > > *  R  @@ -397,7 +396,7 @@ template<typename T >
-

Decompose matrix \(A\) using Gram-Schmidt process.

+

Decompose matrix \(A\) using Gram-Schmidt process.

\begin{eqnarray*} \text{given that}\quad A &=& *\left[\mathbf{a}_1,\mathbf{a}_2,\ldots,\mathbf{a}_{N-1},\right]\\ \text{where}\quad\mathbf{a}_i &=& \left[a_{0i},a_{1i},a_{2i},\ldots,a_{(M-1)i}\right]^T\quad\ldots\mbox{(column vectors)}\\ \text{then}\quad\mathbf{u}_i &=& \mathbf{a}_i *-\sum_{j=0}^{i-1}\text{proj}_{\mathbf{u}_j}\mathbf{a}_i\\ \mathbf{e}_i &=&\frac{\mathbf{u}_i}{\left|\mathbf{u}_i\right|}\\ Q &=& \begin{bmatrix}\mathbf{e}_0 & \mathbf{e}_1 & \mathbf{e}_2 & \dots & \mathbf{e}_{N-1}\end{bmatrix}\\ R &=& \begin{bmatrix}\langle\mathbf{e}_0\,,\mathbf{a}_0\rangle & \langle\mathbf{e}_1\,,\mathbf{a}_1\rangle & \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots \\ 0 & \langle\mathbf{e}_1\,,\mathbf{a}_1\rangle & \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\ 0 & 0 & \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix}\\ \end{eqnarray*}

@@ -409,79 +408,79 @@ template<typename T >
-
150  {
-
151  std::size_t ROWS = A.size(); // number of rows of A
-
152  std::size_t COLUMNS = A[0].size(); // number of columns of A
-
153  std::valarray<T> col_vector(ROWS);
-
154  std::valarray<T> col_vector2(ROWS);
-
155  std::valarray<T> tmp_vector(ROWS);
-
156 
-
157  for (int i = 0; i < COLUMNS; i++) {
-
158  /* for each column => R is a square matrix of NxN */
-
159  int j;
-
160  R[0][i] = 0.; /* make R upper triangular */
-
161 
-
162  /* get corresponding Q vector */
-
163 #ifdef _OPENMP
-
164 // parallelize on threads
-
165 #pragma omp for
-
166 #endif
-
167  for (j = 0; j < ROWS; j++) {
-
168  tmp_vector[j] = A[j][i]; /* accumulator for uk */
-
169  col_vector[j] = A[j][i];
-
170  }
-
171  for (j = 0; j < i; j++) {
-
172  for (int k = 0; k < ROWS; k++) {
-
173  col_vector2[k] = Q[0][k][j];
-
174  }
-
175  col_vector2 = vector_proj(col_vector, col_vector2);
-
176  tmp_vector -= col_vector2;
-
177  }
-
178 
-
179  double mag = vector_mag(tmp_vector);
-
180 
-
181 #ifdef _OPENMP
-
182 // parallelize on threads
-
183 #pragma omp for
-
184 #endif
-
185  for (j = 0; j < ROWS; j++) Q[0][j][i] = tmp_vector[j] / mag;
-
186 
-
187  /* compute upper triangular values of R */
-
188 #ifdef _OPENMP
-
189 // parallelize on threads
-
190 #pragma omp for
-
191 #endif
-
192  for (int kk = 0; kk < ROWS; kk++) {
-
193  col_vector[kk] = Q[0][kk][i];
-
194  }
-
195 
-
196 #ifdef _OPENMP
-
197 // parallelize on threads
-
198 #pragma omp for
-
199 #endif
-
200  for (int k = i; k < COLUMNS; k++) {
-
201  for (int kk = 0; kk < ROWS; kk++) {
-
202  col_vector2[kk] = A[kk][k];
-
203  }
-
204  R[0][i][k] = (col_vector * col_vector2).sum();
-
205  }
-
206  }
-
207 }
-
T sum(const std::vector< std::valarray< T >> &A)
Definition: vector_ops.hpp:232
-
std::valarray< T > vector_proj(const std::valarray< T > &a, const std::valarray< T > &b)
Definition: qr_decompose.h:104
+
150 {
+
151 std::size_t ROWS = A.size(); // number of rows of A
+
152 std::size_t COLUMNS = A[0].size(); // number of columns of A
+
153 std::valarray<T> col_vector(ROWS);
+
154 std::valarray<T> col_vector2(ROWS);
+
155 std::valarray<T> tmp_vector(ROWS);
+
156
+
157 for (int i = 0; i < COLUMNS; i++) {
+
158 /* for each column => R is a square matrix of NxN */
+
159 int j;
+
160 R[0][i] = 0.; /* make R upper triangular */
+
161
+
162 /* get corresponding Q vector */
+
163#ifdef _OPENMP
+
164// parallelize on threads
+
165#pragma omp for
+
166#endif
+
167 for (j = 0; j < ROWS; j++) {
+
168 tmp_vector[j] = A[j][i]; /* accumulator for uk */
+
169 col_vector[j] = A[j][i];
+
170 }
+
171 for (j = 0; j < i; j++) {
+
172 for (int k = 0; k < ROWS; k++) {
+
173 col_vector2[k] = Q[0][k][j];
+
174 }
+
175 col_vector2 = vector_proj(col_vector, col_vector2);
+
176 tmp_vector -= col_vector2;
+
177 }
+
178
+
179 double mag = vector_mag(tmp_vector);
+
180
+
181#ifdef _OPENMP
+
182// parallelize on threads
+
183#pragma omp for
+
184#endif
+
185 for (j = 0; j < ROWS; j++) Q[0][j][i] = tmp_vector[j] / mag;
+
186
+
187 /* compute upper triangular values of R */
+
188#ifdef _OPENMP
+
189// parallelize on threads
+
190#pragma omp for
+
191#endif
+
192 for (int kk = 0; kk < ROWS; kk++) {
+
193 col_vector[kk] = Q[0][kk][i];
+
194 }
+
195
+
196#ifdef _OPENMP
+
197// parallelize on threads
+
198#pragma omp for
+
199#endif
+
200 for (int k = i; k < COLUMNS; k++) {
+
201 for (int kk = 0; kk < ROWS; kk++) {
+
202 col_vector2[kk] = A[kk][k];
+
203 }
+
204 R[0][i][k] = (col_vector * col_vector2).sum();
+
205 }
+
206 }
+
207}
+
T sum(const std::vector< std::valarray< T > > &A)
Definition: vector_ops.hpp:232
+
std::valarray< T > vector_proj(const std::valarray< T > &a, const std::valarray< T > &b)
Definition: qr_decompose.h:104
double vector_mag(const std::valarray< T > &a)
Definition: qr_decompose.h:92
double mag(const std::array< double, 3 > &vec)
Calculates the magnitude of the mathematical vector from it's direction ratios.
Definition: vector_cross_product.cpp:83
Here is the call graph for this function:
-
+
- +

◆ vector_dot()

@@ -516,19 +515,19 @@ template<typename T >
-

Compute dot product of two vectors of equal lengths

-

If \(\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\) and \(\vec{b}=\left[b_0,b_1,b_1,...,b_L\right]\) then \(\vec{a}\cdot\vec{b}=\displaystyle\sum_{i=0}^L a_i\times b_i\)

+

Compute dot product of two vectors of equal lengths

+

If \(\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\) and \(\vec{b}=\left[b_0,b_1,b_1,...,b_L\right]\) then \(\vec{a}\cdot\vec{b}=\displaystyle\sum_{i=0}^L a_i\times b_i\)

Returns
\(\vec{a}\cdot\vec{b}\)
-
76  {
-
77  return (a * b).sum();
-
78  // could also use following
-
79  // return std::inner_product(std::begin(a), std::end(a), std::begin(b),
-
80  // 0.f);
-
81 }
+
76 {
+
77 return (a * b).sum();
+
78 // could also use following
+
79 // return std::inner_product(std::begin(a), std::end(a), std::begin(b),
+
80 // 0.f);
+
81}
- +

◆ vector_mag()

@@ -553,13 +552,13 @@ template<typename T >
-

Compute magnitude of vector.

-

If \(\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\) then \(\left|\vec{a}\right|=\sqrt{\displaystyle\sum_{i=0}^L a_i^2}\)

+

Compute magnitude of vector.

+

If \(\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\) then \(\left|\vec{a}\right|=\sqrt{\displaystyle\sum_{i=0}^L a_i^2}\)

Returns
\(\left|\vec{a}\right|\)
-
92  {
-
93  double dot = vector_dot(a, a);
-
94  return std::sqrt(dot);
-
95 }
+
92 {
+
93 double dot = vector_dot(a, a);
+
94 return std::sqrt(dot);
+
95}
double vector_dot(const std::valarray< T > &a, const std::valarray< T > &b)
Definition: qr_decompose.h:76
T sqrt(T... args)
@@ -571,8 +570,8 @@ Here is the call graph for this function:
- -

◆ vector_proj()

+ +

◆ vector_proj()

@@ -580,7 +579,7 @@ Here is the call graph for this function:
template<typename T >
- + @@ -598,29 +597,29 @@ template<typename T >
std::valarray<T> qr_algorithm::vector_proj std::valarray< T > qr_algorithm::vector_proj ( const std::valarray< T > &  a,
-

Compute projection of vector \(\vec{a}\) on \(\vec{b}\) defined as

+

Compute projection of vector \(\vec{a}\) on \(\vec{b}\) defined as

\[\text{proj}_\vec{b}\vec{a}=\frac{\vec{a}\cdot\vec{b}}{\left|\vec{b}\right|^2}\vec{b}\]

Returns
NULL if error, otherwise pointer to output
-

check for division by zero using machine epsilon

-
105  {
-
106  double num = vector_dot(a, b);
-
107  double deno = vector_dot(b, b);
-
108 
-
109  /*! check for division by zero using machine epsilon */
-
110  if (deno <= std::numeric_limits<double>::epsilon()) {
-
111  std::cerr << "[" << __func__ << "] Possible division by zero\n";
-
112  return a; // return vector a back
-
113  }
-
114 
-
115  double scalar = num / deno;
-
116 
-
117  return b * scalar;
-
118 }
+

check for division by zero using machine epsilon

+
105 {
+
106 double num = vector_dot(a, b);
+
107 double deno = vector_dot(b, b);
+
108
+
109 /*! check for division by zero using machine epsilon */
+ +
111 std::cerr << "[" << __func__ << "] Possible division by zero\n";
+
112 return a; // return vector a back
+
113 }
+
114
+
115 double scalar = num / deno;
+
116
+
117 return b * scalar;
+
118}
Here is the call graph for this function:
-
+
@@ -632,7 +631,7 @@ Here is the call graph for this function:
diff --git a/d2/d3b/namespaceqr__algorithm_a240edf2b6b5942c0e5f2c9d3e326797f_cgraph.map b/d2/d3b/namespaceqr__algorithm_a257425cb2365359da51c6fe6741834d8_cgraph.map similarity index 100% rename from d2/d3b/namespaceqr__algorithm_a240edf2b6b5942c0e5f2c9d3e326797f_cgraph.map rename to d2/d3b/namespaceqr__algorithm_a257425cb2365359da51c6fe6741834d8_cgraph.map diff --git a/d2/d3b/namespaceqr__algorithm_a240edf2b6b5942c0e5f2c9d3e326797f_cgraph.md5 b/d2/d3b/namespaceqr__algorithm_a257425cb2365359da51c6fe6741834d8_cgraph.md5 similarity index 100% rename from d2/d3b/namespaceqr__algorithm_a240edf2b6b5942c0e5f2c9d3e326797f_cgraph.md5 rename to d2/d3b/namespaceqr__algorithm_a257425cb2365359da51c6fe6741834d8_cgraph.md5 diff --git a/d2/d3b/namespaceqr__algorithm_a240edf2b6b5942c0e5f2c9d3e326797f_cgraph.svg b/d2/d3b/namespaceqr__algorithm_a257425cb2365359da51c6fe6741834d8_cgraph.svg similarity index 98% rename from d2/d3b/namespaceqr__algorithm_a240edf2b6b5942c0e5f2c9d3e326797f_cgraph.svg rename to d2/d3b/namespaceqr__algorithm_a257425cb2365359da51c6fe6741834d8_cgraph.svg index 2496cdb20..4d61498f1 100644 --- a/d2/d3b/namespaceqr__algorithm_a240edf2b6b5942c0e5f2c9d3e326797f_cgraph.svg +++ b/d2/d3b/namespaceqr__algorithm_a257425cb2365359da51c6fe6741834d8_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + + - + diff --git a/d2/d3b/namespaceqr__algorithm_a28e2fa3e803abaea6c568dc45d69d8cc_cgraph.md5 b/d2/d3b/namespaceqr__algorithm_a28e2fa3e803abaea6c568dc45d69d8cc_cgraph.md5 new file mode 100644 index 000000000..eaede4295 --- /dev/null +++ b/d2/d3b/namespaceqr__algorithm_a28e2fa3e803abaea6c568dc45d69d8cc_cgraph.md5 @@ -0,0 +1 @@ +ff1ce491baef77cae98d3923cd25991e \ No newline at end of file diff --git a/d2/d3b/namespaceqr__algorithm_a763896dbb4a7e95c4a1e614ac0819d66_cgraph.svg b/d2/d3b/namespaceqr__algorithm_a28e2fa3e803abaea6c568dc45d69d8cc_cgraph.svg similarity index 96% rename from d2/d3b/namespaceqr__algorithm_a763896dbb4a7e95c4a1e614ac0819d66_cgraph.svg rename to d2/d3b/namespaceqr__algorithm_a28e2fa3e803abaea6c568dc45d69d8cc_cgraph.svg index d40ab0523..6f3ce8a22 100644 --- a/d2/d3b/namespaceqr__algorithm_a763896dbb4a7e95c4a1e614ac0819d66_cgraph.svg +++ b/d2/d3b/namespaceqr__algorithm_a28e2fa3e803abaea6c568dc45d69d8cc_cgraph.svg @@ -1,7 +1,7 @@ - @@ -68,7 +68,7 @@ var sectionId = 'dynsection-0'; Node2 - + mat_mul @@ -83,7 +83,7 @@ var sectionId = 'dynsection-0'; Node3 - + qr_algorithm::qr_decompose @@ -98,7 +98,7 @@ var sectionId = 'dynsection-0'; Node4 - + machine_learning::sum @@ -128,7 +128,7 @@ var sectionId = 'dynsection-0'; Node8 - + qr_algorithm::vector_proj @@ -210,7 +210,7 @@ var sectionId = 'dynsection-0'; - + - Node2 - + mat_mul @@ -37,7 +37,7 @@ Node3 - + qr_algorithm::qr_decompose @@ -52,7 +52,7 @@ Node4 - + machine_learning::sum @@ -82,7 +82,7 @@ Node8 - + qr_algorithm::vector_proj diff --git a/d2/d3b/namespaceqr__algorithm_a5422c76bfa322620de611083bd518d71_cgraph.map b/d2/d3b/namespaceqr__algorithm_a6d3c7dce1f142141f509d09f6c0e25dc_cgraph.map similarity index 100% rename from d2/d3b/namespaceqr__algorithm_a5422c76bfa322620de611083bd518d71_cgraph.map rename to d2/d3b/namespaceqr__algorithm_a6d3c7dce1f142141f509d09f6c0e25dc_cgraph.map diff --git a/d2/d3b/namespaceqr__algorithm_a5422c76bfa322620de611083bd518d71_cgraph.md5 b/d2/d3b/namespaceqr__algorithm_a6d3c7dce1f142141f509d09f6c0e25dc_cgraph.md5 similarity index 100% rename from d2/d3b/namespaceqr__algorithm_a5422c76bfa322620de611083bd518d71_cgraph.md5 rename to d2/d3b/namespaceqr__algorithm_a6d3c7dce1f142141f509d09f6c0e25dc_cgraph.md5 diff --git a/d2/d3b/namespaceqr__algorithm_a5422c76bfa322620de611083bd518d71_cgraph.svg b/d2/d3b/namespaceqr__algorithm_a6d3c7dce1f142141f509d09f6c0e25dc_cgraph.svg similarity index 96% rename from d2/d3b/namespaceqr__algorithm_a5422c76bfa322620de611083bd518d71_cgraph.svg rename to d2/d3b/namespaceqr__algorithm_a6d3c7dce1f142141f509d09f6c0e25dc_cgraph.svg index 586ab9fb3..af27f2d41 100644 --- a/d2/d3b/namespaceqr__algorithm_a5422c76bfa322620de611083bd518d71_cgraph.svg +++ b/d2/d3b/namespaceqr__algorithm_a6d3c7dce1f142141f509d09f6c0e25dc_cgraph.svg @@ -1,7 +1,7 @@ - - + - + diff --git a/d2/d3b/namespaceqr__algorithm_a73ce637634fc49e1d10d190eb388ebf1_cgraph.md5 b/d2/d3b/namespaceqr__algorithm_a73ce637634fc49e1d10d190eb388ebf1_cgraph.md5 new file mode 100644 index 000000000..3b3b1fded --- /dev/null +++ b/d2/d3b/namespaceqr__algorithm_a73ce637634fc49e1d10d190eb388ebf1_cgraph.md5 @@ -0,0 +1 @@ +282e3bc80ac2f821dcf3616342fe3a0c \ No newline at end of file diff --git a/d2/d3b/namespaceqr__algorithm_ab1ac74497ffb2101040cc1efe3546de8_cgraph.svg b/d2/d3b/namespaceqr__algorithm_a73ce637634fc49e1d10d190eb388ebf1_cgraph.svg similarity index 96% rename from d2/d3b/namespaceqr__algorithm_ab1ac74497ffb2101040cc1efe3546de8_cgraph.svg rename to d2/d3b/namespaceqr__algorithm_a73ce637634fc49e1d10d190eb388ebf1_cgraph.svg index dfc7da69f..742eace34 100644 --- a/d2/d3b/namespaceqr__algorithm_ab1ac74497ffb2101040cc1efe3546de8_cgraph.svg +++ b/d2/d3b/namespaceqr__algorithm_a73ce637634fc49e1d10d190eb388ebf1_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + machine_learning::sum @@ -51,7 +51,7 @@ Node6 - + qr_algorithm::vector_proj diff --git a/d2/d3b/namespaceqr__algorithm_a763896dbb4a7e95c4a1e614ac0819d66_cgraph.md5 b/d2/d3b/namespaceqr__algorithm_a763896dbb4a7e95c4a1e614ac0819d66_cgraph.md5 deleted file mode 100644 index 470c5497b..000000000 --- a/d2/d3b/namespaceqr__algorithm_a763896dbb4a7e95c4a1e614ac0819d66_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -1d2d8f127f6ca7e70040d15547ca6324 \ No newline at end of file diff --git a/d2/d3b/namespaceqr__algorithm_ab1ac74497ffb2101040cc1efe3546de8_cgraph.md5 b/d2/d3b/namespaceqr__algorithm_ab1ac74497ffb2101040cc1efe3546de8_cgraph.md5 deleted file mode 100644 index f202f5045..000000000 --- a/d2/d3b/namespaceqr__algorithm_ab1ac74497ffb2101040cc1efe3546de8_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -079ee8ddd5c4a9041eb3938709d62d12 \ No newline at end of file diff --git a/d2/d3b/namespaceqr__algorithm_ad16da2183db22378435042f26af43d5f_cgraph.svg b/d2/d3b/namespaceqr__algorithm_ad16da2183db22378435042f26af43d5f_cgraph.svg index 983049ee2..bd8820d3f 100644 --- a/d2/d3b/namespaceqr__algorithm_ad16da2183db22378435042f26af43d5f_cgraph.svg +++ b/d2/d3b/namespaceqr__algorithm_ad16da2183db22378435042f26af43d5f_cgraph.svg @@ -1,7 +1,7 @@ - - - diff --git a/d2/d4b/spirograph_8cpp__incl_org.svg b/d2/d4b/spirograph_8cpp__incl_org.svg index b02910ce6..f7f728fef 100644 --- a/d2/d4b/spirograph_8cpp__incl_org.svg +++ b/d2/d4b/spirograph_8cpp__incl_org.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: sorting/heap_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('d2/d52/heap__sort_8cpp.html','../../')
-
-
heap_sort.cpp File Reference
+
heap_sort.cpp File Reference
-

Heap Sort Algorithm (heap sort) implementation +

Heap Sort Algorithm (heap sort) implementation More...

#include <algorithm>
#include <cassert>
@@ -109,14 +108,13 @@ Include dependency graph for heap_sort.cpp:
- - - + + @@ -127,12 +125,12 @@ template<typename T >

+

Functions

template<typename T >
void printArray (T *arr, int sz)
 
-template<typename T >
void heapify (T *arr, int n, int i)
template<typename T >
void heapify (T *arr, int n, int i)
 
template<typename T >
void heapSort (T *arr, int n)
 

Detailed Description

-

Heap Sort Algorithm (heap sort) implementation

-
Author
Ayaan Khan
+

Heap Sort Algorithm (heap sort) implementation

+
Author
Ayaan Khan

Heap-sort is a comparison-based sorting algorithm. Heap-sort can be thought of as an improved selection sort: like selection sort, heap sort divides its input into a sorted and an unsorted region, and it iteratively shrinks the unsorted region by extracting the largest element from it and inserting it into the sorted region. Unlike selection sort, heap sort does not waste time with a linear-time scan of the unsorted region; rather, heap sort maintains the unsorted region in a heap data structure to more quickly find the largest element in each step.

-

Time Complexity - \(O(n \log(n))\)

+

Time Complexity - \(O(n \log(n))\)

Function Documentation

- +

◆ main()

@@ -147,11 +145,11 @@ template<typename T >
-

Main function

-
120  {
-
121  test();
-
122  return 0;
-
123 }
+

Main function

+
120 {
+
121 test();
+
122 return 0;
+
123}
void test()
Definition: heap_sort.cpp:99
Here is the call graph for this function:
@@ -162,7 +160,7 @@ Here is the call graph for this function:
- +

◆ printArray()

@@ -189,7 +187,7 @@ template<typename T >
-

Utility function to print the array after sorting.

+

Utility function to print the array after sorting.

Parameters
@@ -197,15 +195,15 @@ template<typename T >
arrarray to be printed
-
37  {
-
38  for (int i = 0; i < sz; i++) std::cout << arr[i] << " ";
-
39  std::cout << "\n";
-
40 }
+
37 {
+
38 for (int i = 0; i < sz; i++) std::cout << arr[i] << " ";
+
39 std::cout << "\n";
+
40}
- +

◆ test()

@@ -219,26 +217,26 @@ template<typename T >
-

Test cases to test the program

-
99  {
-
100  std::cout << "Test 1\n";
-
101  int arr[] = {-10, 78, -1, -6, 7, 4, 94, 5, 99, 0};
-
102  int sz = sizeof(arr) / sizeof(arr[0]); // sz - size of array
-
103  printArray(arr, sz); // displaying the array before sorting
-
104  heapSort(arr, sz); // calling heapsort to sort the array
-
105  printArray(arr, sz); // display array after sorting
-
106  assert(std::is_sorted(arr, arr + sz));
-
107  std::cout << "Test 1 Passed\n========================\n";
-
108 
-
109  std::cout << "Test 2\n";
-
110  double arr2[] = {4.5, -3.6, 7.6, 0, 12.9};
-
111  sz = sizeof(arr2) / sizeof(arr2[0]);
-
112  printArray(arr2, sz);
-
113  heapSort(arr2, sz);
-
114  printArray(arr2, sz);
-
115  assert(std::is_sorted(arr2, arr2 + sz));
-
116  std::cout << "Test 2 passed\n";
-
117 }
+

Test cases to test the program

+
99 {
+
100 std::cout << "Test 1\n";
+
101 int arr[] = {-10, 78, -1, -6, 7, 4, 94, 5, 99, 0};
+
102 int sz = sizeof(arr) / sizeof(arr[0]); // sz - size of array
+
103 printArray(arr, sz); // displaying the array before sorting
+
104 heapSort(arr, sz); // calling heapsort to sort the array
+
105 printArray(arr, sz); // display array after sorting
+
106 assert(std::is_sorted(arr, arr + sz));
+
107 std::cout << "Test 1 Passed\n========================\n";
+
108
+
109 std::cout << "Test 2\n";
+
110 double arr2[] = {4.5, -3.6, 7.6, 0, 12.9};
+
111 sz = sizeof(arr2) / sizeof(arr2[0]);
+
112 printArray(arr2, sz);
+
113 heapSort(arr2, sz);
+
114 printArray(arr2, sz);
+
115 assert(std::is_sorted(arr2, arr2 + sz));
+
116 std::cout << "Test 2 passed\n";
+
117}
void heapSort(T *arr, int n)
Definition: heap_sort.cpp:84
void printArray(T *arr, int sz)
Definition: heap_sort.cpp:37
T is_sorted(T... args)
@@ -257,7 +255,7 @@ Here is the call graph for this function:
diff --git a/d2/d52/heap__sort_8cpp.js b/d2/d52/heap__sort_8cpp.js index c12d746e4..2e5e15336 100644 --- a/d2/d52/heap__sort_8cpp.js +++ b/d2/d52/heap__sort_8cpp.js @@ -1,6 +1,5 @@ var heap__sort_8cpp = [ - [ "heapify", "d5/d4c/group__sorting.html#gabd9a93f241c5c86f2ec0abf8b66b4145", null ], [ "heapSort", "d5/d4c/group__sorting.html#ga29d28b140174dbdde7c9f5157758435f", null ], [ "main", "d2/d52/heap__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "printArray", "d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767", null ], diff --git a/d2/d52/heap__sort_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg b/d2/d52/heap__sort_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg index 165d1d484..e8ac96642 100644 --- a/d2/d52/heap__sort_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg +++ b/d2/d52/heap__sort_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: machine_learning/neural_network.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('d2/d58/neural__network_8cpp.html','../ Classes | Namespaces | Functions -
-
neural_network.cpp File Reference
+
neural_network.cpp File Reference
-

Implementation of Multilayer Perceptron. +

Implementation of Multilayer Perceptron. More...

#include <algorithm>
#include <cassert>
@@ -119,32 +118,32 @@ Include dependency graph for neural_network.cpp:
-

+

Classes

class  machine_learning::neural_network::layers::DenseLayer
 
class  machine_learning::neural_network::NeuralNetwork
 
- - - + + - + - + - + - +

+

Namespaces

 machine_learning
 A* search algorithm
namespace  machine_learning
 A* search algorithm
 
 neural_network
namespace  neural_network
 Neural Network or Multilayer Perceptron.
 
 activations
namespace  activations
 Various activation functions used in Neural network.
 
 util_functions
namespace  util_functions
 Various utility functions used in Neural network.
 
 layers
namespace  layers
 This namespace contains layers used in MLP.
 
- @@ -169,14 +168,14 @@ Functions

+

Functions

double machine_learning::neural_network::activations::sigmoid (const double &x)
 
 

Detailed Description

-

Implementation of Multilayer Perceptron.

-
Author
Deep Raval
+

Implementation of Multilayer Perceptron.

+
Author
Deep Raval

A multilayer perceptron (MLP) is a class of feedforward artificial neural network (ANN). The term MLP is used ambiguously, sometimes loosely to any feedforward ANN, sometimes strictly to refer to networks composed of multiple layers of perceptrons (with threshold activation). Multilayer perceptrons are sometimes colloquially referred to as "vanilla" neural networks, especially when they have a single hidden layer.

-

An MLP consists of at least three layers of nodes: an input layer, a hidden layer and an output layer. Except for the input nodes, each node is a neuron that uses a nonlinear activation function. MLP utilizes a supervised learning technique called backpropagation for training. Its multiple layers and non-linear activation distinguish MLP from a linear perceptron. It can distinguish data that is not linearly separable.

-

See Backpropagation for training algorithm.

+

An MLP consists of at least three layers of nodes: an input layer, a hidden layer and an output layer. Except for the input nodes, each node is a neuron that uses a nonlinear activation function. MLP utilizes a supervised learning technique called backpropagation for training. Its multiple layers and non-linear activation distinguish MLP from a linear perceptron. It can distinguish data that is not linearly separable.

+

See Backpropagation for training algorithm.

Note
This implementation uses mini-batch gradient descent as optimizer and MSE as loss function. Bias is also not included.

Function Documentation

- +

◆ drelu()

@@ -191,14 +190,14 @@ Functions
-

Derivative of relu function

Parameters
+

Derivative of relu function

Parameters
XValue
Returns
derivative of relu(x)
-
81 { return x >= 0.0 ? 1.0 : 0.0; }
+
81{ return x >= 0.0 ? 1.0 : 0.0; }
Here is the call graph for this function:
@@ -208,7 +207,7 @@ Here is the call graph for this function:
- +

◆ dsigmoid()

@@ -223,14 +222,14 @@ Here is the call graph for this function:
-

Derivative of sigmoid function

Parameters
+

Derivative of sigmoid function

Parameters
XValue
Returns
Returns derivative of sigmoid(x)
-
67 { return x * (1 - x); }
+
67{ return x * (1 - x); }
Here is the call graph for this function:
@@ -240,7 +239,7 @@ Here is the call graph for this function:
- +

◆ dtanh()

@@ -255,14 +254,14 @@ Here is the call graph for this function:
-

Derivative of Sigmoid function

Parameters
+

Derivative of Sigmoid function

Parameters
XValue
Returns
Returns derivative of tanh(x)
-
95 { return 1 - x * x; }
+
95{ return 1 - x * x; }
Here is the call graph for this function:
@@ -272,7 +271,7 @@ Here is the call graph for this function:
- +

◆ identity_function()

@@ -287,14 +286,14 @@ Here is the call graph for this function:
-

Identity function

Parameters
+

Identity function

Parameters
XValue
Returns
Returns x
-
112 { return x; }
+
112{ return x; }
Here is the call graph for this function:
@@ -304,7 +303,7 @@ Here is the call graph for this function:
- +

◆ main()

@@ -322,11 +321,11 @@ Here is the call graph for this function:

Main function.

Returns
0 on exit
-
833  {
-
834  // Testing
-
835  test();
-
836  return 0;
-
837 }
+
833 {
+
834 // Testing
+
835 test();
+
836 return 0;
+
837}
static void test()
Definition: neural_network.cpp:805
Here is the call graph for this function:
@@ -337,7 +336,7 @@ Here is the call graph for this function:
- +

◆ relu()

@@ -352,14 +351,14 @@ Here is the call graph for this function:
-

Relu function

Parameters
+

Relu function

Parameters
XValue
Returns
relu(x)
-
74 { return std::max(0.0, x); }
+
74{ return std::max(0.0, x); }
T max(T... args)
Here is the call graph for this function:
@@ -370,7 +369,7 @@ Here is the call graph for this function:
- +

◆ sigmoid()

@@ -385,14 +384,14 @@ Here is the call graph for this function:
-

Sigmoid function

Parameters
+

Sigmoid function

Parameters
XValue
Returns
Returns sigmoid(x)
-
60 { return 1.0 / (1.0 + std::exp(-x)); }
+
60{ return 1.0 / (1.0 + std::exp(-x)); }
T exp(T... args)
Here is the call graph for this function:
@@ -403,7 +402,7 @@ Here is the call graph for this function:
- +

◆ square()

@@ -418,14 +417,14 @@ Here is the call graph for this function:
-

Square function

Parameters
+

Square function

Parameters
XValue
Returns
Returns x * x
-
106 { return x * x; }
+
106{ return x * x; }
Here is the call graph for this function:
@@ -435,7 +434,7 @@ Here is the call graph for this function:
- +

◆ tanh()

@@ -450,14 +449,14 @@ Here is the call graph for this function:
-

Tanh function

Parameters
+

Tanh function

Parameters
XValue
Returns
Returns tanh(x)
-
88 { return 2 / (1 + std::exp(-2 * x)) - 1; }
+
88{ return 2 / (1 + std::exp(-2 * x)) - 1; }
Here is the call graph for this function:
@@ -467,7 +466,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -489,35 +488,35 @@ Here is the call graph for this function:
-

Function to test neural network

Returns
none
-
805  {
-
806  // Creating network with 3 layers for "iris.csv"
- - -
809  {4, "none"}, // First layer with 3 neurons and "none" as activation
-
810  {6,
-
811  "relu"}, // Second layer with 6 neurons and "relu" as activation
-
812  {3, "sigmoid"} // Third layer with 3 neurons and "sigmoid" as
-
813  // activation
-
814  });
-
815  // Printing summary of model
-
816  myNN.summary();
-
817  // Training Model
-
818  myNN.fit_from_csv("iris.csv", true, 100, 0.3, false, 2, 32, true);
-
819  // Testing predictions of model
- -
821  myNN.single_predict({{5, 3.4, 1.6, 0.4}})) == 0);
- -
823  myNN.single_predict({{6.4, 2.9, 4.3, 1.3}})) == 1);
- -
825  myNN.single_predict({{6.2, 3.4, 5.4, 2.3}})) == 2);
-
826  return;
-
827 }
+

Function to test neural network

Returns
none
+
805 {
+
806 // Creating network with 3 layers for "iris.csv"
+ + +
809 {4, "none"}, // First layer with 3 neurons and "none" as activation
+
810 {6,
+
811 "relu"}, // Second layer with 6 neurons and "relu" as activation
+
812 {3, "sigmoid"} // Third layer with 3 neurons and "sigmoid" as
+
813 // activation
+
814 });
+
815 // Printing summary of model
+
816 myNN.summary();
+
817 // Training Model
+
818 myNN.fit_from_csv("iris.csv", true, 100, 0.3, false, 2, 32, true);
+
819 // Testing predictions of model
+ +
821 myNN.single_predict({{5, 3.4, 1.6, 0.4}})) == 0);
+ +
823 myNN.single_predict({{6.4, 2.9, 4.3, 1.3}})) == 1);
+ +
825 myNN.single_predict({{6.2, 3.4, 5.4, 2.3}})) == 2);
+
826 return;
+
827}
Definition: neural_network.cpp:247
+
std::vector< std::valarray< double > > single_predict(const std::vector< std::valarray< double > > &X)
Definition: neural_network.cpp:451
void fit_from_csv(const std::string &file_name, const bool &last_label, const int &epochs, const double &learning_rate, const bool &normalize, const int &slip_lines=1, const size_t &batch_size=32, const bool &shuffle=true)
Definition: neural_network.cpp:587
void summary()
Definition: neural_network.cpp:773
-
std::vector< std::valarray< double > > single_predict(const std::vector< std::valarray< double >> &X)
Definition: neural_network.cpp:451
-
size_t argmax(const std::vector< std::valarray< T >> &A)
Definition: vector_ops.hpp:307
+
size_t argmax(const std::vector< std::valarray< T > > &A)
Definition: vector_ops.hpp:307
Here is the call graph for this function:
@@ -533,7 +532,7 @@ Here is the call graph for this function:
diff --git a/d2/d58/neural__network_8cpp.js b/d2/d58/neural__network_8cpp.js index 6fca654b7..7683c82f0 100644 --- a/d2/d58/neural__network_8cpp.js +++ b/d2/d58/neural__network_8cpp.js @@ -1,7 +1,7 @@ var neural__network_8cpp = [ - [ "DenseLayer", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer" ], - [ "NeuralNetwork", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network" ], + [ "machine_learning::neural_network::layers::DenseLayer", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer" ], + [ "machine_learning::neural_network::NeuralNetwork", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network" ], [ "drelu", "d2/d58/neural__network_8cpp.html#aa69e95a34054d7989bf446f96b2ffaf9", null ], [ "dsigmoid", "d2/d58/neural__network_8cpp.html#a76eb66212d577f948a457b6e29d87c46", null ], [ "dtanh", "d2/d58/neural__network_8cpp.html#a2a5e874b9774aa5362dbcf288828b95c", null ], diff --git a/d2/d58/neural__network_8cpp_a23aa9d32bcbcd65cfc85f0a41e2afadc_cgraph.svg b/d2/d58/neural__network_8cpp_a23aa9d32bcbcd65cfc85f0a41e2afadc_cgraph.svg index fccefe6ba..91428ad53 100644 --- a/d2/d58/neural__network_8cpp_a23aa9d32bcbcd65cfc85f0a41e2afadc_cgraph.svg +++ b/d2/d58/neural__network_8cpp_a23aa9d32bcbcd65cfc85f0a41e2afadc_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - - + - + - + - - - - - - - - + + + + + + + + - - - + + + @@ -37,12 +37,12 @@ - + - + - - + + diff --git a/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index 093b05559..76beb5c7b 100644 --- a/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -0fcda9df8d4be34e79204dd9c054858a \ No newline at end of file +ef804c4531cdcd77cdd696ab6dbd49a6 \ No newline at end of file diff --git a/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index f467317cc..ea6830faa 100644 --- a/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,7 +1,7 @@ - @@ -67,7 +67,7 @@ var sectionId = 'dynsection-10'; Node2 - + machine_learning::argmax @@ -99,7 +99,7 @@ var sectionId = 'dynsection-10'; Node45 - + machine_learning::neural _network::NeuralNetwork @@ -208,7 +208,7 @@ var sectionId = 'dynsection-10'; Node8 - + machine_learning::get _shape @@ -239,7 +239,7 @@ var sectionId = 'dynsection-10'; Node11 - + machine_learning::neural _network::NeuralNetwork::fit @@ -255,7 +255,7 @@ var sectionId = 'dynsection-10'; Node26 - + sorting::shuffle @@ -270,7 +270,7 @@ var sectionId = 'dynsection-10'; Node31 - + machine_learning::neural _network::NeuralNetwork @@ -311,7 +311,7 @@ var sectionId = 'dynsection-10'; Node12 - + machine_learning::neural _network::NeuralNetwork @@ -328,7 +328,7 @@ var sectionId = 'dynsection-10'; Node13 - + machine_learning::apply _function @@ -344,7 +344,7 @@ var sectionId = 'dynsection-10'; Node15 - + machine_learning::multiply @@ -359,7 +359,7 @@ var sectionId = 'dynsection-10'; Node17 - + machine_learning::equal _shuffle @@ -375,7 +375,7 @@ var sectionId = 'dynsection-10'; Node22 - + machine_learning::hadamard _product @@ -458,7 +458,7 @@ var sectionId = 'dynsection-10'; Node28 - + machine_learning::sum @@ -473,7 +473,7 @@ var sectionId = 'dynsection-10'; Node29 - + machine_learning::transpose @@ -488,7 +488,7 @@ var sectionId = 'dynsection-10'; Node30 - + machine_learning::zeroes _initialization @@ -778,7 +778,7 @@ var sectionId = 'dynsection-10'; Node37 - + machine_learning::insert _element @@ -809,7 +809,7 @@ var sectionId = 'dynsection-10'; Node39 - + machine_learning::minmax _scaler @@ -840,7 +840,7 @@ var sectionId = 'dynsection-10'; Node42 - + machine_learning::pop_back @@ -855,7 +855,7 @@ var sectionId = 'dynsection-10'; Node43 - + machine_learning::pop _front diff --git a/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg b/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg index 41a9ac996..95236c1e5 100644 --- a/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg +++ b/d2/d58/neural__network_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg @@ -1,7 +1,7 @@ - Node2 - + machine_learning::argmax @@ -53,7 +53,7 @@ Node45 - + machine_learning::neural _network::NeuralNetwork @@ -162,7 +162,7 @@ Node8 - + machine_learning::get _shape @@ -193,7 +193,7 @@ Node11 - + machine_learning::neural _network::NeuralNetwork::fit @@ -209,7 +209,7 @@ Node26 - + sorting::shuffle @@ -224,7 +224,7 @@ Node31 - + machine_learning::neural _network::NeuralNetwork @@ -265,7 +265,7 @@ Node12 - + machine_learning::neural _network::NeuralNetwork @@ -282,7 +282,7 @@ Node13 - + machine_learning::apply _function @@ -298,7 +298,7 @@ Node15 - + machine_learning::multiply @@ -313,7 +313,7 @@ Node17 - + machine_learning::equal _shuffle @@ -329,7 +329,7 @@ Node22 - + machine_learning::hadamard _product @@ -412,7 +412,7 @@ Node28 - + machine_learning::sum @@ -427,7 +427,7 @@ Node29 - + machine_learning::transpose @@ -442,7 +442,7 @@ Node30 - + machine_learning::zeroes _initialization @@ -732,7 +732,7 @@ Node37 - + machine_learning::insert _element @@ -763,7 +763,7 @@ Node39 - + machine_learning::minmax _scaler @@ -794,7 +794,7 @@ Node42 - + machine_learning::pop_back @@ -809,7 +809,7 @@ Node43 - + machine_learning::pop _front diff --git a/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index d4220581b..e4d581ff4 100644 --- a/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,32 +1,32 @@ - + - + - + - - - - - - - - + + + + + + + + - - - + + + @@ -38,12 +38,12 @@ - + - + - - + + diff --git a/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index d4124acff..7ac586efa 100644 --- a/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -31b89e1f94e860862bc0261c78377ca5 \ No newline at end of file +baefa18d0e1f19a5d103539f42ced42b \ No newline at end of file diff --git a/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 79ba65d4d..6b603dba4 100644 --- a/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - @@ -82,7 +82,7 @@ var sectionId = 'dynsection-5'; Node3 - + machine_learning::argmax @@ -114,7 +114,7 @@ var sectionId = 'dynsection-5'; Node46 - + machine_learning::neural _network::NeuralNetwork @@ -223,7 +223,7 @@ var sectionId = 'dynsection-5'; Node9 - + machine_learning::get _shape @@ -254,7 +254,7 @@ var sectionId = 'dynsection-5'; Node12 - + machine_learning::neural _network::NeuralNetwork::fit @@ -270,7 +270,7 @@ var sectionId = 'dynsection-5'; Node27 - + sorting::shuffle @@ -285,7 +285,7 @@ var sectionId = 'dynsection-5'; Node32 - + machine_learning::neural _network::NeuralNetwork @@ -326,7 +326,7 @@ var sectionId = 'dynsection-5'; Node13 - + machine_learning::neural _network::NeuralNetwork @@ -343,7 +343,7 @@ var sectionId = 'dynsection-5'; Node14 - + machine_learning::apply _function @@ -359,7 +359,7 @@ var sectionId = 'dynsection-5'; Node16 - + machine_learning::multiply @@ -374,7 +374,7 @@ var sectionId = 'dynsection-5'; Node18 - + machine_learning::equal _shuffle @@ -390,7 +390,7 @@ var sectionId = 'dynsection-5'; Node23 - + machine_learning::hadamard _product @@ -473,7 +473,7 @@ var sectionId = 'dynsection-5'; Node29 - + machine_learning::sum @@ -488,7 +488,7 @@ var sectionId = 'dynsection-5'; Node30 - + machine_learning::transpose @@ -503,7 +503,7 @@ var sectionId = 'dynsection-5'; Node31 - + machine_learning::zeroes _initialization @@ -793,7 +793,7 @@ var sectionId = 'dynsection-5'; Node38 - + machine_learning::insert _element @@ -824,7 +824,7 @@ var sectionId = 'dynsection-5'; Node40 - + machine_learning::minmax _scaler @@ -855,7 +855,7 @@ var sectionId = 'dynsection-5'; Node43 - + machine_learning::pop_back @@ -870,7 +870,7 @@ var sectionId = 'dynsection-5'; Node44 - + machine_learning::pop _front diff --git a/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg b/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg index 6a3915c97..e7652f451 100644 --- a/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg +++ b/d2/d58/neural__network_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg @@ -1,7 +1,7 @@ - Node3 - + machine_learning::argmax @@ -68,7 +68,7 @@ Node46 - + machine_learning::neural _network::NeuralNetwork @@ -177,7 +177,7 @@ Node9 - + machine_learning::get _shape @@ -208,7 +208,7 @@ Node12 - + machine_learning::neural _network::NeuralNetwork::fit @@ -224,7 +224,7 @@ Node27 - + sorting::shuffle @@ -239,7 +239,7 @@ Node32 - + machine_learning::neural _network::NeuralNetwork @@ -280,7 +280,7 @@ Node13 - + machine_learning::neural _network::NeuralNetwork @@ -297,7 +297,7 @@ Node14 - + machine_learning::apply _function @@ -313,7 +313,7 @@ Node16 - + machine_learning::multiply @@ -328,7 +328,7 @@ Node18 - + machine_learning::equal _shuffle @@ -344,7 +344,7 @@ Node23 - + machine_learning::hadamard _product @@ -427,7 +427,7 @@ Node29 - + machine_learning::sum @@ -442,7 +442,7 @@ Node30 - + machine_learning::transpose @@ -457,7 +457,7 @@ Node31 - + machine_learning::zeroes _initialization @@ -747,7 +747,7 @@ Node38 - + machine_learning::insert _element @@ -778,7 +778,7 @@ Node40 - + machine_learning::minmax _scaler @@ -809,7 +809,7 @@ Node43 - + machine_learning::pop_back @@ -824,7 +824,7 @@ Node44 - + machine_learning::pop _front diff --git a/d2/d58/neural__network_8cpp_af8f264600754602b6a9ea19cc690e50e_cgraph.svg b/d2/d58/neural__network_8cpp_af8f264600754602b6a9ea19cc690e50e_cgraph.svg index 69b3c6571..ac58204f6 100644 --- a/d2/d58/neural__network_8cpp_af8f264600754602b6a9ea19cc690e50e_cgraph.svg +++ b/d2/d58/neural__network_8cpp_af8f264600754602b6a9ea19cc690e50e_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: backtracking/subset_sum.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d2/d5a/subset__sum_8cpp.html','../../' -
-
subset_sum.cpp File Reference
+
subset_sum.cpp File Reference
-

Implementation of the Subset Sum problem. +

Implementation of the Subset Sum problem. More...

#include <cassert>
#include <iostream>
@@ -110,16 +109,16 @@ Include dependency graph for subset_sum.cpp:
- - + - - + +

+

Namespaces

 backtracking
namespace  backtracking
 Backtracking algorithms.
 
 Subsets
 Functions for the Subset Sum problem.
namespace  Subsets
 Functions for the Subset Sum problem.
 
- @@ -132,10 +131,10 @@ Functions

+

Functions

uint64_t backtracking::subset_sum::number_of_subsets (int32_t sum, const std::vector< int32_t > &in_arr)
 The main function implements count of subsets. More...
 

Detailed Description

-

Implementation of the Subset Sum problem.

-

We are given an array and a sum value. The algorithm finds all the subsets of that array with sum equal to the given sum and return such subsets count. This approach will have exponential time complexity.

Author
Swastika Gupta
+

Implementation of the Subset Sum problem.

+

We are given an array and a sum value. The algorithm finds all the subsets of that array with sum equal to the given sum and return such subsets count. This approach will have exponential time complexity.

Author
Swastika Gupta

Function Documentation

- +

◆ main()

@@ -153,10 +152,10 @@ Functions

Main function.

Returns
0 on exit
-
103  {
-
104  test(); // run self-test implementations
-
105  return 0;
-
106 }
+
103 {
+
104 test(); // run self-test implementations
+
105 return 0;
+
106}
static void test()
Test implementations.
Definition: subset_sum.cpp:57
Here is the call graph for this function:
@@ -167,7 +166,7 @@ Here is the call graph for this function:
- +

◆ number_of_subsets()

@@ -202,24 +201,24 @@ Here is the call graph for this function:
Returns
count of the number of subsets with required sum
-
33  {
-
34  int32_t nelement = in_arr.size();
-
35  uint64_t count_of_subset = 0;
-
36 
-
37  for (int32_t i = 0; i < (1 << (nelement)); i++) {
-
38  int32_t check = 0;
-
39  for (int32_t j = 0; j < nelement; j++) {
-
40  if (i & (1 << j)) {
-
41  check += (in_arr[j]);
-
42  }
-
43  }
-
44  if (check == sum) {
-
45  count_of_subset++;
-
46  }
-
47  }
-
48  return count_of_subset;
-
49 }
-
T sum(const std::vector< std::valarray< T >> &A)
Definition: vector_ops.hpp:232
+
33 {
+
34 int32_t nelement = in_arr.size();
+
35 uint64_t count_of_subset = 0;
+
36
+
37 for (int32_t i = 0; i < (1 << (nelement)); i++) {
+
38 int32_t check = 0;
+
39 for (int32_t j = 0; j < nelement; j++) {
+
40 if (i & (1 << j)) {
+
41 check += (in_arr[j]);
+
42 }
+
43 }
+
44 if (check == sum) {
+
45 count_of_subset++;
+
46 }
+
47 }
+
48 return count_of_subset;
+
49}
+
T sum(const std::vector< std::valarray< T > > &A)
Definition: vector_ops.hpp:232
T size(T... args)
bool check(const std::string &s, const std::unordered_set< std::string > &strSet, int pos, std::vector< int > *dp)
Function that checks if the string passed in param can be segmented from position 'pos',...
Definition: word_break.cpp:80
@@ -231,7 +230,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -256,47 +255,47 @@ Here is the call graph for this function:

Test implementations.

Returns
void
-
57  {
-
58  // 1st test
-
59  std::cout << "1st test ";
-
60  std::vector<int32_t> array1 = {-7, -3, -2, 5, 8}; // input array
-
61  assert(backtracking::subset_sum::number_of_subsets(0, array1) ==
-
62  2); // first argument in subset_sum function is the required sum and
-
63  // second is the input array
-
64  std::cout << "passed" << std::endl;
-
65 
-
66  // 2nd test
-
67  std::cout << "2nd test ";
-
68  std::vector<int32_t> array2 = {1, 2, 3, 3};
-
69  assert(backtracking::subset_sum::number_of_subsets(6, array2) ==
-
70  3); // here we are expecting 3 subsets which sum up to 6 i.e.
-
71  // {(1,2,3),(1,2,3),(3,3)}
-
72  std::cout << "passed" << std::endl;
-
73 
-
74  // 3rd test
-
75  std::cout << "3rd test ";
-
76  std::vector<int32_t> array3 = {1, 1, 1, 1};
-
77  assert(backtracking::subset_sum::number_of_subsets(1, array3) ==
-
78  4); // here we are expecting 4 subsets which sum up to 1 i.e.
-
79  // {(1),(1),(1),(1)}
-
80  std::cout << "passed" << std::endl;
-
81 
-
82  // 4th test
-
83  std::cout << "4th test ";
-
84  std::vector<int32_t> array4 = {3, 3, 3, 3};
-
85  assert(backtracking::subset_sum::number_of_subsets(6, array4) ==
-
86  6); // here we are expecting 6 subsets which sum up to 6 i.e.
-
87  // {(3,3),(3,3),(3,3),(3,3),(3,3),(3,3)}
-
88  std::cout << "passed" << std::endl;
-
89 
-
90  // Test 5
-
91  std::cout << "5th test ";
-
92  std::vector<int32_t> array5 = {};
-
93  assert(backtracking::subset_sum::number_of_subsets(6, array5) ==
-
94  0); // here we are expecting 0 subsets which sum up to 6 i.e. we
-
95  // cannot select anything from an empty array
-
96  std::cout << "passed" << std::endl;
-
97 }
+
57 {
+
58 // 1st test
+
59 std::cout << "1st test ";
+
60 std::vector<int32_t> array1 = {-7, -3, -2, 5, 8}; // input array
+
61 assert(backtracking::subset_sum::number_of_subsets(0, array1) ==
+
62 2); // first argument in subset_sum function is the required sum and
+
63 // second is the input array
+
64 std::cout << "passed" << std::endl;
+
65
+
66 // 2nd test
+
67 std::cout << "2nd test ";
+
68 std::vector<int32_t> array2 = {1, 2, 3, 3};
+
69 assert(backtracking::subset_sum::number_of_subsets(6, array2) ==
+
70 3); // here we are expecting 3 subsets which sum up to 6 i.e.
+
71 // {(1,2,3),(1,2,3),(3,3)}
+
72 std::cout << "passed" << std::endl;
+
73
+
74 // 3rd test
+
75 std::cout << "3rd test ";
+
76 std::vector<int32_t> array3 = {1, 1, 1, 1};
+
77 assert(backtracking::subset_sum::number_of_subsets(1, array3) ==
+
78 4); // here we are expecting 4 subsets which sum up to 1 i.e.
+
79 // {(1),(1),(1),(1)}
+
80 std::cout << "passed" << std::endl;
+
81
+
82 // 4th test
+
83 std::cout << "4th test ";
+
84 std::vector<int32_t> array4 = {3, 3, 3, 3};
+
85 assert(backtracking::subset_sum::number_of_subsets(6, array4) ==
+
86 6); // here we are expecting 6 subsets which sum up to 6 i.e.
+
87 // {(3,3),(3,3),(3,3),(3,3),(3,3),(3,3)}
+
88 std::cout << "passed" << std::endl;
+
89
+
90 // Test 5
+
91 std::cout << "5th test ";
+
92 std::vector<int32_t> array5 = {};
+
93 assert(backtracking::subset_sum::number_of_subsets(6, array5) ==
+
94 0); // here we are expecting 0 subsets which sum up to 6 i.e. we
+
95 // cannot select anything from an empty array
+
96 std::cout << "passed" << std::endl;
+
97}
T endl(T... args)
@@ -315,7 +314,7 @@ Here is the call graph for this function:
diff --git a/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.map b/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.map index 2b1af9c8e..d28ba7a53 100644 --- a/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.map +++ b/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.md5 b/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.md5 index 6debdd0d1..75bb58036 100644 --- a/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.md5 +++ b/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.md5 @@ -1 +1 @@ -a0525aaac8cd2f6c9197faa4903dd32e \ No newline at end of file +acd8218375b484f9843c7f692b97092f \ No newline at end of file diff --git a/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.svg b/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.svg index 552c78593..b05ed1f04 100644 --- a/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.svg +++ b/d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + machine_learning::sum diff --git a/d2/d5a/subset__sum_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d2/d5a/subset__sum_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 1510c341e..49e2fcc6f 100644 --- a/d2/d5a/subset__sum_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d2/d5a/subset__sum_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - - - - + + Algorithms_in_C++: range_queries::heavy_light_decomposition::HLD< X > Class Template Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -95,8 +95,7 @@ $(document).ready(function(){initNavTree('d2/d8a/classrange__queries_1_1heavy__l Private Member Functions | Private Attributes | List of all members -
-
range_queries::heavy_light_decomposition::HLD< X > Class Template Reference
+
range_queries::heavy_light_decomposition::HLD< X > Class Template Reference
@@ -111,11 +110,11 @@ Inheritance diagram for range_queries::heavy_light_decomposition::HLD< X >
Collaboration diagram for range_queries::heavy_light_decomposition::HLD< X >:
-
+
[legend]
- @@ -155,7 +154,7 @@ Public Member Functions

+

Public Member Functions

 HLD (int nodes)
 Class parameterized constructor. Resizes the and initilizes the data members. More...
 The function returns the least common ancestor of two nodes. More...
 
- @@ -170,30 +169,28 @@ Private Member Functions

+

Private Member Functions

void dfs_hc (int u, int p=-1)
 Utility function to assign heavy child to each node (-1 for a leaf node) More...
 Utility function to break down a path query into two chain queries. More...
 
- - + - + - + - +

+

Private Attributes

-int label
+int label
 utility member to assign labels in dfs_labels()
 
-std::vector< int > h_label
+std::vector< int > h_label
 stores the label of a node
 
-std::vector< int > h_heavychlid
+std::vector< int > h_heavychlid
 stores the heavy child of a node
 
-std::vector< int > h_parent
+std::vector< int > h_parent
 stores the top of the heavy chain from a node
 

Detailed Description

-

template<typename X>
-class range_queries::heavy_light_decomposition::HLD< X >

- -

The Heavy-Light Decomposition class.

+
template<typename X>
+class range_queries::heavy_light_decomposition::HLD< X >

The Heavy-Light Decomposition class.

Template Parameters
@@ -201,7 +198,7 @@ class range_queries::heavy_light_decomposition::HLD< X >

Constructor & Destructor Documentation

- +

◆ HLD()

@@ -234,29 +231,25 @@ template<typename X >
thedata type of the values stored in the tree nodes
-
435  : Tree<X>(nodes), SG<X>(nodes) {
-
436  /* Initialization and resize vectors */
-
437  label = 0;
- - - -
441  iota(h_parent.begin(), h_parent.end(), 0);
-
442  }
-
T assign(T... args)
-
T begin(T... args)
+
435 : Tree<X>(nodes), SG<X>(nodes) {
+
436 /* Initialization and resize vectors */
+
437 label = 0;
+
438 h_label.assign(Tree<X>::t_nodes, -1);
+
439 h_heavychlid.assign(Tree<X>::t_nodes, -1);
+ +
441 iota(h_parent.begin(), h_parent.end(), 0);
+
442 }
std::vector< int > h_parent
stores the top of the heavy chain from a node
Definition: heavy_light_decomposition.cpp:341
int label
utility member to assign labels in dfs_labels()
Definition: heavy_light_decomposition.cpp:338
std::vector< int > h_heavychlid
stores the heavy child of a node
Definition: heavy_light_decomposition.cpp:340
std::vector< int > h_label
stores the label of a node
Definition: heavy_light_decomposition.cpp:339
const int t_nodes
number of nodes
Definition: heavy_light_decomposition.cpp:84
-
T end(T... args)
T iota(T... args)
-
T resize(T... args)

Member Function Documentation

- +

◆ chain_query()

@@ -301,25 +294,25 @@ template<typename X >
Returns
the sum of ndoe values in the simple path from a to b
-
409  {
-
410  X ret = SG<X>::sret_init;
-
411  if (Tree<X>::t_depth[a] < Tree<X>::t_depth[b]) {
-
412  std::swap(a, b);
-
413  }
-
414  while (Tree<X>::t_depth[a] >= Tree<X>::t_depth[b]) {
-
415  int l = h_label[h_parent[a]];
-
416  int r = h_label[a];
- - -
419  }
-
420  ret = SG<X>::combine(ret, SG<X>::query(l, r));
-
421  a = Tree<X>::t_par[h_parent[a]][0];
-
422  if (a == -1) {
-
423  break;
-
424  }
-
425  }
-
426  return ret;
-
427  }
+
409 {
+
410 X ret = SG<X>::sret_init;
+ +
412 std::swap(a, b);
+
413 }
+
414 while (Tree<X>::t_depth[a] >= Tree<X>::t_depth[b]) {
+
415 int l = h_label[h_parent[a]];
+
416 int r = h_label[a];
+ + +
419 }
+
420 ret = SG<X>::combine(ret, SG<X>::query(l, r));
+
421 a = Tree<X>::t_par[h_parent[a]][0];
+
422 if (a == -1) {
+
423 break;
+
424 }
+
425 }
+
426 return ret;
+
427 }
X query(int l, int r)
Make a range query from node label l to node label r.
Definition: heavy_light_decomposition.cpp:305
X combine(X lhs, X rhs)
Function that specifies the type of operation involved when segments are combined.
Definition: heavy_light_decomposition.cpp:274
X sret_init
inital query return value
Definition: heavy_light_decomposition.cpp:264
@@ -335,7 +328,7 @@ Here is the call graph for this function:
- +

◆ dfs_hc()

@@ -380,26 +373,32 @@ template<typename X >
Returns
void
-
350  {
-
351  int hc_size = -1, hc_id = -1;
-
352  for (const int &v : Tree<X>::t_adj[u]) {
-
353  if (v ^ p) {
-
354  dfs_hc(v, u);
-
355  if (Tree<X>::t_size[v] > hc_size) {
-
356  hc_size = Tree<X>::t_size[v];
-
357  hc_id = v;
-
358  }
-
359  }
-
360  }
-
361  h_heavychlid[u] = hc_id;
-
362  }
+
350 {
+
351 int hc_size = -1, hc_id = -1;
+
352 for (const int &v : Tree<X>::t_adj[u]) {
+
353 if (v ^ p) {
+
354 dfs_hc(v, u);
+
355 if (Tree<X>::t_size[v] > hc_size) {
+
356 hc_size = Tree<X>::t_size[v];
+
357 hc_id = v;
+
358 }
+
359 }
+
360 }
+
361 h_heavychlid[u] = hc_id;
+
362 }
void dfs_hc(int u, int p=-1)
Utility function to assign heavy child to each node (-1 for a leaf node)
Definition: heavy_light_decomposition.cpp:350
std::vector< std::list< int > > t_adj
an adjacency list to stores the tree edges
Definition: heavy_light_decomposition.cpp:83
std::vector< int > t_size
a vector to store the subtree size rooted at node
Definition: heavy_light_decomposition.cpp:89
-
+
+Here is the call graph for this function:
+
+
- + +
+
+

◆ dfs_labels()

@@ -444,22 +443,28 @@ template<typename X >
Returns
void
-
390  {
-
391  h_label[u] = label++;
-
392  if (h_heavychlid[u] != -1) {
-
393  dfs_labels(h_heavychlid[u], u);
-
394  }
-
395  for (const int &v : Tree<X>::t_adj[u]) {
-
396  if (v ^ p and v ^ h_heavychlid[u]) {
-
397  dfs_labels(v, u);
-
398  }
-
399  }
-
400  }
+
390 {
+
391 h_label[u] = label++;
+
392 if (h_heavychlid[u] != -1) {
+ +
394 }
+
395 for (const int &v : Tree<X>::t_adj[u]) {
+
396 if (v ^ p and v ^ h_heavychlid[u]) {
+
397 dfs_labels(v, u);
+
398 }
+
399 }
+
400 }
void dfs_labels(int u, int p=-1)
Utility function to lable the nodes so that heavy chains have a contigous lable.
Definition: heavy_light_decomposition.cpp:390
-
+
+Here is the call graph for this function:
+
+
- + + + +

◆ dfs_par()

@@ -504,22 +509,28 @@ template<typename X >
Returns
void
-
371  {
-
372  if (h_heavychlid[u] != -1) {
-
373  h_parent[h_heavychlid[u]] = h_parent[u];
-
374  dfs_par(h_heavychlid[u], u);
-
375  }
-
376  for (const int &v : Tree<X>::t_adj[u]) {
-
377  if (v ^ p and v ^ h_heavychlid[u]) {
-
378  dfs_par(v, u);
-
379  }
-
380  }
-
381  }
+
371 {
+
372 if (h_heavychlid[u] != -1) {
+ +
374 dfs_par(h_heavychlid[u], u);
+
375 }
+
376 for (const int &v : Tree<X>::t_adj[u]) {
+
377 if (v ^ p and v ^ h_heavychlid[u]) {
+
378 dfs_par(v, u);
+
379 }
+
380 }
+
381 }
void dfs_par(int u, int p=-1)
Utility function to assign highest parent that can be reached though heavy chains.
Definition: heavy_light_decomposition.cpp:371
-
+
+Here is the call graph for this function:
+
+
- + + + +

◆ init()

@@ -546,24 +557,24 @@ template<typename X >

This function must be called after the tree adjacency list and node values are populated The function initializes the required parametes, and populates the segment tree.

Returns
void
-
450  {
-
451  Tree<X>::init();
-
452 
-
453  // Fill the heavy child, greatest parent, and labels
-
454  label = 0;
- - - -
458 
-
459  // Segment Tree Initialization
-
460  for (int i = 0; i < Tree<X>::t_nodes; i++) {
- -
462  }
-
463  for (int i = Tree<X>::t_nodes - 1; i > 0; i--) {
-
464  SG<X>::s_tree[i] =
-
465  SG<X>::combine(SG<X>::s_tree[i << 1], SG<X>::s_tree[i << 1 | 1]);
-
466  }
-
467  }
+
450 {
+ +
452
+
453 // Fill the heavy child, greatest parent, and labels
+
454 label = 0;
+ + + +
458
+
459 // Segment Tree Initialization
+
460 for (int i = 0; i < Tree<X>::t_nodes; i++) {
+ +
462 }
+
463 for (int i = Tree<X>::t_nodes - 1; i > 0; i--) {
+
464 SG<X>::s_tree[i] =
+
465 SG<X>::combine(SG<X>::s_tree[i << 1], SG<X>::s_tree[i << 1 | 1]);
+
466 }
+
467 }
std::vector< X > s_tree
Everything here is private, and can only be accessed through the methods, in the derived class (HLD)
Definition: heavy_light_decomposition.cpp:262
std::vector< X > t_val
values of nodes
Definition: heavy_light_decomposition.cpp:92
int t_root
the root of the tree
Definition: heavy_light_decomposition.cpp:91
@@ -571,13 +582,13 @@ template<typename X >
Here is the call graph for this function:
-
+
- +

◆ query()

@@ -622,14 +633,14 @@ template<typename X >
Returns
the sum of node values in the simple path from a to b
-
489  {
-
490  int lc = Tree<X>::lca(a, b);
-
491  X ret = SG<X>::sret_init;
-
492  assert(lc != -1);
-
493  ret += chain_query(a, lc);
-
494  ret += chain_query(b, lc);
-
495  return ret - Tree<X>::t_val[lc];
-
496  }
+
489 {
+
490 int lc = Tree<X>::lca(a, b);
+
491 X ret = SG<X>::sret_init;
+
492 assert(lc != -1);
+
493 ret += chain_query(a, lc);
+
494 ret += chain_query(b, lc);
+
495 return ret - Tree<X>::t_val[lc];
+
496 }
X chain_query(int a, int b)
Utility function to break down a path query into two chain queries.
Definition: heavy_light_decomposition.cpp:409
int lca(int a, int b)
The function returns the least common ancestor of two nodes.
Definition: heavy_light_decomposition.cpp:229
@@ -641,7 +652,7 @@ Here is the call graph for this function:
- +

◆ update()

@@ -686,11 +697,11 @@ template<typename X >
Returns
void
-
475  {
-
476  X diff = val - Tree<X>::t_val[node];
-
477  SG<X>::update(h_label[node], diff);
-
478  Tree<X>::t_val[node] = val;
-
479  }
+
475 {
+
476 X diff = val - Tree<X>::t_val[node];
+
477 SG<X>::update(h_label[node], diff);
+
478 Tree<X>::t_val[node] = val;
+
479 }
void update(int p, X v)
Update the value at a node.
Definition: heavy_light_decomposition.cpp:293
struct list node
Definition: avltree.cpp:13
@@ -712,7 +723,7 @@ Here is the call graph for this function:
diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.map b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.map new file mode 100644 index 000000000..9f883fc52 --- /dev/null +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.md5 b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.md5 new file mode 100644 index 000000000..56f4c34e8 --- /dev/null +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.md5 @@ -0,0 +1 @@ +f6fbc757189675c509f6d7af9f09bdad \ No newline at end of file diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.svg b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.svg new file mode 100644 index 000000000..39bb9914f --- /dev/null +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a0579062b384e54b611b80c6337c7f2c8_cgraph.svg @@ -0,0 +1,30 @@ + + + + + + +range_queries::heavy_light_decomposition::HLD::dfs_labels + + + +Node1 + + +range_queries::heavy +_light_decomposition +::HLD::dfs_labels + + + + + +Node1->Node1 + + + + + diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.map b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.map new file mode 100644 index 000000000..f547e3e41 --- /dev/null +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.md5 b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.md5 new file mode 100644 index 000000000..7e5322cf0 --- /dev/null +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.md5 @@ -0,0 +1 @@ +72bdee8e385032311495aec5ced1de57 \ No newline at end of file diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.svg b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.svg new file mode 100644 index 000000000..09cf5edb4 --- /dev/null +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a2dfbda148aad0bfaba2ebfda9ebc915a_cgraph.svg @@ -0,0 +1,30 @@ + + + + + + +range_queries::heavy_light_decomposition::HLD::dfs_par + + + +Node1 + + +range_queries::heavy +_light_decomposition +::HLD::dfs_par + + + + + +Node1->Node1 + + + + + diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a4dfbf5d9df825eeb63b294c6849bdcab_cgraph.svg b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a4dfbf5d9df825eeb63b294c6849bdcab_cgraph.svg index 8dd8383ed..a0698f8fd 100644 --- a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a4dfbf5d9df825eeb63b294c6849bdcab_cgraph.svg +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_a4dfbf5d9df825eeb63b294c6849bdcab_cgraph.svg @@ -1,7 +1,7 @@ - - - - + - - - - - - + + + + + + diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_ae9e979edd69678b85665c01e2ee97828_cgraph.md5 b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_ae9e979edd69678b85665c01e2ee97828_cgraph.md5 index 8f7dc98c6..79b46bfa2 100644 --- a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_ae9e979edd69678b85665c01e2ee97828_cgraph.md5 +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_ae9e979edd69678b85665c01e2ee97828_cgraph.md5 @@ -1 +1 @@ -1d3a59fdba7e391132e6cdc60cbcc3fa \ No newline at end of file +fd79112d1e449bba49c4e48f39774bf4 \ No newline at end of file diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_ae9e979edd69678b85665c01e2ee97828_cgraph.svg b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_ae9e979edd69678b85665c01e2ee97828_cgraph.svg index 1220388d8..1e57ccc57 100644 --- a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_ae9e979edd69678b85665c01e2ee97828_cgraph.svg +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_ae9e979edd69678b85665c01e2ee97828_cgraph.svg @@ -1,22 +1,22 @@ - - - + + range_queries::heavy_light_decomposition::HLD::init - + Node1 - -range_queries::heavy -_light_decomposition -::HLD::init + +range_queries::heavy +_light_decomposition +::HLD::init @@ -24,103 +24,121 @@ Node2 - -range_queries::heavy -_light_decomposition -::SG::combine + +range_queries::heavy +_light_decomposition +::SG::combine Node1->Node2 - - + + Node3 - -range_queries::heavy -_light_decomposition -::HLD::dfs_hc + +range_queries::heavy +_light_decomposition +::HLD::dfs_hc Node1->Node3 - - + + Node4 - -range_queries::heavy -_light_decomposition -::HLD::dfs_labels + +range_queries::heavy +_light_decomposition +::HLD::dfs_labels - + Node1->Node4 - - + + Node5 - -range_queries::heavy -_light_decomposition -::HLD::dfs_par + +range_queries::heavy +_light_decomposition +::HLD::dfs_par - + Node1->Node5 - - + + Node6 - -range_queries::heavy -_light_decomposition -::Tree::init + +range_queries::heavy +_light_decomposition +::Tree::init - + Node1->Node6 - - + + + + + +Node3->Node3 + + + + + +Node4->Node4 + + + + + +Node5->Node5 + + Node7 - -range_queries::heavy -_light_decomposition -::Tree::dfs_lca + +range_queries::heavy +_light_decomposition +::Tree::dfs_lca - + Node6->Node7 - - + + @@ -134,10 +152,22 @@ - + Node6->Node8 - - + + + + + +Node7->Node7 + + + + + +Node8->Node8 + + diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.map b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.map new file mode 100644 index 000000000..c9b54930f --- /dev/null +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.md5 b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.md5 new file mode 100644 index 000000000..20d75f206 --- /dev/null +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.md5 @@ -0,0 +1 @@ +8c93406c870c3f1a3213f5f09fc185cb \ No newline at end of file diff --git a/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.svg b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.svg new file mode 100644 index 000000000..5218942b6 --- /dev/null +++ b/d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d_af64848d6630c39d0f09ce2359cc7c4f8_cgraph.svg @@ -0,0 +1,30 @@ + + + + + + +range_queries::heavy_light_decomposition::HLD::dfs_hc + + + +Node1 + + +range_queries::heavy +_light_decomposition +::HLD::dfs_hc + + + + + +Node1->Node1 + + + + + diff --git a/d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node.html b/d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node.html index 91ad00a2d..225036f71 100644 --- a/d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node.html +++ b/d2/d9a/structothers_1_1iterative__tree__traversals_1_1_node.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: others::iterative_tree_traversals::Node Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('d2/d9a/structothers_1_1iterative__tree -
-
others::iterative_tree_traversals::Node Struct Reference
+
others::iterative_tree_traversals::Node Struct Reference
@@ -107,23 +106,23 @@ Collaboration diagram for others::iterative_tree_traversals::Node:
[legend]
- - + - + - +

+

Public Attributes

-int64_t data = 0
+int64_t data = 0
 The value/key of the node.
 
-struct Nodeleft {}
+struct Nodeleft {}
 struct pointer to left subtree.
 
-struct Noderight {}
+struct Noderight {}
 struct pointer to right subtree.
 

Detailed Description

-

defines the structure of a node of the tree

+

defines the structure of a node of the tree


The documentation for this struct was generated from the following file: @@ -133,7 +132,7 @@ struct
    - +
diff --git a/d2/dae/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node__coll__graph.svg b/d2/dae/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node__coll__graph.svg index b60ffdeec..10316502a 100644 --- a/d2/dae/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node__coll__graph.svg +++ b/d2/dae/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node__coll__graph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: stack_linkedList Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,8 +94,7 @@ $(document).ready(function(){initNavTree('d2/dc4/classstack__linked_list.html',' Public Member Functions | Public Attributes | List of all members -
-
stack_linkedList Class Reference
+
stack_linkedList Class Reference
@@ -105,27 +104,146 @@ Collaboration diagram for stack_linkedList:
[legend]
- - + - + - +

+

Public Member Functions

-void enqueue (int)
void enqueue (int)
 
-int dequeue ()
int dequeue ()
 
-void display ()
void display ()
 
- - -

+

Public Attributes

+
linkedlistfront
 
+
linkedlistrear
 
+

Constructor & Destructor Documentation

+ +

◆ stack_linkedList()

+ +
+
+ + + + + +
+ + + + + + + +
stack_linkedList::stack_linkedList ()
+
+inline
+
+
15{ front = rear = NULL; }
+
+
+
+

Member Function Documentation

+ +

◆ dequeue()

+ +
+
+ + + + + + + +
int stack_linkedList::dequeue ()
+
+
32 {
+
33 linkedlist *temp;
+
34 int ele;
+
35 if (front == NULL)
+
36 std::cout << "\nStack is empty";
+
37 else {
+
38 temp = front;
+
39 ele = temp->data;
+
40 if (front == rear) // if length of queue is 1;
+
41 rear = rear->next;
+
42 front = front->next;
+
43 delete (temp);
+
44 }
+
45 return ele;
+
46}
+ +
Definition: queue_using_linkedlist.cpp:6
+
+
+
+ +

◆ display()

+ +
+
+ + + + + + + +
void stack_linkedList::display ()
+
+
47 {
+
48 if (front == NULL)
+
49 std::cout << "\nStack is empty";
+
50
+
51 else {
+
52 linkedlist *temp;
+
53 temp = front;
+
54 while (temp != NULL) {
+
55 std::cout << temp->data << " ";
+
56 temp = temp->next;
+
57 }
+
58 }
+
59}
+
+
+
+ +

◆ enqueue()

+ +
+
+ + + + + + + + +
void stack_linkedList::enqueue (int ele)
+
+
20 {
+
21 linkedlist *temp = new linkedlist();
+
22 temp->data = ele;
+
23 temp->next = NULL;
+
24
+
25 if (front == NULL)
+
26 front = rear = temp;
+
27 else {
+
28 rear->next = temp;
+
29 rear = temp;
+
30 }
+
31}
+
+
+

The documentation for this class was generated from the following file:
  • data_structures/queue_using_linkedlist.cpp
@@ -135,7 +253,7 @@ Public Attributes diff --git a/d2/dc4/classstack__linked_list.js b/d2/dc4/classstack__linked_list.js deleted file mode 100644 index e5037602d..000000000 --- a/d2/dc4/classstack__linked_list.js +++ /dev/null @@ -1,9 +0,0 @@ -var classstack__linked_list = -[ - [ "stack_linkedList", "d2/dc4/classstack__linked_list.html#a44c1c5a34c5fb553025a33abe4f2e819", null ], - [ "dequeue", "d2/dc4/classstack__linked_list.html#af12688f7e4d74a978c93d5b26199a208", null ], - [ "display", "d2/dc4/classstack__linked_list.html#a565e79ec7a9d949664277afda874cf7c", null ], - [ "enqueue", "d2/dc4/classstack__linked_list.html#a1d32f339f2b90dea16f89282db7074e5", null ], - [ "front", "d2/dc4/classstack__linked_list.html#a445c8ffd4a85bf74a5d5f7b7e716f06d", null ], - [ "rear", "d2/dc4/classstack__linked_list.html#aa34ec2024dcfe130e6458149093772b3", null ] -]; \ No newline at end of file diff --git a/d2/dce/classothers_1_1iterative__tree__traversals_1_1_binary_tree-members.html b/d2/dce/classothers_1_1iterative__tree__traversals_1_1_binary_tree-members.html index d2bf6af24..8e9bd5a79 100644 --- a/d2/dce/classothers_1_1iterative__tree__traversals_1_1_binary_tree-members.html +++ b/d2/dce/classothers_1_1iterative__tree__traversals_1_1_binary_tree-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,23 +90,22 @@ $(document).ready(function(){initNavTree('d9/d12/classothers_1_1iterative__tree_
-
-
others::iterative_tree_traversals::BinaryTree Member List
+
others::iterative_tree_traversals::BinaryTree Member List
diff --git a/d2/dcf/namespacestatistics.html b/d2/dcf/namespacestatistics.html index fdbe11c39..cbddb20aa 100644 --- a/d2/dcf/namespacestatistics.html +++ b/d2/dcf/namespacestatistics.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: statistics Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,15 +92,14 @@ $(document).ready(function(){initNavTree('d2/dcf/namespacestatistics.html','../.
-
-
statistics Namespace Reference
+
statistics Namespace Reference

Statistical algorithms. More...

- @@ -108,14 +107,14 @@ Classes

+

Classes

class  stats_computer1
 
 

Detailed Description

-

Statistical algorithms.

+

Statistical algorithms.

diff --git a/d2/dd4/structstd_1_1is__integral_3_01uint128__t_01_4.html b/d2/dd4/structstd_1_1is__integral_3_01uint128__t_01_4.html index abc2c044b..68ad4e24d 100644 --- a/d2/dd4/structstd_1_1is__integral_3_01uint128__t_01_4.html +++ b/d2/dd4/structstd_1_1is__integral_3_01uint128__t_01_4.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: std::is_integral< uint128_t > Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,8 +90,7 @@ $(document).ready(function(){initNavTree('d2/dd4/structstd_1_1is__integral_3_01u
-
-
std::is_integral< uint128_t > Struct Reference
+
std::is_integral< uint128_t > Struct Reference
@@ -115,7 +114,7 @@ Collaboration diagram for std::is_integral< uint128_t >:
diff --git a/d2/ddd/gaussian__elimination_8cpp__incl.svg b/d2/ddd/gaussian__elimination_8cpp__incl.svg index c76c258dc..b1df5bff5 100644 --- a/d2/ddd/gaussian__elimination_8cpp__incl.svg +++ b/d2/ddd/gaussian__elimination_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: house_robber Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d2/de1/namespacehouse__robber.html','.
-
-
house_robber Namespace Reference
+
house_robber Namespace Reference
-

Functions for the House Robber algorithm. +

Functions for the House Robber algorithm. More...

Detailed Description

-

Functions for the House Robber algorithm.

+

Functions for the House Robber algorithm.

diff --git a/d2/de3/structlinear__probing_1_1_entry-members.html b/d2/de3/structlinear__probing_1_1_entry-members.html index 7c50b16cc..fce753e72 100644 --- a/d2/de3/structlinear__probing_1_1_entry-members.html +++ b/d2/de3/structlinear__probing_1_1_entry-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,21 +90,20 @@ $(document).ready(function(){initNavTree('db/d19/structlinear__probing_1_1_entry
-
-
linear_probing::Entry Member List
+
linear_probing::Entry Member List

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

- +
Entry(int key=notPresent)linear_probing::Entryinlineexplicit
keylinear_probing::Entry
keylinear_probing::Entry
diff --git a/d2/de7/namespacerunge__kutta.html b/d2/de7/namespacerunge__kutta.html index 04ce1894e..f3bb8e280 100644 --- a/d2/de7/namespacerunge__kutta.html +++ b/d2/de7/namespacerunge__kutta.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: runge_kutta Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d2/de7/namespacerunge__kutta.html','..
-
-
runge_kutta Namespace Reference
+
runge_kutta Namespace Reference
-

Functions for Runge Kutta fourth order method. +

Functions for Runge Kutta fourth order method. More...

Detailed Description

-

Functions for Runge Kutta fourth order method.

+

Functions for Runge Kutta fourth order method.

diff --git a/d2/de9/heavy__light__decomposition_8cpp.html b/d2/de9/heavy__light__decomposition_8cpp.html index 4055798af..456eebfc5 100644 --- a/d2/de9/heavy__light__decomposition_8cpp.html +++ b/d2/de9/heavy__light__decomposition_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: range_queries/heavy_light_decomposition.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('d2/de9/heavy__light__decomposition_8cp Classes | Namespaces | Functions -
-
heavy_light_decomposition.cpp File Reference
+
heavy_light_decomposition.cpp File Reference
-

Heavy Light Decomposition implementation +

Heavy Light Decomposition implementation More...

#include <algorithm>
#include <cassert>
@@ -117,7 +116,7 @@ Include dependency graph for heavy_light_decomposition.cpp:
- @@ -129,16 +128,16 @@ Classes

+

Classes

class  range_queries::heavy_light_decomposition::Tree< X >
 A Basic Tree, which supports binary lifting. More...
 The Heavy-Light Decomposition class. More...
 
- - + - +

+

Namespaces

 range_queries
namespace  range_queries
 Algorithms and Data Structures that support range queries and updates.
 
 heavy_light_decomposition
namespace  heavy_light_decomposition
 Heavy light decomposition algorithm.
 
- @@ -150,16 +149,16 @@ Functions

+

Functions

static void test_1 ()
 
 

Detailed Description

-

Heavy Light Decomposition implementation

-
Author
Aniruthan R
+

Heavy Light Decomposition implementation

+
Author
Aniruthan R

Heavy-Light Decomposition is a technique on trees, that supports the following:

  1. Update node s, with a value v
  2. Return the (sum) of all node values on the simple path from a to b (sum) can also be replced with XOR, OR, AND, min, or max
-

The update is done in O(log n) time, and the query is done in O(log^2 n) time with HLD where, n is the number of nodes

-

The template type is the data type of the value stored in the nodes. If a non-primitive data-type is used as a template, the coressponding operators must be overloaded.

-

An HLD object can only be created with a constant number of nodes, and it cannot be changed later. Creaty an empty instance is not supported.

-

To start answering updates and queries,

    +

    The update is done in O(log n) time, and the query is done in O(log^2 n) time with HLD where, n is the number of nodes

    +

    The template type is the data type of the value stored in the nodes. If a non-primitive data-type is used as a template, the coressponding operators must be overloaded.

    +

    An HLD object can only be created with a constant number of nodes, and it cannot be changed later. Creaty an empty instance is not supported.

    +

    To start answering updates and queries,

    1. Create an instance of HLD<X> object (obj), with the required data type.
    2. Read in the edge/parent information and update it with obj.add_edge(). Note: The edges addes must be 0 indexed.
    3. Create a vector with initial node values, and call set_node_val() with it.
    4. @@ -167,9 +166,9 @@ Functions
    5. Call obj.update(node, new_val), to update the value at index 'node' to the new value. Note: node must be 0 indexed
    6. Call obj.query(a, b) to get the (sum) of node values in the simple path from a to b. Note: a and b, must be 0 indexed.
    -

    Sample I/O at the bottom.

    Todo:
    Support edge weight queries, by storing the edge weight value in it's child algorithm verified by testing in CSES path queries: https://cses.fi/problemset/task/1138
    +

    Sample I/O at the bottom.

    Todo:
    Support edge weight queries, by storing the edge weight value in it's child algorithm verified by testing in CSES path queries: https://cses.fi/problemset/task/1138

Function Documentation

- +

◆ main()

@@ -184,13 +183,13 @@ Functions
-

Main function

-
634  {
-
635  test_1();
-
636  test_2();
-
637  test_3();
-
638  return 0;
-
639 }
+

Main function

+
634 {
+
635 test_1();
+
636 test_2();
+
637 test_3();
+
638 return 0;
+
639}
static void test_1()
Definition: heavy_light_decomposition.cpp:505
static void test_2()
Definition: heavy_light_decomposition.cpp:549
static void test_3()
Definition: heavy_light_decomposition.cpp:592
@@ -203,7 +202,7 @@ Here is the call graph for this function:
- +

◆ test_1()

@@ -225,51 +224,51 @@ Here is the call graph for this function:
-

Test implementations

Returns
none
-
505  {
-
506  std::cout << "Test 1:\n";
-
507 
-
508  // Test details
-
509  int n = 5;
-
510  std::vector<int64_t> node_values = {4, 2, 5, 2, 1};
-
511  std::vector<std::vector<int>> edges = {{1, 2}, {1, 3}, {3, 4}, {3, 5}};
-
512  std::vector<std::vector<int>> queries = {
-
513  {2, 1, 4},
-
514  {1, 3, 2},
-
515  {2, 1, 4},
-
516  };
-
517  std::vector<int> expected_result = {11, 8};
-
518  std::vector<int> code_result;
-
519 
- -
521  hld.set_node_val(node_values);
-
522  for (int i = 0; i < n - 1; i++) {
-
523  int u = edges[i][0], v = edges[i][1];
-
524  hld.add_edge(u - 1, v - 1);
-
525  }
-
526  hld.init();
-
527  for (const auto &q : queries) {
-
528  int type = q[0];
-
529  if (type == 1) {
-
530  int p = q[1], x = q[2];
-
531  hld.update(p - 1, x);
-
532  } else if (type == 2) {
-
533  int a = q[1], b = q[2];
-
534  code_result.push_back(hld.query(a - 1, b - 1));
-
535  } else {
-
536  continue;
-
537  }
-
538  }
-
539  for (int i = 0; i < static_cast<int>(expected_result.size()); i++) {
-
540  assert(expected_result[i] == code_result[i]);
-
541  }
-
542  std::cout << "\nTest 1 passed!\n";
-
543 }
+

Test implementations

Returns
none
+
505 {
+
506 std::cout << "Test 1:\n";
+
507
+
508 // Test details
+
509 int n = 5;
+
510 std::vector<int64_t> node_values = {4, 2, 5, 2, 1};
+
511 std::vector<std::vector<int>> edges = {{1, 2}, {1, 3}, {3, 4}, {3, 5}};
+ +
513 {2, 1, 4},
+
514 {1, 3, 2},
+
515 {2, 1, 4},
+
516 };
+
517 std::vector<int> expected_result = {11, 8};
+
518 std::vector<int> code_result;
+
519
+ +
521 hld.set_node_val(node_values);
+
522 for (int i = 0; i < n - 1; i++) {
+
523 int u = edges[i][0], v = edges[i][1];
+
524 hld.add_edge(u - 1, v - 1);
+
525 }
+
526 hld.init();
+
527 for (const auto &q : queries) {
+
528 int type = q[0];
+
529 if (type == 1) {
+
530 int p = q[1], x = q[2];
+
531 hld.update(p - 1, x);
+
532 } else if (type == 2) {
+
533 int a = q[1], b = q[2];
+
534 code_result.push_back(hld.query(a - 1, b - 1));
+
535 } else {
+
536 continue;
+
537 }
+
538 }
+
539 for (int i = 0; i < static_cast<int>(expected_result.size()); i++) {
+
540 assert(expected_result[i] == code_result[i]);
+
541 }
+
542 std::cout << "\nTest 1 passed!\n";
+
543}
The Heavy-Light Decomposition class.
Definition: heavy_light_decomposition.cpp:336
T push_back(T... args)
T size(T... args)
- +
Here is the call graph for this function:
@@ -279,7 +278,7 @@ Here is the call graph for this function:
- +

◆ test_2()

@@ -301,45 +300,45 @@ Here is the call graph for this function:
-

Second test implementations

Returns
void
-
549  {
-
550  std::cout << "Test 2:\n";
-
551 
-
552  // Test details (Bamboo)
-
553  int n = 10;
-
554  std::vector<int64_t> node_values = {1, 8, 6, 8, 6, 2, 9, 2, 3, 2};
- -
556  {10, 5}, {6, 2}, {10, 7}, {5, 2}, {3, 9}, {8, 3}, {1, 4}, {6, 4}, {8, 7}};
-
557  std::vector<std::vector<int>> queries = {
-
558  {2, 1, 10}, {2, 1, 6}, {1, 3, 4}, {2, 1, 9}, {1, 5, 3},
-
559  {1, 7, 8}, {2, 1, 4}, {2, 1, 8}, {1, 1, 4}, {1, 2, 7}};
-
560  std::vector<int> expected_result = {27, 11, 45, 9, 34};
-
561  std::vector<int> code_result;
-
562 
- -
564  hld.set_node_val(node_values);
-
565  for (int i = 0; i < n - 1; i++) {
-
566  int u = edges[i][0], v = edges[i][1];
-
567  hld.add_edge(u - 1, v - 1);
-
568  }
-
569  hld.init();
-
570  for (const auto &q : queries) {
-
571  int type = q[0];
-
572  if (type == 1) {
-
573  int p = q[1], x = q[2];
-
574  hld.update(p - 1, x);
-
575  } else if (type == 2) {
-
576  int a = q[1], b = q[2];
-
577  code_result.push_back(hld.query(a - 1, b - 1));
-
578  } else {
-
579  continue;
-
580  }
-
581  }
-
582  for (int i = 0; i < static_cast<int>(expected_result.size()); i++) {
-
583  assert(expected_result[i] == code_result[i]);
-
584  }
-
585  std::cout << "\nTest2 passed!\n";
-
586 }
+

Second test implementations

Returns
void
+
549 {
+
550 std::cout << "Test 2:\n";
+
551
+
552 // Test details (Bamboo)
+
553 int n = 10;
+
554 std::vector<int64_t> node_values = {1, 8, 6, 8, 6, 2, 9, 2, 3, 2};
+ +
556 {10, 5}, {6, 2}, {10, 7}, {5, 2}, {3, 9}, {8, 3}, {1, 4}, {6, 4}, {8, 7}};
+ +
558 {2, 1, 10}, {2, 1, 6}, {1, 3, 4}, {2, 1, 9}, {1, 5, 3},
+
559 {1, 7, 8}, {2, 1, 4}, {2, 1, 8}, {1, 1, 4}, {1, 2, 7}};
+
560 std::vector<int> expected_result = {27, 11, 45, 9, 34};
+
561 std::vector<int> code_result;
+
562
+ +
564 hld.set_node_val(node_values);
+
565 for (int i = 0; i < n - 1; i++) {
+
566 int u = edges[i][0], v = edges[i][1];
+
567 hld.add_edge(u - 1, v - 1);
+
568 }
+
569 hld.init();
+
570 for (const auto &q : queries) {
+
571 int type = q[0];
+
572 if (type == 1) {
+
573 int p = q[1], x = q[2];
+
574 hld.update(p - 1, x);
+
575 } else if (type == 2) {
+
576 int a = q[1], b = q[2];
+
577 code_result.push_back(hld.query(a - 1, b - 1));
+
578 } else {
+
579 continue;
+
580 }
+
581 }
+
582 for (int i = 0; i < static_cast<int>(expected_result.size()); i++) {
+
583 assert(expected_result[i] == code_result[i]);
+
584 }
+
585 std::cout << "\nTest2 passed!\n";
+
586}
Here is the call graph for this function:
@@ -349,7 +348,7 @@ Here is the call graph for this function:
- +

◆ test_3()

@@ -371,45 +370,45 @@ Here is the call graph for this function:
-

Third test implementations

Returns
void
-
592  {
-
593  std::cout << "Test 3:\n";
-
594 
-
595  // Test details
-
596  int n = 8;
-
597  std::vector<int64_t> node_values = {1, 8, 6, 8, 6, 2, 9, 2};
-
598  std::vector<std::vector<int>> edges = {{1, 2}, {2, 3}, {3, 4}, {1, 5},
-
599  {6, 3}, {7, 5}, {8, 7}};
-
600  std::vector<std::vector<int>> queries = {
-
601  {2, 6, 8}, {2, 3, 6}, {1, 3, 4}, {2, 7, 1}, {1, 5, 3},
-
602  {1, 7, 8}, {2, 6, 4}, {2, 7, 8}, {1, 1, 4}, {1, 2, 7}};
-
603  std::vector<int> expected_result = {34, 8, 16, 14, 10};
-
604  std::vector<int> code_result;
-
605 
- -
607  hld.set_node_val(node_values);
-
608  for (int i = 0; i < n - 1; i++) {
-
609  int u = edges[i][0], v = edges[i][1];
-
610  hld.add_edge(u - 1, v - 1);
-
611  }
-
612  hld.init();
-
613  for (const auto &q : queries) {
-
614  int type = q[0];
-
615  if (type == 1) {
-
616  int p = q[1], x = q[2];
-
617  hld.update(p - 1, x);
-
618  } else if (type == 2) {
-
619  int a = q[1], b = q[2];
-
620  code_result.push_back(hld.query(a - 1, b - 1));
-
621  } else {
-
622  continue;
-
623  }
-
624  }
-
625  for (int i = 0; i < static_cast<int>(expected_result.size()); i++) {
-
626  assert(expected_result[i] == code_result[i]);
-
627  }
-
628  std::cout << "\nTest3 passed!\n";
-
629 }
+

Third test implementations

Returns
void
+
592 {
+
593 std::cout << "Test 3:\n";
+
594
+
595 // Test details
+
596 int n = 8;
+
597 std::vector<int64_t> node_values = {1, 8, 6, 8, 6, 2, 9, 2};
+
598 std::vector<std::vector<int>> edges = {{1, 2}, {2, 3}, {3, 4}, {1, 5},
+
599 {6, 3}, {7, 5}, {8, 7}};
+ +
601 {2, 6, 8}, {2, 3, 6}, {1, 3, 4}, {2, 7, 1}, {1, 5, 3},
+
602 {1, 7, 8}, {2, 6, 4}, {2, 7, 8}, {1, 1, 4}, {1, 2, 7}};
+
603 std::vector<int> expected_result = {34, 8, 16, 14, 10};
+
604 std::vector<int> code_result;
+
605
+ +
607 hld.set_node_val(node_values);
+
608 for (int i = 0; i < n - 1; i++) {
+
609 int u = edges[i][0], v = edges[i][1];
+
610 hld.add_edge(u - 1, v - 1);
+
611 }
+
612 hld.init();
+
613 for (const auto &q : queries) {
+
614 int type = q[0];
+
615 if (type == 1) {
+
616 int p = q[1], x = q[2];
+
617 hld.update(p - 1, x);
+
618 } else if (type == 2) {
+
619 int a = q[1], b = q[2];
+
620 code_result.push_back(hld.query(a - 1, b - 1));
+
621 } else {
+
622 continue;
+
623 }
+
624 }
+
625 for (int i = 0; i < static_cast<int>(expected_result.size()); i++) {
+
626 assert(expected_result[i] == code_result[i]);
+
627 }
+
628 std::cout << "\nTest3 passed!\n";
+
629}
Here is the call graph for this function:
@@ -425,7 +424,7 @@ Here is the call graph for this function:
diff --git a/d2/de9/heavy__light__decomposition_8cpp.js b/d2/de9/heavy__light__decomposition_8cpp.js index ba5ada3fd..b02f36d92 100644 --- a/d2/de9/heavy__light__decomposition_8cpp.js +++ b/d2/de9/heavy__light__decomposition_8cpp.js @@ -1,8 +1,8 @@ var heavy__light__decomposition_8cpp = [ - [ "Tree", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree" ], - [ "SG", "d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html", "d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g" ], - [ "HLD", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d" ], + [ "range_queries::heavy_light_decomposition::Tree< X >", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree" ], + [ "range_queries::heavy_light_decomposition::SG< X >", "d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html", "d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g" ], + [ "range_queries::heavy_light_decomposition::HLD< X >", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d" ], [ "main", "d2/de9/heavy__light__decomposition_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "test_1", "d2/de9/heavy__light__decomposition_8cpp.html#a34b8683a2b429de5cce57e6d733ec817", null ], [ "test_2", "d2/de9/heavy__light__decomposition_8cpp.html#a458410412185a5f09199deaff7157a8d", null ], diff --git a/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.map b/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.map index 8935c786a..70a919d51 100644 --- a/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.map +++ b/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.map @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.md5 b/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.md5 index a154e7f06..1f5ff31a8 100644 --- a/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.md5 +++ b/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.md5 @@ -1 +1 @@ -cea68cd36fea8bb76f95ea310e1e65fc \ No newline at end of file +af4357ba98660c282d9d8f9c3798b544 \ No newline at end of file diff --git a/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.svg b/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.svg index 868392faa..60247059b 100644 --- a/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.svg +++ b/d2/de9/heavy__light__decomposition_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.svg @@ -1,10 +1,10 @@ - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + lru_tests::run_tests - + Node1 - -lru_tests::run_tests + +lru_tests::run_tests Node1->Node1 - - + + Node2 - -lru_tests::test_1 + +lru_tests::test_1 Node1->Node2 - - + + - - -Node15 - - -lru_tests::test_2 + + +Node6 + + +lru_tests::test_2 - - -Node1->Node15 - - + + +Node1->Node6 + + - - -Node16 - - -lru_tests::test_3 + + +Node7 + + +lru_tests::test_3 - - -Node1->Node16 - - + + +Node1->Node7 + + - + Node2->Node2 - - + + Node3 - -others::lru_cache:: -LRUCache::getHits + +others::lru_cache:: +LRUCache::getHits Node2->Node3 - - + + Node4 - -others::lru_cache:: -LRUCache::getPageFault + +others::lru_cache:: +LRUCache::getPageFault Node2->Node4 - - + + Node5 - -others::lru_cache:: -LRUCache::refer + +others::lru_cache:: +LRUCache::refer Node2->Node5 - - + + - - -Node6 - - -std::list::back - - - - - -Node5->Node6 - - - - - -Node7 - - -std::list::begin - - - - - -Node5->Node7 - - - - - -Node8 - - -std::unordered_map::end - - - - + -Node5->Node8 - - +Node6->Node3 + + - - -Node9 - - -std::unordered_map -::erase - - - - + -Node5->Node9 - - +Node6->Node4 + + - - -Node10 - - -std::list::erase - - - - + -Node5->Node10 - - +Node6->Node5 + + - - -Node11 - - -std::unordered_map -::find - - - - + -Node5->Node11 - - +Node6->Node6 + + - - -Node12 - - -std::list::pop_back - - - - - -Node5->Node12 - - - - - -Node13 - - -std::list::push_front - - - - + -Node5->Node13 - - +Node7->Node3 + + - - -Node14 - - -std::list::size - - - - + -Node5->Node14 - - +Node7->Node4 + + - - -Node15->Node3 - - + + +Node7->Node5 + + - - -Node15->Node4 - - - - - -Node15->Node5 - - - - - -Node15->Node15 - - - - - -Node16->Node3 - - - - - -Node16->Node4 - - - - - -Node16->Node5 - - - - - -Node16->Node16 - - + + +Node7->Node7 + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/d3/db3/lru__cache_8cpp_a6a3be6d8871b1f5dc03688da8f3ee9e6_cgraph_org.svg b/d3/db3/lru__cache_8cpp_a6a3be6d8871b1f5dc03688da8f3ee9e6_cgraph_org.svg deleted file mode 100644 index 9935281c8..000000000 --- a/d3/db3/lru__cache_8cpp_a6a3be6d8871b1f5dc03688da8f3ee9e6_cgraph_org.svg +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - -lru_tests::run_tests - - - -Node1 - - -lru_tests::run_tests - - - - - -Node1->Node1 - - - - - -Node2 - - -lru_tests::test_1 - - - - - -Node1->Node2 - - - - - -Node15 - - -lru_tests::test_2 - - - - - -Node1->Node15 - - - - - -Node16 - - -lru_tests::test_3 - - - - - -Node1->Node16 - - - - - -Node2->Node2 - - - - - -Node3 - - -others::lru_cache:: -LRUCache::getHits - - - - - -Node2->Node3 - - - - - -Node4 - - -others::lru_cache:: -LRUCache::getPageFault - - - - - -Node2->Node4 - - - - - -Node5 - - -others::lru_cache:: -LRUCache::refer - - - - - -Node2->Node5 - - - - - -Node6 - - -std::list::back - - - - - -Node5->Node6 - - - - - -Node7 - - -std::list::begin - - - - - -Node5->Node7 - - - - - -Node8 - - -std::unordered_map::end - - - - - -Node5->Node8 - - - - - -Node9 - - -std::unordered_map -::erase - - - - - -Node5->Node9 - - - - - -Node10 - - -std::list::erase - - - - - -Node5->Node10 - - - - - -Node11 - - -std::unordered_map -::find - - - - - -Node5->Node11 - - - - - -Node12 - - -std::list::pop_back - - - - - -Node5->Node12 - - - - - -Node13 - - -std::list::push_front - - - - - -Node5->Node13 - - - - - -Node14 - - -std::list::size - - - - - -Node5->Node14 - - - - - -Node15->Node3 - - - - - -Node15->Node4 - - - - - -Node15->Node5 - - - - - -Node15->Node15 - - - - - -Node16->Node3 - - - - - -Node16->Node4 - - - - - -Node16->Node5 - - - - - -Node16->Node16 - - - - - diff --git a/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 8610f4f53..2f3afc4ac 100644 --- a/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,17 +1,8 @@ - + - - - - - - - - - - + diff --git a/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index acb4294de..0ad6aef71 100644 --- a/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -7b5765ca7874b2630d439c39927a8723 \ No newline at end of file +364b6258fe6fe3ba77e37c884b0d5c55 \ No newline at end of file diff --git a/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 3e4ebec49..f8b35d152 100644 --- a/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d3/db3/lru__cache_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,20 +1,20 @@ - - - + + main - + Node1 - -main + +main @@ -22,223 +22,86 @@ Node2 - -others::lru_cache:: -LRUCache::display + +others::lru_cache:: +LRUCache::display Node1->Node2 - - + + Node3 - -std::endl + +std::endl Node1->Node3 - - + + Node4 - -others::lru_cache:: -LRUCache::getHits + +others::lru_cache:: +LRUCache::getHits Node1->Node4 - - + + Node5 - -others::lru_cache:: -LRUCache::getPageFault + +others::lru_cache:: +LRUCache::getPageFault Node1->Node5 - - + + Node6 - -others::lru_cache:: -LRUCache::refer + +others::lru_cache:: +LRUCache::refer Node1->Node6 - - + + Node2->Node3 - - - - - -Node7 - - -std::list::back - - - - - -Node6->Node7 - - - - - -Node8 - - -std::list::begin - - - - - -Node6->Node8 - - - - - -Node9 - - -std::unordered_map::end - - - - - -Node6->Node9 - - - - - -Node10 - - -std::unordered_map -::erase - - - - - -Node6->Node10 - - - - - -Node11 - - -std::list::erase - - - - - -Node6->Node11 - - - - - -Node12 - - -std::unordered_map -::find - - - - - -Node6->Node12 - - - - - -Node13 - - -std::list::pop_back - - - - - -Node6->Node13 - - - - - -Node14 - - -std::list::push_front - - - - - -Node6->Node14 - - - - - -Node15 - - -std::list::size - - - - - -Node6->Node15 - - + + diff --git a/d3/db7/graph_2dijkstra_8cpp__incl.svg b/d3/db7/graph_2dijkstra_8cpp__incl.svg index e3c6595c1..f29d613fc 100644 --- a/d3/db7/graph_2dijkstra_8cpp__incl.svg +++ b/d3/db7/graph_2dijkstra_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: CycleCheck Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -95,40 +95,63 @@ $(document).ready(function(){initNavTree('d3/dbb/class_cycle_check.html','../../ Private Types | Static Private Member Functions | List of all members -
-
CycleCheck Class Reference
+
CycleCheck Class Reference
-

+

Static Public Member Functions

static bool isCyclicDFS (Graph const &graph)
 
static bool isCyclicBFS (Graph const &graph)
 
- -

+

Private Types

enum  nodeStates : uint8_t { not_visited = 0 +
enum  nodeStates : uint8_t { not_visited = 0 , in_stack , visited }
 
-

+

Static Private Member Functions

static bool isCyclicDFSHelper (AdjList const &adjList, std::vector< nodeStates > *state, unsigned int node)
 

Detailed Description

-

Check if a directed graph has a cycle or not.

-

This class provides 2 methods to check for cycle in a directed graph: isCyclicDFS & isCyclicBFS.

+

Check if a directed graph has a cycle or not.

+

This class provides 2 methods to check for cycle in a directed graph: isCyclicDFS & isCyclicBFS.

  • isCyclicDFS uses DFS traversal method to check for cycle in a graph.
  • isCyclidBFS used BFS traversal method to check for cycle in a graph.
-

Member Function Documentation

- +

Member Enumeration Documentation

+ +

◆ nodeStates

+ +
+
+ + + + + +
+ + + + +
enum CycleCheck::nodeStates : uint8_t
+
+private
+
+
160: uint8_t { not_visited = 0, in_stack, visited };
+
+
+
+

Member Function Documentation

+

◆ isCyclicBFS()

@@ -151,8 +174,8 @@ Static Private Member Functions
-

Check if a graph has cycle or not.

-

This function uses BFS to check if a graph is cyclic or not.

+

Check if a graph has cycle or not.

+

This function uses BFS to check if a graph is cyclic or not.

Parameters
@@ -160,56 +183,56 @@ Static Private Member Functions
Returns
true if a cycle is detected, else false.
-
249  {
-
250  auto graphAjdList = graph.getAdjList();
-
251  auto vertices = graph.getVertices();
-
252 
-
253  std::vector<unsigned int> indegree(vertices, 0);
-
254  // Calculate the indegree i.e. the number of incident edges to the node.
-
255  for (auto const& list : graphAjdList) {
-
256  auto children = list.second;
-
257  for (auto const& child : children) {
-
258  indegree[child]++;
-
259  }
-
260  }
-
261 
-
262  std::queue<unsigned int> can_be_solved;
-
263  for (unsigned int node = 0; node < vertices; node++) {
-
264  // If a node doesn't have any input edges, then that node will
-
265  // definately not result in a cycle and can be visited safely.
-
266  if (!indegree[node]) {
-
267  can_be_solved.emplace(node);
-
268  }
-
269  }
-
270 
-
271  // Vertices that need to be traversed.
-
272  auto remain = vertices;
-
273  // While there are safe nodes that we can visit.
-
274  while (!can_be_solved.empty()) {
-
275  auto solved = can_be_solved.front();
-
276  // Visit the node.
-
277  can_be_solved.pop();
-
278  // Decrease number of nodes that need to be traversed.
-
279  remain--;
-
280 
-
281  // Visit all the children of the visited node.
-
282  auto it = graphAjdList.find(solved);
-
283  if (it != graphAjdList.end()) {
-
284  for (auto child : it->second) {
-
285  // Check if we can visited the node safely.
-
286  if (--indegree[child] == 0) {
-
287  // if node can be visited safely, then add that node to
-
288  // the visit queue.
-
289  can_be_solved.emplace(child);
-
290  }
-
291  }
-
292  }
-
293  }
-
294 
-
295  // If there are still nodes that we can't visit, then it means that
-
296  // there is a cycle and return true, else return false.
-
297  return !(remain == 0);
-
298  }
+
249 {
+
250 auto graphAjdList = graph.getAdjList();
+
251 auto vertices = graph.getVertices();
+
252
+
253 std::vector<unsigned int> indegree(vertices, 0);
+
254 // Calculate the indegree i.e. the number of incident edges to the node.
+
255 for (auto const& list : graphAjdList) {
+
256 auto children = list.second;
+
257 for (auto const& child : children) {
+
258 indegree[child]++;
+
259 }
+
260 }
+
261
+
262 std::queue<unsigned int> can_be_solved;
+
263 for (unsigned int node = 0; node < vertices; node++) {
+
264 // If a node doesn't have any input edges, then that node will
+
265 // definately not result in a cycle and can be visited safely.
+
266 if (!indegree[node]) {
+
267 can_be_solved.emplace(node);
+
268 }
+
269 }
+
270
+
271 // Vertices that need to be traversed.
+
272 auto remain = vertices;
+
273 // While there are safe nodes that we can visit.
+
274 while (!can_be_solved.empty()) {
+
275 auto solved = can_be_solved.front();
+
276 // Visit the node.
+
277 can_be_solved.pop();
+
278 // Decrease number of nodes that need to be traversed.
+
279 remain--;
+
280
+
281 // Visit all the children of the visited node.
+
282 auto it = graphAjdList.find(solved);
+
283 if (it != graphAjdList.end()) {
+
284 for (auto child : it->second) {
+
285 // Check if we can visited the node safely.
+
286 if (--indegree[child] == 0) {
+
287 // if node can be visited safely, then add that node to
+
288 // the visit queue.
+
289 can_be_solved.emplace(child);
+
290 }
+
291 }
+
292 }
+
293 }
+
294
+
295 // If there are still nodes that we can't visit, then it means that
+
296 // there is a cycle and return true, else return false.
+
297 return !(remain == 0);
+
298 }
T emplace(T... args)
T empty(T... args)
T front(T... args)
@@ -228,7 +251,7 @@ Here is the call graph for this function:
- +

◆ isCyclicDFS()

@@ -251,8 +274,8 @@ Here is the call graph for this function:
graphwhich needs to be evaluated for the presence of cycle.
-

Driver function to check if a graph has a cycle.

-

This function uses DFS to check for cycle in the graph.

+

Driver function to check if a graph has a cycle.

+

This function uses DFS to check for cycle in the graph.

Parameters
@@ -260,38 +283,38 @@ Here is the call graph for this function:
Returns
true if a cycle is detected, else false.
-

State of the node.

-

It is a vector of "nodeStates" which represents the state node is in. It can take only 3 values: "not_visited", "in_stack", and "visited".

-

Initially, all nodes are in "not_visited" state.

-
212  {
-
213  auto vertices = graph.getVertices();
-
214 
-
215  /** State of the node.
-
216  *
-
217  * It is a vector of "nodeStates" which represents the state node is in.
-
218  * It can take only 3 values: "not_visited", "in_stack", and "visited".
-
219  *
-
220  * Initially, all nodes are in "not_visited" state.
-
221  */
-
222  std::vector<nodeStates> state(vertices, not_visited);
-
223 
-
224  // Start visiting each node.
-
225  for (unsigned int node = 0; node < vertices; node++) {
-
226  // If a node is not visited, only then check for presence of cycle.
-
227  // There is no need to check for presence of cycle for a visited
-
228  // node as it has already been checked for presence of cycle.
-
229  if (state[node] == not_visited) {
-
230  // Check for cycle.
-
231  if (isCyclicDFSHelper(graph.getAdjList(), &state, node)) {
-
232  return true;
-
233  }
-
234  }
-
235  }
-
236 
-
237  // All nodes have been safely traversed, that means there is no cycle in
-
238  // the graph. Return false.
-
239  return false;
-
240  }
+

State of the node.

+

It is a vector of "nodeStates" which represents the state node is in. It can take only 3 values: "not_visited", "in_stack", and "visited".

+

Initially, all nodes are in "not_visited" state.

+
212 {
+
213 auto vertices = graph.getVertices();
+
214
+
215 /** State of the node.
+
216 *
+
217 * It is a vector of "nodeStates" which represents the state node is in.
+
218 * It can take only 3 values: "not_visited", "in_stack", and "visited".
+
219 *
+
220 * Initially, all nodes are in "not_visited" state.
+
221 */
+
222 std::vector<nodeStates> state(vertices, not_visited);
+
223
+
224 // Start visiting each node.
+
225 for (unsigned int node = 0; node < vertices; node++) {
+
226 // If a node is not visited, only then check for presence of cycle.
+
227 // There is no need to check for presence of cycle for a visited
+
228 // node as it has already been checked for presence of cycle.
+
229 if (state[node] == not_visited) {
+
230 // Check for cycle.
+
231 if (isCyclicDFSHelper(graph.getAdjList(), &state, node)) {
+
232 return true;
+
233 }
+
234 }
+
235 }
+
236
+
237 // All nodes have been safely traversed, that means there is no cycle in
+
238 // the graph. Return false.
+
239 return false;
+
240 }
static bool isCyclicDFSHelper(AdjList const &adjList, std::vector< nodeStates > *state, unsigned int node)
Definition: cycle_check_directed_graph.cpp:170
Here is the call graph for this function:
@@ -302,7 +325,7 @@ Here is the call graph for this function:
- +

◆ isCyclicDFSHelper()

@@ -341,7 +364,7 @@ Here is the call graph for this function:
graphwhich needs to be evaluated for the presence of cycle.
-

Helper function of "isCyclicDFS".

+

Helper function of "isCyclicDFS".

Parameters
@@ -351,37 +374,37 @@ Here is the call graph for this function:
Returns
true if graph has a cycle, else false.
-
172  {
-
173  // Add node "in_stack" state.
-
174  (*state)[node] = in_stack;
-
175 
-
176  // If the node has children, then recursively visit all children of the
-
177  // node.
-
178  auto const it = adjList.find(node);
-
179  if (it != adjList.end()) {
-
180  for (auto child : it->second) {
-
181  // If state of child node is "not_visited", evaluate that child
-
182  // for presence of cycle.
-
183  auto state_of_child = (*state)[child];
-
184  if (state_of_child == not_visited) {
-
185  if (isCyclicDFSHelper(adjList, state, child)) {
-
186  return true;
-
187  }
-
188  } else if (state_of_child == in_stack) {
-
189  // If child node was "in_stack", then that means that there
-
190  // is a cycle in the graph. Return true for presence of the
-
191  // cycle.
-
192  return true;
-
193  }
-
194  }
-
195  }
-
196 
-
197  // Current node has been evaluated for the presence of cycle and had no
-
198  // cycle. Mark current node as "visited".
-
199  (*state)[node] = visited;
-
200  // Return that current node didn't result in any cycles.
-
201  return false;
-
202  }
+
172 {
+
173 // Add node "in_stack" state.
+
174 (*state)[node] = in_stack;
+
175
+
176 // If the node has children, then recursively visit all children of the
+
177 // node.
+
178 auto const it = adjList.find(node);
+
179 if (it != adjList.end()) {
+
180 for (auto child : it->second) {
+
181 // If state of child node is "not_visited", evaluate that child
+
182 // for presence of cycle.
+
183 auto state_of_child = (*state)[child];
+
184 if (state_of_child == not_visited) {
+
185 if (isCyclicDFSHelper(adjList, state, child)) {
+
186 return true;
+
187 }
+
188 } else if (state_of_child == in_stack) {
+
189 // If child node was "in_stack", then that means that there
+
190 // is a cycle in the graph. Return true for presence of the
+
191 // cycle.
+
192 return true;
+
193 }
+
194 }
+
195 }
+
196
+
197 // Current node has been evaluated for the presence of cycle and had no
+
198 // cycle. Mark current node as "visited".
+
199 (*state)[node] = visited;
+
200 // Return that current node didn't result in any cycles.
+
201 return false;
+
202 }
struct list node
Here is the call graph for this function:
@@ -401,7 +424,7 @@ Here is the call graph for this function:
diff --git a/d3/dbb/class_cycle_check.js b/d3/dbb/class_cycle_check.js index 032218c69..8d28c289a 100644 --- a/d3/dbb/class_cycle_check.js +++ b/d3/dbb/class_cycle_check.js @@ -1,10 +1,5 @@ var class_cycle_check = [ - [ "nodeStates", "d3/dbb/class_cycle_check.html#ae68a1f08ee8c0b6323ab0f281862eadf", [ - [ "not_visited", "d3/dbb/class_cycle_check.html#ae68a1f08ee8c0b6323ab0f281862eadfa0d6bede6610396cc93dae3c1c7dea757", null ], - [ "in_stack", "d3/dbb/class_cycle_check.html#ae68a1f08ee8c0b6323ab0f281862eadfaf79bb27ce88c169c6039c6a3e2938fa0", null ], - [ "visited", "d3/dbb/class_cycle_check.html#ae68a1f08ee8c0b6323ab0f281862eadfa81d65ae802bc0dd049a92f218008e01f", null ] - ] ], [ "isCyclicBFS", "d3/dbb/class_cycle_check.html#a399292a33edf87499daa52b51315aca5", null ], [ "isCyclicDFS", "d3/dbb/class_cycle_check.html#ad9a270ffba3a68539b92272c702e3474", null ], [ "isCyclicDFSHelper", "d3/dbb/class_cycle_check.html#a2f4485c08b45e7a21a2e86f9c3f01d8b", null ] diff --git a/d3/dbb/class_cycle_check_a2f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.md5 b/d3/dbb/class_cycle_check_a2f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.md5 index 4c013e8f2..06a355446 100644 --- a/d3/dbb/class_cycle_check_a2f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.md5 +++ b/d3/dbb/class_cycle_check_a2f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.md5 @@ -1 +1 @@ -a0c6be2ab13c9d776c2c4df1beabd198 \ No newline at end of file +1960e3d0311624e3592380a0e87b2f34 \ No newline at end of file diff --git a/d3/dbb/class_cycle_check_a2f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.svg b/d3/dbb/class_cycle_check_a2f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.svg index 1a72faf54..64e960cf6 100644 --- a/d3/dbb/class_cycle_check_a2f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.svg +++ b/d3/dbb/class_cycle_check_a2f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.svg @@ -1,7 +1,7 @@ - + + +Node1->Node1 + + + Node2 diff --git a/d3/dbb/class_cycle_check_a399292a33edf87499daa52b51315aca5_cgraph.svg b/d3/dbb/class_cycle_check_a399292a33edf87499daa52b51315aca5_cgraph.svg index 41947be3d..5953df327 100644 --- a/d3/dbb/class_cycle_check_a399292a33edf87499daa52b51315aca5_cgraph.svg +++ b/d3/dbb/class_cycle_check_a399292a33edf87499daa52b51315aca5_cgraph.svg @@ -1,7 +1,7 @@ - - + + +Node2->Node2 + + + Node3 diff --git a/d3/dbe/comb__sort_8cpp__incl.svg b/d3/dbe/comb__sort_8cpp__incl.svg index f4a039610..2689aff4a 100644 --- a/d3/dbe/comb__sort_8cpp__incl.svg +++ b/d3/dbe/comb__sort_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + +Algorithms_in_C++: fibonacci_sum Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
adjListis the adjacency list representation of some graph.
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d3/dc9/namespacefibonacci__sum.html','
-
-
fibonacci_sum Namespace Reference
+
fibonacci_sum Namespace Reference

Functions for the sum of the Fibonacci Sequence: \(\mathrm{F}(n) + \mathrm{F}(n+1) + .. + \mathrm{F}(m)\). More...

Detailed Description

-

Functions for the sum of the Fibonacci Sequence: \(\mathrm{F}(n) + \mathrm{F}(n+1) + .. + \mathrm{F}(m)\).

+

Functions for the sum of the Fibonacci Sequence: \(\mathrm{F}(n) + \mathrm{F}(n+1) + .. + \mathrm{F}(m)\).

diff --git a/d3/dce/linkedlist__implentation__usingarray_8cpp.html b/d3/dce/linkedlist__implentation__usingarray_8cpp.html index baca140c6..04c335fd5 100644 --- a/d3/dce/linkedlist__implentation__usingarray_8cpp.html +++ b/d3/dce/linkedlist__implentation__usingarray_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: data_structures/linkedlist_implentation_usingarray.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,8 +94,7 @@ $(document).ready(function(){initNavTree('d3/dce/linkedlist__implentation__using Classes | Functions | Variables -
-
linkedlist_implentation_usingarray.cpp File Reference
+
linkedlist_implentation_usingarray.cpp File Reference
@@ -109,15 +108,14 @@ Include dependency graph for linkedlist_implentation_usingarray.cpp:
-

+

Classes

class  Node
 
- - + @@ -125,36 +123,62 @@ void  - + - +

+

Functions

-void initialise_list ()
void initialise_list ()
 
int getnode ()
 
initialise_list (
 
void insertAtTheBeginning (int data)
 
-void insertAtTheEnd (int data)
void insertAtTheEnd (int data)
 
-void display ()
void display ()
 
int main ()
 
- - + - -

+

Variables

-Node AvailArray [100]
+Node AvailArray [100]
 array that will act as nodes of a linked list.
 
+
int head = -1
 
+
int avail = 0
 

Detailed Description

-

Linked list implementation using Arrays.

-

The difference between the pointer implementation of linked list and array implementation of linked list:

    +

    Linked list implementation using Arrays.

    +

    The difference between the pointer implementation of linked list and array implementation of linked list:

    1. The NULL is represented by -1;
    2. Limited size. (in the following case it is 100 nodes at max). But we can reuse the nodes that are to be deleted by again linking it bacj to the list.

    Function Documentation

    - + +

    ◆ display()

    + +
    +
    + + + + + + + +
    void display ()
    +
    +
    69 {
    +
    70 int temp = head;
    +
    71 while (temp != -1) {
    +
    72 std::cout << AvailArray[temp].data << "->";
    +
    73 temp = AvailArray[temp].next;
    +
    74 }
    +
    75 std::cout << "-1" << std::endl;
    +
    76}
    + +
    T endl(T... args)
    +
    Node AvailArray[100]
    array that will act as nodes of a linked list.
    Definition: linkedlist_implentation_usingarray.cpp:19
    +
    +
    +
    +

    ◆ freeNode()

    @@ -169,16 +193,15 @@ int avail = 0
    -

    This function when called will delete the node with the index presented as an argument, and will put back that node into the array.

    -
    42  {
    -
    43  AvailArray[nodeToBeDeleted].next = avail;
    -
    44  avail = nodeToBeDeleted;
    -
    45 }
    -
    Node AvailArray[100]
    array that will act as nodes of a linked list.
    Definition: linkedlist_implentation_usingarray.cpp:19
    +

    This function when called will delete the node with the index presented as an argument, and will put back that node into the array.

    +
    42 {
    +
    43 AvailArray[nodeToBeDeleted].next = avail;
    +
    44 avail = nodeToBeDeleted;
    +
    45}
    - +

    ◆ getnode()

    @@ -192,16 +215,39 @@ int avail = 0
    -

    This will return the index of the first free node present in the avail list

    -
    32  {
    -
    33  int NodeIndexToBeReturned = avail;
    -
    34  avail = AvailArray[avail].next;
    -
    35  return NodeIndexToBeReturned;
    -
    36 }
    +

    This will return the index of the first free node present in the avail list

    +
    32 {
    +
    33 int NodeIndexToBeReturned = avail;
    +
    34 avail = AvailArray[avail].next;
    +
    35 return NodeIndexToBeReturned;
    +
    36}
    - + +

    ◆ initialise_list()

    + +
    +
    + + + + + + + +
    void initialise_list ()
    +
    +
    23 {
    +
    24 for (int i = 0; i <= 98; i++) {
    +
    25 AvailArray[i].next = i + 1;
    +
    26 }
    +
    27 AvailArray[99].next = -1; // indicating the end of the linked list.
    +
    28}
    +
    +
    +
    +

    ◆ insertAtTheBeginning()

    @@ -216,13 +262,13 @@ int avail = 0
    -

    The function will insert the given data into the front of the linked list.

    -
    50  {
    -
    51  int newNode = getnode();
    -
    52  AvailArray[newNode].data = data;
    -
    53  AvailArray[newNode].next = head;
    -
    54  head = newNode;
    -
    55 }
    +

    The function will insert the given data into the front of the linked list.

    +
    50 {
    +
    51 int newNode = getnode();
    +
    52 AvailArray[newNode].data = data;
    +
    53 AvailArray[newNode].next = head;
    +
    54 head = newNode;
    +
    55}
    int data[MAX]
    test data
    Definition: hash_search.cpp:24
    int getnode()
    Definition: linkedlist_implentation_usingarray.cpp:32
    @@ -234,7 +280,36 @@ Here is the call graph for this function:
    - + +

    ◆ insertAtTheEnd()

    + +
    +
    + + + + + + + + +
    void insertAtTheEnd (int data)
    +
    +
    57 {
    +
    58 int newNode = getnode();
    +
    59 int temp = head;
    +
    60 while (AvailArray[temp].next != -1) {
    +
    61 temp = AvailArray[temp].next;
    +
    62 }
    +
    63 // temp is now pointing to the end node.
    +
    64 AvailArray[newNode].data = data;
    +
    65 AvailArray[newNode].next = -1;
    +
    66 AvailArray[temp].next = newNode;
    +
    67}
    +
    +
    +
    +

    ◆ main()

    @@ -249,46 +324,44 @@ Here is the call graph for this function:
-

Main function

-
79  {
-
80  initialise_list();
-
81  int x, y, z;
-
82  for (;;) {
-
83  std::cout << "1. Insert At The Beginning" << std::endl;
-
84  std::cout << "2. Insert At The End" << std::endl;
-
85  std::cout << "3. Display" << std::endl;
-
86  std::cout << "4.Exit" << std::endl;
-
87  std::cout << "Enter Your choice" << std::endl;
-
88  std::cin >> z;
-
89  switch (z) {
-
90  case 1:
-
91  std::cout << "Enter the number you want to enter" << std::endl;
-
92  std::cin >> x;
- -
94  break;
-
95  case 2:
-
96  std::cout << "Enter the number you want to enter" << std::endl;
-
97  std::cin >> y;
-
98  insertAtTheEnd(y);
-
99  break;
-
100  case 3:
-
101  std::cout
-
102  << "The linked list contains the following element in order"
-
103  << std::endl;
-
104  display();
-
105  break;
-
106  case 4:
-
107  return 0;
-
108  default:
-
109  std::cout << "The entered choice is not correct" << std::endl;
-
110  }
-
111  }
-
112 
-
113  return 0;
-
114 }
+

Main function

+
79 {
+
80 initialise_list();
+
81 int x, y, z;
+
82 for (;;) {
+
83 std::cout << "1. Insert At The Beginning" << std::endl;
+
84 std::cout << "2. Insert At The End" << std::endl;
+
85 std::cout << "3. Display" << std::endl;
+
86 std::cout << "4.Exit" << std::endl;
+
87 std::cout << "Enter Your choice" << std::endl;
+
88 std::cin >> z;
+
89 switch (z) {
+
90 case 1:
+
91 std::cout << "Enter the number you want to enter" << std::endl;
+
92 std::cin >> x;
+ +
94 break;
+
95 case 2:
+
96 std::cout << "Enter the number you want to enter" << std::endl;
+
97 std::cin >> y;
+
98 insertAtTheEnd(y);
+
99 break;
+
100 case 3:
+ +
102 << "The linked list contains the following element in order"
+
103 << std::endl;
+
104 display();
+
105 break;
+
106 case 4:
+
107 return 0;
+
108 default:
+
109 std::cout << "The entered choice is not correct" << std::endl;
+
110 }
+
111 }
+
112
+
113 return 0;
+
114}
- -
T endl(T... args)
void insertAtTheBeginning(int data)
Definition: linkedlist_implentation_usingarray.cpp:50
@@ -299,7 +372,7 @@ Here is the call graph for this function:
diff --git a/d3/dce/linkedlist__implentation__usingarray_8cpp.js b/d3/dce/linkedlist__implentation__usingarray_8cpp.js index c5b7c90fe..8db16fcc7 100644 --- a/d3/dce/linkedlist__implentation__usingarray_8cpp.js +++ b/d3/dce/linkedlist__implentation__usingarray_8cpp.js @@ -1,14 +1,9 @@ var linkedlist__implentation__usingarray_8cpp = [ - [ "Node", "db/d8b/struct_node.html", "db/d8b/struct_node" ], - [ "display", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#a1e5b20fed15743656bb6d2e6a6ea6269", null ], + [ "Node", "db/d8b/struct_node.html", null ], [ "freeNode", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#a08ba214242a900e7251cec556b592f02", null ], [ "getnode", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#a73e11e0871f56342a30da93b6c93e8be", null ], - [ "initialise_list", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#ac2fa82ac5ae366cc3aca53a40bb7cd70", null ], [ "insertAtTheBeginning", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#afcb07da7984e20b3207934696791f5df", null ], - [ "insertAtTheEnd", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#a92e0c1bb3b270143881e36b5fea8a60d", null ], [ "main", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "avail", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#ab84c7d9bed2aa1ade1fd61fbf5c2e07e", null ], - [ "AvailArray", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#aed19b403f559fc5d5a4bce724f9e263c", null ], - [ "head", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#a20358970b1abaf992eb85e071e454653", null ] + [ "AvailArray", "d3/dce/linkedlist__implentation__usingarray_8cpp.html#aed19b403f559fc5d5a4bce724f9e263c", null ] ]; \ No newline at end of file diff --git a/d3/dce/linkedlist__implentation__usingarray_8cpp_afcb07da7984e20b3207934696791f5df_cgraph.svg b/d3/dce/linkedlist__implentation__usingarray_8cpp_afcb07da7984e20b3207934696791f5df_cgraph.svg index 8c10aa0a7..e62b5587b 100644 --- a/d3/dce/linkedlist__implentation__usingarray_8cpp_afcb07da7984e20b3207934696791f5df_cgraph.svg +++ b/d3/dce/linkedlist__implentation__usingarray_8cpp_afcb07da7984e20b3207934696791f5df_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,28 +90,27 @@ $(document).ready(function(){initNavTree('d9/d35/classrange__queries_1_1heavy__l
-
-
range_queries::heavy_light_decomposition::SG< X > Member List
+
range_queries::heavy_light_decomposition::SG< X > Member List
diff --git a/d3/deb/namespaceshortest__common__supersequence.html b/d3/deb/namespaceshortest__common__supersequence.html index eb9bd565b..334939845 100644 --- a/d3/deb/namespaceshortest__common__supersequence.html +++ b/d3/deb/namespaceshortest__common__supersequence.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: shortest_common_supersequence Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d3/deb/namespaceshortest__common__supe
-
-
shortest_common_supersequence Namespace Reference
+
shortest_common_supersequence Namespace Reference

Shortest Common Super Sequence algorithm. More...

Detailed Description

-

Shortest Common Super Sequence algorithm.

+

Shortest Common Super Sequence algorithm.

diff --git a/d3/df9/recursive__bubble__sort_8cpp.html b/d3/df9/recursive__bubble__sort_8cpp.html index 5ceb3d96a..567bf3307 100644 --- a/d3/df9/recursive__bubble__sort_8cpp.html +++ b/d3/df9/recursive__bubble__sort_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: sorting/recursive_bubble_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d3/df9/recursive__bubble__sort_8cpp.ht -
-
recursive_bubble_sort.cpp File Reference
+
recursive_bubble_sort.cpp File Reference
-

This is an implementation of a recursive version of the Bubble sort algorithm +

This is an implementation of a recursive version of the Bubble sort algorithm More...

#include <cassert>
#include <iostream>
@@ -112,13 +111,13 @@ Include dependency graph for recursive_bubble_sort.cpp:
- - +

+

Namespaces

 sorting
namespace  sorting
 Sorting algorithms.
 
- @@ -132,22 +131,22 @@ Functions

+

Functions

template<typename T >
void sorting::recursive_bubble_sort (std::vector< T > *nums, uint64_t n)
 

Detailed Description

-

This is an implementation of a recursive version of the Bubble sort algorithm

-
Author
Aditya Prakash
+

This is an implementation of a recursive version of the Bubble sort algorithm

+
Author
Aditya Prakash

The working principle of the Bubble sort algorithm.

-

Bubble sort is a simple sorting algorithm used to rearrange a set of ascending or descending order elements. Bubble sort gets its name from the fact that data "bubbles" to the top of the dataset.

+

Bubble sort is a simple sorting algorithm used to rearrange a set of ascending or descending order elements. Bubble sort gets its name from the fact that data "bubbles" to the top of the dataset.

Algorithm

-

What is Swap?

-

Swapping two numbers means that we interchange their values. Often, an additional variable is required for this operation. This is further illustrated in the following:

-

void swap(int x, int y){ int z = x; x = y; y = z; }

-

The above process is a typical displacement process. When we assign a value to x, the old value of x is lost. That's why we create a temporary variable z to store the initial value of x. z is further used to assign the initial value of x to y, to complete swapping.

-

Recursion

-

While the recursive method does not necessarily have advantages over iterative versions, but it is useful to enhance the understanding of the algorithm and recursion itself. In Recursive Bubble sort algorithm, we firstly call the function on the entire array, and for every subsequent function call, we exclude the last element. This fixes the last element for that sub-array.Formally, for ith iteration, we consider elements up to n-i, where n is the number of elements in the array. Exit condition: n==1; i.e. the sub-array contains only one element.

-

Complexity Time complexity: O(n) best case; O(n²) average case; O(n²) worst case Space complexity: O(n)

-

We need to traverse the array n * (n-1) times. However, if the entire array is already sorted, then we need to traverse it only once. Hence, O(n) is the best case complexity

+

What is Swap?

+

Swapping two numbers means that we interchange their values. Often, an additional variable is required for this operation. This is further illustrated in the following:

+

void swap(int x, int y){ int z = x; x = y; y = z; }

+

The above process is a typical displacement process. When we assign a value to x, the old value of x is lost. That's why we create a temporary variable z to store the initial value of x. z is further used to assign the initial value of x to y, to complete swapping.

+

Recursion

+

While the recursive method does not necessarily have advantages over iterative versions, but it is useful to enhance the understanding of the algorithm and recursion itself. In Recursive Bubble sort algorithm, we firstly call the function on the entire array, and for every subsequent function call, we exclude the last element. This fixes the last element for that sub-array.Formally, for ith iteration, we consider elements up to n-i, where n is the number of elements in the array. Exit condition: n==1; i.e. the sub-array contains only one element.

+

Complexity Time complexity: O(n) best case; O(n²) average case; O(n²) worst case Space complexity: O(n)

+

We need to traverse the array n * (n-1) times. However, if the entire array is already sorted, then we need to traverse it only once. Hence, O(n) is the best case complexity

Function Documentation

- +

◆ main()

@@ -165,10 +164,10 @@ Algorithm

Main function.

Returns
0 on exit
-
146  {
-
147  test(); // run self-test implementations
-
148  return 0;
-
149 }
+
146 {
+
147 test(); // run self-test implementations
+
148 return 0;
+
149}
static void test()
Self-test implementations.
Definition: recursive_bubble_sort.cpp:95
Here is the call graph for this function:
@@ -179,7 +178,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -204,52 +203,52 @@ Here is the call graph for this function:

Self-test implementations.

Returns
void
-
95  {
-
96  // 1st example. Creating an array of type `int`.
-
97  std::cout << "1st test using `int`\n";
-
98  const uint64_t size = 6;
- -
100  // populating the array
-
101  arr.push_back(22);
-
102  arr.push_back(46);
-
103  arr.push_back(94);
-
104  arr.push_back(12);
-
105  arr.push_back(37);
-
106  arr.push_back(63);
-
107  // array populating ends
-
108 
-
109  sorting::recursive_bubble_sort(&arr, size);
-
110  assert(std::is_sorted(std::begin(arr), std::end(arr)));
-
111  std::cout << " 1st test passed!\n";
-
112  // printing the array
-
113  for (uint64_t i = 0; i < size; i++) {
-
114  std::cout << arr[i] << ", ";
-
115  }
-
116  std::cout << std::endl;
-
117 
-
118  // 2nd example. Creating an array of type `double`.
-
119  std::cout << "2nd test using doubles\n";
-
120  std::vector<double> double_arr;
-
121 
-
122  // populating the array
-
123  double_arr.push_back(20.4);
-
124  double_arr.push_back(62.7);
-
125  double_arr.push_back(12.2);
-
126  double_arr.push_back(43.6);
-
127  double_arr.push_back(74.1);
-
128  double_arr.push_back(57.9);
-
129  // array populating ends
-
130 
-
131  sorting::recursive_bubble_sort(&double_arr, size);
-
132  assert(std::is_sorted(std::begin(double_arr), std::end(double_arr)));
-
133  std::cout << " 2nd test passed!\n";
-
134  // printing the array
-
135  for (uint64_t i = 0; i < size; i++) {
-
136  std::cout << double_arr[i] << ", ";
-
137  }
-
138  std::cout << std::endl;
-
139 
-
140 }
+
95 {
+
96 // 1st example. Creating an array of type `int`.
+
97 std::cout << "1st test using `int`\n";
+
98 const uint64_t size = 6;
+ +
100 // populating the array
+
101 arr.push_back(22);
+
102 arr.push_back(46);
+
103 arr.push_back(94);
+
104 arr.push_back(12);
+
105 arr.push_back(37);
+
106 arr.push_back(63);
+
107 // array populating ends
+
108
+ +
110 assert(std::is_sorted(std::begin(arr), std::end(arr)));
+
111 std::cout << " 1st test passed!\n";
+
112 // printing the array
+
113 for (uint64_t i = 0; i < size; i++) {
+
114 std::cout << arr[i] << ", ";
+
115 }
+ +
117
+
118 // 2nd example. Creating an array of type `double`.
+
119 std::cout << "2nd test using doubles\n";
+
120 std::vector<double> double_arr;
+
121
+
122 // populating the array
+
123 double_arr.push_back(20.4);
+
124 double_arr.push_back(62.7);
+
125 double_arr.push_back(12.2);
+
126 double_arr.push_back(43.6);
+
127 double_arr.push_back(74.1);
+
128 double_arr.push_back(57.9);
+
129 // array populating ends
+
130
+
131 sorting::recursive_bubble_sort(&double_arr, size);
+
132 assert(std::is_sorted(std::begin(double_arr), std::end(double_arr)));
+
133 std::cout << " 2nd test passed!\n";
+
134 // printing the array
+
135 for (uint64_t i = 0; i < size; i++) {
+
136 std::cout << double_arr[i] << ", ";
+
137 }
+ +
139
+
140}
T begin(T... args)
T end(T... args)
@@ -257,7 +256,7 @@ Here is the call graph for this function:
T is_sorted(T... args)
void recursive_bubble_sort(std::vector< T > *nums, uint64_t n)
This is an implementation of the recursive_bubble_sort. A vector is passed to the function which is t...
Definition: recursive_bubble_sort.cpp:74
T push_back(T... args)
- +
@@ -267,7 +266,7 @@ Here is the call graph for this function: diff --git a/d3/df9/recursive__bubble__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d3/df9/recursive__bubble__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index ba0a8da4e..78537a5ed 100644 --- a/d3/df9/recursive__bubble__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d3/df9/recursive__bubble__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: strings/horspool.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('d3/dfe/horspool_8cpp.html','../../'); -
-
horspool.cpp File Reference
+
horspool.cpp File Reference
@@ -110,19 +109,19 @@ Include dependency graph for horspool.cpp:
- - + - - + +

+

Namespaces

 strings
namespace  strings
 Algorithms with strings.
 
 horspool
 Functions for Horspool's algorithm.
namespace  horspool
 Functions for Horspool's algorithm.
 
- - - + + @@ -133,17 +132,17 @@ Functions

+

Functions

std::unordered_map< char, int > strings::horspool::findShiftTable (const std::string &prototype)
 
std::unordered_map< char, int > strings::horspool::findShiftTable (const std::string &prototype)
 
bool strings::horspool::horspool (const std::string &text, const std::string &prototype)
 
static void test ()
 

Detailed Description

-

Horspool's algorithm that finds if a string contains a substring (https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm)

-
Author
Harry Kontakis
+

Horspool's algorithm that finds if a string contains a substring (https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm)

+
Author
Harry Kontakis

Function Documentation

- -

◆ findShiftTable()

+ +

◆ findShiftTable()

- + @@ -151,38 +150,38 @@ Functions
std::unordered_map<char, int> strings::horspool::findShiftTable std::unordered_map< char, int > strings::horspool::findShiftTable ( const std::string prototype)
-

A function that finds the shift table of the given prototype string that we need in Horpool's algorithm.

Parameters
+

A function that finds the shift table of the given prototype string that we need in Horpool's algorithm.

Parameters
prototypeis the substring that we use to find shift table
Returns
Shift Table of Horspool's algorithm
-
26  {
- -
28  shiftTable; // A HashMap for shift table that has characters for keys and integers for values
-
29 
-
30  for (int i = 0; i < prototype.size();
-
31  i++) { // Checking all characters of prototype string
-
32  if (shiftTable.find(prototype[i]) ==
-
33  shiftTable.end()) { // If character does not exist in HashMap
-
34  if (i != prototype.size() - 1) {
-
35  shiftTable.insert(std::make_pair(
-
36  prototype[i], prototype.size() - i -
-
37  1)); // Insert the character as key and the size of prototype string - index of character - 1 as value
-
38  } else {
-
39  shiftTable.insert(std::make_pair(
-
40  prototype[i],
-
41  prototype.size())); // Insert the character as key and the size of prototype string as value
-
42  }
-
43  } else {
-
44  if (i != prototype.size() - 1) {
-
45  shiftTable[prototype[i]] = prototype.size() - i - 1;
-
46  }
-
47  }
-
48  }
-
49  return shiftTable;
-
50 }
+
26 {
+ +
28 shiftTable; // A HashMap for shift table that has characters for keys and integers for values
+
29
+
30 for (int i = 0; i < prototype.size();
+
31 i++) { // Checking all characters of prototype string
+
32 if (shiftTable.find(prototype[i]) ==
+
33 shiftTable.end()) { // If character does not exist in HashMap
+
34 if (i != prototype.size() - 1) {
+
35 shiftTable.insert(std::make_pair(
+
36 prototype[i], prototype.size() - i -
+
37 1)); // Insert the character as key and the size of prototype string - index of character - 1 as value
+
38 } else {
+
39 shiftTable.insert(std::make_pair(
+
40 prototype[i],
+
41 prototype.size())); // Insert the character as key and the size of prototype string as value
+
42 }
+
43 } else {
+
44 if (i != prototype.size() - 1) {
+
45 shiftTable[prototype[i]] = prototype.size() - i - 1;
+
46 }
+
47 }
+
48 }
+
49 return shiftTable;
+
50}
T end(T... args)
T find(T... args)
T insert(T... args)
@@ -192,13 +191,13 @@ Functions
Here is the call graph for this function:
-
+
- +

◆ horspool()

@@ -223,7 +222,7 @@ Here is the call graph for this function:
-

A function that implements Horspool's algorithm.

Parameters
+

A function that implements Horspool's algorithm.

Parameters
@@ -233,41 +232,41 @@ Here is the call graph for this function:
Returns
true if text string contains prototype string
false if text string does not contain prototype string
-
59  {
- -
61  prototype); // Initialise shift table calling findShiftTable function
-
62 
-
63  int i = static_cast<int>(
-
64  prototype.size() -
-
65  1); // Index that we shift in text to find the substring
-
66  while (i < text.size()) {
-
67  int j = i, k = 0;
-
68  bool flag = true;
-
69 
-
70  for (int z = static_cast<int>(prototype.size() - 1); z >= 0 && flag;
-
71  z--) { // Checking if all characters of substring are equal with all characters of string
-
72  if (text[j] == prototype[z]) {
-
73  k++;
-
74  j--;
-
75  } else {
-
76  flag = false; // If two characters are not equal set flag to false and break from loop
-
77  }
-
78  }
-
79 
-
80  if (k ==
-
81  prototype.size()) { // If all characters match then return true
-
82  return true;
-
83  } else {
-
84  if (shiftTable.find(text[i]) != shiftTable.end()) {
-
85  i += shiftTable[text[i]]; // If shift table contains the character then shift index as many steps as value
-
86  } else {
-
87  i += prototype.size(); // If character does not exist in shift table then shift index as many steps as size of prototype string
-
88  }
-
89  }
-
90  }
-
91  return false;
-
92 }
-
std::unordered_map< char, int > findShiftTable(const std::string &prototype)
Definition: horspool.cpp:26
+
59 {
+ +
61 prototype); // Initialise shift table calling findShiftTable function
+
62
+
63 int i = static_cast<int>(
+
64 prototype.size() -
+
65 1); // Index that we shift in text to find the substring
+
66 while (i < text.size()) {
+
67 int j = i, k = 0;
+
68 bool flag = true;
+
69
+
70 for (int z = static_cast<int>(prototype.size() - 1); z >= 0 && flag;
+
71 z--) { // Checking if all characters of substring are equal with all characters of string
+
72 if (text[j] == prototype[z]) {
+
73 k++;
+
74 j--;
+
75 } else {
+
76 flag = false; // If two characters are not equal set flag to false and break from loop
+
77 }
+
78 }
+
79
+
80 if (k ==
+
81 prototype.size()) { // If all characters match then return true
+
82 return true;
+
83 } else {
+
84 if (shiftTable.find(text[i]) != shiftTable.end()) {
+
85 i += shiftTable[text[i]]; // If shift table contains the character then shift index as many steps as value
+
86 } else {
+
87 i += prototype.size(); // If character does not exist in shift table then shift index as many steps as size of prototype string
+
88 }
+
89 }
+
90 }
+
91 return false;
+
92}
+
std::unordered_map< char, int > findShiftTable(const std::string &prototype)
Definition: horspool.cpp:26
Here is the call graph for this function:
@@ -277,7 +276,7 @@ Here is the call graph for this function:
- +

◆ main()

@@ -295,10 +294,10 @@ Here is the call graph for this function:

Main Function that calls test function.

Returns
0 on exit
-
119  {
-
120  test();
-
121  return 0;
-
122 }
+
119 {
+
120 test();
+
121 return 0;
+
122}
static void test()
Function with test cases for Horspool's algorithm.
Definition: horspool.cpp:100
Here is the call graph for this function:
@@ -309,7 +308,7 @@ Here is the call graph for this function:
- +

◆ test()

@@ -334,20 +333,20 @@ Here is the call graph for this function:

Function with test cases for Horspool's algorithm.

Returns
void
-
100  {
-
101  assert(strings::horspool::horspool("Hello World","World") == true);
-
102  assert(strings::horspool::horspool("Hello World"," World") == true);
-
103  assert(strings::horspool::horspool("Hello World","ello") == true);
-
104  assert(strings::horspool::horspool("Hello World","rld") == true);
-
105  assert(strings::horspool::horspool("Hello","Helo") == false);
-
106  assert(strings::horspool::horspool("c++_algorithms","c++_algorithms") == true);
-
107  assert(strings::horspool::horspool("c++_algorithms","c++_") == true);
-
108  assert(strings::horspool::horspool("Hello","Hello World") == false);
-
109  assert(strings::horspool::horspool("c++_algorithms","") == false);
-
110  assert(strings::horspool::horspool("c++","c") == true);
-
111  assert(strings::horspool::horspool("3458934793","4793") == true);
-
112  assert(strings::horspool::horspool("3458934793","123") == false);
-
113 }
+
100 {
+
101 assert(strings::horspool::horspool("Hello World","World") == true);
+
102 assert(strings::horspool::horspool("Hello World"," World") == true);
+
103 assert(strings::horspool::horspool("Hello World","ello") == true);
+
104 assert(strings::horspool::horspool("Hello World","rld") == true);
+
105 assert(strings::horspool::horspool("Hello","Helo") == false);
+
106 assert(strings::horspool::horspool("c++_algorithms","c++_algorithms") == true);
+
107 assert(strings::horspool::horspool("c++_algorithms","c++_") == true);
+
108 assert(strings::horspool::horspool("Hello","Hello World") == false);
+
109 assert(strings::horspool::horspool("c++_algorithms","") == false);
+
110 assert(strings::horspool::horspool("c++","c") == true);
+
111 assert(strings::horspool::horspool("3458934793","4793") == true);
+
112 assert(strings::horspool::horspool("3458934793","123") == false);
+
113}
@@ -357,7 +356,7 @@ Here is the call graph for this function: diff --git a/d3/dfe/horspool_8cpp.js b/d3/dfe/horspool_8cpp.js index 59049e957..0d1b8aef8 100644 --- a/d3/dfe/horspool_8cpp.js +++ b/d3/dfe/horspool_8cpp.js @@ -1,6 +1,6 @@ var horspool_8cpp = [ - [ "findShiftTable", "d3/dfe/horspool_8cpp.html#ad352e3be28a6d9f2d1b2f32ce9c729b9", null ], + [ "findShiftTable", "d3/dfe/horspool_8cpp.html#a1a9c3aa55ccc79d0f47d50c580997336", null ], [ "horspool", "d3/dfe/horspool_8cpp.html#a9884bca75ce39c116697ea2574adb37d", null ], [ "main", "d3/dfe/horspool_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "test", "d3/dfe/horspool_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] diff --git a/d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.map b/d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.map similarity index 89% rename from d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.map rename to d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.map index 010de79be..0780908a3 100644 --- a/d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.map +++ b/d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.map @@ -4,6 +4,6 @@ - - + + diff --git a/d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.md5 b/d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.md5 new file mode 100644 index 000000000..704db2217 --- /dev/null +++ b/d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.md5 @@ -0,0 +1 @@ +503f022c4f648f4b2989ead4c50b2222 \ No newline at end of file diff --git a/d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.svg b/d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.svg new file mode 100644 index 000000000..7b79ba63a --- /dev/null +++ b/d3/dfe/horspool_8cpp_a1a9c3aa55ccc79d0f47d50c580997336_cgraph.svg @@ -0,0 +1,122 @@ + + + + + + +strings::horspool::findShiftTable + + + +Node1 + + +strings::horspool:: +findShiftTable + + + + + +Node1->Node1 + + + + + +Node2 + + +std::unordered_map::end + + + + + +Node1->Node2 + + + + + +Node3 + + +std::unordered_map +::find + + + + + +Node1->Node3 + + + + + +Node4 + + +std::unordered_map +::insert + + + + + +Node1->Node4 + + + + + +Node5 + + +std::make_pair + + + + + +Node1->Node5 + + + + + +Node6 + + +std::string::size + + + + + +Node1->Node6 + + + + + +Node7 + + +std::unordered_map +::size + + + + + +Node1->Node7 + + + + + diff --git a/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.map b/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.map index ca2646734..0add4d278 100644 --- a/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.map +++ b/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.map @@ -2,9 +2,9 @@ - - + + - + diff --git a/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.md5 b/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.md5 index 51357ce65..377f9d7ca 100644 --- a/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.md5 +++ b/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.md5 @@ -1 +1 @@ -30c82e4aaab042f9cffa5fd8169e2d96 \ No newline at end of file +ceb0225be01789b57da85f9932dd33f6 \ No newline at end of file diff --git a/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.svg b/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.svg index bfcdbfc72..1d521085a 100644 --- a/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.svg +++ b/d3/dfe/horspool_8cpp_a9884bca75ce39c116697ea2574adb37d_cgraph.svg @@ -1,7 +1,7 @@ - Node4 - + strings::horspool:: findShiftTable @@ -66,18 +66,18 @@ - - -Node8 - + + +Node7 + std::string::size - + -Node1->Node8 +Node1->Node7 @@ -130,27 +130,27 @@ - - -Node7 - + + +Node4->Node7 + + + + + +Node8 + std::unordered_map ::size - - -Node4->Node7 - - - Node4->Node8 - - + + diff --git a/d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.md5 b/d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.md5 deleted file mode 100644 index c36b4f4fd..000000000 --- a/d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -f810862bbaf8da6721278b2b5a8cd236 \ No newline at end of file diff --git a/d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.svg b/d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.svg deleted file mode 100644 index 61fe0708c..000000000 --- a/d3/dfe/horspool_8cpp_ad352e3be28a6d9f2d1b2f32ce9c729b9_cgraph.svg +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - -strings::horspool::findShiftTable - - - -Node1 - - -strings::horspool:: -findShiftTable - - - - - -Node1->Node1 - - - - - -Node2 - - -std::unordered_map::end - - - - - -Node1->Node2 - - - - - -Node3 - - -std::unordered_map -::find - - - - - -Node1->Node3 - - - - - -Node4 - - -std::unordered_map -::insert - - - - - -Node1->Node4 - - - - - -Node5 - - -std::make_pair - - - - - -Node1->Node5 - - - - - -Node6 - - -std::unordered_map -::size - - - - - -Node1->Node6 - - - - - -Node7 - - -std::string::size - - - - - -Node1->Node7 - - - - - diff --git a/d3/dfe/horspool_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d3/dfe/horspool_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index cefbb7835..b395db626 100644 --- a/d3/dfe/horspool_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d3/dfe/horspool_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - - + +Algorithms_in_C++: gram_schmidt Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
textis the string that we are searching if there is a substring
prototypeis the substring that we are searching in text
-
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d4/d0f/namespacegram__schmidt.html','.
-
-
gram_schmidt Namespace Reference
+
gram_schmidt Namespace Reference
diff --git a/d4/d12/namespace_minimum.html b/d4/d12/namespace_minimum.html index 48992528b..f80bcb1d5 100644 --- a/d4/d12/namespace_minimum.html +++ b/d4/d12/namespace_minimum.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Minimum Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,23 +90,22 @@ $(document).ready(function(){initNavTree('d4/d12/namespace_minimum.html','../../
-
-
Minimum Namespace Reference
+
Minimum Namespace Reference
-

Implementation of Minimum Edit Distance algorithm. +

Implementation of Minimum Edit Distance algorithm. More...

Detailed Description

-

Implementation of Minimum Edit Distance algorithm.

-

Edit Distance

+

Implementation of Minimum Edit Distance algorithm.

+

Edit Distance

diff --git a/d4/d13/namespacebidirectional__dijkstra.html b/d4/d13/namespacebidirectional__dijkstra.html index 778028351..837f1a23f 100644 --- a/d4/d13/namespacebidirectional__dijkstra.html +++ b/d4/d13/namespacebidirectional__dijkstra.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: bidirectional_dijkstra Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d4/d13/namespacebidirectional__dijkstr
-
-
bidirectional_dijkstra Namespace Reference
+
bidirectional_dijkstra Namespace Reference
-

Functions for Bidirectional Dijkstra Shortest Path algorithm. +

Functions for Bidirectional Dijkstra Shortest Path algorithm. More...

Detailed Description

-

Functions for Bidirectional Dijkstra Shortest Path algorithm.

+

Functions for Bidirectional Dijkstra Shortest Path algorithm.

diff --git a/d4/d1c/namespacehamming__distance.html b/d4/d1c/namespacehamming__distance.html index ce4195f1c..4d4b2f158 100644 --- a/d4/d1c/namespacehamming__distance.html +++ b/d4/d1c/namespacehamming__distance.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: hamming_distance Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d4/d1c/namespacehamming__distance.html
-
-
hamming_distance Namespace Reference
+
hamming_distance Namespace Reference
-

Functions for Hamming distance implementation. +

Functions for Hamming distance implementation. More...

Detailed Description

-

Functions for Hamming distance implementation.

+

Functions for Hamming distance implementation.

diff --git a/d4/d1e/class_r_btree-members.html b/d4/d1e/class_r_btree-members.html index b2e836a75..06df41dcb 100644 --- a/d4/d1e/class_r_btree-members.html +++ b/d4/d1e/class_r_btree-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,32 +90,31 @@ $(document).ready(function(){initNavTree('d8/d72/class_r_btree.html','../../');
-
-
RBtree Member List
+
RBtree Member List

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

- + - + - + - + - + - +
del() (defined in RBtree)RBtree
delfix(node *) (defined in RBtree)RBtree
delfix(node *) (defined in RBtree)RBtree
disp() (defined in RBtree)RBtree
display(node *) (defined in RBtree)RBtree
display(node *) (defined in RBtree)RBtree
insert() (defined in RBtree)RBtree
insertfix(node *) (defined in RBtree)RBtree
insertfix(node *) (defined in RBtree)RBtree
leftrotate(node *) (defined in RBtree)RBtree
q (defined in RBtree)RBtreeprivate
q (defined in RBtree)RBtreeprivate
RBtree() (defined in RBtree)RBtreeinline
rightrotate(node *) (defined in RBtree)RBtree
rightrotate(node *) (defined in RBtree)RBtree
root (defined in RBtree)RBtreeprivate
search() (defined in RBtree)RBtree
search() (defined in RBtree)RBtree
successor(node *) (defined in RBtree)RBtree
diff --git a/d4/d1f/class_min_heap-members.html b/d4/d1f/class_min_heap-members.html index c45481fdb..c86006d48 100644 --- a/d4/d1f/class_min_heap-members.html +++ b/d4/d1f/class_min_heap-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -90,33 +90,32 @@ $(document).ready(function(){initNavTree('d2/d05/class_min_heap.html','../../');
-
-
MinHeap Member List
+
MinHeap Member List

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

- + - + - + - + - + - + - +
capacityMinHeapprivate
decreaseKey(int i, int new_val)MinHeap
decreaseKey(int i, int new_val)MinHeap
deleteKey(int i)MinHeap
extractMin()MinHeap
extractMin()MinHeap
getMin()MinHeapinline
harrMinHeapprivate
harrMinHeapprivate
heap_sizeMinHeapprivate
insertKey(int k)MinHeap
insertKey(int k)MinHeap
left(int i)MinHeapinline
MinHeap(int cap)MinHeapinlineexplicit
MinHeap(int cap)MinHeapinlineexplicit
MinHeapify(int)MinHeap
parent(int i) (defined in MinHeap)MinHeapinline
parent(int i) (defined in MinHeap)MinHeapinline
right(int i)MinHeapinline
~MinHeap() (defined in MinHeap)MinHeapinline
~MinHeap() (defined in MinHeap)MinHeapinline
diff --git a/d4/d1f/merge__insertion__sort_8cpp__incl.svg b/d4/d1f/merge__insertion__sort_8cpp__incl.svg index 98c78eda2..6ee13c141 100644 --- a/d4/d1f/merge__insertion__sort_8cpp__incl.svg +++ b/d4/d1f/merge__insertion__sort_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: math/least_common_multiple.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d4/d21/least__common__multiple_8cpp.ht
-
-
least_common_multiple.cpp File Reference
+
least_common_multiple.cpp File Reference
#include <cassert>
@@ -105,7 +104,7 @@ Include dependency graph for least_common_multiple.cpp:
- @@ -117,10 +116,10 @@ Functions

+

Functions

unsigned int gcd (unsigned int x, unsigned int y)
 
 

Detailed Description

-

Copyright 2020

Author
tjgurwara99
+

Copyright 2020

Author
tjgurwara99

A basic implementation of LCM function

Function Documentation

- +

◆ gcd()

@@ -145,33 +144,39 @@ Functions
-

Function for finding greatest common divisor of two numbers. @params two integers x and y whose gcd we want to find.

Returns
greatest common divisor of x and y.
-
16  {
-
17  if (x == 0) {
-
18  return y;
-
19  }
-
20  if (y == 0) {
-
21  return x;
-
22  }
-
23  if (x == y) {
-
24  return x;
-
25  }
-
26  if (x > y) {
-
27  // The following is valid because we have checked whether y == 0
-
28 
-
29  unsigned int temp = x / y;
-
30  return gcd(y, x - temp * y);
-
31  }
-
32  // Again the following is valid because we have checked whether x == 0
-
33 
-
34  unsigned int temp = y / x;
-
35  return gcd(x, y - temp * x);
-
36 }
+

Function for finding greatest common divisor of two numbers. @params two integers x and y whose gcd we want to find.

Returns
greatest common divisor of x and y.
+
16 {
+
17 if (x == 0) {
+
18 return y;
+
19 }
+
20 if (y == 0) {
+
21 return x;
+
22 }
+
23 if (x == y) {
+
24 return x;
+
25 }
+
26 if (x > y) {
+
27 // The following is valid because we have checked whether y == 0
+
28
+
29 unsigned int temp = x / y;
+
30 return gcd(y, x - temp * y);
+
31 }
+
32 // Again the following is valid because we have checked whether x == 0
+
33
+
34 unsigned int temp = y / x;
+
35 return gcd(x, y - temp * x);
+
36}
unsigned int gcd(unsigned int x, unsigned int y)
Definition: least_common_multiple.cpp:16
-
+
+Here is the call graph for this function:
+
+
- + +
+
+

◆ lcm()

@@ -196,20 +201,20 @@ Functions
-

Function for finding the least common multiple of two numbers. @params integer x and y whose lcm we want to find.

Returns
lcm of x and y using the relation x * y = gcd(x, y) * lcm(x, y)
-
43  {
-
44  return x / gcd(x, y) * y;
-
45 }
+

Function for finding the least common multiple of two numbers. @params integer x and y whose lcm we want to find.

Returns
lcm of x and y using the relation x * y = gcd(x, y) * lcm(x, y)
+
43 {
+
44 return x / gcd(x, y) * y;
+
45}
Here is the call graph for this function:
-
+
- +

◆ main()

@@ -224,11 +229,11 @@ Here is the call graph for this function:
-

Main function

-
78  {
-
79  tests();
-
80  return 0;
-
81 }
+

Main function

+
78 {
+
79 tests();
+
80 return 0;
+
81}
void tests()
Definition: least_common_multiple.cpp:50
Here is the call graph for this function:
@@ -239,7 +244,7 @@ Here is the call graph for this function:
- +

◆ tests()

@@ -253,31 +258,31 @@ Here is the call graph for this function:
-

Function for testing the lcm() functions with some assert statements.

-
50  {
-
51  // First test on lcm(5,10) == 10
-
52  assert(((void)"LCM of 5 and 10 is 10 but lcm function gives a different "
-
53  "result.\n",
-
54  lcm(5, 10) == 10));
-
55  std::cout << "First assertion passes: LCM of 5 and 10 is " << lcm(5, 10)
-
56  << std::endl;
-
57 
-
58  // Second test on lcm(2,3) == 6 as 2 and 3 are coprime (prime in fact)
-
59  assert(((void)"LCM of 2 and 3 is 6 but lcm function gives a different "
-
60  "result.\n",
-
61  lcm(2, 3) == 6));
-
62  std::cout << "Second assertion passes: LCM of 2 and 3 is " << lcm(2, 3)
-
63  << std::endl;
-
64 
-
65  // Testing an integer overflow.
-
66  // The algorithm should work as long as the result fits into integer.
-
67  assert(((void)"LCM of 987654321 and 987654321 is 987654321 but lcm function"
-
68  " gives a different result.\n",
-
69  lcm(987654321, 987654321) == 987654321));
-
70  std::cout << "Third assertion passes: LCM of 987654321 and 987654321 is "
-
71  << lcm(987654321, 987654321)
-
72  << std::endl;
-
73 }
+

Function for testing the lcm() functions with some assert statements.

+
50 {
+
51 // First test on lcm(5,10) == 10
+
52 assert(((void)"LCM of 5 and 10 is 10 but lcm function gives a different "
+
53 "result.\n",
+
54 lcm(5, 10) == 10));
+
55 std::cout << "First assertion passes: LCM of 5 and 10 is " << lcm(5, 10)
+
56 << std::endl;
+
57
+
58 // Second test on lcm(2,3) == 6 as 2 and 3 are coprime (prime in fact)
+
59 assert(((void)"LCM of 2 and 3 is 6 but lcm function gives a different "
+
60 "result.\n",
+
61 lcm(2, 3) == 6));
+
62 std::cout << "Second assertion passes: LCM of 2 and 3 is " << lcm(2, 3)
+
63 << std::endl;
+
64
+
65 // Testing an integer overflow.
+
66 // The algorithm should work as long as the result fits into integer.
+
67 assert(((void)"LCM of 987654321 and 987654321 is 987654321 but lcm function"
+
68 " gives a different result.\n",
+
69 lcm(987654321, 987654321) == 987654321));
+
70 std::cout << "Third assertion passes: LCM of 987654321 and 987654321 is "
+
71 << lcm(987654321, 987654321)
+
72 << std::endl;
+
73}
T endl(T... args)
unsigned int lcm(unsigned int x, unsigned int y)
Definition: least_common_multiple.cpp:43
@@ -296,7 +301,7 @@ Here is the call graph for this function:
diff --git a/d4/d21/least__common__multiple_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 b/d4/d21/least__common__multiple_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 index 8888d95b1..e81fa293e 100644 --- a/d4/d21/least__common__multiple_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 +++ b/d4/d21/least__common__multiple_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 @@ -1 +1 @@ -a61ed673e3da231de39e9d2d50c3bf9f \ No newline at end of file +69c722ea4a33192fef0ae885227de1f1 \ No newline at end of file diff --git a/d4/d21/least__common__multiple_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg b/d4/d21/least__common__multiple_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg index 32eef624a..9ec2cf887 100644 --- a/d4/d21/least__common__multiple_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg +++ b/d4/d21/least__common__multiple_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg @@ -1,7 +1,7 @@ - + + +Node4->Node4 + + + diff --git a/d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.map b/d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.map new file mode 100644 index 000000000..9d5066e1b --- /dev/null +++ b/d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.md5 b/d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.md5 new file mode 100644 index 000000000..6cdeba598 --- /dev/null +++ b/d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.md5 @@ -0,0 +1 @@ +63194f545c045f973d0472cef162735b \ No newline at end of file diff --git a/d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.svg b/d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.svg new file mode 100644 index 000000000..9e8e853e8 --- /dev/null +++ b/d4/d21/least__common__multiple_8cpp_a8ba1fc66e4134ab25b2602b323150563_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +gcd + + + +Node1 + + +gcd + + + + + +Node1->Node1 + + + + + diff --git a/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.map b/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.map index 1e5f8e058..6840db1a2 100644 --- a/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.map +++ b/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.md5 b/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.md5 index 7f0270c34..1683a5932 100644 --- a/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.md5 +++ b/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.md5 @@ -1 +1 @@ -31d2c67966697e5578929cea1691d489 \ No newline at end of file +1f3bc8ef863ff2657a19486d796ba7ce \ No newline at end of file diff --git a/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.svg b/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.svg index 470f22dee..e78cc60b9 100644 --- a/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.svg +++ b/d4/d21/least__common__multiple_8cpp_aa8d0e241db517813725e721a152e3a25_cgraph.svg @@ -1,14 +1,14 @@ - - - + + lcm - + Node1 @@ -33,5 +33,11 @@ + + +Node2->Node2 + + + diff --git a/d4/d21/least__common__multiple_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d4/d21/least__common__multiple_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 2286c72d6..e29738b10 100644 --- a/d4/d21/least__common__multiple_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d4/d21/least__common__multiple_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -9ec980d7843ac0a86185d3408f5fe43b \ No newline at end of file +bd2e4573af9ef7e8aea0f15493c1bad6 \ No newline at end of file diff --git a/d4/d21/least__common__multiple_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d4/d21/least__common__multiple_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 5fdfdbee2..97c620b58 100644 --- a/d4/d21/least__common__multiple_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d4/d21/least__common__multiple_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - + + +Node5->Node5 + + + diff --git a/d4/d25/ncr__modulo__p_8cpp__incl.svg b/d4/d25/ncr__modulo__p_8cpp__incl.svg index 0034c763b..41561fa74 100644 --- a/d4/d25/ncr__modulo__p_8cpp__incl.svg +++ b/d4/d25/ncr__modulo__p_8cpp__incl.svg @@ -1,7 +1,7 @@ - - diff --git a/d4/d26/durand__kerner__roots_8cpp__incl_org.svg b/d4/d26/durand__kerner__roots_8cpp__incl_org.svg index c2b693673..20ea8a038 100644 --- a/d4/d26/durand__kerner__roots_8cpp__incl_org.svg +++ b/d4/d26/durand__kerner__roots_8cpp__incl_org.svg @@ -1,7 +1,7 @@ - - - - - diff --git a/d4/d2c/struct_trie_1_1_trie_node__coll__graph.md5 b/d4/d2c/struct_trie_1_1_trie_node__coll__graph.md5 deleted file mode 100644 index f2a00cfba..000000000 --- a/d4/d2c/struct_trie_1_1_trie_node__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -9dda26383752407f35291cf519219b01 \ No newline at end of file diff --git a/d4/d2c/struct_trie_1_1_trie_node__coll__graph.svg b/d4/d2c/struct_trie_1_1_trie_node__coll__graph.svg deleted file mode 100644 index bcd236c6f..000000000 --- a/d4/d2c/struct_trie_1_1_trie_node__coll__graph.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -Trie::TrieNode - - - -Node1 - - -Trie::TrieNode - - - - - -Node2 - - -std::shared_ptr< Trie -::TrieNode > - - - - - -Node2->Node1 - - - character - - - diff --git a/d4/d31/range__queries_2sparse__table_8cpp__incl.svg b/d4/d31/range__queries_2sparse__table_8cpp__incl.svg index 6410e7756..62e5b3bba 100644 --- a/d4/d31/range__queries_2sparse__table_8cpp__incl.svg +++ b/d4/d31/range__queries_2sparse__table_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: math/fibonacci_fast.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('d4/d32/fibonacci__fast_8cpp.html','../ -
-
fibonacci_fast.cpp File Reference
+
fibonacci_fast.cpp File Reference
@@ -110,12 +109,12 @@ Include dependency graph for fibonacci_fast.cpp:
-

+

Macros

#define MAX   93
 
- @@ -123,12 +122,12 @@ Functions

+

Functions

uint64_t fib (uint64_t n)
 
 

Detailed Description

-

Faster computation of Fibonacci series.

-

An efficient way to calculate nth fibonacci number faster and simpler than \(O(n\log n)\) method of matrix exponentiation This works by using both recursion and dynamic programming. as 93rd fibonacci exceeds 19 digits, which cannot be stored in a single long long variable, we can only use it till 92nd fibonacci we can use it for 10000th fibonacci etc, if we implement bigintegers. This algorithm works with the fact that nth fibonacci can easily found if we have already found n/2th or (n+1)/2th fibonacci It is a property of fibonacci similar to matrix exponentiation.

-
Author
Krishna Vedala
+

Faster computation of Fibonacci series.

+

An efficient way to calculate nth fibonacci number faster and simpler than \(O(n\log n)\) method of matrix exponentiation This works by using both recursion and dynamic programming. as 93rd fibonacci exceeds 19 digits, which cannot be stored in a single long long variable, we can only use it till 92nd fibonacci we can use it for 10000th fibonacci etc, if we implement bigintegers. This algorithm works with the fact that nth fibonacci can easily found if we have already found n/2th or (n+1)/2th fibonacci It is a property of fibonacci similar to matrix exponentiation.

+
Author
Krishna Vedala
See also
fibonacci_large.cpp, fibonacci.cpp, string_fibonacci.cpp

Macro Definition Documentation

- +

◆ MAX

@@ -139,12 +138,12 @@ Functions
-

maximum number that can be computed - The result after 93 cannot be stored in a uint64_t data type.

+

maximum number that can be computed - The result after 93 cannot be stored in a uint64_t data type.

Function Documentation

- +

◆ fib()

@@ -159,31 +158,31 @@ Functions
-

Algorithm

-
30  {
-
31  static uint64_t f1 = 1,
-
32  f2 = 1; // using static keyword will retain the values of
-
33  // f1 and f2 for the next function call.
-
34 
-
35  if (n <= 2)
-
36  return f2;
-
37  if (n >= 93) {
-
38  std::cerr
-
39  << "Cannot compute for n>93 due to limit of 64-bit integers\n";
-
40  return 0;
-
41  }
-
42 
-
43  uint64_t temp = f2; // we do not need temp to be static
-
44  f2 += f1;
-
45  f1 = temp;
-
46 
-
47  return f2;
-
48 }
+

Algorithm

+
30 {
+
31 static uint64_t f1 = 1,
+
32 f2 = 1; // using static keyword will retain the values of
+
33 // f1 and f2 for the next function call.
+
34
+
35 if (n <= 2)
+
36 return f2;
+
37 if (n >= 93) {
+ +
39 << "Cannot compute for n>93 due to limit of 64-bit integers\n";
+
40 return 0;
+
41 }
+
42
+
43 uint64_t temp = f2; // we do not need temp to be static
+
44 f2 += f1;
+
45 f1 = temp;
+
46
+
47 return f2;
+
48}
- +

◆ main()

@@ -198,14 +197,14 @@ Functions
-

Main function

-
51  {
-
52  // Main Function
-
53  for (uint64_t i = 1; i < 93; i++) {
-
54  std::cout << i << " th fibonacci number is " << fib(i) << std::endl;
-
55  }
-
56  return 0;
-
57 }
+

Main function

+
51 {
+
52 // Main Function
+
53 for (uint64_t i = 1; i < 93; i++) {
+
54 std::cout << i << " th fibonacci number is " << fib(i) << std::endl;
+
55 }
+
56 return 0;
+
57}
T endl(T... args)
uint64_t fib(uint64_t n)
Definition: fibonacci_fast.cpp:30
@@ -223,7 +222,7 @@ Here is the call graph for this function:
diff --git a/d4/d32/fibonacci__fast_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d4/d32/fibonacci__fast_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 3c5ef6fc4..e1370e3b9 100644 --- a/d4/d32/fibonacci__fast_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d4/d32/fibonacci__fast_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: operations_on_datastructures/inorder_successor_of_bst.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
Algorithms_in_C++ -  1.0.0 +
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
@@ -42,21 +41,22 @@
- + +/* @license-end */ +
@@ -70,7 +70,7 @@ $(function() {
@@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cp Classes | Namespaces | Functions -
-
inorder_successor_of_bst.cpp File Reference
+
inorder_successor_of_bst.cpp File Reference
-

An implementation for finding the Inorder successor of a binary search tree Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inorder traversal. +

An implementation for finding the Inorder successor of a binary search tree Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inorder traversal. More...

#include <cassert>
#include <iostream>
@@ -111,7 +110,7 @@ Include dependency graph for inorder_successor_of_bst.cpp:
- @@ -120,38 +119,38 @@ Classes

+

Classes

class  operations_on_datastructures::inorder_traversal_of_bst::Node
 A Node structure representing a single node in BST. More...
 class encapsulating the necessary test cases More...
 
- - + - - + +

+

Namespaces

 operations_on_datastructures
namespace  operations_on_datastructures
 for std::vector
 
 inorder_successor_of_bst
 Functions for the Inorder successor of a binary search tree implementation.
namespace  inorder_successor_of_bst
 Functions for the Inorder successor of a binary search tree implementation.
 
- - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + @@ -163,7 +162,7 @@ Functions

+

Functions

Nodeoperations_on_datastructures::inorder_traversal_of_bst::makeNode (int64_t data)
 Allocates a new node in heap for given data and returns it's pointer. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::Insert (Node *root, int64_t data)
 Inserts the given data in BST while maintaining the properties of BST. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::getNode (Node *root, int64_t data)
 Searches the given data in BST and returns the pointer to the node containing that data. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::findMinNode (Node *root)
 Finds and return the minimum node in BST. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::makeNode (int64_t data)
 Allocates a new node in heap for given data and returns it's pointer. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::Insert (Node *root, int64_t data)
 Inserts the given data in BST while maintaining the properties of BST. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::getNode (Node *root, int64_t data)
 Searches the given data in BST and returns the pointer to the node containing that data. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::findMinNode (Node *root)
 Finds and return the minimum node in BST. More...
 
void operations_on_datastructures::inorder_traversal_of_bst::printInorder (Node *root)
 Prints the BST in inorder traversal using recursion. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::makeBST (Node *root, const std::vector< int64_t > &data)
 This function is used in test cases to quickly create BST containing large data instead of hard coding it in code. For a given root, this will add all the nodes containing data passes in data vector. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor (Node *root, int64_t data)
 Inorder successor of a node is the next node in inorder traversal of the Binary Tree. This function takes the root node and the data of the node for which we have to find the inorder successor, and returns the inorder successor node. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::makeBST (Node *root, const std::vector< int64_t > &data)
 This function is used in test cases to quickly create BST containing large data instead of hard coding it in code. For a given root, this will add all the nodes containing data passes in data vector. More...
 
Nodeoperations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor (Node *root, int64_t data)
 Inorder successor of a node is the next node in inorder traversal of the Binary Tree. This function takes the root node and the data of the node for which we have to find the inorder successor, and returns the inorder successor node. More...
 
void operations_on_datastructures::inorder_traversal_of_bst::deallocate (Node *rootNode)
 This function clears the memory allocated to entire tree recursively. Its just for clean up the memory and not relevant to the actual topic. More...
 
 

Detailed Description

-

An implementation for finding the Inorder successor of a binary search tree Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inorder traversal.

+

An implementation for finding the Inorder successor of a binary search tree Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inorder traversal.

Case 1: The given node has the right node/subtree

 * In this case, the left-most deepest node in the right subtree will
@@ -184,9 +183,9 @@ Method 2: Search from the root node
 
  • In case if there is no link from a child node to the parent node, we need to walk down the tree starting from the root node to the given node, by doing so, we are visiting every ancestor of the given node.
  • In order successor would be the deepest node in this path for which given node is in left subtree.
  • -
    Author
    Nitin Sharma
    +
    Author
    Nitin Sharma

    Function Documentation

    - +

    ◆ deallocate()

    @@ -210,14 +209,14 @@ Method 2: Search from the root node
    Returns
    void
    -
    210  {
    -
    211  if (rootNode == nullptr) {
    -
    212  return;
    -
    213  }
    -
    214  deallocate(rootNode->left);
    -
    215  deallocate(rootNode->right);
    -
    216  delete (rootNode);
    -
    217 }
    +
    210 {
    +
    211 if (rootNode == nullptr) {
    +
    212 return;
    +
    213 }
    +
    214 deallocate(rootNode->left);
    +
    215 deallocate(rootNode->right);
    +
    216 delete (rootNode);
    +
    217}
    void deallocate(Node *rootNode)
    This function clears the memory allocated to entire tree recursively. Its just for clean up the memor...
    Definition: inorder_successor_of_bst.cpp:210
    Here is the call graph for this function:
    @@ -228,14 +227,14 @@ Here is the call graph for this function:
    - -

    ◆ findMinNode()

    + +

    ◆ findMinNode()

    - + @@ -252,32 +251,32 @@ Here is the call graph for this function:
    Returns
    Node* Pointer to the found node
    -
    121  {
    -
    122  if (root == nullptr) {
    -
    123  return root;
    -
    124  }
    -
    125  while (root->left != nullptr) {
    -
    126  root = root->left;
    -
    127  }
    -
    128  return root;
    -
    129 }
    +
    121 {
    +
    122 if (root == nullptr) {
    +
    123 return root;
    +
    124 }
    +
    125 while (root->left != nullptr) {
    +
    126 root = root->left;
    +
    127 }
    +
    128 return root;
    +
    129}
    Here is the call graph for this function:
    -
    +
    - -

    ◆ getInorderSuccessor()

    + +

    ◆ getInorderSuccessor()

    Node* operations_on_datastructures::inorder_traversal_of_bst::findMinNode Node * operations_on_datastructures::inorder_traversal_of_bst::findMinNode ( Node root)
    - + @@ -297,7 +296,7 @@ Here is the call graph for this function:

    Inorder successor of a node is the next node in inorder traversal of the Binary Tree. This function takes the root node and the data of the node for which we have to find the inorder successor, and returns the inorder successor node.

    -

    Search from the root node as we need to walk the tree starting from the root node to the given node, by doing so, we are visiting every ancestor of the given node. In order successor would be the deepest node in this path for which given node is in left subtree. Time complexity O(h)

    Parameters
    +

    Search from the root node as we need to walk the tree starting from the root node to the given node, by doing so, we are visiting every ancestor of the given node. In order successor would be the deepest node in this path for which given node is in left subtree. Time complexity O(h)

    Parameters
    Node* operations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor Node * operations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor ( Node root,
    @@ -305,54 +304,54 @@ Here is the call graph for this function:
    Returns
    Node pointer to the inorder successor node.
    -
    176  {
    -
    177  Node *current = getNode(root, data);
    -
    178  if (current == nullptr) {
    -
    179  return nullptr;
    -
    180  }
    -
    181 
    -
    182  // Case - 1
    -
    183  if (current->right != nullptr) {
    -
    184  return findMinNode(current->right);
    -
    185  }
    -
    186  // case - 2
    -
    187  else {
    -
    188  Node *successor = nullptr;
    -
    189  Node *ancestor = root;
    -
    190 
    -
    191  while (ancestor != current && ancestor != nullptr) {
    -
    192  // This means my current node is in left of the root node
    -
    193  if (current->data < ancestor->data) {
    -
    194  successor = ancestor;
    -
    195  ancestor = ancestor->left; // keep going left
    -
    196  } else {
    -
    197  ancestor = ancestor->right;
    -
    198  }
    -
    199  }
    -
    200  return successor; // Nodes with maximum vales will not have a successor
    -
    201  }
    -
    202 }
    +
    176 {
    +
    177 Node *current = getNode(root, data);
    +
    178 if (current == nullptr) {
    +
    179 return nullptr;
    +
    180 }
    +
    181
    +
    182 // Case - 1
    +
    183 if (current->right != nullptr) {
    +
    184 return findMinNode(current->right);
    +
    185 }
    +
    186 // case - 2
    +
    187 else {
    +
    188 Node *successor = nullptr;
    +
    189 Node *ancestor = root;
    +
    190
    +
    191 while (ancestor != current && ancestor != nullptr) {
    +
    192 // This means my current node is in left of the root node
    +
    193 if (current->data < ancestor->data) {
    +
    194 successor = ancestor;
    +
    195 ancestor = ancestor->left; // keep going left
    +
    196 } else {
    +
    197 ancestor = ancestor->right;
    +
    198 }
    +
    199 }
    +
    200 return successor; // Nodes with maximum vales will not have a successor
    +
    201 }
    +
    202}
    int data[MAX]
    test data
    Definition: hash_search.cpp:24
    -
    Node * findMinNode(Node *root)
    Finds and return the minimum node in BST.
    Definition: inorder_successor_of_bst.cpp:121
    -
    Node * getNode(Node *root, int64_t data)
    Searches the given data in BST and returns the pointer to the node containing that data.
    Definition: inorder_successor_of_bst.cpp:100
    +
    Node * findMinNode(Node *root)
    Finds and return the minimum node in BST.
    Definition: inorder_successor_of_bst.cpp:121
    +
    Node * getNode(Node *root, int64_t data)
    Searches the given data in BST and returns the pointer to the node containing that data.
    Definition: inorder_successor_of_bst.cpp:100
    Definition: linkedlist_implentation_usingarray.cpp:14
    Here is the call graph for this function:
    -
    +
    - -

    ◆ getNode()

    + +

    ◆ getNode()

    rootA pointer to the root node of the BST
    dataThe data (or the data of node) for which we have to find inorder successor.
    - + @@ -380,42 +379,41 @@ Here is the call graph for this function:
    Returns
    Node* pointer to the found node
    -

    Node found!

    -

    Traverse right subtree recursively as the given data is greater than the data in root node, data must be present in right subtree.

    -

    Traverse left subtree recursively as the given data is less than the data in root node, data must be present in left subtree.

    -
    100  {
    -
    101  if (root == nullptr) {
    -
    102  return nullptr;
    -
    103  } else if (root->data == data) {
    -
    104  return root; /// Node found!
    -
    105  } else if (data > root->data) {
    -
    106  /// Traverse right subtree recursively as the given data is greater than
    -
    107  /// the data in root node, data must be present in right subtree.
    -
    108  return getNode(root->right, data);
    -
    109  } else {
    -
    110  /// Traverse left subtree recursively as the given data is less than the
    -
    111  /// data in root node, data must be present in left subtree.
    -
    112  return getNode(root->left, data);
    -
    113  }
    -
    114 }
    -
    T data(T... args)
    +

    Node found!

    +

    Traverse right subtree recursively as the given data is greater than the data in root node, data must be present in right subtree.

    +

    Traverse left subtree recursively as the given data is less than the data in root node, data must be present in left subtree.

    +
    100 {
    +
    101 if (root == nullptr) {
    +
    102 return nullptr;
    +
    103 } else if (root->data == data) {
    +
    104 return root; /// Node found!
    +
    105 } else if (data > root->data) {
    +
    106 /// Traverse right subtree recursively as the given data is greater than
    +
    107 /// the data in root node, data must be present in right subtree.
    +
    108 return getNode(root->right, data);
    +
    109 } else {
    +
    110 /// Traverse left subtree recursively as the given data is less than the
    +
    111 /// data in root node, data must be present in left subtree.
    +
    112 return getNode(root->left, data);
    +
    113 }
    +
    114}
    Here is the call graph for this function:
    -
    +
    - -

    ◆ Insert()

    + +

    ◆ Insert()

    Node* operations_on_datastructures::inorder_traversal_of_bst::getNode Node * operations_on_datastructures::inorder_traversal_of_bst::getNode ( Node root,
    - + @@ -443,21 +441,21 @@ Here is the call graph for this function:
    Returns
    Node* Pointer to the root node.
    -
    82  {
    -
    83  if (root == nullptr) {
    -
    84  root = makeNode(data);
    -
    85  } else if (data <= root->data) {
    -
    86  root->left = Insert(root->left, data);
    -
    87  } else {
    -
    88  root->right = Insert(root->right, data);
    -
    89  }
    -
    90  return root;
    -
    91 }
    -
    Node * makeNode(int64_t data)
    Allocates a new node in heap for given data and returns it's pointer.
    Definition: inorder_successor_of_bst.cpp:68
    +
    82 {
    +
    83 if (root == nullptr) {
    +
    84 root = makeNode(data);
    +
    85 } else if (data <= root->data) {
    +
    86 root->left = Insert(root->left, data);
    +
    87 } else {
    +
    88 root->right = Insert(root->right, data);
    +
    89 }
    +
    90 return root;
    +
    91}
    +
    Node * makeNode(int64_t data)
    Allocates a new node in heap for given data and returns it's pointer.
    Definition: inorder_successor_of_bst.cpp:68
    - +

    ◆ main()

    @@ -492,51 +490,51 @@ Here is the call graph for this function:
    Returns
    0 on exit
    -

    < root node of the bst

    -

    < Data to add nodes in BST

    -

    < An element to find inorder successor for.

    -

    < Making BST

    -

    memory cleanup!

    -
    398  {
    -
    399  test(); // run self-test implementations
    -
    400 
    - -
    402  nullptr; ///< root node of the bst
    -
    403  std::vector<int64_t> node_data{3, 4, 5,
    -
    404  89, 1, 2}; ///< Data to add nodes in BST
    -
    405 
    -
    406  int64_t targetElement = 4; ///< An element to find inorder successor for.
    - -
    408  root, node_data); ///< Making BST
    -
    409 
    - -
    411  *inorderSuccessor = operations_on_datastructures::
    -
    412  inorder_traversal_of_bst::getInorderSuccessor(root, targetElement);
    -
    413 
    -
    414  std::cout << "In-order sequence is : ";
    - -
    416  std::cout << std::endl;
    -
    417 
    -
    418  if (inorderSuccessor == nullptr) {
    -
    419  std::cout << "Inorder successor for last node is NULL" << std::endl;
    -
    420  } else {
    -
    421  std::cout << "Target element is : " << targetElement << std::endl;
    -
    422  std::cout << "Inorder successor for target element is : "
    -
    423  << inorderSuccessor->data << std::endl;
    -
    424  }
    -
    425 
    -
    426  deallocate(root); /// memory cleanup!
    -
    427 
    -
    428  return 0;
    -
    429 }
    +

    < root node of the bst

    +

    < Data to add nodes in BST

    +

    < An element to find inorder successor for.

    +

    < Making BST

    +

    memory cleanup!

    +
    398 {
    +
    399 test(); // run self-test implementations
    +
    400
    + +
    402 nullptr; ///< root node of the bst
    +
    403 std::vector<int64_t> node_data{3, 4, 5,
    +
    404 89, 1, 2}; ///< Data to add nodes in BST
    +
    405
    +
    406 int64_t targetElement = 4; ///< An element to find inorder successor for.
    + +
    408 root, node_data); ///< Making BST
    +
    409
    + +
    411 *inorderSuccessor = operations_on_datastructures::
    +
    412 inorder_traversal_of_bst::getInorderSuccessor(root, targetElement);
    +
    413
    +
    414 std::cout << "In-order sequence is : ";
    + + +
    417
    +
    418 if (inorderSuccessor == nullptr) {
    +
    419 std::cout << "Inorder successor for last node is NULL" << std::endl;
    +
    420 } else {
    +
    421 std::cout << "Target element is : " << targetElement << std::endl;
    +
    422 std::cout << "Inorder successor for target element is : "
    +
    423 << inorderSuccessor->data << std::endl;
    +
    424 }
    +
    425
    +
    426 deallocate(root); /// memory cleanup!
    +
    427
    +
    428 return 0;
    +
    429}
    A Node structure representing a single node in BST.
    Definition: inorder_successor_of_bst.cpp:56
    int64_t data
    The key/value of the node.
    Definition: inorder_successor_of_bst.cpp:58
    T endl(T... args)
    +
    Node * makeBST(Node *root, const std::vector< int64_t > &data)
    This function is used in test cases to quickly create BST containing large data instead of hard codin...
    Definition: inorder_successor_of_bst.cpp:155
    void printInorder(Node *root)
    Prints the BST in inorder traversal using recursion.
    Definition: inorder_successor_of_bst.cpp:136
    static void test()
    Self-test implementations.
    Definition: inorder_successor_of_bst.cpp:387
    -
    Node * makeBST(Node *root, const std::vector< int64_t > &data)
    This function is used in test cases to quickly create BST containing large data instead of hard codin...
    Definition: inorder_successor_of_bst.cpp:155
    - +
    Here is the call graph for this function:
    @@ -546,14 +544,14 @@ Here is the call graph for this function:
    - -

    ◆ makeBST()

    + +

    ◆ makeBST()

    Node* operations_on_datastructures::inorder_traversal_of_bst::Insert Node * operations_on_datastructures::inorder_traversal_of_bst::Insert ( Node root,
    - + @@ -581,29 +579,29 @@ Here is the call graph for this function:
    Returns
    Node pointer to the root node.
    -
    155  {
    -
    156  for (int64_t values : data) {
    -
    157  root = Insert(root, values);
    -
    158  }
    -
    159  return root;
    -
    160 }
    +
    155 {
    +
    156 for (int64_t values : data) {
    +
    157 root = Insert(root, values);
    +
    158 }
    +
    159 return root;
    +
    160}
    Here is the call graph for this function:
    -
    +
    - -

    ◆ makeNode()

    + +

    ◆ makeNode()

    Node* operations_on_datastructures::inorder_traversal_of_bst::makeBST Node * operations_on_datastructures::inorder_traversal_of_bst::makeBST ( Node root,
    - + @@ -620,28 +618,28 @@ Here is the call graph for this function:
    Returns
    A pointer to the newly allocated Node.
    -

    < setting data for node

    -

    < setting left child as null

    -

    < setting right child as null

    -
    68  {
    -
    69  Node *node = new Node();
    -
    70  node->data = data; ///< setting data for node
    -
    71  node->left = nullptr; ///< setting left child as null
    -
    72  node->right = nullptr; ///< setting right child as null
    -
    73  return node;
    -
    74 }
    +

    < setting data for node

    +

    < setting left child as null

    +

    < setting right child as null

    +
    68 {
    +
    69 Node *node = new Node();
    +
    70 node->data = data; ///< setting data for node
    +
    71 node->left = nullptr; ///< setting left child as null
    +
    72 node->right = nullptr; ///< setting right child as null
    +
    73 return node;
    +
    74}
    struct list node
    Definition: avltree.cpp:13
    Here is the call graph for this function:
    -
    +
    - +

    ◆ printInorder()

    @@ -665,17 +663,17 @@ Here is the call graph for this function:
    Returns
    void
    -

    recursive call to left subtree

    -

    recursive call to right subtree

    -
    136  {
    -
    137  if (root == nullptr) {
    -
    138  return;
    -
    139  }
    -
    140 
    -
    141  printInorder(root->left); /// recursive call to left subtree
    -
    142  std::cout << root->data << " ";
    -
    143  printInorder(root->right); /// recursive call to right subtree
    -
    144 }
    +

    recursive call to left subtree

    +

    recursive call to right subtree

    +
    136 {
    +
    137 if (root == nullptr) {
    +
    138 return;
    +
    139 }
    +
    140
    +
    141 printInorder(root->left); /// recursive call to left subtree
    +
    142 std::cout << root->data << " ";
    +
    143 printInorder(root->right); /// recursive call to right subtree
    +
    144}
    Here is the call graph for this function:
    @@ -685,7 +683,7 @@ Here is the call graph for this function:
    - +

    ◆ test()

    @@ -710,10 +708,10 @@ Here is the call graph for this function:

    Self-test implementations.

    Returns
    void
    -
    387  {
    -
    388  TestCases tc;
    -
    389  tc.runTests();
    -
    390 }
    +
    387 {
    +
    388 TestCases tc;
    +
    389 tc.runTests();
    +
    390}
    class encapsulating the necessary test cases
    Definition: inorder_successor_of_bst.cpp:225
    void runTests()
    Executes test cases.
    Definition: inorder_successor_of_bst.cpp:243
    @@ -731,7 +729,7 @@ Here is the call graph for this function:
    diff --git a/d4/d32/inorder__successor__of__bst_8cpp.js b/d4/d32/inorder__successor__of__bst_8cpp.js index a73246833..d73a01616 100644 --- a/d4/d32/inorder__successor__of__bst_8cpp.js +++ b/d4/d32/inorder__successor__of__bst_8cpp.js @@ -1,15 +1,15 @@ var inorder__successor__of__bst_8cpp = [ - [ "Node", "d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html", "d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node" ], + [ "operations_on_datastructures::inorder_traversal_of_bst::Node", "d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html", "d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node" ], [ "TestCases", "d5/d58/class_test_cases.html", "d5/d58/class_test_cases" ], [ "deallocate", "d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589", null ], - [ "findMinNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a25667588088eb647887d1c2bff0efa8c", null ], - [ "getInorderSuccessor", "d4/d32/inorder__successor__of__bst_8cpp.html#a9aa3fac9aa48a6568ecf89aaee190d43", null ], - [ "getNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a744afaca22fa7bb91c92209a26f23e8f", null ], - [ "Insert", "d4/d32/inorder__successor__of__bst_8cpp.html#a2153df6265379da9bda259af3f46556a", null ], + [ "findMinNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a72483e3f6933e004a8d86371e8a990db", null ], + [ "getInorderSuccessor", "d4/d32/inorder__successor__of__bst_8cpp.html#a3923fb22b46e085376703cae0b44d690", null ], + [ "getNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a824cbf1814854824cf05f062eea07b95", null ], + [ "Insert", "d4/d32/inorder__successor__of__bst_8cpp.html#a3ae0bea4123fd2ce155108e88f2ef78c", null ], [ "main", "d4/d32/inorder__successor__of__bst_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ], - [ "makeBST", "d4/d32/inorder__successor__of__bst_8cpp.html#ad0ca93be4f9576bfb715a4864a30dbee", null ], - [ "makeNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a4852816cc9f28f7b9def0e5beb4e8545", null ], + [ "makeBST", "d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9", null ], + [ "makeNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a7f6f73a33beec448c27cc1d70b220702", null ], [ "printInorder", "d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4", null ], [ "test", "d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/d4/d32/inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.map b/d4/d32/inorder__successor__of__bst_8cpp_a05fe8a029e155c43e4efa598d4d089d9_cgraph.map similarity index 100% rename from d4/d32/inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.map rename to d4/d32/inorder__successor__of__bst_8cpp_a05fe8a029e155c43e4efa598d4d089d9_cgraph.map diff --git a/d4/d32/inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.md5 b/d4/d32/inorder__successor__of__bst_8cpp_a05fe8a029e155c43e4efa598d4d089d9_cgraph.md5 similarity index 100% rename from d4/d32/inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.md5 rename to d4/d32/inorder__successor__of__bst_8cpp_a05fe8a029e155c43e4efa598d4d089d9_cgraph.md5 diff --git a/d4/d32/inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.svg b/d4/d32/inorder__successor__of__bst_8cpp_a05fe8a029e155c43e4efa598d4d089d9_cgraph.svg similarity index 96% rename from d4/d32/inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.svg rename to d4/d32/inorder__successor__of__bst_8cpp_a05fe8a029e155c43e4efa598d4d089d9_cgraph.svg index fb3362fad..4d30fd2f7 100644 --- a/d4/d32/inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.svg +++ b/d4/d32/inorder__successor__of__bst_8cpp_a05fe8a029e155c43e4efa598d4d089d9_cgraph.svg @@ -1,7 +1,7 @@ - - diff --git a/d4/d32/inorder__successor__of__bst_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg b/d4/d32/inorder__successor__of__bst_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg index 571c4a941..f3ca1280b 100644 --- a/d4/d32/inorder__successor__of__bst_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg +++ b/d4/d32/inorder__successor__of__bst_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - - - - - diff --git a/d4/d32/inorder__successor__of__bst_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg b/d4/d32/inorder__successor__of__bst_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg index ceccd406a..7df869692 100644 --- a/d4/d32/inorder__successor__of__bst_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg +++ b/d4/d32/inorder__successor__of__bst_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: math/power_of_two.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
    @@ -42,21 +41,22 @@
    Node* operations_on_datastructures::inorder_traversal_of_bst::makeNode Node * operations_on_datastructures::inorder_traversal_of_bst::makeNode ( int64_t  data)
    -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('d4/d38/power__of__two_8cpp.html','../. -
    -
    power_of_two.cpp File Reference
    +
    power_of_two.cpp File Reference
    @@ -108,13 +107,13 @@ Include dependency graph for power_of_two.cpp:
    - - +

    +

    Namespaces

     math
    namespace  math
     for IO operations
     
    - @@ -124,15 +123,15 @@ Functions

    +

    Functions

    void math::power_of_two (int n)
     Function to test above algorithm. More...
     

    Detailed Description

    -

    Implementation to check whether a number is a power of 2 or not.

    -

    This algorithm uses bit manipulation to check if a number is a power of 2 or not.

    +

    Implementation to check whether a number is a power of 2 or not.

    +

    This algorithm uses bit manipulation to check if a number is a power of 2 or not.

    Algorithm

    -

    Let the input number be n, then the bitwise and between n and n-1 will let us know whether the number is power of 2 or not

    -

    For Example, If N= 32 then N-1 is 31, if we perform bitwise and of these two numbers then the result will be zero, which indicates that it is the power of 2 If N=23 then N-1 is 22, if we perform bitwise and of these two numbers then the result will not be zero , which indicates that it is not the power of 2

    Note
    This implementation is better than naive recursive or iterative approach.
    -
    Author
    Neha Hasija
    +

    Let the input number be n, then the bitwise and between n and n-1 will let us know whether the number is power of 2 or not

    +

    For Example, If N= 32 then N-1 is 31, if we perform bitwise and of these two numbers then the result will be zero, which indicates that it is the power of 2 If N=23 then N-1 is 22, if we perform bitwise and of these two numbers then the result will not be zero , which indicates that it is not the power of 2

    Note
    This implementation is better than naive recursive or iterative approach.
    +
    Author
    Neha Hasija

    Function Documentation

    - +

    ◆ main()

    @@ -150,22 +149,22 @@ Algorithm

    Main function.

    Returns
    0 on exit
    -

    n stores the input from the user

    -

    function call with

    Parameters
    +

    n stores the input from the user

    +

    function call with

    Parameters
    n
    -
    58  {
    -
    59  int n = 0;
    -
    60  /// n stores the input from the user
    -
    61  std::cout << "enter a number " << std::endl;
    -
    62  std::cin >> n;
    -
    63  /// function call with @param n
    - -
    65  return 0;
    -
    66 }
    +
    58 {
    +
    59 int n = 0;
    +
    60 /// n stores the input from the user
    +
    61 std::cout << "enter a number " << std::endl;
    +
    62 std::cin >> n;
    +
    63 /// function call with @param n
    + +
    65 return 0;
    +
    66}
    T endl(T... args)
    @@ -185,7 +184,7 @@ Here is the call graph for this function:
    diff --git a/d4/d38/power__of__two_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d4/d38/power__of__two_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 522262d3e..ebcc7d1b9 100644 --- a/d4/d38/power__of__two_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d4/d38/power__of__two_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Open Addressing @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -90,16 +90,31 @@ $(document).ready(function(){initNavTree('d4/d39/group__open__addressing.html','
    -
    -
    Open Addressing
    + +
    Open Addressing
    + + + + + + + + + + + +

    +Namespaces

    namespace  double_hashing
     An implementation of hash table using double hashing algorithm.
     
    namespace  linear_probing
     An implementation of hash table using linear probing algorithm.
     
    namespace  quadratic_probing
     An implementation of hash table using quadratic probing algorithm.
     
    +

    Detailed Description

    diff --git a/d4/d39/group__open__addressing.js b/d4/d39/group__open__addressing.js new file mode 100644 index 000000000..099f7d5ff --- /dev/null +++ b/d4/d39/group__open__addressing.js @@ -0,0 +1,6 @@ +var group__open__addressing = +[ + [ "double_hashing", "d0/d65/namespacedouble__hashing.html", null ], + [ "linear_probing", "d8/d89/namespacelinear__probing.html", null ], + [ "quadratic_probing", "d4/dd2/namespacequadratic__probing.html", null ] +]; \ No newline at end of file diff --git a/d4/d3e/n__queens_8cpp.html b/d4/d3e/n__queens_8cpp.html index 27d82a315..bce6069aa 100644 --- a/d4/d3e/n__queens_8cpp.html +++ b/d4/d3e/n__queens_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: backtracking/n_queens.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d4/d3e/n__queens_8cpp.html','../../'); -
    -
    n_queens.cpp File Reference
    +
    n_queens.cpp File Reference
    -

    Eight Queens puzzle +

    Eight Queens puzzle More...

    #include <iostream>
    #include <array>
    @@ -109,16 +108,16 @@ Include dependency graph for n_queens.cpp:
    - - + - - + +

    +

    Namespaces

     backtracking
    namespace  backtracking
     Backtracking algorithms.
     
     n_queens
     Functions for Eight Queens puzzle.
    namespace  n_queens
     Functions for Eight Queens puzzle.
     
    - @@ -133,13 +132,13 @@ Functions

    +

    Functions

    template<size_t n>
    void backtracking::n_queens::printSolution (const std::array< std::array< int, n >, n > &board)
     

    Detailed Description

    -

    Eight Queens puzzle

    -

    The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other; thus, a solution requires that no two queens share the same row, column, or diagonal. The eight queens puzzle is an example of the more general n queens problem of placing n non-attacking queens on an n×n chessboard, for which solutions exist for all natural numbers n with the exception of n = 2 and n = 3.

    +

    Eight Queens puzzle

    +

    The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other; thus, a solution requires that no two queens share the same row, column, or diagonal. The eight queens puzzle is an example of the more general n queens problem of placing n non-attacking queens on an n×n chessboard, for which solutions exist for all natural numbers n with the exception of n = 2 and n = 3.

    Author
    Unknown author
    -David Leal
    +David Leal

    Function Documentation

    - +

    ◆ isSafe()

    @@ -172,7 +171,7 @@ template<size_t n>
    -

    Check if a queen can be placed on matrix

    Template Parameters
    +

    Check if a queen can be placed on matrix

    Template Parameters
    nnumber of matrix size
    @@ -189,34 +188,34 @@ template<size_t n>
    Returns
    true if queen can be placed on matrix
    false if queen can't be placed on matrix
    -
    58  {
    -
    59  int i = 0, j = 0;
    -
    60 
    -
    61  // Check this row on left side
    -
    62  for (i = 0; i < col; i++) {
    -
    63  if (board[row][i]) {
    -
    64  return false;
    -
    65  }
    -
    66  }
    -
    67 
    -
    68  // Check upper diagonal on left side
    -
    69  for (i = row, j = col; i >= 0 && j >= 0; i--, j--) {
    -
    70  if (board[i][j]) {
    -
    71  return false;
    -
    72  }
    -
    73  }
    -
    74  // Check lower diagonal on left side
    -
    75  for (i = row, j = col; j >= 0 && i < n; i++, j--) {
    -
    76  if (board[i][j]) {
    -
    77  return false;
    -
    78  }
    -
    79  }
    -
    80  return true;
    -
    81  }
    +
    58 {
    +
    59 int i = 0, j = 0;
    +
    60
    +
    61 // Check this row on left side
    +
    62 for (i = 0; i < col; i++) {
    +
    63 if (board[row][i]) {
    +
    64 return false;
    +
    65 }
    +
    66 }
    +
    67
    +
    68 // Check upper diagonal on left side
    +
    69 for (i = row, j = col; i >= 0 && j >= 0; i--, j--) {
    +
    70 if (board[i][j]) {
    +
    71 return false;
    +
    72 }
    +
    73 }
    +
    74 // Check lower diagonal on left side
    +
    75 for (i = row, j = col; j >= 0 && i < n; i++, j--) {
    +
    76 if (board[i][j]) {
    +
    77 return false;
    +
    78 }
    +
    79 }
    +
    80 return true;
    +
    81 }
    - +

    ◆ main()

    @@ -231,24 +230,24 @@ template<size_t n>
    -

    Main function

    -
    118  {
    -
    119  const int n = 4;
    -
    120  std::array<std::array<int, n>, n> board = {
    -
    121  std::array<int, n>({0, 0, 0, 0}),
    -
    122  std::array<int, n>({0, 0, 0, 0}),
    -
    123  std::array<int, n>({0, 0, 0, 0}),
    -
    124  std::array<int, n>({0, 0, 0, 0})
    -
    125  };
    -
    126 
    -
    127  backtracking::n_queens::solveNQ<n>(board, 0);
    -
    128  return 0;
    -
    129 }
    +

    Main function

    +
    118 {
    +
    119 const int n = 4;
    + +
    121 std::array<int, n>({0, 0, 0, 0}),
    +
    122 std::array<int, n>({0, 0, 0, 0}),
    +
    123 std::array<int, n>({0, 0, 0, 0}),
    +
    124 std::array<int, n>({0, 0, 0, 0})
    +
    125 };
    +
    126
    +
    127 backtracking::n_queens::solveNQ<n>(board, 0);
    +
    128 return 0;
    +
    129}
    - +

    ◆ printSolution()

    @@ -265,7 +264,7 @@ template<size_t n>
    -

    Utility function to print matrix

    Template Parameters
    +

    Utility function to print matrix

    Template Parameters
    nnumber of matrix size
    @@ -277,20 +276,20 @@ template<size_t n>
    -
    37  {
    -
    38  std::cout << "\n";
    -
    39  for (int i = 0; i < n; i++) {
    -
    40  for (int j = 0; j < n; j++) {
    -
    41  std::cout << "" << board[i][j] << " ";
    -
    42  }
    -
    43  std::cout << "\n";
    -
    44  }
    -
    45  }
    +
    37 {
    +
    38 std::cout << "\n";
    +
    39 for (int i = 0; i < n; i++) {
    +
    40 for (int j = 0; j < n; j++) {
    +
    41 std::cout << "" << board[i][j] << " ";
    +
    42 }
    +
    43 std::cout << "\n";
    +
    44 }
    +
    45 }
    - +

    ◆ solveNQ()

    @@ -317,7 +316,7 @@ template<size_t n>
    -

    Solve n queens problem

    Template Parameters
    +

    Solve n queens problem

    Template Parameters
    nnumber of matrix size
    @@ -330,28 +329,28 @@ template<size_t n>
    -
    90  {
    -
    91  if (col >= n) {
    -
    92  printSolution<n>(board);
    -
    93  return;
    -
    94  }
    -
    95 
    -
    96  // Consider this column and try placing
    -
    97  // this queen in all rows one by one
    -
    98  for (int i = 0; i < n; i++) {
    -
    99  // Check if queen can be placed
    -
    100  // on board[i][col]
    -
    101  if (isSafe<n>(board, i, col)) {
    -
    102  // Place this queen in matrix
    -
    103  board[i][col] = 1;
    -
    104 
    -
    105  // Recursive to place rest of the queens
    -
    106  solveNQ<n>(board, col + 1);
    -
    107 
    -
    108  board[i][col] = 0; // backtrack
    -
    109  }
    -
    110  }
    -
    111  }
    +
    90 {
    +
    91 if (col >= n) {
    +
    92 printSolution<n>(board);
    +
    93 return;
    +
    94 }
    +
    95
    +
    96 // Consider this column and try placing
    +
    97 // this queen in all rows one by one
    +
    98 for (int i = 0; i < n; i++) {
    +
    99 // Check if queen can be placed
    +
    100 // on board[i][col]
    +
    101 if (isSafe<n>(board, i, col)) {
    +
    102 // Place this queen in matrix
    +
    103 board[i][col] = 1;
    +
    104
    +
    105 // Recursive to place rest of the queens
    +
    106 solveNQ<n>(board, col + 1);
    +
    107
    +
    108 board[i][col] = 0; // backtrack
    +
    109 }
    +
    110 }
    +
    111 }
    Here is the call graph for this function:
    @@ -367,7 +366,7 @@ Here is the call graph for this function:
    diff --git a/d4/d3e/n__queens_8cpp_a0dbd7af47d87f0b956609fe9e3288ecb_cgraph.svg b/d4/d3e/n__queens_8cpp_a0dbd7af47d87f0b956609fe9e3288ecb_cgraph.svg index 1a468056f..dec1e8f46 100644 --- a/d4/d3e/n__queens_8cpp_a0dbd7af47d87f0b956609fe9e3288ecb_cgraph.svg +++ b/d4/d3e/n__queens_8cpp_a0dbd7af47d87f0b956609fe9e3288ecb_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: math/gcd_recursive_euclidean.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('d4/d45/gcd__recursive__euclidean_8cpp.
    -
    -
    gcd_recursive_euclidean.cpp File Reference
    +
    gcd_recursive_euclidean.cpp File Reference
    -

    Compute the greatest common denominator of two integers using recursive form of Euclidean algorithm +

    Compute the greatest common denominator of two integers using recursive form of Euclidean algorithm More...

    #include <iostream>
    @@ -107,7 +106,7 @@ Include dependency graph for gcd_recursive_euclidean.cpp:
    - @@ -115,10 +114,10 @@ Functions

    +

    Functions

    int gcd (int num1, int num2)
     
     

    Detailed Description

    -

    Compute the greatest common denominator of two integers using recursive form of Euclidean algorithm

    +

    Compute the greatest common denominator of two integers using recursive form of Euclidean algorithm

    See also
    gcd_iterative_euclidean.cpp, gcd_of_n_numbers.cpp

    Function Documentation

    - +

    ◆ gcd()

    @@ -143,37 +142,43 @@ Functions
    -

    algorithm

    -
    14  {
    -
    15  if (num1 <= 0 | num2 <= 0) {
    -
    16  throw std::domain_error("Euclidean algorithm domain is for ints > 0");
    -
    17  }
    -
    18 
    -
    19  if (num1 == num2) {
    -
    20  return num1;
    -
    21  }
    -
    22 
    -
    23  // Everything divides 0
    -
    24  if (num1 == 0)
    -
    25  return num2;
    -
    26  if (num2 == 0)
    -
    27  return num1;
    -
    28 
    -
    29  // base case
    -
    30  if (num1 == num2)
    -
    31  return num1;
    -
    32 
    -
    33  // a is greater
    -
    34  if (num1 > num2)
    -
    35  return gcd(num1 - num2, num2);
    -
    36  return gcd(num1, num2 - num1);
    -
    37 }
    +

    algorithm

    +
    14 {
    +
    15 if (num1 <= 0 | num2 <= 0) {
    +
    16 throw std::domain_error("Euclidean algorithm domain is for ints > 0");
    +
    17 }
    +
    18
    +
    19 if (num1 == num2) {
    +
    20 return num1;
    +
    21 }
    +
    22
    +
    23 // Everything divides 0
    +
    24 if (num1 == 0)
    +
    25 return num2;
    +
    26 if (num2 == 0)
    +
    27 return num1;
    +
    28
    +
    29 // base case
    +
    30 if (num1 == num2)
    +
    31 return num1;
    +
    32
    +
    33 // a is greater
    +
    34 if (num1 > num2)
    +
    35 return gcd(num1 - num2, num2);
    +
    36 return gcd(num1, num2 - num1);
    +
    37}
    int gcd(int num1, int num2)
    Definition: gcd_recursive_euclidean.cpp:14
    -
    +
    +Here is the call graph for this function:
    +
    +
    - + +
    +
    +

    ◆ main()

    @@ -188,24 +193,24 @@ Functions
    -

    Main function

    -
    42  {
    -
    43  std::cout << "gcd of 120,7 is " << (gcd(120, 7)) << std::endl;
    -
    44  try {
    -
    45  std::cout << "gcd of -120,10 is " << gcd(-120, 10) << std::endl;
    -
    46  } catch (const std::domain_error &e) {
    -
    47  std::cout << "Error handling was successful" << std::endl;
    -
    48  }
    -
    49  std::cout << "gcd of 312,221 is " << (gcd(312, 221)) << std::endl;
    -
    50  std::cout << "gcd of 289,204 is " << (gcd(289, 204)) << std::endl;
    -
    51  return 0;
    -
    52 }
    +

    Main function

    +
    42 {
    +
    43 std::cout << "gcd of 120,7 is " << (gcd(120, 7)) << std::endl;
    +
    44 try {
    +
    45 std::cout << "gcd of -120,10 is " << gcd(-120, 10) << std::endl;
    +
    46 } catch (const std::domain_error &e) {
    +
    47 std::cout << "Error handling was successful" << std::endl;
    +
    48 }
    +
    49 std::cout << "gcd of 312,221 is " << (gcd(312, 221)) << std::endl;
    +
    50 std::cout << "gcd of 289,204 is " << (gcd(289, 204)) << std::endl;
    +
    51 return 0;
    +
    52}
    T endl(T... args)
    Here is the call graph for this function:
    -
    +
    @@ -217,7 +222,7 @@ Here is the call graph for this function:
    diff --git a/d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.map b/d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.map new file mode 100644 index 000000000..9d5066e1b --- /dev/null +++ b/d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.md5 b/d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.md5 new file mode 100644 index 000000000..6cdeba598 --- /dev/null +++ b/d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.md5 @@ -0,0 +1 @@ +63194f545c045f973d0472cef162735b \ No newline at end of file diff --git a/d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.svg b/d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.svg new file mode 100644 index 000000000..9e8e853e8 --- /dev/null +++ b/d4/d45/gcd__recursive__euclidean_8cpp_ae48807fa2b7000afae599e67f327545e_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +gcd + + + +Node1 + + +gcd + + + + + +Node1->Node1 + + + + + diff --git a/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 5003cdfb1..0b4563f03 100644 --- a/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,5 +1,5 @@ - + - + diff --git a/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 6267b37f2..ae3f8fe23 100644 --- a/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -0a510339d6503e41ca87c42775bfae21 \ No newline at end of file +c72e9bdf4852af158ecad75d464e2730 \ No newline at end of file diff --git a/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index e7f266651..1b092689e 100644 --- a/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d4/d45/gcd__recursive__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,20 +1,20 @@ - - - + + main - + Node1 - -main + +main @@ -22,16 +22,16 @@ Node2 - -std::endl + +std::endl Node1->Node2 - - + + @@ -45,8 +45,14 @@ Node1->Node3 - - + + + + + +Node3->Node3 + + diff --git a/d4/d48/hamming__distance_8cpp.html b/d4/d48/hamming__distance_8cpp.html index 5918f4918..61a18e690 100644 --- a/d4/d48/hamming__distance_8cpp.html +++ b/d4/d48/hamming__distance_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: bit_manipulation/hamming_distance.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d4/d48/hamming__distance_8cpp.html','. -
    -
    hamming_distance.cpp File Reference
    +
    hamming_distance.cpp File Reference
    -

    Returns the Hamming distance between two integers. +

    Returns the Hamming distance between two integers. More...

    #include <cassert>
    #include <iostream>
    @@ -109,16 +108,16 @@ Include dependency graph for hamming_distance.cpp:
    - - + - - + +

    +

    Namespaces

     bit_manipulation
    namespace  bit_manipulation
     for std::vector
     
     hamming_distance
     Functions for Hamming distance implementation.
    namespace  hamming_distance
     Functions for Hamming distance implementation.
     
    - @@ -134,11 +133,11 @@ Functions

    +

    Functions

    uint64_t bit_manipulation::hamming_distance::bitCount (uint64_t value)
     
     

    Detailed Description

    -

    Returns the Hamming distance between two integers.

    -

    To find hamming distance between two integers, we take their xor, which will have a set bit iff those bits differ in the two numbers. Hence, we return the number of such set bits.

    -
    Author
    Ravishankar Joshi
    +

    Returns the Hamming distance between two integers.

    +

    To find hamming distance between two integers, we take their xor, which will have a set bit iff those bits differ in the two numbers. Hence, we return the number of such set bits.

    +
    Author
    Ravishankar Joshi

    Function Documentation

    - +

    ◆ bitCount()

    @@ -153,23 +152,23 @@ Functions
    -

    This function returns the number of set bits in the given number.

    Parameters
    +

    This function returns the number of set bits in the given number.

    Parameters
    valuethe number of which we want to count the number of set bits.
    Returns
    the number of set bits in the given number.
    -
    34  {
    -
    35  uint64_t count = 0;
    -
    36  while (value) { // until all bits are zero
    -
    37  if (value & 1) { // check lower bit
    -
    38  count++;
    -
    39  }
    -
    40  value >>= 1; // shift bits, removing lower bit
    -
    41  }
    -
    42  return count;
    -
    43 }
    +
    34 {
    +
    35 uint64_t count = 0;
    +
    36 while (value) { // until all bits are zero
    +
    37 if (value & 1) { // check lower bit
    +
    38 count++;
    +
    39 }
    +
    40 value >>= 1; // shift bits, removing lower bit
    +
    41 }
    +
    42 return count;
    +
    43}
    Here is the call graph for this function:
    @@ -179,7 +178,7 @@ Here is the call graph for this function:
    - +

    ◆ hamming_distance() [1/2]

    @@ -204,7 +203,7 @@ Here is the call graph for this function:
    -

    This function returns the hamming distance between two strings.

    Parameters
    +

    This function returns the hamming distance between two strings.

    Parameters
    @@ -212,15 +211,15 @@ Here is the call graph for this function:
    Returns
    the number of characters differing between the two strings.
    -
    59  {
    -
    60  assert(a.size() == b.size());
    -
    61  size_t n = a.size();
    -
    62  uint64_t count = 0;
    -
    63  for (size_t i = 0; i < n; i++) {
    -
    64  count += (b[i] != a[i]);
    -
    65  }
    -
    66  return count;
    -
    67 }
    +
    59 {
    +
    60 assert(a.size() == b.size());
    +
    61 size_t n = a.size();
    +
    62 uint64_t count = 0;
    +
    63 for (size_t i = 0; i < n; i++) {
    +
    64 count += (b[i] != a[i]);
    +
    65 }
    +
    66 return count;
    +
    67}
    T size(T... args)
    Here is the call graph for this function:
    @@ -231,7 +230,7 @@ Here is the call graph for this function:
    - +

    ◆ hamming_distance() [2/2]

    @@ -256,7 +255,7 @@ Here is the call graph for this function:
    athe first string
    bthe second string
    -

    This function returns the hamming distance between two integers.

    Parameters
    +

    This function returns the hamming distance between two integers.

    Parameters
    @@ -264,7 +263,7 @@ Here is the call graph for this function:
    Returns
    the number of bits differing between the two integers.
    -
    51 { return bitCount(a ^ b); }
    +
    51{ return bitCount(a ^ b); }
    uint64_t bitCount(uint64_t value)
    Definition: hamming_distance.cpp:34
    Here is the call graph for this function:
    @@ -275,7 +274,7 @@ Here is the call graph for this function:
    - +

    ◆ main()

    @@ -293,15 +292,15 @@ Here is the call graph for this function:

    Main function.

    Returns
    0 on exit
    -
    99  {
    -
    100  test(); // execute the tests
    -
    101  uint64_t a = 11; // 1011 in binary
    -
    102  uint64_t b = 2; // 0010 in binary
    -
    103 
    -
    104  std::cout << "Hamming distance between " << a << " and " << b << " is "
    - -
    106  << std::endl;
    -
    107 }
    +
    99 {
    +
    100 test(); // execute the tests
    +
    101 uint64_t a = 11; // 1011 in binary
    +
    102 uint64_t b = 2; // 0010 in binary
    +
    103
    +
    104 std::cout << "Hamming distance between " << a << " and " << b << " is "
    + +
    106 << std::endl;
    +
    107}
    T endl(T... args)
    static void test()
    Function to the test hamming distance.
    Definition: hamming_distance.cpp:75
    @@ -315,7 +314,7 @@ Here is the call graph for this function:
    - +

    ◆ test()

    @@ -340,25 +339,25 @@ Here is the call graph for this function:

    Function to the test hamming distance.

    Returns
    void
    -
    75  {
    -
    76  assert(bit_manipulation::hamming_distance::hamming_distance(11, 2) == 2);
    -
    77  assert(bit_manipulation::hamming_distance::hamming_distance(2, 0) == 1);
    -
    78  assert(bit_manipulation::hamming_distance::hamming_distance(11, 0) == 3);
    -
    79 
    -
    80  assert(bit_manipulation::hamming_distance::hamming_distance("1101",
    -
    81  "1111") == 1);
    -
    82  assert(bit_manipulation::hamming_distance::hamming_distance("1111",
    -
    83  "1111") == 0);
    -
    84  assert(bit_manipulation::hamming_distance::hamming_distance("0000",
    -
    85  "1111") == 4);
    -
    86 
    -
    87  assert(bit_manipulation::hamming_distance::hamming_distance("alpha",
    -
    88  "alphb") == 1);
    -
    89  assert(bit_manipulation::hamming_distance::hamming_distance("abcd",
    -
    90  "abcd") == 0);
    -
    91  assert(bit_manipulation::hamming_distance::hamming_distance("dcba",
    -
    92  "abcd") == 4);
    -
    93 }
    +
    75 {
    +
    76 assert(bit_manipulation::hamming_distance::hamming_distance(11, 2) == 2);
    +
    77 assert(bit_manipulation::hamming_distance::hamming_distance(2, 0) == 1);
    +
    78 assert(bit_manipulation::hamming_distance::hamming_distance(11, 0) == 3);
    +
    79
    +
    80 assert(bit_manipulation::hamming_distance::hamming_distance("1101",
    +
    81 "1111") == 1);
    +
    82 assert(bit_manipulation::hamming_distance::hamming_distance("1111",
    +
    83 "1111") == 0);
    +
    84 assert(bit_manipulation::hamming_distance::hamming_distance("0000",
    +
    85 "1111") == 4);
    +
    86
    +
    87 assert(bit_manipulation::hamming_distance::hamming_distance("alpha",
    +
    88 "alphb") == 1);
    +
    89 assert(bit_manipulation::hamming_distance::hamming_distance("abcd",
    +
    90 "abcd") == 0);
    +
    91 assert(bit_manipulation::hamming_distance::hamming_distance("dcba",
    +
    92 "abcd") == 4);
    +
    93}
    @@ -368,7 +367,7 @@ Here is the call graph for this function: diff --git a/d4/d48/hamming__distance_8cpp_a40ba9fe8b5df5c268f0c7d677ff2fe80_cgraph.svg b/d4/d48/hamming__distance_8cpp_a40ba9fe8b5df5c268f0c7d677ff2fe80_cgraph.svg index f89b66609..4e1e07328 100644 --- a/d4/d48/hamming__distance_8cpp_a40ba9fe8b5df5c268f0c7d677ff2fe80_cgraph.svg +++ b/d4/d48/hamming__distance_8cpp_a40ba9fe8b5df5c268f0c7d677ff2fe80_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - + +Algorithms_in_C++: Contributor Covenant Code of Conduct @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
    athe first number
    bthe second number
    -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -89,17 +89,16 @@ $(document).ready(function(){initNavTree('d4/d4c/md__c_o_d_e__o_f__c_o_n_d_u_c_t -
    -
    -
    Contributor Covenant Code of Conduct
    +
    +
    Contributor Covenant Code of Conduct

    Our Pledge

    -

    In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

    +

    In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

    Our Standards

    -

    Examples of behavior that contributes to creating a positive environment include:

    +

    Examples of behavior that contributes to creating a positive environment include:

    • Using welcoming and inclusive language
    • Being respectful of differing viewpoints and experiences
    • @@ -107,7 +106,7 @@ Our Standards
    • Focusing on what is best for the community
    • Showing empathy towards other community members
    -

    Examples of unacceptable behavior by participants include:

    +

    Examples of unacceptable behavior by participants include:

    • The use of sexualized language or imagery and unwelcome sexual attention or advances
    • Trolling, insulting/derogatory comments, and personal or political attacks
    • @@ -117,26 +116,26 @@ Our Standards

    Our Responsibilities

    -

    Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

    -

    Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

    +

    Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

    +

    Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

    Scope

    -

    This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

    +

    This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

    Enforcement

    -

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at 1anup.nosp@m.panw.nosp@m.ar@gm.nosp@m.ail..nosp@m.com, dynam.nosp@m.itec.nosp@m.hetan.nosp@m.@gma.nosp@m.il.co.nosp@m.m, nikhi.nosp@m.lkal.nosp@m.a8@gm.nosp@m.ail..nosp@m.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

    -

    Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

    +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at 1anup.nosp@m.panw.nosp@m.ar@gm.nosp@m.ail..nosp@m.com, dynam.nosp@m.itec.nosp@m.hetan.nosp@m.@gma.nosp@m.il.co.nosp@m.m, nikhi.nosp@m.lkal.nosp@m.a8@gm.nosp@m.ail..nosp@m.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

    +

    Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

    Attribution

    -

    This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

    -

    For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq

    +

    This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

    +

    For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq

    diff --git a/d4/d59/large__factorial_8cpp__incl.svg b/d4/d59/large__factorial_8cpp__incl.svg index f56827104..ea72a37f8 100644 --- a/d4/d59/large__factorial_8cpp__incl.svg +++ b/d4/d59/large__factorial_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: math/armstrong_number.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('d4/d5d/math_2armstrong__number_8cpp.ht
    -
    -
    armstrong_number.cpp File Reference
    +
    armstrong_number.cpp File Reference
    -

    Program to check if a number is an Armstrong/Narcissistic number in decimal system. +

    Program to check if a number is an Armstrong/Narcissistic number in decimal system. More...

    #include <cassert>
    #include <cmath>
    @@ -109,7 +108,7 @@ Include dependency graph for armstrong_number.cpp:
    - @@ -121,10 +120,10 @@ Functions

    +

    Functions

    int number_of_digits (int num)
     
     

    Detailed Description

    -

    Program to check if a number is an Armstrong/Narcissistic number in decimal system.

    -

    Armstrong number or Narcissistic number is a number that is the sum of its own digits raised to the power of the number of digits.

    Author
    iamnambiar
    +

    Program to check if a number is an Armstrong/Narcissistic number in decimal system.

    +

    Armstrong number or Narcissistic number is a number that is the sum of its own digits raised to the power of the number of digits.

    Author
    iamnambiar

    Function Documentation

    - +

    ◆ is_armstrong()

    @@ -139,7 +138,7 @@ Functions
    -

    Function to check whether the number is armstrong number or not.

    Parameters
    +

    Function to check whether the number is armstrong number or not.

    Parameters
    numNumber
    @@ -148,26 +147,26 @@ Functions
    Returns
    true if the number is armstrong.
    false if the number is not armstrong.
    -
    36  {
    -
    37  // If the number is less than 0, then it is not a armstrong number.
    -
    38  if (number < 0) {
    -
    39  return false;
    -
    40  }
    -
    41  int sum = 0;
    -
    42  int temp = number;
    -
    43  // Finding the total number of digits in the number
    -
    44  int total_digits = number_of_digits(number);
    -
    45  while (temp > 0) {
    -
    46  int rem = temp % 10;
    -
    47  // Finding each digit raised to the power total digit and add it to the
    -
    48  // total sum
    -
    49  sum = sum + std::pow(rem, total_digits);
    -
    50  temp = temp / 10;
    -
    51  }
    -
    52  return number == sum;
    -
    53 }
    +
    36 {
    +
    37 // If the number is less than 0, then it is not a armstrong number.
    +
    38 if (number < 0) {
    +
    39 return false;
    +
    40 }
    +
    41 int sum = 0;
    +
    42 int temp = number;
    +
    43 // Finding the total number of digits in the number
    +
    44 int total_digits = number_of_digits(number);
    +
    45 while (temp > 0) {
    +
    46 int rem = temp % 10;
    +
    47 // Finding each digit raised to the power total digit and add it to the
    +
    48 // total sum
    +
    49 sum = sum + std::pow(rem, total_digits);
    +
    50 temp = temp / 10;
    +
    51 }
    +
    52 return number == sum;
    +
    53}
    int number_of_digits(int num)
    Definition: armstrong_number.cpp:21
    -
    T sum(const std::vector< std::valarray< T >> &A)
    Definition: vector_ops.hpp:232
    +
    T sum(const std::vector< std::valarray< T > > &A)
    Definition: vector_ops.hpp:232
    T pow(T... args)
    Here is the call graph for this function:
    @@ -178,7 +177,7 @@ Here is the call graph for this function:
    - +

    ◆ main()

    @@ -193,11 +192,11 @@ Here is the call graph for this function:
    -

    Main Function

    -
    77  {
    -
    78  test();
    -
    79  return 0;
    -
    80 }
    +

    Main Function

    +
    77 {
    +
    78 test();
    +
    79 return 0;
    +
    80}
    void test()
    Definition: armstrong_number.cpp:59
    Here is the call graph for this function:
    @@ -208,7 +207,7 @@ Here is the call graph for this function:
    - +

    ◆ number_of_digits()

    @@ -223,25 +222,25 @@ Here is the call graph for this function:
    -

    Function to calculate the total number of digits in the number.

    Parameters
    +

    Function to calculate the total number of digits in the number.

    Parameters
    numNumber
    Returns
    Total number of digits.
    -
    21  {
    -
    22  int total_digits = 0;
    -
    23  while (num > 0) {
    -
    24  num = num / 10;
    -
    25  ++total_digits;
    -
    26  }
    -
    27  return total_digits;
    -
    28 }
    +
    21 {
    +
    22 int total_digits = 0;
    +
    23 while (num > 0) {
    +
    24 num = num / 10;
    +
    25 ++total_digits;
    +
    26 }
    +
    27 return total_digits;
    +
    28}
    - +

    ◆ test()

    @@ -255,21 +254,21 @@ Here is the call graph for this function:
    -

    Function for testing the is_armstrong() function with all the test cases.

    -
    59  {
    -
    60  // is_armstrong(370) returns true.
    -
    61  assert(is_armstrong(370) == true);
    -
    62  // is_armstrong(225) returns false.
    -
    63  assert(is_armstrong(225) == false);
    -
    64  // is_armstrong(-23) returns false.
    -
    65  assert(is_armstrong(-23) == false);
    -
    66  // is_armstrong(153) returns true.
    -
    67  assert(is_armstrong(153) == true);
    -
    68  // is_armstrong(0) returns true.
    -
    69  assert(is_armstrong(0) == true);
    -
    70  // is_armstrong(12) returns false.
    -
    71  assert(is_armstrong(12) == false);
    -
    72 }
    +

    Function for testing the is_armstrong() function with all the test cases.

    +
    59 {
    +
    60 // is_armstrong(370) returns true.
    +
    61 assert(is_armstrong(370) == true);
    +
    62 // is_armstrong(225) returns false.
    +
    63 assert(is_armstrong(225) == false);
    +
    64 // is_armstrong(-23) returns false.
    +
    65 assert(is_armstrong(-23) == false);
    +
    66 // is_armstrong(153) returns true.
    +
    67 assert(is_armstrong(153) == true);
    +
    68 // is_armstrong(0) returns true.
    +
    69 assert(is_armstrong(0) == true);
    +
    70 // is_armstrong(12) returns false.
    +
    71 assert(is_armstrong(12) == false);
    +
    72}
    bool is_armstrong(int number)
    Definition: armstrong_number.cpp:36
    Here is the call graph for this function:
    @@ -286,7 +285,7 @@ Here is the call graph for this function:
    diff --git a/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.map b/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.map index 38b7698e6..50b8292ba 100644 --- a/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.map +++ b/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.map @@ -2,5 +2,5 @@ - + diff --git a/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.md5 b/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.md5 index b3126ed0e..89ca85569 100644 --- a/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.md5 +++ b/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.md5 @@ -1 +1 @@ -cc35a690ba214f72da96bbf83ee7af5e \ No newline at end of file +5c7f787ae78bd6e71307a1cff86d665a \ No newline at end of file diff --git a/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.svg b/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.svg index af270ad1b..80d7dc70e 100644 --- a/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.svg +++ b/d4/d5d/math_2armstrong__number_8cpp_a9cebd92bc70890c3cfa261d68a5016e7_cgraph.svg @@ -1,7 +1,7 @@ - Node4 - + machine_learning::sum diff --git a/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.map b/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.map index 08fe6bc96..abf547b71 100644 --- a/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.map +++ b/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.map @@ -3,5 +3,5 @@ - + diff --git a/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 b/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 index cc2f7477b..73502ba16 100644 --- a/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 +++ b/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 @@ -1 +1 @@ -6f4bce45fb6d8c4779ab6d10d366a19b \ No newline at end of file +6a8a1e848fc3dd8e2c510392ee4dc8c7 \ No newline at end of file diff --git a/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg b/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg index 96c8eea06..4027e831b 100644 --- a/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg +++ b/d4/d5d/math_2armstrong__number_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg @@ -1,7 +1,7 @@ - Node5 - + machine_learning::sum diff --git a/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index d4e009cd7..8dfd7deab 100644 --- a/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -4,5 +4,5 @@ - + diff --git a/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index d529996de..54349bae2 100644 --- a/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -52ae47bad3343b518639abb019afad19 \ No newline at end of file +fa13cc9a2cee0787344a9a84ad711e39 \ No newline at end of file diff --git a/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 72a784f00..4c629c04b 100644 --- a/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d4/d5d/math_2armstrong__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - Node6 - + machine_learning::sum diff --git a/d4/d60/kohonen__som__trace_8cpp__incl.svg b/d4/d60/kohonen__som__trace_8cpp__incl.svg index ae2d162e9..d1c64bad0 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 e841fb35a..72773eb70 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 @@ - - - + + Algorithms_in_C++: numerical_methods/qr_decompose.h File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d4/d68/qr__decompose_8h.html','../../' -
    -
    qr_decompose.h File Reference
    +
    qr_decompose.h File Reference
    -

    Library functions to compute QR decomposition of a given matrix. +

    Library functions to compute QR decomposition of a given matrix. More...

    #include <cmath>
    #include <cstdlib>
    @@ -122,43 +121,43 @@ This graph shows which files directly or indirectly include this file:

    Go to the source code of this file.

    - - - + +

    +

    Namespaces

     qr_algorithm
     Functions to compute QR decomposition of any rectangular matrix.
    namespace  qr_algorithm
     Functions to compute QR decomposition of any rectangular matrix.
     
    - - - - - - - + + + + + + - - - - - - + + + + + +

    +

    Functions

    template<typename T >
    std::ostreamqr_algorithm::operator<< (std::ostream &out, std::valarray< std::valarray< T >> const &v)
     
    template<typename T >
    std::ostreamqr_algorithm::operator<< (std::ostream &out, std::valarray< T > const &v)
     
    template<typename T >
    std::ostreamqr_algorithm::operator<< (std::ostream &out, std::valarray< std::valarray< T > > const &v)
     
    template<typename T >
    std::ostreamqr_algorithm::operator<< (std::ostream &out, std::valarray< T > const &v)
     
    template<typename T >
    double qr_algorithm::vector_dot (const std::valarray< T > &a, const std::valarray< T > &b)
     
    template<typename T >
    double qr_algorithm::vector_mag (const std::valarray< T > &a)
     
    template<typename T >
    std::valarray< T > qr_algorithm::vector_proj (const std::valarray< T > &a, const std::valarray< T > &b)
     
    template<typename T >
    void qr_algorithm::qr_decompose (const std::valarray< std::valarray< T >> &A, std::valarray< std::valarray< T >> *Q, std::valarray< std::valarray< T >> *R)
     
    template<typename T >
    std::valarray< T > qr_algorithm::vector_proj (const std::valarray< T > &a, const std::valarray< T > &b)
     
    template<typename T >
    void qr_algorithm::qr_decompose (const std::valarray< std::valarray< T > > &A, std::valarray< std::valarray< T > > *Q, std::valarray< std::valarray< T > > *R)
     

    Detailed Description

    -

    Library functions to compute QR decomposition of a given matrix.

    -
    Author
    Krishna Vedala
    +

    Library functions to compute QR decomposition of a given matrix.

    +
    Author
    Krishna Vedala
    diff --git a/d4/d68/qr__decompose_8h.js b/d4/d68/qr__decompose_8h.js index c86abc107..8cb8a5af6 100644 --- a/d4/d68/qr__decompose_8h.js +++ b/d4/d68/qr__decompose_8h.js @@ -1,9 +1,9 @@ var qr__decompose_8h = [ - [ "operator<<", "d4/d68/qr__decompose_8h.html#a7c63c78d6839b8ad73b77c161210b514", null ], - [ "operator<<", "d4/d68/qr__decompose_8h.html#a240edf2b6b5942c0e5f2c9d3e326797f", null ], - [ "qr_decompose", "d4/d68/qr__decompose_8h.html#ab1ac74497ffb2101040cc1efe3546de8", null ], + [ "operator<<", "d4/d68/qr__decompose_8h.html#adfbdf47277c8cfee229b05b72f1f7834", null ], + [ "operator<<", "d4/d68/qr__decompose_8h.html#a257425cb2365359da51c6fe6741834d8", null ], + [ "qr_decompose", "d4/d68/qr__decompose_8h.html#a73ce637634fc49e1d10d190eb388ebf1", null ], [ "vector_dot", "d4/d68/qr__decompose_8h.html#a8ea313a1a1b5f9d0e3e332c29c6446ec", null ], [ "vector_mag", "d4/d68/qr__decompose_8h.html#ad16da2183db22378435042f26af43d5f", null ], - [ "vector_proj", "d4/d68/qr__decompose_8h.html#a5422c76bfa322620de611083bd518d71", null ] + [ "vector_proj", "d4/d68/qr__decompose_8h.html#a6d3c7dce1f142141f509d09f6c0e25dc", null ] ]; \ No newline at end of file diff --git a/d4/d68/qr__decompose_8h_source.html b/d4/d68/qr__decompose_8h_source.html index be9c256ca..231bed9d5 100644 --- a/d4/d68/qr__decompose_8h_source.html +++ b/d4/d68/qr__decompose_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: numerical_methods/qr_decompose.h Source File @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -90,230 +90,229 @@ $(document).ready(function(){initNavTree('d4/d68/qr__decompose_8h_source.html','
    -
    -
    qr_decompose.h
    +
    qr_decompose.h
    -Go to the documentation of this file.
    1 /**
    -
    2  * @file
    -
    3  * \brief Library functions to compute [QR
    -
    4  * decomposition](https://en.wikipedia.org/wiki/QR_decomposition) of a given
    -
    5  * matrix.
    -
    6  * \author [Krishna Vedala](https://github.com/kvedala)
    -
    7  */
    -
    8 
    -
    9 #ifndef NUMERICAL_METHODS_QR_DECOMPOSE_H_
    -
    10 #define NUMERICAL_METHODS_QR_DECOMPOSE_H_
    -
    11 
    -
    12 #include <cmath>
    -
    13 #include <cstdlib>
    -
    14 #include <iomanip>
    -
    15 #include <iostream>
    -
    16 #include <limits>
    -
    17 #include <numeric>
    -
    18 #include <valarray>
    -
    19 #ifdef _OPENMP
    -
    20 #include <omp.h>
    -
    21 #endif
    -
    22 
    -
    23 /** \namespace qr_algorithm
    -
    24  * \brief Functions to compute [QR
    -
    25  * decomposition](https://en.wikipedia.org/wiki/QR_decomposition) of any
    -
    26  * rectangular matrix
    -
    27  */
    -
    28 namespace qr_algorithm {
    -
    29 /**
    -
    30  * operator to print a matrix
    -
    31  */
    -
    32 template <typename T>
    - -
    34  std::valarray<std::valarray<T>> const &v) {
    -
    35  const int width = 12;
    -
    36  const char separator = ' ';
    -
    37 
    -
    38  out.precision(4);
    -
    39  for (size_t row = 0; row < v.size(); row++) {
    -
    40  for (size_t col = 0; col < v[row].size(); col++)
    -
    41  out << std::right << std::setw(width) << std::setfill(separator)
    -
    42  << v[row][col];
    -
    43  out << std::endl;
    -
    44  }
    -
    45 
    -
    46  return out;
    -
    47 }
    -
    48 
    -
    49 /**
    -
    50  * operator to print a vector
    -
    51  */
    -
    52 template <typename T>
    - -
    54  const int width = 10;
    -
    55  const char separator = ' ';
    -
    56 
    -
    57  out.precision(4);
    -
    58  for (size_t row = 0; row < v.size(); row++) {
    -
    59  out << std::right << std::setw(width) << std::setfill(separator)
    -
    60  << v[row];
    -
    61  }
    -
    62 
    -
    63  return out;
    -
    64 }
    -
    65 
    -
    66 /**
    -
    67  * Compute dot product of two vectors of equal lengths
    -
    68  *
    -
    69  * If \f$\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\f$ and
    -
    70  * \f$\vec{b}=\left[b_0,b_1,b_1,...,b_L\right]\f$ then
    -
    71  * \f$\vec{a}\cdot\vec{b}=\displaystyle\sum_{i=0}^L a_i\times b_i\f$
    -
    72  *
    -
    73  * \returns \f$\vec{a}\cdot\vec{b}\f$
    -
    74  */
    -
    75 template <typename T>
    -
    76 inline double vector_dot(const std::valarray<T> &a, const std::valarray<T> &b) {
    -
    77  return (a * b).sum();
    -
    78  // could also use following
    -
    79  // return std::inner_product(std::begin(a), std::end(a), std::begin(b),
    -
    80  // 0.f);
    -
    81 }
    -
    82 
    -
    83 /**
    -
    84  * Compute magnitude of vector.
    -
    85  *
    -
    86  * If \f$\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\f$ then
    -
    87  * \f$\left|\vec{a}\right|=\sqrt{\displaystyle\sum_{i=0}^L a_i^2}\f$
    -
    88  *
    -
    89  * \returns \f$\left|\vec{a}\right|\f$
    -
    90  */
    -
    91 template <typename T>
    -
    92 inline double vector_mag(const std::valarray<T> &a) {
    -
    93  double dot = vector_dot(a, a);
    -
    94  return std::sqrt(dot);
    -
    95 }
    -
    96 
    -
    97 /**
    -
    98  * Compute projection of vector \f$\vec{a}\f$ on \f$\vec{b}\f$ defined as
    -
    99  * \f[\text{proj}_\vec{b}\vec{a}=\frac{\vec{a}\cdot\vec{b}}{\left|\vec{b}\right|^2}\vec{b}\f]
    -
    100  *
    -
    101  * \returns NULL if error, otherwise pointer to output
    -
    102  */
    -
    103 template <typename T>
    - -
    105  const std::valarray<T> &b) {
    -
    106  double num = vector_dot(a, b);
    -
    107  double deno = vector_dot(b, b);
    -
    108 
    -
    109  /*! check for division by zero using machine epsilon */
    -
    110  if (deno <= std::numeric_limits<double>::epsilon()) {
    -
    111  std::cerr << "[" << __func__ << "] Possible division by zero\n";
    -
    112  return a; // return vector a back
    -
    113  }
    -
    114 
    -
    115  double scalar = num / deno;
    -
    116 
    -
    117  return b * scalar;
    -
    118 }
    -
    119 
    -
    120 /**
    -
    121  * Decompose matrix \f$A\f$ using [Gram-Schmidt
    -
    122  *process](https://en.wikipedia.org/wiki/QR_decomposition).
    -
    123  *
    -
    124  * \f{eqnarray*}{
    -
    125  * \text{given that}\quad A &=&
    -
    126  *\left[\mathbf{a}_1,\mathbf{a}_2,\ldots,\mathbf{a}_{N-1},\right]\\
    -
    127  * \text{where}\quad\mathbf{a}_i &=&
    -
    128  * \left[a_{0i},a_{1i},a_{2i},\ldots,a_{(M-1)i}\right]^T\quad\ldots\mbox{(column
    -
    129  * vectors)}\\
    -
    130  * \text{then}\quad\mathbf{u}_i &=& \mathbf{a}_i
    -
    131  *-\sum_{j=0}^{i-1}\text{proj}_{\mathbf{u}_j}\mathbf{a}_i\\
    -
    132  * \mathbf{e}_i &=&\frac{\mathbf{u}_i}{\left|\mathbf{u}_i\right|}\\
    -
    133  * Q &=& \begin{bmatrix}\mathbf{e}_0 & \mathbf{e}_1 & \mathbf{e}_2 & \dots &
    -
    134  * \mathbf{e}_{N-1}\end{bmatrix}\\
    -
    135  * R &=& \begin{bmatrix}\langle\mathbf{e}_0\,,\mathbf{a}_0\rangle &
    -
    136  * \langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
    -
    137  * \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots \\
    -
    138  * 0 & \langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
    -
    139  * \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\
    -
    140  * 0 & 0 & \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle &
    -
    141  * \dots\\ \vdots & \vdots & \vdots & \ddots
    -
    142  * \end{bmatrix}\\
    -
    143  * \f}
    -
    144  */
    -
    145 template <typename T>
    - -
    147  const std::valarray<std::valarray<T>> &A, /**< input matrix to decompose */
    -
    148  std::valarray<std::valarray<T>> *Q, /**< output decomposed matrix */
    -
    149  std::valarray<std::valarray<T>> *R /**< output decomposed matrix */
    -
    150 ) {
    -
    151  std::size_t ROWS = A.size(); // number of rows of A
    -
    152  std::size_t COLUMNS = A[0].size(); // number of columns of A
    -
    153  std::valarray<T> col_vector(ROWS);
    -
    154  std::valarray<T> col_vector2(ROWS);
    -
    155  std::valarray<T> tmp_vector(ROWS);
    -
    156 
    -
    157  for (int i = 0; i < COLUMNS; i++) {
    -
    158  /* for each column => R is a square matrix of NxN */
    -
    159  int j;
    -
    160  R[0][i] = 0.; /* make R upper triangular */
    -
    161 
    -
    162  /* get corresponding Q vector */
    -
    163 #ifdef _OPENMP
    -
    164 // parallelize on threads
    -
    165 #pragma omp for
    -
    166 #endif
    -
    167  for (j = 0; j < ROWS; j++) {
    -
    168  tmp_vector[j] = A[j][i]; /* accumulator for uk */
    -
    169  col_vector[j] = A[j][i];
    -
    170  }
    -
    171  for (j = 0; j < i; j++) {
    -
    172  for (int k = 0; k < ROWS; k++) {
    -
    173  col_vector2[k] = Q[0][k][j];
    -
    174  }
    -
    175  col_vector2 = vector_proj(col_vector, col_vector2);
    -
    176  tmp_vector -= col_vector2;
    -
    177  }
    -
    178 
    -
    179  double mag = vector_mag(tmp_vector);
    -
    180 
    -
    181 #ifdef _OPENMP
    -
    182 // parallelize on threads
    -
    183 #pragma omp for
    -
    184 #endif
    -
    185  for (j = 0; j < ROWS; j++) Q[0][j][i] = tmp_vector[j] / mag;
    -
    186 
    -
    187  /* compute upper triangular values of R */
    -
    188 #ifdef _OPENMP
    -
    189 // parallelize on threads
    -
    190 #pragma omp for
    -
    191 #endif
    -
    192  for (int kk = 0; kk < ROWS; kk++) {
    -
    193  col_vector[kk] = Q[0][kk][i];
    -
    194  }
    -
    195 
    -
    196 #ifdef _OPENMP
    -
    197 // parallelize on threads
    -
    198 #pragma omp for
    -
    199 #endif
    -
    200  for (int k = i; k < COLUMNS; k++) {
    -
    201  for (int kk = 0; kk < ROWS; kk++) {
    -
    202  col_vector2[kk] = A[kk][k];
    -
    203  }
    -
    204  R[0][i][k] = (col_vector * col_vector2).sum();
    -
    205  }
    -
    206  }
    -
    207 }
    -
    208 } // namespace qr_algorithm
    -
    209 
    -
    210 #endif // NUMERICAL_METHODS_QR_DECOMPOSE_H_
    +Go to the documentation of this file.
    1/**
    +
    2 * @file
    +
    3 * \brief Library functions to compute [QR
    +
    4 * decomposition](https://en.wikipedia.org/wiki/QR_decomposition) of a given
    +
    5 * matrix.
    +
    6 * \author [Krishna Vedala](https://github.com/kvedala)
    +
    7 */
    +
    8
    +
    9#ifndef NUMERICAL_METHODS_QR_DECOMPOSE_H_
    +
    10#define NUMERICAL_METHODS_QR_DECOMPOSE_H_
    +
    11
    +
    12#include <cmath>
    +
    13#include <cstdlib>
    +
    14#include <iomanip>
    +
    15#include <iostream>
    +
    16#include <limits>
    +
    17#include <numeric>
    +
    18#include <valarray>
    +
    19#ifdef _OPENMP
    +
    20#include <omp.h>
    +
    21#endif
    +
    22
    +
    23/** \namespace qr_algorithm
    +
    24 * \brief Functions to compute [QR
    +
    25 * decomposition](https://en.wikipedia.org/wiki/QR_decomposition) of any
    +
    26 * rectangular matrix
    +
    27 */
    +
    28namespace qr_algorithm {
    +
    29/**
    +
    30 * operator to print a matrix
    +
    31 */
    +
    32template <typename T>
    + + +
    35 const int width = 12;
    +
    36 const char separator = ' ';
    +
    37
    +
    38 out.precision(4);
    +
    39 for (size_t row = 0; row < v.size(); row++) {
    +
    40 for (size_t col = 0; col < v[row].size(); col++)
    +
    41 out << std::right << std::setw(width) << std::setfill(separator)
    +
    42 << v[row][col];
    +
    43 out << std::endl;
    +
    44 }
    +
    45
    +
    46 return out;
    +
    47}
    +
    48
    +
    49/**
    +
    50 * operator to print a vector
    +
    51 */
    +
    52template <typename T>
    + +
    54 const int width = 10;
    +
    55 const char separator = ' ';
    +
    56
    +
    57 out.precision(4);
    +
    58 for (size_t row = 0; row < v.size(); row++) {
    +
    59 out << std::right << std::setw(width) << std::setfill(separator)
    +
    60 << v[row];
    +
    61 }
    +
    62
    +
    63 return out;
    +
    64}
    +
    65
    +
    66/**
    +
    67 * Compute dot product of two vectors of equal lengths
    +
    68 *
    +
    69 * If \f$\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\f$ and
    +
    70 * \f$\vec{b}=\left[b_0,b_1,b_1,...,b_L\right]\f$ then
    +
    71 * \f$\vec{a}\cdot\vec{b}=\displaystyle\sum_{i=0}^L a_i\times b_i\f$
    +
    72 *
    +
    73 * \returns \f$\vec{a}\cdot\vec{b}\f$
    +
    74 */
    +
    75template <typename T>
    +
    76inline double vector_dot(const std::valarray<T> &a, const std::valarray<T> &b) {
    +
    77 return (a * b).sum();
    +
    78 // could also use following
    +
    79 // return std::inner_product(std::begin(a), std::end(a), std::begin(b),
    +
    80 // 0.f);
    +
    81}
    +
    82
    +
    83/**
    +
    84 * Compute magnitude of vector.
    +
    85 *
    +
    86 * If \f$\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\f$ then
    +
    87 * \f$\left|\vec{a}\right|=\sqrt{\displaystyle\sum_{i=0}^L a_i^2}\f$
    +
    88 *
    +
    89 * \returns \f$\left|\vec{a}\right|\f$
    +
    90 */
    +
    91template <typename T>
    +
    92inline double vector_mag(const std::valarray<T> &a) {
    +
    93 double dot = vector_dot(a, a);
    +
    94 return std::sqrt(dot);
    +
    95}
    +
    96
    +
    97/**
    +
    98 * Compute projection of vector \f$\vec{a}\f$ on \f$\vec{b}\f$ defined as
    +
    99 * \f[\text{proj}_\vec{b}\vec{a}=\frac{\vec{a}\cdot\vec{b}}{\left|\vec{b}\right|^2}\vec{b}\f]
    +
    100 *
    +
    101 * \returns NULL if error, otherwise pointer to output
    +
    102 */
    +
    103template <typename T>
    + +
    105 const std::valarray<T> &b) {
    +
    106 double num = vector_dot(a, b);
    +
    107 double deno = vector_dot(b, b);
    +
    108
    +
    109 /*! check for division by zero using machine epsilon */
    + +
    111 std::cerr << "[" << __func__ << "] Possible division by zero\n";
    +
    112 return a; // return vector a back
    +
    113 }
    +
    114
    +
    115 double scalar = num / deno;
    +
    116
    +
    117 return b * scalar;
    +
    118}
    +
    119
    +
    120/**
    +
    121 * Decompose matrix \f$A\f$ using [Gram-Schmidt
    +
    122 *process](https://en.wikipedia.org/wiki/QR_decomposition).
    +
    123 *
    +
    124 * \f{eqnarray*}{
    +
    125 * \text{given that}\quad A &=&
    +
    126 *\left[\mathbf{a}_1,\mathbf{a}_2,\ldots,\mathbf{a}_{N-1},\right]\\
    +
    127 * \text{where}\quad\mathbf{a}_i &=&
    +
    128 * \left[a_{0i},a_{1i},a_{2i},\ldots,a_{(M-1)i}\right]^T\quad\ldots\mbox{(column
    +
    129 * vectors)}\\
    +
    130 * \text{then}\quad\mathbf{u}_i &=& \mathbf{a}_i
    +
    131 *-\sum_{j=0}^{i-1}\text{proj}_{\mathbf{u}_j}\mathbf{a}_i\\
    +
    132 * \mathbf{e}_i &=&\frac{\mathbf{u}_i}{\left|\mathbf{u}_i\right|}\\
    +
    133 * Q &=& \begin{bmatrix}\mathbf{e}_0 & \mathbf{e}_1 & \mathbf{e}_2 & \dots &
    +
    134 * \mathbf{e}_{N-1}\end{bmatrix}\\
    +
    135 * R &=& \begin{bmatrix}\langle\mathbf{e}_0\,,\mathbf{a}_0\rangle &
    +
    136 * \langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
    +
    137 * \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots \\
    +
    138 * 0 & \langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
    +
    139 * \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\
    +
    140 * 0 & 0 & \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle &
    +
    141 * \dots\\ \vdots & \vdots & \vdots & \ddots
    +
    142 * \end{bmatrix}\\
    +
    143 * \f}
    +
    144 */
    +
    145template <typename T>
    + +
    147 const std::valarray<std::valarray<T>> &A, /**< input matrix to decompose */
    +
    148 std::valarray<std::valarray<T>> *Q, /**< output decomposed matrix */
    +
    149 std::valarray<std::valarray<T>> *R /**< output decomposed matrix */
    +
    150) {
    +
    151 std::size_t ROWS = A.size(); // number of rows of A
    +
    152 std::size_t COLUMNS = A[0].size(); // number of columns of A
    +
    153 std::valarray<T> col_vector(ROWS);
    +
    154 std::valarray<T> col_vector2(ROWS);
    +
    155 std::valarray<T> tmp_vector(ROWS);
    +
    156
    +
    157 for (int i = 0; i < COLUMNS; i++) {
    +
    158 /* for each column => R is a square matrix of NxN */
    +
    159 int j;
    +
    160 R[0][i] = 0.; /* make R upper triangular */
    +
    161
    +
    162 /* get corresponding Q vector */
    +
    163#ifdef _OPENMP
    +
    164// parallelize on threads
    +
    165#pragma omp for
    +
    166#endif
    +
    167 for (j = 0; j < ROWS; j++) {
    +
    168 tmp_vector[j] = A[j][i]; /* accumulator for uk */
    +
    169 col_vector[j] = A[j][i];
    +
    170 }
    +
    171 for (j = 0; j < i; j++) {
    +
    172 for (int k = 0; k < ROWS; k++) {
    +
    173 col_vector2[k] = Q[0][k][j];
    +
    174 }
    +
    175 col_vector2 = vector_proj(col_vector, col_vector2);
    +
    176 tmp_vector -= col_vector2;
    +
    177 }
    +
    178
    +
    179 double mag = vector_mag(tmp_vector);
    +
    180
    +
    181#ifdef _OPENMP
    +
    182// parallelize on threads
    +
    183#pragma omp for
    +
    184#endif
    +
    185 for (j = 0; j < ROWS; j++) Q[0][j][i] = tmp_vector[j] / mag;
    +
    186
    +
    187 /* compute upper triangular values of R */
    +
    188#ifdef _OPENMP
    +
    189// parallelize on threads
    +
    190#pragma omp for
    +
    191#endif
    +
    192 for (int kk = 0; kk < ROWS; kk++) {
    +
    193 col_vector[kk] = Q[0][kk][i];
    +
    194 }
    +
    195
    +
    196#ifdef _OPENMP
    +
    197// parallelize on threads
    +
    198#pragma omp for
    +
    199#endif
    +
    200 for (int k = i; k < COLUMNS; k++) {
    +
    201 for (int kk = 0; kk < ROWS; kk++) {
    +
    202 col_vector2[kk] = A[kk][k];
    +
    203 }
    +
    204 R[0][i][k] = (col_vector * col_vector2).sum();
    +
    205 }
    +
    206 }
    +
    207}
    +
    208} // namespace qr_algorithm
    +
    209
    +
    210#endif // NUMERICAL_METHODS_QR_DECOMPOSE_H_
    T endl(T... args)
    T right(T... args)
    -
    T sum(const std::vector< std::valarray< T >> &A)
    Definition: vector_ops.hpp:232
    +
    T sum(const std::vector< std::valarray< T > > &A)
    Definition: vector_ops.hpp:232
    Functions to compute QR decomposition of any rectangular matrix.
    -
    std::valarray< T > vector_proj(const std::valarray< T > &a, const std::valarray< T > &b)
    Definition: qr_decompose.h:104
    -
    std::ostream & operator<<(std::ostream &out, std::valarray< std::valarray< T >> const &v)
    Definition: qr_decompose.h:33
    +
    std::valarray< T > vector_proj(const std::valarray< T > &a, const std::valarray< T > &b)
    Definition: qr_decompose.h:104
    +
    void qr_decompose(const std::valarray< std::valarray< T > > &A, std::valarray< std::valarray< T > > *Q, std::valarray< std::valarray< T > > *R)
    Definition: qr_decompose.h:146
    double vector_dot(const std::valarray< T > &a, const std::valarray< T > &b)
    Definition: qr_decompose.h:76
    -
    void qr_decompose(const std::valarray< std::valarray< T >> &A, std::valarray< std::valarray< T >> *Q, std::valarray< std::valarray< T >> *R)
    Definition: qr_decompose.h:146
    double vector_mag(const std::valarray< T > &a)
    Definition: qr_decompose.h:92
    +
    std::ostream & operator<<(std::ostream &out, std::valarray< std::valarray< T > > const &v)
    Definition: qr_decompose.h:33
    T precision(T... args)
    T setfill(T... args)
    @@ -327,7 +326,7 @@ $(document).ready(function(){initNavTree('d4/d68/qr__decompose_8h_source.html',' diff --git a/d4/d72/qr__eigen__values_8cpp__incl.svg b/d4/d72/qr__eigen__values_8cpp__incl.svg index e1a5c3031..2ba3d31ba 100644 --- a/d4/d72/qr__eigen__values_8cpp__incl.svg +++ b/d4/d72/qr__eigen__values_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: sorting/shell_sort2.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d4/d7a/shell__sort2_8cpp.html','../../ -
    -
    shell_sort2.cpp File Reference
    +
    shell_sort2.cpp File Reference
    -

    Shell sort algorithm +

    Shell sort algorithm More...

    #include <cassert>
    #include <cstdlib>
    @@ -113,13 +112,13 @@ Include dependency graph for shell_sort2.cpp:
    - - +

    +

    Namespaces

     sorting
    namespace  sorting
     Sorting algorithms.
     
    - @@ -147,10 +146,10 @@ Functions

    +

    Functions

    template<class T >
    void show_data (T *arr, size_t LEN)
     

    Detailed Description

    -

    Shell sort algorithm

    -
    Author
    Krishna Vedala
    +

    Shell sort algorithm

    +
    Author
    Krishna Vedala

    Function Documentation

    - +

    ◆ compare()

    @@ -177,24 +176,24 @@ template<typename T >
    -

    function to compare sorting using cstdlib's qsort

    -
    87  {
    -
    88  T arg1 = *static_cast<const T *>(a);
    -
    89  T arg2 = *static_cast<const T *>(b);
    -
    90 
    -
    91  if (arg1 < arg2)
    -
    92  return -1;
    -
    93  if (arg1 > arg2)
    -
    94  return 1;
    -
    95  return 0;
    -
    96 
    -
    97  // return (arg1 > arg2) - (arg1 < arg2); // possible shortcut
    -
    98  // return arg1 - arg2; // erroneous shortcut (fails if INT_MIN is present)
    -
    99 }
    +

    function to compare sorting using cstdlib's qsort

    +
    87 {
    +
    88 T arg1 = *static_cast<const T *>(a);
    +
    89 T arg2 = *static_cast<const T *>(b);
    +
    90
    +
    91 if (arg1 < arg2)
    +
    92 return -1;
    +
    93 if (arg1 > arg2)
    +
    94 return 1;
    +
    95 return 0;
    +
    96
    +
    97 // return (arg1 > arg2) - (arg1 < arg2); // possible shortcut
    +
    98 // return arg1 - arg2; // erroneous shortcut (fails if INT_MIN is present)
    +
    99}
    - +

    ◆ main()

    @@ -219,59 +218,59 @@ template<typename T >
    -

    Main function

    -
    183  {
    -
    184  // initialize random number generator - once per program
    -
    185  std::srand(std::time(NULL));
    -
    186 
    -
    187  test_int(100); // test with sorting random array of 100 values
    -
    188  std::cout << "Test 1 - 100 int values - passed. \n";
    -
    189  test_int(1000); // test with sorting random array of 1000 values
    -
    190  std::cout << "Test 2 - 1000 int values - passed.\n";
    -
    191  test_int(10000); // test with sorting random array of 10000 values
    -
    192  std::cout << "Test 3 - 10000 int values - passed.\n";
    -
    193 
    -
    194  test_f(100); // test with sorting random array of 100 values
    -
    195  std::cout << "Test 1 - 100 float values - passed. \n";
    -
    196  test_f(1000); // test with sorting random array of 1000 values
    -
    197  std::cout << "Test 2 - 1000 float values - passed.\n";
    -
    198  test_f(10000); // test with sorting random array of 10000 values
    -
    199  std::cout << "Test 3 - 10000 float values - passed.\n";
    -
    200 
    -
    201  int i, NUM_DATA;
    -
    202 
    -
    203  if (argc == 2)
    -
    204  NUM_DATA = atoi(argv[1]);
    -
    205  else
    -
    206  NUM_DATA = 200;
    -
    207 
    -
    208  // int array = new int[NUM_DATA];
    -
    209  int *data = new int[NUM_DATA];
    -
    210  // int array2 = new int[NUM_DATA];
    -
    211  int range = 1800;
    -
    212 
    -
    213  std::srand(time(NULL));
    -
    214  for (i = 0; i < NUM_DATA; i++) {
    -
    215  // allocate random numbers in the given range
    -
    216  data[i] = (std::rand() % range) - (range >> 1);
    -
    217  }
    -
    218 
    -
    219  std::cout << "Unsorted original data: " << std::endl;
    -
    220  show_data(data, NUM_DATA);
    -
    221  std::clock_t start = std::clock();
    -
    222  shell_sort(data, NUM_DATA); // perform sorting
    - -
    224 
    - -
    226  << "Data Sorted using custom implementation: " << std::endl;
    -
    227  show_data(data, NUM_DATA);
    -
    228 
    -
    229  double elapsed_time = (end - start) * 1.f / CLOCKS_PER_SEC;
    -
    230  std::cout << "Time spent sorting: " << elapsed_time << "s\n" << std::endl;
    -
    231 
    -
    232  delete[] data;
    -
    233  return 0;
    -
    234 }
    +

    Main function

    +
    183 {
    +
    184 // initialize random number generator - once per program
    +
    185 std::srand(std::time(NULL));
    +
    186
    +
    187 test_int(100); // test with sorting random array of 100 values
    +
    188 std::cout << "Test 1 - 100 int values - passed. \n";
    +
    189 test_int(1000); // test with sorting random array of 1000 values
    +
    190 std::cout << "Test 2 - 1000 int values - passed.\n";
    +
    191 test_int(10000); // test with sorting random array of 10000 values
    +
    192 std::cout << "Test 3 - 10000 int values - passed.\n";
    +
    193
    +
    194 test_f(100); // test with sorting random array of 100 values
    +
    195 std::cout << "Test 1 - 100 float values - passed. \n";
    +
    196 test_f(1000); // test with sorting random array of 1000 values
    +
    197 std::cout << "Test 2 - 1000 float values - passed.\n";
    +
    198 test_f(10000); // test with sorting random array of 10000 values
    +
    199 std::cout << "Test 3 - 10000 float values - passed.\n";
    +
    200
    +
    201 int i, NUM_DATA;
    +
    202
    +
    203 if (argc == 2)
    +
    204 NUM_DATA = atoi(argv[1]);
    +
    205 else
    +
    206 NUM_DATA = 200;
    +
    207
    +
    208 // int array = new int[NUM_DATA];
    +
    209 int *data = new int[NUM_DATA];
    +
    210 // int array2 = new int[NUM_DATA];
    +
    211 int range = 1800;
    +
    212
    +
    213 std::srand(time(NULL));
    +
    214 for (i = 0; i < NUM_DATA; i++) {
    +
    215 // allocate random numbers in the given range
    +
    216 data[i] = (std::rand() % range) - (range >> 1);
    +
    217 }
    +
    218
    +
    219 std::cout << "Unsorted original data: " << std::endl;
    +
    220 show_data(data, NUM_DATA);
    +
    221 std::clock_t start = std::clock();
    +
    222 shell_sort(data, NUM_DATA); // perform sorting
    + +
    224
    + +
    226 << "Data Sorted using custom implementation: " << std::endl;
    +
    227 show_data(data, NUM_DATA);
    +
    228
    +
    229 double elapsed_time = (end - start) * 1.f / CLOCKS_PER_SEC;
    +
    230 std::cout << "Time spent sorting: " << elapsed_time << "s\n" << std::endl;
    +
    231
    +
    232 delete[] data;
    +
    233 return 0;
    +
    234}
    T atoi(T... args)
    T clock(T... args)
    @@ -295,7 +294,7 @@ Here is the call graph for this function:
    - +

    ◆ show_data() [1/2]

    @@ -322,21 +321,21 @@ template<class T >
    -

    pretty print array

    Parameters
    +

    pretty print array

    Parameters
    [in]arrarray to print
    [in]LENlength of array to print
    -
    18  {
    -
    19  size_t i;
    -
    20 
    -
    21  for (i = 0; i < LEN; i++) {
    -
    22  std::cout << arr[i] << ", ";
    -
    23  }
    - -
    25 }
    +
    18 {
    +
    19 size_t i;
    +
    20
    +
    21 for (i = 0; i < LEN; i++) {
    +
    22 std::cout << arr[i] << ", ";
    +
    23 }
    + +
    25}
    Here is the call graph for this function:
    @@ -346,7 +345,7 @@ Here is the call graph for this function:
    - +

    ◆ show_data() [2/2]

    @@ -363,16 +362,16 @@ template<typename T , size_t N>
    -

    pretty print array

    Parameters
    +

    pretty print array

    Parameters
    [in]arrarray to print
    [in]Nlength of array to print
    -
    32  {
    -
    33  show_data(arr, N);
    -
    34 }
    +
    32 {
    +
    33 show_data(arr, N);
    +
    34}
    Here is the call graph for this function:
    @@ -382,7 +381,7 @@ Here is the call graph for this function:
    - +

    ◆ test_f()

    @@ -397,43 +396,43 @@ Here is the call graph for this function:
    -

    Test implementation of shell_sort on float arrays by comparing results against std::qsort.

    -
    145  {
    -
    146  // int array = new int[NUM_DATA];
    -
    147  float *data = new float[NUM_DATA];
    -
    148  float *data2 = new float[NUM_DATA];
    -
    149  // int array2 = new int[NUM_DATA];
    -
    150  int range = 1000;
    -
    151 
    -
    152  for (int i = 0; i < NUM_DATA; i++) {
    -
    153  data[i] = data2[i] = ((std::rand() % range) - (range >> 1)) / 100.;
    -
    154  }
    -
    155 
    -
    156  /* sort using our implementation */
    -
    157  std::clock_t start = std::clock();
    -
    158  shell_sort(data, NUM_DATA);
    - -
    160  double elapsed_time = static_cast<double>(end - start) / CLOCKS_PER_SEC;
    -
    161  std::cout << "Time spent sorting using shell_sort2: " << elapsed_time
    -
    162  << "s\n";
    -
    163 
    -
    164  /* sort using std::qsort */
    -
    165  start = std::clock();
    -
    166  std::qsort(data2, NUM_DATA, sizeof(data2[0]), compare<float>);
    -
    167  end = std::clock();
    -
    168 
    -
    169  elapsed_time = static_cast<double>(end - start) / CLOCKS_PER_SEC;
    -
    170  std::cout << "Time spent sorting using std::qsort: " << elapsed_time
    -
    171  << "s\n";
    -
    172 
    -
    173  for (int i = 0; i < NUM_DATA; i++) {
    -
    174  assert(data[i] == data2[i]); // ensure that our sorting results match
    -
    175  // the standard results
    -
    176  }
    -
    177 
    -
    178  delete[] data;
    -
    179  delete[] data2;
    -
    180 }
    +

    Test implementation of shell_sort on float arrays by comparing results against std::qsort.

    +
    145 {
    +
    146 // int array = new int[NUM_DATA];
    +
    147 float *data = new float[NUM_DATA];
    +
    148 float *data2 = new float[NUM_DATA];
    +
    149 // int array2 = new int[NUM_DATA];
    +
    150 int range = 1000;
    +
    151
    +
    152 for (int i = 0; i < NUM_DATA; i++) {
    +
    153 data[i] = data2[i] = ((std::rand() % range) - (range >> 1)) / 100.;
    +
    154 }
    +
    155
    +
    156 /* sort using our implementation */
    +
    157 std::clock_t start = std::clock();
    +
    158 shell_sort(data, NUM_DATA);
    + +
    160 double elapsed_time = static_cast<double>(end - start) / CLOCKS_PER_SEC;
    +
    161 std::cout << "Time spent sorting using shell_sort2: " << elapsed_time
    +
    162 << "s\n";
    +
    163
    +
    164 /* sort using std::qsort */
    +
    165 start = std::clock();
    +
    166 std::qsort(data2, NUM_DATA, sizeof(data2[0]), compare<float>);
    +
    167 end = std::clock();
    +
    168
    +
    169 elapsed_time = static_cast<double>(end - start) / CLOCKS_PER_SEC;
    +
    170 std::cout << "Time spent sorting using std::qsort: " << elapsed_time
    +
    171 << "s\n";
    +
    172
    +
    173 for (int i = 0; i < NUM_DATA; i++) {
    +
    174 assert(data[i] == data2[i]); // ensure that our sorting results match
    +
    175 // the standard results
    +
    176 }
    +
    177
    +
    178 delete[] data;
    +
    179 delete[] data2;
    +
    180}
    T qsort(T... args)
    Definition: huffman.cpp:28
    @@ -445,7 +444,7 @@ Here is the call graph for this function:
    - +

    ◆ test_int()

    @@ -460,42 +459,42 @@ Here is the call graph for this function:
    -

    Test implementation of shell_sort on integer arrays by comparing results against std::qsort.

    -
    105  {
    -
    106  // int array = new int[NUM_DATA];
    -
    107  int *data = new int[NUM_DATA];
    -
    108  int *data2 = new int[NUM_DATA];
    -
    109  // int array2 = new int[NUM_DATA];
    -
    110  int range = 1800;
    -
    111 
    -
    112  for (int i = 0; i < NUM_DATA; i++)
    -
    113  data[i] = data2[i] = (std::rand() % range) - (range >> 1);
    -
    114 
    -
    115  /* sort using our implementation */
    -
    116  std::clock_t start = std::clock();
    -
    117  shell_sort(data, NUM_DATA);
    - -
    119  double elapsed_time = static_cast<double>(end - start) / CLOCKS_PER_SEC;
    -
    120  std::cout << "Time spent sorting using shell_sort2: " << elapsed_time
    -
    121  << "s\n";
    -
    122 
    -
    123  /* sort using std::qsort */
    -
    124  start = std::clock();
    -
    125  std::qsort(data2, NUM_DATA, sizeof(data2[0]), compare<int>);
    -
    126  end = std::clock();
    -
    127 
    -
    128  elapsed_time = static_cast<double>(end - start) / CLOCKS_PER_SEC;
    -
    129  std::cout << "Time spent sorting using std::qsort: " << elapsed_time
    -
    130  << "s\n";
    -
    131 
    -
    132  for (int i = 0; i < NUM_DATA; i++) {
    -
    133  assert(data[i] == data2[i]); // ensure that our sorting results match
    -
    134  // the standard results
    -
    135  }
    -
    136 
    -
    137  delete[] data;
    -
    138  delete[] data2;
    -
    139 }
    +

    Test implementation of shell_sort on integer arrays by comparing results against std::qsort.

    +
    105 {
    +
    106 // int array = new int[NUM_DATA];
    +
    107 int *data = new int[NUM_DATA];
    +
    108 int *data2 = new int[NUM_DATA];
    +
    109 // int array2 = new int[NUM_DATA];
    +
    110 int range = 1800;
    +
    111
    +
    112 for (int i = 0; i < NUM_DATA; i++)
    +
    113 data[i] = data2[i] = (std::rand() % range) - (range >> 1);
    +
    114
    +
    115 /* sort using our implementation */
    +
    116 std::clock_t start = std::clock();
    +
    117 shell_sort(data, NUM_DATA);
    + +
    119 double elapsed_time = static_cast<double>(end - start) / CLOCKS_PER_SEC;
    +
    120 std::cout << "Time spent sorting using shell_sort2: " << elapsed_time
    +
    121 << "s\n";
    +
    122
    +
    123 /* sort using std::qsort */
    +
    124 start = std::clock();
    +
    125 std::qsort(data2, NUM_DATA, sizeof(data2[0]), compare<int>);
    +
    126 end = std::clock();
    +
    127
    +
    128 elapsed_time = static_cast<double>(end - start) / CLOCKS_PER_SEC;
    +
    129 std::cout << "Time spent sorting using std::qsort: " << elapsed_time
    +
    130 << "s\n";
    +
    131
    +
    132 for (int i = 0; i < NUM_DATA; i++) {
    +
    133 assert(data[i] == data2[i]); // ensure that our sorting results match
    +
    134 // the standard results
    +
    135 }
    +
    136
    +
    137 delete[] data;
    +
    138 delete[] data2;
    +
    139}
    Here is the call graph for this function:
    @@ -511,7 +510,7 @@ Here is the call graph for this function:
    diff --git a/d4/d7a/shell__sort2_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d4/d7a/shell__sort2_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg index 66fbe82a6..63b31b474 100644 --- a/d4/d7a/shell__sort2_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg +++ b/d4/d7a/shell__sort2_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - + + Algorithms_in_C++: math/sum_of_digits.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d4/d83/sum__of__digits_8cpp.html','../
    -
    -
    sum_of_digits.cpp File Reference
    +
    sum_of_digits.cpp File Reference
    @@ -108,7 +107,7 @@ Include dependency graph for sum_of_digits.cpp:
    - @@ -122,10 +121,10 @@ Functions

    +

    Functions

    int sum_of_digits (int num)
     
     

    Detailed Description

    -

    A C++ Program to find the Sum of Digits of input integer.

    -

    Copyright 2020

    Author
    iamnambiar
    +

    A C++ Program to find the Sum of Digits of input integer.

    +

    Copyright 2020

    Author
    iamnambiar

    Function Documentation

    - +

    ◆ main()

    @@ -140,12 +139,12 @@ Functions
    -

    Main Function

    -
    68  {
    -
    69  test();
    -
    70  std::cout << "Success." << std::endl;
    -
    71  return 0;
    -
    72 }
    +

    Main Function

    +
    68 {
    +
    69 test();
    +
    70 std::cout << "Success." << std::endl;
    +
    71 return 0;
    +
    72}
    T endl(T... args)
    void test()
    Definition: sum_of_digits.cpp:58
    @@ -158,7 +157,7 @@ Here is the call graph for this function:
    - +

    ◆ sum_of_digits()

    @@ -173,7 +172,7 @@ Here is the call graph for this function:
    -

    Function to find the sum of the digits of an integer.

    Parameters
    +

    Function to find the sum of the digits of an integer.

    Parameters
    numThe integer.
    @@ -181,19 +180,19 @@ Here is the call graph for this function:
    Returns
    Sum of the digits of the integer.

    \detail First the algorithm check whether the num is negative or positive, if it is negative, then we neglect the negative sign. Next, the algorithm extract the last digit of num by dividing by 10 and extracting the remainder and this is added to the sum. The number is then divided by 10 to remove the last digit. This loop continues until num becomes 0.

    -
    23  {
    -
    24  // If num is negative then negative sign is neglected.
    -
    25  if (num < 0) {
    -
    26  num = -1 * num;
    -
    27  }
    -
    28  int sum = 0;
    -
    29  while (num > 0) {
    -
    30  sum = sum + (num % 10);
    -
    31  num = num / 10;
    -
    32  }
    -
    33  return sum;
    -
    34 }
    -
    T sum(const std::vector< std::valarray< T >> &A)
    Definition: vector_ops.hpp:232
    +
    23 {
    +
    24 // If num is negative then negative sign is neglected.
    +
    25 if (num < 0) {
    +
    26 num = -1 * num;
    +
    27 }
    +
    28 int sum = 0;
    +
    29 while (num > 0) {
    +
    30 sum = sum + (num % 10);
    +
    31 num = num / 10;
    +
    32 }
    +
    33 return sum;
    +
    34}
    +
    T sum(const std::vector< std::valarray< T > > &A)
    Definition: vector_ops.hpp:232
    Here is the call graph for this function:
    @@ -203,7 +202,7 @@ Here is the call graph for this function:
    - +

    ◆ test()

    @@ -217,13 +216,13 @@ Here is the call graph for this function:
    -

    Function for testing the sum_of_digits() with all the test cases.

    -
    58  {
    -
    59  // First test.
    -
    60  test1();
    -
    61  // Second test.
    -
    62  test2();
    -
    63 }
    +

    Function for testing the sum_of_digits() with all the test cases.

    +
    58 {
    +
    59 // First test.
    +
    60 test1();
    +
    61 // Second test.
    +
    62 test2();
    +
    63}
    void test2()
    Definition: sum_of_digits.cpp:49
    void test1()
    Definition: sum_of_digits.cpp:40
    @@ -235,7 +234,7 @@ Here is the call graph for this function:
    - +

    ◆ test1()

    @@ -249,11 +248,11 @@ Here is the call graph for this function:
    -

    Function for testing the sum_of_digits() function with a first test case of 119765 and assert statement.

    -
    40  {
    -
    41  int test_case_1 = sum_of_digits(119765);
    -
    42  assert(test_case_1 == 29);
    -
    43 }
    +

    Function for testing the sum_of_digits() function with a first test case of 119765 and assert statement.

    +
    40 {
    +
    41 int test_case_1 = sum_of_digits(119765);
    +
    42 assert(test_case_1 == 29);
    +
    43}
    int sum_of_digits(int num)
    Definition: sum_of_digits.cpp:23
    Here is the call graph for this function:
    @@ -264,7 +263,7 @@ Here is the call graph for this function:
    - +

    ◆ test2()

    @@ -278,11 +277,11 @@ Here is the call graph for this function:
    -

    Function for testing the sum_of_digits() function with a second test case of -12256 and assert statement.

    -
    49  {
    -
    50  int test_case_2 = sum_of_digits(-12256);
    -
    51  assert(test_case_2 == 16);
    -
    52 }
    +

    Function for testing the sum_of_digits() function with a second test case of -12256 and assert statement.

    +
    49 {
    +
    50 int test_case_2 = sum_of_digits(-12256);
    +
    51 assert(test_case_2 == 16);
    +
    52}
    Here is the call graph for this function:
    @@ -298,7 +297,7 @@ Here is the call graph for this function:
    diff --git a/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map b/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map index bdbc8ea58..8f3d50d8b 100644 --- a/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map +++ b/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 b/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 index ca0c7e38c..6dd67b139 100644 --- a/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 +++ b/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 @@ -1 +1 @@ -fe84adc1328d400082a06b4d6b5752cf \ No newline at end of file +11f2613d8640e598fc4ace10b35036de \ No newline at end of file diff --git a/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg b/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg index fb86f8927..ec406bc91 100644 --- a/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg +++ b/d4/d83/sum__of__digits_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + machine_learning::sum diff --git a/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map b/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map index 59982d3e6..966c87ea1 100644 --- a/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map +++ b/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 b/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 index 9b5b80f90..0ba3baa54 100644 --- a/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 +++ b/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 @@ -1 +1 @@ -cfd4687a0a8b92a2c95f8040f6047729 \ No newline at end of file +fb9627fd7fb56b4667bf1f50c7b8d11d \ No newline at end of file diff --git a/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg b/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg index 2961abebd..52997db14 100644 --- a/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg +++ b/d4/d83/sum__of__digits_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + machine_learning::sum diff --git a/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.map b/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.map index 8016a04cd..6e2e6979e 100644 --- a/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.map +++ b/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.md5 b/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.md5 index d72a33867..7b1be42c8 100644 --- a/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.md5 +++ b/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.md5 @@ -1 +1 @@ -099e7f436acfc5215b8d196284375da4 \ No newline at end of file +44d026fe395c16ac4251dd3f1e5c6291 \ No newline at end of file diff --git a/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.svg b/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.svg index 480d473fd..ee3a9efec 100644 --- a/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.svg +++ b/d4/d83/sum__of__digits_8cpp_a4619c78b6ad985713024f930f31c4395_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + machine_learning::sum diff --git a/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.map b/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.map index e168d7af7..1d2dcb6c4 100644 --- a/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.map +++ b/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.map @@ -3,5 +3,5 @@ - + diff --git a/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 b/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 index f060c52b9..36f9b8bb3 100644 --- a/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 +++ b/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.md5 @@ -1 +1 @@ -9007ace8abdcde5ee07264852fd81777 \ No newline at end of file +7334cad915a8d70dfd6c7444232269fd \ No newline at end of file diff --git a/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg b/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg index 0b13ff2e3..5d49fb151 100644 --- a/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg +++ b/d4/d83/sum__of__digits_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg @@ -1,7 +1,7 @@ - Node4 - + machine_learning::sum diff --git a/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index fdff7e42d..24662e3de 100644 --- a/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -5,5 +5,5 @@ - + diff --git a/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 6fa9e644a..2d9a849d3 100644 --- a/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -86b9da22b2b3a1102afd4c4b4ba12464 \ No newline at end of file +5c2e2c5e1c7d4de937235fd18418f2e1 \ No newline at end of file diff --git a/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index b64eb8f37..5a3343a0b 100644 --- a/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d4/d83/sum__of__digits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - Node6 - + machine_learning::sum diff --git a/d4/d86/large__number_8h.html b/d4/d86/large__number_8h.html index 7da3b4395..34056dae9 100644 --- a/d4/d86/large__number_8h.html +++ b/d4/d86/large__number_8h.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: math/large_number.h File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d4/d86/large__number_8h.html','../../'
    -
    -
    large_number.h File Reference
    +
    large_number.h File Reference
    @@ -121,21 +120,21 @@ This graph shows which files directly or indirectly include this file:

    Go to the source code of this file.

    -

    +

    Classes

    class  large_number
     

    Detailed Description

    -

    Library to perform arithmatic operations on arbitrarily large numbers.

    -
    Author
    Krishna Vedala
    +

    Library to perform arithmatic operations on arbitrarily large numbers.

    +
    Author
    Krishna Vedala
    diff --git a/d4/d86/large__number_8h_source.html b/d4/d86/large__number_8h_source.html index 31e15aa71..8c6d05a2d 100644 --- a/d4/d86/large__number_8h_source.html +++ b/d4/d86/large__number_8h_source.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: math/large_number.h Source File @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -90,333 +90,330 @@ $(document).ready(function(){initNavTree('d4/d86/large__number_8h_source.html','
    -
    -
    large_number.h
    +
    large_number.h
    -Go to the documentation of this file.
    1 /**
    -
    2  * @file
    -
    3  * @brief Library to perform arithmatic operations on arbitrarily large
    -
    4  * numbers.
    -
    5  * \author [Krishna Vedala](https://github.com/kvedala)
    -
    6  */
    -
    7 
    -
    8 #ifndef MATH_LARGE_NUMBER_H_
    -
    9 #define MATH_LARGE_NUMBER_H_
    -
    10 #include <algorithm>
    -
    11 #include <cassert>
    -
    12 #include <cinttypes>
    -
    13 #include <cstring>
    -
    14 #include <iostream>
    -
    15 #include <type_traits>
    -
    16 #include <vector>
    -
    17 
    -
    18 /**
    -
    19  * Store large unsigned numbers as a C++ vector
    -
    20  * The class provides convenience functions to add a
    -
    21  * digit to the number, perform multiplication of
    -
    22  * large number with long unsigned integers.
    -
    23  **/
    -
    24 class large_number {
    -
    25  public:
    -
    26  /**< initializer with value = 1 */
    - -
    28 
    -
    29  // /**< initializer from an integer */
    -
    30  // explicit large_number(uint64_t n) {
    -
    31  // uint64_t carry = n;
    -
    32  // do {
    -
    33  // add_digit(carry % 10);
    -
    34  // carry /= 10;
    -
    35  // } while (carry != 0);
    -
    36  // }
    -
    37 
    -
    38  /**< initializer from an integer */
    -
    39  explicit large_number(int n) {
    -
    40  int carry = n;
    -
    41  do {
    -
    42  add_digit(carry % 10);
    -
    43  carry /= 10;
    -
    44  } while (carry != 0);
    -
    45  }
    -
    46 
    -
    47  /**< initializer from another large_number */
    - -
    49 
    -
    50  /**< initializer from a vector */
    - -
    52 
    -
    53  /**< initializer from a string */
    -
    54  explicit large_number(char const *number_str) {
    -
    55  for (size_t i = strlen(number_str); i > 0; i--) {
    -
    56  char a = number_str[i - 1] - '0';
    -
    57  if (a >= 0 && a <= 9)
    -
    58  _digits.push_back(a);
    -
    59  }
    -
    60  }
    -
    61 
    -
    62  /**
    -
    63  * Function to check implementation
    -
    64  **/
    -
    65  static bool test() {
    -
    66  std::cout << "------ Checking `large_number` class implementations\t"
    -
    67  << std::endl;
    -
    68  large_number a(40);
    -
    69  // 1. test multiplication
    -
    70  a *= 10;
    -
    71  if (a != large_number(400)) {
    -
    72  std::cerr << "\tFailed 1/6 (" << a << "!=400)" << std::endl;
    -
    73  return false;
    -
    74  }
    -
    75  std::cout << "\tPassed 1/6...";
    -
    76  // 2. test compound addition with integer
    -
    77  a += 120;
    -
    78  if (a != large_number(520)) {
    -
    79  std::cerr << "\tFailed 2/6 (" << a << "!=520)" << std::endl;
    -
    80  return false;
    -
    81  }
    -
    82  std::cout << "\tPassed 2/6...";
    -
    83  // 3. test compound multiplication again
    -
    84  a *= 10;
    -
    85  if (a != large_number(5200)) {
    -
    86  std::cerr << "\tFailed 3/6 (" << a << "!=5200)" << std::endl;
    -
    87  return false;
    -
    88  }
    -
    89  std::cout << "\tPassed 3/6...";
    -
    90  // 4. test increment (prefix)
    -
    91  ++a;
    -
    92  if (a != large_number(5201)) {
    -
    93  std::cerr << "\tFailed 4/6 (" << a << "!=5201)" << std::endl;
    -
    94  return false;
    -
    95  }
    -
    96  std::cout << "\tPassed 4/6...";
    -
    97  // 5. test increment (postfix)
    -
    98  a++;
    -
    99  if (a != large_number(5202)) {
    -
    100  std::cerr << "\tFailed 5/6 (" << a << "!=5202)" << std::endl;
    -
    101  return false;
    -
    102  }
    -
    103  std::cout << "\tPassed 5/6...";
    -
    104  // 6. test addition with another large number
    -
    105  a = a + large_number("7000000000000000000000000000000");
    -
    106  if (a != large_number("7000000000000000000000000005202")) {
    -
    107  std::cerr << "\tFailed 6/6 (" << a
    -
    108  << "!=7000000000000000000000000005202)" << std::endl;
    -
    109  return false;
    -
    110  }
    -
    111  std::cout << "\tPassed 6/6..." << std::endl;
    -
    112  return true;
    -
    113  }
    -
    114 
    -
    115  /**
    -
    116  * add a digit at MSB to the large number
    -
    117  **/
    -
    118  void add_digit(unsigned int value) {
    -
    119  if (value > 9) {
    -
    120  std::cerr << "digit > 9!!\n";
    -
    121  exit(EXIT_FAILURE);
    -
    122  }
    -
    123 
    -
    124  _digits.push_back(value);
    -
    125  }
    -
    126 
    -
    127  /**
    -
    128  * Get number of digits in the number
    -
    129  **/
    -
    130  size_t num_digits() const { return _digits.size(); }
    -
    131 
    -
    132  /**
    -
    133  * operator over load to access the
    -
    134  * i^th digit conveniently and also
    -
    135  * assign value to it
    -
    136  **/
    -
    137  inline unsigned char &operator[](size_t n) { return this->_digits[n]; }
    -
    138 
    -
    139  inline const unsigned char &operator[](size_t n) const {
    -
    140  return this->_digits[n];
    -
    141  }
    -
    142 
    -
    143  /**
    -
    144  * operator overload to compare two numbers
    -
    145  **/
    - -
    147  for (size_t i = a.num_digits(); i > 0; i--)
    -
    148  out << static_cast<int>(a[i - 1]);
    -
    149  return out;
    -
    150  }
    -
    151 
    -
    152  /**
    -
    153  * operator overload to compare two numbers
    -
    154  **/
    -
    155  friend bool operator==(large_number const &a, large_number const &b) {
    -
    156  size_t N = a.num_digits();
    -
    157  if (N != b.num_digits())
    -
    158  return false;
    -
    159  for (size_t i = 0; i < N; i++)
    -
    160  if (a[i] != b[i])
    -
    161  return false;
    -
    162  return true;
    -
    163  }
    -
    164 
    -
    165  /**
    -
    166  * operator overload to compare two numbers
    -
    167  **/
    -
    168  friend bool operator!=(large_number const &a, large_number const &b) {
    -
    169  return !(a == b);
    -
    170  }
    -
    171 
    -
    172  /**
    -
    173  * operator overload to increment (prefix)
    -
    174  **/
    - -
    176  (*this) += 1;
    -
    177  return *this;
    -
    178  }
    -
    179 
    -
    180  /**
    -
    181  * operator overload to increment (postfix)
    -
    182  **/
    - -
    184  static large_number tmp(_digits);
    -
    185  ++(*this);
    -
    186  return tmp;
    -
    187  }
    -
    188 
    -
    189  /**
    -
    190  * operator overload to add
    -
    191  **/
    - -
    193  // if adding with another large_number
    -
    194  large_number *b = reinterpret_cast<large_number *>(&n);
    -
    195  const size_t max_L = std::max(this->num_digits(), b->num_digits());
    -
    196  unsigned int carry = 0;
    -
    197  size_t i;
    -
    198  for (i = 0; i < max_L || carry != 0; i++) {
    -
    199  if (i < b->num_digits())
    -
    200  carry += (*b)[i];
    -
    201  if (i < this->num_digits())
    -
    202  carry += (*this)[i];
    -
    203  if (i < this->num_digits())
    -
    204  (*this)[i] = carry % 10;
    -
    205  else
    -
    206  this->add_digit(carry % 10);
    -
    207  carry /= 10;
    -
    208  }
    -
    209  return *this;
    -
    210  }
    -
    211 
    -
    212  large_number &operator+=(int n) { return (*this) += large_number(n); }
    -
    213  // large_number &operator+=(uint64_t n) { return (*this) += large_number(n);
    -
    214  // }
    -
    215 
    -
    216  /**
    -
    217  * operator overload to perform addition
    -
    218  **/
    -
    219  template <class T>
    -
    220  friend large_number &operator+(const large_number &a, const T &b) {
    -
    221  static large_number c = a;
    -
    222  c += b;
    -
    223  return c;
    -
    224  }
    -
    225 
    -
    226  /**
    -
    227  * assignment operator
    -
    228  **/
    - -
    230  this->_digits = b._digits;
    -
    231  return *this;
    -
    232  }
    -
    233 
    -
    234  /**
    -
    235  * operator overload to increment
    -
    236  **/
    -
    237  template <class T>
    -
    238  large_number &operator*=(const T n) {
    -
    239  static_assert(std::is_integral<T>::value,
    -
    240  "Must be integer addition unsigned integer types.");
    -
    241  this->multiply(n);
    -
    242  return *this;
    -
    243  }
    -
    244 
    -
    245  /**
    -
    246  * returns i^th digit as an ASCII character
    -
    247  **/
    -
    248  char digit_char(size_t i) const {
    -
    249  return _digits[num_digits() - i - 1] + '0';
    -
    250  }
    -
    251 
    -
    252  private:
    -
    253  /**
    -
    254  * multiply large number with another integer and
    -
    255  * store the result in the same large number
    -
    256  **/
    -
    257  template <class T>
    -
    258  void multiply(const T n) {
    -
    259  static_assert(std::is_integral<T>::value,
    -
    260  "Can only have integer types.");
    -
    261  // assert(!(std::is_signed<T>::value)); //, "Implemented only for
    -
    262  // unsigned integer types.");
    -
    263 
    -
    264  size_t i;
    -
    265  uint64_t carry = 0, temp;
    -
    266  for (i = 0; i < this->num_digits(); i++) {
    -
    267  temp = static_cast<uint64_t>((*this)[i]) * n;
    -
    268  temp += carry;
    -
    269  if (temp < 10) {
    -
    270  carry = 0;
    -
    271  } else {
    -
    272  carry = temp / 10;
    -
    273  temp = temp % 10;
    -
    274  }
    -
    275  (*this)[i] = temp;
    -
    276  }
    -
    277 
    -
    278  while (carry != 0) {
    -
    279  this->add_digit(carry % 10);
    -
    280  carry /= 10;
    -
    281  }
    -
    282  }
    -
    283 
    - -
    285  _digits; /**< where individual digits are stored */
    -
    286 };
    -
    287 
    -
    288 #endif // MATH_LARGE_NUMBER_H_
    +Go to the documentation of this file.
    1/**
    +
    2 * @file
    +
    3 * @brief Library to perform arithmatic operations on arbitrarily large
    +
    4 * numbers.
    +
    5 * \author [Krishna Vedala](https://github.com/kvedala)
    +
    6 */
    +
    7
    +
    8#ifndef MATH_LARGE_NUMBER_H_
    +
    9#define MATH_LARGE_NUMBER_H_
    +
    10#include <algorithm>
    +
    11#include <cassert>
    +
    12#include <cinttypes>
    +
    13#include <cstring>
    +
    14#include <iostream>
    +
    15#include <type_traits>
    +
    16#include <vector>
    +
    17
    +
    18/**
    +
    19 * Store large unsigned numbers as a C++ vector
    +
    20 * The class provides convenience functions to add a
    +
    21 * digit to the number, perform multiplication of
    +
    22 * large number with long unsigned integers.
    +
    23 **/
    + +
    25 public:
    +
    26 /**< initializer with value = 1 */
    +
    27 large_number() { _digits.push_back(1); }
    +
    28
    +
    29 // /**< initializer from an integer */
    +
    30 // explicit large_number(uint64_t n) {
    +
    31 // uint64_t carry = n;
    +
    32 // do {
    +
    33 // add_digit(carry % 10);
    +
    34 // carry /= 10;
    +
    35 // } while (carry != 0);
    +
    36 // }
    +
    37
    +
    38 /**< initializer from an integer */
    +
    39 explicit large_number(int n) {
    +
    40 int carry = n;
    +
    41 do {
    +
    42 add_digit(carry % 10);
    +
    43 carry /= 10;
    +
    44 } while (carry != 0);
    +
    45 }
    +
    46
    +
    47 /**< initializer from another large_number */
    + +
    49
    +
    50 /**< initializer from a vector */
    + +
    52
    +
    53 /**< initializer from a string */
    +
    54 explicit large_number(char const *number_str) {
    +
    55 for (size_t i = strlen(number_str); i > 0; i--) {
    +
    56 char a = number_str[i - 1] - '0';
    +
    57 if (a >= 0 && a <= 9)
    +
    58 _digits.push_back(a);
    +
    59 }
    +
    60 }
    +
    61
    +
    62 /**
    +
    63 * Function to check implementation
    +
    64 **/
    +
    65 static bool test() {
    +
    66 std::cout << "------ Checking `large_number` class implementations\t"
    +
    67 << std::endl;
    +
    68 large_number a(40);
    +
    69 // 1. test multiplication
    +
    70 a *= 10;
    +
    71 if (a != large_number(400)) {
    +
    72 std::cerr << "\tFailed 1/6 (" << a << "!=400)" << std::endl;
    +
    73 return false;
    +
    74 }
    +
    75 std::cout << "\tPassed 1/6...";
    +
    76 // 2. test compound addition with integer
    +
    77 a += 120;
    +
    78 if (a != large_number(520)) {
    +
    79 std::cerr << "\tFailed 2/6 (" << a << "!=520)" << std::endl;
    +
    80 return false;
    +
    81 }
    +
    82 std::cout << "\tPassed 2/6...";
    +
    83 // 3. test compound multiplication again
    +
    84 a *= 10;
    +
    85 if (a != large_number(5200)) {
    +
    86 std::cerr << "\tFailed 3/6 (" << a << "!=5200)" << std::endl;
    +
    87 return false;
    +
    88 }
    +
    89 std::cout << "\tPassed 3/6...";
    +
    90 // 4. test increment (prefix)
    +
    91 ++a;
    +
    92 if (a != large_number(5201)) {
    +
    93 std::cerr << "\tFailed 4/6 (" << a << "!=5201)" << std::endl;
    +
    94 return false;
    +
    95 }
    +
    96 std::cout << "\tPassed 4/6...";
    +
    97 // 5. test increment (postfix)
    +
    98 a++;
    +
    99 if (a != large_number(5202)) {
    +
    100 std::cerr << "\tFailed 5/6 (" << a << "!=5202)" << std::endl;
    +
    101 return false;
    +
    102 }
    +
    103 std::cout << "\tPassed 5/6...";
    +
    104 // 6. test addition with another large number
    +
    105 a = a + large_number("7000000000000000000000000000000");
    +
    106 if (a != large_number("7000000000000000000000000005202")) {
    +
    107 std::cerr << "\tFailed 6/6 (" << a
    +
    108 << "!=7000000000000000000000000005202)" << std::endl;
    +
    109 return false;
    +
    110 }
    +
    111 std::cout << "\tPassed 6/6..." << std::endl;
    +
    112 return true;
    +
    113 }
    +
    114
    +
    115 /**
    +
    116 * add a digit at MSB to the large number
    +
    117 **/
    +
    118 void add_digit(unsigned int value) {
    +
    119 if (value > 9) {
    +
    120 std::cerr << "digit > 9!!\n";
    +
    121 exit(EXIT_FAILURE);
    +
    122 }
    +
    123
    +
    124 _digits.push_back(value);
    +
    125 }
    +
    126
    +
    127 /**
    +
    128 * Get number of digits in the number
    +
    129 **/
    +
    130 size_t num_digits() const { return _digits.size(); }
    +
    131
    +
    132 /**
    +
    133 * operator over load to access the
    +
    134 * i^th digit conveniently and also
    +
    135 * assign value to it
    +
    136 **/
    +
    137 inline unsigned char &operator[](size_t n) { return this->_digits[n]; }
    +
    138
    +
    139 inline const unsigned char &operator[](size_t n) const {
    +
    140 return this->_digits[n];
    +
    141 }
    +
    142
    +
    143 /**
    +
    144 * operator overload to compare two numbers
    +
    145 **/
    + +
    147 for (size_t i = a.num_digits(); i > 0; i--)
    +
    148 out << static_cast<int>(a[i - 1]);
    +
    149 return out;
    +
    150 }
    +
    151
    +
    152 /**
    +
    153 * operator overload to compare two numbers
    +
    154 **/
    +
    155 friend bool operator==(large_number const &a, large_number const &b) {
    +
    156 size_t N = a.num_digits();
    +
    157 if (N != b.num_digits())
    +
    158 return false;
    +
    159 for (size_t i = 0; i < N; i++)
    +
    160 if (a[i] != b[i])
    +
    161 return false;
    +
    162 return true;
    +
    163 }
    +
    164
    +
    165 /**
    +
    166 * operator overload to compare two numbers
    +
    167 **/
    +
    168 friend bool operator!=(large_number const &a, large_number const &b) {
    +
    169 return !(a == b);
    +
    170 }
    +
    171
    +
    172 /**
    +
    173 * operator overload to increment (prefix)
    +
    174 **/
    + +
    176 (*this) += 1;
    +
    177 return *this;
    +
    178 }
    +
    179
    +
    180 /**
    +
    181 * operator overload to increment (postfix)
    +
    182 **/
    + +
    184 static large_number tmp(_digits);
    +
    185 ++(*this);
    +
    186 return tmp;
    +
    187 }
    +
    188
    +
    189 /**
    +
    190 * operator overload to add
    +
    191 **/
    + +
    193 // if adding with another large_number
    +
    194 large_number *b = reinterpret_cast<large_number *>(&n);
    +
    195 const size_t max_L = std::max(this->num_digits(), b->num_digits());
    +
    196 unsigned int carry = 0;
    +
    197 size_t i;
    +
    198 for (i = 0; i < max_L || carry != 0; i++) {
    +
    199 if (i < b->num_digits())
    +
    200 carry += (*b)[i];
    +
    201 if (i < this->num_digits())
    +
    202 carry += (*this)[i];
    +
    203 if (i < this->num_digits())
    +
    204 (*this)[i] = carry % 10;
    +
    205 else
    +
    206 this->add_digit(carry % 10);
    +
    207 carry /= 10;
    +
    208 }
    +
    209 return *this;
    +
    210 }
    +
    211
    +
    212 large_number &operator+=(int n) { return (*this) += large_number(n); }
    +
    213 // large_number &operator+=(uint64_t n) { return (*this) += large_number(n);
    +
    214 // }
    +
    215
    +
    216 /**
    +
    217 * operator overload to perform addition
    +
    218 **/
    +
    219 template <class T>
    +
    220 friend large_number &operator+(const large_number &a, const T &b) {
    +
    221 static large_number c = a;
    +
    222 c += b;
    +
    223 return c;
    +
    224 }
    +
    225
    +
    226 /**
    +
    227 * assignment operator
    +
    228 **/
    + +
    230 this->_digits = b._digits;
    +
    231 return *this;
    +
    232 }
    +
    233
    +
    234 /**
    +
    235 * operator overload to increment
    +
    236 **/
    +
    237 template <class T>
    + +
    239 static_assert(std::is_integral<T>::value,
    +
    240 "Must be integer addition unsigned integer types.");
    +
    241 this->multiply(n);
    +
    242 return *this;
    +
    243 }
    +
    244
    +
    245 /**
    +
    246 * returns i^th digit as an ASCII character
    +
    247 **/
    +
    248 char digit_char(size_t i) const {
    +
    249 return _digits[num_digits() - i - 1] + '0';
    +
    250 }
    +
    251
    +
    252 private:
    +
    253 /**
    +
    254 * multiply large number with another integer and
    +
    255 * store the result in the same large number
    +
    256 **/
    +
    257 template <class T>
    +
    258 void multiply(const T n) {
    +
    259 static_assert(std::is_integral<T>::value,
    +
    260 "Can only have integer types.");
    +
    261 // assert(!(std::is_signed<T>::value)); //, "Implemented only for
    +
    262 // unsigned integer types.");
    +
    263
    +
    264 size_t i;
    +
    265 uint64_t carry = 0, temp;
    +
    266 for (i = 0; i < this->num_digits(); i++) {
    +
    267 temp = static_cast<uint64_t>((*this)[i]) * n;
    +
    268 temp += carry;
    +
    269 if (temp < 10) {
    +
    270 carry = 0;
    +
    271 } else {
    +
    272 carry = temp / 10;
    +
    273 temp = temp % 10;
    +
    274 }
    +
    275 (*this)[i] = temp;
    +
    276 }
    +
    277
    +
    278 while (carry != 0) {
    +
    279 this->add_digit(carry % 10);
    +
    280 carry /= 10;
    +
    281 }
    +
    282 }
    +
    283
    + +
    285 _digits; /**< where individual digits are stored */
    +
    286};
    +
    287
    +
    288#endif // MATH_LARGE_NUMBER_H_
    Definition: large_number.h:24
    large_number(const large_number &a)
    Definition: large_number.h:48
    large_number()
    Definition: large_number.h:27
    +
    friend std::ostream & operator<<(std::ostream &out, const large_number &a)
    Definition: large_number.h:146
    void multiply(const T n)
    Definition: large_number.h:258
    +
    large_number & operator++()
    Definition: large_number.h:175
    void add_digit(unsigned int value)
    Definition: large_number.h:118
    -
    large_number & operator++()
    Definition: large_number.h:175
    -
    friend large_number & operator+(const large_number &a, const T &b)
    Definition: large_number.h:220
    friend bool operator!=(large_number const &a, large_number const &b)
    Definition: large_number.h:168
    large_number(std::vector< unsigned char > &vec)
    Definition: large_number.h:51
    -
    friend std::ostream & operator<<(std::ostream &out, const large_number &a)
    Definition: large_number.h:146
    +
    large_number & operator*=(const T n)
    Definition: large_number.h:238
    friend bool operator==(large_number const &a, large_number const &b)
    Definition: large_number.h:155
    +
    unsigned char & operator[](size_t n)
    Definition: large_number.h:137
    +
    large_number & operator++(int)
    Definition: large_number.h:183
    static bool test()
    Definition: large_number.h:65
    -
    large_number & operator*=(const T n)
    Definition: large_number.h:238
    +
    large_number & operator+=(large_number n)
    Definition: large_number.h:192
    +
    large_number & operator=(const large_number &b)
    Definition: large_number.h:229
    +
    friend large_number & operator+(const large_number &a, const T &b)
    Definition: large_number.h:220
    size_t num_digits() const
    Definition: large_number.h:130
    -
    large_number & operator+=(large_number n)
    Definition: large_number.h:192
    -
    large_number & operator++(int)
    Definition: large_number.h:183
    -
    unsigned char & operator[](size_t n)
    Definition: large_number.h:137
    char digit_char(size_t i) const
    Definition: large_number.h:248
    -
    large_number & operator=(const large_number &b)
    Definition: large_number.h:229
    std::vector< unsigned char > _digits
    Definition: large_number.h:285
    large_number(int n)
    Definition: large_number.h:39
    T endl(T... args)
    T max(T... args)
    -
    T push_back(T... args)
    -
    T size(T... args)
    - +
    diff --git a/d4/d8d/jarvis__algorithm_8cpp.html b/d4/d8d/jarvis__algorithm_8cpp.html index 0f2d46191..68ca4b353 100644 --- a/d4/d8d/jarvis__algorithm_8cpp.html +++ b/d4/d8d/jarvis__algorithm_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: geometry/jarvis_algorithm.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('d4/d8d/jarvis__algorithm_8cpp.html','. Classes | Namespaces | Functions -
    -
    jarvis_algorithm.cpp File Reference
    +
    jarvis_algorithm.cpp File Reference
    -

    Implementation of Jarvis’s algorithm. +

    Implementation of Jarvis’s algorithm. More...

    #include <vector>
    #include <cassert>
    @@ -111,23 +110,23 @@ Include dependency graph for jarvis_algorithm.cpp:
    -

    +

    Classes

    struct  geometry::jarvis::Point
     
    class  geometry::jarvis::Convexhull
     
    - - + - - + +

    +

    Namespaces

     geometry
    namespace  geometry
     Geometry algorithms.
     
     jarvis
     Functions for Jarvis’s algorithm.
    namespace  jarvis
     Functions for Jarvis’s algorithm.
     
    - @@ -135,17 +134,17 @@ Functions

    +

    Functions

    static void test ()
     
     

    Detailed Description

    -

    Implementation of Jarvis’s algorithm.

    -

    Given a set of points in the plane. the convex hull of the set is the smallest convex polygon that contains all the points of it.

    +

    Implementation of Jarvis’s algorithm.

    +

    Given a set of points in the plane. the convex hull of the set is the smallest convex polygon that contains all the points of it.

    Algorithm

    -

    The idea of Jarvis’s Algorithm is simple, we start from the leftmost point (or point with minimum x coordinate value) and we keep wrapping points in counterclockwise direction.

    -

    The idea is to use orientation() here. Next point is selected as the point that beats all other points at counterclockwise orientation, i.e., next point is q if for any other point r, we have “orientation(p, q, r) = counterclockwise”.

    -

    For Example, If points = {{0, 3}, {2, 2}, {1, 1}, {2, 1}, {3, 0}, {0, 0}, {3, 3}};

    -

    then the convex hull is (0, 3), (0, 0), (3, 0), (3, 3)

    -
    Author
    Rishabh Agarwal
    +

    The idea of Jarvis’s Algorithm is simple, we start from the leftmost point (or point with minimum x coordinate value) and we keep wrapping points in counterclockwise direction.

    +

    The idea is to use orientation() here. Next point is selected as the point that beats all other points at counterclockwise orientation, i.e., next point is q if for any other point r, we have “orientation(p, q, r) = counterclockwise”.

    +

    For Example, If points = {{0, 3}, {2, 2}, {1, 1}, {2, 1}, {3, 0}, {0, 0}, {3, 3}};

    +

    then the convex hull is (0, 3), (0, 0), (3, 0), (3, 3)

    +
    Author
    Rishabh Agarwal

    Function Documentation

    - +

    ◆ main()

    @@ -160,11 +159,11 @@ Algorithm
    -

    Driver Code

    -
    176  {
    -
    177  test();
    -
    178  return 0;
    -
    179 }
    +

    Driver Code

    +
    176 {
    +
    177 test();
    +
    178 return 0;
    +
    179}
    static void test()
    Definition: jarvis_algorithm.cpp:151
    Here is the call graph for this function:
    @@ -175,7 +174,7 @@ Here is the call graph for this function:
    - +

    ◆ test()

    @@ -197,34 +196,34 @@ Here is the call graph for this function:
    -

    Test function

    Returns
    void
    -
    151  {
    -
    152  std::vector<geometry::jarvis::Point> points = {{0, 3},
    -
    153  {2, 2},
    -
    154  {1, 1},
    -
    155  {2, 1},
    -
    156  {3, 0},
    -
    157  {0, 0},
    -
    158  {3, 3}
    -
    159  };
    -
    160  geometry::jarvis::Convexhull hull(points);
    - -
    162  actualPoint = hull.getConvexHull();
    -
    163 
    -
    164  std::vector<geometry::jarvis::Point> expectedPoint = {{0, 3},
    -
    165  {0, 0},
    -
    166  {3, 0},
    -
    167  {3, 3}};
    -
    168  for (int i = 0; i < expectedPoint.size(); i++) {
    -
    169  assert(actualPoint[i].x == expectedPoint[i].x);
    -
    170  assert(actualPoint[i].y == expectedPoint[i].y);
    -
    171  }
    -
    172  std::cout << "Test implementations passed!\n";
    -
    173 }
    +

    Test function

    Returns
    void
    +
    151 {
    + +
    153 {2, 2},
    +
    154 {1, 1},
    +
    155 {2, 1},
    +
    156 {3, 0},
    +
    157 {0, 0},
    +
    158 {3, 3}
    +
    159 };
    +
    160 geometry::jarvis::Convexhull hull(points);
    + +
    162 actualPoint = hull.getConvexHull();
    +
    163
    +
    164 std::vector<geometry::jarvis::Point> expectedPoint = {{0, 3},
    +
    165 {0, 0},
    +
    166 {3, 0},
    +
    167 {3, 3}};
    +
    168 for (int i = 0; i < expectedPoint.size(); i++) {
    +
    169 assert(actualPoint[i].x == expectedPoint[i].x);
    +
    170 assert(actualPoint[i].y == expectedPoint[i].y);
    +
    171 }
    +
    172 std::cout << "Test implementations passed!\n";
    +
    173}
    Definition: jarvis_algorithm.cpp:55
    T size(T... args)
    - +
    Here is the call graph for this function:
    @@ -240,7 +239,7 @@ Here is the call graph for this function:
    diff --git a/d4/d8d/jarvis__algorithm_8cpp.js b/d4/d8d/jarvis__algorithm_8cpp.js index 1f3d6df20..54c880668 100644 --- a/d4/d8d/jarvis__algorithm_8cpp.js +++ b/d4/d8d/jarvis__algorithm_8cpp.js @@ -1,7 +1,7 @@ var jarvis__algorithm_8cpp = [ - [ "Point", "d9/d5a/structgeometry_1_1jarvis_1_1_point.html", "d9/d5a/structgeometry_1_1jarvis_1_1_point" ], - [ "Convexhull", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull" ], + [ "geometry::jarvis::Point", "d9/d5a/structgeometry_1_1jarvis_1_1_point.html", null ], + [ "geometry::jarvis::Convexhull", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull" ], [ "main", "d4/d8d/jarvis__algorithm_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "test", "d4/d8d/jarvis__algorithm_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index 84feea383..324b446cc 100644 --- a/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,6 +1,6 @@ - + diff --git a/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index f67e80bf2..f00d51048 100644 --- a/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -ee1d49cd2b811688c44c6848ff6a40f6 \ No newline at end of file +af3611720b0cb3779d6d58f90ca4a853 \ No newline at end of file diff --git a/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 0209cafdc..d69bba455 100644 --- a/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d4/d8d/jarvis__algorithm_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + geometry::jarvis::Convexhull ::getConvexHull diff --git a/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 0df6eecb1..5ac468b9a 100644 --- a/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,7 +1,7 @@ - + diff --git a/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 0065f77d7..d6eb09e51 100644 --- a/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -7300215fd64a9d0f8b5600a39bc44c17 \ No newline at end of file +be2e6cd948247d454ced0a5ca7e651ae \ No newline at end of file diff --git a/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 537157fbd..287be5467 100644 --- a/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d4/d8d/jarvis__algorithm_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + geometry::jarvis::Convexhull ::getConvexHull diff --git a/d4/d90/classdata__structures_1_1_skip_list.html b/d4/d90/classdata__structures_1_1_skip_list.html index ca37b602d..21868c76e 100644 --- a/d4/d90/classdata__structures_1_1_skip_list.html +++ b/d4/d90/classdata__structures_1_1_skip_list.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: data_structures::SkipList Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -94,18 +94,11 @@ $(document).ready(function(){initNavTree('d4/d90/classdata__structures_1_1_skip_ Public Member Functions | Private Attributes | List of all members -
    -
    data_structures::SkipList Class Reference
    +
    data_structures::SkipList Class Reference
    -
    -Collaboration diagram for data_structures::SkipList:
    -
    -
    -
    -
    [legend]
    - @@ -115,26 +108,26 @@ Public Member Functions - - + +

    +

    Public Member Functions

     SkipList ()
     
     
    void deleteElement (int key)
     
    void * searchElement (int key)
     
    void * searchElement (int key)
     
    void displayList ()
     
    - - + - +

    +

    Private Attributes

    -int level
    +int level
     Maximum level of the skiplist.
     
    -std::shared_ptr< Nodeheader
    +std::shared_ptr< Nodeheader
     Pointer to the header node.
     

    Detailed Description

    -

    SkipList class implementation with basic methods

    +

    SkipList class implementation with basic methods

    Constructor & Destructor Documentation

    - +

    ◆ SkipList()

    @@ -156,12 +149,12 @@ int  -

    Skip List constructor. Initializes header, start Node for searching in the list

    -
    64  {
    -
    65  level = 0;
    -
    66  // Header initialization
    -
    67  header = std::make_shared<Node>(-1, MAX_LEVEL);
    -
    68  }
    +

    Skip List constructor. Initializes header, start Node for searching in the list

    +
    64 {
    +
    65 level = 0;
    +
    66 // Header initialization
    +
    67 header = std::make_shared<Node>(-1, MAX_LEVEL);
    +
    68 }
    int level
    Maximum level of the skiplist.
    Definition: skip_list.cpp:56
    std::shared_ptr< Node > header
    Pointer to the header node.
    Definition: skip_list.cpp:57
    constexpr int MAX_LEVEL
    Maximum level of skip list.
    Definition: skip_list.cpp:27
    @@ -169,7 +162,7 @@ int Member Function Documentation - +

    ◆ deleteElement()

    @@ -192,47 +185,47 @@ int  -

    Deletes an element by key and prints if has been removed successfully

    Parameters
    +

    Deletes an element by key and prints if has been removed successfully

    Parameters
    keyis number that is used for comparision.
    -
    133  {
    - -
    135 
    - -
    137  update.fill(nullptr);
    -
    138 
    -
    139  for (int i = level; i >= 0; i--) {
    -
    140  while (x->forward[i] != nullptr && x->forward[i]->key < key) {
    -
    141  x = x->forward[i];
    -
    142  }
    -
    143  update[i] = x;
    -
    144  }
    -
    145 
    -
    146  x = x->forward[0];
    -
    147 
    -
    148  bool doesnt_exist = (x == nullptr || x->key != key);
    -
    149 
    -
    150  if (!doesnt_exist) {
    -
    151  for (int i = 0; i <= level; i++) {
    -
    152  if (update[i]->forward[i] != x) {
    -
    153  break;
    -
    154  }
    -
    155  update[i]->forward[i] = x->forward[i];
    -
    156  }
    -
    157  /* Remove empty levels*/
    -
    158  while (level > 0 && header->forward[level] == nullptr) level--;
    -
    159  std::cout << "Deleted" << std::endl;
    -
    160  } else {
    -
    161  std::cout << "Doesn't exist" << std::endl;
    -
    162  }
    -
    163  }
    +
    133 {
    + +
    135
    + +
    137 update.fill(nullptr);
    +
    138
    +
    139 for (int i = level; i >= 0; i--) {
    +
    140 while (x->forward[i] != nullptr && x->forward[i]->key < key) {
    +
    141 x = x->forward[i];
    +
    142 }
    +
    143 update[i] = x;
    +
    144 }
    +
    145
    +
    146 x = x->forward[0];
    +
    147
    +
    148 bool doesnt_exist = (x == nullptr || x->key != key);
    +
    149
    +
    150 if (!doesnt_exist) {
    +
    151 for (int i = 0; i <= level; i++) {
    +
    152 if (update[i]->forward[i] != x) {
    +
    153 break;
    +
    154 }
    +
    155 update[i]->forward[i] = x->forward[i];
    +
    156 }
    +
    157 /* Remove empty levels*/
    +
    158 while (level > 0 && header->forward[level] == nullptr) level--;
    +
    159 std::cout << "Deleted" << std::endl;
    +
    160 } else {
    +
    161 std::cout << "Doesn't exist" << std::endl;
    +
    162 }
    +
    163 }
    T endl(T... args)
    - +
    Here is the call graph for this function:
    @@ -242,7 +235,7 @@ Here is the call graph for this function:
    - +

    ◆ displayList()

    @@ -264,19 +257,19 @@ Here is the call graph for this function:
    -

    Display skip list level

    -
    191  {
    -
    192  std::cout << "Displaying list:\n";
    -
    193  for (int i = 0; i <= level; i++) {
    -
    194  std::shared_ptr<Node> node = header->forward[i];
    -
    195  std::cout << "Level " << (i) << ": ";
    -
    196  while (node != nullptr) {
    -
    197  std::cout << node->key << " ";
    -
    198  node = node->forward[i];
    -
    199  }
    -
    200  std::cout << std::endl;
    -
    201  }
    -
    202  }
    +

    Display skip list level

    +
    191 {
    +
    192 std::cout << "Displaying list:\n";
    +
    193 for (int i = 0; i <= level; i++) {
    +
    194 std::shared_ptr<Node> node = header->forward[i];
    +
    195 std::cout << "Level " << (i) << ": ";
    +
    196 while (node != nullptr) {
    +
    197 std::cout << node->key << " ";
    +
    198 node = node->forward[i];
    +
    199 }
    + +
    201 }
    +
    202 }
    Definition: avltree.cpp:13
    Here is the call graph for this function:
    @@ -287,7 +280,7 @@ Here is the call graph for this function:
    - +

    ◆ insertElement()

    @@ -320,51 +313,51 @@ Here is the call graph for this function:
    -

    Inserts elements with given key and value; It's level is computed by randomLevel() function.

    Parameters
    +

    Inserts elements with given key and value; It's level is computed by randomLevel() function.

    Parameters
    keyis number that is used for comparision
    valuepointer to a value, that can be any type
    -
    90  {
    -
    91  std::cout << "Inserting" << key << "...";
    - - -
    94  update.fill(nullptr);
    -
    95 
    -
    96  for (int i = level; i >= 0; i--) {
    -
    97  while (x->forward[i] != nullptr && x->forward[i]->key < key) {
    -
    98  x = x->forward[i];
    -
    99  }
    -
    100  update[i] = x;
    -
    101  }
    -
    102 
    -
    103  x = x->forward[0];
    -
    104 
    -
    105  bool doesnt_exist = (x == nullptr || x->key != key);
    -
    106  if (doesnt_exist) {
    -
    107  int rlevel = randomLevel();
    -
    108 
    -
    109  if (rlevel > level) {
    -
    110  for (int i = level + 1; i < rlevel + 1; i++) update[i] = header;
    -
    111 
    -
    112  // Update current level
    -
    113  level = rlevel;
    -
    114  }
    -
    115 
    - -
    117  std::make_shared<Node>(key, rlevel, value);
    -
    118  for (int i = 0; i <= rlevel; i++) {
    -
    119  n->forward[i] = update[i]->forward[i];
    -
    120  update[i]->forward[i] = n;
    -
    121  }
    -
    122  std::cout << "Inserted" << std::endl;
    -
    123 
    -
    124  } else {
    -
    125  std::cout << "Exists" << std::endl;
    -
    126  }
    -
    127  }
    +
    90 {
    +
    91 std::cout << "Inserting" << key << "...";
    + + +
    94 update.fill(nullptr);
    +
    95
    +
    96 for (int i = level; i >= 0; i--) {
    +
    97 while (x->forward[i] != nullptr && x->forward[i]->key < key) {
    +
    98 x = x->forward[i];
    +
    99 }
    +
    100 update[i] = x;
    +
    101 }
    +
    102
    +
    103 x = x->forward[0];
    +
    104
    +
    105 bool doesnt_exist = (x == nullptr || x->key != key);
    +
    106 if (doesnt_exist) {
    +
    107 int rlevel = randomLevel();
    +
    108
    +
    109 if (rlevel > level) {
    +
    110 for (int i = level + 1; i < rlevel + 1; i++) update[i] = header;
    +
    111
    +
    112 // Update current level
    +
    113 level = rlevel;
    +
    114 }
    +
    115
    + +
    117 std::make_shared<Node>(key, rlevel, value);
    +
    118 for (int i = 0; i <= rlevel; i++) {
    +
    119 n->forward[i] = update[i]->forward[i];
    +
    120 update[i]->forward[i] = n;
    +
    121 }
    +
    122 std::cout << "Inserted" << std::endl;
    +
    123
    +
    124 } else {
    +
    125 std::cout << "Exists" << std::endl;
    +
    126 }
    +
    127 }
    int randomLevel()
    Definition: skip_list.cpp:75
    Here is the call graph for this function:
    @@ -375,7 +368,7 @@ Here is the call graph for this function:
    - +

    ◆ randomLevel()

    @@ -397,15 +390,15 @@ Here is the call graph for this function:
    -

    Returns random level of the skip list. Every higher level is 2 times less likely.

    Returns
    random level for skip list
    -
    75  {
    -
    76  int lvl = 0;
    -
    77  while (static_cast<float>(std::rand()) / RAND_MAX < PROBABILITY &&
    -
    78  lvl < MAX_LEVEL) {
    -
    79  lvl++;
    -
    80  }
    -
    81  return lvl;
    -
    82  }
    +

    Returns random level of the skip list. Every higher level is 2 times less likely.

    Returns
    random level for skip list
    +
    75 {
    +
    76 int lvl = 0;
    +
    77 while (static_cast<float>(std::rand()) / RAND_MAX < PROBABILITY &&
    +
    78 lvl < MAX_LEVEL) {
    +
    79 lvl++;
    +
    80 }
    +
    81 return lvl;
    +
    82 }
    constexpr float PROBABILITY
    Current probability for "coin toss".
    Definition: skip_list.cpp:28
    T rand(T... args)
    @@ -417,8 +410,8 @@ Here is the call graph for this function:
    - -

    ◆ searchElement()

    + +

    ◆ searchElement()

    @@ -427,7 +420,7 @@ Here is the call graph for this function:
    - + @@ -440,34 +433,34 @@ Here is the call graph for this function:
    void* data_structures::SkipList::searchElement void * data_structures::SkipList::searchElement ( int  key)
    -

    Searching element in skip list structure

    Parameters
    +

    Searching element in skip list structure

    Parameters
    keyis number that is used for comparision
    Returns
    pointer to the value of the node
    -
    170  {
    - -
    172  std::cout << "Searching for " << key << std::endl;
    -
    173 
    -
    174  for (int i = level; i >= 0; i--) {
    -
    175  while (x->forward[i] && x->forward[i]->key < key) x = x->forward[i];
    -
    176  }
    -
    177 
    -
    178  x = x->forward[0];
    -
    179  if (x && x->key == key) {
    -
    180  std::cout << "Found" << std::endl;
    -
    181  return x->value;
    -
    182  } else {
    -
    183  std::cout << "Not Found" << std::endl;
    -
    184  return nullptr;
    -
    185  }
    -
    186  }
    +
    170 {
    + +
    172 std::cout << "Searching for " << key << std::endl;
    +
    173
    +
    174 for (int i = level; i >= 0; i--) {
    +
    175 while (x->forward[i] && x->forward[i]->key < key) x = x->forward[i];
    +
    176 }
    +
    177
    +
    178 x = x->forward[0];
    +
    179 if (x && x->key == key) {
    +
    180 std::cout << "Found" << std::endl;
    +
    181 return x->value;
    +
    182 } else {
    +
    183 std::cout << "Not Found" << std::endl;
    +
    184 return nullptr;
    +
    185 }
    +
    186 }
    Here is the call graph for this function:
    -
    +
    @@ -482,7 +475,7 @@ Here is the call graph for this function:
    diff --git a/d4/d90/classdata__structures_1_1_skip_list.js b/d4/d90/classdata__structures_1_1_skip_list.js index 6e0f28534..426db1331 100644 --- a/d4/d90/classdata__structures_1_1_skip_list.js +++ b/d4/d90/classdata__structures_1_1_skip_list.js @@ -5,7 +5,7 @@ var classdata__structures_1_1_skip_list = [ "displayList", "d4/d90/classdata__structures_1_1_skip_list.html#a812611f80b8079268dbb19cc4e9bee5c", null ], [ "insertElement", "d4/d90/classdata__structures_1_1_skip_list.html#a40a4042bdf0b6683b5f21ae7854de8a9", null ], [ "randomLevel", "d4/d90/classdata__structures_1_1_skip_list.html#aa3f3813e9896792fc86b296547689ba4", null ], - [ "searchElement", "d4/d90/classdata__structures_1_1_skip_list.html#a2249e3ab2f8a0f2334b90635202de4f2", null ], + [ "searchElement", "d4/d90/classdata__structures_1_1_skip_list.html#af2f3d4e15b1f47afac849c2e08a730f4", null ], [ "header", "d4/d90/classdata__structures_1_1_skip_list.html#ad7e392386d7db622185d6f7c718e4f16", null ], [ "level", "d4/d90/classdata__structures_1_1_skip_list.html#a3e249c2c35a8b7f5ffd2d77fee60d650", null ] ]; \ No newline at end of file diff --git a/d4/d90/classdata__structures_1_1_skip_list_a40a4042bdf0b6683b5f21ae7854de8a9_cgraph.svg b/d4/d90/classdata__structures_1_1_skip_list_a40a4042bdf0b6683b5f21ae7854de8a9_cgraph.svg index cacc1f189..5ee21d448 100644 --- a/d4/d90/classdata__structures_1_1_skip_list_a40a4042bdf0b6683b5f21ae7854de8a9_cgraph.svg +++ b/d4/d90/classdata__structures_1_1_skip_list_a40a4042bdf0b6683b5f21ae7854de8a9_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - + + Algorithms_in_C++: vector_cross Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d4/d91/namespacevector__cross.html','.
    -
    -
    vector_cross Namespace Reference
    +
    vector_cross Namespace Reference

    Functions for Vector Cross Product algorithms. More...

    Detailed Description

    -

    Functions for Vector Cross Product algorithms.

    +

    Functions for Vector Cross Product algorithms.

    diff --git a/d4/d96/range__queries_2sparse__table_8cpp.html b/d4/d96/range__queries_2sparse__table_8cpp.html index a6ccaf585..93cb7d94f 100644 --- a/d4/d96/range__queries_2sparse__table_8cpp.html +++ b/d4/d96/range__queries_2sparse__table_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: range_queries/sparse_table.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d4/d96/range__queries_2sparse__table_8 -
    -
    sparse_table.cpp File Reference
    +
    sparse_table.cpp File Reference
    -

    Implementation of Sparse Table data structure. +

    Implementation of Sparse Table data structure. More...

    #include <vector>
    #include <cassert>
    @@ -111,23 +110,23 @@ Include dependency graph for sparse_table.cpp:
    - - + - - + +

    +

    Namespaces

     range_queries
    namespace  range_queries
     Algorithms and Data Structures that support range queries and updates.
     
     sparse_table
     Functions for Implementation of Sparse Table
    namespace  sparse_table
     Functions for Implementation of Sparse Table
     
    - - - - - - - + + + + + + @@ -135,8 +134,8 @@ Functions

    +

    Functions

    template<typename T >
    std::vector< T > range_queries::sparse_table::computeLogs (const std::vector< T > &A)
     
    template<typename T >
    std::vector< std::vector< T > > range_queries::sparse_table::buildTable (const std::vector< T > &A, const std::vector< T > &logs)
     
    template<typename T >
    std::vector< T > range_queries::sparse_table::computeLogs (const std::vector< T > &A)
     
    template<typename T >
    std::vector< std::vector< T > > range_queries::sparse_table::buildTable (const std::vector< T > &A, const std::vector< T > &logs)
     
    template<typename T >
    int range_queries::sparse_table::getMinimum (int beg, int end, const std::vector< T > &logs, const std::vector< std::vector< T > > &table)
     
     

    Detailed Description

    -

    Implementation of Sparse Table data structure.

    -

    Sparse Table is a data structure, that allows answering range queries. It can answer most range queries in O(logn), but its true power is answering range minimum queries or equivalent range maximum queries). For those queries it can compute the answer in O(1) time.

    +

    Implementation of Sparse Table data structure.

    +

    Sparse Table is a data structure, that allows answering range queries. It can answer most range queries in O(logn), but its true power is answering range minimum queries or equivalent range maximum queries). For those queries it can compute the answer in O(1) time.

    • Running Time Complexity
    • @@ -146,8 +145,8 @@ Functions

    Function Documentation

    - -

    ◆ buildTable()

    + +

    ◆ buildTable()

    @@ -155,7 +154,7 @@ Functions template<typename T >
    - + @@ -173,7 +172,7 @@ template<typename T >
    std::vector<std::vector<T> > range_queries::sparse_table::buildTable std::vector< std::vector< T > > range_queries::sparse_table::buildTable ( const std::vector< T > &  A,
    -

    This functions builds the primary data structure sparse table

    Parameters
    +

    This functions builds the primary data structure sparse table

    Parameters
    @@ -182,37 +181,37 @@ template<typename T >
    Returns
    created sparse table data structure
    -
    54  {
    -
    55  int n = A.size();
    -
    56  std::vector<std::vector<T> > table(20, std::vector<T>(n+5, 0));
    -
    57  int curLen = 0;
    -
    58  for (int i = 0 ; i <= logs[n] ; i++) {
    -
    59  curLen = 1 << i;
    -
    60  for (int j = 0 ; j + curLen < n ; j++) {
    -
    61  if (curLen == 1) {
    -
    62  table[i][j] = A[j];
    -
    63  }
    -
    64  else {
    -
    65  table[i][j] = std::min(table[i-1][j], table[i-1][j + curLen/2]);
    -
    66  }
    -
    67  }
    -
    68  }
    -
    69  return table;
    -
    70 }
    +
    54 {
    +
    55 int n = A.size();
    +
    56 std::vector<std::vector<T> > table(20, std::vector<T>(n+5, 0));
    +
    57 int curLen = 0;
    +
    58 for (int i = 0 ; i <= logs[n] ; i++) {
    +
    59 curLen = 1 << i;
    +
    60 for (int j = 0 ; j + curLen < n ; j++) {
    +
    61 if (curLen == 1) {
    +
    62 table[i][j] = A[j];
    +
    63 }
    +
    64 else {
    +
    65 table[i][j] = std::min(table[i-1][j], table[i-1][j + curLen/2]);
    +
    66 }
    +
    67 }
    +
    68 }
    +
    69 return table;
    +
    70}
    T min(T... args)
    T size(T... args)
    Here is the call graph for this function:
    -
    +
    - -

    ◆ computeLogs()

    + +

    ◆ computeLogs()

    @@ -220,7 +219,7 @@ Here is the call graph for this function:
    template<typename T >
    nvalue of the size of the input array
    Aarray of the input integers
    - + @@ -228,32 +227,32 @@ template<typename T >
    std::vector<T> range_queries::sparse_table::computeLogs std::vector< T > range_queries::sparse_table::computeLogs ( const std::vector< T > &  A)
    -

    This function precomputes intial log table for further use.

    Parameters
    +

    This function precomputes intial log table for further use.

    Parameters
    nvalue of the size of the input array
    Returns
    corresponding vector of the log table
    -
    36  {
    -
    37  int n = A.size();
    -
    38  std::vector<T> logs(n);
    -
    39  logs[1] = 0;
    -
    40  for (int i = 2 ; i < n ; i++) {
    -
    41  logs[i] = logs[i/2] + 1;
    -
    42  }
    -
    43  return logs;
    -
    44 }
    +
    36 {
    +
    37 int n = A.size();
    +
    38 std::vector<T> logs(n);
    +
    39 logs[1] = 0;
    +
    40 for (int i = 2 ; i < n ; i++) {
    +
    41 logs[i] = logs[i/2] + 1;
    +
    42 }
    +
    43 return logs;
    +
    44}
    Here is the call graph for this function:
    -
    +
    - +

    ◆ getMinimum()

    @@ -292,7 +291,7 @@ template<typename T >
    -

    This function is the query function to get the range minimum value

    Parameters
    +

    This function is the query function to get the range minimum value

    Parameters
    @@ -302,11 +301,11 @@ template<typename T >
    Returns
    minimum value for the [beg, end] range for the input array
    -
    81  {
    -
    82  int p = logs[end - beg + 1];
    -
    83  int pLen = 1 << p;
    -
    84  return std::min(table[p][beg], table[p][end - pLen + 1]);
    -
    85 }
    +
    81 {
    +
    82 int p = logs[end - beg + 1];
    +
    83 int pLen = 1 << p;
    +
    84 return std::min(table[p][beg], table[p][end - pLen + 1]);
    +
    85}
    T end(T... args)
    Here is the call graph for this function:
    @@ -317,7 +316,7 @@ Here is the call graph for this function:
    - +

    ◆ main()

    @@ -332,18 +331,18 @@ Here is the call graph for this function:
    begbeginning index of the query range
    endending index of the query range
    -

    Main function

    -
    92  {
    -
    93  std::vector<int> A{1, 2, 0, 3, 9};
    - - -
    96  assert(range_queries::sparse_table::getMinimum(0, 0, logs, table) == 1);
    -
    97  assert(range_queries::sparse_table::getMinimum(0, 4, logs, table) == 0);
    -
    98  assert(range_queries::sparse_table::getMinimum(2, 4, logs, table) == 0);
    -
    99  return 0;
    -
    100 }
    -
    std::vector< std::vector< T > > buildTable(const std::vector< T > &A, const std::vector< T > &logs)
    Definition: sparse_table.cpp:54
    -
    std::vector< T > computeLogs(const std::vector< T > &A)
    Definition: sparse_table.cpp:36
    +

    Main function

    +
    92 {
    +
    93 std::vector<int> A{1, 2, 0, 3, 9};
    + + +
    96 assert(range_queries::sparse_table::getMinimum(0, 0, logs, table) == 1);
    +
    97 assert(range_queries::sparse_table::getMinimum(0, 4, logs, table) == 0);
    +
    98 assert(range_queries::sparse_table::getMinimum(2, 4, logs, table) == 0);
    +
    99 return 0;
    +
    100}
    +
    std::vector< T > computeLogs(const std::vector< T > &A)
    Definition: sparse_table.cpp:36
    +
    std::vector< std::vector< T > > buildTable(const std::vector< T > &A, const std::vector< T > &logs)
    Definition: sparse_table.cpp:54
    @@ -353,7 +352,7 @@ Here is the call graph for this function:
    diff --git a/d4/d96/range__queries_2sparse__table_8cpp.js b/d4/d96/range__queries_2sparse__table_8cpp.js index 1cb06f097..de5924584 100644 --- a/d4/d96/range__queries_2sparse__table_8cpp.js +++ b/d4/d96/range__queries_2sparse__table_8cpp.js @@ -1,7 +1,7 @@ var range__queries_2sparse__table_8cpp = [ - [ "buildTable", "d4/d96/range__queries_2sparse__table_8cpp.html#a328ed1c01cccd07aeb1500c11b609be3", null ], - [ "computeLogs", "d4/d96/range__queries_2sparse__table_8cpp.html#ad71ae7840af3a52e7ee56186bb0c3063", null ], + [ "buildTable", "d4/d96/range__queries_2sparse__table_8cpp.html#a803a2451e87021d14ae06f148383e6bc", null ], + [ "computeLogs", "d4/d96/range__queries_2sparse__table_8cpp.html#a40810d8c0fe3f8cf432ab128b1ae0300", null ], [ "getMinimum", "d4/d96/range__queries_2sparse__table_8cpp.html#a932816c3de9e5ad122b180de60978e8f", null ], [ "main", "d4/d96/range__queries_2sparse__table_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] ]; \ No newline at end of file diff --git a/d4/d96/range__queries_2sparse__table_8cpp_ad71ae7840af3a52e7ee56186bb0c3063_cgraph.map b/d4/d96/range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.map similarity index 100% rename from d4/d96/range__queries_2sparse__table_8cpp_ad71ae7840af3a52e7ee56186bb0c3063_cgraph.map rename to d4/d96/range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.map diff --git a/d4/d96/range__queries_2sparse__table_8cpp_ad71ae7840af3a52e7ee56186bb0c3063_cgraph.md5 b/d4/d96/range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.md5 similarity index 100% rename from d4/d96/range__queries_2sparse__table_8cpp_ad71ae7840af3a52e7ee56186bb0c3063_cgraph.md5 rename to d4/d96/range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.md5 diff --git a/d4/d96/range__queries_2sparse__table_8cpp_ad71ae7840af3a52e7ee56186bb0c3063_cgraph.svg b/d4/d96/range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.svg similarity index 97% rename from d4/d96/range__queries_2sparse__table_8cpp_ad71ae7840af3a52e7ee56186bb0c3063_cgraph.svg rename to d4/d96/range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.svg index 283e628ff..3d8912b87 100644 --- a/d4/d96/range__queries_2sparse__table_8cpp_ad71ae7840af3a52e7ee56186bb0c3063_cgraph.svg +++ b/d4/d96/range__queries_2sparse__table_8cpp_a40810d8c0fe3f8cf432ab128b1ae0300_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: math/primes_up_to_billion.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('d4/d9c/primes__up__to__billion_8cpp.ht -
    -
    primes_up_to_billion.cpp File Reference
    +
    primes_up_to_billion.cpp File Reference
    @@ -109,23 +108,23 @@ Include dependency graph for primes_up_to_billion.cpp:
    -

    +

    Functions

    void Sieve (int64_t n)
     
    int main ()
     
    -

    +

    Variables

    char prime [100000000]
     

    Detailed Description

    -

    Compute prime numbers upto 1 billion.

    +

    Compute prime numbers upto 1 billion.

    See also
    prime_numbers.cpp sieve_of_eratosthenes.cpp

    Function Documentation

    - +

    ◆ main()

    @@ -140,18 +139,18 @@ Variables
    -

    Main function

    -
    26  {
    -
    27  Sieve(100000000);
    -
    28  int64_t n;
    -
    29  std::cin >> n; // 10006187
    -
    30  if (prime[n] == '1')
    -
    31  std::cout << "YES\n";
    -
    32  else
    -
    33  std::cout << "NO\n";
    -
    34 
    -
    35  return 0;
    -
    36 }
    +

    Main function

    +
    26 {
    +
    27 Sieve(100000000);
    +
    28 int64_t n;
    +
    29 std::cin >> n; // 10006187
    +
    30 if (prime[n] == '1')
    +
    31 std::cout << "YES\n";
    +
    32 else
    +
    33 std::cout << "NO\n";
    +
    34
    +
    35 return 0;
    +
    36}
    void Sieve(int64_t n)
    Definition: primes_up_to_billion.cpp:13
    @@ -165,7 +164,7 @@ Here is the call graph for this function:
    - +

    ◆ Sieve()

    @@ -180,24 +179,24 @@ Here is the call graph for this function:
    -

    Perform Sieve algorithm

    -
    13  {
    -
    14  memset(prime, '1', sizeof(prime)); // intitize '1' to every index
    -
    15  prime[0] = '0'; // 0 is not prime
    -
    16  prime[1] = '0'; // 1 is not prime
    -
    17  for (int64_t p = 2; p * p <= n; p++) {
    -
    18  if (prime[p] == '1') {
    -
    19  for (int64_t i = p * p; i <= n; i += p)
    -
    20  prime[i] = '0'; // set all multiples of p to false
    -
    21  }
    -
    22  }
    -
    23 }
    +

    Perform Sieve algorithm

    +
    13 {
    +
    14 memset(prime, '1', sizeof(prime)); // intitize '1' to every index
    +
    15 prime[0] = '0'; // 0 is not prime
    +
    16 prime[1] = '0'; // 1 is not prime
    +
    17 for (int64_t p = 2; p * p <= n; p++) {
    +
    18 if (prime[p] == '1') {
    +
    19 for (int64_t i = p * p; i <= n; i += p)
    +
    20 prime[i] = '0'; // set all multiples of p to false
    +
    21 }
    +
    22 }
    +
    23}
    T memset(T... args)

    Variable Documentation

    - +

    ◆ prime

    @@ -208,7 +207,7 @@ Here is the call graph for this function:
    -

    array to store the primes

    +

    array to store the primes

    @@ -218,7 +217,7 @@ Here is the call graph for this function: diff --git a/d4/d9c/primes__up__to__billion_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d4/d9c/primes__up__to__billion_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index e843780de..7bddd63b7 100644 --- a/d4/d9c/primes__up__to__billion_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d4/d9c/primes__up__to__billion_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: math/sum_of_binomial_coefficient.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('d4/d9d/sum__of__binomial__coefficient_ -
    -
    sum_of_binomial_coefficient.cpp File Reference
    +
    sum_of_binomial_coefficient.cpp File Reference
    @@ -109,13 +108,13 @@ Include dependency graph for sum_of_binomial_coefficient.cpp:
    - - +

    +

    Namespaces

     math
    namespace  math
     for IO operations
     
    - @@ -126,11 +125,11 @@ Functions

    +

    Functions

    uint64_t math::binomialCoeffSum (uint64_t n)
     
     

    Detailed Description

    -

    Algorithm to find sum of binomial coefficients of a given positive integer.

    -

    Given a positive integer n, the task is to find the sum of binomial coefficient i.e nC0 + nC1 + nC2 + ... + nCn-1 + nCn By induction, we can prove that the sum is equal to 2^n

    See also
    more on https://en.wikipedia.org/wiki/Binomial_coefficient#Sums_of_the_binomial_coefficients
    -
    Author
    muskan0719
    +

    Algorithm to find sum of binomial coefficients of a given positive integer.

    +

    Given a positive integer n, the task is to find the sum of binomial coefficient i.e nC0 + nC1 + nC2 + ... + nCn-1 + nCn By induction, we can prove that the sum is equal to 2^n

    See also
    more on https://en.wikipedia.org/wiki/Binomial_coefficient#Sums_of_the_binomial_coefficients
    +
    Author
    muskan0719

    Function Documentation

    - +

    ◆ main()

    @@ -148,10 +147,10 @@ Functions

    Main function.

    Returns
    0 on exit
    -
    63  {
    -
    64  test(); // execute the tests
    -
    65  return 0;
    -
    66 }
    +
    63 {
    +
    64 test(); // execute the tests
    +
    65 return 0;
    +
    66}
    static void test()
    Definition: sum_of_binomial_coefficient.cpp:37
    Here is the call graph for this function:
    @@ -162,7 +161,7 @@ Here is the call graph for this function:
    - +

    ◆ test()

    @@ -184,28 +183,28 @@ Here is the call graph for this function:
    -

    Function for testing binomialCoeffSum function. test cases and assert statement.

    Returns
    void
    -
    37  {
    -
    38  int test_case_1 = math::binomialCoeffSum(2);
    -
    39  assert(test_case_1 == 4);
    -
    40  std::cout << "Test_case_1 Passed!" << std::endl;
    -
    41 
    -
    42  int test_case_2 = math::binomialCoeffSum(3);
    -
    43  assert(test_case_2 == 8);
    -
    44  std::cout << "Test_case_2 Passed!" << std::endl;
    -
    45 
    -
    46  int test_case_3 = math::binomialCoeffSum(4);
    -
    47  assert(test_case_3 == 16);
    -
    48  std::cout << "Test_case_3 Passed!" << std::endl;
    -
    49 
    -
    50  int test_case_4 = math::binomialCoeffSum(5);
    -
    51  assert(test_case_4 == 32);
    -
    52  std::cout << "Test_case_4 Passed!" << std::endl;
    -
    53 
    -
    54  int test_case_5 = math::binomialCoeffSum(7);
    -
    55  assert(test_case_5 == 128);
    -
    56  std::cout << "Test_case_5 Passed!" << std::endl;
    -
    57 }
    +

    Function for testing binomialCoeffSum function. test cases and assert statement.

    Returns
    void
    +
    37 {
    +
    38 int test_case_1 = math::binomialCoeffSum(2);
    +
    39 assert(test_case_1 == 4);
    +
    40 std::cout << "Test_case_1 Passed!" << std::endl;
    +
    41
    +
    42 int test_case_2 = math::binomialCoeffSum(3);
    +
    43 assert(test_case_2 == 8);
    +
    44 std::cout << "Test_case_2 Passed!" << std::endl;
    +
    45
    +
    46 int test_case_3 = math::binomialCoeffSum(4);
    +
    47 assert(test_case_3 == 16);
    +
    48 std::cout << "Test_case_3 Passed!" << std::endl;
    +
    49
    +
    50 int test_case_4 = math::binomialCoeffSum(5);
    +
    51 assert(test_case_4 == 32);
    +
    52 std::cout << "Test_case_4 Passed!" << std::endl;
    +
    53
    +
    54 int test_case_5 = math::binomialCoeffSum(7);
    +
    55 assert(test_case_5 == 128);
    +
    56 std::cout << "Test_case_5 Passed!" << std::endl;
    +
    57}
    T endl(T... args)
    uint64_t binomialCoeffSum(uint64_t n)
    Definition: sum_of_binomial_coefficient.cpp:26
    @@ -224,7 +223,7 @@ Here is the call graph for this function:
    diff --git a/d4/d9d/sum__of__binomial__coefficient_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d4/d9d/sum__of__binomial__coefficient_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index ed4e9249e..f291efdf6 100644 --- a/d4/d9d/sum__of__binomial__coefficient_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d4/d9d/sum__of__binomial__coefficient_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: math/gcd_iterative_euclidean.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('d4/da0/gcd__iterative__euclidean_8cpp.
    -
    -
    gcd_iterative_euclidean.cpp File Reference
    +
    gcd_iterative_euclidean.cpp File Reference
    -

    Compute the greatest common denominator of two integers using iterative form of Euclidean algorithm +

    Compute the greatest common denominator of two integers using iterative form of Euclidean algorithm More...

    #include <iostream>
    #include <stdexcept>
    @@ -108,7 +107,7 @@ Include dependency graph for gcd_iterative_euclidean.cpp:
    - @@ -116,10 +115,10 @@ Functions

    +

    Functions

    int gcd (int num1, int num2)
     
     

    Detailed Description

    -

    Compute the greatest common denominator of two integers using iterative form of Euclidean algorithm

    +

    Compute the greatest common denominator of two integers using iterative form of Euclidean algorithm

    See also
    gcd_recursive_euclidean.cpp, gcd_of_n_numbers.cpp

    Function Documentation

    - +

    ◆ gcd()

    @@ -144,40 +143,40 @@ Functions
    -

    algorithm

    -
    15  {
    -
    16  if (num1 <= 0 | num2 <= 0) {
    -
    17  throw std::domain_error("Euclidean algorithm domain is for ints > 0");
    -
    18  }
    -
    19 
    -
    20  if (num1 == num2) {
    -
    21  return num1;
    -
    22  }
    -
    23 
    -
    24  int base_num = 0;
    -
    25  int previous_remainder = 1;
    -
    26 
    -
    27  if (num1 > num2) {
    -
    28  base_num = num1;
    -
    29  previous_remainder = num2;
    -
    30  } else {
    -
    31  base_num = num2;
    -
    32  previous_remainder = num1;
    -
    33  }
    -
    34 
    -
    35  while ((base_num % previous_remainder) != 0) {
    -
    36  int old_base = base_num;
    -
    37  base_num = previous_remainder;
    -
    38  previous_remainder = old_base % previous_remainder;
    -
    39  }
    -
    40 
    -
    41  return previous_remainder;
    -
    42 }
    +

    algorithm

    +
    15 {
    +
    16 if (num1 <= 0 | num2 <= 0) {
    +
    17 throw std::domain_error("Euclidean algorithm domain is for ints > 0");
    +
    18 }
    +
    19
    +
    20 if (num1 == num2) {
    +
    21 return num1;
    +
    22 }
    +
    23
    +
    24 int base_num = 0;
    +
    25 int previous_remainder = 1;
    +
    26
    +
    27 if (num1 > num2) {
    +
    28 base_num = num1;
    +
    29 previous_remainder = num2;
    +
    30 } else {
    +
    31 base_num = num2;
    +
    32 previous_remainder = num1;
    +
    33 }
    +
    34
    +
    35 while ((base_num % previous_remainder) != 0) {
    +
    36 int old_base = base_num;
    +
    37 base_num = previous_remainder;
    +
    38 previous_remainder = old_base % previous_remainder;
    +
    39 }
    +
    40
    +
    41 return previous_remainder;
    +
    42}
    - +

    ◆ main()

    @@ -192,19 +191,19 @@ Functions
    -

    Main function

    -
    47  {
    -
    48  std::cout << "gcd of 120,7 is " << (gcd(120, 7)) << std::endl;
    -
    49  try {
    -
    50  std::cout << "gcd of -120,10 is " << gcd(-120, 10) << std::endl;
    -
    51  } catch (const std::domain_error &e) {
    -
    52  std::cout << "Error handling was successful" << std::endl;
    -
    53  }
    -
    54  std::cout << "gcd of 312,221 is " << (gcd(312, 221)) << std::endl;
    -
    55  std::cout << "gcd of 289,204 is " << (gcd(289, 204)) << std::endl;
    -
    56 
    -
    57  return 0;
    -
    58 }
    +

    Main function

    +
    47 {
    +
    48 std::cout << "gcd of 120,7 is " << (gcd(120, 7)) << std::endl;
    +
    49 try {
    +
    50 std::cout << "gcd of -120,10 is " << gcd(-120, 10) << std::endl;
    +
    51 } catch (const std::domain_error &e) {
    +
    52 std::cout << "Error handling was successful" << std::endl;
    +
    53 }
    +
    54 std::cout << "gcd of 312,221 is " << (gcd(312, 221)) << std::endl;
    +
    55 std::cout << "gcd of 289,204 is " << (gcd(289, 204)) << std::endl;
    +
    56
    +
    57 return 0;
    +
    58}
    T endl(T... args)
    int gcd(int num1, int num2)
    Definition: gcd_iterative_euclidean.cpp:15
    @@ -223,7 +222,7 @@ Here is the call graph for this function:
    diff --git a/d4/da0/gcd__iterative__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d4/da0/gcd__iterative__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index f43cb4f4d..3094271e2 100644 --- a/d4/da0/gcd__iterative__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d4/da0/gcd__iterative__euclidean_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: SegmentIntersection Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -93,15 +93,13 @@ $(document).ready(function(){initNavTree('d4/db4/struct_segment_intersection.htm -
    -
    SegmentIntersection Struct Reference
    +
    SegmentIntersection Struct Reference
    - - + @@ -109,9 +107,9 @@ bool 

    +

    Public Member Functions

    -bool intersect (Point first_point, Point second_point, Point third_point, Point forth_point)
    bool intersect (Point first_point, Point second_point, Point third_point, Point forth_point)
     
    int direction (Point first_point, Point second_point, Point third_point)
     
    intersect ( 

    Detailed Description

    -

    intersect returns true if segments of two line intersects and false if they do not. It calls the subroutines direction which computes the orientation.

    +

    intersect returns true if segments of two line intersects and false if they do not. It calls the subroutines direction which computes the orientation.

    Member Function Documentation

    - +

    ◆ direction()

    @@ -150,18 +148,97 @@ bool intersect (
    -

    We will find direction of line here respect to @first_point. Here @second_point and @third_point is first and second points of the line respectively. we want a method to determine which way a given angle these three points turns. If returned number is negative, then the angle is counter-clockwise. That means the line is going to right to left. We will fount angle as clockwise if the method returns positive number.

    -
    64  {
    -
    65  return ((third_point.x - first_point.x) *
    -
    66  (second_point.y - first_point.y)) -
    -
    67  ((second_point.x - first_point.x) *
    -
    68  (third_point.y - first_point.y));
    -
    69  }
    +

    We will find direction of line here respect to @first_point. Here @second_point and @third_point is first and second points of the line respectively. we want a method to determine which way a given angle these three points turns. If returned number is negative, then the angle is counter-clockwise. That means the line is going to right to left. We will fount angle as clockwise if the method returns positive number.

    +
    64 {
    +
    65 return ((third_point.x - first_point.x) *
    +
    66 (second_point.y - first_point.y)) -
    +
    67 ((second_point.x - first_point.x) *
    +
    68 (third_point.y - first_point.y));
    +
    69 }
    int y
    Point respect to x coordinate.
    Definition: line_segment_intersection.cpp:14
    - + +

    ◆ intersect()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    bool SegmentIntersection::intersect (Point first_point,
    Point second_point,
    Point third_point,
    Point forth_point 
    )
    +
    +inline
    +
    +
    24 {
    +
    25 int direction1 = direction(third_point, forth_point, first_point);
    +
    26 int direction2 = direction(third_point, forth_point, second_point);
    +
    27 int direction3 = direction(first_point, second_point, third_point);
    +
    28 int direction4 = direction(first_point, second_point, forth_point);
    +
    29
    +
    30 if ((direction1 < 0 || direction2 > 0) &&
    +
    31 (direction3 < 0 || direction4 > 0))
    +
    32 return true;
    +
    33
    +
    34 else if (direction1 == 0 &&
    +
    35 on_segment(third_point, forth_point, first_point))
    +
    36 return true;
    +
    37
    +
    38 else if (direction2 == 0 &&
    +
    39 on_segment(third_point, forth_point, second_point))
    +
    40 return true;
    +
    41
    +
    42 else if (direction3 == 0 &&
    +
    43 on_segment(first_point, second_point, third_point))
    +
    44 return true;
    +
    45
    +
    46 else if (direction3 == 0 &&
    +
    47 on_segment(first_point, second_point, forth_point))
    +
    48 return true;
    +
    49
    +
    50 else
    +
    51 return false;
    +
    52 }
    +
    bool on_segment(Point first_point, Point second_point, Point third_point)
    Definition: line_segment_intersection.cpp:75
    +
    int direction(Point first_point, Point second_point, Point third_point)
    Definition: line_segment_intersection.cpp:63
    +
    +
    +
    +

    ◆ on_segment()

    @@ -200,17 +277,17 @@ bool intersect (
    -

    This method determines whether a point known to be colinear with a segment lies on that segment.

    -
    76  {
    -
    77  if (std::min(first_point.x, second_point.x) <= third_point.x &&
    -
    78  third_point.x <= std::max(first_point.x, second_point.x) &&
    -
    79  std::min(first_point.y, second_point.y) <= third_point.y &&
    -
    80  third_point.y <= std::max(first_point.y, second_point.y))
    -
    81  return true;
    -
    82 
    -
    83  else
    -
    84  return false;
    -
    85  }
    +

    This method determines whether a point known to be colinear with a segment lies on that segment.

    +
    76 {
    +
    77 if (std::min(first_point.x, second_point.x) <= third_point.x &&
    +
    78 third_point.x <= std::max(first_point.x, second_point.x) &&
    +
    79 std::min(first_point.y, second_point.y) <= third_point.y &&
    +
    80 third_point.y <= std::max(first_point.y, second_point.y))
    +
    81 return true;
    +
    82
    +
    83 else
    +
    84 return false;
    +
    85 }
    T max(T... args)
    T min(T... args)
    @@ -231,7 +308,7 @@ Here is the call graph for this function:
    diff --git a/d4/db4/struct_segment_intersection.js b/d4/db4/struct_segment_intersection.js index d0b7e7779..d7d655a77 100644 --- a/d4/db4/struct_segment_intersection.js +++ b/d4/db4/struct_segment_intersection.js @@ -1,6 +1,5 @@ var struct_segment_intersection = [ [ "direction", "d4/db4/struct_segment_intersection.html#a3beb2ac1b35d67354f1dbaf9a971e655", null ], - [ "intersect", "d4/db4/struct_segment_intersection.html#aefd077282f45bd16799b53f8aa430ffd", null ], [ "on_segment", "d4/db4/struct_segment_intersection.html#a008941b2272866c64cdaf959afa939bf", null ] ]; \ No newline at end of file diff --git a/d4/db4/struct_segment_intersection_a008941b2272866c64cdaf959afa939bf_cgraph.svg b/d4/db4/struct_segment_intersection_a008941b2272866c64cdaf959afa939bf_cgraph.svg index 9e9c512d7..3a9fd99b3 100644 --- a/d4/db4/struct_segment_intersection_a008941b2272866c64cdaf959afa939bf_cgraph.svg +++ b/d4/db4/struct_segment_intersection_a008941b2272866c64cdaf959afa939bf_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -90,24 +90,23 @@ $(document).ready(function(){initNavTree('d5/d29/struct_min_heap_node.html','../
    -
    -
    MinHeapNode Member List
    +
    MinHeapNode Member List

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

    - + - +
    data (defined in MinHeapNode)MinHeapNode
    freq (defined in MinHeapNode)MinHeapNode
    freq (defined in MinHeapNode)MinHeapNode
    left (defined in MinHeapNode)MinHeapNode
    MinHeapNode(char data, unsigned freq) (defined in MinHeapNode)MinHeapNodeinline
    MinHeapNode(char data, unsigned freq) (defined in MinHeapNode)MinHeapNodeinline
    right (defined in MinHeapNode)MinHeapNode
    diff --git a/d4/db9/namespacencr__modulo__p.html b/d4/db9/namespacencr__modulo__p.html index 1de743c14..f3d763c3e 100644 --- a/d4/db9/namespacencr__modulo__p.html +++ b/d4/db9/namespacencr__modulo__p.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: ncr_modulo_p Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d4/db9/namespacencr__modulo__p.html','
    -
    -
    ncr_modulo_p Namespace Reference
    +
    ncr_modulo_p Namespace Reference
    -

    Functions for nCr modulo p implementation. +

    Functions for nCr modulo p implementation. More...

    Detailed Description

    -

    Functions for nCr modulo p implementation.

    +

    Functions for nCr modulo p implementation.

    diff --git a/d4/dc7/extended__euclid__algorithm_8cpp__incl.svg b/d4/dc7/extended__euclid__algorithm_8cpp__incl.svg index 8f14ab254..c92e42073 100644 --- a/d4/dc7/extended__euclid__algorithm_8cpp__incl.svg +++ b/d4/dc7/extended__euclid__algorithm_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - diff --git a/d4/dcb/classstack__coll__graph.md5 b/d4/dcb/classstack__coll__graph.md5 deleted file mode 100644 index eefd345aa..000000000 --- a/d4/dcb/classstack__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -c463627e1ba30d2b25996809dbf22d22 \ No newline at end of file diff --git a/d4/dcb/classstack__coll__graph.svg b/d4/dcb/classstack__coll__graph.svg deleted file mode 100644 index edec01285..000000000 --- a/d4/dcb/classstack__coll__graph.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - -stack< Type > - - - -Node1 - - -stack< Type > - - - - - -Node2 - - -node< Type > - - - - - -Node2->Node1 - - - stackTop - - - diff --git a/d4/dd2/namespacequadratic__probing.html b/d4/dd2/namespacequadratic__probing.html index 9f2236b44..af34aea45 100644 --- a/d4/dd2/namespacequadratic__probing.html +++ b/d4/dd2/namespacequadratic__probing.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: quadratic_probing Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -95,26 +95,25 @@ $(document).ready(function(){initNavTree('d4/dd2/namespacequadratic__probing.htm Typedefs | Functions | Variables -
    -
    quadratic_probing Namespace Reference
    +
    quadratic_probing Namespace Reference
    -

    An implementation of hash table using quadratic probing algorithm. +

    An implementation of hash table using quadratic probing algorithm. More...

    -

    +

    Classes

    struct  Entry
     
    - - - + +

    +

    Typedefs

    -using Entry = struct Entry
     
    +using Entry = Entry
     
    - @@ -139,31 +138,31 @@ Functions

    +

    Functions

    bool putProber (const Entry &entry, int key)
     
    void removalInfo (int key)
     
    - - - - - - -

    +

    Variables

    +
    int notPresent
     
    +
    std::vector< Entrytable
     
    +
    int totalSize
     
    +
    int tomb = -1
     
    +
    int size
     
    +
    bool rehashing
     

    Detailed Description

    -

    An implementation of hash table using quadratic probing algorithm.

    +

    An implementation of hash table using quadratic probing algorithm.

    Function Documentation

    - +

    ◆ add()

    @@ -178,20 +177,20 @@ bool rehashing
    -

    Checks for load factor here

    Parameters
    +

    Checks for load factor here

    Parameters
    keykey value to hash and add to table
    -
    182  {
    -
    183  int index = quadraticProbe(key, false);
    -
    184  table[index].key = key;
    -
    185  // Load factor greater than 0.5 causes resizing
    -
    186  if (++size / static_cast<double>(totalSize) >= 0.5) {
    -
    187  rehash();
    -
    188  }
    -
    189 }
    +
    182 {
    +
    183 int index = quadraticProbe(key, false);
    +
    184 table[index].key = key;
    +
    185 // Load factor greater than 0.5 causes resizing
    +
    186 if (++size / static_cast<double>(totalSize) >= 0.5) {
    +
    187 rehash();
    +
    188 }
    +
    189}
    int quadraticProbe(int key, bool searching)
    Definition: quadratic_probing_hash_table.cpp:56
    void rehash()
    Definition: quadratic_probing_hash_table.cpp:160
    @@ -203,7 +202,7 @@ Here is the call graph for this function:
    - +

    ◆ addInfo()

    @@ -218,23 +217,23 @@ Here is the call graph for this function:
    -

    Information about the adding process

    Parameters
    +

    Information about the adding process

    Parameters
    keykey value to hash and add to table
    -
    207  {
    -
    208  std::cout << "Initial table: ";
    -
    209  display();
    -
    210  std::cout << std::endl;
    -
    211  std::cout << "hash of " << key << " is " << hashFxn(key) << " % "
    -
    212  << totalSize << " == " << hashFxn(key) % totalSize;
    -
    213  std::cout << std::endl;
    -
    214  add(key);
    -
    215  std::cout << "New table: ";
    -
    216  display();
    -
    217 }
    +
    207 {
    +
    208 std::cout << "Initial table: ";
    +
    209 display();
    + +
    211 std::cout << "hash of " << key << " is " << hashFxn(key) << " % "
    +
    212 << totalSize << " == " << hashFxn(key) % totalSize;
    + +
    214 add(key);
    +
    215 std::cout << "New table: ";
    +
    216 display();
    +
    217}
    T endl(T... args)
    void add(int key)
    Definition: quadratic_probing_hash_table.cpp:182
    @@ -249,7 +248,7 @@ Here is the call graph for this function:
    - +

    ◆ display()

    @@ -263,21 +262,21 @@ Here is the call graph for this function:
    -

    Displays the table

    Returns
    None
    -
    142  {
    -
    143  for (int i = 0; i < totalSize; i++) {
    -
    144  if (table[i].key == notPresent) {
    -
    145  std::cout << " Empty ";
    -
    146  } else if (table[i].key == tomb) {
    -
    147  std::cout << " Tomb ";
    -
    148  } else {
    -
    149  std::cout << " ";
    -
    150  std::cout << table[i].key;
    -
    151  std::cout << " ";
    -
    152  }
    -
    153  }
    -
    154  std::cout << std::endl;
    -
    155 }
    +

    Displays the table

    Returns
    None
    +
    142 {
    +
    143 for (int i = 0; i < totalSize; i++) {
    +
    144 if (table[i].key == notPresent) {
    +
    145 std::cout << " Empty ";
    +
    146 } else if (table[i].key == tomb) {
    +
    147 std::cout << " Tomb ";
    +
    148 } else {
    +
    149 std::cout << " ";
    +
    150 std::cout << table[i].key;
    +
    151 std::cout << " ";
    +
    152 }
    +
    153 }
    + +
    155}
    Here is the call graph for this function:
    @@ -287,7 +286,7 @@ Here is the call graph for this function:
    - +

    ◆ find()

    @@ -302,7 +301,7 @@ Here is the call graph for this function:
    -

    Get the entry instance corresponding to a key

    Parameters
    +

    Get the entry instance corresponding to a key

    Parameters
    keykey value to search/probe
    @@ -311,13 +310,13 @@ Here is the call graph for this function:
    Returns
    if present, the entry instance
    if not present, a new instance
    -
    131  {
    -
    132  int index = quadraticProbe(key, true);
    -
    133  if (index == notPresent) {
    -
    134  return Entry();
    -
    135  }
    -
    136  return table[index];
    -
    137 }
    +
    131 {
    +
    132 int index = quadraticProbe(key, true);
    +
    133 if (index == notPresent) {
    +
    134 return Entry();
    +
    135 }
    +
    136 return table[index];
    +
    137}
    Definition: quadratic_probing_hash_table.cpp:37
    Here is the call graph for this function:
    @@ -328,7 +327,7 @@ Here is the call graph for this function:
    - +

    ◆ hashFxn()

    @@ -343,22 +342,22 @@ Here is the call graph for this function:
    -

    Hash a key

    Parameters
    +

    Hash a key

    Parameters
    keykey value to hash
    Returns
    hash of the key
    -
    46  {
    -
    47  std::hash<int> hash;
    -
    48  return hash(key);
    -
    49 }
    +
    46 {
    +
    47 std::hash<int> hash;
    +
    48 return hash(key);
    +
    49}
    - +

    ◆ putProber()

    @@ -383,7 +382,7 @@ Here is the call graph for this function:
    -

    Finds empty spot

    Parameters
    +

    Finds empty spot

    Parameters
    @@ -393,17 +392,17 @@ Here is the call graph for this function:
    Returns
    true if key is present
    false if key is absent
    -
    106  {
    -
    107  if (entry.key == notPresent || entry.key == tomb) {
    -
    108  return true;
    -
    109  }
    -
    110  return false;
    -
    111 }
    +
    106 {
    +
    107 if (entry.key == notPresent || entry.key == tomb) {
    +
    108 return true;
    +
    109 }
    +
    110 return false;
    +
    111}
    int key
    key value
    Definition: quadratic_probing_hash_table.cpp:39
    - +

    ◆ quadraticProbe()

    @@ -428,56 +427,56 @@ Here is the call graph for this function:
    entryInstance of table entry
    keykey value to search/probe
    -

    Performs quadratic probing to resolve collisions

    Parameters
    +

    Performs quadratic probing to resolve collisions

    Parameters
    keykey value to search/probe
    searchingtrue if only searching, false1 if assigning @returns value ofnotPresent`.
    -
    56  {
    -
    57  int hash = static_cast<int>(hashFxn(key));
    -
    58  int i = 0;
    -
    59  Entry entry;
    -
    60  do {
    -
    61  size_t index =
    -
    62  (hash + static_cast<size_t>(std::round(std::pow(i, 2)))) %
    -
    63  totalSize;
    -
    64  entry = table[index];
    -
    65  if (searching) {
    -
    66  if (entry.key == notPresent) {
    -
    67  return notPresent;
    -
    68  }
    -
    69  if (searchingProber(entry, key)) {
    -
    70  std::cout << "Found key!" << std::endl;
    -
    71  return index;
    -
    72  }
    -
    73  std::cout << "Found tombstone or equal hash, checking next"
    -
    74  << std::endl;
    -
    75  i++;
    -
    76  } else {
    -
    77  if (putProber(entry, key)) {
    -
    78  if (!rehashing) {
    -
    79  std::cout << "Spot found!" << std::endl;
    -
    80  }
    -
    81  return index;
    -
    82  }
    -
    83  if (!rehashing) {
    -
    84  std::cout << "Spot taken, looking at next (next index = "
    -
    85  << (hash + static_cast<size_t>(
    -
    86  std::round(std::pow(i + 1, 2)))) %
    -
    87  totalSize
    -
    88  << std::endl;
    -
    89  }
    -
    90  i++;
    -
    91  }
    -
    92  if (i == totalSize * 100) {
    -
    93  std::cout << "Quadratic probe failed (infinite loop)" << std::endl;
    -
    94  return notPresent;
    -
    95  }
    -
    96  } while (entry.key != notPresent);
    -
    97  return notPresent;
    -
    98 }
    +
    56 {
    +
    57 int hash = static_cast<int>(hashFxn(key));
    +
    58 int i = 0;
    +
    59 Entry entry;
    +
    60 do {
    +
    61 size_t index =
    +
    62 (hash + static_cast<size_t>(std::round(std::pow(i, 2)))) %
    +
    63 totalSize;
    +
    64 entry = table[index];
    +
    65 if (searching) {
    +
    66 if (entry.key == notPresent) {
    +
    67 return notPresent;
    +
    68 }
    +
    69 if (searchingProber(entry, key)) {
    +
    70 std::cout << "Found key!" << std::endl;
    +
    71 return index;
    +
    72 }
    +
    73 std::cout << "Found tombstone or equal hash, checking next"
    +
    74 << std::endl;
    +
    75 i++;
    +
    76 } else {
    +
    77 if (putProber(entry, key)) {
    +
    78 if (!rehashing) {
    +
    79 std::cout << "Spot found!" << std::endl;
    +
    80 }
    +
    81 return index;
    +
    82 }
    +
    83 if (!rehashing) {
    +
    84 std::cout << "Spot taken, looking at next (next index = "
    +
    85 << (hash + static_cast<size_t>(
    +
    86 std::round(std::pow(i + 1, 2)))) %
    +
    87 totalSize
    +
    88 << std::endl;
    +
    89 }
    +
    90 i++;
    +
    91 }
    +
    92 if (i == totalSize * 100) {
    +
    93 std::cout << "Quadratic probe failed (infinite loop)" << std::endl;
    +
    94 return notPresent;
    +
    95 }
    +
    96 } while (entry.key != notPresent);
    +
    97 return notPresent;
    +
    98}
    bool putProber(const Entry &entry, int key)
    Definition: quadratic_probing_hash_table.cpp:106
    bool searchingProber(const Entry &entry, int key)
    Definition: quadratic_probing_hash_table.cpp:119
    T pow(T... args)
    @@ -491,7 +490,7 @@ Here is the call graph for this function:
    - +

    ◆ rehash()

    @@ -505,25 +504,25 @@ Here is the call graph for this function:
    -

    Rehashes the table into a bigger table

    Returns
    none
    -
    160  {
    -
    161  // Necessary so wall of add info isn't printed all at once
    -
    162  rehashing = true;
    -
    163  int oldSize = totalSize;
    -
    164  std::vector<Entry> oldTable(table);
    -
    165  // Really this should use the next prime number greater than totalSize * 2
    -
    166  totalSize *= 2;
    -
    167  table = std::vector<Entry>(totalSize);
    -
    168  for (int i = 0; i < oldSize; i++) {
    -
    169  if (oldTable[i].key != -1 && oldTable[i].key != notPresent) {
    -
    170  size--; // Size stays the same (add increments size)
    -
    171  add(oldTable[i].key);
    -
    172  }
    -
    173  }
    -
    174  // delete[] oldTable;
    -
    175  rehashing = false;
    -
    176  std::cout << "Table was rehashed, new size is: " << totalSize << std::endl;
    -
    177 }
    +

    Rehashes the table into a bigger table

    Returns
    none
    +
    160 {
    +
    161 // Necessary so wall of add info isn't printed all at once
    +
    162 rehashing = true;
    +
    163 int oldSize = totalSize;
    +
    164 std::vector<Entry> oldTable(table);
    +
    165 // Really this should use the next prime number greater than totalSize * 2
    +
    166 totalSize *= 2;
    +
    167 table = std::vector<Entry>(totalSize);
    +
    168 for (int i = 0; i < oldSize; i++) {
    +
    169 if (oldTable[i].key != -1 && oldTable[i].key != notPresent) {
    +
    170 size--; // Size stays the same (add increments size)
    +
    171 add(oldTable[i].key);
    +
    172 }
    +
    173 }
    +
    174 // delete[] oldTable;
    +
    175 rehashing = false;
    +
    176 std::cout << "Table was rehashed, new size is: " << totalSize << std::endl;
    +
    177}
    Here is the call graph for this function:
    @@ -534,7 +533,7 @@ Here is the call graph for this function:
    - +

    ◆ removalInfo()

    @@ -549,23 +548,23 @@ Here is the call graph for this function:
    -

    Information about removal process

    Parameters
    +

    Information about removal process

    Parameters
    keykey value to hash and remove from table
    -
    222  {
    -
    223  std::cout << "Initial table: ";
    -
    224  display();
    -
    225  std::cout << std::endl;
    -
    226  std::cout << "hash of " << key << " is " << hashFxn(key) << " % "
    -
    227  << totalSize << " == " << hashFxn(key) % totalSize;
    -
    228  std::cout << std::endl;
    -
    229  remove(key);
    -
    230  std::cout << "New table: ";
    -
    231  display();
    -
    232 }
    +
    222 {
    +
    223 std::cout << "Initial table: ";
    +
    224 display();
    + +
    226 std::cout << "hash of " << key << " is " << hashFxn(key) << " % "
    +
    227 << totalSize << " == " << hashFxn(key) % totalSize;
    + +
    229 remove(key);
    +
    230 std::cout << "New table: ";
    +
    231 display();
    +
    232}
    void remove(int key)
    Definition: quadratic_probing_hash_table.cpp:194
    Here is the call graph for this function:
    @@ -576,7 +575,7 @@ Here is the call graph for this function:
    - +

    ◆ remove()

    @@ -591,21 +590,21 @@ Here is the call graph for this function:
    -

    Removes key. Leaves tombstone upon removal.

    Parameters
    +

    Removes key. Leaves tombstone upon removal.

    Parameters
    keykey value to hash and remove from table
    -
    194  {
    -
    195  int index = quadraticProbe(key, true);
    -
    196  if (index == notPresent) {
    -
    197  std::cout << "key not found" << std::endl;
    -
    198  }
    -
    199  table[index].key = tomb;
    -
    200  std::cout << "Removal successful, leaving tombstone" << std::endl;
    -
    201  size--;
    -
    202 }
    +
    194 {
    +
    195 int index = quadraticProbe(key, true);
    +
    196 if (index == notPresent) {
    +
    197 std::cout << "key not found" << std::endl;
    +
    198 }
    +
    199 table[index].key = tomb;
    +
    200 std::cout << "Removal successful, leaving tombstone" << std::endl;
    +
    201 size--;
    +
    202}
    Here is the call graph for this function:
    @@ -615,7 +614,7 @@ Here is the call graph for this function:
    - +

    ◆ searchingProber()

    @@ -640,7 +639,7 @@ Here is the call graph for this function:
    -

    Looks for a matching key

    Parameters
    +

    Looks for a matching key

    Parameters
    @@ -650,12 +649,12 @@ Here is the call graph for this function:
    Returns
    true if key matches the entry
    false if key does not match the entry
    -
    119  {
    -
    120  if (entry.key == key) {
    -
    121  return true;
    -
    122  }
    -
    123  return false;
    -
    124 }
    +
    119 {
    +
    120 if (entry.key == key) {
    +
    121 return true;
    +
    122 }
    +
    123 return false;
    +
    124}
    @@ -665,7 +664,7 @@ Here is the call graph for this function: diff --git a/d4/dd2/namespacequadratic__probing.js b/d4/dd2/namespacequadratic__probing.js index d3537d06d..f4a8571b2 100644 --- a/d4/dd2/namespacequadratic__probing.js +++ b/d4/dd2/namespacequadratic__probing.js @@ -1,7 +1,6 @@ var namespacequadratic__probing = [ [ "Entry", "da/dd1/structquadratic__probing_1_1_entry.html", "da/dd1/structquadratic__probing_1_1_entry" ], - [ "Entry", "d4/dd2/namespacequadratic__probing.html#a8f877db9460c8e472719908b9a018ffb", null ], [ "add", "d4/dd2/namespacequadratic__probing.html#a00ebcc6d39653eccc26f8432efbfc8d9", null ], [ "addInfo", "d4/dd2/namespacequadratic__probing.html#a312143ed316d48978084c025ff8d9768", null ], [ "display", "d4/dd2/namespacequadratic__probing.html#a40d617ebf4d6ba21bcda8d8d1faa2357", null ], @@ -12,11 +11,5 @@ var namespacequadratic__probing = [ "rehash", "d4/dd2/namespacequadratic__probing.html#ada6f1f44f7e83b0094fbcbe170788486", null ], [ "removalInfo", "d4/dd2/namespacequadratic__probing.html#a69fe1f7c36fe004ba83eef2ca82e7e30", null ], [ "remove", "d4/dd2/namespacequadratic__probing.html#a07a0467b24102260fbb6b554c453c20a", null ], - [ "searchingProber", "d4/dd2/namespacequadratic__probing.html#aeb6bca8db4768226f8ea8291ea4f83f6", null ], - [ "notPresent", "d4/dd2/namespacequadratic__probing.html#a90f9d8a71e3f148b65bcc0c1c8a49c70", null ], - [ "rehashing", "d4/dd2/namespacequadratic__probing.html#ad20bb8020424def88917e26979051fae", null ], - [ "size", "d4/dd2/namespacequadratic__probing.html#a6c60d84648b0f7bf78789da196bcd2b3", null ], - [ "table", "d4/dd2/namespacequadratic__probing.html#a149e32e186c3fac390ffa81dd6c73147", null ], - [ "tomb", "d4/dd2/namespacequadratic__probing.html#aaa4b6c021ba71ecdac8b23b45d55c774", null ], - [ "totalSize", "d4/dd2/namespacequadratic__probing.html#a2d5722a3b692eeb1b96615fba6a248f3", null ] + [ "searchingProber", "d4/dd2/namespacequadratic__probing.html#aeb6bca8db4768226f8ea8291ea4f83f6", null ] ]; \ No newline at end of file diff --git a/d4/dd2/namespacequadratic__probing_a00ebcc6d39653eccc26f8432efbfc8d9_cgraph.svg b/d4/dd2/namespacequadratic__probing_a00ebcc6d39653eccc26f8432efbfc8d9_cgraph.svg index a7f2b2b38..1a78f8fa1 100644 --- a/d4/dd2/namespacequadratic__probing_a00ebcc6d39653eccc26f8432efbfc8d9_cgraph.svg +++ b/d4/dd2/namespacequadratic__probing_a00ebcc6d39653eccc26f8432efbfc8d9_cgraph.svg @@ -1,7 +1,7 @@ - - - diff --git a/d4/dd2/namespacequadratic__probing_a312143ed316d48978084c025ff8d9768_cgraph_org.svg b/d4/dd2/namespacequadratic__probing_a312143ed316d48978084c025ff8d9768_cgraph_org.svg index 81f439127..b64f353ea 100644 --- a/d4/dd2/namespacequadratic__probing_a312143ed316d48978084c025ff8d9768_cgraph_org.svg +++ b/d4/dd2/namespacequadratic__probing_a312143ed316d48978084c025ff8d9768_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - diff --git a/d4/dd2/namespacequadratic__probing_a69fe1f7c36fe004ba83eef2ca82e7e30_cgraph_org.svg b/d4/dd2/namespacequadratic__probing_a69fe1f7c36fe004ba83eef2ca82e7e30_cgraph_org.svg index e692f337e..9f8e8e841 100644 --- a/d4/dd2/namespacequadratic__probing_a69fe1f7c36fe004ba83eef2ca82e7e30_cgraph_org.svg +++ b/d4/dd2/namespacequadratic__probing_a69fe1f7c36fe004ba83eef2ca82e7e30_cgraph_org.svg @@ -1,7 +1,7 @@ - - - diff --git a/d4/dd2/namespacequadratic__probing_ada6f1f44f7e83b0094fbcbe170788486_cgraph_org.svg b/d4/dd2/namespacequadratic__probing_ada6f1f44f7e83b0094fbcbe170788486_cgraph_org.svg index 31b644d11..e111d324e 100644 --- a/d4/dd2/namespacequadratic__probing_ada6f1f44f7e83b0094fbcbe170788486_cgraph_org.svg +++ b/d4/dd2/namespacequadratic__probing_ada6f1f44f7e83b0094fbcbe170788486_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - + +Algorithms_in_C++: geometry::jarvis::Convexhull Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
    entryInstance of table entry
    keykey value to search/probe
    -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -95,42 +95,35 @@ $(document).ready(function(){initNavTree('d4/dde/classgeometry_1_1jarvis_1_1_con Static Public Member Functions | Private Attributes | List of all members -
    -
    geometry::jarvis::Convexhull Class Reference
    +
    geometry::jarvis::Convexhull Class Reference
    -
    -Collaboration diagram for geometry::jarvis::Convexhull:
    -
    -
    -
    -
    [legend]
    - - - + +

    +

    Public Member Functions

     Convexhull (const std::vector< Point > &pointList)
     
    std::vector< PointgetConvexHull () const
     
    std::vector< PointgetConvexHull () const
     
    -

    +

    Static Public Member Functions

    static int orientation (const Point &p, const Point &q, const Point &r)
     
    - - -

    +

    Private Attributes

    +
    std::vector< Pointpoints
     
    +
    int size
     

    Detailed Description

    -

    Class which can be called from main and is globally available throughout the code

    +

    Class which can be called from main and is globally available throughout the code

    Constructor & Destructor Documentation

    - +

    ◆ Convexhull()

    @@ -153,7 +146,7 @@ int size
    -

    Constructor of given class

    +

    Constructor of given class

    Parameters
    @@ -161,10 +154,10 @@ int 
    pointListlist of all points in the space
    size
    -
    66  {
    -
    67  points = pointList;
    -
    68  size = points.size();
    -
    69  }
    +
    66 {
    +
    67 points = pointList;
    +
    68 size = points.size();
    +
    69 }
    Here is the call graph for this function:
    @@ -175,8 +168,8 @@ Here is the call graph for this function:

    Member Function Documentation

    - -

    ◆ getConvexHull()

    + +

    ◆ getConvexHull()

    @@ -185,7 +178,7 @@ Here is the call graph for this function:
    - + @@ -197,63 +190,63 @@ Here is the call graph for this function:
    std::vector<Point> geometry::jarvis::Convexhull::getConvexHull std::vector< Point > geometry::jarvis::Convexhull::getConvexHull ( ) const
    -

    Creates convex hull of a set of n points. There must be 3 points at least for the convex hull to exist

    +

    Creates convex hull of a set of n points. There must be 3 points at least for the convex hull to exist

    Returns
    an vector array containing points in space which enclose all given points thus forming a hull
    -
    78  {
    -
    79  // Initialize Result
    -
    80  std::vector<Point> hull;
    -
    81 
    -
    82  // Find the leftmost point
    -
    83  int leftmost_point = 0;
    -
    84  for (int i = 1; i < size; i++) {
    -
    85  if (points[i].x < points[leftmost_point].x) {
    -
    86  leftmost_point = i;
    -
    87  }
    -
    88  }
    -
    89  // Start from leftmost point, keep moving counterclockwise
    -
    90  // until reach the start point again. This loop runs O(h)
    -
    91  // times where h is number of points in result or output.
    -
    92  int p = leftmost_point, q = 0;
    -
    93  do {
    -
    94  // Add current point to result
    -
    95  hull.push_back(points[p]);
    -
    96 
    -
    97  // Search for a point 'q' such that orientation(p, x, q)
    -
    98  // is counterclockwise for all points 'x'. The idea
    -
    99  // is to keep track of last visited most counter clock-
    -
    100  // wise point in q. If any point 'i' is more counter clock-
    -
    101  // wise than q, then update q.
    -
    102  q = (p + 1) % size;
    -
    103  for (int i = 0; i < size; i++) {
    -
    104  // If i is more counterclockwise than current q, then
    -
    105  // update q
    -
    106  if (orientation(points[p], points[i], points[q]) == 2) {
    -
    107  q = i;
    -
    108  }
    -
    109  }
    -
    110 
    -
    111  // Now q is the most counterclockwise with respect to p
    -
    112  // Set p as q for next iteration, so that q is added to
    -
    113  // result 'hull'
    -
    114  p = q;
    -
    115 
    -
    116  } while (p != leftmost_point); // While we don't come to first point
    -
    117 
    -
    118  return hull;
    -
    119  }
    +
    78 {
    +
    79 // Initialize Result
    + +
    81
    +
    82 // Find the leftmost point
    +
    83 int leftmost_point = 0;
    +
    84 for (int i = 1; i < size; i++) {
    +
    85 if (points[i].x < points[leftmost_point].x) {
    +
    86 leftmost_point = i;
    +
    87 }
    +
    88 }
    +
    89 // Start from leftmost point, keep moving counterclockwise
    +
    90 // until reach the start point again. This loop runs O(h)
    +
    91 // times where h is number of points in result or output.
    +
    92 int p = leftmost_point, q = 0;
    +
    93 do {
    +
    94 // Add current point to result
    +
    95 hull.push_back(points[p]);
    +
    96
    +
    97 // Search for a point 'q' such that orientation(p, x, q)
    +
    98 // is counterclockwise for all points 'x'. The idea
    +
    99 // is to keep track of last visited most counter clock-
    +
    100 // wise point in q. If any point 'i' is more counter clock-
    +
    101 // wise than q, then update q.
    +
    102 q = (p + 1) % size;
    +
    103 for (int i = 0; i < size; i++) {
    +
    104 // If i is more counterclockwise than current q, then
    +
    105 // update q
    +
    106 if (orientation(points[p], points[i], points[q]) == 2) {
    +
    107 q = i;
    +
    108 }
    +
    109 }
    +
    110
    +
    111 // Now q is the most counterclockwise with respect to p
    +
    112 // Set p as q for next iteration, so that q is added to
    +
    113 // result 'hull'
    +
    114 p = q;
    +
    115
    +
    116 } while (p != leftmost_point); // While we don't come to first point
    +
    117
    +
    118 return hull;
    +
    119 }
    static int orientation(const Point &p, const Point &q, const Point &r)
    Definition: jarvis_algorithm.cpp:133
    T push_back(T... args)
    Here is the call graph for this function:
    -
    +
    - +

    ◆ orientation()

    @@ -292,7 +285,7 @@ Here is the call graph for this function:
    -

    This function returns the geometric orientation for the three points in a space, ie, whether they are linear ir clockwise or anti-clockwise

    Parameters
    +

    This function returns the geometric orientation for the three points in a space, ie, whether they are linear ir clockwise or anti-clockwise

    Parameters
    @@ -305,14 +298,14 @@ Here is the call graph for this function: 1 -> Clock Wise
    2 -> Anti Clock Wise
    -
    133  {
    -
    134  int val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
    -
    135 
    -
    136  if (val == 0) {
    -
    137  return 0;
    -
    138  }
    -
    139  return (val > 0) ? 1 : 2;
    -
    140  }
    +
    133 {
    +
    134 int val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
    +
    135
    +
    136 if (val == 0) {
    +
    137 return 0;
    +
    138 }
    +
    139 return (val > 0) ? 1 : 2;
    +
    140 }
    int y
    Point respect to x coordinate.
    Definition: line_segment_intersection.cpp:14
    @@ -326,7 +319,7 @@ Here is the call graph for this function: diff --git a/d4/dde/classgeometry_1_1jarvis_1_1_convexhull.js b/d4/dde/classgeometry_1_1jarvis_1_1_convexhull.js index 140863739..b1c514413 100644 --- a/d4/dde/classgeometry_1_1jarvis_1_1_convexhull.js +++ b/d4/dde/classgeometry_1_1jarvis_1_1_convexhull.js @@ -1,8 +1,6 @@ var classgeometry_1_1jarvis_1_1_convexhull = [ [ "Convexhull", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#a8306e48040a8570e164c58d1c530f870", null ], - [ "getConvexHull", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#a878952f2eb3d1fae79d58c994fc10ab1", null ], - [ "orientation", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#a54df5f9a8f37170bd97c91127664655c", null ], - [ "points", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#a835cd4cdc5a644abb84535197d753b02", null ], - [ "size", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#a2272bb62c35af959953b0ea06b010036", null ] + [ "getConvexHull", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#aeec46e86786ddd461464b07a77c4d5f1", null ], + [ "orientation", "d4/dde/classgeometry_1_1jarvis_1_1_convexhull.html#a54df5f9a8f37170bd97c91127664655c", null ] ]; \ No newline at end of file diff --git a/d4/dde/classgeometry_1_1jarvis_1_1_convexhull_a8306e48040a8570e164c58d1c530f870_cgraph.svg b/d4/dde/classgeometry_1_1jarvis_1_1_convexhull_a8306e48040a8570e164c58d1c530f870_cgraph.svg index e7423cf0d..1180a5622 100644 --- a/d4/dde/classgeometry_1_1jarvis_1_1_convexhull_a8306e48040a8570e164c58d1c530f870_cgraph.svg +++ b/d4/dde/classgeometry_1_1jarvis_1_1_convexhull_a8306e48040a8570e164c58d1c530f870_cgraph.svg @@ -1,7 +1,7 @@ - - - - + +Algorithms_in_C++: postfix_expression Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
    pfirst point selected
    qadjacent point for q
    -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d4/de6/namespacepostfix__expression.ht
    -
    -
    postfix_expression Namespace Reference
    +
    postfix_expression Namespace Reference

    Functions for Postfix Expression algorithm. More...

    Detailed Description

    -

    Functions for Postfix Expression algorithm.

    +

    Functions for Postfix Expression algorithm.

    diff --git a/d4/deb/gcd__iterative__euclidean_8cpp__incl.svg b/d4/deb/gcd__iterative__euclidean_8cpp__incl.svg index 771221dd8..13e631b7e 100644 --- a/d4/deb/gcd__iterative__euclidean_8cpp__incl.svg +++ b/d4/deb/gcd__iterative__euclidean_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: machine_learning/kohonen_som_topology.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -95,12 +95,11 @@ $(document).ready(function(){initNavTree('d4/def/kohonen__som__topology_8cpp.htm Macros | Functions | Variables -
    -
    kohonen_som_topology.cpp File Reference
    +
    kohonen_som_topology.cpp File Reference
    -

    Kohonen self organizing map (topological map) +

    Kohonen self organizing map (topological map) More...

    #include <algorithm>
    #include <array>
    @@ -120,36 +119,36 @@ Include dependency graph for kohonen_som_topology.cpp:
    - - - + +

    +

    Namespaces

     machine_learning
     A* search algorithm
    namespace  machine_learning
     A* search algorithm
     
    - - - - - - - - - - - - - + + + + + + + + + + + + - - + + - - + + @@ -157,20 +156,20 @@ Functions

    +

    Functions

    double _random (double a, double b)
     
    int save_2d_data (const char *fname, const std::vector< std::valarray< double >> &X)
     
    void get_min_2d (const std::vector< std::valarray< double >> &X, double *val, int *x_idx, int *y_idx)
     
    int machine_learning::save_u_matrix (const char *fname, const std::vector< std::vector< std::valarray< double >>> &W)
     
    double machine_learning::update_weights (const std::valarray< double > &X, std::vector< std::vector< std::valarray< double >>> *W, std::vector< std::valarray< double >> *D, double alpha, int R)
     
    void machine_learning::kohonen_som (const std::vector< std::valarray< double >> &X, std::vector< std::vector< std::valarray< double >>> *W, double alpha_min)
     
    void test_2d_classes (std::vector< std::valarray< double >> *data)
     
    int save_2d_data (const char *fname, const std::vector< std::valarray< double > > &X)
     
    void get_min_2d (const std::vector< std::valarray< double > > &X, double *val, int *x_idx, int *y_idx)
     
    int machine_learning::save_u_matrix (const char *fname, const std::vector< std::vector< std::valarray< double > > > &W)
     
    double machine_learning::update_weights (const std::valarray< double > &X, std::vector< std::vector< std::valarray< double > > > *W, std::vector< std::valarray< double > > *D, double alpha, int R)
     
    void machine_learning::kohonen_som (const std::vector< std::valarray< double > > &X, std::vector< std::vector< std::valarray< double > > > *W, double alpha_min)
     
    void test_2d_classes (std::vector< std::valarray< double > > *data)
     
    void test1 ()
     
    void test_3d_classes1 (std::vector< std::valarray< double >> *data)
     
    void test_3d_classes1 (std::vector< std::valarray< double > > *data)
     
    void test2 ()
     
    void test_3d_classes2 (std::vector< std::valarray< double >> *data)
     
    void test_3d_classes2 (std::vector< std::valarray< double > > *data)
     
    void test3 ()
     
    double get_clock_diff (clock_t start_t, clock_t end_t)
    int main (int argc, char **argv)
     
    -

    +

    Variables

    constexpr double machine_learning::MIN_DISTANCE = 1e-4
     

    Detailed Description

    -

    Kohonen self organizing map (topological map)

    -
    Author
    Krishna Vedala
    -

    This example implements a powerful unsupervised learning algorithm called as a self organizing map. The algorithm creates a connected network of weights that closely follows the given data points. This thus creates a topological map of the given data i.e., it maintains the relationship between varipus data points in a much higher dimesional space by creating an equivalent in a 2-dimensional space. Trained topological maps for the test cases in the program

    Note
    This C++ version of the program is considerable slower than its C counterpart
    +

    Kohonen self organizing map (topological map)

    +
    Author
    Krishna Vedala
    +

    This example implements a powerful unsupervised learning algorithm called as a self organizing map. The algorithm creates a connected network of weights that closely follows the given data points. This thus creates a topological map of the given data i.e., it maintains the relationship between varipus data points in a much higher dimesional space by creating an equivalent in a 2-dimensional space. Trained topological maps for the test cases in the program

    Note
    This C++ version of the program is considerable slower than its C counterpart
    The compiled code is much slower when compiled with MS Visual C++ 2019 than with GCC on windows
    See also
    kohonen_som_trace.cpp

    Function Documentation

    - +

    ◆ get_clock_diff()

    @@ -195,7 +194,7 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
    -

    Convert clock cycle difference to time in seconds

    +

    Convert clock cycle difference to time in seconds

    Parameters
    @@ -204,13 +203,13 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
    Returns
    time difference in seconds
    -
    577  {
    -
    578  return static_cast<double>(end_t - start_t) / CLOCKS_PER_SEC;
    -
    579 }
    +
    577 {
    +
    578 return static_cast<double>(end_t - start_t) / CLOCKS_PER_SEC;
    +
    579}
    - +

    ◆ main()

    @@ -235,39 +234,39 @@ The compiled code is much slower when compiled with MS Visual C++ 2019 than with
    [in]start_tstart clock
    -

    Main function

    -
    582  {
    -
    583 #ifdef _OPENMP
    -
    584  std::cout << "Using OpenMP based parallelization\n";
    -
    585 #else
    -
    586  std::cout << "NOT using OpenMP based parallelization\n";
    -
    587 #endif
    -
    588 
    -
    589  std::srand(std::time(nullptr));
    -
    590 
    -
    591  std::clock_t start_clk = std::clock();
    -
    592  test1();
    -
    593  auto end_clk = std::clock();
    -
    594  std::cout << "Test 1 completed in " << get_clock_diff(start_clk, end_clk)
    -
    595  << " sec\n";
    -
    596 
    -
    597  start_clk = std::clock();
    -
    598  test2();
    -
    599  end_clk = std::clock();
    -
    600  std::cout << "Test 2 completed in " << get_clock_diff(start_clk, end_clk)
    -
    601  << " sec\n";
    -
    602 
    -
    603  start_clk = std::clock();
    -
    604  test3();
    -
    605  end_clk = std::clock();
    -
    606  std::cout << "Test 3 completed in " << get_clock_diff(start_clk, end_clk)
    -
    607  << " sec\n";
    -
    608 
    -
    609  std::cout
    -
    610  << "(Note: Calculated times include: creating test sets, training "
    -
    611  "model and writing files to disk.)\n\n";
    -
    612  return 0;
    -
    613 }
    +

    Main function

    +
    582 {
    +
    583#ifdef _OPENMP
    +
    584 std::cout << "Using OpenMP based parallelization\n";
    +
    585#else
    +
    586 std::cout << "NOT using OpenMP based parallelization\n";
    +
    587#endif
    +
    588
    +
    589 std::srand(std::time(nullptr));
    +
    590
    +
    591 std::clock_t start_clk = std::clock();
    +
    592 test1();
    +
    593 auto end_clk = std::clock();
    +
    594 std::cout << "Test 1 completed in " << get_clock_diff(start_clk, end_clk)
    +
    595 << " sec\n";
    +
    596
    +
    597 start_clk = std::clock();
    +
    598 test2();
    +
    599 end_clk = std::clock();
    +
    600 std::cout << "Test 2 completed in " << get_clock_diff(start_clk, end_clk)
    +
    601 << " sec\n";
    +
    602
    +
    603 start_clk = std::clock();
    +
    604 test3();
    +
    605 end_clk = std::clock();
    +
    606 std::cout << "Test 3 completed in " << get_clock_diff(start_clk, end_clk)
    +
    607 << " sec\n";
    +
    608
    + +
    610 << "(Note: Calculated times include: creating test sets, training "
    +
    611 "model and writing files to disk.)\n\n";
    +
    612 return 0;
    +
    613}
    T clock(T... args)
    @@ -286,7 +285,7 @@ Here is the call graph for this function:
    - +

    ◆ test1()

    @@ -300,51 +299,51 @@ Here is the call graph for this function:
    -

    Test that creates a random set of points distributed in four clusters in circumference of a circle and trains an SOM that finds that circular pattern. The following CSV files are created to validate the execution:

      +

      Test that creates a random set of points distributed in four clusters in circumference of a circle and trains an SOM that finds that circular pattern. The following CSV files are created to validate the execution:

      • test1.csv: random test samples points with a circular pattern
      • w11.csv: initial random map
      • w12.csv: trained SOM map
      -
      369  {
      -
      370  int j = 0, N = 300;
      -
      371  int features = 2;
      -
      372  int num_out = 30;
      - - -
      375  for (int i = 0; i < std::max(num_out, N); i++) {
      -
      376  // loop till max(N, num_out)
      -
      377  if (i < N) { // only add new arrays if i < N
      -
      378  X[i] = std::valarray<double>(features);
      -
      379  }
      -
      380  if (i < num_out) { // only add new arrays if i < num_out
      -
      381  W[i] = std::vector<std::valarray<double>>(num_out);
      -
      382  for (int k = 0; k < num_out; k++) {
      -
      383  W[i][k] = std::valarray<double>(features);
      -
      384 #ifdef _OPENMP
      -
      385 #pragma omp for
      -
      386 #endif
      -
      387  for (j = 0; j < features; j++) {
      -
      388  // preallocate with random initial weights
      -
      389  W[i][k][j] = _random(-10, 10);
      -
      390  }
      -
      391  }
      -
      392  }
      -
      393  }
      -
      394 
      -
      395  test_2d_classes(&X); // create test data around circumference of a circle
      -
      396  save_2d_data("test1.csv", X); // save test data points
      -
      397  save_u_matrix("w11.csv", W); // save initial random weights
      -
      398  kohonen_som(X, &W, 1e-4); // train the SOM
      -
      399  save_u_matrix("w12.csv", W); // save the resultant weights
      -
      400 }
      +
      369 {
      +
      370 int j = 0, N = 300;
      +
      371 int features = 2;
      +
      372 int num_out = 30;
      + + +
      375 for (int i = 0; i < std::max(num_out, N); i++) {
      +
      376 // loop till max(N, num_out)
      +
      377 if (i < N) { // only add new arrays if i < N
      +
      378 X[i] = std::valarray<double>(features);
      +
      379 }
      +
      380 if (i < num_out) { // only add new arrays if i < num_out
      +
      381 W[i] = std::vector<std::valarray<double>>(num_out);
      +
      382 for (int k = 0; k < num_out; k++) {
      +
      383 W[i][k] = std::valarray<double>(features);
      +
      384#ifdef _OPENMP
      +
      385#pragma omp for
      +
      386#endif
      +
      387 for (j = 0; j < features; j++) {
      +
      388 // preallocate with random initial weights
      +
      389 W[i][k][j] = _random(-10, 10);
      +
      390 }
      +
      391 }
      +
      392 }
      +
      393 }
      +
      394
      +
      395 test_2d_classes(&X); // create test data around circumference of a circle
      +
      396 save_2d_data("test1.csv", X); // save test data points
      +
      397 save_u_matrix("w11.csv", W); // save initial random weights
      +
      398 kohonen_som(X, &W, 1e-4); // train the SOM
      +
      399 save_u_matrix("w12.csv", W); // save the resultant weights
      +
      400}
      constexpr uint32_t N
      A struct to represent sparse table for min() as their invariant function, for the given array A....
      Definition: sparse_table.cpp:47
      -
      int save_2d_data(const char *fname, const std::vector< std::valarray< double >> &X)
      Definition: kohonen_som_topology.cpp:65
      +
      int save_2d_data(const char *fname, const std::vector< std::valarray< double > > &X)
      Definition: kohonen_som_topology.cpp:65
      double _random(double a, double b)
      Definition: kohonen_som_topology.cpp:53
      -
      void test_2d_classes(std::vector< std::valarray< double >> *data)
      Definition: kohonen_som_topology.cpp:330
      +
      void test_2d_classes(std::vector< std::valarray< double > > *data)
      Definition: kohonen_som_topology.cpp:330
      T max(T... args)
      -
      int save_u_matrix(const char *fname, const std::vector< std::vector< std::valarray< double >>> &W)
      Definition: kohonen_som_topology.cpp:142
      -
      void kohonen_som(const std::vector< std::valarray< double >> &X, std::vector< std::vector< std::valarray< double >>> *W, double alpha_min)
      Definition: kohonen_som_topology.cpp:269
      - +
      int save_u_matrix(const char *fname, const std::vector< std::vector< std::valarray< double > > > &W)
      Definition: kohonen_som_topology.cpp:142
      +
      void kohonen_som(const std::vector< std::valarray< double > > &X, std::vector< std::vector< std::valarray< double > > > *W, double alpha_min)
      Definition: kohonen_som_topology.cpp:269
      +
      Here is the call graph for this function:
      @@ -355,7 +354,7 @@ Here is the call graph for this function:
    - +

    ◆ test2()

    @@ -369,44 +368,44 @@ Here is the call graph for this function:
    -

    Test that creates a random set of points distributed in 4 clusters in 3D space and trains an SOM that finds the topological pattern. The following CSV files are created to validate the execution:

      +

      Test that creates a random set of points distributed in 4 clusters in 3D space and trains an SOM that finds the topological pattern. The following CSV files are created to validate the execution:

      • test2.csv: random test samples points with a lamniscate pattern
      • w21.csv: initial random map
      • w22.csv: trained SOM map
      -
      451  {
      -
      452  int j = 0, N = 300;
      -
      453  int features = 3;
      -
      454  int num_out = 30;
      - - -
      457  for (int i = 0; i < std::max(num_out, N); i++) {
      -
      458  // loop till max(N, num_out)
      -
      459  if (i < N) { // only add new arrays if i < N
      -
      460  X[i] = std::valarray<double>(features);
      -
      461  }
      -
      462  if (i < num_out) { // only add new arrays if i < num_out
      -
      463  W[i] = std::vector<std::valarray<double>>(num_out);
      -
      464  for (int k = 0; k < num_out; k++) {
      -
      465  W[i][k] = std::valarray<double>(features);
      -
      466 #ifdef _OPENMP
      -
      467 #pragma omp for
      -
      468 #endif
      -
      469  for (j = 0; j < features; j++) {
      -
      470  // preallocate with random initial weights
      -
      471  W[i][k][j] = _random(-10, 10);
      -
      472  }
      -
      473  }
      -
      474  }
      -
      475  }
      -
      476 
      -
      477  test_3d_classes1(&X); // create test data around circumference of a circle
      -
      478  save_2d_data("test2.csv", X); // save test data points
      -
      479  save_u_matrix("w21.csv", W); // save initial random weights
      -
      480  kohonen_som(X, &W, 1e-4); // train the SOM
      -
      481  save_u_matrix("w22.csv", W); // save the resultant weights
      -
      482 }
      -
      void test_3d_classes1(std::vector< std::valarray< double >> *data)
      Definition: kohonen_som_topology.cpp:411
      +
      451 {
      +
      452 int j = 0, N = 300;
      +
      453 int features = 3;
      +
      454 int num_out = 30;
      + + +
      457 for (int i = 0; i < std::max(num_out, N); i++) {
      +
      458 // loop till max(N, num_out)
      +
      459 if (i < N) { // only add new arrays if i < N
      +
      460 X[i] = std::valarray<double>(features);
      +
      461 }
      +
      462 if (i < num_out) { // only add new arrays if i < num_out
      +
      463 W[i] = std::vector<std::valarray<double>>(num_out);
      +
      464 for (int k = 0; k < num_out; k++) {
      +
      465 W[i][k] = std::valarray<double>(features);
      +
      466#ifdef _OPENMP
      +
      467#pragma omp for
      +
      468#endif
      +
      469 for (j = 0; j < features; j++) {
      +
      470 // preallocate with random initial weights
      +
      471 W[i][k][j] = _random(-10, 10);
      +
      472 }
      +
      473 }
      +
      474 }
      +
      475 }
      +
      476
      +
      477 test_3d_classes1(&X); // create test data around circumference of a circle
      +
      478 save_2d_data("test2.csv", X); // save test data points
      +
      479 save_u_matrix("w21.csv", W); // save initial random weights
      +
      480 kohonen_som(X, &W, 1e-4); // train the SOM
      +
      481 save_u_matrix("w22.csv", W); // save the resultant weights
      +
      482}
      +
      void test_3d_classes1(std::vector< std::valarray< double > > *data)
      Definition: kohonen_som_topology.cpp:411
      Here is the call graph for this function:
      @@ -416,7 +415,7 @@ Here is the call graph for this function:
    - +

    ◆ test3()

    @@ -430,44 +429,44 @@ Here is the call graph for this function:
    -

    Test that creates a random set of points distributed in eight clusters in 3D space and trains an SOM that finds the topological pattern. The following CSV files are created to validate the execution:

      +

      Test that creates a random set of points distributed in eight clusters in 3D space and trains an SOM that finds the topological pattern. The following CSV files are created to validate the execution:

      • test3.csv: random test samples points with a circular pattern
      • w31.csv: initial random map
      • w32.csv: trained SOM map
      -
      537  {
      -
      538  int j = 0, N = 500;
      -
      539  int features = 3;
      -
      540  int num_out = 30;
      - - -
      543  for (int i = 0; i < std::max(num_out, N); i++) {
      -
      544  // loop till max(N, num_out)
      -
      545  if (i < N) { // only add new arrays if i < N
      -
      546  X[i] = std::valarray<double>(features);
      -
      547  }
      -
      548  if (i < num_out) { // only add new arrays if i < num_out
      -
      549  W[i] = std::vector<std::valarray<double>>(num_out);
      -
      550  for (int k = 0; k < num_out; k++) {
      -
      551  W[i][k] = std::valarray<double>(features);
      -
      552 #ifdef _OPENMP
      -
      553 #pragma omp for
      -
      554 #endif
      -
      555  for (j = 0; j < features; j++) {
      -
      556  // preallocate with random initial weights
      -
      557  W[i][k][j] = _random(-10, 10);
      -
      558  }
      -
      559  }
      -
      560  }
      -
      561  }
      -
      562 
      -
      563  test_3d_classes2(&X); // create test data around circumference of a circle
      -
      564  save_2d_data("test3.csv", X); // save test data points
      -
      565  save_u_matrix("w31.csv", W); // save initial random weights
      -
      566  kohonen_som(X, &W, 1e-4); // train the SOM
      -
      567  save_u_matrix("w32.csv", W); // save the resultant weights
      -
      568 }
      -
      void test_3d_classes2(std::vector< std::valarray< double >> *data)
      Definition: kohonen_som_topology.cpp:493
      +
      537 {
      +
      538 int j = 0, N = 500;
      +
      539 int features = 3;
      +
      540 int num_out = 30;
      + + +
      543 for (int i = 0; i < std::max(num_out, N); i++) {
      +
      544 // loop till max(N, num_out)
      +
      545 if (i < N) { // only add new arrays if i < N
      +
      546 X[i] = std::valarray<double>(features);
      +
      547 }
      +
      548 if (i < num_out) { // only add new arrays if i < num_out
      +
      549 W[i] = std::vector<std::valarray<double>>(num_out);
      +
      550 for (int k = 0; k < num_out; k++) {
      +
      551 W[i][k] = std::valarray<double>(features);
      +
      552#ifdef _OPENMP
      +
      553#pragma omp for
      +
      554#endif
      +
      555 for (j = 0; j < features; j++) {
      +
      556 // preallocate with random initial weights
      +
      557 W[i][k][j] = _random(-10, 10);
      +
      558 }
      +
      559 }
      +
      560 }
      +
      561 }
      +
      562
      +
      563 test_3d_classes2(&X); // create test data around circumference of a circle
      +
      564 save_2d_data("test3.csv", X); // save test data points
      +
      565 save_u_matrix("w31.csv", W); // save initial random weights
      +
      566 kohonen_som(X, &W, 1e-4); // train the SOM
      +
      567 save_u_matrix("w32.csv", W); // save the resultant weights
      +
      568}
      +
      void test_3d_classes2(std::vector< std::valarray< double > > *data)
      Definition: kohonen_som_topology.cpp:493
      Here is the call graph for this function:
      @@ -477,8 +476,8 @@ Here is the call graph for this function:
    - -

    ◆ test_2d_classes()

    + +

    ◆ test_2d_classes()

    @@ -486,13 +485,13 @@ Here is the call graph for this function:
    void test_2d_classes ( - std::vector< std::valarray< double >> *  + std::vector< std::valarray< double > > *  data)
    -

    Creates a random set of points distributed in four clusters in 3D space with centroids at the points

      +

      Creates a random set of points distributed in four clusters in 3D space with centroids at the points

      • \((0,5, 0.5, 0.5)\)
      • \((0,5,-0.5, -0.5)\)
      • \((-0,5, 0.5, 0.5)\)
      • @@ -504,50 +503,50 @@ Here is the call graph for this function:
    -
    330  {
    -
    331  const int N = data->size();
    -
    332  const double R = 0.3; // radius of cluster
    -
    333  int i = 0;
    -
    334  const int num_classes = 4;
    -
    335  std::array<std::array<double, 2>, num_classes> centres = {
    -
    336  // centres of each class cluster
    -
    337  std::array<double, 2>({.5, .5}), // centre of class 1
    -
    338  std::array<double, 2>({.5, -.5}), // centre of class 2
    -
    339  std::array<double, 2>({-.5, .5}), // centre of class 3
    -
    340  std::array<double, 2>({-.5, -.5}) // centre of class 4
    -
    341  };
    -
    342 
    -
    343 #ifdef _OPENMP
    -
    344 #pragma omp for
    -
    345 #endif
    -
    346  for (i = 0; i < N; i++) {
    -
    347  // select a random class for the point
    -
    348  int cls = std::rand() % num_classes;
    -
    349 
    -
    350  // create random coordinates (x,y,z) around the centre of the class
    -
    351  data[0][i][0] = _random(centres[cls][0] - R, centres[cls][0] + R);
    -
    352  data[0][i][1] = _random(centres[cls][1] - R, centres[cls][1] + R);
    -
    353 
    -
    354  /* The follosing can also be used
    -
    355  for (int j = 0; j < 2; j++)
    -
    356  data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    -
    357  */
    -
    358  }
    -
    359 }
    +
    330 {
    +
    331 const int N = data->size();
    +
    332 const double R = 0.3; // radius of cluster
    +
    333 int i = 0;
    +
    334 const int num_classes = 4;
    +
    335 std::array<std::array<double, 2>, num_classes> centres = {
    +
    336 // centres of each class cluster
    +
    337 std::array<double, 2>({.5, .5}), // centre of class 1
    +
    338 std::array<double, 2>({.5, -.5}), // centre of class 2
    +
    339 std::array<double, 2>({-.5, .5}), // centre of class 3
    +
    340 std::array<double, 2>({-.5, -.5}) // centre of class 4
    +
    341 };
    +
    342
    +
    343#ifdef _OPENMP
    +
    344#pragma omp for
    +
    345#endif
    +
    346 for (i = 0; i < N; i++) {
    +
    347 // select a random class for the point
    +
    348 int cls = std::rand() % num_classes;
    +
    349
    +
    350 // create random coordinates (x,y,z) around the centre of the class
    +
    351 data[0][i][0] = _random(centres[cls][0] - R, centres[cls][0] + R);
    +
    352 data[0][i][1] = _random(centres[cls][1] - R, centres[cls][1] + R);
    +
    353
    +
    354 /* The follosing can also be used
    +
    355 for (int j = 0; j < 2; j++)
    +
    356 data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    +
    357 */
    +
    358 }
    +
    359}
    int data[MAX]
    test data
    Definition: hash_search.cpp:24
    T rand(T... args)
    Here is the call graph for this function:
    -
    +
    - -

    ◆ test_3d_classes1()

    + +

    ◆ test_3d_classes1()

    @@ -555,13 +554,13 @@ Here is the call graph for this function:
    void test_3d_classes1 ( - std::vector< std::valarray< double >> *  + std::vector< std::valarray< double > > *  data)
    -

    Creates a random set of points distributed in four clusters in 3D space with centroids at the points

      +

      Creates a random set of points distributed in four clusters in 3D space with centroids at the points

      • \((0,5, 0.5, 0.5)\)
      • \((0,5,-0.5, -0.5)\)
      • \((-0,5, 0.5, 0.5)\)
      • @@ -573,48 +572,48 @@ Here is the call graph for this function:
    -
    411  {
    -
    412  const size_t N = data->size();
    -
    413  const double R = 0.3; // radius of cluster
    -
    414  int i = 0;
    -
    415  const int num_classes = 4;
    -
    416  const std::array<std::array<double, 3>, num_classes> centres = {
    -
    417  // centres of each class cluster
    -
    418  std::array<double, 3>({.5, .5, .5}), // centre of class 1
    -
    419  std::array<double, 3>({.5, -.5, -.5}), // centre of class 2
    -
    420  std::array<double, 3>({-.5, .5, .5}), // centre of class 3
    -
    421  std::array<double, 3>({-.5, -.5 - .5}) // centre of class 4
    -
    422  };
    -
    423 
    -
    424 #ifdef _OPENMP
    -
    425 #pragma omp for
    -
    426 #endif
    -
    427  for (i = 0; i < N; i++) {
    -
    428  // select a random class for the point
    -
    429  int cls = std::rand() % num_classes;
    -
    430 
    -
    431  // create random coordinates (x,y,z) around the centre of the class
    -
    432  data[0][i][0] = _random(centres[cls][0] - R, centres[cls][0] + R);
    -
    433  data[0][i][1] = _random(centres[cls][1] - R, centres[cls][1] + R);
    -
    434  data[0][i][2] = _random(centres[cls][2] - R, centres[cls][2] + R);
    -
    435 
    -
    436  /* The follosing can also be used
    -
    437  for (int j = 0; j < 3; j++)
    -
    438  data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    -
    439  */
    -
    440  }
    -
    441 }
    +
    411 {
    +
    412 const size_t N = data->size();
    +
    413 const double R = 0.3; // radius of cluster
    +
    414 int i = 0;
    +
    415 const int num_classes = 4;
    +
    416 const std::array<std::array<double, 3>, num_classes> centres = {
    +
    417 // centres of each class cluster
    +
    418 std::array<double, 3>({.5, .5, .5}), // centre of class 1
    +
    419 std::array<double, 3>({.5, -.5, -.5}), // centre of class 2
    +
    420 std::array<double, 3>({-.5, .5, .5}), // centre of class 3
    +
    421 std::array<double, 3>({-.5, -.5 - .5}) // centre of class 4
    +
    422 };
    +
    423
    +
    424#ifdef _OPENMP
    +
    425#pragma omp for
    +
    426#endif
    +
    427 for (i = 0; i < N; i++) {
    +
    428 // select a random class for the point
    +
    429 int cls = std::rand() % num_classes;
    +
    430
    +
    431 // create random coordinates (x,y,z) around the centre of the class
    +
    432 data[0][i][0] = _random(centres[cls][0] - R, centres[cls][0] + R);
    +
    433 data[0][i][1] = _random(centres[cls][1] - R, centres[cls][1] + R);
    +
    434 data[0][i][2] = _random(centres[cls][2] - R, centres[cls][2] + R);
    +
    435
    +
    436 /* The follosing can also be used
    +
    437 for (int j = 0; j < 3; j++)
    +
    438 data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    +
    439 */
    +
    440 }
    +
    441}
    Here is the call graph for this function:
    -
    +
    - -

    ◆ test_3d_classes2()

    + +

    ◆ test_3d_classes2()

    @@ -622,13 +621,13 @@ Here is the call graph for this function:
    void test_3d_classes2 ( - std::vector< std::valarray< double >> *  + std::vector< std::valarray< double > > *  data)
    -

    Creates a random set of points distributed in four clusters in 3D space with centroids at the points

      +

      Creates a random set of points distributed in four clusters in 3D space with centroids at the points

      • \((0,5, 0.5, 0.5)\)
      • \((0,5,-0.5, -0.5)\)
      • \((-0,5, 0.5, 0.5)\)
      • @@ -640,45 +639,45 @@ Here is the call graph for this function:
    -
    493  {
    -
    494  const size_t N = data->size();
    -
    495  const double R = 0.2; // radius of cluster
    -
    496  int i = 0;
    -
    497  const int num_classes = 8;
    -
    498  const std::array<std::array<double, 3>, num_classes> centres = {
    -
    499  // centres of each class cluster
    -
    500  std::array<double, 3>({.5, .5, .5}), // centre of class 1
    -
    501  std::array<double, 3>({.5, .5, -.5}), // centre of class 2
    -
    502  std::array<double, 3>({.5, -.5, .5}), // centre of class 3
    -
    503  std::array<double, 3>({.5, -.5, -.5}), // centre of class 4
    -
    504  std::array<double, 3>({-.5, .5, .5}), // centre of class 5
    -
    505  std::array<double, 3>({-.5, .5, -.5}), // centre of class 6
    -
    506  std::array<double, 3>({-.5, -.5, .5}), // centre of class 7
    -
    507  std::array<double, 3>({-.5, -.5, -.5}) // centre of class 8
    -
    508  };
    -
    509 
    -
    510 #ifdef _OPENMP
    -
    511 #pragma omp for
    -
    512 #endif
    -
    513  for (i = 0; i < N; i++) {
    -
    514  // select a random class for the point
    -
    515  int cls = std::rand() % num_classes;
    -
    516 
    -
    517  // create random coordinates (x,y,z) around the centre of the class
    -
    518  data[0][i][0] = _random(centres[cls][0] - R, centres[cls][0] + R);
    -
    519  data[0][i][1] = _random(centres[cls][1] - R, centres[cls][1] + R);
    -
    520  data[0][i][2] = _random(centres[cls][2] - R, centres[cls][2] + R);
    -
    521 
    -
    522  /* The follosing can also be used
    -
    523  for (int j = 0; j < 3; j++)
    -
    524  data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    -
    525  */
    -
    526  }
    -
    527 }
    +
    493 {
    +
    494 const size_t N = data->size();
    +
    495 const double R = 0.2; // radius of cluster
    +
    496 int i = 0;
    +
    497 const int num_classes = 8;
    +
    498 const std::array<std::array<double, 3>, num_classes> centres = {
    +
    499 // centres of each class cluster
    +
    500 std::array<double, 3>({.5, .5, .5}), // centre of class 1
    +
    501 std::array<double, 3>({.5, .5, -.5}), // centre of class 2
    +
    502 std::array<double, 3>({.5, -.5, .5}), // centre of class 3
    +
    503 std::array<double, 3>({.5, -.5, -.5}), // centre of class 4
    +
    504 std::array<double, 3>({-.5, .5, .5}), // centre of class 5
    +
    505 std::array<double, 3>({-.5, .5, -.5}), // centre of class 6
    +
    506 std::array<double, 3>({-.5, -.5, .5}), // centre of class 7
    +
    507 std::array<double, 3>({-.5, -.5, -.5}) // centre of class 8
    +
    508 };
    +
    509
    +
    510#ifdef _OPENMP
    +
    511#pragma omp for
    +
    512#endif
    +
    513 for (i = 0; i < N; i++) {
    +
    514 // select a random class for the point
    +
    515 int cls = std::rand() % num_classes;
    +
    516
    +
    517 // create random coordinates (x,y,z) around the centre of the class
    +
    518 data[0][i][0] = _random(centres[cls][0] - R, centres[cls][0] + R);
    +
    519 data[0][i][1] = _random(centres[cls][1] - R, centres[cls][1] + R);
    +
    520 data[0][i][2] = _random(centres[cls][2] - R, centres[cls][2] + R);
    +
    521
    +
    522 /* The follosing can also be used
    +
    523 for (int j = 0; j < 3; j++)
    +
    524 data[i][j] = _random(centres[class][j] - R, centres[class][j] + R);
    +
    525 */
    +
    526 }
    +
    527}
    Here is the call graph for this function:
    -
    +
    @@ -690,7 +689,7 @@ Here is the call graph for this function:
    diff --git a/d4/def/kohonen__som__topology_8cpp.js b/d4/def/kohonen__som__topology_8cpp.js index 006e2a6a4..162ebfe43 100644 --- a/d4/def/kohonen__som__topology_8cpp.js +++ b/d4/def/kohonen__som__topology_8cpp.js @@ -1,19 +1,18 @@ var kohonen__som__topology_8cpp = [ - [ "_USE_MATH_DEFINES", "d9/d66/group__machine__learning.html#ga525335710b53cb064ca56b936120431e", null ], [ "_random", "d9/d66/group__machine__learning.html#gaf5ce14f026d6d231bef29161bac2b485", null ], [ "get_clock_diff", "d4/def/kohonen__som__topology_8cpp.html#a2256c10b16edba377b64a44b6c656908", null ], - [ "get_min_2d", "d9/d66/group__machine__learning.html#gab53c14440b2b2dd3172c66afc5c2f63f", null ], - [ "kohonen_som", "d4/def/kohonen__som__topology_8cpp.html#adc731720947b4bc2ab047c141e7d0299", null ], + [ "get_min_2d", "d9/d66/group__machine__learning.html#ga60f9186ccb682724a8792a2bf81e9b9e", null ], + [ "kohonen_som", "d4/def/kohonen__som__topology_8cpp.html#ac43d294e21a0c4fa33c53757df054576", null ], [ "main", "d4/def/kohonen__som__topology_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], - [ "save_2d_data", "d9/d66/group__machine__learning.html#ga6c606bc85a3e9fd9d010f874ad760336", null ], - [ "save_u_matrix", "d4/def/kohonen__som__topology_8cpp.html#a1d577f5d95b774ae97eb6838852d0df5", null ], + [ "save_2d_data", "d9/d66/group__machine__learning.html#gabc90175770bf0d5853c466e14993a08c", null ], + [ "save_u_matrix", "d4/def/kohonen__som__topology_8cpp.html#aa72a53c88203fde278f1fe6c3afe5b07", null ], [ "test1", "d4/def/kohonen__som__topology_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0", null ], [ "test2", "d4/def/kohonen__som__topology_8cpp.html#a0283886819c7c140a023582b7269e2d0", null ], [ "test3", "d4/def/kohonen__som__topology_8cpp.html#a6d0455dd5c30adda100e95f0423c786e", null ], - [ "test_2d_classes", "d4/def/kohonen__som__topology_8cpp.html#a6b5e744876fd980a3451cbb385d4e755", null ], - [ "test_3d_classes1", "d4/def/kohonen__som__topology_8cpp.html#ab3081e021270ba21a9fd88646f6a6e26", null ], - [ "test_3d_classes2", "d4/def/kohonen__som__topology_8cpp.html#a0e7435446ed7c763f7de79a468add2e0", null ], - [ "update_weights", "d4/def/kohonen__som__topology_8cpp.html#ac4010fe3a52a74e8b5b1aaadfe38b46f", null ], + [ "test_2d_classes", "d4/def/kohonen__som__topology_8cpp.html#a48efb079040c7aaa3a4917a0e486cba9", null ], + [ "test_3d_classes1", "d4/def/kohonen__som__topology_8cpp.html#a1302662a56ebf67a21249270b017297e", null ], + [ "test_3d_classes2", "d4/def/kohonen__som__topology_8cpp.html#a4b7ab643f6a5002f991837de46f70653", null ], + [ "update_weights", "d4/def/kohonen__som__topology_8cpp.html#ae868ad43698a1d69ba46ea3827d7d2c3", null ], [ "MIN_DISTANCE", "d4/def/kohonen__som__topology_8cpp.html#a7220dbb7fa896d83bfb7a50e4fce1786", null ] ]; \ No newline at end of file diff --git a/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map b/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map index 04a2bd350..ef25e8eef 100644 --- a/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map +++ b/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map @@ -1,18 +1,18 @@ - + - - - + + + - + - + - + diff --git a/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 b/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 index d34bb84dd..6dfbce500 100644 --- a/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 +++ b/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 @@ -1 +1 @@ -b8d15c296f77a95ac28ba8a3b4398e8a \ No newline at end of file +fa81f90deac98b4e6b5022b07e44d9c1 \ No newline at end of file diff --git a/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg b/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg index 431b7ffd6..4444b12c3 100644 --- a/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg +++ b/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg @@ -1,7 +1,7 @@ - @@ -82,7 +82,7 @@ var sectionId = 'dynsection-3'; Node4 - + machine_learning::kohonen_som @@ -112,7 +112,7 @@ var sectionId = 'dynsection-3'; Node16 - + save_2d_data @@ -127,7 +127,7 @@ var sectionId = 'dynsection-3'; Node21 - + machine_learning::save _u_matrix @@ -143,7 +143,7 @@ var sectionId = 'dynsection-3'; Node23 - + test_3d_classes1 @@ -173,7 +173,7 @@ var sectionId = 'dynsection-3'; Node5 - + machine_learning::update _weights @@ -204,7 +204,7 @@ var sectionId = 'dynsection-3'; Node7 - + get_min_2d @@ -255,7 +255,7 @@ var sectionId = 'dynsection-3'; Node15 - + machine_learning::sum diff --git a/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg b/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg index b4bbfa614..1d94e29b1 100644 --- a/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg +++ b/d4/def/kohonen__som__topology_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg @@ -1,7 +1,7 @@ - Node4 - + machine_learning::kohonen_som @@ -66,7 +66,7 @@ Node16 - + save_2d_data @@ -81,7 +81,7 @@ Node21 - + machine_learning::save _u_matrix @@ -97,7 +97,7 @@ Node23 - + test_3d_classes1 @@ -127,7 +127,7 @@ Node5 - + machine_learning::update _weights @@ -158,7 +158,7 @@ Node7 - + get_min_2d @@ -209,7 +209,7 @@ Node15 - + machine_learning::sum diff --git a/d4/def/kohonen__som__topology_8cpp_ab3081e021270ba21a9fd88646f6a6e26_cgraph.map b/d4/def/kohonen__som__topology_8cpp_a1302662a56ebf67a21249270b017297e_cgraph.map similarity index 100% rename from d4/def/kohonen__som__topology_8cpp_ab3081e021270ba21a9fd88646f6a6e26_cgraph.map rename to d4/def/kohonen__som__topology_8cpp_a1302662a56ebf67a21249270b017297e_cgraph.map diff --git a/d4/def/kohonen__som__topology_8cpp_ab3081e021270ba21a9fd88646f6a6e26_cgraph.md5 b/d4/def/kohonen__som__topology_8cpp_a1302662a56ebf67a21249270b017297e_cgraph.md5 similarity index 100% rename from d4/def/kohonen__som__topology_8cpp_ab3081e021270ba21a9fd88646f6a6e26_cgraph.md5 rename to d4/def/kohonen__som__topology_8cpp_a1302662a56ebf67a21249270b017297e_cgraph.md5 diff --git a/d4/def/kohonen__som__topology_8cpp_ab3081e021270ba21a9fd88646f6a6e26_cgraph.svg b/d4/def/kohonen__som__topology_8cpp_a1302662a56ebf67a21249270b017297e_cgraph.svg similarity index 97% rename from d4/def/kohonen__som__topology_8cpp_ab3081e021270ba21a9fd88646f6a6e26_cgraph.svg rename to d4/def/kohonen__som__topology_8cpp_a1302662a56ebf67a21249270b017297e_cgraph.svg index 2d4dba016..7d2d18038 100644 --- a/d4/def/kohonen__som__topology_8cpp_ab3081e021270ba21a9fd88646f6a6e26_cgraph.svg +++ b/d4/def/kohonen__som__topology_8cpp_a1302662a56ebf67a21249270b017297e_cgraph.svg @@ -1,7 +1,7 @@ - - + - - - + + + - + - + - + diff --git a/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 b/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 index d96f99203..071cd30f5 100644 --- a/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 +++ b/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 @@ -1 +1 @@ -b6cb65aa450f069380e6dec7c2a4a460 \ No newline at end of file +3beaff67931ae852db2d52bd8bccab51 \ No newline at end of file diff --git a/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg b/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg index 3243a4f9e..6785f2bb5 100644 --- a/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg +++ b/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg @@ -1,7 +1,7 @@ - @@ -82,7 +82,7 @@ var sectionId = 'dynsection-2'; Node4 - + machine_learning::kohonen_som @@ -112,7 +112,7 @@ var sectionId = 'dynsection-2'; Node16 - + save_2d_data @@ -127,7 +127,7 @@ var sectionId = 'dynsection-2'; Node21 - + machine_learning::save _u_matrix @@ -143,7 +143,7 @@ var sectionId = 'dynsection-2'; Node23 - + test_2d_classes @@ -173,7 +173,7 @@ var sectionId = 'dynsection-2'; Node5 - + machine_learning::update _weights @@ -204,7 +204,7 @@ var sectionId = 'dynsection-2'; Node7 - + get_min_2d @@ -255,7 +255,7 @@ var sectionId = 'dynsection-2'; Node15 - + machine_learning::sum diff --git a/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg b/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg index 125303279..dac109597 100644 --- a/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg +++ b/d4/def/kohonen__som__topology_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg @@ -1,7 +1,7 @@ - Node4 - + machine_learning::kohonen_som @@ -66,7 +66,7 @@ Node16 - + save_2d_data @@ -81,7 +81,7 @@ Node21 - + machine_learning::save _u_matrix @@ -97,7 +97,7 @@ Node23 - + test_2d_classes @@ -127,7 +127,7 @@ Node5 - + machine_learning::update _weights @@ -158,7 +158,7 @@ Node7 - + get_min_2d @@ -209,7 +209,7 @@ Node15 - + machine_learning::sum diff --git a/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map index dd0a089dd..fa7e80c21 100644 --- a/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map +++ b/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -8,18 +8,18 @@ - + - - - + + + - + - + - + @@ -29,6 +29,6 @@ - - + + diff --git a/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 index 4339c4e4a..472920a1d 100644 --- a/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 +++ b/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -1 +1 @@ -2060a3291feabaa0f599fb3147f9389b \ No newline at end of file +d5aa78c7475bd58e27522fd5e9a86b45 \ No newline at end of file diff --git a/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg index a3c17e0ea..fceb69693 100644 --- a/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg +++ b/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -1,7 +1,7 @@ - @@ -187,7 +187,7 @@ var sectionId = 'dynsection-1'; Node8 - + machine_learning::kohonen_som @@ -217,7 +217,7 @@ var sectionId = 'dynsection-1'; Node20 - + save_2d_data @@ -232,7 +232,7 @@ var sectionId = 'dynsection-1'; Node25 - + machine_learning::save _u_matrix @@ -248,7 +248,7 @@ var sectionId = 'dynsection-1'; Node27 - + test_2d_classes @@ -278,7 +278,7 @@ var sectionId = 'dynsection-1'; Node9 - + machine_learning::update _weights @@ -309,7 +309,7 @@ var sectionId = 'dynsection-1'; Node11 - + get_min_2d @@ -360,7 +360,7 @@ var sectionId = 'dynsection-1'; Node19 - + machine_learning::sum @@ -558,7 +558,7 @@ var sectionId = 'dynsection-1'; Node29 - + test_3d_classes1 @@ -615,7 +615,7 @@ var sectionId = 'dynsection-1'; Node31 - + test_3d_classes2 diff --git a/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg b/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg index 6fb7fcb7b..e33aa8e5f 100644 --- a/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg +++ b/d4/def/kohonen__som__topology_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg @@ -1,7 +1,7 @@ - Node8 - + machine_learning::kohonen_som @@ -171,7 +171,7 @@ Node20 - + save_2d_data @@ -186,7 +186,7 @@ Node25 - + machine_learning::save _u_matrix @@ -202,7 +202,7 @@ Node27 - + test_2d_classes @@ -232,7 +232,7 @@ Node9 - + machine_learning::update _weights @@ -263,7 +263,7 @@ Node11 - + get_min_2d @@ -314,7 +314,7 @@ Node19 - + machine_learning::sum @@ -512,7 +512,7 @@ Node29 - + test_3d_classes1 @@ -569,7 +569,7 @@ Node31 - + test_3d_classes2 diff --git a/d4/def/kohonen__som__topology_8cpp_a6b5e744876fd980a3451cbb385d4e755_cgraph.map b/d4/def/kohonen__som__topology_8cpp_a48efb079040c7aaa3a4917a0e486cba9_cgraph.map similarity index 100% rename from d4/def/kohonen__som__topology_8cpp_a6b5e744876fd980a3451cbb385d4e755_cgraph.map rename to d4/def/kohonen__som__topology_8cpp_a48efb079040c7aaa3a4917a0e486cba9_cgraph.map diff --git a/d4/def/kohonen__som__topology_8cpp_a6b5e744876fd980a3451cbb385d4e755_cgraph.md5 b/d4/def/kohonen__som__topology_8cpp_a48efb079040c7aaa3a4917a0e486cba9_cgraph.md5 similarity index 100% rename from d4/def/kohonen__som__topology_8cpp_a6b5e744876fd980a3451cbb385d4e755_cgraph.md5 rename to d4/def/kohonen__som__topology_8cpp_a48efb079040c7aaa3a4917a0e486cba9_cgraph.md5 diff --git a/d4/def/kohonen__som__topology_8cpp_a6b5e744876fd980a3451cbb385d4e755_cgraph.svg b/d4/def/kohonen__som__topology_8cpp_a48efb079040c7aaa3a4917a0e486cba9_cgraph.svg similarity index 97% rename from d4/def/kohonen__som__topology_8cpp_a6b5e744876fd980a3451cbb385d4e755_cgraph.svg rename to d4/def/kohonen__som__topology_8cpp_a48efb079040c7aaa3a4917a0e486cba9_cgraph.svg index 3741a1406..a94c270b2 100644 --- a/d4/def/kohonen__som__topology_8cpp_a6b5e744876fd980a3451cbb385d4e755_cgraph.svg +++ b/d4/def/kohonen__som__topology_8cpp_a48efb079040c7aaa3a4917a0e486cba9_cgraph.svg @@ -1,7 +1,7 @@ - - - + - - - + + + - + - + - + diff --git a/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 b/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 index c2430db1b..90577cc82 100644 --- a/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 +++ b/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 @@ -1 +1 @@ -20b3b46987e38e11f264d078ef949da5 \ No newline at end of file +6229395169572fd503574e7a031f0ebe \ No newline at end of file diff --git a/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg b/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg index 7987b1418..f76f2ffe0 100644 --- a/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg +++ b/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg @@ -1,7 +1,7 @@ - @@ -82,7 +82,7 @@ var sectionId = 'dynsection-4'; Node4 - + machine_learning::kohonen_som @@ -112,7 +112,7 @@ var sectionId = 'dynsection-4'; Node16 - + save_2d_data @@ -127,7 +127,7 @@ var sectionId = 'dynsection-4'; Node21 - + machine_learning::save _u_matrix @@ -143,7 +143,7 @@ var sectionId = 'dynsection-4'; Node23 - + test_3d_classes2 @@ -173,7 +173,7 @@ var sectionId = 'dynsection-4'; Node5 - + machine_learning::update _weights @@ -204,7 +204,7 @@ var sectionId = 'dynsection-4'; Node7 - + get_min_2d @@ -255,7 +255,7 @@ var sectionId = 'dynsection-4'; Node15 - + machine_learning::sum diff --git a/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg b/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg index 7c6ac34e6..b98540b7a 100644 --- a/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg +++ b/d4/def/kohonen__som__topology_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph_org.svg @@ -1,7 +1,7 @@ - Node4 - + machine_learning::kohonen_som @@ -66,7 +66,7 @@ Node16 - + save_2d_data @@ -81,7 +81,7 @@ Node21 - + machine_learning::save _u_matrix @@ -97,7 +97,7 @@ Node23 - + test_3d_classes2 @@ -127,7 +127,7 @@ Node5 - + machine_learning::update _weights @@ -158,7 +158,7 @@ Node7 - + get_min_2d @@ -209,7 +209,7 @@ Node15 - + machine_learning::sum diff --git a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html index b9669a380..12fc68cae 100644 --- a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html +++ b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: machine_learning::neural_network::NeuralNetwork Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -95,45 +95,38 @@ $(document).ready(function(){initNavTree('d4/df4/classmachine__learning_1_1neura Private Member Functions | Private Attributes | List of all members -
    -
    machine_learning::neural_network::NeuralNetwork Class Reference
    +
    machine_learning::neural_network::NeuralNetwork Class Reference
    -
    -Collaboration diagram for machine_learning::neural_network::NeuralNetwork:
    -
    -
    -
    -
    [legend]
    - - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - + + @@ -143,24 +136,24 @@ Public Member Functions

    +

    Public Member Functions

     NeuralNetwork ()=default
     
     NeuralNetwork (const std::vector< std::pair< int, std::string >> &config)
     
     NeuralNetwork (const std::vector< std::pair< int, std::string > > &config)
     
     NeuralNetwork (const NeuralNetwork &model)=default
     
     ~NeuralNetwork ()=default
     
    NeuralNetworkoperator= (const NeuralNetwork &model)=default
     
    NeuralNetworkoperator= (const NeuralNetwork &model)=default
     
     NeuralNetwork (NeuralNetwork &&)=default
     
    NeuralNetworkoperator= (NeuralNetwork &&)=default
     
    std::pair< std::vector< std::vector< std::valarray< double > > >, std::vector< std::vector< std::valarray< double > > > > get_XY_from_csv (const std::string &file_name, const bool &last_label, const bool &normalize, const int &slip_lines=1)
     
    std::vector< std::valarray< double > > single_predict (const std::vector< std::valarray< double >> &X)
     
    std::vector< std::vector< std::valarray< double > > > batch_predict (const std::vector< std::vector< std::valarray< double >>> &X)
     
    void fit (const std::vector< std::vector< std::valarray< double >>> &X_, const std::vector< std::vector< std::valarray< double >>> &Y_, const int &epochs=100, const double &learning_rate=0.01, const size_t &batch_size=32, const bool &shuffle=true)
     
    NeuralNetworkoperator= (NeuralNetwork &&)=default
     
    std::pair< std::vector< std::vector< std::valarray< double > > >, std::vector< std::vector< std::valarray< double > > > > get_XY_from_csv (const std::string &file_name, const bool &last_label, const bool &normalize, const int &slip_lines=1)
     
    std::vector< std::valarray< double > > single_predict (const std::vector< std::valarray< double > > &X)
     
    std::vector< std::vector< std::valarray< double > > > batch_predict (const std::vector< std::vector< std::valarray< double > > > &X)
     
    void fit (const std::vector< std::vector< std::valarray< double > > > &X_, const std::vector< std::vector< std::valarray< double > > > &Y_, const int &epochs=100, const double &learning_rate=0.01, const size_t &batch_size=32, const bool &shuffle=true)
     
    void fit_from_csv (const std::string &file_name, const bool &last_label, const int &epochs, const double &learning_rate, const bool &normalize, const int &slip_lines=1, const size_t &batch_size=32, const bool &shuffle=true)
     
    void evaluate (const std::vector< std::vector< std::valarray< double >>> &X, const std::vector< std::vector< std::valarray< double >>> &Y)
     
    void evaluate (const std::vector< std::vector< std::valarray< double > > > &X, const std::vector< std::vector< std::valarray< double > > > &Y)
     
    void evaluate_from_csv (const std::string &file_name, const bool &last_label, const bool &normalize, const int &slip_lines=1)
     
    void save_model (const std::string &_file_name)
    void summary ()
     
    - - - - - + + + +

    +

    Private Member Functions

     NeuralNetwork (const std::vector< std::pair< int, std::string >> &config, const std::vector< std::vector< std::valarray< double >>> &kernels)
     
    std::vector< std::vector< std::valarray< double > > > __detailed_single_prediction (const std::vector< std::valarray< double >> &X)
     
     NeuralNetwork (const std::vector< std::pair< int, std::string > > &config, const std::vector< std::vector< std::valarray< double > > > &kernels)
     
    std::vector< std::vector< std::valarray< double > > > __detailed_single_prediction (const std::vector< std::valarray< double > > &X)
     
    - -

    +

    Private Attributes

    +
    std::vector< neural_network::layers::DenseLayerlayers
     

    Detailed Description

    -

    NeuralNetwork class is implements MLP. This class is used by actual user to create and train networks.

    +

    NeuralNetwork class is implements MLP. This class is used by actual user to create and train networks.

    Constructor & Destructor Documentation

    - -

    ◆ NeuralNetwork() [1/5]

    + +

    ◆ NeuralNetwork() [1/5]

    @@ -171,13 +164,13 @@ Private Attributes machine_learning::neural_network::NeuralNetwork::NeuralNetwork ( - const std::vector< std::pair< int, std::string >> &  + const std::vector< std::pair< int, std::string > > &  config, - const std::vector< std::vector< std::valarray< double >>> &  + const std::vector< std::vector< std::valarray< double > > > &  kernels  @@ -192,37 +185,37 @@ Private Attributes
    -

    Private Constructor for class NeuralNetwork. This constructor is used internally to load model.

    Parameters
    +

    Private Constructor for class NeuralNetwork. This constructor is used internally to load model.

    Parameters
    configvector containing pair (neurons, activation)
    kernelsvector containing all pretrained kernels
    -
    258  {
    -
    259  // First layer should not have activation
    -
    260  if (config.begin()->second != "none") {
    -
    261  std::cerr << "ERROR (" << __func__ << ") : ";
    -
    262  std::cerr
    -
    263  << "First layer can't have activation other than none got "
    -
    264  << config.begin()->second;
    -
    265  std::cerr << std::endl;
    -
    266  std::exit(EXIT_FAILURE);
    -
    267  }
    -
    268  // Network should have atleast two layers
    -
    269  if (config.size() <= 1) {
    -
    270  std::cerr << "ERROR (" << __func__ << ") : ";
    -
    271  std::cerr << "Invalid size of network, ";
    -
    272  std::cerr << "Atleast two layers are required";
    -
    273  std::exit(EXIT_FAILURE);
    -
    274  }
    -
    275  // Reconstructing all pretrained layers
    -
    276  for (size_t i = 0; i < config.size(); i++) {
    -
    277  layers.emplace_back(neural_network::layers::DenseLayer(
    -
    278  config[i].first, config[i].second, kernels[i]));
    -
    279  }
    -
    280  std::cout << "INFO: Network constructed successfully" << std::endl;
    -
    281  }
    +
    258 {
    +
    259 // First layer should not have activation
    +
    260 if (config.begin()->second != "none") {
    +
    261 std::cerr << "ERROR (" << __func__ << ") : ";
    + +
    263 << "First layer can't have activation other than none got "
    +
    264 << config.begin()->second;
    + +
    266 std::exit(EXIT_FAILURE);
    +
    267 }
    +
    268 // Network should have atleast two layers
    +
    269 if (config.size() <= 1) {
    +
    270 std::cerr << "ERROR (" << __func__ << ") : ";
    +
    271 std::cerr << "Invalid size of network, ";
    +
    272 std::cerr << "Atleast two layers are required";
    +
    273 std::exit(EXIT_FAILURE);
    +
    274 }
    +
    275 // Reconstructing all pretrained layers
    +
    276 for (size_t i = 0; i < config.size(); i++) {
    +
    277 layers.emplace_back(neural_network::layers::DenseLayer(
    +
    278 config[i].first, config[i].second, kernels[i]));
    +
    279 }
    +
    280 std::cout << "INFO: Network constructed successfully" << std::endl;
    +
    281 }
    T begin(T... args)
    T endl(T... args)
    @@ -232,13 +225,13 @@ Private Attributes
    Here is the call graph for this function:
    -
    +
    - +

    ◆ NeuralNetwork() [2/5]

    @@ -260,12 +253,12 @@ Here is the call graph for this function:
    -

    Default Constructor for class NeuralNetwork. This constructor is used to create empty variable of type NeuralNetwork class.

    +

    Default Constructor for class NeuralNetwork. This constructor is used to create empty variable of type NeuralNetwork class.

    - -

    ◆ NeuralNetwork() [3/5]

    + +

    ◆ NeuralNetwork() [3/5]

    @@ -276,7 +269,7 @@ Here is the call graph for this function:
    machine_learning::neural_network::NeuralNetwork::NeuralNetwork ( - const std::vector< std::pair< int, std::string >> &  + const std::vector< std::pair< int, std::string > > &  config) @@ -287,52 +280,52 @@ Here is the call graph for this function:
    -

    Constructor for class NeuralNetwork. This constructor is used by user.

    Parameters
    +

    Constructor for class NeuralNetwork. This constructor is used by user.

    Parameters
    configvector containing pair (neurons, activation)
    -
    314  {
    -
    315  // First layer should not have activation
    -
    316  if (config.begin()->second != "none") {
    -
    317  std::cerr << "ERROR (" << __func__ << ") : ";
    -
    318  std::cerr
    -
    319  << "First layer can't have activation other than none got "
    -
    320  << config.begin()->second;
    -
    321  std::cerr << std::endl;
    -
    322  std::exit(EXIT_FAILURE);
    -
    323  }
    -
    324  // Network should have atleast two layers
    -
    325  if (config.size() <= 1) {
    -
    326  std::cerr << "ERROR (" << __func__ << ") : ";
    -
    327  std::cerr << "Invalid size of network, ";
    -
    328  std::cerr << "Atleast two layers are required";
    -
    329  std::exit(EXIT_FAILURE);
    -
    330  }
    -
    331  // Separately creating first layer so it can have unit matrix
    -
    332  // as kernel.
    -
    333  layers.push_back(neural_network::layers::DenseLayer(
    -
    334  config[0].first, config[0].second,
    -
    335  {config[0].first, config[0].first}, false));
    -
    336  // Creating remaining layers
    -
    337  for (size_t i = 1; i < config.size(); i++) {
    -
    338  layers.push_back(neural_network::layers::DenseLayer(
    -
    339  config[i].first, config[i].second,
    -
    340  {config[i - 1].first, config[i].first}, true));
    -
    341  }
    -
    342  std::cout << "INFO: Network constructed successfully" << std::endl;
    -
    343  }
    +
    314 {
    +
    315 // First layer should not have activation
    +
    316 if (config.begin()->second != "none") {
    +
    317 std::cerr << "ERROR (" << __func__ << ") : ";
    + +
    319 << "First layer can't have activation other than none got "
    +
    320 << config.begin()->second;
    + +
    322 std::exit(EXIT_FAILURE);
    +
    323 }
    +
    324 // Network should have atleast two layers
    +
    325 if (config.size() <= 1) {
    +
    326 std::cerr << "ERROR (" << __func__ << ") : ";
    +
    327 std::cerr << "Invalid size of network, ";
    +
    328 std::cerr << "Atleast two layers are required";
    +
    329 std::exit(EXIT_FAILURE);
    +
    330 }
    +
    331 // Separately creating first layer so it can have unit matrix
    +
    332 // as kernel.
    +
    333 layers.push_back(neural_network::layers::DenseLayer(
    +
    334 config[0].first, config[0].second,
    +
    335 {config[0].first, config[0].first}, false));
    +
    336 // Creating remaining layers
    +
    337 for (size_t i = 1; i < config.size(); i++) {
    +
    338 layers.push_back(neural_network::layers::DenseLayer(
    +
    339 config[i].first, config[i].second,
    +
    340 {config[i - 1].first, config[i].first}, true));
    +
    341 }
    +
    342 std::cout << "INFO: Network constructed successfully" << std::endl;
    +
    343 }
    Here is the call graph for this function:
    -
    +
    - +

    ◆ NeuralNetwork() [4/5]

    @@ -355,7 +348,7 @@ Here is the call graph for this function:
    -

    Copy Constructor for class NeuralNetwork.

    +

    Copy Constructor for class NeuralNetwork.

    Parameters
    @@ -365,7 +358,7 @@ Here is the call graph for this function: - +

    ◆ ~NeuralNetwork()

    @@ -387,11 +380,11 @@ Here is the call graph for this function:
    modelinstance of class to be copied.
    -

    Destructor for class NeuralNetwork.

    +

    Destructor for class NeuralNetwork.

    - +

    ◆ NeuralNetwork() [5/5]

    @@ -414,13 +407,13 @@ Here is the call graph for this function:
    -

    Move constructor for class NeuralNetwork

    +

    Move constructor for class NeuralNetwork

    Member Function Documentation

    - -

    ◆ __detailed_single_prediction()

    + +

    ◆ __detailed_single_prediction()

    @@ -429,9 +422,9 @@ Here is the call graph for this function:
    - + - + @@ -442,38 +435,38 @@ Here is the call graph for this function:
    std::vector<std::vector<std::valarray<double> > > machine_learning::neural_network::NeuralNetwork::__detailed_single_prediction std::vector< std::vector< std::valarray< double > > > machine_learning::neural_network::NeuralNetwork::__detailed_single_prediction (const std::vector< std::valarray< double >> & const std::vector< std::valarray< double > > &  X)
    -

    Private function to get detailed predictions (i.e. activated neuron values). This function is used in backpropagation, single predict and batch predict.

    Parameters
    +

    Private function to get detailed predictions (i.e. activated neuron values). This function is used in backpropagation, single predict and batch predict.

    Parameters
    Xinput vector
    -
    289  {
    - -
    291  std::vector<std::valarray<double>> current_pass = X;
    -
    292  details.emplace_back(X);
    -
    293  for (const auto &l : layers) {
    -
    294  current_pass = multiply(current_pass, l.kernel);
    -
    295  current_pass = apply_function(current_pass, l.activation_function);
    -
    296  details.emplace_back(current_pass);
    -
    297  }
    -
    298  return details;
    -
    299  }
    +
    289 {
    + +
    291 std::vector<std::valarray<double>> current_pass = X;
    +
    292 details.emplace_back(X);
    +
    293 for (const auto &l : layers) {
    +
    294 current_pass = multiply(current_pass, l.kernel);
    +
    295 current_pass = apply_function(current_pass, l.activation_function);
    +
    296 details.emplace_back(current_pass);
    +
    297 }
    +
    298 return details;
    +
    299 }
    T emplace_back(T... args)
    -
    std::vector< std::valarray< T > > multiply(const std::vector< std::valarray< T >> &A, const std::vector< std::valarray< T >> &B)
    Definition: vector_ops.hpp:460
    -
    std::vector< std::valarray< T > > apply_function(const std::vector< std::valarray< T >> &A, T(*func)(const T &))
    Definition: vector_ops.hpp:329
    +
    std::vector< std::valarray< T > > multiply(const std::vector< std::valarray< T > > &A, const std::vector< std::valarray< T > > &B)
    Definition: vector_ops.hpp:460
    +
    std::vector< std::valarray< T > > apply_function(const std::vector< std::valarray< T > > &A, T(*func)(const T &))
    Definition: vector_ops.hpp:329
    Here is the call graph for this function:
    -
    +
    - -

    ◆ batch_predict()

    + +

    ◆ batch_predict()

    @@ -482,9 +475,9 @@ Here is the call graph for this function:
    - + - + @@ -495,35 +488,35 @@ Here is the call graph for this function:
    std::vector<std::vector<std::valarray<double> > > machine_learning::neural_network::NeuralNetwork::batch_predict std::vector< std::vector< std::valarray< double > > > machine_learning::neural_network::NeuralNetwork::batch_predict (const std::vector< std::vector< std::valarray< double >>> & const std::vector< std::vector< std::valarray< double > > > &  X)
    -

    Function to get prediction of model on batch

    Parameters
    +

    Function to get prediction of model on batch

    Parameters
    Xarray of feature vectors
    Returns
    returns predicted values as vector
    -
    465  {
    -
    466  // Store predicted values
    - -
    468  X.size());
    -
    469  for (size_t i = 0; i < X.size(); i++) { // For every sample
    -
    470  // Push predicted values
    -
    471  predicted_batch[i] = this->single_predict(X[i]);
    -
    472  }
    -
    473  return predicted_batch; // Return predicted values
    -
    474  }
    -
    std::vector< std::valarray< double > > single_predict(const std::vector< std::valarray< double >> &X)
    Definition: neural_network.cpp:451
    +
    465 {
    +
    466 // Store predicted values
    + +
    468 X.size());
    +
    469 for (size_t i = 0; i < X.size(); i++) { // For every sample
    +
    470 // Push predicted values
    +
    471 predicted_batch[i] = this->single_predict(X[i]);
    +
    472 }
    +
    473 return predicted_batch; // Return predicted values
    +
    474 }
    +
    std::vector< std::valarray< double > > single_predict(const std::vector< std::valarray< double > > &X)
    Definition: neural_network.cpp:451
    Here is the call graph for this function:
    -
    +
    - -

    ◆ evaluate()

    + +

    ◆ evaluate()

    @@ -534,13 +527,13 @@ Here is the call graph for this function:
    void machine_learning::neural_network::NeuralNetwork::evaluate ( - const std::vector< std::vector< std::valarray< double >>> &  + const std::vector< std::vector< std::valarray< double > > > &  X, - const std::vector< std::vector< std::valarray< double >>> &  + const std::vector< std::vector< std::valarray< double > > > &  Y  @@ -555,48 +548,48 @@ Here is the call graph for this function:
    -

    Function to evaluate model on supplied data

    Parameters
    +

    Function to evaluate model on supplied data

    Parameters
    Xarray of feature vectors (input data)
    Yarray of target values (label)
    -
    607  {
    -
    608  std::cout << "INFO: Evaluation Started" << std::endl;
    -
    609  double acc = 0, loss = 0; // intialize performance metrics with zero
    -
    610  for (size_t i = 0; i < X.size(); i++) { // For every sample in input
    -
    611  // Get predictions
    - -
    613  this->single_predict(X[i]);
    -
    614  // If predicted class is correct
    -
    615  if (argmax(pred) == argmax(Y[i])) {
    -
    616  acc += 1; // Increment accuracy
    -
    617  }
    -
    618  // Calculating loss - Mean Squared Error
    -
    619  loss += sum(apply_function((Y[i] - pred),
    -
    620  neural_network::util_functions::square) *
    -
    621  0.5);
    -
    622  }
    -
    623  acc /= X.size(); // Averaging accuracy
    -
    624  loss /= X.size(); // Averaging loss
    -
    625  // Prinitng performance of the model
    -
    626  std::cout << "Evaluation: Loss: " << loss;
    -
    627  std::cout << ", Accuracy: " << acc << std::endl;
    -
    628  return;
    -
    629  }
    -
    size_t argmax(const std::vector< std::valarray< T >> &A)
    Definition: vector_ops.hpp:307
    -
    T sum(const std::vector< std::valarray< T >> &A)
    Definition: vector_ops.hpp:232
    +
    607 {
    +
    608 std::cout << "INFO: Evaluation Started" << std::endl;
    +
    609 double acc = 0, loss = 0; // intialize performance metrics with zero
    +
    610 for (size_t i = 0; i < X.size(); i++) { // For every sample in input
    +
    611 // Get predictions
    + +
    613 this->single_predict(X[i]);
    +
    614 // If predicted class is correct
    +
    615 if (argmax(pred) == argmax(Y[i])) {
    +
    616 acc += 1; // Increment accuracy
    +
    617 }
    +
    618 // Calculating loss - Mean Squared Error
    +
    619 loss += sum(apply_function((Y[i] - pred),
    +
    620 neural_network::util_functions::square) *
    +
    621 0.5);
    +
    622 }
    +
    623 acc /= X.size(); // Averaging accuracy
    +
    624 loss /= X.size(); // Averaging loss
    +
    625 // Prinitng performance of the model
    +
    626 std::cout << "Evaluation: Loss: " << loss;
    +
    627 std::cout << ", Accuracy: " << acc << std::endl;
    +
    628 return;
    +
    629 }
    +
    size_t argmax(const std::vector< std::valarray< T > > &A)
    Definition: vector_ops.hpp:307
    +
    T sum(const std::vector< std::valarray< T > > &A)
    Definition: vector_ops.hpp:232
    Here is the call graph for this function:
    -
    +
    - +

    ◆ evaluate_from_csv()

    @@ -641,7 +634,7 @@ Here is the call graph for this function:
    -

    Function to evaluate model on data stored in csv file

    Parameters
    +

    Function to evaluate model on data stored in csv file

    Parameters
    @@ -650,16 +643,16 @@ Here is the call graph for this function:
    file_namecsv file name
    last_labelflag for whether label is in first or last column
    -
    639  {
    -
    640  // Getting training data from csv file
    -
    641  auto data =
    -
    642  this->get_XY_from_csv(file_name, last_label, normalize, slip_lines);
    -
    643  // Evaluating model
    -
    644  this->evaluate(data.first, data.second);
    -
    645  return;
    -
    646  }
    -
    void evaluate(const std::vector< std::vector< std::valarray< double >>> &X, const std::vector< std::vector< std::valarray< double >>> &Y)
    Definition: neural_network.cpp:606
    -
    std::pair< std::vector< std::vector< std::valarray< double > > >, std::vector< std::vector< std::valarray< double > > > > get_XY_from_csv(const std::string &file_name, const bool &last_label, const bool &normalize, const int &slip_lines=1)
    Definition: neural_network.cpp:382
    +
    639 {
    +
    640 // Getting training data from csv file
    +
    641 auto data =
    +
    642 this->get_XY_from_csv(file_name, last_label, normalize, slip_lines);
    +
    643 // Evaluating model
    +
    644 this->evaluate(data.first, data.second);
    +
    645 return;
    +
    646 }
    +
    std::pair< std::vector< std::vector< std::valarray< double > > >, std::vector< std::vector< std::valarray< double > > > > get_XY_from_csv(const std::string &file_name, const bool &last_label, const bool &normalize, const int &slip_lines=1)
    Definition: neural_network.cpp:382
    +
    void evaluate(const std::vector< std::vector< std::valarray< double > > > &X, const std::vector< std::vector< std::valarray< double > > > &Y)
    Definition: neural_network.cpp:606
    int data[MAX]
    test data
    Definition: hash_search.cpp:24
    Here is the call graph for this function:
    @@ -670,8 +663,8 @@ Here is the call graph for this function:
    - -

    ◆ fit()

    + +

    ◆ fit()

    @@ -682,13 +675,13 @@ Here is the call graph for this function:
    void machine_learning::neural_network::NeuralNetwork::fit ( - const std::vector< std::vector< std::valarray< double >>> &  + const std::vector< std::vector< std::valarray< double > > > &  X_, - const std::vector< std::vector< std::valarray< double >>> &  + const std::vector< std::vector< std::valarray< double > > > &  Y_, @@ -727,7 +720,7 @@ Here is the call graph for this function:
    -

    Function to fit model on supplied data

    Parameters
    +

    Function to fit model on supplied data

    Parameters
    @@ -738,114 +731,114 @@ Here is the call graph for this function:
    Xarray of feature vectors
    Yarray of target values
    -
    488  {
    - -
    490  // Both label and input data should have same size
    -
    491  if (X.size() != Y.size()) {
    -
    492  std::cerr << "ERROR (" << __func__ << ") : ";
    -
    493  std::cerr << "X and Y in fit have different sizes" << std::endl;
    -
    494  std::exit(EXIT_FAILURE);
    -
    495  }
    -
    496  std::cout << "INFO: Training Started" << std::endl;
    -
    497  for (int epoch = 1; epoch <= epochs; epoch++) { // For every epoch
    -
    498  // Shuffle X and Y if flag is set
    -
    499  if (shuffle) {
    -
    500  equal_shuffle(X, Y);
    -
    501  }
    -
    502  auto start =
    - -
    504  double loss = 0,
    -
    505  acc = 0; // Intialize performance metrics with zero
    -
    506  // For each starting index of batch
    -
    507  for (size_t batch_start = 0; batch_start < X.size();
    -
    508  batch_start += batch_size) {
    -
    509  for (size_t i = batch_start;
    -
    510  i < std::min(X.size(), batch_start + batch_size); i++) {
    -
    511  std::vector<std::valarray<double>> grad, cur_error,
    -
    512  predicted;
    -
    513  auto activations = this->__detailed_single_prediction(X[i]);
    -
    514  // Gradients vector to store gradients for all layers
    -
    515  // They will be averaged and applied to kernel
    - -
    517  gradients.resize(this->layers.size());
    -
    518  // First intialize gradients to zero
    -
    519  for (size_t i = 0; i < gradients.size(); i++) {
    - -
    521  gradients[i], get_shape(this->layers[i].kernel));
    -
    522  }
    -
    523  predicted = activations.back(); // Predicted vector
    -
    524  cur_error = predicted - Y[i]; // Absoulute error
    -
    525  // Calculating loss with MSE
    -
    526  loss += sum(apply_function(
    -
    527  cur_error, neural_network::util_functions::square));
    -
    528  // If prediction is correct
    -
    529  if (argmax(predicted) == argmax(Y[i])) {
    -
    530  acc += 1;
    -
    531  }
    -
    532  // For every layer (except first) starting from last one
    -
    533  for (size_t j = this->layers.size() - 1; j >= 1; j--) {
    -
    534  // Backpropogating errors
    -
    535  cur_error = hadamard_product(
    -
    536  cur_error,
    - -
    538  activations[j + 1],
    -
    539  this->layers[j].dactivation_function));
    -
    540  // Calculating gradient for current layer
    -
    541  grad = multiply(transpose(activations[j]), cur_error);
    -
    542  // Change error according to current kernel values
    -
    543  cur_error = multiply(cur_error,
    -
    544  transpose(this->layers[j].kernel));
    -
    545  // Adding gradient values to collection of gradients
    -
    546  gradients[j] = gradients[j] + grad / double(batch_size);
    -
    547  }
    -
    548  // Applying gradients
    -
    549  for (size_t j = this->layers.size() - 1; j >= 1; j--) {
    -
    550  // Updating kernel (aka weights)
    -
    551  this->layers[j].kernel = this->layers[j].kernel -
    -
    552  gradients[j] * learning_rate;
    -
    553  }
    -
    554  }
    -
    555  }
    -
    556  auto stop =
    -
    557  std::chrono::high_resolution_clock::now(); // Stoping the clock
    -
    558  // Calculate time taken by epoch
    -
    559  auto duration =
    -
    560  std::chrono::duration_cast<std::chrono::microseconds>(stop -
    -
    561  start);
    -
    562  loss /= X.size(); // Averaging loss
    -
    563  acc /= X.size(); // Averaging accuracy
    -
    564  std::cout.precision(4); // set output precision to 4
    -
    565  // Printing training stats
    -
    566  std::cout << "Training: Epoch " << epoch << '/' << epochs;
    -
    567  std::cout << ", Loss: " << loss;
    -
    568  std::cout << ", Accuracy: " << acc;
    -
    569  std::cout << ", Taken time: " << duration.count() / 1e6
    -
    570  << " seconds";
    -
    571  std::cout << std::endl;
    -
    572  }
    -
    573  return;
    -
    574  }
    -
    std::vector< std::vector< std::valarray< double > > > __detailed_single_prediction(const std::vector< std::valarray< double >> &X)
    Definition: neural_network.cpp:289
    +
    488 {
    + +
    490 // Both label and input data should have same size
    +
    491 if (X.size() != Y.size()) {
    +
    492 std::cerr << "ERROR (" << __func__ << ") : ";
    +
    493 std::cerr << "X and Y in fit have different sizes" << std::endl;
    +
    494 std::exit(EXIT_FAILURE);
    +
    495 }
    +
    496 std::cout << "INFO: Training Started" << std::endl;
    +
    497 for (int epoch = 1; epoch <= epochs; epoch++) { // For every epoch
    +
    498 // Shuffle X and Y if flag is set
    +
    499 if (shuffle) {
    +
    500 equal_shuffle(X, Y);
    +
    501 }
    +
    502 auto start =
    + +
    504 double loss = 0,
    +
    505 acc = 0; // Intialize performance metrics with zero
    +
    506 // For each starting index of batch
    +
    507 for (size_t batch_start = 0; batch_start < X.size();
    +
    508 batch_start += batch_size) {
    +
    509 for (size_t i = batch_start;
    +
    510 i < std::min(X.size(), batch_start + batch_size); i++) {
    +
    511 std::vector<std::valarray<double>> grad, cur_error,
    +
    512 predicted;
    +
    513 auto activations = this->__detailed_single_prediction(X[i]);
    +
    514 // Gradients vector to store gradients for all layers
    +
    515 // They will be averaged and applied to kernel
    + +
    517 gradients.resize(this->layers.size());
    +
    518 // First intialize gradients to zero
    +
    519 for (size_t i = 0; i < gradients.size(); i++) {
    + +
    521 gradients[i], get_shape(this->layers[i].kernel));
    +
    522 }
    +
    523 predicted = activations.back(); // Predicted vector
    +
    524 cur_error = predicted - Y[i]; // Absoulute error
    +
    525 // Calculating loss with MSE
    +
    526 loss += sum(apply_function(
    +
    527 cur_error, neural_network::util_functions::square));
    +
    528 // If prediction is correct
    +
    529 if (argmax(predicted) == argmax(Y[i])) {
    +
    530 acc += 1;
    +
    531 }
    +
    532 // For every layer (except first) starting from last one
    +
    533 for (size_t j = this->layers.size() - 1; j >= 1; j--) {
    +
    534 // Backpropogating errors
    +
    535 cur_error = hadamard_product(
    +
    536 cur_error,
    + +
    538 activations[j + 1],
    +
    539 this->layers[j].dactivation_function));
    +
    540 // Calculating gradient for current layer
    +
    541 grad = multiply(transpose(activations[j]), cur_error);
    +
    542 // Change error according to current kernel values
    +
    543 cur_error = multiply(cur_error,
    +
    544 transpose(this->layers[j].kernel));
    +
    545 // Adding gradient values to collection of gradients
    +
    546 gradients[j] = gradients[j] + grad / double(batch_size);
    +
    547 }
    +
    548 // Applying gradients
    +
    549 for (size_t j = this->layers.size() - 1; j >= 1; j--) {
    +
    550 // Updating kernel (aka weights)
    +
    551 this->layers[j].kernel = this->layers[j].kernel -
    +
    552 gradients[j] * learning_rate;
    +
    553 }
    +
    554 }
    +
    555 }
    +
    556 auto stop =
    +
    557 std::chrono::high_resolution_clock::now(); // Stoping the clock
    +
    558 // Calculate time taken by epoch
    +
    559 auto duration =
    +
    560 std::chrono::duration_cast<std::chrono::microseconds>(stop -
    +
    561 start);
    +
    562 loss /= X.size(); // Averaging loss
    +
    563 acc /= X.size(); // Averaging accuracy
    +
    564 std::cout.precision(4); // set output precision to 4
    +
    565 // Printing training stats
    +
    566 std::cout << "Training: Epoch " << epoch << '/' << epochs;
    +
    567 std::cout << ", Loss: " << loss;
    +
    568 std::cout << ", Accuracy: " << acc;
    +
    569 std::cout << ", Taken time: " << duration.count() / 1e6
    +
    570 << " seconds";
    + +
    572 }
    +
    573 return;
    +
    574 }
    +
    std::vector< std::vector< std::valarray< double > > > __detailed_single_prediction(const std::vector< std::valarray< double > > &X)
    Definition: neural_network.cpp:289
    T min(T... args)
    Various activation functions used in Neural network.
    -
    void zeroes_initialization(std::vector< std::valarray< T >> &A, const std::pair< size_t, size_t > &shape)
    Definition: vector_ops.hpp:213
    -
    void equal_shuffle(std::vector< std::vector< std::valarray< T >>> &A, std::vector< std::vector< std::valarray< T >>> &B)
    Definition: vector_ops.hpp:136
    -
    std::vector< std::valarray< T > > hadamard_product(const std::vector< std::valarray< T >> &A, const std::vector< std::valarray< T >> &B)
    Definition: vector_ops.hpp:494
    -
    std::pair< size_t, size_t > get_shape(const std::vector< std::valarray< T >> &A)
    Definition: vector_ops.hpp:247
    -
    std::vector< std::valarray< T > > transpose(const std::vector< std::valarray< T >> &A)
    Definition: vector_ops.hpp:382
    -
    std::array< T, N > shuffle(std::array< T, N > arr)
    Definition: bogo_sort.cpp:36
    +
    std::vector< std::valarray< T > > transpose(const std::vector< std::valarray< T > > &A)
    Definition: vector_ops.hpp:382
    +
    std::pair< size_t, size_t > get_shape(const std::vector< std::valarray< T > > &A)
    Definition: vector_ops.hpp:247
    +
    void zeroes_initialization(std::vector< std::valarray< T > > &A, const std::pair< size_t, size_t > &shape)
    Definition: vector_ops.hpp:213
    +
    std::vector< std::valarray< T > > hadamard_product(const std::vector< std::valarray< T > > &A, const std::vector< std::valarray< T > > &B)
    Definition: vector_ops.hpp:494
    +
    void equal_shuffle(std::vector< std::vector< std::valarray< T > > > &A, std::vector< std::vector< std::valarray< T > > > &B)
    Definition: vector_ops.hpp:136
    +
    std::array< T, N > shuffle(std::array< T, N > arr)
    Definition: bogo_sort.cpp:36
    T resize(T... args)
    Here is the call graph for this function:
    -
    +
    - +

    ◆ fit_from_csv()

    @@ -914,7 +907,7 @@ Here is the call graph for this function:
    -

    Function to fit model on data stored in csv file

    Parameters
    +

    Function to fit model on data stored in csv file

    Parameters
    @@ -927,16 +920,16 @@ Here is the call graph for this function:
    file_namecsv file name
    last_labelflag for whether label is in first or last column
    -
    591  {
    -
    592  // Getting training data from csv file
    -
    593  auto data =
    -
    594  this->get_XY_from_csv(file_name, last_label, normalize, slip_lines);
    -
    595  // Fit the model on training data
    -
    596  this->fit(data.first, data.second, epochs, learning_rate, batch_size,
    -
    597  shuffle);
    -
    598  return;
    -
    599  }
    -
    void fit(const std::vector< std::vector< std::valarray< double >>> &X_, const std::vector< std::vector< std::valarray< double >>> &Y_, const int &epochs=100, const double &learning_rate=0.01, const size_t &batch_size=32, const bool &shuffle=true)
    Definition: neural_network.cpp:485
    +
    591 {
    +
    592 // Getting training data from csv file
    +
    593 auto data =
    +
    594 this->get_XY_from_csv(file_name, last_label, normalize, slip_lines);
    +
    595 // Fit the model on training data
    +
    596 this->fit(data.first, data.second, epochs, learning_rate, batch_size,
    +
    597 shuffle);
    +
    598 return;
    +
    599 }
    +
    void fit(const std::vector< std::vector< std::valarray< double > > > &X_, const std::vector< std::vector< std::valarray< double > > > &Y_, const int &epochs=100, const double &learning_rate=0.01, const size_t &batch_size=32, const bool &shuffle=true)
    Definition: neural_network.cpp:485
    Here is the call graph for this function:
    @@ -946,8 +939,8 @@ Here is the call graph for this function:
    - -

    ◆ get_XY_from_csv()

    + +

    ◆ get_XY_from_csv()

    @@ -956,7 +949,7 @@ Here is the call graph for this function:
    - + @@ -991,7 +984,7 @@ Here is the call graph for this function:
    std::pair<std::vector<std::vector<std::valarray<double> > >, std::vector<std::vector<std::valarray<double> > > > machine_learning::neural_network::NeuralNetwork::get_XY_from_csv std::pair< std::vector< std::vector< std::valarray< double > > >, std::vector< std::vector< std::valarray< double > > > > machine_learning::neural_network::NeuralNetwork::get_XY_from_csv ( const std::string file_name,
    -

    Function to get X and Y from csv file (where X = data, Y = label)

    Parameters
    +

    Function to get X and Y from csv file (where X = data, Y = label)

    Parameters
    @@ -1001,68 +994,68 @@ Here is the call graph for this function:
    Returns
    returns pair of X and Y
    -
    383  {
    -
    384  std::ifstream in_file; // Ifstream to read file
    -
    385  in_file.open(file_name.c_str(), std::ios::in); // Open file
    -
    386  // If there is any problem in opening file
    -
    387  if (!in_file.is_open()) {
    -
    388  std::cerr << "ERROR (" << __func__ << ") : ";
    -
    389  std::cerr << "Unable to open file: " << file_name << std::endl;
    -
    390  std::exit(EXIT_FAILURE);
    -
    391  }
    - -
    393  Y; // To store X and Y
    -
    394  std::string line; // To store each line
    -
    395  // Skip lines
    -
    396  for (int i = 0; i < slip_lines; i++) {
    -
    397  std::getline(in_file, line, '\n'); // Ignore line
    -
    398  }
    -
    399  // While file has information
    -
    400  while (!in_file.eof() && std::getline(in_file, line, '\n')) {
    -
    401  std::valarray<double> x_data,
    -
    402  y_data; // To store single sample and label
    -
    403  std::stringstream ss(line); // Constructing stringstream from line
    -
    404  std::string token; // To store each token in line (seprated by ',')
    -
    405  while (std::getline(ss, token, ',')) { // For each token
    -
    406  // Insert numerical value of token in x_data
    -
    407  x_data = insert_element(x_data, std::stod(token));
    -
    408  }
    -
    409  // If label is in last column
    -
    410  if (last_label) {
    -
    411  y_data.resize(this->layers.back().neurons);
    -
    412  // If task is classification
    -
    413  if (y_data.size() > 1) {
    -
    414  y_data[x_data[x_data.size() - 1]] = 1;
    -
    415  }
    -
    416  // If task is regrssion (of single value)
    -
    417  else {
    -
    418  y_data[0] = x_data[x_data.size() - 1];
    -
    419  }
    -
    420  x_data = pop_back(x_data); // Remove label from x_data
    -
    421  } else {
    -
    422  y_data.resize(this->layers.back().neurons);
    -
    423  // If task is classification
    -
    424  if (y_data.size() > 1) {
    -
    425  y_data[x_data[x_data.size() - 1]] = 1;
    -
    426  }
    -
    427  // If task is regrssion (of single value)
    -
    428  else {
    -
    429  y_data[0] = x_data[x_data.size() - 1];
    -
    430  }
    -
    431  x_data = pop_front(x_data); // Remove label from x_data
    -
    432  }
    -
    433  // Push collected X_data and y_data in X and Y
    -
    434  X.push_back({x_data});
    -
    435  Y.push_back({y_data});
    -
    436  }
    -
    437  // Normalize training data if flag is set
    -
    438  if (normalize) {
    -
    439  // Scale data between 0 and 1 using min-max scaler
    -
    440  X = minmax_scaler(X, 0.01, 1.0);
    -
    441  }
    -
    442  in_file.close(); // Closing file
    -
    443  return make_pair(X, Y); // Return pair of X and Y
    -
    444  }
    +
    383 {
    +
    384 std::ifstream in_file; // Ifstream to read file
    +
    385 in_file.open(file_name.c_str(), std::ios::in); // Open file
    +
    386 // If there is any problem in opening file
    +
    387 if (!in_file.is_open()) {
    +
    388 std::cerr << "ERROR (" << __func__ << ") : ";
    +
    389 std::cerr << "Unable to open file: " << file_name << std::endl;
    +
    390 std::exit(EXIT_FAILURE);
    +
    391 }
    + +
    393 Y; // To store X and Y
    +
    394 std::string line; // To store each line
    +
    395 // Skip lines
    +
    396 for (int i = 0; i < slip_lines; i++) {
    +
    397 std::getline(in_file, line, '\n'); // Ignore line
    +
    398 }
    +
    399 // While file has information
    +
    400 while (!in_file.eof() && std::getline(in_file, line, '\n')) {
    + +
    402 y_data; // To store single sample and label
    +
    403 std::stringstream ss(line); // Constructing stringstream from line
    +
    404 std::string token; // To store each token in line (seprated by ',')
    +
    405 while (std::getline(ss, token, ',')) { // For each token
    +
    406 // Insert numerical value of token in x_data
    +
    407 x_data = insert_element(x_data, std::stod(token));
    +
    408 }
    +
    409 // If label is in last column
    +
    410 if (last_label) {
    +
    411 y_data.resize(this->layers.back().neurons);
    +
    412 // If task is classification
    +
    413 if (y_data.size() > 1) {
    +
    414 y_data[x_data[x_data.size() - 1]] = 1;
    +
    415 }
    +
    416 // If task is regrssion (of single value)
    +
    417 else {
    +
    418 y_data[0] = x_data[x_data.size() - 1];
    +
    419 }
    +
    420 x_data = pop_back(x_data); // Remove label from x_data
    +
    421 } else {
    +
    422 y_data.resize(this->layers.back().neurons);
    +
    423 // If task is classification
    +
    424 if (y_data.size() > 1) {
    +
    425 y_data[x_data[x_data.size() - 1]] = 1;
    +
    426 }
    +
    427 // If task is regrssion (of single value)
    +
    428 else {
    +
    429 y_data[0] = x_data[x_data.size() - 1];
    +
    430 }
    +
    431 x_data = pop_front(x_data); // Remove label from x_data
    +
    432 }
    +
    433 // Push collected X_data and y_data in X and Y
    +
    434 X.push_back({x_data});
    +
    435 Y.push_back({y_data});
    +
    436 }
    +
    437 // Normalize training data if flag is set
    +
    438 if (normalize) {
    +
    439 // Scale data between 0 and 1 using min-max scaler
    +
    440 X = minmax_scaler(X, 0.01, 1.0);
    +
    441 }
    +
    442 in_file.close(); // Closing file
    +
    443 return make_pair(X, Y); // Return pair of X and Y
    +
    444 }
    @@ -1072,24 +1065,24 @@ Here is the call graph for this function:
    T getline(T... args)
    T is_open(T... args)
    T make_pair(T... args)
    -
    std::vector< std::vector< std::valarray< T > > > minmax_scaler(const std::vector< std::vector< std::valarray< T >>> &A, const T &low, const T &high)
    Definition: vector_ops.hpp:269
    -
    std::valarray< T > pop_back(const std::valarray< T > &A)
    Definition: vector_ops.hpp:119
    -
    std::valarray< T > insert_element(const std::valarray< T > &A, const T &ele)
    Definition: vector_ops.hpp:85
    -
    std::valarray< T > pop_front(const std::valarray< T > &A)
    Definition: vector_ops.hpp:102
    +
    std::valarray< T > insert_element(const std::valarray< T > &A, const T &ele)
    Definition: vector_ops.hpp:85
    +
    std::valarray< T > pop_front(const std::valarray< T > &A)
    Definition: vector_ops.hpp:102
    +
    std::vector< std::vector< std::valarray< T > > > minmax_scaler(const std::vector< std::vector< std::valarray< T > > > &A, const T &low, const T &high)
    Definition: vector_ops.hpp:269
    +
    std::valarray< T > pop_back(const std::valarray< T > &A)
    Definition: vector_ops.hpp:119
    T open(T... args)
    T push_back(T... args)
    T stod(T... args)
    - +
    Here is the call graph for this function:
    -
    +
    - +

    ◆ load_model()

    @@ -1112,50 +1105,50 @@ Here is the call graph for this function:
    file_namecsv file name
    last_labelflag for whether label is in first or last column
    -

    Function to load earlier saved model.

    Parameters
    +

    Function to load earlier saved model.

    Parameters
    file_namefile from which model will be loaded (*.model)
    Returns
    instance of NeuralNetwork class with pretrained weights
    -
    732  {
    -
    733  std::ifstream in_file; // Ifstream to read file
    -
    734  in_file.open(file_name.c_str()); // Openinig file
    -
    735  // If there is any problem in opening file
    -
    736  if (!in_file.is_open()) {
    -
    737  std::cerr << "ERROR (" << __func__ << ") : ";
    -
    738  std::cerr << "Unable to open file: " << file_name << std::endl;
    -
    739  std::exit(EXIT_FAILURE);
    -
    740  }
    -
    741  std::vector<std::pair<int, std::string>> config; // To store config
    - -
    743  kernels; // To store pretrained kernels
    -
    744  // Loading model from saved file format
    -
    745  size_t total_layers = 0;
    -
    746  in_file >> total_layers;
    -
    747  for (size_t i = 0; i < total_layers; i++) {
    -
    748  int neurons = 0;
    -
    749  std::string activation;
    -
    750  size_t shape_a = 0, shape_b = 0;
    - -
    752  in_file >> neurons >> activation >> shape_a >> shape_b;
    -
    753  for (size_t r = 0; r < shape_a; r++) {
    -
    754  std::valarray<double> row(shape_b);
    -
    755  for (size_t c = 0; c < shape_b; c++) {
    -
    756  in_file >> row[c];
    -
    757  }
    -
    758  kernel.push_back(row);
    -
    759  }
    -
    760  config.emplace_back(make_pair(neurons, activation));
    -
    761  ;
    -
    762  kernels.emplace_back(kernel);
    -
    763  }
    -
    764  std::cout << "INFO: Model loaded successfully" << std::endl;
    -
    765  in_file.close(); // Closing file
    -
    766  return NeuralNetwork(
    -
    767  config, kernels); // Return instance of NeuralNetwork class
    -
    768  }
    +
    732 {
    +
    733 std::ifstream in_file; // Ifstream to read file
    +
    734 in_file.open(file_name.c_str()); // Openinig file
    +
    735 // If there is any problem in opening file
    +
    736 if (!in_file.is_open()) {
    +
    737 std::cerr << "ERROR (" << __func__ << ") : ";
    +
    738 std::cerr << "Unable to open file: " << file_name << std::endl;
    +
    739 std::exit(EXIT_FAILURE);
    +
    740 }
    +
    741 std::vector<std::pair<int, std::string>> config; // To store config
    + +
    743 kernels; // To store pretrained kernels
    +
    744 // Loading model from saved file format
    +
    745 size_t total_layers = 0;
    +
    746 in_file >> total_layers;
    +
    747 for (size_t i = 0; i < total_layers; i++) {
    +
    748 int neurons = 0;
    +
    749 std::string activation;
    +
    750 size_t shape_a = 0, shape_b = 0;
    + +
    752 in_file >> neurons >> activation >> shape_a >> shape_b;
    +
    753 for (size_t r = 0; r < shape_a; r++) {
    +
    754 std::valarray<double> row(shape_b);
    +
    755 for (size_t c = 0; c < shape_b; c++) {
    +
    756 in_file >> row[c];
    +
    757 }
    +
    758 kernel.push_back(row);
    +
    759 }
    +
    760 config.emplace_back(make_pair(neurons, activation));
    +
    761 ;
    +
    762 kernels.emplace_back(kernel);
    +
    763 }
    +
    764 std::cout << "INFO: Model loaded successfully" << std::endl;
    +
    765 in_file.close(); // Closing file
    +
    766 return NeuralNetwork(
    +
    767 config, kernels); // Return instance of NeuralNetwork class
    +
    768 }
    Here is the call graph for this function:
    @@ -1166,8 +1159,8 @@ Here is the call graph for this function:
    - -

    ◆ operator=() [1/2]

    + +

    ◆ operator=() [1/2]

    @@ -1176,7 +1169,7 @@ Here is the call graph for this function:
    - + @@ -1189,12 +1182,12 @@ Here is the call graph for this function:
    NeuralNetwork& machine_learning::neural_network::NeuralNetwork::operator= NeuralNetwork & machine_learning::neural_network::NeuralNetwork::operator= ( const NeuralNetwork model)
    -

    Copy assignment operator for class NeuralNetwork

    +

    Copy assignment operator for class NeuralNetwork

    - -

    ◆ operator=() [2/2]

    + +

    ◆ operator=() [2/2]

    @@ -1203,7 +1196,7 @@ Here is the call graph for this function:
    - + @@ -1216,11 +1209,11 @@ Here is the call graph for this function:
    NeuralNetwork& machine_learning::neural_network::NeuralNetwork::operator= NeuralNetwork & machine_learning::neural_network::NeuralNetwork::operator= ( NeuralNetwork &&  )
    -

    Move assignment operator for class NeuralNetwork

    +

    Move assignment operator for class NeuralNetwork

    - +

    ◆ save_model()

    @@ -1243,15 +1236,15 @@ Here is the call graph for this function:
    -

    Function to save current model.

    Parameters
    +

    Function to save current model.

    Parameters
    file_namefile name to save model (*.model)
    -

    Format in which model is saved:

    -

    total_layers neurons(1st neural_network::layers::DenseLayer) activation_name(1st neural_network::layers::DenseLayer) kernel_shape(1st neural_network::layers::DenseLayer) kernel_values neurons(Nth neural_network::layers::DenseLayer) activation_name(Nth neural_network::layers::DenseLayer) kernel_shape(Nth neural_network::layers::DenseLayer) kernel_value

    -

    For Example, pretrained model with 3 layers:

    +

    Format in which model is saved:

    +

    total_layers neurons(1st neural_network::layers::DenseLayer) activation_name(1st neural_network::layers::DenseLayer) kernel_shape(1st neural_network::layers::DenseLayer) kernel_values neurons(Nth neural_network::layers::DenseLayer) activation_name(Nth neural_network::layers::DenseLayer) kernel_shape(Nth neural_network::layers::DenseLayer) kernel_value

    +

    For Example, pretrained model with 3 layers:

      3
      4 none
      4 4
    @@ -1273,80 +1266,80 @@ Here is the call graph for this function:
    -2.01336 -0.0219682 1.44145 1.72853 -0.465264 -0.705373 -0.908409 -0.740547 0.376416 -
    652  {
    -
    653  std::string file_name = _file_name;
    -
    654  // Adding ".model" extension if it is not already there in name
    -
    655  if (file_name.find(".model") == file_name.npos) {
    -
    656  file_name += ".model";
    -
    657  }
    -
    658  std::ofstream out_file; // Ofstream to write in file
    -
    659  // Open file in out|trunc mode
    -
    660  out_file.open(file_name.c_str(),
    -
    661  std::ofstream::out | std::ofstream::trunc);
    -
    662  // If there is any problem in opening file
    -
    663  if (!out_file.is_open()) {
    -
    664  std::cerr << "ERROR (" << __func__ << ") : ";
    -
    665  std::cerr << "Unable to open file: " << file_name << std::endl;
    -
    666  std::exit(EXIT_FAILURE);
    -
    667  }
    -
    668  /**
    -
    669  Format in which model is saved:
    -
    670 
    -
    671  total_layers
    -
    672  neurons(1st neural_network::layers::DenseLayer) activation_name(1st
    -
    673  neural_network::layers::DenseLayer) kernel_shape(1st
    -
    674  neural_network::layers::DenseLayer) kernel_values
    -
    675  .
    -
    676  .
    -
    677  .
    -
    678  neurons(Nth neural_network::layers::DenseLayer) activation_name(Nth
    -
    679  neural_network::layers::DenseLayer) kernel_shape(Nth
    -
    680  neural_network::layers::DenseLayer) kernel_value
    -
    681 
    -
    682  For Example, pretrained model with 3 layers:
    -
    683  <pre>
    -
    684  3
    -
    685  4 none
    -
    686  4 4
    -
    687  1 0 0 0
    -
    688  0 1 0 0
    -
    689  0 0 1 0
    -
    690  0 0 0 1
    -
    691  6 relu
    -
    692  4 6
    -
    693  -1.88963 -3.61165 1.30757 -0.443906 -2.41039 -2.69653
    -
    694  -0.684753 0.0891452 0.795294 -2.39619 2.73377 0.318202
    -
    695  -2.91451 -4.43249 -0.804187 2.51995 -6.97524 -1.07049
    -
    696  -0.571531 -1.81689 -1.24485 1.92264 -2.81322 1.01741
    -
    697  3 sigmoid
    -
    698  6 3
    -
    699  0.390267 -0.391703 -0.0989607
    -
    700  0.499234 -0.564539 -0.28097
    -
    701  0.553386 -0.153974 -1.92493
    -
    702  -2.01336 -0.0219682 1.44145
    -
    703  1.72853 -0.465264 -0.705373
    -
    704  -0.908409 -0.740547 0.376416
    -
    705  </pre>
    -
    706  */
    -
    707  // Saving model in the same format
    -
    708  out_file << layers.size();
    -
    709  out_file << std::endl;
    -
    710  for (const auto &layer : this->layers) {
    -
    711  out_file << layer.neurons << ' ' << layer.activation << std::endl;
    -
    712  const auto shape = get_shape(layer.kernel);
    -
    713  out_file << shape.first << ' ' << shape.second << std::endl;
    -
    714  for (const auto &row : layer.kernel) {
    -
    715  for (const auto &val : row) {
    -
    716  out_file << val << ' ';
    -
    717  }
    -
    718  out_file << std::endl;
    -
    719  }
    -
    720  }
    -
    721  std::cout << "INFO: Model saved successfully with name : ";
    -
    722  std::cout << file_name << std::endl;
    -
    723  out_file.close(); // Closing file
    -
    724  return;
    -
    725  }
    +
    652 {
    +
    653 std::string file_name = _file_name;
    +
    654 // Adding ".model" extension if it is not already there in name
    +
    655 if (file_name.find(".model") == file_name.npos) {
    +
    656 file_name += ".model";
    +
    657 }
    +
    658 std::ofstream out_file; // Ofstream to write in file
    +
    659 // Open file in out|trunc mode
    +
    660 out_file.open(file_name.c_str(),
    +
    661 std::ofstream::out | std::ofstream::trunc);
    +
    662 // If there is any problem in opening file
    +
    663 if (!out_file.is_open()) {
    +
    664 std::cerr << "ERROR (" << __func__ << ") : ";
    +
    665 std::cerr << "Unable to open file: " << file_name << std::endl;
    +
    666 std::exit(EXIT_FAILURE);
    +
    667 }
    +
    668 /**
    +
    669 Format in which model is saved:
    +
    670
    +
    671 total_layers
    +
    672 neurons(1st neural_network::layers::DenseLayer) activation_name(1st
    +
    673 neural_network::layers::DenseLayer) kernel_shape(1st
    +
    674 neural_network::layers::DenseLayer) kernel_values
    +
    675 .
    +
    676 .
    +
    677 .
    +
    678 neurons(Nth neural_network::layers::DenseLayer) activation_name(Nth
    +
    679 neural_network::layers::DenseLayer) kernel_shape(Nth
    +
    680 neural_network::layers::DenseLayer) kernel_value
    +
    681
    +
    682 For Example, pretrained model with 3 layers:
    +
    683 <pre>
    +
    684 3
    +
    685 4 none
    +
    686 4 4
    +
    687 1 0 0 0
    +
    688 0 1 0 0
    +
    689 0 0 1 0
    +
    690 0 0 0 1
    +
    691 6 relu
    +
    692 4 6
    +
    693 -1.88963 -3.61165 1.30757 -0.443906 -2.41039 -2.69653
    +
    694 -0.684753 0.0891452 0.795294 -2.39619 2.73377 0.318202
    +
    695 -2.91451 -4.43249 -0.804187 2.51995 -6.97524 -1.07049
    +
    696 -0.571531 -1.81689 -1.24485 1.92264 -2.81322 1.01741
    +
    697 3 sigmoid
    +
    698 6 3
    +
    699 0.390267 -0.391703 -0.0989607
    +
    700 0.499234 -0.564539 -0.28097
    +
    701 0.553386 -0.153974 -1.92493
    +
    702 -2.01336 -0.0219682 1.44145
    +
    703 1.72853 -0.465264 -0.705373
    +
    704 -0.908409 -0.740547 0.376416
    +
    705 </pre>
    +
    706 */
    +
    707 // Saving model in the same format
    +
    708 out_file << layers.size();
    +
    709 out_file << std::endl;
    +
    710 for (const auto &layer : this->layers) {
    +
    711 out_file << layer.neurons << ' ' << layer.activation << std::endl;
    +
    712 const auto shape = get_shape(layer.kernel);
    +
    713 out_file << shape.first << ' ' << shape.second << std::endl;
    +
    714 for (const auto &row : layer.kernel) {
    +
    715 for (const auto &val : row) {
    +
    716 out_file << val << ' ';
    +
    717 }
    +
    718 out_file << std::endl;
    +
    719 }
    +
    720 }
    +
    721 std::cout << "INFO: Model saved successfully with name : ";
    +
    722 std::cout << file_name << std::endl;
    +
    723 out_file.close(); // Closing file
    +
    724 return;
    +
    725 }
    T find(T... args)
    @@ -1358,8 +1351,8 @@ Here is the call graph for this function:
    - -

    ◆ single_predict()

    + +

    ◆ single_predict()

    @@ -1368,9 +1361,9 @@ Here is the call graph for this function:
    - + - + @@ -1381,29 +1374,29 @@ Here is the call graph for this function:
    std::vector<std::valarray<double> > machine_learning::neural_network::NeuralNetwork::single_predict std::vector< std::valarray< double > > machine_learning::neural_network::NeuralNetwork::single_predict (const std::vector< std::valarray< double >> & const std::vector< std::valarray< double > > &  X)
    -

    Function to get prediction of model on single sample.

    Parameters
    +

    Function to get prediction of model on single sample.

    Parameters
    Xarray of feature vectors
    Returns
    returns predictions as vector
    -
    452  {
    -
    453  // Get activations of all layers
    - -
    455  // Return activations of last layer (actual predicted values)
    -
    456  return activations.back();
    -
    457  }
    +
    452 {
    +
    453 // Get activations of all layers
    + +
    455 // Return activations of last layer (actual predicted values)
    +
    456 return activations.back();
    +
    457 }
    Here is the call graph for this function:
    -
    +
    - +

    ◆ summary()

    @@ -1425,31 +1418,31 @@ Here is the call graph for this function:
    -

    Function to print summary of the network.

    -
    773  {
    -
    774  // Printing Summary
    -
    775  std::cout
    -
    776  << "==============================================================="
    -
    777  << std::endl;
    -
    778  std::cout << "\t\t+ MODEL SUMMARY +\t\t\n";
    -
    779  std::cout
    -
    780  << "==============================================================="
    -
    781  << std::endl;
    -
    782  for (size_t i = 1; i <= layers.size(); i++) { // For every layer
    -
    783  std::cout << i << ")";
    -
    784  std::cout << " Neurons : "
    -
    785  << layers[i - 1].neurons; // number of neurons
    -
    786  std::cout << ", Activation : "
    -
    787  << layers[i - 1].activation; // activation
    -
    788  std::cout << ", kernel Shape : "
    -
    789  << get_shape(layers[i - 1].kernel); // kernel shape
    -
    790  std::cout << std::endl;
    -
    791  }
    -
    792  std::cout
    -
    793  << "==============================================================="
    -
    794  << std::endl;
    -
    795  return;
    -
    796  }
    +

    Function to print summary of the network.

    +
    773 {
    +
    774 // Printing Summary
    + +
    776 << "==============================================================="
    +
    777 << std::endl;
    +
    778 std::cout << "\t\t+ MODEL SUMMARY +\t\t\n";
    + +
    780 << "==============================================================="
    +
    781 << std::endl;
    +
    782 for (size_t i = 1; i <= layers.size(); i++) { // For every layer
    +
    783 std::cout << i << ")";
    +
    784 std::cout << " Neurons : "
    +
    785 << layers[i - 1].neurons; // number of neurons
    +
    786 std::cout << ", Activation : "
    +
    787 << layers[i - 1].activation; // activation
    +
    788 std::cout << ", kernel Shape : "
    +
    789 << get_shape(layers[i - 1].kernel); // kernel shape
    + +
    791 }
    + +
    793 << "==============================================================="
    +
    794 << std::endl;
    +
    795 return;
    +
    796 }
    Here is the call graph for this function:
    @@ -1468,7 +1461,7 @@ Here is the call graph for this function:
    diff --git a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.js b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.js index 1b957658b..4196450a9 100644 --- a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.js +++ b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.js @@ -1,23 +1,22 @@ var classmachine__learning_1_1neural__network_1_1_neural_network = [ - [ "NeuralNetwork", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a215d132aa38b9c9aab6716663a751b82", null ], + [ "NeuralNetwork", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a4c4c6f63ab965317f9471518ee931b89", null ], [ "NeuralNetwork", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#ae7cf126a3a8f9d20c81b21584d061a08", null ], - [ "NeuralNetwork", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a8f984bfd3e32b9b71c33a4f62335c710", null ], + [ "NeuralNetwork", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a62151b0398a2536be60d950e10ffe9a8", null ], [ "NeuralNetwork", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a176b955c90ae57d7dbc3c63f27c84c75", null ], [ "~NeuralNetwork", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a8973f687738ddd76f93b5562feae4027", null ], [ "NeuralNetwork", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a173bb71780af6953ec2e307a4c74b025", null ], - [ "__detailed_single_prediction", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#acd397b51fcf8f690b03e406ada8c9d13", null ], - [ "batch_predict", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a4c4ff6b340d0e460d3015ad601a568b6", null ], - [ "evaluate", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a0ee425af6fd83a033c021128b8253f52", null ], + [ "__detailed_single_prediction", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a361a45f3c3d8347d79103bf182d0570b", null ], + [ "batch_predict", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a88bf9023ab3d4cdb61cf707c7cdfc86b", null ], + [ "evaluate", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#aec648ea4f40bd71123b5f907a681dd8e", null ], [ "evaluate_from_csv", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a36494e26ff36d6e15c1022bb9a1ee848", null ], - [ "fit", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a8f8eb4423c57a00b0ab46de226bc6509", null ], + [ "fit", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a2be1b52bb9f57486f9a436f35c9089c0", null ], [ "fit_from_csv", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a5172a6791b9bd24f4232bab8d6b81fff", null ], - [ "get_XY_from_csv", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a8d983ebb3225a9901b713a0f05b44aba", null ], + [ "get_XY_from_csv", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a650c677fd6512665741ddd9b7983275d", null ], [ "load_model", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a58ed20abf6ce3744535bd8b5bb9e741b", null ], - [ "operator=", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a955088afdb35d1ea38ac41feb21a77b4", null ], - [ "operator=", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#afa4a080c9526909ea87a6c0f6cfd6a2f", null ], + [ "operator=", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a58a9614e4c6d4ca672d3358e99a3404f", null ], + [ "operator=", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a2c49bfebf9b859d5ceb26035d3003601", null ], [ "save_model", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a4f14e473bb0722c6490b9dc8da5982aa", null ], - [ "single_predict", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#ac130322a5abb1ff763b7c1a55405a35e", null ], - [ "summary", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a61d30113d13304c664057118b92a5931", null ], - [ "layers", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a8c5a466131aa2ae6b7276185b0834053", null ] + [ "single_predict", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a3b9eac1824d365dce715fb17c33cb96f", null ], + [ "summary", "d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network.html#a61d30113d13304c664057118b92a5931", null ] ]; \ No newline at end of file diff --git a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a0ee425af6fd83a033c021128b8253f52_cgraph.md5 b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a0ee425af6fd83a033c021128b8253f52_cgraph.md5 deleted file mode 100644 index 062e9fa2e..000000000 --- a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a0ee425af6fd83a033c021128b8253f52_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -036aff131f5521dc7e047a941d272e21 \ No newline at end of file diff --git a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a8f8eb4423c57a00b0ab46de226bc6509_cgraph.map b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.map similarity index 84% rename from d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a8f8eb4423c57a00b0ab46de226bc6509_cgraph.map rename to d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.map index 7a2b9c4b7..15f5ae234 100644 --- a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a8f8eb4423c57a00b0ab46de226bc6509_cgraph.map +++ b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.map @@ -1,22 +1,22 @@ - - - + + + - - - - + + + + - + - - - + + + diff --git a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.md5 b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.md5 new file mode 100644 index 000000000..764d01c1a --- /dev/null +++ b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.md5 @@ -0,0 +1 @@ +5291d821a1fd5d1dec4d756435a6f207 \ No newline at end of file diff --git a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a8f8eb4423c57a00b0ab46de226bc6509_cgraph.svg b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.svg similarity index 97% rename from d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a8f8eb4423c57a00b0ab46de226bc6509_cgraph.svg rename to d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.svg index 6946fab13..e71187e7d 100644 --- a/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a8f8eb4423c57a00b0ab46de226bc6509_cgraph.svg +++ b/d4/df4/classmachine__learning_1_1neural__network_1_1_neural_network_a2be1b52bb9f57486f9a436f35c9089c0_cgraph.svg @@ -1,7 +1,7 @@ - @@ -48,7 +48,7 @@ if (edges && edges.length) { @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d4/dfb/namespacecycle__sort.html','../
    -
    -
    cycle_sort Namespace Reference
    +
    cycle_sort Namespace Reference
    -

    Functions for Cycle sort algorithm. +

    Functions for Cycle sort algorithm. More...

    Detailed Description

    -

    Functions for Cycle sort algorithm.

    +

    Functions for Cycle sort algorithm.

    diff --git a/d5/d02/namespacehorspool.html b/d5/d02/namespacehorspool.html index 815822937..5b0d47996 100644 --- a/d5/d02/namespacehorspool.html +++ b/d5/d02/namespacehorspool.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: horspool Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d5/d02/namespacehorspool.html','../../
    -
    -
    horspool Namespace Reference
    +
    horspool Namespace Reference
    -

    Functions for Horspool's algorithm. +

    Functions for Horspool's algorithm. More...

    Detailed Description

    -

    Functions for Horspool's algorithm.

    +

    Functions for Horspool's algorithm.

    diff --git a/d5/d08/classgraph_1_1_graph__coll__graph.map b/d5/d08/classgraph_1_1_graph__coll__graph.map deleted file mode 100644 index 9c64eecda..000000000 --- a/d5/d08/classgraph_1_1_graph__coll__graph.map +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/d5/d08/classgraph_1_1_graph__coll__graph.md5 b/d5/d08/classgraph_1_1_graph__coll__graph.md5 deleted file mode 100644 index 9554b4369..000000000 --- a/d5/d08/classgraph_1_1_graph__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -dd90b2a0f94e72731318fb2cd2f8c019 \ No newline at end of file diff --git a/d5/d08/classgraph_1_1_graph__coll__graph.svg b/d5/d08/classgraph_1_1_graph__coll__graph.svg deleted file mode 100644 index 61e438355..000000000 --- a/d5/d08/classgraph_1_1_graph__coll__graph.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - -graph::Graph< T > - - - -Node1 - - -graph::Graph< T > - - - - - -Node2 - - -std::vector< std::vector -< int > > - - - - - -Node2->Node1 - - - neighbors - - - -Node3 - - -std::vector< int > - - - - - -Node3->Node2 - - - elements - - - -Node4 - - -std::map< T, std::list -< T > > - - - - - -Node4->Node1 - - - adjacency_list - - - -Node5 - - -T - - - - - -Node5->Node4 - - - keys - - - diff --git a/d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html b/d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html index cdf299f1a..111a60478 100644 --- a/d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html +++ b/d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: data_structures::trie_using_hashmap::Trie::Node Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -93,33 +93,26 @@ $(document).ready(function(){initNavTree('d5/d12/structdata__structures_1_1trie_ -
    -
    data_structures::trie_using_hashmap::Trie::Node Struct Reference
    +
    data_structures::trie_using_hashmap::Trie::Node Struct Reference

    struct representing a trie node. More...

    -
    -Collaboration diagram for data_structures::trie_using_hashmap::Trie::Node:
    -
    -
    -
    -
    [legend]
    - - +

    +

    Public Attributes

    std::unordered_map< char16_t, std::shared_ptr< Node > > children
     
    -bool word_end = false
    +bool word_end = false
     boolean variable to represent the node end
     

    Detailed Description

    -

    struct representing a trie node.

    +

    struct representing a trie node.

    Member Data Documentation

    - +

    ◆ children

    @@ -130,7 +123,7 @@ bool  -

    unordered map with key type char16_t and value is a shared pointer type of Node

    +

    unordered map with key type char16_t and value is a shared pointer type of Node

    @@ -143,7 +136,7 @@ bool 
    diff --git a/d5/d15/classcll.html b/d5/d15/classcll.html index 11d0f80f5..1b7ca837e 100644 --- a/d5/d15/classcll.html +++ b/d5/d15/classcll.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: cll Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
    Algorithms_in_C++ -  1.0.0 +
    Algorithms_in_C++ 1.0.0
    Set of algorithms implemented in C++.
    @@ -42,21 +41,22 @@
    - + +/* @license-end */ +
    @@ -70,7 +70,7 @@ $(function() {
    @@ -94,8 +94,7 @@ $(document).ready(function(){initNavTree('d5/d15/classcll.html','../../'); initR Public Member Functions | Protected Attributes | List of all members -
    -
    cll Class Reference
    +
    cll Class Reference
    @@ -105,39 +104,280 @@ Collaboration diagram for cll:
    [legend]
    - - + - + - + - + - + - + - +

    +

    Public Member Functions

    -void display ()
    void display ()
     
    -void insert_front (int new_data)
    void insert_front (int new_data)
     
    -void insert_tail (int new_data)
    void insert_tail (int new_data)
     
    -int get_size ()
    int get_size ()
     
    -bool find_item (int item_to_find)
    bool find_item (int item_to_find)
     
    -int operator* ()
    int operator* ()
     
    -void operator++ ()
    void operator++ ()
     
    - - -

    +

    Protected Attributes

    +
    nodehead
     
    +
    int total
     
    +

    Constructor & Destructor Documentation

    + +

    ◆ cll()

    + +
    +
    + + + + + + + +
    cll::cll ()
    +
    +
    8 {
    +
    9 head = NULL;
    +
    10 total = 0;
    +
    11}
    +
    +
    +
    + +

    ◆ ~cll()

    + +
    +
    + + + + + + + +
    cll::~cll ()
    +
    +
    13 { /* Desstructure, no need to fill */
    +
    14}
    +
    +
    +
    +

    Member Function Documentation

    + +

    ◆ display()

    + +
    +
    + + + + + + + +
    void cll::display ()
    +
    +
    17 {
    +
    18 if (head == NULL)
    +
    19 cout << "List is empty !" << endl;
    +
    20 else {
    +
    21 cout << "CLL list: ";
    +
    22 node *current = head;
    +
    23 for (int i = 0; i < total; i++) {
    +
    24 cout << current->data << " -> ";
    +
    25 current = current->next;
    +
    26 }
    +
    27 cout << head->data << endl;
    +
    28 cout << "Total element: " << total << endl;
    +
    29 }
    +
    30}
    + +
    #define endl
    Definition: matrix_exponentiation.cpp:36
    +
    Definition: avltree.cpp:13
    +
    +
    +
    + +

    ◆ find_item()

    + +
    +
    + + + + + + + + +
    bool cll::find_item (int item_to_find)
    +
    +
    78 {
    +
    79 if (head == NULL) {
    +
    80 cout << "List is empty !" << endl;
    +
    81 return false;
    +
    82 } else {
    +
    83 node *current = head;
    +
    84 while (current->next != head) {
    +
    85 if (current->data == item_to_find)
    +
    86 return true;
    +
    87 current = current->next;
    +
    88 }
    +
    89 return false;
    +
    90 }
    +
    91}
    +
    +
    +
    + +

    ◆ get_size()

    + +
    +
    + + + + + + + +
    int cll::get_size ()
    +
    +
    74{ return total; }
    +
    +
    +
    + +

    ◆ insert_front()

    + +
    +
    + + + + + + + + +
    void cll::insert_front (int new_data)
    +
    +
    33 {
    +
    34 node *newNode;
    +
    35 newNode = new node;
    +
    36 newNode->data = new_data;
    +
    37 newNode->next = NULL;
    +
    38 if (head == NULL) {
    +
    39 head = newNode;
    +
    40 head->next = head;
    +
    41 } else {
    +
    42 node *current = head;
    +
    43 while (current->next != head) {
    +
    44 current = current->next;
    +
    45 }
    +
    46 newNode->next = head;
    +
    47 current->next = newNode;
    +
    48 head = newNode;
    +
    49 }
    +
    50 total++;
    +
    51}
    +
    struct list node
    +
    +
    +
    + +

    ◆ insert_tail()

    + +
    +
    + + + + + + + + +
    void cll::insert_tail (int new_data)
    +
    +
    54 {
    +
    55 node *newNode;
    +
    56 newNode = new node;
    +
    57 newNode->data = new_data;
    +
    58 newNode->next = NULL;
    +
    59 if (head == NULL) {
    +
    60 head = newNode;
    +
    61 head->next = head;
    +
    62 } else {
    +
    63 node *current = head;
    +
    64 while (current->next != head) {
    +
    65 current = current->next;
    +
    66 }
    +
    67 current->next = newNode;
    +
    68 newNode->next = head;
    +
    69 }
    +
    70 total++;
    +
    71}
    +
    +
    +
    + +

    ◆ operator*()

    + +
    +
    + + + + + + + +
    int cll::operator* ()
    +
    +
    94{ return head->data; }
    +
    +
    +
    + +

    ◆ operator++()

    + +
    +
    + + + + + + + +
    void cll::operator++ ()
    +
    +
    98 {
    +
    99 if (head == NULL) {
    +
    100 cout << "List is empty !" << endl;
    +
    101 } else {
    +
    102 node *current = head;
    +
    103 while (current->next != head) {
    +
    104 current = current->next;
    +
    105 }
    +
    106 current->next = head->next;
    +
    107 head = head->next;
    +
    108 }
    +
    109 total--;
    +
    110}
    +
    +
    +

    The documentation for this class was generated from the following files:
    • data_structures/cll/cll.h
    • data_structures/cll/cll.cpp
    • @@ -148,7 +388,7 @@ int total diff --git a/d5/d15/classcll.js b/d5/d15/classcll.js deleted file mode 100644 index d2972c0ab..000000000 --- a/d5/d15/classcll.js +++ /dev/null @@ -1,14 +0,0 @@ -var classcll = -[ - [ "cll", "d5/d15/classcll.html#a3f09a4ec2bc5a211a8409693b4cab4f8", null ], - [ "~cll", "d5/d15/classcll.html#a239fa940a9ca1defdecfeeb07cad351b", null ], - [ "display", "d5/d15/classcll.html#ae957a9434f6d1ffef7461ea4d7c9a8fe", null ], - [ "find_item", "d5/d15/classcll.html#abb6fb5834563d077a4eaff1b7fdc5b44", null ], - [ "get_size", "d5/d15/classcll.html#a04b61bb736525f28b8042c6145e1a265", null ], - [ "insert_front", "d5/d15/classcll.html#a9434bf2d7deca6d7fe1efe06c5341df0", null ], - [ "insert_tail", "d5/d15/classcll.html#a2eb66b7c9d059dcf75090248fa521262", null ], - [ "operator*", "d5/d15/classcll.html#a3665c1dd793c23873f4d8238b86c2021", null ], - [ "operator++", "d5/d15/classcll.html#a1b49e807e33b6f11b2ea151df61a9f2f", null ], - [ "head", "d5/d15/classcll.html#a852ab0b4ec38b8462df3f32ee6f11290", null ], - [ "total", "d5/d15/classcll.html#a23cbc56c51dafc17bd16cecd0f491731", null ] -]; \ No newline at end of file diff --git a/d5/d25/structstd_1_1is__unsigned_3_01uint128__t_01_4.html b/d5/d25/structstd_1_1is__unsigned_3_01uint128__t_01_4.html index 10678fb2a..9f4638766 100644 --- a/d5/d25/structstd_1_1is__unsigned_3_01uint128__t_01_4.html +++ b/d5/d25/structstd_1_1is__unsigned_3_01uint128__t_01_4.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: std::is_unsigned< uint128_t > Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,8 +90,7 @@ $(document).ready(function(){initNavTree('d5/d25/structstd_1_1is__unsigned_3_01u
      -
      -
      std::is_unsigned< uint128_t > Struct Reference
      +
      std::is_unsigned< uint128_t > Struct Reference
      @@ -115,7 +114,7 @@ Collaboration diagram for std::is_unsigned< uint128_t >:
      diff --git a/d5/d29/struct_min_heap_node.html b/d5/d29/struct_min_heap_node.html index d63ea4242..c4a21eb18 100644 --- a/d5/d29/struct_min_heap_node.html +++ b/d5/d29/struct_min_heap_node.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: MinHeapNode Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -94,8 +94,7 @@ $(document).ready(function(){initNavTree('d5/d29/struct_min_heap_node.html','../ Public Member Functions | Public Attributes | List of all members -
      -
      MinHeapNode Struct Reference
      +
      MinHeapNode Struct Reference
      @@ -105,27 +104,68 @@ Collaboration diagram for MinHeapNode:
      [legend]
      - - +

      +

      Public Member Functions

      MinHeapNode (char data, unsigned freq)
       MinHeapNode (char data, unsigned freq)
       
      - - - - -

      +

      Public Attributes

      +
      char data
       
      +
      unsigned freq
       
      +
      MinHeapNodeleft
       
      +
      MinHeapNoderight
       
      +

      Constructor & Destructor Documentation

      + +

      ◆ MinHeapNode()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + + + +
      MinHeapNode::MinHeapNode (char data,
      unsigned freq 
      )
      +
      +inline
      +
      +
      19 {
      +
      20 left = right = NULL;
      +
      21 this->data = data;
      +
      22 this->freq = freq;
      +
      23 }
      +
      +
      +

      The documentation for this struct was generated from the following file:
      • greedy_algorithms/huffman.cpp
      @@ -135,7 +175,7 @@ unsigned freq
        - +
      diff --git a/d5/d29/struct_min_heap_node.js b/d5/d29/struct_min_heap_node.js deleted file mode 100644 index 74f379906..000000000 --- a/d5/d29/struct_min_heap_node.js +++ /dev/null @@ -1,8 +0,0 @@ -var struct_min_heap_node = -[ - [ "MinHeapNode", "d5/d29/struct_min_heap_node.html#a41f73e87e4ddf1fbe72ae0db2b4e674e", null ], - [ "data", "d5/d29/struct_min_heap_node.html#a3d422a54a6e8f8ebc7e386125a09d8e8", null ], - [ "freq", "d5/d29/struct_min_heap_node.html#a3b604fe2d4f56fcb78f8e0e02b0458fd", null ], - [ "left", "d5/d29/struct_min_heap_node.html#ad06549be842d9a2cacdb3e55b019e68c", null ], - [ "right", "d5/d29/struct_min_heap_node.html#a6df054c3211ae8a8ec15a21e7d18343a", null ] -]; \ No newline at end of file diff --git a/d5/d2c/namespacelayers.html b/d5/d2c/namespacelayers.html index 7100943d9..ce524cfd6 100644 --- a/d5/d2c/namespacelayers.html +++ b/d5/d2c/namespacelayers.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: layers Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d5/d2c/namespacelayers.html','../../')
      -
      -
      layers Namespace Reference
      +
      layers Namespace Reference

      This namespace contains layers used in MLP. More...

      Detailed Description

      -

      This namespace contains layers used in MLP.

      +

      This namespace contains layers used in MLP.

      diff --git a/d5/d33/gram__schmidt_8cpp.html b/d5/d33/gram__schmidt_8cpp.html index e6b3367c4..4b367930a 100644 --- a/d5/d33/gram__schmidt_8cpp.html +++ b/d5/d33/gram__schmidt_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: linear_algebra/gram_schmidt.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d5/d33/gram__schmidt_8cpp.html','../.. -
      -
      gram_schmidt.cpp File Reference
      +
      gram_schmidt.cpp File Reference
      -

      Gram Schmidt Orthogonalisation Process +

      Gram Schmidt Orthogonalisation Process More...

      #include <array>
      #include <cassert>
      @@ -112,16 +111,16 @@ Include dependency graph for gram_schmidt.cpp:
      - - + - - + +

      +

      Namespaces

       linear_algebra
      namespace  linear_algebra
       for io operations
       
       gram_schmidt
       Functions for Gram Schmidt Orthogonalisation Process
      namespace  gram_schmidt
       Functions for Gram Schmidt Orthogonalisation Process
       
      - @@ -138,16 +137,16 @@ Functions

      +

      Functions

      double linear_algebra::gram_schmidt::dot_product (const std::array< double, 10 > &x, const std::array< double, 10 > &y, const int &c)
       
       

      Detailed Description

      -

      Gram Schmidt Orthogonalisation Process

      -

      Takes the input of Linearly Independent Vectors, returns vectors orthogonal to each other.

      +

      Gram Schmidt Orthogonalisation Process

      +

      Takes the input of Linearly Independent Vectors, returns vectors orthogonal to each other.

      Algorithm

      -

      Take the first vector of given LI vectors as first vector of Orthogonal vectors. Take projection of second input vector on the first vector of Orthogonal vector and subtract it from the 2nd LI vector. Take projection of third vector on the second vector of Othogonal vectors and subtract it from the 3rd LI vector. Keep repeating the above process until all the vectors in the given input array are exhausted.

      -

      For Example: In R2, Input LI Vectors={(3,1),(2,2)} then Orthogonal Vectors= {(3, 1),(-0.4, 1.2)}

      -

      Have defined maximum dimension of vectors to be 10 and number of vectors taken is 20. Please do not give linearly dependent vectors

      -
      Author
      Akanksha Gupta
      +

      Take the first vector of given LI vectors as first vector of Orthogonal vectors. Take projection of second input vector on the first vector of Orthogonal vector and subtract it from the 2nd LI vector. Take projection of third vector on the second vector of Othogonal vectors and subtract it from the 3rd LI vector. Keep repeating the above process until all the vectors in the given input array are exhausted.

      +

      For Example: In R2, Input LI Vectors={(3,1),(2,2)} then Orthogonal Vectors= {(3, 1),(-0.4, 1.2)}

      +

      Have defined maximum dimension of vectors to be 10 and number of vectors taken is 20. Please do not give linearly dependent vectors

      +
      Author
      Akanksha Gupta

      Function Documentation

      - +

      ◆ display()

      @@ -178,7 +177,7 @@ Algorithm
      -

      Function to print the orthogonalised vector

      +

      Function to print the orthogonalised vector

      Parameters
      @@ -188,20 +187,20 @@ Algorithm
      Returns
      void
      -
      102  {
      -
      103  for (int i = 0; i < r; ++i) {
      -
      104  std::cout << "Vector " << i + 1 << ": ";
      -
      105  for (int j = 0; j < c; ++j) {
      -
      106  std::cout << B[i][j] << " ";
      -
      107  }
      -
      108  std::cout << '\n';
      -
      109  }
      -
      110 }
      +
      102 {
      +
      103 for (int i = 0; i < r; ++i) {
      +
      104 std::cout << "Vector " << i + 1 << ": ";
      +
      105 for (int j = 0; j < c; ++j) {
      +
      106 std::cout << B[i][j] << " ";
      +
      107 }
      +
      108 std::cout << '\n';
      +
      109 }
      +
      110}
      - +

      ◆ dot_product()

      @@ -232,7 +231,7 @@ Algorithm
      rnumber of vectors
      -

      Dot product function. Takes 2 vectors along with their dimension as input and returns the dot product.

      Parameters
      +

      Dot product function. Takes 2 vectors along with their dimension as input and returns the dot product.

      Parameters
      @@ -241,14 +240,14 @@ Algorithm
      Returns
      sum
      -
      60  {
      -
      61  double sum = 0;
      -
      62  for (int i = 0; i < c; ++i) {
      -
      63  sum += x[i] * y[i];
      -
      64  }
      -
      65  return sum;
      -
      66 }
      -
      T sum(const std::vector< std::valarray< T >> &A)
      Definition: vector_ops.hpp:232
      +
      60 {
      +
      61 double sum = 0;
      +
      62 for (int i = 0; i < c; ++i) {
      +
      63 sum += x[i] * y[i];
      +
      64 }
      +
      65 return sum;
      +
      66}
      +
      T sum(const std::vector< std::valarray< T > > &A)
      Definition: vector_ops.hpp:232
      Here is the call graph for this function:
      @@ -258,7 +257,7 @@ Here is the call graph for this function:
      - +

      ◆ gram_schmidt()

      @@ -295,7 +294,7 @@ Here is the call graph for this function:
      xvector 1
      yvector 2
      -

      Function for the process of Gram Schimdt Process

      Parameters
      +

      Function for the process of Gram Schimdt Process

      Parameters
      @@ -305,67 +304,67 @@ Here is the call graph for this function:
      Returns
      void
      -

      we check whether appropriate dimensions are given or not.

      -

      First vector is copied as it is.

      -

      array to store projections

      -

      First initialised to zero

      -

      to store previous projected array

      -

      to store the factor by which the previous array will change

      -

      projected array created

      -

      we take the projection with all the previous vector and add them.

      -

      subtract total projection vector from the input vector

      -
      123  {
      -
      124  if (c < r) { /// we check whether appropriate dimensions are given or not.
      -
      125  std::cout << "Dimension of vector is less than number of vector, hence "
      -
      126  "\n first "
      -
      127  << c << " vectors are orthogonalised\n";
      -
      128  r = c;
      -
      129  }
      -
      130 
      -
      131  int k = 1;
      -
      132 
      -
      133  while (k <= r) {
      -
      134  if (k == 1) {
      -
      135  for (int j = 0; j < c; j++)
      -
      136  B[0][j] = A[0][j]; /// First vector is copied as it is.
      -
      137  }
      -
      138 
      -
      139  else {
      - -
      141  all_projection{}; /// array to store projections
      -
      142  for (int i = 0; i < c; ++i) {
      -
      143  all_projection[i] = 0; /// First initialised to zero
      -
      144  }
      -
      145 
      -
      146  int l = 1;
      -
      147  while (l < k) {
      - -
      149  temp{}; /// to store previous projected array
      -
      150  double factor = NAN; /// to store the factor by which the
      -
      151  /// previous array will change
      -
      152  factor = projection(A[k - 1], B[l - 1], c);
      -
      153  for (int i = 0; i < c; ++i) {
      -
      154  temp[i] = B[l - 1][i] * factor; /// projected array created
      -
      155  }
      -
      156  for (int j = 0; j < c; ++j) {
      -
      157  all_projection[j] =
      -
      158  all_projection[j] +
      -
      159  temp[j]; /// we take the projection with all the
      -
      160  /// previous vector and add them.
      -
      161  }
      -
      162  l++;
      -
      163  }
      -
      164  for (int i = 0; i < c; ++i) {
      -
      165  B[k - 1][i] =
      -
      166  A[k - 1][i] -
      -
      167  all_projection[i]; /// subtract total projection vector
      -
      168  /// from the input vector
      -
      169  }
      -
      170  }
      -
      171  k++;
      -
      172  }
      -
      173  display(r, c, B); // for displaying orthogoanlised vectors
      -
      174 }
      +

      we check whether appropriate dimensions are given or not.

      +

      First vector is copied as it is.

      +

      array to store projections

      +

      First initialised to zero

      +

      to store previous projected array

      +

      to store the factor by which the previous array will change

      +

      projected array created

      +

      we take the projection with all the previous vector and add them.

      +

      subtract total projection vector from the input vector

      +
      123 {
      +
      124 if (c < r) { /// we check whether appropriate dimensions are given or not.
      +
      125 std::cout << "Dimension of vector is less than number of vector, hence "
      +
      126 "\n first "
      +
      127 << c << " vectors are orthogonalised\n";
      +
      128 r = c;
      +
      129 }
      +
      130
      +
      131 int k = 1;
      +
      132
      +
      133 while (k <= r) {
      +
      134 if (k == 1) {
      +
      135 for (int j = 0; j < c; j++)
      +
      136 B[0][j] = A[0][j]; /// First vector is copied as it is.
      +
      137 }
      +
      138
      +
      139 else {
      + +
      141 all_projection{}; /// array to store projections
      +
      142 for (int i = 0; i < c; ++i) {
      +
      143 all_projection[i] = 0; /// First initialised to zero
      +
      144 }
      +
      145
      +
      146 int l = 1;
      +
      147 while (l < k) {
      + +
      149 temp{}; /// to store previous projected array
      +
      150 double factor = NAN; /// to store the factor by which the
      +
      151 /// previous array will change
      +
      152 factor = projection(A[k - 1], B[l - 1], c);
      +
      153 for (int i = 0; i < c; ++i) {
      +
      154 temp[i] = B[l - 1][i] * factor; /// projected array created
      +
      155 }
      +
      156 for (int j = 0; j < c; ++j) {
      +
      157 all_projection[j] =
      +
      158 all_projection[j] +
      +
      159 temp[j]; /// we take the projection with all the
      +
      160 /// previous vector and add them.
      +
      161 }
      +
      162 l++;
      +
      163 }
      +
      164 for (int i = 0; i < c; ++i) {
      +
      165 B[k - 1][i] =
      +
      166 A[k - 1][i] -
      +
      167 all_projection[i]; /// subtract total projection vector
      +
      168 /// from the input vector
      +
      169 }
      +
      170 }
      +
      171 k++;
      +
      172 }
      +
      173 display(r, c, B); // for displaying orthogoanlised vectors
      +
      174}
      double projection(const std::array< double, 10 > &x, const std::array< double, 10 > &y, const int &c)
      Definition: gram_schmidt.cpp:79
      @@ -377,7 +376,7 @@ Here is the call graph for this function:
      - +

      ◆ main()

      @@ -395,55 +394,55 @@ Here is the call graph for this function:

      Main Function.

      Returns
      0 on exit
      -

      a 2-D array for storing all vectors

      -

      a 2-D array for storing orthogonalised vectors

      -

      storing vectors in array A

      -

      Input of vectors is taken

      -

      To check whether vectors are orthogonal or not

      -

      take make the process numerically stable, upper bound for the dot product take 0.1

      -
      248  {
      -
      249  int r = 0, c = 0;
      -
      250  test(); // perform self tests
      -
      251  std::cout << "Enter the dimension of your vectors\n";
      -
      252  std::cin >> c;
      -
      253  std::cout << "Enter the number of vectors you will enter\n";
      -
      254  std::cin >> r;
      -
      255 
      - -
      257  A{}; /// a 2-D array for storing all vectors
      - -
      259  {0}}; /// a 2-D array for storing orthogonalised vectors
      -
      260  /// storing vectors in array A
      -
      261  for (int i = 0; i < r; ++i) {
      -
      262  std::cout << "Enter vector " << i + 1
      -
      263  << '\n'; /// Input of vectors is taken
      -
      264  for (int j = 0; j < c; ++j) {
      -
      265  std::cout << "Value " << j + 1 << "th of vector: ";
      -
      266  std::cin >> A[i][j];
      -
      267  }
      -
      268  std::cout << '\n';
      -
      269  }
      -
      270 
      - -
      272 
      -
      273  double dot = 0;
      -
      274  int flag = 1; /// To check whether vectors are orthogonal or not
      -
      275  for (int i = 0; i < r - 1; ++i) {
      -
      276  for (int j = i + 1; j < r; ++j) {
      -
      277  dot =
      -
      278  fabs(linear_algebra::gram_schmidt::dot_product(B[i], B[j], c));
      -
      279  if (dot > 0.1) /// take make the process numerically stable, upper
      -
      280  /// bound for the dot product take 0.1
      -
      281  {
      -
      282  flag = 0;
      -
      283  break;
      -
      284  }
      -
      285  }
      -
      286  }
      -
      287  if (flag == 0)
      -
      288  std::cout << "Vectors are linearly dependent\n";
      -
      289  return 0;
      -
      290 }
      +

      a 2-D array for storing all vectors

      +

      a 2-D array for storing orthogonalised vectors

      +

      storing vectors in array A

      +

      Input of vectors is taken

      +

      To check whether vectors are orthogonal or not

      +

      take make the process numerically stable, upper bound for the dot product take 0.1

      +
      248 {
      +
      249 int r = 0, c = 0;
      +
      250 test(); // perform self tests
      +
      251 std::cout << "Enter the dimension of your vectors\n";
      +
      252 std::cin >> c;
      +
      253 std::cout << "Enter the number of vectors you will enter\n";
      +
      254 std::cin >> r;
      +
      255
      + +
      257 A{}; /// a 2-D array for storing all vectors
      + +
      259 {0}}; /// a 2-D array for storing orthogonalised vectors
      +
      260 /// storing vectors in array A
      +
      261 for (int i = 0; i < r; ++i) {
      +
      262 std::cout << "Enter vector " << i + 1
      +
      263 << '\n'; /// Input of vectors is taken
      +
      264 for (int j = 0; j < c; ++j) {
      +
      265 std::cout << "Value " << j + 1 << "th of vector: ";
      +
      266 std::cin >> A[i][j];
      +
      267 }
      +
      268 std::cout << '\n';
      +
      269 }
      +
      270
      + +
      272
      +
      273 double dot = 0;
      +
      274 int flag = 1; /// To check whether vectors are orthogonal or not
      +
      275 for (int i = 0; i < r - 1; ++i) {
      +
      276 for (int j = i + 1; j < r; ++j) {
      +
      277 dot =
      +
      278 fabs(linear_algebra::gram_schmidt::dot_product(B[i], B[j], c));
      +
      279 if (dot > 0.1) /// take make the process numerically stable, upper
      +
      280 /// bound for the dot product take 0.1
      +
      281 {
      +
      282 flag = 0;
      +
      283 break;
      +
      284 }
      +
      285 }
      +
      286 }
      +
      287 if (flag == 0)
      +
      288 std::cout << "Vectors are linearly dependent\n";
      +
      289 return 0;
      +
      290}
      T fabs(T... args)
      void gram_schmidt(int r, const int &c, const std::array< std::array< double, 10 >, 20 > &A, std::array< std::array< double, 10 >, 20 > B)
      Definition: gram_schmidt.cpp:121
      @@ -457,7 +456,7 @@ Here is the call graph for this function:
      - +

      ◆ projection()

      @@ -488,7 +487,7 @@ Here is the call graph for this function:
      rnumber of vectors
      cdimension of vectors
      -

      Projection Function Takes input of 2 vectors along with their dimension and evaluates their projection in temp

      +

      Projection Function Takes input of 2 vectors along with their dimension and evaluates their projection in temp

      Parameters
      @@ -498,20 +497,20 @@ Here is the call graph for this function:
      Returns
      factor
      -

      The dot product of two vectors is taken

      -

      The norm of the second vector is taken.

      -

      multiply that factor with every element in a 3rd vector, whose initial values are same as the 2nd vector.

      -
      80  {
      -
      81  double dot =
      -
      82  dot_product(x, y, c); /// The dot product of two vectors is taken
      -
      83  double anorm =
      -
      84  dot_product(y, y, c); /// The norm of the second vector is taken.
      -
      85  double factor =
      -
      86  dot /
      -
      87  anorm; /// multiply that factor with every element in a 3rd vector,
      -
      88  /// whose initial values are same as the 2nd vector.
      -
      89  return factor;
      -
      90 }
      +

      The dot product of two vectors is taken

      +

      The norm of the second vector is taken.

      +

      multiply that factor with every element in a 3rd vector, whose initial values are same as the 2nd vector.

      +
      80 {
      +
      81 double dot =
      +
      82 dot_product(x, y, c); /// The dot product of two vectors is taken
      +
      83 double anorm =
      +
      84 dot_product(y, y, c); /// The norm of the second vector is taken.
      +
      85 double factor =
      +
      86 dot /
      +
      87 anorm; /// multiply that factor with every element in a 3rd vector,
      +
      88 /// whose initial values are same as the 2nd vector.
      +
      89 return factor;
      +
      90}
      double dot_product(const std::array< double, 10 > &x, const std::array< double, 10 > &y, const int &c)
      Definition: gram_schmidt.cpp:59
      Here is the call graph for this function:
      @@ -522,7 +521,7 @@ Here is the call graph for this function:
      - +

      ◆ test()

      @@ -544,69 +543,69 @@ Here is the call graph for this function:
      xVector 1
      -

      Test Function. Process has been tested for 3 Sample Inputs

      Returns
      void
      -
      181  {
      - -
      183  {{1, 0, 1, 0}, {1, 1, 1, 1}, {0, 1, 2, 1}}};
      -
      184  std::array<std::array<double, 10>, 20> b1 = {{0}};
      -
      185  double dot1 = 0;
      - -
      187  int flag = 1;
      -
      188  for (int i = 0; i < 2; ++i) {
      -
      189  for (int j = i + 1; j < 3; ++j) {
      -
      190  dot1 = fabs(
      -
      191  linear_algebra::gram_schmidt::dot_product(b1[i], b1[j], 4));
      -
      192  if (dot1 > 0.1) {
      -
      193  flag = 0;
      -
      194  break;
      -
      195  }
      -
      196  }
      -
      197  }
      -
      198  if (flag == 0)
      -
      199  std::cout << "Vectors are linearly dependent\n";
      -
      200  assert(flag == 1);
      -
      201  std::cout << "Passed Test Case 1\n ";
      -
      202 
      -
      203  std::array<std::array<double, 10>, 20> a2 = {{{3, 1}, {2, 2}}};
      -
      204  std::array<std::array<double, 10>, 20> b2 = {{0}};
      -
      205  double dot2 = 0;
      - -
      207  flag = 1;
      -
      208  for (int i = 0; i < 1; ++i) {
      -
      209  for (int j = i + 1; j < 2; ++j) {
      -
      210  dot2 = fabs(
      -
      211  linear_algebra::gram_schmidt::dot_product(b2[i], b2[j], 2));
      -
      212  if (dot2 > 0.1) {
      -
      213  flag = 0;
      -
      214  break;
      -
      215  }
      -
      216  }
      -
      217  }
      -
      218  if (flag == 0)
      -
      219  std::cout << "Vectors are linearly dependent\n";
      -
      220  assert(flag == 1);
      -
      221  std::cout << "Passed Test Case 2\n";
      -
      222 
      -
      223  std::array<std::array<double, 10>, 20> a3 = {{{1, 2, 2}, {-4, 3, 2}}};
      -
      224  std::array<std::array<double, 10>, 20> b3 = {{0}};
      -
      225  double dot3 = 0;
      - -
      227  flag = 1;
      -
      228  for (int i = 0; i < 1; ++i) {
      -
      229  for (int j = i + 1; j < 2; ++j) {
      -
      230  dot3 = fabs(
      -
      231  linear_algebra::gram_schmidt::dot_product(b3[i], b3[j], 3));
      -
      232  if (dot3 > 0.1) {
      -
      233  flag = 0;
      -
      234  break;
      -
      235  }
      -
      236  }
      -
      237  }
      -
      238  if (flag == 0)
      -
      239  std::cout << "Vectors are linearly dependent\n";
      -
      240  assert(flag == 1);
      -
      241  std::cout << "Passed Test Case 3\n";
      -
      242 }
      +

      Test Function. Process has been tested for 3 Sample Inputs

      Returns
      void
      +
      181 {
      + +
      183 {{1, 0, 1, 0}, {1, 1, 1, 1}, {0, 1, 2, 1}}};
      +
      184 std::array<std::array<double, 10>, 20> b1 = {{0}};
      +
      185 double dot1 = 0;
      + +
      187 int flag = 1;
      +
      188 for (int i = 0; i < 2; ++i) {
      +
      189 for (int j = i + 1; j < 3; ++j) {
      +
      190 dot1 = fabs(
      +
      191 linear_algebra::gram_schmidt::dot_product(b1[i], b1[j], 4));
      +
      192 if (dot1 > 0.1) {
      +
      193 flag = 0;
      +
      194 break;
      +
      195 }
      +
      196 }
      +
      197 }
      +
      198 if (flag == 0)
      +
      199 std::cout << "Vectors are linearly dependent\n";
      +
      200 assert(flag == 1);
      +
      201 std::cout << "Passed Test Case 1\n ";
      +
      202
      +
      203 std::array<std::array<double, 10>, 20> a2 = {{{3, 1}, {2, 2}}};
      +
      204 std::array<std::array<double, 10>, 20> b2 = {{0}};
      +
      205 double dot2 = 0;
      + +
      207 flag = 1;
      +
      208 for (int i = 0; i < 1; ++i) {
      +
      209 for (int j = i + 1; j < 2; ++j) {
      +
      210 dot2 = fabs(
      +
      211 linear_algebra::gram_schmidt::dot_product(b2[i], b2[j], 2));
      +
      212 if (dot2 > 0.1) {
      +
      213 flag = 0;
      +
      214 break;
      +
      215 }
      +
      216 }
      +
      217 }
      +
      218 if (flag == 0)
      +
      219 std::cout << "Vectors are linearly dependent\n";
      +
      220 assert(flag == 1);
      +
      221 std::cout << "Passed Test Case 2\n";
      +
      222
      +
      223 std::array<std::array<double, 10>, 20> a3 = {{{1, 2, 2}, {-4, 3, 2}}};
      +
      224 std::array<std::array<double, 10>, 20> b3 = {{0}};
      +
      225 double dot3 = 0;
      + +
      227 flag = 1;
      +
      228 for (int i = 0; i < 1; ++i) {
      +
      229 for (int j = i + 1; j < 2; ++j) {
      +
      230 dot3 = fabs(
      +
      231 linear_algebra::gram_schmidt::dot_product(b3[i], b3[j], 3));
      +
      232 if (dot3 > 0.1) {
      +
      233 flag = 0;
      +
      234 break;
      +
      235 }
      +
      236 }
      +
      237 }
      +
      238 if (flag == 0)
      +
      239 std::cout << "Vectors are linearly dependent\n";
      +
      240 assert(flag == 1);
      +
      241 std::cout << "Passed Test Case 3\n";
      +
      242}
      @@ -616,7 +615,7 @@ Here is the call graph for this function:
      diff --git a/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.map b/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.map index 2bc02e4b1..b56a1c61b 100644 --- a/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.map +++ b/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.md5 b/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.md5 index 4ecae6439..9135b4b4f 100644 --- a/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.md5 +++ b/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.md5 @@ -1 +1 @@ -d01db209ea1f40231571867947eccaa2 \ No newline at end of file +9a55844be55392b1d85bd2133a4b5421 \ No newline at end of file diff --git a/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.svg b/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.svg index 8e186d658..c2e21984e 100644 --- a/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.svg +++ b/d5/d33/gram__schmidt_8cpp_a46e459aff5eafffb5ad9ceb129b4d274_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + machine_learning::sum diff --git a/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.map b/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.map index 051bed187..001fec67d 100644 --- a/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.map +++ b/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.map @@ -2,5 +2,5 @@ - + diff --git a/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.md5 b/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.md5 index 4297f9b02..04b91aca5 100644 --- a/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.md5 +++ b/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.md5 @@ -1 +1 @@ -b6fdadb3e9a16b4603c1881c8dfce0f6 \ No newline at end of file +e03c9e7c1fb54f513373239885678c21 \ No newline at end of file diff --git a/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.svg b/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.svg index 8d516620c..b2d0aead7 100644 --- a/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.svg +++ b/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph.svg @@ -1,7 +1,7 @@ - @@ -112,7 +112,7 @@ var sectionId = 'dynsection-2'; Node4 - + machine_learning::sum diff --git a/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph_org.svg b/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph_org.svg index 2604a247b..d7158370c 100644 --- a/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph_org.svg +++ b/d5/d33/gram__schmidt_8cpp_aa31ca28f60c880802462335eedc5d91f_cgraph_org.svg @@ -1,7 +1,7 @@ - Node4 - + machine_learning::sum diff --git a/d5/d33/gram__schmidt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d5/d33/gram__schmidt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 348bce310..eb4519459 100644 --- a/d5/d33/gram__schmidt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d5/d33/gram__schmidt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - + diff --git a/d5/d33/gram__schmidt_8cpp_aed4d308f46ca1d91e348ca260ec1d2fb_cgraph.md5 b/d5/d33/gram__schmidt_8cpp_aed4d308f46ca1d91e348ca260ec1d2fb_cgraph.md5 index 7273b27c1..692f8e0a8 100644 --- a/d5/d33/gram__schmidt_8cpp_aed4d308f46ca1d91e348ca260ec1d2fb_cgraph.md5 +++ b/d5/d33/gram__schmidt_8cpp_aed4d308f46ca1d91e348ca260ec1d2fb_cgraph.md5 @@ -1 +1 @@ -99db7f1b10447ebfdcbf9c6fbac7adc2 \ No newline at end of file +519f80bc5b8f14ec0d179006f40216d7 \ No newline at end of file diff --git a/d5/d33/gram__schmidt_8cpp_aed4d308f46ca1d91e348ca260ec1d2fb_cgraph.svg b/d5/d33/gram__schmidt_8cpp_aed4d308f46ca1d91e348ca260ec1d2fb_cgraph.svg index 376f1b4ce..588a3b78d 100644 --- a/d5/d33/gram__schmidt_8cpp_aed4d308f46ca1d91e348ca260ec1d2fb_cgraph.svg +++ b/d5/d33/gram__schmidt_8cpp_aed4d308f46ca1d91e348ca260ec1d2fb_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + machine_learning::sum diff --git a/d5/d39/namespaceactivations.html b/d5/d39/namespaceactivations.html index 88d1abcf4..c844a1986 100644 --- a/d5/d39/namespaceactivations.html +++ b/d5/d39/namespaceactivations.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: activations Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d5/d39/namespaceactivations.html','../
      -
      -
      activations Namespace Reference
      +
      activations Namespace Reference

      Various activation functions used in Neural network. More...

      Detailed Description

      -

      Various activation functions used in Neural network.

      +

      Various activation functions used in Neural network.

      diff --git a/d5/d3c/namespacedata__structures.html b/d5/d3c/namespacedata__structures.html index 2ba625ebe..4d2650aea 100644 --- a/d5/d3c/namespacedata__structures.html +++ b/d5/d3c/namespacedata__structures.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: data_structures Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -93,58 +93,57 @@ $(document).ready(function(){initNavTree('d5/d3c/namespacedata__structures.html' -
      -
      data_structures Namespace Reference
      +
      data_structures Namespace Reference

      Data Structures algorithms. More...

      - - +

      +

      Classes

      struct  Node
       
      class  SkipList
       
      class  trie
       Trie implementation for small-case English alphabets a-z More...
       Trie implementation for small-case English alphabets a-z More...
       
      - - + - +

      +

      Variables

      -constexpr int MAX_LEVEL = 2
      +constexpr int MAX_LEVEL = 2
       Maximum level of skip list.
       
      -constexpr float PROBABILITY = 0.5
      +constexpr float PROBABILITY = 0.5
       Current probability for "coin toss".
       

      Detailed Description

      -

      Data Structures algorithms.

      -

      for std::vector

      -

      for std::to_string

      -

      for IO operations

      -

      Data-structure algorithms.

      -

      Algorithms with data structures.

      -

      for assert

      -

      for io operations for std::array

      -

      Algorithms with data structures

      -

      for std::array for assert

      -

      Data Structures algorithms

      -

      for std::array for assert for std::ofstream for std::cout for std::unique_ptr for std::queue

      -

      Algorithms with data structures

      -

      for assert for IO operations for std::shared_ptr for std::stack for std::unordered_map

      -

      Data structures algorithms

      +

      Data Structures algorithms.

      +

      for std::vector

      +

      for std::to_string

      +

      for IO operations

      +

      Data-structure algorithms.

      +

      Algorithms with data structures.

      +

      for assert

      +

      for io operations for std::array

      +

      Algorithms with data structures

      +

      for std::array for assert

      +

      Data Structures algorithms

      +

      for std::array for assert for std::ofstream for std::cout for std::unique_ptr for std::queue

      +

      Algorithms with data structures

      +

      for assert for IO operations for std::shared_ptr for std::stack for std::unordered_map

      +

      Data structures algorithms

      diff --git a/d5/d45/sublist__search_8cpp.html b/d5/d45/sublist__search_8cpp.html index e6dead02d..70cc1101f 100644 --- a/d5/d45/sublist__search_8cpp.html +++ b/d5/d45/sublist__search_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: search/sublist_search.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('d5/d45/sublist__search_8cpp.html','../ Classes | Namespaces | Functions -
      -
      sublist_search.cpp File Reference
      +
      sublist_search.cpp File Reference
      -

      Implementation of the Sublist Search Algorithm +

      Implementation of the Sublist Search Algorithm More...

      #include <cassert>
      #include <iostream>
      @@ -111,7 +110,7 @@ Include dependency graph for sublist_search.cpp:
      - @@ -120,23 +119,23 @@ Classes

      +

      Classes

      struct  search::sublist_search::Node
       A Node structure representing a single link Node in a linked list. More...
       class encapsulating the necessary test cases More...
       
      - - + - - + +

      +

      Namespaces

       search
      namespace  search
       for std::vector
       
       
      - - - - + + + @@ -148,7 +147,7 @@ Functions

      +

      Functions

      void search::sublist_search::printLinkedList (Node *start)
       A simple function to print the linked list. More...
       
      Nodesearch::sublist_search::makeLinkedList (const std::vector< uint64_t > &data)
       Give a vector of data, it adds each element of vector in the linked list and return the address of head pointer. More...
       
      Nodesearch::sublist_search::makeLinkedList (const std::vector< uint64_t > &data)
       Give a vector of data, it adds each element of vector in the linked list and return the address of head pointer. More...
       
      bool search::sublist_search::sublistSearch (Node *sublist, Node *mainList)
       Main searching function. More...
       
       

      Detailed Description

      -

      Implementation of the Sublist Search Algorithm

      +

      Implementation of the Sublist Search Algorithm

      Algorithm

        @@ -162,9 +161,9 @@ Working
      • The sublist search algorithm works by comparing the first element of the first list with the first element of the second list.
      • If the two values don't match, it goes to the next element of the second list. It does this until the two values match.
      -
      Author
      Nitin Sharma
      +
      Author
      Nitin Sharma

      Function Documentation

      - +

      ◆ main()

      @@ -199,50 +198,50 @@ Working
      Returns
      0 on exit
      -

      < Main list in which sublist is to be searched

      -

      < Sublist to be searched

      -

      < Main list in which sublist is to be searched

      -

      < boolean to check if the sublist exists or not

      -
      339  {
      -
      340  test(); // run self-test implementations
      -
      341 
      -
      342  std::vector<uint64_t> mainlistData = {
      -
      343  2, 5, 6, 7, 8}; ///< Main list in which sublist is to be searched
      -
      344  std::vector<uint64_t> sublistData = {6, 8}; ///< Sublist to be searched
      -
      345 
      -
      346  search::sublist_search::Node *mainlistLL =
      - -
      348  search::sublist_search::Node *sublistLL =
      - -
      350  sublistData); ///< Main list in which sublist is to be
      -
      351  ///< searched
      -
      352 
      - -
      354  sublistLL,
      -
      355  mainlistLL); ///< boolean to check if the sublist exists or not
      -
      356 
      -
      357  std::cout << "Sublist: " << std::endl;
      - -
      359 
      -
      360  std::cout << "Main list: " << std::endl;
      - -
      362  std::cout << std::endl;
      -
      363 
      -
      364  if (exists) {
      -
      365  std::cout << "[TRUE] - sublist found in main list\n";
      -
      366  } else {
      -
      367  std::cout << "[FALSE] - sublist NOT found in main list\n";
      -
      368  }
      -
      369  return 0;
      -
      370 }
      +

      < Main list in which sublist is to be searched

      +

      < Sublist to be searched

      +

      < Main list in which sublist is to be searched

      +

      < boolean to check if the sublist exists or not

      +
      339 {
      +
      340 test(); // run self-test implementations
      +
      341
      +
      342 std::vector<uint64_t> mainlistData = {
      +
      343 2, 5, 6, 7, 8}; ///< Main list in which sublist is to be searched
      +
      344 std::vector<uint64_t> sublistData = {6, 8}; ///< Sublist to be searched
      +
      345
      +
      346 search::sublist_search::Node *mainlistLL =
      + + + +
      350 sublistData); ///< Main list in which sublist is to be
      +
      351 ///< searched
      +
      352
      + +
      354 sublistLL,
      +
      355 mainlistLL); ///< boolean to check if the sublist exists or not
      +
      356
      +
      357 std::cout << "Sublist: " << std::endl;
      + +
      359
      +
      360 std::cout << "Main list: " << std::endl;
      + + +
      363
      +
      364 if (exists) {
      +
      365 std::cout << "[TRUE] - sublist found in main list\n";
      +
      366 } else {
      +
      367 std::cout << "[FALSE] - sublist NOT found in main list\n";
      +
      368 }
      +
      369 return 0;
      +
      370}
      T endl(T... args)
      A Node structure representing a single link Node in a linked list.
      Definition: sublist_search.cpp:47
      bool sublistSearch(Node *sublist, Node *mainList)
      Main searching function.
      Definition: sublist_search.cpp:100
      +
      Node * makeLinkedList(const std::vector< uint64_t > &data)
      Give a vector of data, it adds each element of vector in the linked list and return the address of he...
      Definition: sublist_search.cpp:73
      static void test()
      Self-test implementations.
      Definition: sublist_search.cpp:328
      -
      Node * makeLinkedList(const std::vector< uint64_t > &data)
      Give a vector of data, it adds each element of vector in the linked list and return the address of he...
      Definition: sublist_search.cpp:73
      void printLinkedList(Node *start)
      A simple function to print the linked list.
      Definition: sublist_search.cpp:57
      - +
      bool exists(const std::string &str, const std::unordered_set< std::string > &strSet)
      Function that checks if the string passed in param is present in the the unordered_set passed.
      Definition: word_break.cpp:60
      Here is the call graph for this function:
      @@ -253,14 +252,14 @@ Here is the call graph for this function:
      - -

      ◆ makeLinkedList()

      + +

      ◆ makeLinkedList()

      - + @@ -277,26 +276,26 @@ Here is the call graph for this function:
      Returns
      Node* A head pointer to the linked list.
      -

      This is used in test cases for rapidly creating linked list with 100+ elements, instead of hard-coding 100 elements in test cases.

      -
      73  {
      -
      74  /// This is used in test cases for rapidly creating linked list with 100+
      -
      75  /// elements, instead of hard-coding 100 elements in test cases.
      -
      76  Node *head = nullptr;
      -
      77  Node *tail = nullptr;
      -
      78  for (int i : data) {
      -
      79  Node *node = new Node;
      -
      80  node->data = i;
      -
      81  node->next = nullptr;
      -
      82  if (head == nullptr) {
      -
      83  head = node;
      -
      84  tail = node;
      -
      85  } else {
      -
      86  tail->next = node;
      -
      87  tail = tail->next;
      -
      88  }
      -
      89  }
      -
      90  return head;
      -
      91 }
      +

      This is used in test cases for rapidly creating linked list with 100+ elements, instead of hard-coding 100 elements in test cases.

      +
      73 {
      +
      74 /// This is used in test cases for rapidly creating linked list with 100+
      +
      75 /// elements, instead of hard-coding 100 elements in test cases.
      +
      76 Node *head = nullptr;
      +
      77 Node *tail = nullptr;
      +
      78 for (int i : data) {
      +
      79 Node *node = new Node;
      +
      80 node->data = i;
      +
      81 node->next = nullptr;
      +
      82 if (head == nullptr) {
      +
      83 head = node;
      +
      84 tail = node;
      +
      85 } else {
      +
      86 tail->next = node;
      +
      87 tail = tail->next;
      +
      88 }
      +
      89 }
      +
      90 return head;
      +
      91}
      int data[MAX]
      test data
      Definition: hash_search.cpp:24
      struct list node
      Definition: linkedlist_implentation_usingarray.cpp:14
      @@ -304,13 +303,13 @@ Here is the call graph for this function:
      Here is the call graph for this function:
      -
      +
      - +

      ◆ printLinkedList()

      @@ -334,13 +333,13 @@ Here is the call graph for this function:
      Returns
      void
      -
      57  {
      -
      58  while (start != nullptr) {
      -
      59  std::cout << "->" << start->data;
      -
      60  start = start->next;
      -
      61  }
      - -
      63 }
      +
      57 {
      +
      58 while (start != nullptr) {
      +
      59 std::cout << "->" << start->data;
      +
      60 start = start->next;
      +
      61 }
      + +
      63}
      Here is the call graph for this function:
      @@ -350,7 +349,7 @@ Here is the call graph for this function:
      - +

      ◆ sublistSearch()

      @@ -387,59 +386,59 @@ Here is the call graph for this function:
      Returns
      true if the sublist is found
      false if the sublist is NOT found
      -

      Initialize target pointer to the head node of sublist.

      -

      Initialize main pointer to the current node of main list.

      -

      If the data of target node and main node is equal then move to the next node of both lists.

      -

      Is target pointer becomes null that means the target list is been traversed without returning false. Which means the sublist has been found and return ture.

      -

      set the target pointer again to stating point of target list.

      -

      set the main pointer to the next element of the main list and repeat the algo.

      -

      If the main list is exhausted, means sublist does not found, return false

      -
      100  {
      -
      101  if (sublist == nullptr || mainList == nullptr) {
      -
      102  return false;
      -
      103  }
      -
      104 
      -
      105  /// Initialize target pointer to the head node of sublist.
      -
      106  Node *target_ptr = sublist;
      -
      107 
      -
      108  while (mainList != nullptr) {
      -
      109  /// Initialize main pointer to the current node of main list.
      -
      110  Node *main_ptr = mainList;
      -
      111 
      -
      112  while (target_ptr != nullptr) {
      -
      113  if (main_ptr == nullptr) {
      -
      114  return false;
      -
      115 
      -
      116  } else if (main_ptr->data == target_ptr->data) {
      -
      117  /// If the data of target node and main node is equal then move
      -
      118  /// to the next node of both lists.
      -
      119  target_ptr = target_ptr->next;
      -
      120  main_ptr = main_ptr->next;
      -
      121 
      -
      122  } else {
      -
      123  break;
      -
      124  }
      -
      125  }
      -
      126 
      -
      127  if (target_ptr == nullptr) {
      -
      128  /// Is target pointer becomes null that means the target list is
      -
      129  /// been traversed without returning false. Which means the sublist
      -
      130  /// has been found and return ture.
      -
      131  return true;
      -
      132  }
      -
      133 
      -
      134  /// set the target pointer again to stating point of target list.
      -
      135  target_ptr = sublist;
      -
      136 
      -
      137  /// set the main pointer to the next element of the main list and repeat
      -
      138  /// the algo.
      -
      139  mainList = mainList->next;
      -
      140  }
      -
      141 
      -
      142  /// If the main list is exhausted, means sublist does not found, return
      -
      143  /// false
      -
      144  return false;
      -
      145 }
      +

      Initialize target pointer to the head node of sublist.

      +

      Initialize main pointer to the current node of main list.

      +

      If the data of target node and main node is equal then move to the next node of both lists.

      +

      Is target pointer becomes null that means the target list is been traversed without returning false. Which means the sublist has been found and return ture.

      +

      set the target pointer again to stating point of target list.

      +

      set the main pointer to the next element of the main list and repeat the algo.

      +

      If the main list is exhausted, means sublist does not found, return false

      +
      100 {
      +
      101 if (sublist == nullptr || mainList == nullptr) {
      +
      102 return false;
      +
      103 }
      +
      104
      +
      105 /// Initialize target pointer to the head node of sublist.
      +
      106 Node *target_ptr = sublist;
      +
      107
      +
      108 while (mainList != nullptr) {
      +
      109 /// Initialize main pointer to the current node of main list.
      +
      110 Node *main_ptr = mainList;
      +
      111
      +
      112 while (target_ptr != nullptr) {
      +
      113 if (main_ptr == nullptr) {
      +
      114 return false;
      +
      115
      +
      116 } else if (main_ptr->data == target_ptr->data) {
      +
      117 /// If the data of target node and main node is equal then move
      +
      118 /// to the next node of both lists.
      +
      119 target_ptr = target_ptr->next;
      +
      120 main_ptr = main_ptr->next;
      +
      121
      +
      122 } else {
      +
      123 break;
      +
      124 }
      +
      125 }
      +
      126
      +
      127 if (target_ptr == nullptr) {
      +
      128 /// Is target pointer becomes null that means the target list is
      +
      129 /// been traversed without returning false. Which means the sublist
      +
      130 /// has been found and return ture.
      +
      131 return true;
      +
      132 }
      +
      133
      +
      134 /// set the target pointer again to stating point of target list.
      +
      135 target_ptr = sublist;
      +
      136
      +
      137 /// set the main pointer to the next element of the main list and repeat
      +
      138 /// the algo.
      +
      139 mainList = mainList->next;
      +
      140 }
      +
      141
      +
      142 /// If the main list is exhausted, means sublist does not found, return
      +
      143 /// false
      +
      144 return false;
      +
      145}
      Here is the call graph for this function:
      @@ -449,7 +448,7 @@ Here is the call graph for this function:
      - +

      ◆ test()

      @@ -474,10 +473,10 @@ Here is the call graph for this function:

      Self-test implementations.

      Returns
      void
      -
      328  {
      -
      329  TestCases tc;
      -
      330  tc.runTests();
      -
      331 }
      +
      328 {
      +
      329 TestCases tc;
      +
      330 tc.runTests();
      +
      331}
      class encapsulating the necessary test cases
      Definition: inorder_successor_of_bst.cpp:225
      void runTests()
      Executes test cases.
      Definition: inorder_successor_of_bst.cpp:243
      @@ -495,7 +494,7 @@ Here is the call graph for this function:
      diff --git a/d5/d45/sublist__search_8cpp.js b/d5/d45/sublist__search_8cpp.js index 77cba54b0..f7ce142aa 100644 --- a/d5/d45/sublist__search_8cpp.js +++ b/d5/d45/sublist__search_8cpp.js @@ -1,9 +1,9 @@ var sublist__search_8cpp = [ - [ "Node", "da/d61/structsearch_1_1sublist__search_1_1_node.html", "da/d61/structsearch_1_1sublist__search_1_1_node" ], + [ "search::sublist_search::Node", "da/d61/structsearch_1_1sublist__search_1_1_node.html", "da/d61/structsearch_1_1sublist__search_1_1_node" ], [ "TestCases", "d5/d58/class_test_cases.html", "d5/d58/class_test_cases" ], [ "main", "d5/d45/sublist__search_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ], - [ "makeLinkedList", "d5/d45/sublist__search_8cpp.html#ab4054b9ab80a5e609b6fcdf70f2e03b9", null ], + [ "makeLinkedList", "d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53", null ], [ "printLinkedList", "d5/d45/sublist__search_8cpp.html#ad1028bc215281d62e344af99da57fab2", null ], [ "sublistSearch", "d5/d45/sublist__search_8cpp.html#a4faee403e2758aaab682ed6622ae218c", null ], [ "test", "d5/d45/sublist__search_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] diff --git a/d5/d45/sublist__search_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d5/d45/sublist__search_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg index 5112d6490..389911fa7 100644 --- a/d5/d45/sublist__search_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg +++ b/d5/d45/sublist__search_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -1,7 +1,7 @@ - diff --git a/d5/d45/sublist__search_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg b/d5/d45/sublist__search_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg index a83833450..878032c16 100644 --- a/d5/d45/sublist__search_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg +++ b/d5/d45/sublist__search_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - diff --git a/d5/d45/sublist__search_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg b/d5/d45/sublist__search_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg index ceccd406a..7df869692 100644 --- a/d5/d45/sublist__search_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg +++ b/d5/d45/sublist__search_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
      @@ -42,21 +41,22 @@
      Node* search::sublist_search::makeLinkedList Node * search::sublist_search::makeLinkedList ( const std::vector< uint64_t > &  data)
      -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,27 +90,26 @@ $(document).ready(function(){initNavTree('d3/d26/classdata__structures_1_1trie__
      -
      -
      data_structures::trie_using_hashmap::Trie Member List
      +
      data_structures::trie_using_hashmap::Trie Member List

      This is the complete list of members for data_structures::trie_using_hashmap::Trie, including all inherited members.

      - + - + - + - +
      delete_word(std::string word)data_structures::trie_using_hashmap::Trieinline
      get_all_words(std::vector< std::string > results, const std::shared_ptr< Node > &element, std::string prefix)data_structures::trie_using_hashmap::Trieinline
      get_all_words(std::vector< std::string > results, const std::shared_ptr< Node > &element, std::string prefix)data_structures::trie_using_hashmap::Trieinline
      insert(const std::string &word)data_structures::trie_using_hashmap::Trieinline
      predict_words(const std::string &prefix)data_structures::trie_using_hashmap::Trieinline
      predict_words(const std::string &prefix)data_structures::trie_using_hashmap::Trieinline
      root_nodedata_structures::trie_using_hashmap::Trieprivate
      search(const std::string &word)data_structures::trie_using_hashmap::Trieinline
      search(const std::string &word)data_structures::trie_using_hashmap::Trieinline
      startwith(const std::string &prefix)data_structures::trie_using_hashmap::Trieinline
      Trie()=defaultdata_structures::trie_using_hashmap::Trie
      Trie()=defaultdata_structures::trie_using_hashmap::Trie
      diff --git a/d5/d48/shortest__common__supersequence_8cpp__incl.svg b/d5/d48/shortest__common__supersequence_8cpp__incl.svg index 246221450..b49a762ae 100644 --- a/d5/d48/shortest__common__supersequence_8cpp__incl.svg +++ b/d5/d48/shortest__common__supersequence_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Sorting Algorithm @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,26 +92,31 @@ $(document).ready(function(){initNavTree('d5/d4c/group__sorting.html','../../');
      -
      -
      Sorting Algorithm
      +
      Sorting Algorithm
      - - + - +

      +

      Files

      file  merge_sort.cpp
       Merege Sort Algorithm (MEREGE SORT) implementation
       Merege Sort Algorithm (MEREGE SORT) implementation
       
      file  wiggle_sort.cpp
       Wiggle Sort Algorithm Implementation
       Wiggle Sort Algorithm Implementation
       
      - + + + +

      +

      +Namespaces

      namespace  sorting
       Sorting algorithms.
       
      + - - + + @@ -132,7 +137,7 @@ template<typename T >

      Functions

      -template<typename T >
      void heapify (T *arr, int n, int i)
      template<typename T >
      void heapify (T *arr, int n, int i)
       
      template<typename T >
      void heapSort (T *arr, int n)
       

      Detailed Description

      -

      The heapify procedure can be thought of as building a heap from the bottom up by successively sifting downward to establish the heap property.

      +

      The heapify procedure can be thought of as building a heap from the bottom up by successively sifting downward to establish the heap property.

      Parameters
      @@ -142,7 +147,7 @@ template<typename T >

      Function Documentation

      - +

      ◆ displayElements()

      @@ -177,29 +182,82 @@ template<typename T >
      Examples
      /Users/runner/work/C-Plus-Plus/C-Plus-Plus/sorting/wiggle_sort.cpp.
      -
      85  {
      -
      86  uint32_t size = arr.size();
      -
      87 
      -
      88  std::cout << "Sorted elements are as follows: ";
      -
      89 
      -
      90  std::cout << "[";
      -
      91 
      -
      92  for (int i = 0; i < size; i++) {
      -
      93  std::cout << arr[i];
      -
      94  if (i != size - 1) {
      -
      95  std::cout << ", ";
      -
      96  }
      -
      97  }
      -
      98 
      -
      99  std::cout << "]" << std::endl;
      -
      100 }
      +
      85 {
      +
      86 uint32_t size = arr.size();
      +
      87
      +
      88 std::cout << "Sorted elements are as follows: ";
      +
      89
      +
      90 std::cout << "[";
      +
      91
      +
      92 for (int i = 0; i < size; i++) {
      +
      93 std::cout << arr[i];
      +
      94 if (i != size - 1) {
      +
      95 std::cout << ", ";
      +
      96 }
      +
      97 }
      +
      98
      +
      99 std::cout << "]" << std::endl;
      +
      100}
      T endl(T... args)
      T size(T... args)
      - + +

      ◆ heapify()

      + +
      +
      +
      +template<typename T >
      +
      arrarray to be sorted
      + + + + + + + + + + + + + + + + + + + + + + + +
      void heapify (T * arr,
      int n,
      int i 
      )
      +
      +
      58 {
      +
      59 int largest = i;
      +
      60 int l = 2 * i + 1;
      +
      61 int r = 2 * i + 2;
      +
      62
      +
      63 if (l < n && arr[l] > arr[largest])
      +
      64 largest = l;
      +
      65
      +
      66 if (r < n && arr[r] > arr[largest])
      +
      67 largest = r;
      +
      68
      +
      69 if (largest != i) {
      +
      70 std::swap(arr[i], arr[largest]);
      +
      71 heapify(arr, n, largest);
      +
      72 }
      +
      73}
      +
      T swap(T... args)
      +
      +
      + +

      ◆ heapSort()

      @@ -226,7 +284,7 @@ template<typename T >
      -

      Utilizes heapify procedure to sort the array

      +

      Utilizes heapify procedure to sort the array

      Parameters
      @@ -234,19 +292,18 @@ template<typename T >
      arrarray to be sorted
      -
      84  {
      -
      85  for (int i = n - 1; i >= 0; i--) heapify(arr, n, i);
      -
      86 
      -
      87  for (int i = n - 1; i >= 0; i--) {
      -
      88  std::swap(arr[0], arr[i]);
      -
      89  heapify(arr, i, 0);
      -
      90  }
      -
      91 }
      -
      T swap(T... args)
      +
      84 {
      +
      85 for (int i = n - 1; i >= 0; i--) heapify(arr, n, i);
      +
      86
      +
      87 for (int i = n - 1; i >= 0; i--) {
      +
      88 std::swap(arr[0], arr[i]);
      +
      89 heapify(arr, i, 0);
      +
      90 }
      +
      91}
      - +

      ◆ main()

      @@ -261,30 +318,30 @@ template<typename T >
      -

      Main function

      -

      Driver Code

      -
      90  {
      -
      91  int size;
      -
      92  std::cout << "Enter the number of elements : ";
      -
      93  std::cin >> size;
      -
      94  int *arr = new int[size];
      -
      95  std::cout << "Enter the unsorted elements : ";
      -
      96  for (int i = 0; i < size; ++i) {
      -
      97  std::cin >> arr[i];
      -
      98  }
      -
      99  mergeSort(arr, 0, size - 1);
      -
      100  std::cout << "Sorted array : ";
      -
      101  show(arr, size);
      -
      102  delete[] arr;
      -
      103  return 0;
      -
      104 }
      +

      Main function

      +

      Driver Code

      +
      90 {
      +
      91 int size;
      +
      92 std::cout << "Enter the number of elements : ";
      +
      93 std::cin >> size;
      +
      94 int *arr = new int[size];
      +
      95 std::cout << "Enter the unsorted elements : ";
      +
      96 for (int i = 0; i < size; ++i) {
      +
      97 std::cin >> arr[i];
      +
      98 }
      +
      99 mergeSort(arr, 0, size - 1);
      +
      100 std::cout << "Sorted array : ";
      +
      101 show(arr, size);
      +
      102 delete[] arr;
      +
      103 return 0;
      +
      104}
      void show(int *arr, int size)
      Definition: merge_sort.cpp:84
      void mergeSort(int *arr, int l, int r)
      Definition: merge_sort.cpp:71
      - +

      ◆ merge()

      @@ -321,7 +378,7 @@ template<typename T >
      -

      The merge() function is used for merging two halves. The merge(arr, l, m, r) is key process that assumes that arr[l..m] and arr[m+1..r] are sorted and merges the two sorted sub-arrays into one.

      +

      The merge() function is used for merging two halves. The merge(arr, l, m, r) is key process that assumes that arr[l..m] and arr[m+1..r] are sorted and merges the two sorted sub-arrays into one.

      Parameters
      @@ -337,37 +394,37 @@ template<typename T >
      arr- array with two halves arr[l...m] and arr[m+1...l]
      -
      33  {
      -
      34  int i, j, k;
      -
      35  int n1 = m - l + 1;
      -
      36  int n2 = r - m;
      -
      37 
      -
      38  int *L = new int[n1], *R = new int[n2];
      -
      39 
      -
      40  for (i = 0; i < n1; i++) L[i] = arr[l + i];
      -
      41  for (j = 0; j < n2; j++) R[j] = arr[m + 1 + j];
      -
      42 
      -
      43  i = 0;
      -
      44  j = 0;
      -
      45  k = l;
      -
      46  while (i < n1 || j < n2) {
      -
      47  if (j >= n2 || (i < n1 && L[i] <= R[j])) {
      -
      48  arr[k] = L[i];
      -
      49  i++;
      -
      50  } else {
      -
      51  arr[k] = R[j];
      -
      52  j++;
      -
      53  }
      -
      54  k++;
      -
      55  }
      -
      56 
      -
      57  delete[] L;
      -
      58  delete[] R;
      -
      59 }
      +
      33 {
      +
      34 int i, j, k;
      +
      35 int n1 = m - l + 1;
      +
      36 int n2 = r - m;
      +
      37
      +
      38 int *L = new int[n1], *R = new int[n2];
      +
      39
      +
      40 for (i = 0; i < n1; i++) L[i] = arr[l + i];
      +
      41 for (j = 0; j < n2; j++) R[j] = arr[m + 1 + j];
      +
      42
      +
      43 i = 0;
      +
      44 j = 0;
      +
      45 k = l;
      +
      46 while (i < n1 || j < n2) {
      +
      47 if (j >= n2 || (i < n1 && L[i] <= R[j])) {
      +
      48 arr[k] = L[i];
      +
      49 i++;
      +
      50 } else {
      +
      51 arr[k] = R[j];
      +
      52 j++;
      +
      53 }
      +
      54 k++;
      +
      55 }
      +
      56
      +
      57 delete[] L;
      +
      58 delete[] R;
      +
      59}
      - +

      ◆ mergeSort()

      @@ -398,7 +455,7 @@ template<typename T >
      -

      Merge sort is a divide and conquer algorithm, it divides the input array into two halves and calls itself for the two halves and then calls merge() to merge the two halves

      +

      Merge sort is a divide and conquer algorithm, it divides the input array into two halves and calls itself for the two halves and then calls merge() to merge the two halves

      Parameters
      @@ -407,25 +464,25 @@ template<typename T >
      arr- array to be sorted
      -
      71  {
      -
      72  if (l < r) {
      -
      73  int m = l + (r - l) / 2;
      -
      74  mergeSort(arr, l, m);
      -
      75  mergeSort(arr, m + 1, r);
      -
      76  merge(arr, l, m, r);
      -
      77  }
      -
      78 }
      +
      71 {
      +
      72 if (l < r) {
      +
      73 int m = l + (r - l) / 2;
      +
      74 mergeSort(arr, l, m);
      +
      75 mergeSort(arr, m + 1, r);
      +
      76 merge(arr, l, m, r);
      +
      77 }
      +
      78}
      void merge(int *arr, int l, int m, int r)
      Definition: merge_sort.cpp:33
      Here is the call graph for this function:
      -
      +
      - +

      ◆ show()

      @@ -450,15 +507,15 @@ Here is the call graph for this function:
      -

      Utility function used to print the array after sorting

      -
      84  {
      -
      85  for (int i = 0; i < size; i++) std::cout << arr[i] << " ";
      -
      86  std::cout << "\n";
      -
      87 }
      +

      Utility function used to print the array after sorting

      +
      84 {
      +
      85 for (int i = 0; i < size; i++) std::cout << arr[i] << " ";
      +
      86 std::cout << "\n";
      +
      87}
      - +

      ◆ test()

      @@ -480,26 +537,26 @@ Here is the call graph for this function:
      -

      Test function

      Returns
      void
      -
      106  {
      -
      107  std::srand(std::time(nullptr)); // initialize random number generator
      -
      108 
      -
      109  std::vector<float> data1(100);
      -
      110  for (auto &d : data1) { // generate random numbers between -5.0 and 4.99
      -
      111  d = float(std::rand() % 1000 - 500) / 100.f;
      -
      112  }
      -
      113 
      -
      114  std::vector<float> sorted = sorting::wiggle_sort::wiggleSort<float>(data1);
      -
      115 
      -
      116  displayElements(sorted);
      -
      117 
      -
      118  for (uint32_t j = 0; j < data1.size(); j += 2) {
      -
      119  assert(data1[j] <= data1[j + 1] &&
      -
      120  data1[j + 1] >= data1[j + 2]); // check the validation condition
      -
      121  }
      -
      122 
      -
      123  std::cout << "Test 1 passed\n";
      -
      124 }
      +

      Test function

      Returns
      void
      +
      106 {
      +
      107 std::srand(std::time(nullptr)); // initialize random number generator
      +
      108
      +
      109 std::vector<float> data1(100);
      +
      110 for (auto &d : data1) { // generate random numbers between -5.0 and 4.99
      +
      111 d = float(std::rand() % 1000 - 500) / 100.f;
      +
      112 }
      +
      113
      +
      114 std::vector<float> sorted = sorting::wiggle_sort::wiggleSort<float>(data1);
      +
      115
      +
      116 displayElements(sorted);
      +
      117
      +
      118 for (uint32_t j = 0; j < data1.size(); j += 2) {
      +
      119 assert(data1[j] <= data1[j + 1] &&
      +
      120 data1[j + 1] >= data1[j + 2]); // check the validation condition
      +
      121 }
      +
      122
      +
      123 std::cout << "Test 1 passed\n";
      +
      124}
      static void displayElements(const std::vector< T > &arr)
      Utility function used for printing the elements. Prints elements of the array after they're sorted us...
      Definition: wiggle_sort.cpp:85
      T rand(T... args)
      T srand(T... args)
      @@ -519,7 +576,7 @@ Here is the call graph for this function:
      diff --git a/d5/d4c/group__sorting.js b/d5/d4c/group__sorting.js index c5a0d6da1..29ca31830 100644 --- a/d5/d4c/group__sorting.js +++ b/d5/d4c/group__sorting.js @@ -2,6 +2,7 @@ var group__sorting = [ [ "merge_sort.cpp", "d5/df4/merge__sort_8cpp.html", null ], [ "wiggle_sort.cpp", "d1/dcc/wiggle__sort_8cpp.html", null ], + [ "sorting", "d5/d91/namespacesorting.html", null ], [ "displayElements", "d5/d4c/group__sorting.html#ga135e4c638e3bcf548bd122b5f49a3e72", null ], [ "heapSort", "d5/d4c/group__sorting.html#ga29d28b140174dbdde7c9f5157758435f", null ], [ "main", "d5/d4c/group__sorting.html#gae66f6b31b5ad750f1fe042a706a4e3d4", null ], diff --git a/d5/d4c/group__sorting_gaa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d5/d4c/group__sorting_gaa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 9f6ea273d..d3a4d5d25 100644 --- a/d5/d4c/group__sorting_gaa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d5/d4c/group__sorting_gaa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,7 +1,7 @@ - - - + + diff --git a/d5/d4c/group__sorting_gab6b14fea48d9841e29b9fc26be6e05d7_cgraph.md5 b/d5/d4c/group__sorting_gab6b14fea48d9841e29b9fc26be6e05d7_cgraph.md5 index 430f32061..6676330e1 100644 --- a/d5/d4c/group__sorting_gab6b14fea48d9841e29b9fc26be6e05d7_cgraph.md5 +++ b/d5/d4c/group__sorting_gab6b14fea48d9841e29b9fc26be6e05d7_cgraph.md5 @@ -1 +1 @@ -79bf9141a6580825262267deef7601e1 \ No newline at end of file +33a909d64e74e94c0c84658d6f7d9227 \ No newline at end of file diff --git a/d5/d4c/group__sorting_gab6b14fea48d9841e29b9fc26be6e05d7_cgraph.svg b/d5/d4c/group__sorting_gab6b14fea48d9841e29b9fc26be6e05d7_cgraph.svg index cb5cc3fbb..927a3cf22 100644 --- a/d5/d4c/group__sorting_gab6b14fea48d9841e29b9fc26be6e05d7_cgraph.svg +++ b/d5/d4c/group__sorting_gab6b14fea48d9841e29b9fc26be6e05d7_cgraph.svg @@ -1,14 +1,14 @@ - - - + + mergeSort - + Node1 @@ -18,6 +18,12 @@ + + +Node1->Node1 + + + Node2 diff --git a/d5/d4d/structciphers_1_1elliptic__curve__key__exchange_1_1_point-members.html b/d5/d4d/structciphers_1_1elliptic__curve__key__exchange_1_1_point-members.html index 8d1fe0efc..3588d4cc9 100644 --- a/d5/d4d/structciphers_1_1elliptic__curve__key__exchange_1_1_point-members.html +++ b/d5/d4d/structciphers_1_1elliptic__curve__key__exchange_1_1_point-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,23 +90,22 @@ $(document).ready(function(){initNavTree('d6/d45/structciphers_1_1elliptic__curv
      -
      -
      ciphers::elliptic_curve_key_exchange::Point Member List
      +
      ciphers::elliptic_curve_key_exchange::Point Member List
      diff --git a/d5/d55/classgraph_1_1_rooted_tree-members.html b/d5/d55/classgraph_1_1_rooted_tree-members.html index 555ba123d..73aa7f33f 100644 --- a/d5/d55/classgraph_1_1_rooted_tree-members.html +++ b/d5/d55/classgraph_1_1_rooted_tree-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,31 +90,30 @@ $(document).ready(function(){initNavTree('d0/d58/classgraph_1_1_rooted_tree.html
      -
      -
      graph::RootedTree Member List
      +
      graph::RootedTree Member List

      This is the complete list of members for graph::RootedTree, including all inherited members.

      - - - + + + - + - + - + - +
      add_edge(T u, T v, bool bidir=true)graph::Graph< T >inline
      adjacency_listgraph::Graph< T >private
      breadth_first_search(T src)graph::Graph< T >inline
      Graph()=default (defined in graph::Graph< T >)graph::Graph< T >
      adjacency_listgraph::Graph< T >private
      breadth_first_search(T src)graph::Graph< T >inline
      Graph()=default (defined in graph::Graph< T >)graph::Graph< T >
      Graph(size_t N, const std::vector< std::pair< int, int > > &undirected_edges)graph::Graph< T >inline
      levelgraph::RootedTree
      levelgraph::RootedTree
      neighborsgraph::Graph< T >
      number_of_vertices() constgraph::Graph< T >inline
      number_of_vertices() constgraph::Graph< T >inline
      parentgraph::RootedTree
      populate_parents()graph::RootedTreeinlineprotected
      populate_parents()graph::RootedTreeinlineprotected
      rootgraph::RootedTree
      RootedTree(const std::vector< std::pair< int, int > > &undirected_edges, int root_)graph::RootedTreeinline
      RootedTree(const std::vector< std::pair< int, int > > &undirected_edges, int root_)graph::RootedTreeinline
      diff --git a/d5/d58/class_test_cases.html b/d5/d58/class_test_cases.html index b694b1ebb..05a2fb1e3 100644 --- a/d5/d58/class_test_cases.html +++ b/d5/d58/class_test_cases.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: TestCases Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -94,15 +94,14 @@ $(document).ready(function(){initNavTree('d5/d58/class_test_cases.html','../../' Public Member Functions | Private Member Functions | List of all members -
      -
      TestCases Class Reference
      +
      TestCases Class Reference

      class encapsulating the necessary test cases More...

      - @@ -141,7 +140,7 @@ Public Member Functions

      +

      Public Member Functions

      void runTests ()
       Executes test cases. More...
       A test case with array of length 1000. More...
       
      - @@ -157,10 +156,10 @@ Private Member Functions

      +

      Private Member Functions

      template<typename T >
      void log (T msg)
       

      Detailed Description

      -

      class encapsulating the necessary test cases

      -

      a class containing the necessary test cases

      +

      class encapsulating the necessary test cases

      +

      a class containing the necessary test cases

      Member Function Documentation

      - +

      ◆ log() [1/3]

      @@ -194,10 +193,10 @@ template<typename T >
      Returns
      void
      -
      233  {
      -
      234  // It's just to avoid writing cout and endl
      -
      235  std::cout << "[TESTS] : ---> " << msg << std::endl;
      -
      236  }
      +
      233 {
      +
      234 // It's just to avoid writing cout and endl
      +
      235 std::cout << "[TESTS] : ---> " << msg << std::endl;
      +
      236 }
      T endl(T... args)
      @@ -209,7 +208,7 @@ Here is the call graph for this function:
      - +

      ◆ log() [2/3]

      @@ -243,10 +242,10 @@ template<typename T >
      Returns
      void
      -
      161  {
      -
      162  // It's just to avoid writing cout and endl
      -
      163  std::cout << "[TESTS] : ---> " << msg << std::endl;
      -
      164  }
      +
      161 {
      +
      162 // It's just to avoid writing cout and endl
      +
      163 std::cout << "[TESTS] : ---> " << msg << std::endl;
      +
      164 }
      Here is the call graph for this function:
      @@ -256,7 +255,7 @@ Here is the call graph for this function:
      - +

      ◆ log() [3/3]

      @@ -290,10 +289,10 @@ template<typename T >
      Returns
      void
      -
      189  {
      -
      190  // It's just to avoid writing cout and endl
      -
      191  std::cout << "[TESTS] : ---> " << msg << std::endl;
      -
      192  }
      +
      189 {
      +
      190 // It's just to avoid writing cout and endl
      +
      191 std::cout << "[TESTS] : ---> " << msg << std::endl;
      +
      192 }
      Here is the call graph for this function:
      @@ -303,7 +302,7 @@ Here is the call graph for this function:
      - +

      ◆ runTests() [1/3]

      @@ -328,16 +327,16 @@ Here is the call graph for this function:

      Executes test cases.

      Returns
      void
      -
      243  {
      -
      244  log("Running Tests...");
      -
      245 
      -
      246  testCase_1();
      -
      247  testCase_2();
      -
      248  testCase_3();
      -
      249 
      -
      250  log("Test Cases over!");
      -
      251  std::cout << std::endl;
      -
      252  }
      +
      243 {
      +
      244 log("Running Tests...");
      +
      245
      +
      246 testCase_1();
      +
      247 testCase_2();
      +
      248 testCase_3();
      +
      249
      +
      250 log("Test Cases over!");
      + +
      252 }
      void log(T msg)
      A function to print given message on console.
      Definition: inorder_successor_of_bst.cpp:233
      void testCase_2()
      A test case which contains main list of 100 elements and sublist of 20.
      Definition: inorder_successor_of_bst.cpp:304
      void testCase_1()
      A test case contains edge case, printing inorder successor of last node.
      Definition: inorder_successor_of_bst.cpp:259
      @@ -351,7 +350,7 @@ Here is the call graph for this function:
      - +

      ◆ runTests() [2/3]

      @@ -376,16 +375,16 @@ Here is the call graph for this function:

      Executes test cases.

      Returns
      void
      -
      171  {
      -
      172  log("Running Tests...");
      -
      173 
      -
      174  testCase_1();
      -
      175  testCase_2();
      -
      176  testCase_3();
      -
      177 
      -
      178  log("Test Cases over!");
      -
      179  std::cout << std::endl;
      -
      180  }
      +
      171 {
      +
      172 log("Running Tests...");
      +
      173
      +
      174 testCase_1();
      +
      175 testCase_2();
      +
      176 testCase_3();
      +
      177
      +
      178 log("Test Cases over!");
      + +
      180 }
      Here is the call graph for this function:
      @@ -395,7 +394,7 @@ Here is the call graph for this function:
      - +

      ◆ runTests() [3/3]

      @@ -420,16 +419,16 @@ Here is the call graph for this function:

      Executes test cases.

      Returns
      void
      -
      199  {
      -
      200  log("Running Tests...");
      -
      201 
      -
      202  testCase_1();
      -
      203  testCase_2();
      -
      204  testCase_3();
      -
      205 
      -
      206  log("Test Cases over!");
      -
      207  std::cout << std::endl;
      -
      208  }
      +
      199 {
      +
      200 log("Running Tests...");
      +
      201
      +
      202 testCase_1();
      +
      203 testCase_2();
      +
      204 testCase_3();
      +
      205
      +
      206 log("Test Cases over!");
      + +
      208 }
      Here is the call graph for this function:
      @@ -439,7 +438,7 @@ Here is the call graph for this function:
      - +

      ◆ testCase_1() [1/3]

      @@ -464,56 +463,56 @@ Here is the call graph for this function:

      A test case contains edge case, printing inorder successor of last node.

      Returns
      void
      -

      < Expected output of this test

      -

      < Data to make nodes in BST

      -

      < Adding nodes to BST

      -

      < Printing inorder to cross-verify.

      -

      < The inorder successor node for given data

      -

      memory cleanup!

      -
      259  {
      - -
      261  *expectedOutput = nullptr; ///< Expected output of this test
      -
      262 
      -
      263  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      -
      264  log("This is test case 1 : ");
      -
      265  log("Description:");
      -
      266  log(" EDGE CASE : Printing inorder successor for last node in the "
      -
      267  "BST, Output will be nullptr.");
      -
      268 
      - -
      270  nullptr;
      -
      271  std::vector<int64_t> node_data{
      -
      272  20, 3, 5, 6, 2, 23, 45, 78, 21}; ///< Data to make nodes in BST
      -
      273 
      - -
      275  root,
      -
      276  node_data); ///< Adding nodes to BST
      -
      277 
      -
      278  std::cout << "Inorder sequence is : ";
      - -
      280  root); ///< Printing inorder to cross-verify.
      -
      281  std::cout << std::endl;
      -
      282 
      - -
      284  *inorderSuccessor = operations_on_datastructures::
      -
      285  inorder_traversal_of_bst::getInorderSuccessor(
      -
      286  root, 78); ///< The inorder successor node for given data
      -
      287 
      -
      288  log("Checking assert expression...");
      -
      289  assert(inorderSuccessor == expectedOutput);
      -
      290  log("Assertion check passed!");
      -
      291 
      - -
      293  root); /// memory cleanup!
      -
      294 
      -
      295  log("[PASS] : TEST CASE 1 PASS!");
      -
      296  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      -
      297  }
      +

      < Expected output of this test

      +

      < Data to make nodes in BST

      +

      < Adding nodes to BST

      +

      < Printing inorder to cross-verify.

      +

      < The inorder successor node for given data

      +

      memory cleanup!

      +
      259 {
      + +
      261 *expectedOutput = nullptr; ///< Expected output of this test
      +
      262
      +
      263 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      +
      264 log("This is test case 1 : ");
      +
      265 log("Description:");
      +
      266 log(" EDGE CASE : Printing inorder successor for last node in the "
      +
      267 "BST, Output will be nullptr.");
      +
      268
      + +
      270 nullptr;
      +
      271 std::vector<int64_t> node_data{
      +
      272 20, 3, 5, 6, 2, 23, 45, 78, 21}; ///< Data to make nodes in BST
      +
      273
      + +
      275 root,
      +
      276 node_data); ///< Adding nodes to BST
      +
      277
      +
      278 std::cout << "Inorder sequence is : ";
      + +
      280 root); ///< Printing inorder to cross-verify.
      + +
      282
      + +
      284 *inorderSuccessor = operations_on_datastructures::
      +
      285 inorder_traversal_of_bst::getInorderSuccessor(
      +
      286 root, 78); ///< The inorder successor node for given data
      +
      287
      +
      288 log("Checking assert expression...");
      +
      289 assert(inorderSuccessor == expectedOutput);
      +
      290 log("Assertion check passed!");
      +
      291
      + +
      293 root); /// memory cleanup!
      +
      294
      +
      295 log("[PASS] : TEST CASE 1 PASS!");
      +
      296 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      +
      297 }
      A Node structure representing a single node in BST.
      Definition: inorder_successor_of_bst.cpp:56
      +
      Node * makeBST(Node *root, const std::vector< int64_t > &data)
      This function is used in test cases to quickly create BST containing large data instead of hard codin...
      Definition: inorder_successor_of_bst.cpp:155
      void printInorder(Node *root)
      Prints the BST in inorder traversal using recursion.
      Definition: inorder_successor_of_bst.cpp:136
      void deallocate(Node *rootNode)
      This function clears the memory allocated to entire tree recursively. Its just for clean up the memor...
      Definition: inorder_successor_of_bst.cpp:210
      -
      Node * makeBST(Node *root, const std::vector< int64_t > &data)
      This function is used in test cases to quickly create BST containing large data instead of hard codin...
      Definition: inorder_successor_of_bst.cpp:155
      - +
      Here is the call graph for this function:
      @@ -523,7 +522,7 @@ Here is the call graph for this function:
      - +

      ◆ testCase_1() [2/3]

      @@ -548,52 +547,52 @@ Here is the call graph for this function:

      A test case contains edge case, Only contains one element.

      Returns
      void
      -

      < Expected output of this test

      -

      < Data to make linked list which will be the sublist

      -

      < Data to make linked list which will be the main list

      -

      < Sublist to be searched

      -

      < Main list in which sublist is to be searched

      -

      < boolean, if sublist exist or not

      -
      186  {
      -
      187  const bool expectedOutput = true; ///< Expected output of this test
      -
      188 
      -
      189  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      190  "~");
      -
      191  log("This is test case 1 for sublist search Algorithm : ");
      -
      192  log("Description:");
      -
      193  log(" EDGE CASE : Only contains one element");
      -
      194 
      -
      195  std::vector<uint64_t> sublistData = {
      -
      196  6}; ///< Data to make linked list which will be the sublist
      -
      197  std::vector<uint64_t> mainlistData = {
      -
      198  2, 5, 6, 7,
      -
      199  8}; ///< Data to make linked list which will be the main list
      -
      200 
      -
      201  search::sublist_search::Node *sublistLL =
      - -
      203  sublistData); ///< Sublist to be searched
      -
      204  search::sublist_search::Node *mainlistLL =
      - -
      206  mainlistData); ///< Main list in which sublist is to be
      -
      207  ///< searched
      -
      208 
      - -
      210  sublistLL, mainlistLL); ///< boolean, if sublist exist or not
      -
      211 
      -
      212  log("Checking assert expression...");
      -
      213  assert(exists == expectedOutput);
      -
      214  log("Assertion check passed!");
      -
      215 
      -
      216  log("[PASS] : TEST CASE 1 PASS!");
      -
      217  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      218  "~");
      -
      219 
      -
      220  delete (sublistLL);
      -
      221  delete (mainlistLL);
      -
      222  }
      +

      < Expected output of this test

      +

      < Data to make linked list which will be the sublist

      +

      < Data to make linked list which will be the main list

      +

      < Sublist to be searched

      +

      < Main list in which sublist is to be searched

      +

      < boolean, if sublist exist or not

      +
      186 {
      +
      187 const bool expectedOutput = true; ///< Expected output of this test
      +
      188
      +
      189 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      190 "~");
      +
      191 log("This is test case 1 for sublist search Algorithm : ");
      +
      192 log("Description:");
      +
      193 log(" EDGE CASE : Only contains one element");
      +
      194
      +
      195 std::vector<uint64_t> sublistData = {
      +
      196 6}; ///< Data to make linked list which will be the sublist
      +
      197 std::vector<uint64_t> mainlistData = {
      +
      198 2, 5, 6, 7,
      +
      199 8}; ///< Data to make linked list which will be the main list
      +
      200
      + + +
      203 sublistData); ///< Sublist to be searched
      +
      204 search::sublist_search::Node *mainlistLL =
      + +
      206 mainlistData); ///< Main list in which sublist is to be
      +
      207 ///< searched
      +
      208
      + +
      210 sublistLL, mainlistLL); ///< boolean, if sublist exist or not
      +
      211
      +
      212 log("Checking assert expression...");
      +
      213 assert(exists == expectedOutput);
      +
      214 log("Assertion check passed!");
      +
      215
      +
      216 log("[PASS] : TEST CASE 1 PASS!");
      +
      217 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      218 "~");
      +
      219
      +
      220 delete (sublistLL);
      +
      221 delete (mainlistLL);
      +
      222 }
      A Node structure representing a single link Node in a linked list.
      Definition: sublist_search.cpp:47
      bool sublistSearch(Node *sublist, Node *mainList)
      Main searching function.
      Definition: sublist_search.cpp:100
      -
      Node * makeLinkedList(const std::vector< uint64_t > &data)
      Give a vector of data, it adds each element of vector in the linked list and return the address of he...
      Definition: sublist_search.cpp:73
      +
      Node * makeLinkedList(const std::vector< uint64_t > &data)
      Give a vector of data, it adds each element of vector in the linked list and return the address of he...
      Definition: sublist_search.cpp:73
      bool exists(const std::string &str, const std::unordered_set< std::string > &strSet)
      Function that checks if the string passed in param is present in the the unordered_set passed.
      Definition: word_break.cpp:60
      Here is the call graph for this function:
      @@ -604,7 +603,7 @@ Here is the call graph for this function:
      - +

      ◆ testCase_1() [3/3]

      @@ -629,36 +628,36 @@ Here is the call graph for this function:

      A test case with single input.

      Returns
      void
      -
      214  {
      -
      215  const int64_t inputSize = 1;
      -
      216  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      217  "~");
      -
      218  log("This is test case 1 for Random Pivot Quick Sort Algorithm : ");
      -
      219  log("Description:");
      -
      220  log(" EDGE CASE : Only contains one element");
      -
      221  std::array<int64_t, inputSize> unsorted_arr{2};
      -
      222 
      -
      223  int64_t start = 0;
      -
      224  int64_t end = unsorted_arr.size() - 1; // length - 1
      -
      225 
      -
      226  log("Running algorithm of data of length 50 ...");
      -
      227  std::array<int64_t, unsorted_arr.size()> sorted_arr =
      - -
      229  end);
      -
      230  log("Algorithm finished!");
      -
      231 
      -
      232  log("Checking assert expression...");
      -
      233  assert(std::is_sorted(sorted_arr.begin(), sorted_arr.end()));
      -
      234  log("Assertion check passed!");
      -
      235 
      -
      236  log("[PASS] : TEST CASE 1 PASS!");
      -
      237  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      238  "~");
      -
      239  }
      +
      214 {
      +
      215 const int64_t inputSize = 1;
      +
      216 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      217 "~");
      +
      218 log("This is test case 1 for Random Pivot Quick Sort Algorithm : ");
      +
      219 log("Description:");
      +
      220 log(" EDGE CASE : Only contains one element");
      +
      221 std::array<int64_t, inputSize> unsorted_arr{2};
      +
      222
      +
      223 int64_t start = 0;
      +
      224 int64_t end = unsorted_arr.size() - 1; // length - 1
      +
      225
      +
      226 log("Running algorithm of data of length 50 ...");
      +
      227 std::array<int64_t, unsorted_arr.size()> sorted_arr =
      + +
      229 end);
      +
      230 log("Algorithm finished!");
      +
      231
      +
      232 log("Checking assert expression...");
      +
      233 assert(std::is_sorted(sorted_arr.begin(), sorted_arr.end()));
      +
      234 log("Assertion check passed!");
      +
      235
      +
      236 log("[PASS] : TEST CASE 1 PASS!");
      +
      237 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      238 "~");
      +
      239 }
      T end(T... args)
      T is_sorted(T... args)
      -
      std::array< int64_t, size > quickSortRP(std::array< int64_t, size > arr, int64_t start, int64_t end)
      Random pivot quick sort function. This function is the starting point of the algorithm.
      Definition: random_pivot_quick_sort.cpp:130
      +
      std::array< int64_t, size > quickSortRP(std::array< int64_t, size > arr, int64_t start, int64_t end)
      Random pivot quick sort function. This function is the starting point of the algorithm.
      Definition: random_pivot_quick_sort.cpp:130
      T size(T... args)
      Here is the call graph for this function:
      @@ -669,7 +668,7 @@ Here is the call graph for this function:
      - +

      ◆ testCase_2() [1/3]

      @@ -694,47 +693,47 @@ Here is the call graph for this function:

      A test case which contains main list of 100 elements and sublist of 20.

      Returns
      void
      -

      < Expected output of this test

      -

      < Data to make nodes in BST

      -

      < Adding nodes to BST

      -

      < Printing inorder to cross-verify.

      -

      < The inorder successor node for given data

      -

      memory cleanup!

      -
      304  {
      -
      305  const int expectedOutput = 21; ///< Expected output of this test
      -
      306 
      -
      307  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      -
      308  log("This is test case 2 : ");
      -
      309 
      - -
      311  nullptr;
      -
      312  std::vector<int64_t> node_data{
      -
      313  20, 3, 5, 6, 2, 23, 45, 78, 21}; ///< Data to make nodes in BST
      -
      314 
      - -
      316  root,
      -
      317  node_data); ///< Adding nodes to BST
      -
      318 
      -
      319  std::cout << "Inorder sequence is : ";
      - -
      321  root); ///< Printing inorder to cross-verify.
      -
      322  std::cout << std::endl;
      -
      323 
      - -
      325  *inorderSuccessor = operations_on_datastructures::
      -
      326  inorder_traversal_of_bst::getInorderSuccessor(
      -
      327  root, 20); ///< The inorder successor node for given data
      -
      328 
      -
      329  log("Checking assert expression...");
      -
      330  assert(inorderSuccessor->data == expectedOutput);
      -
      331  log("Assertion check passed!");
      -
      332 
      - -
      334  root); /// memory cleanup!
      -
      335 
      -
      336  log("[PASS] : TEST CASE 2 PASS!");
      -
      337  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      -
      338  }
      +

      < Expected output of this test

      +

      < Data to make nodes in BST

      +

      < Adding nodes to BST

      +

      < Printing inorder to cross-verify.

      +

      < The inorder successor node for given data

      +

      memory cleanup!

      +
      304 {
      +
      305 const int expectedOutput = 21; ///< Expected output of this test
      +
      306
      +
      307 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      +
      308 log("This is test case 2 : ");
      +
      309
      + +
      311 nullptr;
      +
      312 std::vector<int64_t> node_data{
      +
      313 20, 3, 5, 6, 2, 23, 45, 78, 21}; ///< Data to make nodes in BST
      +
      314
      + +
      316 root,
      +
      317 node_data); ///< Adding nodes to BST
      +
      318
      +
      319 std::cout << "Inorder sequence is : ";
      + +
      321 root); ///< Printing inorder to cross-verify.
      + +
      323
      + +
      325 *inorderSuccessor = operations_on_datastructures::
      +
      326 inorder_traversal_of_bst::getInorderSuccessor(
      +
      327 root, 20); ///< The inorder successor node for given data
      +
      328
      +
      329 log("Checking assert expression...");
      +
      330 assert(inorderSuccessor->data == expectedOutput);
      +
      331 log("Assertion check passed!");
      +
      332
      + +
      334 root); /// memory cleanup!
      +
      335
      +
      336 log("[PASS] : TEST CASE 2 PASS!");
      +
      337 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      +
      338 }
      int64_t data
      The key/value of the node.
      Definition: inorder_successor_of_bst.cpp:58
      Here is the call graph for this function:
      @@ -745,7 +744,7 @@ Here is the call graph for this function:
      - +

      ◆ testCase_2() [2/3]

      @@ -770,59 +769,59 @@ Here is the call graph for this function:

      A test case which contains main list of 100 elements and sublist of 20.

      Returns
      void
      -

      Expected output of this test

      -

      < Data to make linked list which will be the sublist

      -

      < Main list in which sublist is to be searched

      -

      Inserts 100 elements in main list

      -

      Inserts 20 elements in sublist

      -

      < Sublist to be searched

      -

      < Main list in which sublist is to be searched

      -

      < boolean, if sublist exist or not

      -
      229  {
      -
      230  const bool expectedOutput = true; /// Expected output of this test
      -
      231 
      -
      232  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      233  "~");
      -
      234  log("This is test case 2 for sublist search Algorithm : ");
      -
      235  log("Description:");
      -
      236  log(" contains main list of 100 elements and sublist of 20");
      -
      237 
      -
      238  std::vector<uint64_t> sublistData(
      -
      239  20); ///< Data to make linked list which will be the sublist
      -
      240  std::vector<uint64_t> mainlistData(
      -
      241  100); ///< Main list in which sublist is to be searched
      -
      242 
      -
      243  for (int i = 0; i < 100; i++) {
      -
      244  /// Inserts 100 elements in main list
      -
      245  mainlistData[i] = i + 1;
      -
      246  }
      -
      247 
      -
      248  int temp = 0;
      -
      249  for (int i = 45; i < 65; i++) {
      -
      250  /// Inserts 20 elements in sublist
      -
      251  sublistData[temp] = i + 1;
      -
      252  temp++;
      -
      253  }
      -
      254 
      -
      255  search::sublist_search::Node *sublistLL =
      - -
      257  sublistData); ///< Sublist to be searched
      -
      258  search::sublist_search::Node *mainlistLL =
      - -
      260  mainlistData); ///< Main list in which sublist is to be
      -
      261  ///< searched
      -
      262 
      - -
      264  sublistLL, mainlistLL); ///< boolean, if sublist exist or not
      -
      265 
      -
      266  log("Checking assert expression...");
      -
      267  assert(exists == expectedOutput);
      -
      268  log("Assertion check passed!");
      -
      269 
      -
      270  log("[PASS] : TEST CASE 2 PASS!");
      -
      271  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      272  "~");
      -
      273  }
      +

      Expected output of this test

      +

      < Data to make linked list which will be the sublist

      +

      < Main list in which sublist is to be searched

      +

      Inserts 100 elements in main list

      +

      Inserts 20 elements in sublist

      +

      < Sublist to be searched

      +

      < Main list in which sublist is to be searched

      +

      < boolean, if sublist exist or not

      +
      229 {
      +
      230 const bool expectedOutput = true; /// Expected output of this test
      +
      231
      +
      232 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      233 "~");
      +
      234 log("This is test case 2 for sublist search Algorithm : ");
      +
      235 log("Description:");
      +
      236 log(" contains main list of 100 elements and sublist of 20");
      +
      237
      +
      238 std::vector<uint64_t> sublistData(
      +
      239 20); ///< Data to make linked list which will be the sublist
      +
      240 std::vector<uint64_t> mainlistData(
      +
      241 100); ///< Main list in which sublist is to be searched
      +
      242
      +
      243 for (int i = 0; i < 100; i++) {
      +
      244 /// Inserts 100 elements in main list
      +
      245 mainlistData[i] = i + 1;
      +
      246 }
      +
      247
      +
      248 int temp = 0;
      +
      249 for (int i = 45; i < 65; i++) {
      +
      250 /// Inserts 20 elements in sublist
      +
      251 sublistData[temp] = i + 1;
      +
      252 temp++;
      +
      253 }
      +
      254
      + + +
      257 sublistData); ///< Sublist to be searched
      +
      258 search::sublist_search::Node *mainlistLL =
      + +
      260 mainlistData); ///< Main list in which sublist is to be
      +
      261 ///< searched
      +
      262
      + +
      264 sublistLL, mainlistLL); ///< boolean, if sublist exist or not
      +
      265
      +
      266 log("Checking assert expression...");
      +
      267 assert(exists == expectedOutput);
      +
      268 log("Assertion check passed!");
      +
      269
      +
      270 log("[PASS] : TEST CASE 2 PASS!");
      +
      271 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      272 "~");
      +
      273 }
      Here is the call graph for this function:
      @@ -832,7 +831,7 @@ Here is the call graph for this function:
      - +

      ◆ testCase_2() [3/3]

      @@ -857,34 +856,34 @@ Here is the call graph for this function:

      A test case with input array of length 500.

      Returns
      void
      -
      245  {
      -
      246  const int64_t inputSize = 500;
      -
      247  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      248  "~");
      -
      249  log("Description:");
      -
      250  log(" BIG INPUT : Contains 500 elements and repeated elements");
      -
      251  log("This is test case 2 for Random Pivot Quick Sort Algorithm : ");
      -
      252  std::array<int64_t, inputSize> unsorted_arr =
      -
      253  sorting::random_pivot_quick_sort::generateUnsortedArray<inputSize>(
      -
      254  1, 10000);
      -
      255 
      -
      256  int64_t start = 0;
      -
      257  int64_t end = unsorted_arr.size() - 1; // length - 1
      -
      258 
      -
      259  log("Running algorithm of data of length 500 ...");
      -
      260  std::array<int64_t, unsorted_arr.size()> sorted_arr =
      - -
      262  end);
      -
      263  log("Algorithm finished!");
      -
      264 
      -
      265  log("Checking assert expression...");
      -
      266  assert(std::is_sorted(sorted_arr.begin(), sorted_arr.end()));
      -
      267  log("Assertion check passed!");
      -
      268 
      -
      269  log("[PASS] : TEST CASE 2 PASS!");
      -
      270  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      271  "~");
      -
      272  }
      +
      245 {
      +
      246 const int64_t inputSize = 500;
      +
      247 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      248 "~");
      +
      249 log("Description:");
      +
      250 log(" BIG INPUT : Contains 500 elements and repeated elements");
      +
      251 log("This is test case 2 for Random Pivot Quick Sort Algorithm : ");
      +
      252 std::array<int64_t, inputSize> unsorted_arr =
      +
      253 sorting::random_pivot_quick_sort::generateUnsortedArray<inputSize>(
      +
      254 1, 10000);
      +
      255
      +
      256 int64_t start = 0;
      +
      257 int64_t end = unsorted_arr.size() - 1; // length - 1
      +
      258
      +
      259 log("Running algorithm of data of length 500 ...");
      +
      260 std::array<int64_t, unsorted_arr.size()> sorted_arr =
      + +
      262 end);
      +
      263 log("Algorithm finished!");
      +
      264
      +
      265 log("Checking assert expression...");
      +
      266 assert(std::is_sorted(sorted_arr.begin(), sorted_arr.end()));
      +
      267 log("Assertion check passed!");
      +
      268
      +
      269 log("[PASS] : TEST CASE 2 PASS!");
      +
      270 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      271 "~");
      +
      272 }
      Here is the call graph for this function:
      @@ -894,7 +893,7 @@ Here is the call graph for this function:
      - +

      ◆ testCase_3() [1/3]

      @@ -919,48 +918,48 @@ Here is the call graph for this function:

      A test case which contains main list of 50 elements and sublist of 20.

      Returns
      void
      -

      < Expected output of this test

      -

      < Data to make nodes in BST

      -

      < Adding nodes to BST

      -

      < Printing inorder to cross-verify.

      -

      < The inorder successor node for given data

      -

      memory cleanup!

      -
      345  {
      -
      346  const int expectedOutput = 110; ///< Expected output of this test
      -
      347 
      -
      348  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      -
      349  log("This is test case 3 : ");
      -
      350 
      - -
      352  nullptr;
      -
      353  std::vector<int64_t> node_data{
      -
      354  89, 67, 32, 56, 90, 123, 120,
      -
      355  110, 115, 6, 78, 7, 10}; ///< Data to make nodes in BST
      -
      356 
      - -
      358  root,
      -
      359  node_data); ///< Adding nodes to BST
      -
      360 
      -
      361  std::cout << "Inorder sequence is : ";
      - -
      363  root); ///< Printing inorder to cross-verify.
      -
      364  std::cout << std::endl;
      -
      365 
      - -
      367  *inorderSuccessor = operations_on_datastructures::
      -
      368  inorder_traversal_of_bst::getInorderSuccessor(
      -
      369  root, 90); ///< The inorder successor node for given data
      -
      370 
      -
      371  log("Checking assert expression...");
      -
      372  assert(inorderSuccessor->data == expectedOutput);
      -
      373  log("Assertion check passed!");
      -
      374 
      - -
      376  root); /// memory cleanup!
      -
      377 
      -
      378  log("[PASS] : TEST CASE 3 PASS!");
      -
      379  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      -
      380  }
      +

      < Expected output of this test

      +

      < Data to make nodes in BST

      +

      < Adding nodes to BST

      +

      < Printing inorder to cross-verify.

      +

      < The inorder successor node for given data

      +

      memory cleanup!

      +
      345 {
      +
      346 const int expectedOutput = 110; ///< Expected output of this test
      +
      347
      +
      348 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      +
      349 log("This is test case 3 : ");
      +
      350
      + +
      352 nullptr;
      +
      353 std::vector<int64_t> node_data{
      +
      354 89, 67, 32, 56, 90, 123, 120,
      +
      355 110, 115, 6, 78, 7, 10}; ///< Data to make nodes in BST
      +
      356
      + +
      358 root,
      +
      359 node_data); ///< Adding nodes to BST
      +
      360
      +
      361 std::cout << "Inorder sequence is : ";
      + +
      363 root); ///< Printing inorder to cross-verify.
      + +
      365
      + +
      367 *inorderSuccessor = operations_on_datastructures::
      +
      368 inorder_traversal_of_bst::getInorderSuccessor(
      +
      369 root, 90); ///< The inorder successor node for given data
      +
      370
      +
      371 log("Checking assert expression...");
      +
      372 assert(inorderSuccessor->data == expectedOutput);
      +
      373 log("Assertion check passed!");
      +
      374
      + +
      376 root); /// memory cleanup!
      +
      377
      +
      378 log("[PASS] : TEST CASE 3 PASS!");
      +
      379 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
      +
      380 }
      Here is the call graph for this function:
      @@ -970,7 +969,7 @@ Here is the call graph for this function:
      - +

      ◆ testCase_3() [2/3]

      @@ -995,56 +994,56 @@ Here is the call graph for this function:

      A test case which contains main list of 50 elements and sublist of 20.

      Returns
      void
      -

      < Expected output of this test

      -

      < Sublist to be searched

      -

      < Main list in which sublist is to be searched

      -

      Inserts 100 elements in main list

      -

      Inserts 20 elements in sublist

      -

      < Sublist to be searched

      -

      < Main list in which sublist is to be searched

      -

      < boolean, if sublist exist or not

      -
      280  {
      -
      281  const bool expectedOutput = false; ///< Expected output of this test
      -
      282 
      -
      283  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      284  "~");
      -
      285  log("This is test case 3 for sublist search Algorithm : ");
      -
      286  log("Description:");
      -
      287  log(" contains main list of 50 elements and sublist of 20");
      -
      288 
      -
      289  std::vector<uint64_t> sublistData(20); ///< Sublist to be searched
      -
      290  std::vector<uint64_t> mainlistData(
      -
      291  50); ///< Main list in which sublist is to be searched
      -
      292 
      -
      293  for (int i = 0; i < 50; i++) {
      -
      294  /// Inserts 100 elements in main list
      -
      295  mainlistData.push_back(i + 1);
      -
      296  }
      -
      297 
      -
      298  for (int i = 45; i < 65; i++) {
      -
      299  /// Inserts 20 elements in sublist
      -
      300  sublistData.push_back(i + 1);
      -
      301  }
      -
      302 
      -
      303  search::sublist_search::Node *sublistLL =
      - -
      305  sublistData); ///< Sublist to be searched
      -
      306  search::sublist_search::Node *mainlistLL =
      - -
      308  mainlistData); ///< Main list in which sublist is to be
      -
      309  ///< searched
      -
      310 
      - -
      312  sublistLL, mainlistLL); ///< boolean, if sublist exist or not
      -
      313 
      -
      314  log("Checking assert expression...");
      -
      315  assert(exists == expectedOutput);
      -
      316  log("Assertion check passed!");
      -
      317 
      -
      318  log("[PASS] : TEST CASE 3 PASS!");
      -
      319  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      320  "~");
      -
      321  }
      +

      < Expected output of this test

      +

      < Sublist to be searched

      +

      < Main list in which sublist is to be searched

      +

      Inserts 100 elements in main list

      +

      Inserts 20 elements in sublist

      +

      < Sublist to be searched

      +

      < Main list in which sublist is to be searched

      +

      < boolean, if sublist exist or not

      +
      280 {
      +
      281 const bool expectedOutput = false; ///< Expected output of this test
      +
      282
      +
      283 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      284 "~");
      +
      285 log("This is test case 3 for sublist search Algorithm : ");
      +
      286 log("Description:");
      +
      287 log(" contains main list of 50 elements and sublist of 20");
      +
      288
      +
      289 std::vector<uint64_t> sublistData(20); ///< Sublist to be searched
      +
      290 std::vector<uint64_t> mainlistData(
      +
      291 50); ///< Main list in which sublist is to be searched
      +
      292
      +
      293 for (int i = 0; i < 50; i++) {
      +
      294 /// Inserts 100 elements in main list
      +
      295 mainlistData.push_back(i + 1);
      +
      296 }
      +
      297
      +
      298 for (int i = 45; i < 65; i++) {
      +
      299 /// Inserts 20 elements in sublist
      +
      300 sublistData.push_back(i + 1);
      +
      301 }
      +
      302
      + + +
      305 sublistData); ///< Sublist to be searched
      +
      306 search::sublist_search::Node *mainlistLL =
      + +
      308 mainlistData); ///< Main list in which sublist is to be
      +
      309 ///< searched
      +
      310
      + +
      312 sublistLL, mainlistLL); ///< boolean, if sublist exist or not
      +
      313
      +
      314 log("Checking assert expression...");
      +
      315 assert(exists == expectedOutput);
      +
      316 log("Assertion check passed!");
      +
      317
      +
      318 log("[PASS] : TEST CASE 3 PASS!");
      +
      319 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      320 "~");
      +
      321 }
      Here is the call graph for this function:
      @@ -1054,7 +1053,7 @@ Here is the call graph for this function:
      - +

      ◆ testCase_3() [3/3]

      @@ -1079,34 +1078,34 @@ Here is the call graph for this function:

      A test case with array of length 1000.

      Returns
      void
      -
      278  {
      -
      279  const int64_t inputSize = 1000;
      -
      280  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      281  "~");
      -
      282  log("This is test case 3 for Random Pivot Quick Sort Algorithm : ");
      -
      283  log("Description:");
      -
      284  log(" LARGE INPUT : Contains 1000 elements and repeated elements");
      -
      285  std::array<int64_t, inputSize> unsorted_arr =
      -
      286  sorting::random_pivot_quick_sort::generateUnsortedArray<inputSize>(
      -
      287  1, 10000);
      -
      288 
      -
      289  int64_t start = 0;
      -
      290  int64_t end = unsorted_arr.size() - 1; // length - 1
      -
      291 
      -
      292  log("Running algorithm...");
      -
      293  std::array<int64_t, unsorted_arr.size()> sorted_arr =
      - -
      295  end);
      -
      296  log("Algorithm finished!");
      -
      297 
      -
      298  log("Checking assert expression...");
      -
      299  assert(std::is_sorted(sorted_arr.begin(), sorted_arr.end()));
      -
      300  log("Assertion check passed!");
      -
      301 
      -
      302  log("[PASS] : TEST CASE 3 PASS!");
      -
      303  log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      -
      304  "~");
      -
      305  }
      +
      278 {
      +
      279 const int64_t inputSize = 1000;
      +
      280 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      281 "~");
      +
      282 log("This is test case 3 for Random Pivot Quick Sort Algorithm : ");
      +
      283 log("Description:");
      +
      284 log(" LARGE INPUT : Contains 1000 elements and repeated elements");
      +
      285 std::array<int64_t, inputSize> unsorted_arr =
      +
      286 sorting::random_pivot_quick_sort::generateUnsortedArray<inputSize>(
      +
      287 1, 10000);
      +
      288
      +
      289 int64_t start = 0;
      +
      290 int64_t end = unsorted_arr.size() - 1; // length - 1
      +
      291
      +
      292 log("Running algorithm...");
      +
      293 std::array<int64_t, unsorted_arr.size()> sorted_arr =
      + +
      295 end);
      +
      296 log("Algorithm finished!");
      +
      297
      +
      298 log("Checking assert expression...");
      +
      299 assert(std::is_sorted(sorted_arr.begin(), sorted_arr.end()));
      +
      300 log("Assertion check passed!");
      +
      301
      +
      302 log("[PASS] : TEST CASE 3 PASS!");
      +
      303 log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      +
      304 "~");
      +
      305 }
      Here is the call graph for this function:
      @@ -1127,7 +1126,7 @@ Here is the call graph for this function:
      diff --git a/d5/d58/class_test_cases_aa3aa3d5bf666f327ee8e2d11d397b06e_cgraph.svg b/d5/d58/class_test_cases_aa3aa3d5bf666f327ee8e2d11d397b06e_cgraph.svg index b2bd8adb8..1937c2546 100644 --- a/d5/d58/class_test_cases_aa3aa3d5bf666f327ee8e2d11d397b06e_cgraph.svg +++ b/d5/d58/class_test_cases_aa3aa3d5bf666f327ee8e2d11d397b06e_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - + + Algorithms_in_C++: range_queries/persistent_seg_tree_lazy_prop.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__pr Classes | Namespaces | Functions -
      -
      persistent_seg_tree_lazy_prop.cpp File Reference
      +
      persistent_seg_tree_lazy_prop.cpp File Reference
      -

      Persistent segment tree with range updates (lazy propagation) +

      Persistent segment tree with range updates (lazy propagation) More...

      #include <iostream>
      #include <memory>
      @@ -111,7 +110,7 @@ Include dependency graph for persistent_seg_tree_lazy_prop.cpp:
      - @@ -119,13 +118,13 @@ Classes

      +

      Classes

      class  range_queries::perSegTree
       Range query here is range sum, but the code can be modified to make different queries like range max or min. More...
      class  range_queries::perSegTree::Node
       
      - - +

      +

      Namespaces

       range_queries
      namespace  range_queries
       Algorithms and Data Structures that support range queries and updates.
       
      - @@ -135,11 +134,11 @@ Functions

      +

      Functions

      static void test ()
       Test implementations. More...
       

      Detailed Description

      -

      Persistent segment tree with range updates (lazy propagation)

      -

      A normal segment tree facilitates making point updates and range queries in logarithmic time. Lazy propagation preserves the logarithmic time with range updates. So, a segment tree with lazy propagation enables doing range updates and range queries in logarithmic time, but it doesn't save any information about itself before the last update. A persistent data structure always preserves the previous version of itself when it is modified. That is, a new version of the segment tree is generated after every update. It saves all previous versions of itself (before every update) to facilitate doing range queries in any version. More memory is used ,but the logarithmic time is preserved because the new version points to the same nodes, that the previous version points to, that are not affected by the update. That is, only the nodes that are affected by the update and their ancestors are copied. The rest is copied using lazy propagation in the next queries. Thus preserving the logarithmic time because the number of nodes copied after any update is logarithmic.

      -
      Author
      Magdy Sedra
      +

      Persistent segment tree with range updates (lazy propagation)

      +

      A normal segment tree facilitates making point updates and range queries in logarithmic time. Lazy propagation preserves the logarithmic time with range updates. So, a segment tree with lazy propagation enables doing range updates and range queries in logarithmic time, but it doesn't save any information about itself before the last update. A persistent data structure always preserves the previous version of itself when it is modified. That is, a new version of the segment tree is generated after every update. It saves all previous versions of itself (before every update) to facilitate doing range queries in any version. More memory is used ,but the logarithmic time is preserved because the new version points to the same nodes, that the previous version points to, that are not affected by the update. That is, only the nodes that are affected by the update and their ancestors are copied. The rest is copied using lazy propagation in the next queries. Thus preserving the logarithmic time because the number of nodes copied after any update is logarithmic.

      +
      Author
      Magdy Sedra

      Function Documentation

      - +

      ◆ main()

      @@ -157,21 +156,21 @@ Functions

      Main function.

      Returns
      0 on exit
      -
      318  {
      -
      319  test(); // run self-test implementations
      -
      320  return 0;
      -
      321 }
      +
      318 {
      +
      319 test(); // run self-test implementations
      +
      320 return 0;
      +
      321}
      static void test()
      Test implementations.
      Definition: persistent_seg_tree_lazy_prop.cpp:268
      Here is the call graph for this function:
      -
      +
      - +

      ◆ test()

      @@ -196,63 +195,63 @@ Here is the call graph for this function:

      Test implementations.

      Returns
      void
      -
      268  {
      -
      269  std::vector<int64_t> arr = {-5, 2, 3, 11, -2, 7, 0, 1};
      - -
      271  std::cout << "Elements before any updates are {";
      -
      272  for (uint32_t i = 0; i < arr.size(); ++i) {
      -
      273  std::cout << arr[i];
      -
      274  if (i != arr.size() - 1) {
      -
      275  std::cout << ",";
      -
      276  }
      -
      277  }
      -
      278  std::cout << "}\n";
      -
      279  tree.construct(
      -
      280  arr); // constructing the original segment tree (version = 0)
      -
      281  std::cout << "Querying range sum on version 0 from index 2 to 4 = 3+11-2 = "
      -
      282  << tree.query(2, 4, 0) << '\n';
      -
      283  std::cout
      -
      284  << "Subtract 7 from all elements from index 1 to index 5 inclusive\n";
      -
      285  tree.update(1, 5, -7); // subtracting 7 from index 1 to index 5
      -
      286  std::cout << "Elements of the segment tree whose version = 1 (after 1 "
      -
      287  "update) are {";
      -
      288  for (uint32_t i = 0; i < arr.size(); ++i) {
      -
      289  std::cout << tree.query(i, i, 1);
      -
      290  if (i != arr.size() - 1) {
      -
      291  std::cout << ",";
      -
      292  }
      -
      293  }
      -
      294  std::cout << "}\n";
      -
      295  std::cout << "Add 10 to all elements from index 0 to index 7 inclusive\n";
      -
      296  tree.update(0, 7, 10); // adding 10 to all elements
      -
      297  std::cout << "Elements of the segment tree whose version = 2 (after 2 "
      -
      298  "updates) are {";
      -
      299  for (uint32_t i = 0; i < arr.size(); ++i) {
      -
      300  std::cout << tree.query(i, i, 2);
      -
      301  if (i != arr.size() - 1) {
      -
      302  std::cout << ",";
      -
      303  }
      -
      304  }
      -
      305  std::cout << "}\n";
      -
      306  std::cout << "Number of segment trees (versions) now = " << tree.size()
      -
      307  << '\n';
      -
      308  std::cout << "Querying range sum on version 0 from index 3 to 5 = 11-2+7 = "
      -
      309  << tree.query(3, 5, 0) << '\n';
      -
      310  std::cout << "Querying range sum on version 1 from index 3 to 5 = 4-9+0 = "
      -
      311  << tree.query(3, 5, 1) << '\n';
      -
      312 }
      +
      268 {
      +
      269 std::vector<int64_t> arr = {-5, 2, 3, 11, -2, 7, 0, 1};
      + +
      271 std::cout << "Elements before any updates are {";
      +
      272 for (uint32_t i = 0; i < arr.size(); ++i) {
      +
      273 std::cout << arr[i];
      +
      274 if (i != arr.size() - 1) {
      +
      275 std::cout << ",";
      +
      276 }
      +
      277 }
      +
      278 std::cout << "}\n";
      +
      279 tree.construct(
      +
      280 arr); // constructing the original segment tree (version = 0)
      +
      281 std::cout << "Querying range sum on version 0 from index 2 to 4 = 3+11-2 = "
      +
      282 << tree.query(2, 4, 0) << '\n';
      + +
      284 << "Subtract 7 from all elements from index 1 to index 5 inclusive\n";
      +
      285 tree.update(1, 5, -7); // subtracting 7 from index 1 to index 5
      +
      286 std::cout << "Elements of the segment tree whose version = 1 (after 1 "
      +
      287 "update) are {";
      +
      288 for (uint32_t i = 0; i < arr.size(); ++i) {
      +
      289 std::cout << tree.query(i, i, 1);
      +
      290 if (i != arr.size() - 1) {
      +
      291 std::cout << ",";
      +
      292 }
      +
      293 }
      +
      294 std::cout << "}\n";
      +
      295 std::cout << "Add 10 to all elements from index 0 to index 7 inclusive\n";
      +
      296 tree.update(0, 7, 10); // adding 10 to all elements
      +
      297 std::cout << "Elements of the segment tree whose version = 2 (after 2 "
      +
      298 "updates) are {";
      +
      299 for (uint32_t i = 0; i < arr.size(); ++i) {
      +
      300 std::cout << tree.query(i, i, 2);
      +
      301 if (i != arr.size() - 1) {
      +
      302 std::cout << ",";
      +
      303 }
      +
      304 }
      +
      305 std::cout << "}\n";
      +
      306 std::cout << "Number of segment trees (versions) now = " << tree.size()
      +
      307 << '\n';
      +
      308 std::cout << "Querying range sum on version 0 from index 3 to 5 = 11-2+7 = "
      +
      309 << tree.query(3, 5, 0) << '\n';
      +
      310 std::cout << "Querying range sum on version 1 from index 3 to 5 = 4-9+0 = "
      +
      311 << tree.query(3, 5, 1) << '\n';
      +
      312}
      Range query here is range sum, but the code can be modified to make different queries like range max ...
      Definition: persistent_seg_tree_lazy_prop.cpp:39
      uint32_t size()
      Getting the number of versions after updates so far which is equal to the size of the pointers vector...
      Definition: persistent_seg_tree_lazy_prop.cpp:255
      -
      std::shared_ptr< Node > construct(const uint32_t &i, const uint32_t &j)
      Constructing the segment tree with the early passed vector. Every call creates a node to hold the sum...
      Definition: persistent_seg_tree_lazy_prop.cpp:106
      +
      std::shared_ptr< Node > update(const uint32_t &i, const uint32_t &j, const uint32_t &l, const uint32_t &r, const int64_t &value, std::shared_ptr< Node > const &curr)
      Doing range update, checking at every node if it has some value to be propagated. All nodes affected ...
      Definition: persistent_seg_tree_lazy_prop.cpp:135
      +
      std::shared_ptr< Node > construct(const uint32_t &i, const uint32_t &j)
      Constructing the segment tree with the early passed vector. Every call creates a node to hold the sum...
      Definition: persistent_seg_tree_lazy_prop.cpp:106
      int64_t query(const uint32_t &i, const uint32_t &j, const uint32_t &l, const uint32_t &r, std::shared_ptr< Node > const &curr)
      Querying the range from index l to index r, checking at every node if it has some value to be propaga...
      Definition: persistent_seg_tree_lazy_prop.cpp:171
      -
      std::shared_ptr< Node > update(const uint32_t &i, const uint32_t &j, const uint32_t &l, const uint32_t &r, const int64_t &value, std::shared_ptr< Node > const &curr)
      Doing range update, checking at every node if it has some value to be propagated. All nodes affected ...
      Definition: persistent_seg_tree_lazy_prop.cpp:135
      T size(T... args)
      - +
      Here is the call graph for this function:
      -
      +
      @@ -264,7 +263,7 @@ Here is the call graph for this function:
      diff --git a/d5/d58/persistent__seg__tree__lazy__prop_8cpp.js b/d5/d58/persistent__seg__tree__lazy__prop_8cpp.js index e09619b80..673eda8d0 100644 --- a/d5/d58/persistent__seg__tree__lazy__prop_8cpp.js +++ b/d5/d58/persistent__seg__tree__lazy__prop_8cpp.js @@ -1,7 +1,7 @@ var persistent__seg__tree__lazy__prop_8cpp = [ - [ "perSegTree", "d8/d28/classrange__queries_1_1per_seg_tree.html", "d8/d28/classrange__queries_1_1per_seg_tree" ], - [ "Node", "d5/d66/classrange__queries_1_1per_seg_tree_1_1_node.html", "d5/d66/classrange__queries_1_1per_seg_tree_1_1_node" ], + [ "range_queries::perSegTree", "d8/d28/classrange__queries_1_1per_seg_tree.html", "d8/d28/classrange__queries_1_1per_seg_tree" ], + [ "range_queries::perSegTree::Node", "d5/d66/classrange__queries_1_1per_seg_tree_1_1_node.html", "d5/d66/classrange__queries_1_1per_seg_tree_1_1_node" ], [ "main", "d5/d58/persistent__seg__tree__lazy__prop_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "test", "d5/d58/persistent__seg__tree__lazy__prop_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index 8f260b912..f8f99e35c 100644 --- a/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -1,10 +1,10 @@ - - - - - - - - + + + + + + + + diff --git a/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index 5e3780ff8..77035f3e7 100644 --- a/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -ec856ef8be7199a44c3ec6193965f4dc \ No newline at end of file +853d97163e3d210d69c130ead5f4b73f \ No newline at end of file diff --git a/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 883331e92..01a641c09 100644 --- a/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d5/d58/persistent__seg__tree__lazy__prop_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,10 +1,10 @@ - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -range_queries::perSegTree - - - -Node1 - - -range_queries::perSegTree - - - - - -Node2 - - -std::vector< std::shared -_ptr< range_queries::perSegTree -::Node > > - - - - - -Node2->Node1 - - - ptrs - - - -Node3 - - -std::shared_ptr< range -_queries::perSegTree:: -Node > - - - - - -Node3->Node2 - - - elements - - - -Node4 - - -std::vector< int64_t > - - - - - -Node4->Node1 - - - vec - - - -Node5 - - -std::int64_t - - - - - -Node5->Node4 - - - elements - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/d6/d47/classrange__queries_1_1per_seg_tree__coll__graph_org.svg b/d6/d47/classrange__queries_1_1per_seg_tree__coll__graph_org.svg deleted file mode 100644 index 6f1413767..000000000 --- a/d6/d47/classrange__queries_1_1per_seg_tree__coll__graph_org.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - -range_queries::perSegTree - - - -Node1 - - -range_queries::perSegTree - - - - - -Node2 - - -std::vector< std::shared -_ptr< range_queries::perSegTree -::Node > > - - - - - -Node2->Node1 - - - ptrs - - - -Node3 - - -std::shared_ptr< range -_queries::perSegTree:: -Node > - - - - - -Node3->Node2 - - - elements - - - -Node4 - - -std::vector< int64_t > - - - - - -Node4->Node1 - - - vec - - - -Node5 - - -std::int64_t - - - - - -Node5->Node4 - - - elements - - - diff --git a/d6/d4a/addition__rule_8cpp.html b/d6/d4a/addition__rule_8cpp.html index faafb8ae8..38adba04f 100644 --- a/d6/d4a/addition__rule_8cpp.html +++ b/d6/d4a/addition__rule_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: probability/addition_rule.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d6/d4a/addition__rule_8cpp.html','../.
      -
      -
      addition_rule.cpp File Reference
      +
      addition_rule.cpp File Reference
      @@ -107,7 +106,7 @@ Include dependency graph for addition_rule.cpp:
      - @@ -117,9 +116,9 @@ Functions

      +

      Functions

      double addition_rule_independent (double A, double B)
       
       

      Detailed Description

      -

      Addition rule of probabilities.

      +

      Addition rule of probabilities.

      Function Documentation

      - +

      ◆ addition_rule_dependent()

      @@ -150,14 +149,14 @@ Functions
      -

      Calculates the probability of the events A or B for dependent events note that if value of B_given_A is unknown, use chainrule to find it \parama [in] A probability of event A \parama [in] B probability of event B \parama [in] B_given_A probability of event B condition A

      Returns
      probability of A and B
      -
      25  {
      -
      26  return (A + B) - (A * B_given_A);
      -
      27 }
      +

      Calculates the probability of the events A or B for dependent events note that if value of B_given_A is unknown, use chainrule to find it \parama [in] A probability of event A \parama [in] B probability of event B \parama [in] B_given_A probability of event B condition A

      Returns
      probability of A and B
      +
      25 {
      +
      26 return (A + B) - (A * B_given_A);
      +
      27}
      - +

      ◆ addition_rule_independent()

      @@ -182,14 +181,14 @@ Functions
      -

      calculates the probability of the independent events A or B for independent events \parama [in] A probability of event A \parama [in] B probability of event B

      Returns
      probability of A and B
      -
      14  {
      -
      15  return (A + B) - (A * B);
      -
      16 }
      +

      calculates the probability of the independent events A or B for independent events \parama [in] A probability of event A \parama [in] B probability of event B

      Returns
      probability of A and B
      +
      14 {
      +
      15 return (A + B) - (A * B);
      +
      16}
      - +

      ◆ main()

      @@ -204,20 +203,20 @@ Functions
      -

      Main function

      -
      30  {
      -
      31  double A = 0.5;
      -
      32  double B = 0.25;
      -
      33  double B_given_A = 0.05;
      -
      34 
      -
      35  std::cout << "independent P(A or B) = " << addition_rule_independent(A, B)
      -
      36  << std::endl;
      -
      37 
      -
      38  std::cout << "dependent P(A or B) = "
      -
      39  << addition_rule_dependent(A, B, B_given_A) << std::endl;
      -
      40 
      -
      41  return 0;
      -
      42 }
      +

      Main function

      +
      30 {
      +
      31 double A = 0.5;
      +
      32 double B = 0.25;
      +
      33 double B_given_A = 0.05;
      +
      34
      +
      35 std::cout << "independent P(A or B) = " << addition_rule_independent(A, B)
      +
      36 << std::endl;
      +
      37
      +
      38 std::cout << "dependent P(A or B) = "
      +
      39 << addition_rule_dependent(A, B, B_given_A) << std::endl;
      +
      40
      +
      41 return 0;
      +
      42}
      double addition_rule_independent(double A, double B)
      Definition: addition_rule.cpp:14
      double addition_rule_dependent(double A, double B, double B_given_A)
      Definition: addition_rule.cpp:25
      @@ -237,7 +236,7 @@ Here is the call graph for this function:
      diff --git a/d6/d4a/addition__rule_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d6/d4a/addition__rule_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 1786f3bee..206415edc 100644 --- a/d6/d4a/addition__rule_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d6/d4a/addition__rule_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: ciphers Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -94,41 +94,40 @@ $(document).ready(function(){initNavTree('d6/d4e/namespaceciphers.html','../../' Namespaces | Classes | Variables
      -
      -
      ciphers Namespace Reference
      +
      ciphers Namespace Reference
      -

      Base64 Encoding and Decoding +

      Base64 Encoding and Decoding More...

      - - +

      +

      Namespaces

       elliptic_curve_key_exchange
      namespace  elliptic_curve_key_exchange
       namespace elliptic_curve_key_exchange
       
      - - +

      +

      Classes

      class  HillCipher
       Implementation of Hill Cipher algorithm. More...
       Implementation of Hill Cipher algorithm. More...
       
      -

      +

      Variables

      static const char * STRKEY
       

      Detailed Description

      -

      Base64 Encoding and Decoding

      -

      for IO operations

      -

      Algorithms for encryption and decryption.

      -

      In programming, Base64 is a group of binary-to-text encoding schemes that represent binary data (more specifically, a sequence of 8-bit bytes) in an ASCII string format by translating the data into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding. Each non-final Base64 digit represents exactly 6 bits of data. Three 8-bit bytes (i.e., a total of 24 bits) can therefore be represented by four 6-bit Base64 digits.

      Author
      Ashish Daulatabad for std::array for assert operations for IO operations
      +

      Base64 Encoding and Decoding

      +

      for IO operations

      +

      Algorithms for encryption and decryption.

      +

      In programming, Base64 is a group of binary-to-text encoding schemes that represent binary data (more specifically, a sequence of 8-bit bytes) in an ASCII string format by translating the data into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding. Each non-final Base64 digit represents exactly 6 bits of data. Three 8-bit bytes (i.e., a total of 24 bits) can therefore be represented by four 6-bit Base64 digits.

      Author
      Ashish Daulatabad for std::array for assert operations for IO operations

      Cipher algorithms

      -

      for assert for 256-bit integer

      -

      Cipher algorithms

      +

      for assert for 256-bit integer

      +

      Cipher algorithms

      Variable Documentation

      - +

      ◆ STRKEY

      @@ -150,7 +149,7 @@ Variables Initial value:
      =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~!@#$%^&"
      "*()_+`-=[]{}|;':\",./<>?\\\r\n \0"
      -

      dictionary of characters that can be encrypted and decrypted

      +

      dictionary of characters that can be encrypted and decrypted

      @@ -160,7 +159,7 @@ Variables diff --git a/d6/d4e/namespaceciphers.js b/d6/d4e/namespaceciphers.js index 78228b3c2..d4d0e7726 100644 --- a/d6/d4e/namespaceciphers.js +++ b/d6/d4e/namespaceciphers.js @@ -1,11 +1,5 @@ var namespaceciphers = [ - [ "base64_encoding", null, [ - [ "base64_decode", "d1/d1c/base64__encoding_8cpp.html#ab53bd53022c27d29201dd744aa7986cf", null ], - [ "base64_encode", "d1/d1c/base64__encoding_8cpp.html#a4491ab05952c7db58fd832fee1f2361e", null ], - [ "find_idx", "d1/d1c/base64__encoding_8cpp.html#a845feda50fd909a33a72ef4745b59b61", null ], - [ "chars", "d1/d1c/base64__encoding_8cpp.html#ad3dd10bb330989e209fcaddf6fd0ae3c", null ] - ] ], [ "caesar", null, [ [ "decrypt", "d6/d2c/caesar__cipher_8cpp.html#a355e69511cd2006b5c4c80ae95b71056", null ], [ "encrypt", "d6/d2c/caesar__cipher_8cpp.html#ac3381121289548640b1c27a58a8524c3", null ] diff --git a/d6/d53/namespaceword__break.html b/d6/d53/namespaceword__break.html index 270808f54..47e62118b 100644 --- a/d6/d53/namespaceword__break.html +++ b/d6/d53/namespaceword__break.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: word_break Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d6/d53/namespaceword__break.html','../
      -
      -
      word_break Namespace Reference
      +
      word_break Namespace Reference
      -

      Functions for Word Break problem. +

      Functions for Word Break problem. More...

      Detailed Description

      -

      Functions for Word Break problem.

      +

      Functions for Word Break problem.

      diff --git a/d6/d60/group__ode.html b/d6/d60/group__ode.html index dacf34cd1..f9d36a445 100644 --- a/d6/d60/group__ode.html +++ b/d6/d60/group__ode.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Ordinary Differential Equations @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('d6/d60/group__ode.html','../../'); ini
      -
      -
      Ordinary Differential Equations
      +
      Ordinary Differential Equations
      - @@ -119,9 +118,9 @@ Functions

      +

      Functions

      void forward_euler_step (const double dx, const double x, std::valarray< double > *y, std::valarray< double > *dy)
       Compute next step approximation using the forward-Euler method. More...
       

      Detailed Description

      -

      Integration functions for implementations with solving ordinary differential equations (ODEs) of any order and and any number of independent variables.

      +

      Integration functions for implementations with solving ordinary differential equations (ODEs) of any order and and any number of independent variables.

      Function Documentation

      - +

      ◆ forward_euler()

      @@ -177,45 +176,45 @@ Functions
      Returns
      time taken for computation in seconds
      -
      103  {
      -
      104  std::valarray<double> dy = *y;
      -
      105 
      -
      106  std::ofstream fp;
      -
      107  if (save_to_file) {
      -
      108  fp.open("forward_euler.csv", std::ofstream::out);
      -
      109  if (!fp.is_open()) {
      -
      110  std::perror("Error! ");
      -
      111  }
      -
      112  }
      -
      113 
      -
      114  std::size_t L = y->size();
      -
      115 
      -
      116  /* start integration */
      -
      117  std::clock_t t1 = std::clock();
      -
      118  double x = x0;
      -
      119 
      -
      120  do { // iterate for each step of independent variable
      -
      121  if (save_to_file && fp.is_open()) {
      -
      122  // write to file
      -
      123  fp << x << ",";
      -
      124  for (int i = 0; i < L - 1; i++) {
      -
      125  fp << y[0][i] << ","; // NOLINT
      -
      126  }
      -
      127  fp << y[0][L - 1] << "\n"; // NOLINT
      -
      128  }
      -
      129 
      -
      130  forward_euler_step(dx, x, y, &dy); // perform integration
      -
      131  x += dx; // update step
      -
      132  } while (x <= x_max); // till upper limit of independent variable
      -
      133  /* end of integration */
      -
      134  std::clock_t t2 = std::clock();
      -
      135 
      -
      136  if (fp.is_open()) {
      -
      137  fp.close();
      -
      138  }
      -
      139 
      -
      140  return static_cast<double>(t2 - t1) / CLOCKS_PER_SEC;
      -
      141 }
      +
      103 {
      +
      104 std::valarray<double> dy = *y;
      +
      105
      +
      106 std::ofstream fp;
      +
      107 if (save_to_file) {
      +
      108 fp.open("forward_euler.csv", std::ofstream::out);
      +
      109 if (!fp.is_open()) {
      +
      110 std::perror("Error! ");
      +
      111 }
      +
      112 }
      +
      113
      +
      114 std::size_t L = y->size();
      +
      115
      +
      116 /* start integration */
      + +
      118 double x = x0;
      +
      119
      +
      120 do { // iterate for each step of independent variable
      +
      121 if (save_to_file && fp.is_open()) {
      +
      122 // write to file
      +
      123 fp << x << ",";
      +
      124 for (int i = 0; i < L - 1; i++) {
      +
      125 fp << y[0][i] << ","; // NOLINT
      +
      126 }
      +
      127 fp << y[0][L - 1] << "\n"; // NOLINT
      +
      128 }
      +
      129
      +
      130 forward_euler_step(dx, x, y, &dy); // perform integration
      +
      131 x += dx; // update step
      +
      132 } while (x <= x_max); // till upper limit of independent variable
      +
      133 /* end of integration */
      + +
      135
      +
      136 if (fp.is_open()) {
      +
      137 fp.close();
      +
      138 }
      +
      139
      +
      140 return static_cast<double>(t2 - t1) / CLOCKS_PER_SEC;
      +
      141}
      T clock(T... args)
      @@ -225,7 +224,7 @@ Functions
      T open(T... args)
      T perror(T... args)
      - +
      Here is the call graph for this function:
      @@ -235,7 +234,7 @@ Here is the call graph for this function:
      - +

      ◆ forward_euler_step()

      @@ -286,10 +285,10 @@ Here is the call graph for this function:
      -
      87  {
      -
      88  problem(x, y, dy);
      -
      89  *y += *dy * dx;
      -
      90 }
      +
      87 {
      +
      88 problem(x, y, dy);
      +
      89 *y += *dy * dx;
      +
      90}
      void problem(const double &x, std::valarray< double > *y, std::valarray< double > *dy)
      Problem statement for a system with first-order differential equations. Updates the system differenti...
      Definition: ode_forward_euler.cpp:54
      Here is the call graph for this function:
      @@ -300,7 +299,7 @@ Here is the call graph for this function:
      - +

      ◆ midpoint_euler()

      @@ -356,43 +355,43 @@ Here is the call graph for this function:
      Returns
      time taken for computation in seconds
      -
      108  {
      -
      109  std::valarray<double> dy = y[0];
      -
      110 
      -
      111  std::ofstream fp;
      -
      112  if (save_to_file) {
      -
      113  fp.open("midpoint_euler.csv", std::ofstream::out);
      -
      114  if (!fp.is_open()) {
      -
      115  std::perror("Error! ");
      -
      116  }
      -
      117  }
      -
      118 
      -
      119  std::size_t L = y->size();
      -
      120 
      -
      121  /* start integration */
      -
      122  std::clock_t t1 = std::clock();
      -
      123  double x = x0;
      -
      124  do { // iterate for each step of independent variable
      -
      125  if (save_to_file && fp.is_open()) {
      -
      126  // write to file
      -
      127  fp << x << ",";
      -
      128  for (int i = 0; i < L - 1; i++) {
      -
      129  fp << y[0][i] << ",";
      -
      130  }
      -
      131  fp << y[0][L - 1] << "\n";
      -
      132  }
      -
      133 
      -
      134  midpoint_euler_step(dx, x, y, &dy); // perform integration
      -
      135  x += dx; // update step
      -
      136  } while (x <= x_max); // till upper limit of independent variable
      -
      137  /* end of integration */
      -
      138  std::clock_t t2 = std::clock();
      -
      139 
      -
      140  if (fp.is_open())
      -
      141  fp.close();
      -
      142 
      -
      143  return static_cast<double>(t2 - t1) / CLOCKS_PER_SEC;
      -
      144 }
      +
      108 {
      +
      109 std::valarray<double> dy = y[0];
      +
      110
      +
      111 std::ofstream fp;
      +
      112 if (save_to_file) {
      +
      113 fp.open("midpoint_euler.csv", std::ofstream::out);
      +
      114 if (!fp.is_open()) {
      +
      115 std::perror("Error! ");
      +
      116 }
      +
      117 }
      +
      118
      +
      119 std::size_t L = y->size();
      +
      120
      +
      121 /* start integration */
      + +
      123 double x = x0;
      +
      124 do { // iterate for each step of independent variable
      +
      125 if (save_to_file && fp.is_open()) {
      +
      126 // write to file
      +
      127 fp << x << ",";
      +
      128 for (int i = 0; i < L - 1; i++) {
      +
      129 fp << y[0][i] << ",";
      +
      130 }
      +
      131 fp << y[0][L - 1] << "\n";
      +
      132 }
      +
      133
      +
      134 midpoint_euler_step(dx, x, y, &dy); // perform integration
      +
      135 x += dx; // update step
      +
      136 } while (x <= x_max); // till upper limit of independent variable
      +
      137 /* end of integration */
      + +
      139
      +
      140 if (fp.is_open())
      +
      141 fp.close();
      +
      142
      +
      143 return static_cast<double>(t2 - t1) / CLOCKS_PER_SEC;
      +
      144}
      void midpoint_euler_step(const double dx, const double &x, std::valarray< double > *y, std::valarray< double > *dy)
      Compute next step approximation using the midpoint-Euler method.
      Definition: ode_midpoint_euler.cpp:85
      Here is the call graph for this function:
      @@ -403,7 +402,7 @@ Here is the call graph for this function:
      - +

      ◆ midpoint_euler_step()

      @@ -454,16 +453,16 @@ Here is the call graph for this function:
      -
      86  {
      -
      87  problem(x, y, dy);
      -
      88  double tmp_x = x + 0.5 * dx;
      -
      89 
      -
      90  std::valarray<double> tmp_y = y[0] + dy[0] * (0.5 * dx);
      -
      91 
      -
      92  problem(tmp_x, &tmp_y, dy);
      -
      93 
      -
      94  y[0] += dy[0] * dx;
      -
      95 }
      +
      86 {
      +
      87 problem(x, y, dy);
      +
      88 double tmp_x = x + 0.5 * dx;
      +
      89
      +
      90 std::valarray<double> tmp_y = y[0] + dy[0] * (0.5 * dx);
      +
      91
      +
      92 problem(tmp_x, &tmp_y, dy);
      +
      93
      +
      94 y[0] += dy[0] * dx;
      +
      95}
      void problem(const double &x, std::valarray< double > *y, std::valarray< double > *dy)
      Problem statement for a system with first-order differential equations. Updates the system differenti...
      Definition: ode_midpoint_euler.cpp:53
      Here is the call graph for this function:
      @@ -474,7 +473,7 @@ Here is the call graph for this function:
      - +

      ◆ semi_implicit_euler()

      @@ -530,43 +529,43 @@ Here is the call graph for this function:
      Returns
      time taken for computation in seconds
      -
      105  {
      -
      106  std::valarray<double> dy = y[0];
      -
      107 
      -
      108  std::ofstream fp;
      -
      109  if (save_to_file) {
      -
      110  fp.open("semi_implicit_euler.csv", std::ofstream::out);
      -
      111  if (!fp.is_open()) {
      -
      112  std::perror("Error! ");
      -
      113  }
      -
      114  }
      -
      115 
      -
      116  std::size_t L = y->size();
      -
      117 
      -
      118  /* start integration */
      -
      119  std::clock_t t1 = std::clock();
      -
      120  double x = x0;
      -
      121  do { // iterate for each step of independent variable
      -
      122  if (save_to_file && fp.is_open()) {
      -
      123  // write to file
      -
      124  fp << x << ",";
      -
      125  for (int i = 0; i < L - 1; i++) {
      -
      126  fp << y[0][i] << ",";
      -
      127  }
      -
      128  fp << y[0][L - 1] << "\n";
      -
      129  }
      -
      130 
      -
      131  semi_implicit_euler_step(dx, x, y, &dy); // perform integration
      -
      132  x += dx; // update step
      -
      133  } while (x <= x_max); // till upper limit of independent variable
      -
      134  /* end of integration */
      -
      135  std::clock_t t2 = std::clock();
      -
      136 
      -
      137  if (fp.is_open())
      -
      138  fp.close();
      -
      139 
      -
      140  return static_cast<double>(t2 - t1) / CLOCKS_PER_SEC;
      -
      141 }
      +
      105 {
      +
      106 std::valarray<double> dy = y[0];
      +
      107
      +
      108 std::ofstream fp;
      +
      109 if (save_to_file) {
      +
      110 fp.open("semi_implicit_euler.csv", std::ofstream::out);
      +
      111 if (!fp.is_open()) {
      +
      112 std::perror("Error! ");
      +
      113 }
      +
      114 }
      +
      115
      +
      116 std::size_t L = y->size();
      +
      117
      +
      118 /* start integration */
      + +
      120 double x = x0;
      +
      121 do { // iterate for each step of independent variable
      +
      122 if (save_to_file && fp.is_open()) {
      +
      123 // write to file
      +
      124 fp << x << ",";
      +
      125 for (int i = 0; i < L - 1; i++) {
      +
      126 fp << y[0][i] << ",";
      +
      127 }
      +
      128 fp << y[0][L - 1] << "\n";
      +
      129 }
      +
      130
      +
      131 semi_implicit_euler_step(dx, x, y, &dy); // perform integration
      +
      132 x += dx; // update step
      +
      133 } while (x <= x_max); // till upper limit of independent variable
      +
      134 /* end of integration */
      + +
      136
      +
      137 if (fp.is_open())
      +
      138 fp.close();
      +
      139
      +
      140 return static_cast<double>(t2 - t1) / CLOCKS_PER_SEC;
      +
      141}
      void semi_implicit_euler_step(const double dx, const double &x, std::valarray< double > *y, std::valarray< double > *dy)
      Compute next step approximation using the semi-implicit-Euler method.
      Definition: ode_semi_implicit_euler.cpp:82
      Here is the call graph for this function:
      @@ -577,7 +576,7 @@ Here is the call graph for this function:
      - +

      ◆ semi_implicit_euler_step()

      @@ -628,14 +627,14 @@ Here is the call graph for this function:
      -
      84  {
      -
      85  problem(x, y, dy); // update dy once
      -
      86  y[0][0] += dx * dy[0][0]; // update y0
      -
      87  problem(x, y, dy); // update dy once more
      -
      88 
      -
      89  dy[0][0] = 0.f; // ignore y0
      -
      90  y[0] += dy[0] * dx; // update remaining using new dy
      -
      91 }
      +
      84 {
      +
      85 problem(x, y, dy); // update dy once
      +
      86 y[0][0] += dx * dy[0][0]; // update y0
      +
      87 problem(x, y, dy); // update dy once more
      +
      88
      +
      89 dy[0][0] = 0.f; // ignore y0
      +
      90 y[0] += dy[0] * dx; // update remaining using new dy
      +
      91}
      void problem(const double &x, std::valarray< double > *y, std::valarray< double > *dy)
      Problem statement for a system with first-order differential equations. Updates the system differenti...
      Definition: ode_semi_implicit_euler.cpp:53
      Here is the call graph for this function:
      @@ -651,7 +650,7 @@ Here is the call graph for this function:
      diff --git a/d6/d60/group__ode_ga195d23bbdfcb80e83c9cda45c9ad5723_cgraph.svg b/d6/d60/group__ode_ga195d23bbdfcb80e83c9cda45c9ad5723_cgraph.svg index 7814b4f09..18f79ec8f 100644 --- a/d6/d60/group__ode_ga195d23bbdfcb80e83c9cda45c9ad5723_cgraph.svg +++ b/d6/d60/group__ode_ga195d23bbdfcb80e83c9cda45c9ad5723_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - - - + + Algorithms_in_C++: kadane Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d6/d74/namespacekadane.html','../../')
      -
      -
      kadane Namespace Reference
      +
      kadane Namespace Reference
      -

      Functions for Kadane algorithm. +

      Functions for Kadane algorithm. More...

      Detailed Description

      -

      Functions for Kadane algorithm.

      +

      Functions for Kadane algorithm.

      diff --git a/d6/d7a/golden__search__extrema_8cpp.html b/d6/d7a/golden__search__extrema_8cpp.html index 94bf8f3a0..d1d029c26 100644 --- a/d6/d7a/golden__search__extrema_8cpp.html +++ b/d6/d7a/golden__search__extrema_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: numerical_methods/golden_search_extrema.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d6/d7a/golden__search__extrema_8cpp.ht -
      -
      golden_search_extrema.cpp File Reference
      +
      golden_search_extrema.cpp File Reference
      -

      Find extrema of a univariate real function in a given interval using golden section search algorithm. +

      Find extrema of a univariate real function in a given interval using golden section search algorithm. More...

      #include <cassert>
      #include <cmath>
      @@ -112,45 +111,42 @@ Include dependency graph for golden_search_extrema.cpp:
      - - - +

      +

      Macros

      +
      #define _USE_MATH_DEFINES
       
      -#define EPSILON   1e-7
      +#define EPSILON   1e-7
       solution accuracy limit
       
      - - + + Expected result = 2. More...
      - + + Expected result: \(e\approx 2.71828182845904509\). More...
      - + + Expected result: \(\pi\approx 3.14159265358979312\). More...

      +

      Functions

      double get_minima (const std::function< double(double)> &f, double lim_a, double lim_b)
       Get the minima of a function in the given interval. To get the maxima, simply negate the function. The golden ratio used here is: More...
       
      -void test1 ()
      void test1 ()
       Test function to find minima for the function \(f(x)= (x-2)^2\) in the interval \([1,5]\)
      - Expected result = 2.
       
      -void test2 ()
      void test2 ()
       Test function to find maxima for the function \(f(x)= x^{\frac{1}{x}}\) in the interval \([-2,10]\)
      - Expected result: \(e\approx 2.71828182845904509\).
       
      -void test3 ()
      void test3 ()
       Test function to find maxima for the function \(f(x)= \cos x\) in the interval \([0,12]\)
      - Expected result: \(\pi\approx 3.14159265358979312\).
       
      int main ()
       

      Detailed Description

      -

      Find extrema of a univariate real function in a given interval using golden section search algorithm.

      +

      Find extrema of a univariate real function in a given interval using golden section search algorithm.

      See also
      brent_method_extrema.cpp
      -
      Author
      Krishna Vedala
      +
      Author
      Krishna Vedala

      Function Documentation

      - +

      ◆ get_minima()

      @@ -195,47 +191,47 @@ void 
      Returns
      local minima found in the interval
      -
      30  {
      -
      31  uint32_t iters = 0;
      -
      32  double c, d;
      -
      33  double prev_mean, mean = std::numeric_limits<double>::infinity();
      -
      34 
      -
      35  // golden ratio value
      -
      36  const double M_GOLDEN_RATIO = (1.f + std::sqrt(5.f)) / 2.f;
      -
      37 
      -
      38  // ensure that lim_a < lim_b
      -
      39  if (lim_a > lim_b) {
      -
      40  std::swap(lim_a, lim_b);
      -
      41  } else if (std::abs(lim_a - lim_b) <= EPSILON) {
      -
      42  std::cerr << "Search range must be greater than " << EPSILON << "\n";
      -
      43  return lim_a;
      -
      44  }
      -
      45 
      -
      46  do {
      -
      47  prev_mean = mean;
      -
      48 
      -
      49  // compute the section ratio width
      -
      50  double ratio = (lim_b - lim_a) / M_GOLDEN_RATIO;
      -
      51  c = lim_b - ratio; // right-side section start
      -
      52  d = lim_a + ratio; // left-side section end
      -
      53 
      -
      54  if (f(c) < f(d)) {
      -
      55  // select left section
      -
      56  lim_b = d;
      -
      57  } else {
      -
      58  // selct right section
      -
      59  lim_a = c;
      -
      60  }
      -
      61 
      -
      62  mean = (lim_a + lim_b) / 2.f;
      -
      63  iters++;
      -
      64 
      -
      65  // continue till the interval width is greater than sqrt(system epsilon)
      -
      66  } while (std::abs(lim_a - lim_b) > EPSILON);
      -
      67 
      -
      68  std::cout << " (iters: " << iters << ") ";
      -
      69  return prev_mean;
      -
      70 }
      +
      30 {
      +
      31 uint32_t iters = 0;
      +
      32 double c, d;
      +
      33 double prev_mean, mean = std::numeric_limits<double>::infinity();
      +
      34
      +
      35 // golden ratio value
      +
      36 const double M_GOLDEN_RATIO = (1.f + std::sqrt(5.f)) / 2.f;
      +
      37
      +
      38 // ensure that lim_a < lim_b
      +
      39 if (lim_a > lim_b) {
      +
      40 std::swap(lim_a, lim_b);
      +
      41 } else if (std::abs(lim_a - lim_b) <= EPSILON) {
      +
      42 std::cerr << "Search range must be greater than " << EPSILON << "\n";
      +
      43 return lim_a;
      +
      44 }
      +
      45
      +
      46 do {
      +
      47 prev_mean = mean;
      +
      48
      +
      49 // compute the section ratio width
      +
      50 double ratio = (lim_b - lim_a) / M_GOLDEN_RATIO;
      +
      51 c = lim_b - ratio; // right-side section start
      +
      52 d = lim_a + ratio; // left-side section end
      +
      53
      +
      54 if (f(c) < f(d)) {
      +
      55 // select left section
      +
      56 lim_b = d;
      +
      57 } else {
      +
      58 // selct right section
      +
      59 lim_a = c;
      +
      60 }
      +
      61
      +
      62 mean = (lim_a + lim_b) / 2.f;
      +
      63 iters++;
      +
      64
      +
      65 // continue till the interval width is greater than sqrt(system epsilon)
      +
      66 } while (std::abs(lim_a - lim_b) > EPSILON);
      +
      67
      +
      68 std::cout << " (iters: " << iters << ") ";
      +
      69 return prev_mean;
      +
      70}
      #define EPSILON
      solution accuracy limit
      Definition: golden_search_extrema.cpp:17
      T infinity(T... args)
      @@ -250,7 +246,7 @@ Here is the call graph for this function:
      - +

      ◆ main()

      @@ -265,19 +261,19 @@ Here is the call graph for this function:
      -

      Main function

      -
      139  {
      -
      140  std::cout.precision(9);
      -
      141 
      -
      142  std::cout << "Computations performed with machine epsilon: " << EPSILON
      -
      143  << "\n";
      -
      144 
      -
      145  test1();
      -
      146  test2();
      -
      147  test3();
      -
      148 
      -
      149  return 0;
      -
      150 }
      +

      Main function

      +
      139 {
      +
      140 std::cout.precision(9);
      +
      141
      +
      142 std::cout << "Computations performed with machine epsilon: " << EPSILON
      +
      143 << "\n";
      +
      144
      +
      145 test1();
      +
      146 test2();
      +
      147 test3();
      +
      148
      +
      149 return 0;
      +
      150}
      void test2()
      Test function to find maxima for the function in the interval Expected result: .
      Definition: golden_search_extrema.cpp:100
      void test1()
      Test function to find minima for the function in the interval Expected result = 2.
      Definition: golden_search_extrema.cpp:78
      void test3()
      Test function to find maxima for the function in the interval Expected result: .
      Definition: golden_search_extrema.cpp:123
      @@ -288,6 +284,133 @@ Here is the call graph for this function:
      + + + +

      ◆ test1()

      + +
      +
      + + + + + + + +
      void test1 ()
      +
      + +

      Test function to find minima for the function \(f(x)= (x-2)^2\) in the interval \([1,5]\)
      + Expected result = 2.

      +
      78 {
      +
      79 // define the function to minimize as a lambda function
      +
      80 std::function<double(double)> f1 = [](double x) {
      +
      81 return (x - 2) * (x - 2);
      +
      82 };
      +
      83
      +
      84 std::cout << "Test 1.... ";
      +
      85
      +
      86 double minima = get_minima(f1, 1, 5);
      +
      87
      +
      88 std::cout << minima << "...";
      +
      89
      +
      90 assert(std::abs(minima - 2) < EPSILON);
      +
      91 std::cout << "passed\n";
      +
      92}
      + +
      double get_minima(const std::function< double(double)> &f, double lim_a, double lim_b)
      Get the minima of a function in the given interval. To get the maxima, simply negate the function....
      Definition: golden_search_extrema.cpp:29
      +
      +Here is the call graph for this function:
      +
      +
      +
      +
      + +
      +
      + +

      ◆ test2()

      + +
      +
      + + + + + + + +
      void test2 ()
      +
      + +

      Test function to find maxima for the function \(f(x)= x^{\frac{1}{x}}\) in the interval \([-2,10]\)
      + Expected result: \(e\approx 2.71828182845904509\).

      +
      100 {
      +
      101 // define the function to maximize as a lambda function
      +
      102 // since we are maximixing, we negated the function return value
      +
      103 std::function<double(double)> func = [](double x) {
      +
      104 return -std::pow(x, 1.f / x);
      +
      105 };
      +
      106
      +
      107 std::cout << "Test 2.... ";
      +
      108
      +
      109 double minima = get_minima(func, -2, 10);
      +
      110
      +
      111 std::cout << minima << " (" << M_E << ")...";
      +
      112
      +
      113 assert(std::abs(minima - M_E) < EPSILON);
      +
      114 std::cout << "passed\n";
      +
      115}
      +
      T pow(T... args)
      +
      +Here is the call graph for this function:
      +
      +
      +
      +
      + +
      +
      + +

      ◆ test3()

      + +
      +
      + + + + + + + +
      void test3 ()
      +
      + +

      Test function to find maxima for the function \(f(x)= \cos x\) in the interval \([0,12]\)
      + Expected result: \(\pi\approx 3.14159265358979312\).

      +
      123 {
      +
      124 // define the function to maximize as a lambda function
      +
      125 // since we are maximixing, we negated the function return value
      +
      126 std::function<double(double)> func = [](double x) { return std::cos(x); };
      +
      127
      +
      128 std::cout << "Test 3.... ";
      +
      129
      +
      130 double minima = get_minima(func, -4, 12);
      +
      131
      +
      132 std::cout << minima << " (" << M_PI << ")...";
      +
      133
      +
      134 assert(std::abs(minima - M_PI) < EPSILON);
      +
      135 std::cout << "passed\n";
      +
      136}
      +
      T cos(T... args)
      +
      +Here is the call graph for this function:
      +
      +
      +
      +
      +
      @@ -296,7 +419,7 @@ Here is the call graph for this function: diff --git a/d6/d7a/golden__search__extrema_8cpp.js b/d6/d7a/golden__search__extrema_8cpp.js index 8646eae12..bc956a03a 100644 --- a/d6/d7a/golden__search__extrema_8cpp.js +++ b/d6/d7a/golden__search__extrema_8cpp.js @@ -1,6 +1,5 @@ var golden__search__extrema_8cpp = [ - [ "_USE_MATH_DEFINES", "d6/d7a/golden__search__extrema_8cpp.html#a525335710b53cb064ca56b936120431e", null ], [ "EPSILON", "d6/d7a/golden__search__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70", null ], [ "get_minima", "d6/d7a/golden__search__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b", null ], [ "main", "d6/d7a/golden__search__extrema_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], diff --git a/d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map b/d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map new file mode 100644 index 000000000..e9e71f83b --- /dev/null +++ b/d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 b/d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 new file mode 100644 index 000000000..6e96e6c1c --- /dev/null +++ b/d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 @@ -0,0 +1 @@ +6fcfaef331465e86375f58b6de1b6bed \ No newline at end of file diff --git a/d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg b/d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg new file mode 100644 index 000000000..4d29f88e3 --- /dev/null +++ b/d6/d7a/golden__search__extrema_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg @@ -0,0 +1,98 @@ + + + + + + +test2 + + + +Node1 + + +test2 + + + + + +Node2 + + +get_minima + + + + + +Node1->Node2 + + + + + +Node6 + + +std::pow + + + + + +Node1->Node6 + + + + + +Node3 + + +std::numeric_limits +::infinity + + + + + +Node2->Node3 + + + + + +Node4 + + +std::sqrt + + + + + +Node2->Node4 + + + + + +Node5 + + +std::swap + + + + + +Node2->Node5 + + + + + diff --git a/d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map b/d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map new file mode 100644 index 000000000..abef2fa8e --- /dev/null +++ b/d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 b/d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 new file mode 100644 index 000000000..c177a47d2 --- /dev/null +++ b/d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 @@ -0,0 +1 @@ +03ac9d0ffa55c429a8317dae4b0c684b \ No newline at end of file diff --git a/d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg b/d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg new file mode 100644 index 000000000..176925061 --- /dev/null +++ b/d6/d7a/golden__search__extrema_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg @@ -0,0 +1,83 @@ + + + + + + +test1 + + + +Node1 + + +test1 + + + + + +Node2 + + +get_minima + + + + + +Node1->Node2 + + + + + +Node3 + + +std::numeric_limits +::infinity + + + + + +Node2->Node3 + + + + + +Node4 + + +std::sqrt + + + + + +Node2->Node4 + + + + + +Node5 + + +std::swap + + + + + +Node2->Node5 + + + + + diff --git a/d6/d7a/golden__search__extrema_8cpp_a1aa76a6d5fd4d333f9072beff1dc486b_cgraph.svg b/d6/d7a/golden__search__extrema_8cpp_a1aa76a6d5fd4d333f9072beff1dc486b_cgraph.svg index 9feb5fddd..4ef0223ee 100644 --- a/d6/d7a/golden__search__extrema_8cpp_a1aa76a6d5fd4d333f9072beff1dc486b_cgraph.svg +++ b/d6/d7a/golden__search__extrema_8cpp_a1aa76a6d5fd4d333f9072beff1dc486b_cgraph.svg @@ -1,7 +1,7 @@ - + + + + + + + diff --git a/d6/d7a/golden__search__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 b/d6/d7a/golden__search__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 new file mode 100644 index 000000000..2b799fd2d --- /dev/null +++ b/d6/d7a/golden__search__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.md5 @@ -0,0 +1 @@ +253a7797df0a27250fe239c9ecea91eb \ No newline at end of file diff --git a/d6/d7a/golden__search__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg b/d6/d7a/golden__search__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg new file mode 100644 index 000000000..b75085404 --- /dev/null +++ b/d6/d7a/golden__search__extrema_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg @@ -0,0 +1,98 @@ + + + + + + +test3 + + + +Node1 + + +test3 + + + + + +Node2 + + +std::cos + + + + + +Node1->Node2 + + + + + +Node3 + + +get_minima + + + + + +Node1->Node3 + + + + + +Node4 + + +std::numeric_limits +::infinity + + + + + +Node3->Node4 + + + + + +Node5 + + +std::sqrt + + + + + +Node3->Node5 + + + + + +Node6 + + +std::swap + + + + + +Node3->Node6 + + + + + diff --git a/d6/d7a/golden__search__extrema_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d6/d7a/golden__search__extrema_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index e065eb2c7..2c55cb354 100644 --- a/d6/d7a/golden__search__extrema_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d6/d7a/golden__search__extrema_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: backtracking/sudoku_solve.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d6/d7b/sudoku__solve_8cpp.html','../.. -
      -
      sudoku_solve.cpp File Reference
      +
      sudoku_solve.cpp File Reference
      -

      Sudoku Solver algorithm. +

      Sudoku Solver algorithm. More...

      #include <iostream>
      #include <array>
      @@ -109,13 +108,13 @@ Include dependency graph for sudoku_solve.cpp:
      - - +

      +

      Namespaces

       backtracking
      namespace  backtracking
       Backtracking algorithms.
       
      - @@ -130,13 +129,13 @@ Functions

      +

      Functions

      template<size_t V>
      bool backtracking::isPossible (const std::array< std::array< int, V >, V > &mat, int i, int j, int no, int n)
       

      Detailed Description

      -

      Sudoku Solver algorithm.

      -

      Sudoku (数独, sūdoku, digit-single) (/suːˈdoʊkuː/, /-ˈdɒk-/, /sə-/, originally called Number Place) is a logic-based, combinatorial number-placement puzzle. In classic sudoku, the objective is to fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 subgrids that compose the grid (also called "boxes", "blocks", or "regions") contain all of the digits from 1 to 9. The puzzle setter provides a partially completed grid, which for a well-posed puzzle has a single solution.

      -
      Author
      DarthCoder3200
      +

      Sudoku Solver algorithm.

      +

      Sudoku (数独, sūdoku, digit-single) (/suːˈdoʊkuː/, /-ˈdɒk-/, /sə-/, originally called Number Place) is a logic-based, combinatorial number-placement puzzle. In classic sudoku, the objective is to fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 subgrids that compose the grid (also called "boxes", "blocks", or "regions") contain all of the digits from 1 to 9. The puzzle setter provides a partially completed grid, which for a well-posed puzzle has a single solution.

      +
      Author
      DarthCoder3200
      -David Leal
      +David Leal

      Function Documentation

      - +

      ◆ main()

      @@ -151,28 +150,28 @@ Functions
      -

      Main function

      -
      137  {
      -
      138  const int V = 9;
      - -
      140  std::array <int, V> {5, 3, 0, 0, 7, 0, 0, 0, 0},
      -
      141  std::array <int, V> {6, 0, 0, 1, 9, 5, 0, 0, 0},
      -
      142  std::array <int, V> {0, 9, 8, 0, 0, 0, 0, 6, 0},
      -
      143  std::array <int, V> {8, 0, 0, 0, 6, 0, 0, 0, 3},
      -
      144  std::array <int, V> {4, 0, 0, 8, 0, 3, 0, 0, 1},
      -
      145  std::array <int, V> {7, 0, 0, 0, 2, 0, 0, 0, 6},
      -
      146  std::array <int, V> {0, 6, 0, 0, 0, 0, 2, 8, 0},
      -
      147  std::array <int, V> {0, 0, 0, 4, 1, 9, 0, 0, 5},
      -
      148  std::array <int, V> {0, 0, 0, 0, 8, 0, 0, 7, 9}
      -
      149  };
      -
      150 
      -
      151  backtracking::printMat<V>(mat, mat, 9);
      -
      152  std::cout << "Solution " << std::endl;
      -
      153  std::array <std::array <int, V>, V> starting_mat = mat;
      -
      154  backtracking::solveSudoku<V>(mat, starting_mat, 0, 0);
      -
      155 
      -
      156  return 0;
      -
      157 }
      +

      Main function

      +
      137 {
      +
      138 const int V = 9;
      + +
      140 std::array <int, V> {5, 3, 0, 0, 7, 0, 0, 0, 0},
      +
      141 std::array <int, V> {6, 0, 0, 1, 9, 5, 0, 0, 0},
      +
      142 std::array <int, V> {0, 9, 8, 0, 0, 0, 0, 6, 0},
      +
      143 std::array <int, V> {8, 0, 0, 0, 6, 0, 0, 0, 3},
      +
      144 std::array <int, V> {4, 0, 0, 8, 0, 3, 0, 0, 1},
      +
      145 std::array <int, V> {7, 0, 0, 0, 2, 0, 0, 0, 6},
      +
      146 std::array <int, V> {0, 6, 0, 0, 0, 0, 2, 8, 0},
      +
      147 std::array <int, V> {0, 0, 0, 4, 1, 9, 0, 0, 5},
      +
      148 std::array <int, V> {0, 0, 0, 0, 8, 0, 0, 7, 9}
      +
      149 };
      +
      150
      +
      151 backtracking::printMat<V>(mat, mat, 9);
      +
      152 std::cout << "Solution " << std::endl;
      +
      153 std::array <std::array <int, V>, V> starting_mat = mat;
      +
      154 backtracking::solveSudoku<V>(mat, starting_mat, 0, 0);
      +
      155
      +
      156 return 0;
      +
      157}
      T endl(T... args)
      @@ -191,7 +190,7 @@ Here is the call graph for this function:
      diff --git a/d6/d7b/sudoku__solve_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d6/d7b/sudoku__solve_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index a39b40afa..6a539567b 100644 --- a/d6/d7b/sudoku__solve_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d6/d7b/sudoku__solve_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: hashing/double_hash_hash_table.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -96,12 +96,11 @@ $(document).ready(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp. Typedefs | Functions | Variables -
      -
      double_hash_hash_table.cpp File Reference
      +
      double_hash_hash_table.cpp File Reference
      -

      Storage mechanism using double-hashed keys. +

      Storage mechanism using double-hashed keys. More...

      #include <iostream>
      #include <memory>
      @@ -113,24 +112,24 @@ Include dependency graph for double_hash_hash_table.cpp:
      -

      +

      Classes

      struct  double_hashing::Entry
       
      - - - + +

      +

      Namespaces

       double_hashing
       An implementation of hash table using double hashing algorithm.
      namespace  double_hashing
       An implementation of hash table using double hashing algorithm.
       
      - - - + +

      +

      Typedefs

      -using double_hashing::Entry = struct Entry
       
      +using double_hashing::Entry = Entry
       
      - @@ -160,35 +159,35 @@ Functions

      +

      Functions

      bool double_hashing::putProber (const Entry &entry, int key)
       
      int main ()
       
      - - - - - - -

      +

      Variables

      +
      int double_hashing::notPresent
       
      +
      std::vector< Entrydouble_hashing::table
       
      +
      int double_hashing::totalSize
       
      +
      int double_hashing::tomb = -1
       
      +
      int double_hashing::size
       
      +
      bool double_hashing::rehashing
       

      Detailed Description

      -

      Storage mechanism using double-hashed keys.

      -
      Author
      achance6
      +

      Storage mechanism using double-hashed keys.

      +
      Author
      achance6
      -Krishna Vedala
      +Krishna Vedala
      Note
      The implementation can be optimized by using OOP style.

      Function Documentation

      - +

      ◆ main()

      @@ -203,61 +202,61 @@ bool double_hashing::rehas
      -

      Main program

      Returns
      0 on success
      -
      250  {
      -
      251  int cmd = 0, hash = 0, key = 0;
      -
      252  std::cout << "Enter the initial size of Hash Table. = ";
      -
      253  std::cin >> totalSize;
      -
      254  table = std::vector<Entry>(totalSize);
      -
      255  bool loop = true;
      -
      256  while (loop) {
      -
      257  std::cout << std::endl;
      -
      258  std::cout << "PLEASE CHOOSE -" << std::endl;
      -
      259  std::cout << "1. Add key. (Numeric only)" << std::endl;
      -
      260  std::cout << "2. Remove key." << std::endl;
      -
      261  std::cout << "3. Find key." << std::endl;
      -
      262  std::cout << "4. Generate Hash. (Numeric only)" << std::endl;
      -
      263  std::cout << "5. Display Hash table." << std::endl;
      -
      264  std::cout << "6. Exit." << std::endl;
      -
      265  std::cin >> cmd;
      -
      266  switch (cmd) {
      -
      267  case 1:
      -
      268  std::cout << "Enter key to add = ";
      -
      269  std::cin >> key;
      - -
      271  break;
      -
      272  case 2:
      -
      273  std::cout << "Enter key to remove = ";
      -
      274  std::cin >> key;
      - -
      276  break;
      -
      277  case 3: {
      -
      278  std::cout << "Enter key to search = ";
      -
      279  std::cin >> key;
      -
      280  Entry entry = table[double_hashing::doubleHash(key, true)];
      -
      281  if (entry.key == double_hashing::notPresent) {
      -
      282  std::cout << "Key not present";
      -
      283  }
      -
      284  break;
      -
      285  }
      -
      286  case 4:
      -
      287  std::cout << "Enter element to generate hash = ";
      -
      288  std::cin >> key;
      -
      289  std::cout << "Hash of " << key
      -
      290  << " is = " << double_hashing::hashFxn(key);
      -
      291  break;
      -
      292  case 5:
      - -
      294  break;
      -
      295  default:
      -
      296  loop = false;
      -
      297  break;
      -
      298  // delete[] table;
      -
      299  }
      -
      300  std::cout << std::endl;
      -
      301  }
      -
      302  return 0;
      -
      303 }
      +

      Main program

      Returns
      0 on success
      +
      250 {
      +
      251 int cmd = 0, hash = 0, key = 0;
      +
      252 std::cout << "Enter the initial size of Hash Table. = ";
      +
      253 std::cin >> totalSize;
      +
      254 table = std::vector<Entry>(totalSize);
      +
      255 bool loop = true;
      +
      256 while (loop) {
      + +
      258 std::cout << "PLEASE CHOOSE -" << std::endl;
      +
      259 std::cout << "1. Add key. (Numeric only)" << std::endl;
      +
      260 std::cout << "2. Remove key." << std::endl;
      +
      261 std::cout << "3. Find key." << std::endl;
      +
      262 std::cout << "4. Generate Hash. (Numeric only)" << std::endl;
      +
      263 std::cout << "5. Display Hash table." << std::endl;
      +
      264 std::cout << "6. Exit." << std::endl;
      +
      265 std::cin >> cmd;
      +
      266 switch (cmd) {
      +
      267 case 1:
      +
      268 std::cout << "Enter key to add = ";
      +
      269 std::cin >> key;
      + +
      271 break;
      +
      272 case 2:
      +
      273 std::cout << "Enter key to remove = ";
      +
      274 std::cin >> key;
      + +
      276 break;
      +
      277 case 3: {
      +
      278 std::cout << "Enter key to search = ";
      +
      279 std::cin >> key;
      +
      280 Entry entry = table[double_hashing::doubleHash(key, true)];
      +
      281 if (entry.key == double_hashing::notPresent) {
      +
      282 std::cout << "Key not present";
      +
      283 }
      +
      284 break;
      +
      285 }
      +
      286 case 4:
      +
      287 std::cout << "Enter element to generate hash = ";
      +
      288 std::cin >> key;
      +
      289 std::cout << "Hash of " << key
      +
      290 << " is = " << double_hashing::hashFxn(key);
      +
      291 break;
      +
      292 case 5:
      + +
      294 break;
      +
      295 default:
      +
      296 loop = false;
      +
      297 break;
      +
      298 // delete[] table;
      +
      299 }
      + +
      301 }
      +
      302 return 0;
      +
      303}
      T endl(T... args)
      @@ -278,7 +277,7 @@ bool double_hashing::rehas diff --git a/d6/d80/double__hash__hash__table_8cpp.js b/d6/d80/double__hash__hash__table_8cpp.js index f74480441..868cfb663 100644 --- a/d6/d80/double__hash__hash__table_8cpp.js +++ b/d6/d80/double__hash__hash__table_8cpp.js @@ -1,7 +1,6 @@ var double__hash__hash__table_8cpp = [ - [ "Entry", "d9/dde/structdouble__hashing_1_1_entry.html", "d9/dde/structdouble__hashing_1_1_entry" ], - [ "Entry", "d6/d80/double__hash__hash__table_8cpp.html#a4b68c58d0e039662991f8e220129efd9", null ], + [ "double_hashing::Entry", "d9/dde/structdouble__hashing_1_1_entry.html", "d9/dde/structdouble__hashing_1_1_entry" ], [ "add", "d6/d80/double__hash__hash__table_8cpp.html#a79a9c914a6c68275b3640303d7faad8a", null ], [ "addInfo", "d6/d80/double__hash__hash__table_8cpp.html#a9c652b2e467e5d250dfe3bed83b12560", null ], [ "display", "d6/d80/double__hash__hash__table_8cpp.html#a1e901418c759627557eff359b8db38cd", null ], @@ -13,11 +12,5 @@ var double__hash__hash__table_8cpp = [ "rehash", "d6/d80/double__hash__hash__table_8cpp.html#af4981819aae8bc7e7beeaef02615e30d", null ], [ "removalInfo", "d6/d80/double__hash__hash__table_8cpp.html#a5d06e4598569526294f10104875f6824", null ], [ "remove", "d6/d80/double__hash__hash__table_8cpp.html#a28083ecac6eb94b643281875c8665931", null ], - [ "searchingProber", "d6/d80/double__hash__hash__table_8cpp.html#a29f543e2626bad58907661e1e45028a6", null ], - [ "notPresent", "d6/d80/double__hash__hash__table_8cpp.html#a77d33a0c49294b9ec22ad86eeff79585", null ], - [ "rehashing", "d6/d80/double__hash__hash__table_8cpp.html#ae5d042a7f6038a2ec9e5718d0c7fb31f", null ], - [ "size", "d6/d80/double__hash__hash__table_8cpp.html#a5f5323b52037218cf5ae888778b7f980", null ], - [ "table", "d6/d80/double__hash__hash__table_8cpp.html#a0e2ff0f9cfc7b54e60a6561f792d8b26", null ], - [ "tomb", "d6/d80/double__hash__hash__table_8cpp.html#a4e9a7219d34e781e4e73d74a968b26c1", null ], - [ "totalSize", "d6/d80/double__hash__hash__table_8cpp.html#a60a52265027518b25655d730f960013a", null ] + [ "searchingProber", "d6/d80/double__hash__hash__table_8cpp.html#a29f543e2626bad58907661e1e45028a6", null ] ]; \ No newline at end of file diff --git a/d6/d8d/namespacemorse.html b/d6/d8d/namespacemorse.html index 5b186686c..101b1da38 100644 --- a/d6/d8d/namespacemorse.html +++ b/d6/d8d/namespacemorse.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: morse Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d6/d8d/namespacemorse.html','../../');
      -
      -
      morse Namespace Reference
      +
      morse Namespace Reference
      -

      Functions for Morse Code. +

      Functions for Morse Code. More...

      Detailed Description

      -

      Functions for Morse Code.

      +

      Functions for Morse Code.

      diff --git a/d6/d93/large__number_8h__dep__incl.svg b/d6/d93/large__number_8h__dep__incl.svg index 8fe5f5033..9eade871e 100644 --- a/d6/d93/large__number_8h__dep__incl.svg +++ b/d6/d93/large__number_8h__dep__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: math/large_factorial.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d6/d9d/large__factorial_8cpp.html','..
      -
      -
      large_factorial.cpp File Reference
      +
      large_factorial.cpp File Reference
      @@ -110,7 +109,7 @@ Include dependency graph for large_factorial.cpp:
      - @@ -120,11 +119,11 @@ Functions

      +

      Functions

      bool test1 ()
       
       

      Detailed Description

      -

      Compute factorial of any arbitratily large number/.

      -
      Author
      Krishna Vedala
      +

      Compute factorial of any arbitratily large number/.

      +
      Author
      Krishna Vedala
      See also
      factorial.cpp

      Function Documentation

      - +

      ◆ main()

      @@ -149,37 +148,37 @@ Functions
      -

      Main program

      -
      89  {
      -
      90  int number, i;
      -
      91 
      -
      92  if (argc == 2) {
      -
      93  number = atoi(argv[1]);
      -
      94  } else {
      -
      95  std::cout << "Enter the value of n(n starts from 0 ): ";
      -
      96  std::cin >> number;
      -
      97  }
      -
      98 
      - -
      100 
      -
      101  std::clock_t start_time = std::clock();
      -
      102  for (i = 2; i <= number; i++) /* Multiply every number from 2 thru N */
      -
      103  result *= i;
      -
      104  std::clock_t end_time = std::clock();
      -
      105  double time_taken =
      -
      106  static_cast<double>(end_time - start_time) / CLOCKS_PER_SEC;
      -
      107 
      -
      108  std::cout << number << "! = " << result << std::endl
      -
      109  << "Number of digits: " << result.num_digits() << std::endl
      -
      110  << "Time taken: " << std::scientific << time_taken << " s"
      -
      111  << std::endl;
      -
      112 
      -
      113  test1();
      -
      114  test2();
      -
      115  result.test();
      -
      116 
      -
      117  return 0;
      -
      118 }
      +

      Main program

      +
      89 {
      +
      90 int number, i;
      +
      91
      +
      92 if (argc == 2) {
      +
      93 number = atoi(argv[1]);
      +
      94 } else {
      +
      95 std::cout << "Enter the value of n(n starts from 0 ): ";
      +
      96 std::cin >> number;
      +
      97 }
      +
      98
      + +
      100
      +
      101 std::clock_t start_time = std::clock();
      +
      102 for (i = 2; i <= number; i++) /* Multiply every number from 2 thru N */
      +
      103 result *= i;
      +
      104 std::clock_t end_time = std::clock();
      +
      105 double time_taken =
      +
      106 static_cast<double>(end_time - start_time) / CLOCKS_PER_SEC;
      +
      107
      +
      108 std::cout << number << "! = " << result << std::endl
      +
      109 << "Number of digits: " << result.num_digits() << std::endl
      +
      110 << "Time taken: " << std::scientific << time_taken << " s"
      +
      111 << std::endl;
      +
      112
      +
      113 test1();
      +
      114 test2();
      +
      115 result.test();
      +
      116
      +
      117 return 0;
      +
      118}
      T atoi(T... args)
      @@ -200,7 +199,7 @@ Here is the call graph for this function:
      - +

      ◆ test1()

      @@ -214,35 +213,35 @@ Here is the call graph for this function:
      -

      Test implementation for 10! Result must be 3628800.

      Returns
      True if test pass else False
      -
      17  {
      -
      18  std::cout << "---- Check 1\t";
      -
      19  unsigned int i, number = 10;
      - -
      21  for (i = 2; i <= number; i++) /* Multiply every number from 2 thru N */
      -
      22  result *= i;
      -
      23 
      -
      24  const char *known_reslt = "3628800";
      -
      25 
      -
      26  /* check 1 */
      -
      27  if (strlen(known_reslt) != result.num_digits()) {
      -
      28  std::cerr << "Result lengths dont match! " << strlen(known_reslt)
      -
      29  << " != " << result.num_digits() << std::endl;
      -
      30  return false;
      -
      31  }
      -
      32 
      -
      33  const size_t N = result.num_digits();
      -
      34  for (i = 0; i < N; i++) {
      -
      35  if (known_reslt[i] != result.digit_char(i)) {
      -
      36  std::cerr << i << "^th digit mismatch! " << known_reslt[i]
      -
      37  << " != " << result.digit_char(i) << std::endl;
      -
      38  return false;
      -
      39  }
      -
      40  }
      -
      41 
      -
      42  std::cout << "Passed!" << std::endl;
      -
      43  return true;
      -
      44 }
      +

      Test implementation for 10! Result must be 3628800.

      Returns
      True if test pass else False
      +
      17 {
      +
      18 std::cout << "---- Check 1\t";
      +
      19 unsigned int i, number = 10;
      + +
      21 for (i = 2; i <= number; i++) /* Multiply every number from 2 thru N */
      +
      22 result *= i;
      +
      23
      +
      24 const char *known_reslt = "3628800";
      +
      25
      +
      26 /* check 1 */
      +
      27 if (strlen(known_reslt) != result.num_digits()) {
      +
      28 std::cerr << "Result lengths dont match! " << strlen(known_reslt)
      +
      29 << " != " << result.num_digits() << std::endl;
      +
      30 return false;
      +
      31 }
      +
      32
      +
      33 const size_t N = result.num_digits();
      +
      34 for (i = 0; i < N; i++) {
      +
      35 if (known_reslt[i] != result.digit_char(i)) {
      +
      36 std::cerr << i << "^th digit mismatch! " << known_reslt[i]
      +
      37 << " != " << result.digit_char(i) << std::endl;
      +
      38 return false;
      +
      39 }
      +
      40 }
      +
      41
      +
      42 std::cout << "Passed!" << std::endl;
      +
      43 return true;
      +
      44}
      constexpr uint32_t N
      A struct to represent sparse table for min() as their invariant function, for the given array A....
      Definition: sparse_table.cpp:47
      T strlen(T... args)
      @@ -254,7 +253,7 @@ Here is the call graph for this function:
      - +

      ◆ test2()

      @@ -268,41 +267,41 @@ Here is the call graph for this function:
      -

      Test implementation for 100! The result is the 156 digit number:

      9332621544394415268169923885626670049071596826438162146859296389521759
      +

      Test implementation for 100! The result is the 156 digit number:

      9332621544394415268169923885626670049071596826438162146859296389521759
      9993229915608941463976156518286253697920827223758251185210916864000000
      000000000000000000
      Returns
      True if test pass else False
      -
      54  {
      -
      55  std::cout << "---- Check 2\t";
      -
      56  unsigned int i, number = 100;
      - -
      58  for (i = 2; i <= number; i++) /* Multiply every number from 2 thru N */
      -
      59  result *= i;
      -
      60 
      -
      61  const char *known_reslt =
      -
      62  "9332621544394415268169923885626670049071596826438162146859296389521759"
      -
      63  "9993229915608941463976156518286253697920827223758251185210916864000000"
      -
      64  "000000000000000000";
      -
      65 
      -
      66  /* check 1 */
      -
      67  if (strlen(known_reslt) != result.num_digits()) {
      -
      68  std::cerr << "Result lengths dont match! " << strlen(known_reslt)
      -
      69  << " != " << result.num_digits() << std::endl;
      -
      70  return false;
      -
      71  }
      -
      72 
      -
      73  const size_t N = result.num_digits();
      -
      74  for (i = 0; i < N; i++) {
      -
      75  if (known_reslt[i] != result.digit_char(i)) {
      -
      76  std::cerr << i << "^th digit mismatch! " << known_reslt[i]
      -
      77  << " != " << result.digit_char(i) << std::endl;
      -
      78  return false;
      -
      79  }
      -
      80  }
      -
      81 
      -
      82  std::cout << "Passed!" << std::endl;
      -
      83  return true;
      -
      84 }
      +
      54 {
      +
      55 std::cout << "---- Check 2\t";
      +
      56 unsigned int i, number = 100;
      + +
      58 for (i = 2; i <= number; i++) /* Multiply every number from 2 thru N */
      +
      59 result *= i;
      +
      60
      +
      61 const char *known_reslt =
      +
      62 "9332621544394415268169923885626670049071596826438162146859296389521759"
      +
      63 "9993229915608941463976156518286253697920827223758251185210916864000000"
      +
      64 "000000000000000000";
      +
      65
      +
      66 /* check 1 */
      +
      67 if (strlen(known_reslt) != result.num_digits()) {
      +
      68 std::cerr << "Result lengths dont match! " << strlen(known_reslt)
      +
      69 << " != " << result.num_digits() << std::endl;
      +
      70 return false;
      +
      71 }
      +
      72
      +
      73 const size_t N = result.num_digits();
      +
      74 for (i = 0; i < N; i++) {
      +
      75 if (known_reslt[i] != result.digit_char(i)) {
      +
      76 std::cerr << i << "^th digit mismatch! " << known_reslt[i]
      +
      77 << " != " << result.digit_char(i) << std::endl;
      +
      78 return false;
      +
      79 }
      +
      80 }
      +
      81
      +
      82 std::cout << "Passed!" << std::endl;
      +
      83 return true;
      +
      84}
      Here is the call graph for this function:
      @@ -318,7 +317,7 @@ Here is the call graph for this function:
      diff --git a/d6/d9d/large__factorial_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d6/d9d/large__factorial_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg index 1499e6acd..079e970b4 100644 --- a/d6/d9d/large__factorial_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg +++ b/d6/d9d/large__factorial_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - diff --git a/d6/d9e/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info__coll__graph.md5 b/d6/d9e/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info__coll__graph.md5 deleted file mode 100644 index 358f5500b..000000000 --- a/d6/d9e/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -7fd835ac9fd2c00d63887d6fca61fab6 \ No newline at end of file diff --git a/d6/d9e/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info__coll__graph.svg b/d6/d9e/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info__coll__graph.svg deleted file mode 100644 index 1b6552a45..000000000 --- a/d6/d9e/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1_info__coll__graph.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - -machine_learning::aystar_search::AyStarSearch< Puzzle >::Info - - - -Node1 - - -machine_learning::aystar -_search::AyStarSearch< - Puzzle >::Info - - - - - -Node2 - - -std::shared_ptr< Puzzle > - - - - - -Node2->Node1 - - - state - - - diff --git a/d6/da2/namespacevigenere.html b/d6/da2/namespacevigenere.html index 9adaa00e0..4dc8c82b4 100644 --- a/d6/da2/namespacevigenere.html +++ b/d6/da2/namespacevigenere.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: vigenere Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d6/da2/namespacevigenere.html','../../
      -
      -
      vigenere Namespace Reference
      +
      vigenere Namespace Reference
      -

      Functions for vigenère cipher algorithm. +

      Functions for vigenère cipher algorithm. More...

      Detailed Description

      -

      Functions for vigenère cipher algorithm.

      +

      Functions for vigenère cipher algorithm.

      diff --git a/d6/da8/0__1__knapsack_8cpp__incl.svg b/d6/da8/0__1__knapsack_8cpp__incl.svg index d2f6174a0..2111848c9 100644 --- a/d6/da8/0__1__knapsack_8cpp__incl.svg +++ b/d6/da8/0__1__knapsack_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: tree_234 Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d6/dab/namespacetree__234.html','../..
      -
      -
      tree_234 Namespace Reference
      +
      tree_234 Namespace Reference
      -

      Functions for 2–3–4 tree +

      Functions for 2–3–4 tree More...

      Detailed Description

      -

      Functions for 2–3–4 tree

      +

      Functions for 2–3–4 tree

      diff --git a/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html b/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html index c6e27ae07..cee28aed9 100644 --- a/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html +++ b/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: others::lru_cache::LRUCache Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -94,21 +94,14 @@ $(document).ready(function(){initNavTree('d6/dae/classothers_1_1lru__cache_1_1_l Public Member Functions | Private Attributes | List of all members -
      -
      others::lru_cache::LRUCache Class Reference
      +
      others::lru_cache::LRUCache Class Reference

      LRU cache class. More...

      -
      -Collaboration diagram for others::lru_cache::LRUCache:
      -
      -
      -
      -
      [legend]
      - @@ -126,18 +119,18 @@ Public Member Functions

      +

      Public Member Functions

       LRUCache (uint64_t pf)
       Constructor, Initialize thee LRU class with page frame. More...
       A function to get page fault. More...
       
      - - + - + - + @@ -147,9 +140,9 @@ uint64_t 

      +

      Private Attributes

      -uint64_t pageFrame
      +uint64_t pageFrame
       Page frame, or total size of the cache.
       
      -std::list< uint64_t > cache
      +std::list< uint64_t > cache
       Cache linked list (using the STL)
       
      -std::unordered_map< uint64_t, std::list< uint64_t >::iterator > pageMap
      +std::unordered_map< uint64_t, std::list< uint64_t >::iterator > pageMap
       Hash map containing pages and their addresses.
       
      uint64_t hits
       

      Detailed Description

      -

      LRU cache class.

      +

      LRU cache class.

      Constructor & Destructor Documentation

      - +

      ◆ LRUCache()

      @@ -180,13 +173,13 @@ uint64_t 
      84 { pageFrame = pf; }
      +
      84{ pageFrame = pf; }
      uint64_t pageFrame
      Page frame, or total size of the cache.
      Definition: lru_cache.cpp:68

      Member Function Documentation

      - +

      ◆ display()

      @@ -211,12 +204,12 @@ uint64_t 
      Returns
      Void
      -
      120  {
      -
      121  for (uint64_t &it : cache) {
      -
      122  std::cout << it << " ";
      -
      123  }
      -
      124  std::cout << std::endl;
      -
      125  }
      +
      120 {
      +
      121 for (uint64_t &it : cache) {
      +
      122 std::cout << it << " ";
      +
      123 }
      + +
      125 }
      std::list< uint64_t > cache
      Cache linked list (using the STL)
      Definition: lru_cache.cpp:69
      T endl(T... args)
      @@ -229,7 +222,7 @@ Here is the call graph for this function:
      - +

      ◆ getHits()

      @@ -254,12 +247,12 @@ Here is the call graph for this function:

      A function to get page hits.

      Returns
      int
      -
      130 { return hits; }
      +
      130{ return hits; }
      uint64_t hits
      was found in cache.
      Definition: lru_cache.cpp:73
      - +

      ◆ getPageFault()

      @@ -284,12 +277,12 @@ Here is the call graph for this function:

      A function to get page fault.

      Returns
      int
      -
      135 { return pageFault; }
      +
      135{ return pageFault; }
      uint64_t pageFault
      Definition: lru_cache.cpp:76
      - +

      ◆ refer()

      @@ -321,51 +314,37 @@ Here is the call graph for this function:
      Returns
      void
      -

      < Increase the page fault by one.

      -
      91  {
      -
      92  // If the page requested not in cache.
      -
      93  if (pageMap.find(page) == pageMap.end()) {
      -
      94  pageFault++; ///< Increase the page fault by one.
      -
      95 
      -
      96  // Check if the cache is full
      -
      97  if (cache.size() == pageFrame) {
      -
      98  // delete the last page from cache
      -
      99  uint64_t lastPage = cache.back();
      -
      100  cache.pop_back();
      -
      101  pageMap.erase(lastPage);
      -
      102  }
      -
      103  }
      -
      104  // The requested page is in the cache
      -
      105  else {
      -
      106  hits++;
      -
      107  // present in cache, erase from current position to bring in front
      -
      108  cache.erase(pageMap[page]);
      -
      109  }
      -
      110  // Push it in the front of the cache and update the page reference in
      -
      111  // page map.
      -
      112  cache.push_front(page);
      -
      113  pageMap[page] = cache.begin();
      -
      114  }
      -
      T back(T... args)
      -
      T begin(T... args)
      +

      < Increase the page fault by one.

      +
      91 {
      +
      92 // If the page requested not in cache.
      +
      93 if (pageMap.find(page) == pageMap.end()) {
      +
      94 pageFault++; ///< Increase the page fault by one.
      +
      95
      +
      96 // Check if the cache is full
      +
      97 if (cache.size() == pageFrame) {
      +
      98 // delete the last page from cache
      +
      99 uint64_t lastPage = cache.back();
      +
      100 cache.pop_back();
      +
      101 pageMap.erase(lastPage);
      +
      102 }
      +
      103 }
      +
      104 // The requested page is in the cache
      +
      105 else {
      +
      106 hits++;
      +
      107 // present in cache, erase from current position to bring in front
      +
      108 cache.erase(pageMap[page]);
      +
      109 }
      +
      110 // Push it in the front of the cache and update the page reference in
      +
      111 // page map.
      +
      112 cache.push_front(page);
      +
      113 pageMap[page] = cache.begin();
      +
      114 }
      std::unordered_map< uint64_t, std::list< uint64_t >::iterator > pageMap
      Hash map containing pages and their addresses.
      Definition: lru_cache.cpp:71
      -
      T end(T... args)
      -
      T erase(T... args)
      -
      T find(T... args)
      -
      T pop_back(T... args)
      -
      T push_front(T... args)
      -
      T size(T... args)
      -
      -Here is the call graph for this function:
      -
      -
      -
      -
      - +

      Member Data Documentation

      - +

      ◆ hits

      @@ -388,11 +367,11 @@ Here is the call graph for this function:
      0

      was found in cache.

      -

      Total number of hits, or total number of times a page

      +

      Total number of hits, or total number of times a page

      - +

      ◆ pageFault

      @@ -411,7 +390,7 @@ Here is the call graph for this function:
      -

      Total number of miss/page fault, or total number of times a page was not found in cache

      +

      Total number of miss/page fault, or total number of times a page was not found in cache

      @@ -424,7 +403,7 @@ Here is the call graph for this function: diff --git a/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.map b/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.map deleted file mode 100644 index 3796cac1d..000000000 --- a/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.map +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.md5 b/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.md5 deleted file mode 100644 index c2a07bfa3..000000000 --- a/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -8d34906632cd4341388e0e546730454b \ No newline at end of file diff --git a/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.svg b/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.svg deleted file mode 100644 index 15d03a754..000000000 --- a/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.svg +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - -others::lru_cache::LRUCache::refer - - - -Node1 - - -others::lru_cache:: -LRUCache::refer - - - - - -Node2 - - -std::list::back - - - - - -Node1->Node2 - - - - - -Node3 - - -std::list::begin - - - - - -Node1->Node3 - - - - - -Node4 - - -std::unordered_map::end - - - - - -Node1->Node4 - - - - - -Node5 - - -std::unordered_map -::erase - - - - - -Node1->Node5 - - - - - -Node6 - - -std::list::erase - - - - - -Node1->Node6 - - - - - -Node7 - - -std::unordered_map -::find - - - - - -Node1->Node7 - - - - - -Node8 - - -std::list::pop_back - - - - - -Node1->Node8 - - - - - -Node9 - - -std::list::push_front - - - - - -Node1->Node9 - - - - - -Node10 - - -std::list::size - - - - - -Node1->Node10 - - - - - diff --git a/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_aad506b1c1a3cd5b93cc7e497626bfb53_cgraph.svg b/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_aad506b1c1a3cd5b93cc7e497626bfb53_cgraph.svg index aea8c1c18..e85cdff9a 100644 --- a/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_aad506b1c1a3cd5b93cc7e497626bfb53_cgraph.svg +++ b/d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_aad506b1c1a3cd5b93cc7e497626bfb53_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: probability/binomial_dist.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('d6/db0/binomial__dist_8cpp.html','../.
      -
      -
      binomial_dist.cpp File Reference
      +
      binomial_dist.cpp File Reference
      -

      Binomial distribution example +

      Binomial distribution example More...

      #include <cmath>
      #include <iostream>
      @@ -108,7 +107,7 @@ Include dependency graph for binomial_dist.cpp:
      - @@ -126,15 +125,15 @@ Functions

      +

      Functions

      double binomial_expected (double n, double p)
       
       

      Detailed Description

      -

      Binomial distribution example

      -

      The binomial distribution models the number of successes in a sequence of n independent events

      -

      Summary of variables used:

        +

        Binomial distribution example

        +

        The binomial distribution models the number of successes in a sequence of n independent events

        +

        Summary of variables used:

        • n : number of trials
        • p : probability of success
        • x : desired successes

        Function Documentation

        - +

        ◆ binomial_expected()

        @@ -159,7 +158,7 @@ Functions
        -

        finds the expected value of a binomial distribution

        Parameters
        +

        finds the expected value of a binomial distribution

        Parameters
        @@ -167,11 +166,11 @@ Functions
        Returns
        \(\mu=np\)
        -
        22 { return n * p; }
        +
        22{ return n * p; }
        - +

        ◆ binomial_range_successes()

        @@ -208,14 +207,14 @@ Functions
        [in]n
        [in]p
        -

        calculates the probability of a result within a range (inclusive, inclusive)

        Returns
        \(\displaystyle \left.P(n,p)\right|_{x_0}^{x_1} = \sum_{i=x_0}^{x_1} P(i) =\sum_{i=x_0}^{x_1} {n\choose i} p^i (1-p)^{n-i}\)
        -
        75  {
        -
        76  double probability = 0;
        -
        77  for (int i = lower_bound; i <= upper_bound; i++) {
        -
        78  probability += nCr(n, i) * std::pow(p, i) * std::pow(1 - p, n - i);
        -
        79  }
        -
        80  return probability;
        -
        81 }
        +

        calculates the probability of a result within a range (inclusive, inclusive)

        Returns
        \(\displaystyle \left.P(n,p)\right|_{x_0}^{x_1} = \sum_{i=x_0}^{x_1} P(i) =\sum_{i=x_0}^{x_1} {n\choose i} p^i (1-p)^{n-i}\)
        +
        75 {
        +
        76 double probability = 0;
        +
        77 for (int i = lower_bound; i <= upper_bound; i++) {
        +
        78 probability += nCr(n, i) * std::pow(p, i) * std::pow(1 - p, n - i);
        +
        79 }
        +
        80 return probability;
        +
        81}
        double nCr(double n, double r)
        Definition: binomial_dist.cpp:47
        T pow(T... args)
        T upper_bound(T... args)
        @@ -228,7 +227,7 @@ Here is the call graph for this function:
        - +

        ◆ binomial_standard_deviation()

        @@ -253,7 +252,7 @@ Here is the call graph for this function:
      -

      finds the standard deviation of the binomial distribution

      Parameters
      +

      finds the standard deviation of the binomial distribution

      Parameters
      @@ -261,9 +260,9 @@ Here is the call graph for this function:
      Returns
      \(\sigma = \sqrt{\sigma^2} = \sqrt{n\cdot p\cdot (1-p)}\)
      -
      36  {
      -
      37  return std::sqrt(binomial_variance(n, p));
      -
      38 }
      +
      36 {
      +
      37 return std::sqrt(binomial_variance(n, p));
      +
      38}
      double binomial_variance(double n, double p)
      Definition: binomial_dist.cpp:29
      T sqrt(T... args)
      @@ -275,7 +274,7 @@ Here is the call graph for this function:
      - +

      ◆ binomial_variance()

      @@ -300,7 +299,7 @@ Here is the call graph for this function:
      [in]n
      [in]p
      -

      finds the variance of the binomial distribution

      Parameters
      +

      finds the variance of the binomial distribution

      Parameters
      @@ -308,11 +307,11 @@ Here is the call graph for this function:
      Returns
      \(\sigma^2 = n\cdot p\cdot (1-p)\)
      -
      29 { return n * p * (1 - p); }
      +
      29{ return n * p * (1 - p); }
      - +

      ◆ binomial_x_successes()

      @@ -343,10 +342,10 @@ Here is the call graph for this function:
      [in]n
      [in]p
      -

      calculates the probability of exactly x successes

      Returns
      \(\displaystyle P(n,p,x) = {n\choose x} p^x (1-p)^{n-x}\)
      -
      65  {
      -
      66  return nCr(n, x) * std::pow(p, x) * std::pow(1 - p, n - x);
      -
      67 }
      +

      calculates the probability of exactly x successes

      Returns
      \(\displaystyle P(n,p,x) = {n\choose x} p^x (1-p)^{n-x}\)
      +
      65 {
      +
      66 return nCr(n, x) * std::pow(p, x) * std::pow(1 - p, n - x);
      +
      67}
      Here is the call graph for this function:
      @@ -356,7 +355,7 @@ Here is the call graph for this function:
      - +

      ◆ main()

      @@ -371,24 +370,24 @@ Here is the call graph for this function:
      -

      main function

      -
      84  {
      -
      85  std::cout << "expected value : " << binomial_expected(100, 0.5)
      -
      86  << std::endl;
      -
      87 
      -
      88  std::cout << "variance : " << binomial_variance(100, 0.5) << std::endl;
      -
      89 
      -
      90  std::cout << "standard deviation : "
      -
      91  << binomial_standard_deviation(100, 0.5) << std::endl;
      -
      92 
      -
      93  std::cout << "exactly 30 successes : " << binomial_x_successes(100, 0.5, 30)
      -
      94  << std::endl;
      -
      95 
      -
      96  std::cout << "45 or more successes : "
      -
      97  << binomial_range_successes(100, 0.5, 45, 100) << std::endl;
      -
      98 
      -
      99  return 0;
      -
      100 }
      +

      main function

      +
      84 {
      +
      85 std::cout << "expected value : " << binomial_expected(100, 0.5)
      +
      86 << std::endl;
      +
      87
      +
      88 std::cout << "variance : " << binomial_variance(100, 0.5) << std::endl;
      +
      89
      +
      90 std::cout << "standard deviation : "
      + +
      92
      +
      93 std::cout << "exactly 30 successes : " << binomial_x_successes(100, 0.5, 30)
      +
      94 << std::endl;
      +
      95
      +
      96 std::cout << "45 or more successes : "
      +
      97 << binomial_range_successes(100, 0.5, 45, 100) << std::endl;
      +
      98
      +
      99 return 0;
      +
      100}
      double binomial_x_successes(double n, double p, double x)
      Definition: binomial_dist.cpp:65
      double binomial_expected(double n, double p)
      Definition: binomial_dist.cpp:22
      @@ -404,7 +403,7 @@ Here is the call graph for this function:
      - +

      ◆ nCr()

      @@ -429,7 +428,7 @@ Here is the call graph for this function:
      -

      Computes n choose r

      Parameters
      +

      Computes n choose r

      Parameters
      @@ -437,20 +436,20 @@ Here is the call graph for this function:
      Returns
      \(\displaystyle {n\choose r} = \frac{n!}{r!(n-r)!} = \frac{n\times(n-1)\times(n-2)\times\cdots(n-r)}{r!} \)
      -
      47  {
      -
      48  double numerator = n;
      -
      49  double denominator = r;
      -
      50 
      -
      51  for (int i = n - 1; i >= ((n - r) + 1); i--) {
      -
      52  numerator *= i;
      -
      53  }
      -
      54 
      -
      55  for (int i = 1; i < r; i++) {
      -
      56  denominator *= i;
      -
      57  }
      -
      58 
      -
      59  return numerator / denominator;
      -
      60 }
      +
      47 {
      +
      48 double numerator = n;
      +
      49 double denominator = r;
      +
      50
      +
      51 for (int i = n - 1; i >= ((n - r) + 1); i--) {
      +
      52 numerator *= i;
      +
      53 }
      +
      54
      +
      55 for (int i = 1; i < r; i++) {
      +
      56 denominator *= i;
      +
      57 }
      +
      58
      +
      59 return numerator / denominator;
      +
      60}
      @@ -460,7 +459,7 @@ Here is the call graph for this function: diff --git a/d6/db0/binomial__dist_8cpp_a19ae0a6a2bd200fd1eb0e31b2bf4cc76_cgraph.svg b/d6/db0/binomial__dist_8cpp_a19ae0a6a2bd200fd1eb0e31b2bf4cc76_cgraph.svg index 116436f4a..4f656b6ab 100644 --- a/d6/db0/binomial__dist_8cpp_a19ae0a6a2bd200fd1eb0e31b2bf4cc76_cgraph.svg +++ b/d6/db0/binomial__dist_8cpp_a19ae0a6a2bd200fd1eb0e31b2bf4cc76_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - + +Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
      [in]n
      [in]r
      -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,27 +90,26 @@ $(document).ready(function(){initNavTree('d4/d90/classdata__structures_1_1_skip_
      -
      -
      data_structures::SkipList Member List
      +
      data_structures::SkipList Member List
      diff --git a/d6/db8/inv__sqrt_8cpp.html b/d6/db8/inv__sqrt_8cpp.html index ced09b9e3..e1deda229 100644 --- a/d6/db8/inv__sqrt_8cpp.html +++ b/d6/db8/inv__sqrt_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: math/inv_sqrt.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('d6/db8/inv__sqrt_8cpp.html','../../');
      -
      -
      inv_sqrt.cpp File Reference
      +
      inv_sqrt.cpp File Reference
      -

      Implementation of the inverse square root Root. +

      Implementation of the inverse square root Root. More...

      #include <cassert>
      #include <cmath>
      @@ -110,7 +109,7 @@ Include dependency graph for inv_sqrt.cpp:
      - @@ -118,7 +117,7 @@ Functions - + @@ -128,10 +127,10 @@ Functions

      +

      Functions

      template<typename T = double, char iterations = 2>
      Fast_InvSqrt (T x)
       
      template<typename T = double>
      Standard_InvSqrt (T number)
       This is the function that calculates the fast inverse square root. The following code is the fast inverse square root with standard lib (cmath) More information can be found at LinkedIn More...
       This is the function that calculates the fast inverse square root. The following code is the fast inverse square root with standard lib (cmath) More information can be found at LinkedIn More...
       
      static void test ()
       Self-test implementations. More...
       

      Detailed Description

      -

      Implementation of the inverse square root Root.

      -

      Two implementation to calculate inverse inverse root, from Quake III Arena (C++ version) and with a standard library (cmath). This algorithm is used to calculate shadows in Quake III Arena.

      +

      Implementation of the inverse square root Root.

      +

      Two implementation to calculate inverse inverse root, from Quake III Arena (C++ version) and with a standard library (cmath). This algorithm is used to calculate shadows in Quake III Arena.

      Function Documentation

      - +

      ◆ Fast_InvSqrt()

      @@ -158,8 +157,8 @@ template<typename T = double, char iterations = 2>

      for numeric_limits

      -

      for assert for std::sqrt for IO operations

      -

      This is the function that calculates the fast inverse square root. The following code is the fast inverse square root implementation from Quake III Arena (Adapted for C++). More information can be found at Wikipedia

      Template Parameters
      +

      for assert for std::sqrt for IO operations

      +

      This is the function that calculates the fast inverse square root. The following code is the fast inverse square root implementation from Quake III Arena (Adapted for C++). More information can be found at Wikipedia

      Template Parameters
      @@ -173,32 +172,32 @@ template<typename T = double, char iterations = 2>
      Returns
      the inverse square root
      -
      28  {
      -
      29  using Tint = typename std::conditional<sizeof(T) == 8, std::int64_t,
      -
      30  std::int32_t>::type;
      -
      31  T y = x;
      -
      32  T x2 = y * 0.5;
      -
      33 
      -
      34  Tint i =
      -
      35  *reinterpret_cast<Tint *>(&y); // Store floating-point bits in integer
      -
      36 
      -
      37  i = (sizeof(T) == 8 ? 0x5fe6eb50c7b537a9 : 0x5f3759df) -
      -
      38  (i >> 1); // Initial guess for Newton's method
      -
      39 
      -
      40  y = *reinterpret_cast<T *>(&i); // Convert new bits into float
      -
      41 
      -
      42  y = y * (1.5 - (x2 * y * y)); // 1st iteration Newton's method
      -
      43  if (iterations == 2) {
      -
      44  y = y * (1.5 - (x2 * y * y)); // 2nd iteration, the more exact result
      -
      45  }
      -
      46  return y;
      -
      47 }
      +
      28 {
      +
      29 using Tint = typename std::conditional<sizeof(T) == 8, std::int64_t,
      +
      30 std::int32_t>::type;
      +
      31 T y = x;
      +
      32 T x2 = y * 0.5;
      +
      33
      +
      34 Tint i =
      +
      35 *reinterpret_cast<Tint *>(&y); // Store floating-point bits in integer
      +
      36
      +
      37 i = (sizeof(T) == 8 ? 0x5fe6eb50c7b537a9 : 0x5f3759df) -
      +
      38 (i >> 1); // Initial guess for Newton's method
      +
      39
      +
      40 y = *reinterpret_cast<T *>(&i); // Convert new bits into float
      +
      41
      +
      42 y = y * (1.5 - (x2 * y * y)); // 1st iteration Newton's method
      +
      43 if (iterations == 2) {
      +
      44 y = y * (1.5 - (x2 * y * y)); // 2nd iteration, the more exact result
      +
      45 }
      +
      46 return y;
      +
      47}
      - +

      ◆ main()

      @@ -216,23 +215,23 @@ template<typename T = double, char iterations = 2>

      Main function.

      Returns
      0 on exit
      -
      87  {
      -
      88  test(); // run self-test implementations
      -
      89  std::cout << "The Fast inverse square root of 36 is: "
      -
      90  << Fast_InvSqrt<float, 1>(36.0f) << std::endl;
      -
      91  std::cout << "The Fast inverse square root of 36 is: "
      -
      92  << Fast_InvSqrt<double, 2>(36.0f) << " (2 iterations)"
      -
      93  << std::endl;
      -
      94  std::cout << "The Fast inverse square root of 100 is: "
      -
      95  << Fast_InvSqrt(100.0f)
      -
      96  << " (With default template type and iterations: double, 2)"
      -
      97  << std::endl;
      -
      98  std::cout << "The Standard inverse square root of 36 is: "
      -
      99  << Standard_InvSqrt<float>(36.0f) << std::endl;
      -
      100  std::cout << "The Standard inverse square root of 100 is: "
      -
      101  << Standard_InvSqrt(100.0f)
      -
      102  << " (With default template type: double)" << std::endl;
      -
      103 }
      +
      87 {
      +
      88 test(); // run self-test implementations
      +
      89 std::cout << "The Fast inverse square root of 36 is: "
      +
      90 << Fast_InvSqrt<float, 1>(36.0f) << std::endl;
      +
      91 std::cout << "The Fast inverse square root of 36 is: "
      +
      92 << Fast_InvSqrt<double, 2>(36.0f) << " (2 iterations)"
      +
      93 << std::endl;
      +
      94 std::cout << "The Fast inverse square root of 100 is: "
      +
      95 << Fast_InvSqrt(100.0f)
      +
      96 << " (With default template type and iterations: double, 2)"
      +
      97 << std::endl;
      +
      98 std::cout << "The Standard inverse square root of 36 is: "
      +
      99 << Standard_InvSqrt<float>(36.0f) << std::endl;
      +
      100 std::cout << "The Standard inverse square root of 100 is: "
      +
      101 << Standard_InvSqrt(100.0f)
      +
      102 << " (With default template type: double)" << std::endl;
      +
      103}
      T endl(T... args)
      T Standard_InvSqrt(T number)
      This is the function that calculates the fast inverse square root. The following code is the fast inv...
      Definition: inv_sqrt.cpp:59
      @@ -247,7 +246,7 @@ Here is the call graph for this function:
      - +

      ◆ Standard_InvSqrt()

      @@ -265,7 +264,7 @@ template<typename T = double>
      Tfloating type
      iterationsinverse square root, the greater the number of iterations, the more exact the result will be (1 or 2).
      -

      This is the function that calculates the fast inverse square root. The following code is the fast inverse square root with standard lib (cmath) More information can be found at LinkedIn

      +

      This is the function that calculates the fast inverse square root. The following code is the fast inverse square root with standard lib (cmath) More information can be found at LinkedIn

      Template Parameters
      @@ -279,15 +278,15 @@ template<typename T = double>
      Returns
      the inverse square root
      -
      59  {
      -
      60  T squareRoot = sqrt(number);
      -
      61  return 1.0f / squareRoot;
      -
      62 }
      +
      59 {
      +
      60 T squareRoot = sqrt(number);
      +
      61 return 1.0f / squareRoot;
      +
      62}
      T sqrt(T... args)
      - +

      ◆ test()

      @@ -312,20 +311,20 @@ template<typename T = double>

      Self-test implementations.

      Returns
      void
      -
      68  {
      -
      69  const float epsilon = 1e-3f;
      -
      70 
      -
      71  /* Tests with multiple values */
      -
      72  assert(std::fabs(Standard_InvSqrt<float>(100.0f) - 0.0998449f) < epsilon);
      -
      73  assert(std::fabs(Standard_InvSqrt<double>(36.0f) - 0.166667f) < epsilon);
      -
      74  assert(std::fabs(Standard_InvSqrt(12.0f) - 0.288423f) < epsilon);
      -
      75  assert(std::fabs(Standard_InvSqrt<double>(5.0f) - 0.447141f) < epsilon);
      -
      76 
      -
      77  assert(std::fabs(Fast_InvSqrt<float, 1>(100.0f) - 0.0998449f) < epsilon);
      -
      78  assert(std::fabs(Fast_InvSqrt<double, 1>(36.0f) - 0.166667f) < epsilon);
      -
      79  assert(std::fabs(Fast_InvSqrt(12.0f) - 0.288423) < epsilon);
      -
      80  assert(std::fabs(Fast_InvSqrt<double>(5.0f) - 0.447141) < epsilon);
      -
      81 }
      +
      68 {
      +
      69 const float epsilon = 1e-3f;
      +
      70
      +
      71 /* Tests with multiple values */
      +
      72 assert(std::fabs(Standard_InvSqrt<float>(100.0f) - 0.0998449f) < epsilon);
      +
      73 assert(std::fabs(Standard_InvSqrt<double>(36.0f) - 0.166667f) < epsilon);
      +
      74 assert(std::fabs(Standard_InvSqrt(12.0f) - 0.288423f) < epsilon);
      +
      75 assert(std::fabs(Standard_InvSqrt<double>(5.0f) - 0.447141f) < epsilon);
      +
      76
      +
      77 assert(std::fabs(Fast_InvSqrt<float, 1>(100.0f) - 0.0998449f) < epsilon);
      +
      78 assert(std::fabs(Fast_InvSqrt<double, 1>(36.0f) - 0.166667f) < epsilon);
      +
      79 assert(std::fabs(Fast_InvSqrt(12.0f) - 0.288423) < epsilon);
      +
      80 assert(std::fabs(Fast_InvSqrt<double>(5.0f) - 0.447141) < epsilon);
      +
      81}
      T fabs(T... args)
      Here is the call graph for this function:
      @@ -342,7 +341,7 @@ Here is the call graph for this function:
      diff --git a/d6/db8/inv__sqrt_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d6/db8/inv__sqrt_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 666619ed1..85eb07f6e 100644 --- a/d6/db8/inv__sqrt_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d6/db8/inv__sqrt_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - + +Algorithms_in_C++: math::ncr_modulo_p::NCRModuloP Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
      Tfloating type
      -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -94,21 +94,14 @@ $(document).ready(function(){initNavTree('d6/dc1/classmath_1_1ncr__modulo__p_1_1 Public Member Functions | Private Attributes | List of all members -
      -
      math::ncr_modulo_p::NCRModuloP Class Reference
      +
      math::ncr_modulo_p::NCRModuloP Class Reference

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

      -
      -Collaboration diagram for math::ncr_modulo_p::NCRModuloP:
      -
      -
      -
      -
      [legend]
      - @@ -120,20 +113,20 @@ Public Member Functions

      +

      Public Member Functions

       NCRModuloP (const uint64_t &size, const uint64_t &mod)
       the p from (nCr % p) More...
      int64_t ncr (const uint64_t &n, const uint64_t &r, const uint64_t &p)
       
      - - - +

      +

      Private Attributes

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

      Detailed Description

      -

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

      +

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

      Constructor & Destructor Documentation

      - +

      ◆ NCRModuloP()

      @@ -168,22 +161,22 @@ uint64_t 

      the p from (nCr % p)

      -

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

      -
      41  {
      -
      42  p = mod;
      -
      43  fac = std::vector<uint64_t>(size);
      -
      44  fac[0] = 1;
      -
      45  for (int i = 1; i <= size; i++) {
      -
      46  fac[i] = (fac[i - 1] * i) % p;
      -
      47  }
      -
      48  }
      +

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

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

      Member Function Documentation

      - +

      ◆ gcdExtended()

      @@ -228,33 +221,33 @@ uint64_t  -

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

      -

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

      Returns
      the gcd of a and b
      -
      57  {
      -
      58  if (a == 0) {
      -
      59  *x = 0, *y = 1;
      -
      60  return b;
      -
      61  }
      -
      62 
      -
      63  int64_t x1 = 0, y1 = 0;
      -
      64  uint64_t gcd = gcdExtended(b % a, a, &x1, &y1);
      -
      65 
      -
      66  *x = y1 - (b / a) * x1;
      -
      67  *y = x1;
      -
      68  return gcd;
      -
      69  }
      +

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

      +

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

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

      ◆ modInverse()

      @@ -287,28 +280,28 @@ Here is the call graph for this function:
      -

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

      -

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

      Returns
      the modular inverse of a
      -
      76  {
      -
      77  int64_t x = 0, y = 0;
      -
      78  uint64_t g = gcdExtended(a, m, &x, &y);
      -
      79  if (g != 1) { // modular inverse doesn't exist
      -
      80  return -1;
      -
      81  } else {
      -
      82  int64_t res = ((x + m) % m);
      -
      83  return res;
      -
      84  }
      -
      85  }
      +

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

      +

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

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

      ◆ ncr()

      @@ -347,30 +340,30 @@ Here is the call graph for this function:
      -

      Find nCr % p

      -

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

      Returns
      the value nCr % p
      -
      92  {
      -
      93  // Base cases
      -
      94  if (r > n) {
      -
      95  return 0;
      -
      96  }
      -
      97  if (r == 1) {
      -
      98  return n % p;
      -
      99  }
      -
      100  if (r == 0 || r == n) {
      -
      101  return 1;
      -
      102  }
      -
      103  // fac is a global array with fac[r] = (r! % p)
      -
      104  int64_t denominator = modInverse(fac[r], p);
      -
      105  if (denominator < 0) { // modular inverse doesn't exist
      -
      106  return -1;
      -
      107  }
      -
      108  denominator = (denominator * modInverse(fac[n - r], p)) % p;
      -
      109  if (denominator < 0) { // modular inverse doesn't exist
      -
      110  return -1;
      -
      111  }
      -
      112  return (fac[n] * denominator) % p;
      -
      113  }
      +

      Find nCr % p

      +

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

      Returns
      the value nCr % p
      +
      92 {
      +
      93 // Base cases
      +
      94 if (r > n) {
      +
      95 return 0;
      +
      96 }
      +
      97 if (r == 1) {
      +
      98 return n % p;
      +
      99 }
      +
      100 if (r == 0 || r == n) {
      +
      101 return 1;
      +
      102 }
      +
      103 // fac is a global array with fac[r] = (r! % p)
      +
      104 int64_t denominator = modInverse(fac[r], p);
      +
      105 if (denominator < 0) { // modular inverse doesn't exist
      +
      106 return -1;
      +
      107 }
      +
      108 denominator = (denominator * modInverse(fac[n - r], p)) % p;
      +
      109 if (denominator < 0) { // modular inverse doesn't exist
      +
      110 return -1;
      +
      111 }
      +
      112 return (fac[n] * denominator) % p;
      +
      113 }
      int64_t modInverse(const uint64_t &a, const uint64_t &m)
      Definition: ncr_modulo_p.cpp:76
      Here is the call graph for this function:
      @@ -390,7 +383,7 @@ Here is the call graph for this function:
      diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.js b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.js index b4a2aea37..a761f61e0 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.js +++ b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.js @@ -4,6 +4,5 @@ var classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p = [ "gcdExtended", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#afde201f4687740454302c444f507a926", null ], [ "modInverse", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#a0431ec5c876e1154d8e1e5f89e1ab34a", null ], [ "ncr", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#a6b95277f5f527beacc8d0f3bc91fcd08", null ], - [ "fac", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#aed5b4a9e4fd57fe23812293d4a0f30c1", null ], [ "p", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html#a57c168cd6eb85718eab97da658a698ad", null ] ]; \ No newline at end of file diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.map b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.map index 71bea9cb7..9b731b156 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.map +++ b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.map @@ -1,5 +1,5 @@ - - - + + + diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.md5 b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.md5 index 844443be0..9dbf75699 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.md5 +++ b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.md5 @@ -1 +1 @@ -e1fb048ed00e8c3654adecc462b29fc1 \ No newline at end of file +c35711258338883cd2fe1f0fa71a740b \ No newline at end of file diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.svg b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.svg index 97a0512df..8bbf9aa11 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.svg +++ b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a0431ec5c876e1154d8e1e5f89e1ab34a_cgraph.svg @@ -1,14 +1,14 @@ - - - + + math::ncr_modulo_p::NCRModuloP::modInverse - + Node1 @@ -35,6 +35,12 @@ + + +Node2->Node2 + + + Node3 diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.map b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.map index 58929d562..43f82d376 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.map +++ b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.map @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.md5 b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.md5 index 32b369b8f..aa69cb613 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.md5 +++ b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.md5 @@ -1 +1 @@ -e5d1a12ad0580534755405f5b3336a69 \ No newline at end of file +c99b9dccc01ebb1922daccf27fa2342e \ No newline at end of file diff --git a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.svg b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.svg index a44dcc5ec..88e444bcb 100644 --- a/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.svg +++ b/d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p_a6b95277f5f527beacc8d0f3bc91fcd08_cgraph.svg @@ -1,10 +1,10 @@ - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -others::lru_cache::LRUCache - - - -Node1 - - -others::lru_cache:: -LRUCache - - - - - -Node2 - - -std::unordered_map -< uint64_t, std::list -< uint64_t >::iterator > - - - - - -Node2->Node1 - - - pageMap - - - -Node3 - - -std::uint64_t - - - - - -Node3->Node2 - - - keys - - - -Node4 - - -std::list< uint64_t > - - - - - -Node3->Node4 - - - elements - - - -Node4->Node1 - - - cache - - - -Node4->Node2 - - - elements - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/d8/da6/classothers_1_1lru__cache_1_1_l_r_u_cache__coll__graph_org.svg b/d8/da6/classothers_1_1lru__cache_1_1_l_r_u_cache__coll__graph_org.svg deleted file mode 100644 index 2ddcb4875..000000000 --- a/d8/da6/classothers_1_1lru__cache_1_1_l_r_u_cache__coll__graph_org.svg +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - -others::lru_cache::LRUCache - - - -Node1 - - -others::lru_cache:: -LRUCache - - - - - -Node2 - - -std::unordered_map -< uint64_t, std::list -< uint64_t >::iterator > - - - - - -Node2->Node1 - - - pageMap - - - -Node3 - - -std::uint64_t - - - - - -Node3->Node2 - - - keys - - - -Node4 - - -std::list< uint64_t > - - - - - -Node3->Node4 - - - elements - - - -Node4->Node1 - - - cache - - - -Node4->Node2 - - - elements - - - diff --git a/d8/da7/namespacedepth__first__search.html b/d8/da7/namespacedepth__first__search.html index 336d1aebe..90eadef5a 100644 --- a/d8/da7/namespacedepth__first__search.html +++ b/d8/da7/namespacedepth__first__search.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: depth_first_search Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d8/da7/namespacedepth__first__search.h
      -
      -
      depth_first_search Namespace Reference
      +
      depth_first_search Namespace Reference
      -

      Functions for Depth First Search algorithm. +

      Functions for Depth First Search algorithm. More...

      Detailed Description

      -

      Functions for Depth First Search algorithm.

      +

      Functions for Depth First Search algorithm.

      diff --git a/d8/dab/classstatistics_1_1stats__computer2.html b/d8/dab/classstatistics_1_1stats__computer2.html index c0ad30daf..a2a1d742b 100644 --- a/d8/dab/classstatistics_1_1stats__computer2.html +++ b/d8/dab/classstatistics_1_1stats__computer2.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: statistics::stats_computer2< T > Class Template Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -95,12 +95,11 @@ $(document).ready(function(){initNavTree('d8/dab/classstatistics_1_1stats__compu Private Attributes | Friends | List of all members -
      -
      statistics::stats_computer2< T > Class Template Reference
      +
      statistics::stats_computer2< T > Class Template Reference
      - @@ -111,33 +110,31 @@ Public Member Functions

      +

      Public Member Functions

      void new_val (T x)
       
      double std () const
       
      - - - - -

      +

      Private Attributes

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

      +

      Friends

      std::istreamoperator>> (std::istream &input, stats_computer2 &stat)
       
      std::istreamoperator>> (std::istream &input, stats_computer2 &stat)
       

      Detailed Description

      -

      template<typename T>
      -class statistics::stats_computer2< T >

      - -

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

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

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

      Member Function Documentation

      - +

      ◆ mean()

      @@ -161,12 +158,12 @@ template<typename T >
      -

      return sample mean computed till last sample

      -
      86 { return mu; }
      +

      return sample mean computed till last sample

      +
      86{ return mu; }
      - +

      ◆ new_val()

      @@ -191,23 +188,23 @@ template<typename T >
      -

      Constructor

      Parameters
      +

      Constructor

      Parameters
      [in]xnew data sample
      -
      77  {
      -
      78  n++;
      -
      79  double delta = x - mu;
      -
      80  mu += delta / n;
      -
      81  double delta2 = x - mu;
      -
      82  M += delta * delta2;
      -
      83  }
      +
      77 {
      +
      78 n++;
      +
      79 double delta = x - mu;
      +
      80 mu += delta / n;
      +
      81 double delta2 = x - mu;
      +
      82 M += delta * delta2;
      +
      83 }
      - +

      ◆ std()

      @@ -231,8 +228,8 @@ template<typename T >
      -

      return sample standard deviation computed till last sample

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

      return sample standard deviation computed till last sample

      +
      92{ return std::sqrt(this->variance()); }
      double variance() const
      Definition: realtime_stats.cpp:89
      T sqrt(T... args)
      @@ -244,7 +241,7 @@ Here is the call graph for this function:
      - +

      ◆ variance()

      @@ -268,14 +265,14 @@ template<typename T >
      -

      return data variance computed till last sample

      -
      89 { return M / n; }
      +

      return data variance computed till last sample

      +
      89{ return M / n; }

      Friends And Related Function Documentation

      - -

      ◆ operator>>

      + +

      ◆ operator>>

      @@ -286,7 +283,7 @@ template<typename T >
      - + @@ -309,14 +306,14 @@ template<typename T >
      std::istream& operator>> std::istream & operator>> ( std::istream input,
      -

      short-hand operator to read new sample from input stream
      +

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

      -
      98  {
      -
      99  T val;
      -
      100  input >> val;
      -
      101  stat.new_val(val);
      -
      102  return input;
      -
      103  }
      +
      98 {
      +
      99 T val;
      +
      100 input >> val;
      +
      101 stat.new_val(val);
      +
      102 return input;
      +
      103 }
      void new_val(T x)
      Definition: realtime_stats.cpp:77
      @@ -330,7 +327,7 @@ template<typename T >
      diff --git a/d8/dab/classstatistics_1_1stats__computer2.js b/d8/dab/classstatistics_1_1stats__computer2.js index 2e3c9679b..b72efc78c 100644 --- a/d8/dab/classstatistics_1_1stats__computer2.js +++ b/d8/dab/classstatistics_1_1stats__computer2.js @@ -4,9 +4,5 @@ var classstatistics_1_1stats__computer2 = [ "new_val", "d8/dab/classstatistics_1_1stats__computer2.html#ade6de704deea24fdc88077b3d9a0d534", null ], [ "std", "d8/dab/classstatistics_1_1stats__computer2.html#acf2e84df4fc386bb3295016ef8fd156e", null ], [ "variance", "d8/dab/classstatistics_1_1stats__computer2.html#af6198817084276113b3c064e87ce0555", null ], - [ "operator>>", "d8/dab/classstatistics_1_1stats__computer2.html#a7e7a1a2b0a03df0a70cac40d193421d2", null ], - [ "M", "d8/dab/classstatistics_1_1stats__computer2.html#a8daf58bdecd775b8a83ce9ad70c014c4", null ], - [ "mu", "d8/dab/classstatistics_1_1stats__computer2.html#a0acea0729769f430f2dc56260d179745", null ], - [ "n", "d8/dab/classstatistics_1_1stats__computer2.html#a80099005c6e5f9569b75da0e49b14cf6", null ], - [ "var", "d8/dab/classstatistics_1_1stats__computer2.html#ae1bfd81bd7bbbd4b0d51d7d956e532d2", null ] + [ "operator>>", "d8/dab/classstatistics_1_1stats__computer2.html#ab444d485c9e7db35bdc2ff6b7775291a", null ] ]; \ No newline at end of file diff --git a/d8/dab/classstatistics_1_1stats__computer2_acf2e84df4fc386bb3295016ef8fd156e_cgraph.svg b/d8/dab/classstatistics_1_1stats__computer2_acf2e84df4fc386bb3295016ef8fd156e_cgraph.svg index d0afbda42..8ff2c34b9 100644 --- a/d8/dab/classstatistics_1_1stats__computer2_acf2e84df4fc386bb3295016ef8fd156e_cgraph.svg +++ b/d8/dab/classstatistics_1_1stats__computer2_acf2e84df4fc386bb3295016ef8fd156e_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: math/binomial_calculate.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('d8/db1/binomial__calculate_8cpp.html', -
      -
      binomial_calculate.cpp File Reference
      +
      binomial_calculate.cpp File Reference
      -

      Program to calculate Binomial coefficients +

      Program to calculate Binomial coefficients More...

      #include <cassert>
      #include <cstdint>
      @@ -111,16 +110,16 @@ Include dependency graph for binomial_calculate.cpp:
      - - + - - + +

      +

      Namespaces

       math
      namespace  math
       for IO operations
       
       binomial
       Functions for Binomial coefficients implementation.
      namespace  binomial
       Functions for Binomial coefficients implementation.
       
      - @@ -133,10 +132,10 @@ Functions

      +

      Functions

      size_t math::binomial::calculate (int32_t n, int32_t k)
       Function to calculate binomial coefficients. More...
       

      Detailed Description

      -

      Program to calculate Binomial coefficients

      -
      Author
      astronmax
      +

      Program to calculate Binomial coefficients

      +
      Author
      astronmax

      Function Documentation

      - +

      ◆ calculate()

      @@ -171,23 +170,23 @@ Functions
      Returns
      binomial coefficient for n and k
      -
      32  {
      -
      33  // basic cases
      -
      34  if (k > (n / 2))
      -
      35  k = n - k;
      -
      36  if (k == 1)
      -
      37  return n;
      -
      38  if (k == 0)
      -
      39  return 1;
      -
      40 
      -
      41  size_t result = 1;
      -
      42  for (int32_t i = 1; i <= k; ++i) {
      -
      43  result *= n - k + i;
      -
      44  result /= i;
      -
      45  }
      -
      46 
      -
      47  return result;
      -
      48 }
      +
      32 {
      +
      33 // basic cases
      +
      34 if (k > (n / 2))
      +
      35 k = n - k;
      +
      36 if (k == 1)
      +
      37 return n;
      +
      38 if (k == 0)
      +
      39 return 1;
      +
      40
      +
      41 size_t result = 1;
      +
      42 for (int32_t i = 1; i <= k; ++i) {
      +
      43 result *= n - k + i;
      +
      44 result /= i;
      +
      45 }
      +
      46
      +
      47 return result;
      +
      48}
      uint64_t result(uint64_t n)
      Definition: fibonacci_sum.cpp:76
      Here is the call graph for this function:
      @@ -198,7 +197,7 @@ Here is the call graph for this function:
      - +

      ◆ main()

      @@ -233,20 +232,20 @@ Here is the call graph for this function:
      Returns
      0 on exit
      -
      79  {
      -
      80  tests(); // run self-test implementations
      -
      81 
      -
      82  if (argc < 3) {
      -
      83  std::cout << "Usage ./binomial_calculate {n} {k}" << std::endl;
      -
      84  return 0;
      -
      85  }
      -
      86 
      -
      87  int32_t n = atoi(argv[1]);
      -
      88  int32_t k = atoi(argv[2]);
      -
      89 
      - -
      91  return 0;
      -
      92 }
      +
      79 {
      +
      80 tests(); // run self-test implementations
      +
      81
      +
      82 if (argc < 3) {
      +
      83 std::cout << "Usage ./binomial_calculate {n} {k}" << std::endl;
      +
      84 return 0;
      +
      85 }
      +
      86
      +
      87 int32_t n = atoi(argv[1]);
      +
      88 int32_t k = atoi(argv[2]);
      +
      89
      + +
      91 return 0;
      +
      92}
      T atoi(T... args)
      static void tests()
      Test implementations.
      Definition: binomial_calculate.cpp:56
      @@ -261,7 +260,7 @@ Here is the call graph for this function:
      - +

      ◆ tests()

      @@ -286,22 +285,22 @@ Here is the call graph for this function:

      Test implementations.

      Returns
      void
      -
      56  {
      -
      57  // tests for calculate function
      -
      58  assert(math::binomial::calculate(1, 1) == 1);
      -
      59  assert(math::binomial::calculate(57, 57) == 1);
      -
      60  assert(math::binomial::calculate(6, 3) == 20);
      -
      61  assert(math::binomial::calculate(10, 5) == 252);
      -
      62  assert(math::binomial::calculate(20, 10) == 184756);
      -
      63  assert(math::binomial::calculate(30, 15) == 155117520);
      -
      64  assert(math::binomial::calculate(40, 20) == 137846528820);
      -
      65  assert(math::binomial::calculate(50, 25) == 126410606437752);
      -
      66  assert(math::binomial::calculate(60, 30) == 118264581564861424);
      -
      67  assert(math::binomial::calculate(62, 31) == 465428353255261088);
      -
      68 
      -
      69  std::cout << "[+] Binomial coefficients calculate test completed"
      -
      70  << std::endl;
      -
      71 }
      +
      56 {
      +
      57 // tests for calculate function
      +
      58 assert(math::binomial::calculate(1, 1) == 1);
      +
      59 assert(math::binomial::calculate(57, 57) == 1);
      +
      60 assert(math::binomial::calculate(6, 3) == 20);
      +
      61 assert(math::binomial::calculate(10, 5) == 252);
      +
      62 assert(math::binomial::calculate(20, 10) == 184756);
      +
      63 assert(math::binomial::calculate(30, 15) == 155117520);
      +
      64 assert(math::binomial::calculate(40, 20) == 137846528820);
      +
      65 assert(math::binomial::calculate(50, 25) == 126410606437752);
      +
      66 assert(math::binomial::calculate(60, 30) == 118264581564861424);
      +
      67 assert(math::binomial::calculate(62, 31) == 465428353255261088);
      +
      68
      +
      69 std::cout << "[+] Binomial coefficients calculate test completed"
      +
      70 << std::endl;
      +
      71}
      Here is the call graph for this function:
      @@ -317,7 +316,7 @@ Here is the call graph for this function:
      diff --git a/d8/db1/binomial__calculate_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.svg b/d8/db1/binomial__calculate_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.svg index eb130c24a..f0557f9e2 100644 --- a/d8/db1/binomial__calculate_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.svg +++ b/d8/db1/binomial__calculate_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,8 +90,7 @@ $(document).ready(function(){initNavTree('d1/db3/structcompare.html','../../');
      -
      -
      compare Member List
      +
      compare Member List
      @@ -103,7 +102,7 @@ $(document).ready(function(){initNavTree('d1/db3/structcompare.html','../../'); diff --git a/d8/dba/classdata__structures_1_1queue__using__array_1_1_queue___array-members.html b/d8/dba/classdata__structures_1_1queue__using__array_1_1_queue___array-members.html index 1380be849..0d2df265e 100644 --- a/d8/dba/classdata__structures_1_1queue__using__array_1_1_queue___array-members.html +++ b/d8/dba/classdata__structures_1_1queue__using__array_1_1_queue___array-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,25 +90,24 @@ $(document).ready(function(){initNavTree('d6/d04/classdata__structures_1_1queue_
      -
      -
      data_structures::queue_using_array::Queue_Array Member List
      +
      data_structures::queue_using_array::Queue_Array Member List
      diff --git a/d8/dc0/heavy__light__decomposition_8cpp__incl.svg b/d8/dc0/heavy__light__decomposition_8cpp__incl.svg index b868c091b..a2153ef0e 100644 --- a/d8/dc0/heavy__light__decomposition_8cpp__incl.svg +++ b/d8/dc0/heavy__light__decomposition_8cpp__incl.svg @@ -1,7 +1,7 @@ - diff --git a/d8/dc0/heavy__light__decomposition_8cpp__incl_org.svg b/d8/dc0/heavy__light__decomposition_8cpp__incl_org.svg index 16bcc57f3..28365ec83 100644 --- a/d8/dc0/heavy__light__decomposition_8cpp__incl_org.svg +++ b/d8/dc0/heavy__light__decomposition_8cpp__incl_org.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: manacher Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d8/dc6/namespacemanacher.html','../../
      -
      -
      manacher Namespace Reference
      +
      manacher Namespace Reference
      -

      Functions for Manacher's Algorithm implementation. +

      Functions for Manacher's Algorithm implementation. More...

      Detailed Description

      -

      Functions for Manacher's Algorithm implementation.

      +

      Functions for Manacher's Algorithm implementation.

      diff --git a/d8/dc8/struct_point.html b/d8/dc8/struct_point.html index d041fea97..e2fd5ed5d 100644 --- a/d8/dc8/struct_point.html +++ b/d8/dc8/struct_point.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Point Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -94,23 +94,22 @@ $(document).ready(function(){initNavTree('d8/dc8/struct_point.html','../../'); i Public Member Functions | Public Attributes | List of all members -
      -
      Point Struct Reference
      +
      Point Struct Reference
      -

      +

      Public Member Functions

       Point (double a=0.f, double b=0.f)
       
      - - - + @@ -119,10 +118,10 @@ int 

      +

      Public Attributes

      +
      int x
       
      -int y
      +int y
       Point respect to x coordinate.
       
      double x
       

      Detailed Description

      -

      Define a Point.

      -

      Define a point

      +

      Define a Point.

      +

      Define a point

      Constructor & Destructor Documentation

      - +

      ◆ Point()

      @@ -155,23 +154,23 @@ int  -

      construct a point

      Parameters
      +

      construct a point

      Parameters
      [in]aabsicca (default = 0.0)
      [in]bordinate (default = 0.0)
      -
      23  {
      -
      24  x = a;
      -
      25  y = b;
      -
      26  }
      +
      23 {
      +
      24 x = a;
      +
      25 y = b;
      +
      26 }
      int y
      Point respect to x coordinate.
      Definition: line_segment_intersection.cpp:14

      Member Data Documentation

      - +

      ◆ x

      @@ -182,11 +181,11 @@ int  -

      abscissa

      +

      abscissa

      - +

      ◆ y

      @@ -197,7 +196,7 @@ int  -

      ordinate

      +

      ordinate

      @@ -211,7 +210,7 @@ int 
        - +
      diff --git a/d8/dc8/struct_point.js b/d8/dc8/struct_point.js index 14ace42c9..b0e66c73d 100644 --- a/d8/dc8/struct_point.js +++ b/d8/dc8/struct_point.js @@ -1,7 +1,6 @@ var struct_point = [ [ "Point", "d8/dc8/struct_point.html#ae2d6fb1b3fd3a96169d963d62e37130a", null ], - [ "x", "d8/dc8/struct_point.html#a8c779e11e694b20e0946105a9f5de842", null ], [ "x", "d8/dc8/struct_point.html#ab99c56589bc8ad5fa5071387110a5bc7", null ], [ "y", "d8/dc8/struct_point.html#a2e1b5fb2b2a83571f5c0bc0f66a73cf7", null ], [ "y", "d8/dc8/struct_point.html#afa38be143ae800e6ad69ce8ed4df62d8", null ] diff --git a/d8/dcc/namespacestd.html b/d8/dcc/namespacestd.html index e19974daa..6cb7e2cc4 100644 --- a/d8/dcc/namespacestd.html +++ b/d8/dcc/namespacestd.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: std Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -91,2653 +91,2651 @@ $(document).ready(function(){initNavTree('d8/dcc/namespacestd.html','../../'); i
      -
      -
      std Namespace Reference
      +
      std Namespace Reference

      STL namespace. More...

      - - + - + + + + + + + + + + + + + + + + + + + - + - + + + - - - - - + - + - + - - - - - + - + - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + + - + - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - - - - - - - - - - - + - - - - - - - + + + + + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      +

      Classes

      class  money_get
      class  add_const
       
      class  basic_ofstream
      class  add_cv
       
      class  add_lvalue_reference
       
      class  add_pointer
       
      class  add_rvalue_reference
       
      class  add_volatile
       
      class  adopt_lock_t
       
      class  aligned_storage
       
      class  aligned_union
       
      class  alignment_of
       
      class  allocator
       STL class.
       
      class  ctype_byname
      class  allocator_arg_t
       
      class  fstream
      class  allocator_traits
       
      class  array
       STL class.
       
      class  codecvt
       
      class  num_get
       
      class  wostream
      class  atomic
       STL class.
       
      class  codecvt_byname
      class  atomic_flag
       
      class  basic_ostringstream
      class  atomic_ref
       STL class.
       
      class  time_put_byname
       
      class  time_get
       
      class  basic_ios
      class  auto_ptr
       STL class.
       
      class  codecvt_utf8
      class  back_insert_iterator
       
      class  ostringstream
      class  bad_alloc
       STL class.
       
      class  bad_array_length
       
      class  bad_array_new_length
       
      class  bad_cast
       STL class.
       
      class  bad_exception
       STL class.
       
      class  bad_function_call
       
      class  bad_optional_access
       
      class  bad_typeid
       STL class.
       
      class  bad_weak_ptr
       
      class  basic_filebuf
       
      class  basic_fstream
       STL class.
       
      class  iostream
       
      class  codecvt_utf8_utf16
       
      class  ios_base
       STL class.
       
      class  wistream
       STL class.
       
      class  stringstream
       STL class.
       
      class  locale
       
      class  collate_byname
       
      class  ostream
       STL class.
       
      class  wifstream
       STL class.
       
      class  moneypunct_byname
       
      class  ctype_base
       
      class  basic_istream
       STL class.
       
      class  money_base
       
      class  messages_byname
       
      class  strstream
       
      class  time_get_byname
       
      class  basic_stringstream
       STL class.
       
      class  bitset
       STL class.
       
      class  thread
       STL class.
       
      class  time_put
       
      class  wostringstream
       STL class.
       
      class  istrstream
       
      class  basic_ostream
       STL class.
       
      class  moneypunct
       
      class  wiostream
       
      class  collate
       
      class  ofstream
       STL class.
       
      class  basic_istringstream
       STL class.
       
      class  basic_ifstream
       STL class.
       
      class  map
      class  basic_ios
       STL class.
       
      class  codecvt_utf16
       
      class  num_put
       
      class  messages
       
      class  messages_base
       
      class  istringstream
       STL class.
       
      class  ctype
       
      class  istream
       STL class.
       
      class  ostrstream
       
      class  wfstream
       STL class.
       
      class  multimap
       STL class.
       
      class  numpunct_byname
       
      class  basic_iostream
       STL class.
       
      class  wofstream
      class  basic_istream
       STL class.
       
      class  wstringstream
      class  basic_istringstream
       STL class.
       
      class  wistringstream
      class  basic_ofstream
       STL class.
       
      class  ifstream
      class  basic_ostream
       STL class.
       
      class  numpunct
       
      class  money_put
       
      class  is_function
       
      class  input_iterator_tag
       
      class  logical_and
       
      class  is_integral
       
      class  ratio_subtract
       
      class  size_t
       
      class  wcout
       
      class  valarray
      class  basic_ostringstream
       STL class.
       
      class  ratio_greater_equal
       
      class  remove_extent
       
      class  ratio_greater
       
      class  intptr_t
       
      class  regex_iterator
       
      class  lock_guard
       STL class.
       
      class  wbuffer_convert
       
      class  modulus
       
      class  ratio_divide
       
      class  ostreambuf_iterator
       
      class  dynarray
       
      class  is_nothrow_move_constructible
       
      class  vector
       STL class.
       
      class  match_results
       
      class  back_insert_iterator
       
      class  iterator
       
      class  int8_t
       
      class  student_t_distribution
       
      class  mt19937_64
       
      class  runtime_error
       STL class.
       
      class  ranlux24_base
       
      class  allocator_traits
       
      class  ratio_less_equal
       
      class  condition_variable_any
       
      class  deca
       
      class  extreme_value_distribution
       
      class  cout
       
      class  decay
       
      class  is_trivially_move_assignable
       
      class  adopt_lock_t
       
      class  wcerr
       
      class  lognormal_distribution
       
      class  wclog
       
      class  char_traits
       
      class  remove_reference
       
      class  is_pointer
       
      class  multiset
       STL class.
       
      class  weak_ptr
       STL class.
       
      class  bidirectional_iterator_tag
       
      class  wstring_convert
       
      class  greater_equal
       
      class  is_trivially_constructible
       
      class  string
       STL class.
       
      class  discrete_distribution
       
      class  is_polymorphic
       
      class  reverse_iterator
       
      class  bad_array_new_length
       
      class  condition_variable
       
      class  ranlux48
       
      class  unexpected_handler
       
      class  piecewise_constant_distribution
       
      class  codecvt_base
       
      class  set
       STL class.
       
      class  forward_iterator_tag
       
      class  pointer_safety
       
      class  uint_least64_t
       
      class  placeholders
       
      class  nothrow_t
       
      class  is_nothrow_copy_assignable
       
      class  is_same
       
      class  unique_lock
       STL class.
       
      class  is_error_code_enum
       
      class  regex
       
      class  cin
       
      class  unordered_map
       STL class.
       
      class  initializer_list
       
      class  is_const
       
      class  basic_regex
       
      class  poisson_distribution
      class  basic_streambuf
       
      class  bad_typeid
      class  basic_string
       STL class.
       
      class  less_equal
      class  basic_string_view
       STL class.
       
      class  sig_atomic_t
      class  basic_stringbuf
       
      class  make_unsigned
       
      class  basic_filebuf
       
      class  logical_or
       
      class  wstringbuf
       
      class  kilo
      class  basic_stringstream
       STL class.
       
      class  bernoulli_distribution
       
      class  int16_t
       
      class  int32_t
       
      class  is_rvalue_reference
       
      class  integral_constant
       
      class  wsmatch
       
      class  cerr
       
      class  ratio_add
       
      class  is_trivially_move_constructible
       
      class  wcsub_match
       
      class  is_member_pointer
       
      class  wstreampos
       
      class  uint_least16_t
       
      class  tuple
       
      class  make_signed
       
      class  logic_error
       STL class.
       
      class  sregex_iterator
       
      class  int_least64_t
       
      class  binary_negate
       
      class  discard_block_engine
       
      class  is_trivially_assignable
       
      class  add_cv
       
      class  pico
       
      class  iterator_traits
       
      class  is_trivially_default_constructible
       
      class  shared_ptr
       STL class.
       
      class  bad_alloc
       STL class.
       
      class  stringbuf
       
      class  exponential_distribution
       
      class  uint32_t
       
      class  wcregex_iterator
       
      class  bad_function_call
       
      class  false_type
       
      class  wregex
       
      class  uint_least8_t
       
      class  uniform_real_distribution
       
      class  smatch
       
      class  cregex_token_iterator
       
      class  range_error
       STL class.
       
      class  is_assignable
       
      class  is_copy_assignable
       
      class  invalid_argument
       STL class.
       
      class  is_unsigned
       
      class  jmp_buf
       
      class  is_class
       
      class  geometric_distribution
       
      class  uint_fast8_t
       
      class  mersenne_twister_engine
       
      class  is_arithmetic
       
      class  negate
       
      class  try_to_lock_t
       
      class  wfilebuf
       
      class  is_compound
       
      class  is_object
       
      class  recursive_mutex
       STL class.
       
      class  is_copy_constructible
       
      class  not_equal_to
       
      class  is_destructible
       
      class  int_fast32_t
       
      class  rank
       
      class  milli
       
      class  deci
       
      class  add_lvalue_reference
       
      class  is_bind_expression
       
      class  ratio_less
       
      class  int64_t
       
      class  nullptr_t
       
      class  stack
       STL class.
       
      class  uint_fast64_t
       
      class  is_reference
       
      class  ratio
       
      class  shared_future
       
      class  u16streampos
       
      class  aligned_storage
       
      class  wstreambuf
      class  bidirectional_iterator_tag
       
      class  binary_function
       
      class  out_of_range
      class  binary_negate
       
      class  binomial_distribution
       
      class  bit_and
       
      class  bit_not
       
      class  bit_or
       
      class  bitset
       STL class.
       
      class  independent_bits_engine
      class  cauchy_distribution
       
      class  tera
      class  centi
       
      class  recursive_timed_mutex
      class  cerr
       
      class  char_traits
       
      class  chi_squared_distribution
       
      class  cin
       
      class  clock_t
       
      class  clog
       
      class  cmatch
       
      class  codecvt
       
      class  codecvt_base
       
      class  codecvt_byname
       
      class  codecvt_utf16
       
      class  codecvt_utf8
       
      class  codecvt_utf8_utf16
       
      class  collate
       
      class  collate_byname
       
      class  common_type
       
      class  complex
       STL class.
       
      class  nano
      class  condition_variable
       
      class  unordered_multimap
      class  condition_variable_any
       
      class  conditional
       
      class  cout
       
      class  cregex_iterator
       
      class  cregex_token_iterator
       
      class  csub_match
       
      class  ctype
       
      class  ctype_base
       
      class  ctype_byname
       
      class  deca
       
      class  decay
       
      class  deci
       
      class  default_delete
       
      class  default_random_engine
       
      class  defer_lock_t
       
      class  deque
       STL class.
       
      class  normal_distribution
      class  discard_block_engine
       
      class  minstd_rand
       
      class  is_signed
       
      class  is_move_constructible
       
      class  unique_ptr
       STL class.
       
      class  is_nothrow_copy_constructible
       
      class  forward_list
       STL class.
       
      class  errc
       
      class  lconv
       
      class  strstreambuf
       
      class  equal_to
      class  discrete_distribution
       
      class  divides
       
      class  domain_error
       STL class.
       
      class  is_empty
      class  dynarray
       
      class  is_nothrow_default_constructible
       
      class  ratio_equal
       
      class  streamsize
       
      class  shared_lock
       STL class.
       
      class  uint8_t
      class  enable_if
       
      class  enable_shared_from_this
       
      class  ptrdiff_t
      class  equal_to
       
      class  int_fast8_t
       
      class  aligned_union
       
      class  future
       
      class  wcmatch
       
      class  overflow_error
       STL class.
       
      class  centi
       
      class  wssub_match
       
      class  is_nothrow_move_assignable
       
      class  pair
       
      class  wsregex_token_iterator
       
      class  weibull_distribution
       
      class  less
       
      class  multiplies
       
      class  is_enum
       
      class  unary_function
       
      class  error_code
       STL class.
       
      class  yocto
       
      class  streampos
       
      class  istream_iterator
       
      class  terminate_handler
       
      class  reference_wrapper
       
      class  ranlux48_base
       
      class  bit_not
       
      class  int_fast16_t
      class  errc
       
      class  error_category
       STL class.
       
      class  regex_traits
       
      class  negative_binomial_distribution
       
      class  is_union
       
      class  mt19937
       
      class  enable_if
       
      class  chi_squared_distribution
       
      class  add_rvalue_reference
       
      class  ostream_iterator
       
      class  is_trivially_copy_assignable
       
      class  clog
       
      class  is_scalar
       
      class  uses_allocator
       
      class  piecewise_linear_distribution
       
      class  hash
       
      class  shuffle_order_engine
       
      class  greater
       
      class  csub_match
       
      class  uintmax_t
       
      class  remove_pointer
       
      class  numeric_limits
       
      class  add_volatile
       
      class  once_flag
       
      class  is_literal_type
       
      class  peta
       
      class  is_placeholder
       
      class  add_const
       
      class  basic_stringbuf
       
      class  tm
       
      class  is_abstract
       
      class  deque
       STL class.
       
      class  allocator
       STL class.
       
      class  scoped_allocator_adaptor
       
      class  ssub_match
       
      class  promise
       
      class  add_pointer
       
      class  uintptr_t
       
      class  bit_and
       
      class  uniform_int_distribution
       
      class  type_info
       
      class  fisher_f_distribution
       
      class  basic_streambuf
       
      class  is_nothrow_constructible
       
      class  queue
       STL class.
       
      class  is_base_of
       
      class  intmax_t
       
      class  ranlux24
       
      class  remove_cv
       
      class  is_trivially_destructible
       
      class  wcin
       
      class  atomic
       STL class.
       
      class  is_void
       
      class  plus
       
      class  FILE
       
      class  future_error
       
      class  time_base
       
      class  alignment_of
       
      class  bit_or
       
      class  pointer_traits
       
      class  basic_string
       STL class.
       
      class  priority_queue
       STL class.
       
      class  exa
       
      class  is_default_constructible
       
      class  cregex_iterator
       
      class  wstring
       STL class.
       
      class  remove_all_extents
       
      class  unary_negate
       
      class  unordered_multiset
       STL class.
       
      class  wsregex_iterator
       
      class  uint_fast16_t
       
      class  is_nothrow_assignable
       
      class  type_index
       
      class  is_standard_layout
       
      class  timed_mutex
       STL class.
       
      class  bad_exception
       STL class.
       
      class  int_fast64_t
       
      class  function
       
      class  bad_cast
      class  error_code
       STL class.
       
      class  error_condition
       STL class.
       
      class  filebuf
       
      class  int_least16_t
       
      class  istreambuf_iterator
       
      class  u16string
       STL class.
       
      class  is_error_condition_enum
       
      class  is_nothrow_destructible
       
      class  allocator_arg_t
       
      class  uint_least32_t
       
      class  remove_const
       
      class  u32string
       STL class.
       
      class  uint_fast32_t
       
      class  is_lvalue_reference
       
      class  complex
       STL class.
       
      class  insert_iterator
       
      class  bad_array_length
       
      class  is_trivially_copyable
       
      class  list
       STL class.
       
      class  minus
       
      class  linear_congruential_engine
       
      class  cmatch
       
      class  defer_lock_t
      class  exa
       
      class  exception
       STL class.
       
      class  front_insert_iterator
      class  exception_ptr
       
      class  zetta
       
      class  streambuf
       
      class  owner_less
      class  exponential_distribution
       
      class  extent
       
      class  bad_optional_access
      class  extreme_value_distribution
       
      class  yotta
       
      class  wcregex_token_iterator
       
      class  uint64_t
       
      class  regex_token_iterator
       
      class  move_iterator
       
      class  giga
       
      class  integer_sequence
       
      class  has_virtual_destructor
       
      class  max_align_t
       
      class  remove_volatile
       
      class  underlying_type
       
      class  hecto
       
      class  is_member_object_pointer
       
      class  exception_ptr
       
      class  nested_exception
       
      class  random_access_iterator_tag
       
      class  time_t
       
      class  knuth_b
       
      class  auto_ptr
       STL class.
       
      class  minstd_rand0
       
      class  sregex_token_iterator
       
      class  logical_not
       
      class  fpos_t
       
      class  seed_seq
       
      class  default_delete
      class  false_type
       
      class  femto
       
      class  clock_t
      class  FILE
       
      class  true_type
      class  filebuf
       
      class  mbstate_t
      class  fisher_f_distribution
       
      class  gamma_distribution
      class  forward_iterator_tag
       
      class  bad_weak_ptr
       
      class  output_iterator_tag
       
      class  micro
       
      class  is_trivial
       
      class  packaged_task
       
      class  unordered_set
      class  forward_list
       STL class.
       
      class  is_volatile
       
      class  atomic_flag
       
      class  binomial_distribution
       
      class  fpos
       
      class  underflow_error
      class  fpos_t
       
      class  front_insert_iterator
       
      class  fstream
       STL class.
       
      class  cauchy_distribution
      class  function
       
      class  is_trivially_copy_constructible
      class  future
       
      class  conditional
      class  future_error
       
      class  is_pod
      class  gamma_distribution
       
      class  int_least8_t
      class  geometric_distribution
       
      class  streamoff
      class  giga
       
      class  is_move_assignable
      class  greater
       
      class  greater_equal
       
      class  has_virtual_destructor
       
      class  hash
       
      class  hecto
       
      class  ifstream
       STL class.
       
      class  independent_bits_engine
       
      class  initializer_list
       
      class  input_iterator_tag
       
      class  insert_iterator
       
      class  int16_t
       
      class  int32_t
       
      class  int64_t
       
      class  int8_t
       
      class  int_fast16_t
       
      class  int_fast32_t
       
      class  int_fast64_t
       
      class  int_fast8_t
       
      class  int_least16_t
       
      class  int_least32_t
       
      class  subtract_with_carry_engine
      class  int_least64_t
       
      class  regex_error
      class  int_least8_t
       
      class  is_constructible
      class  integer_sequence
       
      class  piecewise_construct_t
      class  integral_constant
       
      class  mutex
       STL class.
      class  intmax_t
       
      class  system_error
       STL class.
      class  intptr_t
       
      class  is_floating_point
       
      class  ratio_not_equal
       
      class  ratio_multiply
       
      class  result_of
       
      class  is_fundamental
       
      class  u32streampos
       
      class  length_error
       STL class.
       
      class  sub_match
       
      class  common_type
       
      class  shared_timed_mutex
       STL class.
       
      class  array
       STL class.
       
      class  random_device
       
      class  default_random_engine
       
      class  raw_storage_iterator
       
      class  is_convertible
       
      class  uint16_t
       
      class  is_array
       
      class  mega
       
      class  new_handler
       
      class  is_member_function_pointer
       
      class  smart_ptr
       STL class.
       
      class  atomic_ref
       STL class.
       
      class  jthread
       STL class.
       
      class  shared_mutex
      class  invalid_argument
       STL class.
       
      class  ios
       STL class.
       
      class  wios
      class  ios_base
       STL class.
       
      class  u8string
      class  iostream
       
      class  is_abstract
       
      class  is_arithmetic
       
      struct  is_arithmetic< uint128_t >
       
      struct  is_arithmetic< uint256_t >
       
      class  is_array
       
      class  is_assignable
       
      class  is_base_of
       
      class  is_bind_expression
       
      class  is_class
       
      class  is_compound
       
      class  is_const
       
      class  is_constructible
       
      class  is_convertible
       
      class  is_copy_assignable
       
      class  is_copy_constructible
       
      class  is_default_constructible
       
      class  is_destructible
       
      class  is_empty
       
      class  is_enum
       
      class  is_error_code_enum
       
      class  is_error_condition_enum
       
      class  is_floating_point
       
      class  is_function
       
      class  is_fundamental
       
      class  is_integral
       
      struct  is_integral< uint128_t >
       
      struct  is_integral< uint256_t >
       
      class  is_literal_type
       
      class  is_lvalue_reference
       
      class  is_member_function_pointer
       
      class  is_member_object_pointer
       
      class  is_member_pointer
       
      class  is_move_assignable
       
      class  is_move_constructible
       
      class  is_nothrow_assignable
       
      class  is_nothrow_constructible
       
      class  is_nothrow_copy_assignable
       
      class  is_nothrow_copy_constructible
       
      class  is_nothrow_default_constructible
       
      class  is_nothrow_destructible
       
      class  is_nothrow_move_assignable
       
      class  is_nothrow_move_constructible
       
      class  is_object
       
      class  is_placeholder
       
      class  is_pod
       
      class  is_pointer
       
      class  is_polymorphic
       
      class  is_reference
       
      class  is_rvalue_reference
       
      class  is_same
       
      class  is_scalar
       
      class  is_signed
       
      class  is_standard_layout
       
      class  is_trivial
       
      class  is_trivially_assignable
       
      class  is_trivially_constructible
       
      class  is_trivially_copy_assignable
       
      class  is_trivially_copy_constructible
       
      class  is_trivially_copyable
       
      class  is_trivially_default_constructible
       
      class  is_trivially_destructible
       
      class  is_trivially_move_assignable
       
      class  is_trivially_move_constructible
       
      class  is_union
       
      class  is_unsigned
       
      struct  is_unsigned< uint128_t >
       
      struct  is_unsigned< uint256_t >
       
      class  is_void
       
      class  is_volatile
       
      class  istream
       STL class.
       
      class  basic_string_view
      class  istream_iterator
       
      class  istreambuf_iterator
       
      class  istringstream
       STL class.
       
      class  istrstream
       
      class  iterator
       
      class  iterator_traits
       
      class  jmp_buf
       
      class  jthread
       STL class.
       
      class  kilo
       
      class  knuth_b
       
      class  lconv
       
      class  length_error
       STL class.
       
      class  less
       
      class  less_equal
       
      class  linear_congruential_engine
       
      class  list
       STL class.
       
      class  locale
       
      class  lock_guard
       STL class.
       
      class  logic_error
       STL class.
       
      class  logical_and
       
      class  logical_not
       
      class  logical_or
       
      class  lognormal_distribution
       
      class  make_signed
       
      class  make_unsigned
       
      class  map
       STL class.
       
      class  match_results
       
      class  max_align_t
       
      class  mbstate_t
       
      class  mega
       
      class  mersenne_twister_engine
       
      class  messages
       
      class  messages_base
       
      class  messages_byname
       
      class  micro
       
      class  milli
       
      class  minstd_rand
       
      class  minstd_rand0
       
      class  minus
       
      class  modulus
       
      class  money_base
       
      class  money_get
       
      class  money_put
       
      class  moneypunct
       
      class  moneypunct_byname
       
      class  move_iterator
       
      class  mt19937
       
      class  mt19937_64
       
      class  multimap
       STL class.
       
      class  multiplies
       
      class  multiset
       STL class.
       
      class  mutex
       STL class.
       
      class  nano
       
      class  negate
       
      class  negative_binomial_distribution
       
      class  nested_exception
       
      class  new_handler
       
      class  normal_distribution
       
      class  not_equal_to
       
      class  nothrow_t
       
      class  nullptr_t
       
      class  num_get
       
      class  num_put
       
      class  numeric_limits
       
      class  numpunct
       
      class  numpunct_byname
       
      class  ofstream
       STL class.
       
      class  once_flag
       
      class  ostream
       STL class.
       
      class  ostream_iterator
       
      class  ostreambuf_iterator
       
      class  ostringstream
       STL class.
       
      class  ostrstream
       
      class  out_of_range
       STL class.
       
      class  output_iterator_tag
       
      class  overflow_error
       STL class.
       
      class  owner_less
       
      class  packaged_task
       
      class  pair
       
      class  peta
       
      class  pico
       
      class  piecewise_constant_distribution
       
      class  piecewise_construct_t
       
      class  piecewise_linear_distribution
       
      class  placeholders
       
      class  plus
       
      class  pointer_safety
       
      class  pointer_traits
       
      class  poisson_distribution
       
      class  priority_queue
       STL class.
       
      class  promise
       
      class  ptrdiff_t
       
      class  queue
       STL class.
       
      class  random_access_iterator_tag
       
      class  random_device
       
      class  range_error
       STL class.
       
      class  rank
       
      class  ranlux24
       
      class  ranlux24_base
       
      class  ranlux48
       
      class  ranlux48_base
       
      class  ratio
       
      class  ratio_add
       
      class  ratio_divide
       
      class  ratio_equal
       
      class  ratio_greater
       
      class  ratio_greater_equal
       
      class  ratio_less
       
      class  ratio_less_equal
       
      class  ratio_multiply
       
      class  ratio_not_equal
       
      class  ratio_subtract
       
      class  raw_storage_iterator
       
      class  recursive_mutex
       STL class.
       
      class  recursive_timed_mutex
       STL class.
       
      class  reference_wrapper
       
      class  regex
       
      class  regex_error
       
      class  regex_iterator
       
      class  regex_token_iterator
       
      class  regex_traits
       
      class  remove_all_extents
       
      class  remove_const
       
      class  remove_cv
       
      class  remove_extent
       
      class  remove_pointer
       
      class  remove_reference
       
      class  remove_volatile
       
      class  result_of
       
      class  reverse_iterator
       
      class  runtime_error
       STL class.
       
      class  scoped_allocator_adaptor
       
      class  seed_seq
       
      class  set
       STL class.
       
      class  shared_future
       
      class  shared_lock
       STL class.
       
      class  shared_mutex
       STL class.
       
      class  shared_ptr
       STL class.
       
      class  shared_timed_mutex
       STL class.
       
      class  shuffle_order_engine
       
      class  sig_atomic_t
       
      class  size_t
       
      class  smart_ptr
       STL class.
       
      class  smatch
       
      class  span
       STL class.
       
      class  sregex_iterator
       
      class  sregex_token_iterator
       
      class  ssub_match
       
      class  stack
       STL class.
       
      class  streambuf
       
      class  streamoff
       
      class  streampos
       
      class  streamsize
       
      class  string
       STL class.
       
      class  string_view
       STL class.
       
      class  wstring_view
      class  stringbuf
       
      class  stringstream
       STL class.
       
      class  u8string_view
      class  strstream
       
      class  strstreambuf
       
      class  student_t_distribution
       
      class  sub_match
       
      class  subtract_with_carry_engine
       
      class  system_error
       STL class.
       
      class  tera
       
      class  terminate_handler
       
      class  thread
       STL class.
       
      class  time_base
       
      class  time_get
       
      class  time_get_byname
       
      class  time_put
       
      class  time_put_byname
       
      class  time_t
       
      class  timed_mutex
       STL class.
       
      class  tm
       
      class  true_type
       
      class  try_to_lock_t
       
      class  tuple
       
      class  type_index
       
      class  type_info
       
      class  u16streampos
       
      class  u16string
       STL class.
       
      class  u16string_view
       STL class.
       
      class  u32streampos
       
      class  u32string
       STL class.
       
      class  u32string_view
       STL class.
       
      class  span
      class  u8string
       STL class.
       
      struct  is_integral< uint128_t >
      class  u8string_view
       STL class.
       
      struct  is_arithmetic< uint128_t >
      class  uint16_t
       
      struct  is_unsigned< uint128_t >
      class  uint32_t
       
      struct  is_integral< uint256_t >
      class  uint64_t
       
      struct  is_arithmetic< uint256_t >
      class  uint8_t
       
      struct  is_unsigned< uint256_t >
      class  uint_fast16_t
       
      class  uint_fast32_t
       
      class  uint_fast64_t
       
      class  uint_fast8_t
       
      class  uint_least16_t
       
      class  uint_least32_t
       
      class  uint_least64_t
       
      class  uint_least8_t
       
      class  uintmax_t
       
      class  uintptr_t
       
      class  unary_function
       
      class  unary_negate
       
      class  underflow_error
       STL class.
       
      class  underlying_type
       
      class  unexpected_handler
       
      class  uniform_int_distribution
       
      class  uniform_real_distribution
       
      class  unique_lock
       STL class.
       
      class  unique_ptr
       STL class.
       
      class  unordered_map
       STL class.
       
      class  unordered_multimap
       STL class.
       
      class  unordered_multiset
       STL class.
       
      class  unordered_set
       STL class.
       
      class  uses_allocator
       
      class  valarray
       STL class.
       
      class  vector
       STL class.
       
      class  wbuffer_convert
       
      class  wcerr
       
      class  wcin
       
      class  wclog
       
      class  wcmatch
       
      class  wcout
       
      class  wcregex_iterator
       
      class  wcregex_token_iterator
       
      class  wcsub_match
       
      class  weak_ptr
       STL class.
       
      class  weibull_distribution
       
      class  wfilebuf
       
      class  wfstream
       STL class.
       
      class  wifstream
       STL class.
       
      class  wios
       STL class.
       
      class  wiostream
       
      class  wistream
       STL class.
       
      class  wistringstream
       STL class.
       
      class  wofstream
       STL class.
       
      class  wostream
       STL class.
       
      class  wostringstream
       STL class.
       
      class  wregex
       
      class  wsmatch
       
      class  wsregex_iterator
       
      class  wsregex_token_iterator
       
      class  wssub_match
       
      class  wstreambuf
       
      class  wstreampos
       
      class  wstring
       STL class.
       
      class  wstring_convert
       
      class  wstring_view
       STL class.
       
      class  wstringbuf
       
      class  wstringstream
       STL class.
       
      class  yocto
       
      class  yotta
       
      class  zetta
       
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

      +

      Functions

      +
      atomic_fetch_and_explicit (T... args)
       
      +
      atomic_fetch_xor_explicit (T... args)
       
      +
      set_unexpected (T... args)
       
      +
      fputs (T... args)
       
      +
      modf (T... args)
       
      +
      not2 (T... args)
       
      +
      strlen (T... args)
       
      +
      exp2 (T... args)
       
      +
      setiosflags (T... args)
       
      +
      adjacent_difference (T... args)
       
      +
      cos (T... args)
       
      +
      fwscanf (T... args)
       
      +
      atomic_init (T... args)
       
      +
      forward_as_tuple (T... args)
       
      +
      abort (T... args)
       
      +
      wcsncmp (T... args)
       
      +
      set_intersection (T... args)
       
      +
      atomic_signal_fence (T... args)
       
      +
      llabs (T... args)
       
      +
      make_move_iterator (T... args)
       
      +
      scanf (T... args)
       
      +
      nextafter (T... args)
       
      +
      stol (T... args)
       
      +
      strcspn (T... args)
       
      +
      ungetwc (T... args)
       
      +
      transform (T... args)
       
      +
      putc (T... args)
       
      +
      iswdigit (T... args)
       
      +
      rint (T... args)
       
      +
      memset (T... args)
       
      +
      isgraph (T... args)
       
      +
      replace_copy_if (T... args)
       
      +
      scalbn (T... args)
       
      +
      partial_sort_copy (T... args)
       
      +
      make_exception_ptr (T... args)
       
      +
      frexp (T... args)
       
      +
      isxdigit (T... args)
       
      +
      atomic_exchange_explicit (T... args)
       
      +
      wprintf (T... args)
       
      +
      fdim (T... args)
       
      +
      wctype (T... args)
       
      +
      mbrtoc32 (T... args)
       
      +
      setw (T... args)
       
      +
      get_temporary_buffer (T... args)
       
      +
      fmax (T... args)
       
      +
      atomic_thread_fence (T... args)
       
      +
      atomic_exchange (T... args)
       
      +
      fgetwc (T... args)
       
      +
      swprintf (T... args)
       
      +
      prev_permutation (T... args)
       
      +
      max_element (T... args)
       
      +
      set_symmetric_difference (T... args)
       
      +
      wcscpy (T... args)
       
      +
      const_pointer_cast (T... args)
       
      +
      minmax_element (T... args)
       
      +
      wcstok (T... args)
       
      +
      ref (T... args)
       
      +
      feupdateenv (T... args)
       
      +
      endl (T... args)
       
      +
      end (T... args)
       
      +
      wmemmove (T... args)
       
      +
      fmin (T... args)
       
      +
      uninitialized_fill_n (T... args)
       
      +
      nouppercase (T... args)
       
      +
      noshowpos (T... args)
       
      +
      ctime (T... args)
       
      +
      wmemset (T... args)
       
      +
      iswpunct (T... args)
       
      +
      pop_heap (T... args)
       
      +
      sprintf (T... args)
       
      +
      fixed (T... args)
       
      +
      make_shared (T... args)
       
      +
      make_heap (T... args)
       
      +
      fmod (T... args)
       
      +
      atol (T... args)
       
      +
      uninitialized_copy (T... args)
       
      +
      dynamic_pointer_cast (T... args)
       
      +
      set_union (T... args)
       
      +
      hexfloat (T... args)
       
      +
      vswprintf (T... args)
       
      +
      asctime (T... args)
       
      +
      iswspace (T... args)
       
      +
      nan (T... args)
       
      +
      sort (T... args)
       
      +
      quick_exit (T... args)
       
      +
      log10 (T... args)
       
      +
      mbstowcs (T... args)
       
      +
      isspace (T... args)
       
      +
      strncat (T... args)
       
      +
      isinf (T... args)
       
      +
      atof (T... args)
       
      +
      erf (T... args)
       
      +
      is_sorted_until (T... args)
       
      +
      cbrt (T... args)
       
      +
      log1p (T... args)
       
      +
      return_temporary_buffer (T... args)
       
      +
      mbsrtowcs (T... args)
       
      +
      feraiseexcept (T... args)
       
      +
      fseek (T... args)
       
      +
      atomic_fetch_or_explicit (T... args)
       
      +
      log (T... args)
       
      +
      putchar (T... args)
       
      +
      make_tuple (T... args)
       
      +
      expm1 (T... args)
       
      +
      fma (T... args)
       
      +
      remove_copy_if (T... args)
       
      +
      showpoint (T... args)
       
      +
      fscanf (T... args)
       
      +
      stable_partition (T... args)
       
      +
      fill_n (T... args)
       
      +
      remove_copy (T... args)
       
      +
      atomic_compare_exchange_strong_explicit (T... args)
       
      +
      wctomb (T... args)
       
      +
      fgets (T... args)
       
      +
      remainder (T... args)
       
      +
      allocate_shared (T... args)
       
      +
      unique (T... args)
       
      +
      includes (T... args)
       
      +
      iswalnum (T... args)
       
      +
      exit (T... args)
       
      +
      put_time (T... args)
       
      +
      to_string (T... args)
       
      +
      is_heap_until (T... args)
       
      +
      wcstold (T... args)
       
      +
      stold (T... args)
       
      +
      ftell (T... args)
       
      +
      copy_backward (T... args)
       
      +
      wcstoll (T... args)
       
      +
      perror (T... args)
       
      +
      vwscanf (T... args)
       
      +
      stable_sort (T... args)
       
      +
      generic_category (T... args)
       
      +
      abs(int) (T... args)
       
      +
      fgetws (T... args)
       
      +
      showpos (T... args)
       
      +
      exp (T... args)
       
      +
      fill (T... args)
       
      +
      isalpha (T... args)
       
      +
      lgamma (T... args)
       
      +
      feclearexcept (T... args)
       
      +
      wcsncpy (T... args)
       
      +
      undeclare_reachable (T... args)
       
      +
      oct (T... args)
       
      +
      strspn (T... args)
       
      +
      realloc (T... args)
       
      +
      copy (T... args)
       
      +
      binary_search (T... args)
       
      +
      system_category (T... args)
       
      +
      mbrtowc (T... args)
       
      +
      strtof (T... args)
       
      +
      mem_fn (T... args)
       
      +
      distance (T... args)
       
      +
      lock (T... args)
       
      +
      strcmp (T... args)
       
      +
      tmpfile (T... args)
       
      +
      hypot (T... args)
       
      +
      getenv (T... args)
       
      +
      strrchr (T... args)
       
      +
      count (T... args)
       
      +
      tan (T... args)
       
      +
      strftime (T... args)
       
      +
      stod (T... args)
       
      +
      towupper (T... args)
       
      +
      atoll (T... args)
       
      +
      atomic_store (T... args)
       
      +
      stoi (T... args)
       
      +
      rethrow_exception (T... args)
       
      +
      sin (T... args)
       
      +
      atomic_fetch_sub_explicit (T... args)
       
      +
      unexpected (T... args)
       
      +
      mbtowc (T... args)
       
      +
      get_time (T... args)
       
      +
      partition (T... args)
       
      +
      next (T... args)
       
      +
      isfinite (T... args)
       
      +
      boolalpha (T... args)
       
      +
      fetestexcept (T... args)
       
      +
      mbrlen (T... args)
       
      +
      iswgraph (T... args)
       
      +
      time (T... args)
       
      +
      atomic_compare_exchange_strong (T... args)
       
      +
      wcschr (T... args)
       
      +
      uppercase (T... args)
       
      +
      lower_bound (T... args)
       
      +
      copy_if (T... args)
       
      +
      isnan (T... args)
       
      +
      has_facet (T... args)
       
      +
      kill_dependency (T... args)
       
      +
      uninitialized_copy_n (T... args)
       
      +
      feholdexcept (T... args)
       
      +
      div (T... args)
       
      +
      at_quick_exit (T... args)
       
      +
      wcspbrk (T... args)
       
      +
      search (T... args)
       
      +
      find_first_of (T... args)
       
      +
      iota (T... args)
       
      +
      declare_reachable (T... args)
       
      +
      atomic_compare_exchange_weak (T... args)
       
      +
      strtod (T... args)
       
      +
      accumulate (T... args)
       
      +
      wcsrchr (T... args)
       
      +
      min_element (T... args)
       
      +
      clearerr (T... args)
       
      +
      random_shuffle (T... args)
       
      +
      iswalpha (T... args)
       
      +
      atomic_fetch_and (T... args)
       
      +
      wmemchr (T... args)
       
      +
      bsearch (T... args)
       
      +
      ilogb (T... args)
       
      +
      unique_copy (T... args)
       
      +
      _Exit (T... args)
       
      +
      move (T... args)
       
      +
      find_end (T... args)
       
      +
      fesetexceptflag (T... args)
       
      +
      nth_element (T... args)
       
      +
      gets (T... args)
       
      +
      lexicographical_compare (T... args)
       
      +
      nearbyint (T... args)
       
      +
      memcpy (T... args)
       
      +
      fwrite (T... args)
       
      +
      unitbuf (T... args)
       
      +
      iswlower (T... args)
       
      +
      mblen (T... args)
       
      +
      swscanf (T... args)
       
      +
      wcstoimax (T... args)
       
      +
      fprintf (T... args)
       
      +
      find_if (T... args)
       
      +
      strtoimax (T... args)
       
      +
      isalnum (T... args)
       
      +
      atomic_fetch_add_explicit (T... args)
       
      +
      push_heap (T... args)
       
      +
      min (T... args)
       
      +
      fwprintf (T... args)
       
      +
      uncaught_exception (T... args)
       
      +
      strtoll (T... args)
       
      +
      throw_with_nested (T... args)
       
      +
      shuffle (T... args)
       
      +
      isprint (T... args)
       
      +
      get_new_handler (T... args)
       
      +
      call_once (T... args)
       
      +
      trunc (T... args)
       
      +
      wcscspn (T... args)
       
      +
      mbrtoc16 (T... args)
       
      +
      lround (T... args)
       
      +
      pow (T... args)
       
      +
      tgamma (T... args)
       
      +
      erfc (T... args)
       
      +
      llround (T... args)
       
      +
      abs(float) (T... args)
       
      +
      asinh (T... args)
       
      +
      feof (T... args)
       
      +
      noskipws (T... args)
       
      +
      find (T... args)
       
      +
      atoi (T... args)
       
      +
      not1 (T... args)
       
      +
      vfscanf (T... args)
       
      +
      stof (T... args)
       
      +
      regex_search (T... args)
       
      +
      rotate_copy (T... args)
       
      +
      set_new_handler (T... args)
       
      +
      undeclare_no_pointers (T... args)
       
      +
      async (T... args)
       
      +
      partition_point (T... args)
       
      +
      vsscanf (T... args)
       
      +
      fesetround (T... args)
       
      +
      atomic_is_lock_free (T... args)
       
      +
      tanh (T... args)
       
      +
      ldiv (T... args)
       
      +
      setbase (T... args)
       
      +
      remove (T... args)
       
      +
      strtol (T... args)
       
      +
      strpbrk (T... args)
       
      +
      signbit (T... args)
       
      +
      wcsncat (T... args)
       
      +
      get_money (T... args)
       
      +
      set_difference (T... args)
       
      +
      cref (T... args)
       
      +
      getline (T... args)
       
      +
      to_wstring (T... args)
       
      +
      system (T... args)
       
      +
      static_pointer_cast (T... args)
       
      +
      wcstoumax (T... args)
       
      +
      memmove (T... args)
       
      +
      getwchar (T... args)
       
      +
      scientific (T... args)
       
      +
      wcsftime (T... args)
       
      +
      begin (T... args)
       
      +
      ceil (T... args)
       
      +
      sinh (T... args)
       
      +
      is_permutation (T... args)
       
      +
      generate_n (T... args)
       
      +
      acosh (T... args)
       
      +
      advance (T... args)
       
      +
      flush (T... args)
       
      +
      atomic_fetch_xor (T... args)
       
      +
      ws (T... args)
       
      +
      signal (T... args)
       
      +
      noshowbase (T... args)
       
      +
      generate (T... args)
       
      +
      ldexp (T... args)
       
      +
      vsnprintf (T... args)
       
      +
      remove_if (T... args)
       
      +
      stoull (T... args)
       
      +
      fegetexceptflag (T... args)
       
      +
      find_if_not (T... args)
       
      +
      merge (T... args)
       
      +
      free (T... args)
       
      +
      count_if (T... args)
       
      +
      clock (T... args)
       
      +
      mktime (T... args)
       
      +
      inserter (T... args)
       
      +
      puts (T... args)
       
      +
      asin (T... args)
       
      +
      iscntrl (T... args)
       
      +
      difftime (T... args)
       
      +
      terminate (T... args)
       
      +
      memcmp (T... args)
       
      +
      uninitialized_fill (T... args)
       
      +
      hex (T... args)
       
      +
      tie (T... args)
       
      +
      back_inserter (T... args)
       
      +
      upper_bound (T... args)
       
      +
      adjacent_find (T... args)
       
      +
      use_facet (T... args)
       
      +
      vfwprintf (T... args)
       
      +
      atomic_fetch_add (T... args)
       
      +
      fsetpos (T... args)
       
      +
      malloc (T... args)
       
      +
      localtime (T... args)
       
      +
      wcscmp (T... args)
       
      +
      c32rtomb (T... args)
       
      +
      isupper (T... args)
       
      +
      wcstod (T... args)
       
      +
      tolower (T... args)
       
      +
      sort_heap (T... args)
       
      +
      isdigit (T... args)
       
      +
      wcslen (T... args)
       
      +
      wmemcmp (T... args)
       
      +
      move_if_noexcept (T... args)
       
      +
      declval (T... args)
       
      +
      fpclassify (T... args)
       
      +
      iswupper (T... args)
       
      +
      rand (T... args)
       
      +
      atomic_compare_exchange_weak_explicit (T... args)
       
      +
      partial_sort (T... args)
       
      +
      llrint (T... args)
       
      +
      fclose (T... args)
       
      +
      reverse (T... args)
       
      +
      partial_sum (T... args)
       
      +
      showbase (T... args)
       
      +
      vswscanf (T... args)
       
      +
      atan (T... args)
       
      +
      atanh (T... args)
       
      +
      iter_swap (T... args)
       
      +
      scalbln (T... args)
       
      +
      reverse_copy (T... args)
       
      +
      forward (T... args)
       
      +
      getc (T... args)
       
      +
      equal_range (T... args)
       
      +
      atomic_fetch_sub (T... args)
       
      +
      is_partitioned (T... args)
       
      +
      next_permutation (T... args)
       
      +
      isblank (T... args)
       
      +
      noshowpoint (T... args)
       
      +
      atan2 (T... args)
       
      +
      nanf (T... args)
       
      +
      towctrans (T... args)
       
      +
      right (T... args)
       
      +
      fputwc (T... args)
       
      +
      strtoul (T... args)
       
      +
      is_heap (T... args)
       
      +
      fflush (T... args)
       
      +
      strtoumax (T... args)
       
      +
      nexttoward (T... args)
       
      +
      nounitbuf (T... args)
       
      +
      ispunct (T... args)
       
      +
      noboolalpha (T... args)
       
      +
      make_pair (T... args)
       
      +
      iswctype (T... args)
       
      +
      srand (T... args)
       
      +
      replace_copy (T... args)
       
      +
      future_category (T... args)
       
      +
      resetiosflags (T... args)
       
      +
      vprintf (T... args)
       
      +
      gmtime (T... args)
       
      +
      align (T... args)
       
      +
      tuple_cat (T... args)
       
      +
      ends (T... args)
       
      +
      set_terminate (T... args)
       
      +
      lrint (T... args)
       
      +
      none_of (T... args)
       
      +
      wscanf (T... args)
       
      +
      fputc (T... args)
       
      +
      dec (T... args)
       
      +
      strcat (T... args)
       
      +
      raise (T... args)
       
      +
      wcsspn (T... args)
       
      +
      fabs (T... args)
       
      +
      wmemcpy (T... args)
       
      +
      copy_n (T... args)
       
      +
      rethrow_if_nested (T... args)
       
      +
      setlocale (T... args)
       
      +
      addressof (T... args)
       
      +
      calloc (T... args)
       
      +
      strerror (T... args)
       
      +
      strcpy (T... args)
       
      +
      wcstoull (T... args)
       
      +
      c16rtomb (T... args)
       
      +
      generate_canonical (T... args)
       
      +
      vfprintf (T... args)
       
      +
      notify_all_at_thread_exit (T... args)
       
      +
      rotate (T... args)
       
      +
      current_exception (T... args)
       
      +
      strtok (T... args)
       
      +
      wcscat (T... args)
       
      +
      strncpy (T... args)
       
      +
      towlower (T... args)
       
      +
      floor (T... args)
       
      +
      left (T... args)
       
      +
      ferror (T... args)
       
      +
      atomic_load_explicit (T... args)
       
      +
      swap (T... args)
       
      +
      acos (T... args)
       
      +
      wcscoll (T... args)
       
      +
      sqrt (T... args)
       
      +
      mbsinit (T... args)
       
      +
      qsort (T... args)
       
      +
      stoll (T... args)
       
      +
      put_money (T... args)
       
      +
      wcstoul (T... args)
       
      +
      wcstol (T... args)
       
      +
      atexit (T... args)
       
      +
      atomic_fetch_or (T... args)
       
      +
      rewind (T... args)
       
      +
      wcsxfrm (T... args)
       
      +
      round (T... args)
       
      +
      vwprintf (T... args)
       
      +
      all_of (T... args)
       
      +
      replace (T... args)
       
      +
      remquo (T... args)
       
      +
      setbuf (T... args)
       
      +
      strncmp (T... args)
       
      +
      localeconv (T... args)
       
      +
      wctrans (T... args)
       
      +
      any_of (T... args)
       
      +
      equal (T... args)
       
      +
      max (T... args)
       
      +
      strxfrm (T... args)
       
      +
      iswxdigit (T... args)
       
      +
      labs (T... args)
       
      +
      regex_match (T... args)
       
      +
      fputws (T... args)
       
      +
      wcrtomb (T... args)
       
      +
      setprecision (T... args)
       
      +
      setvbuf (T... args)
       
      +
      regex_replace (T... args)
       
      +
      freopen (T... args)
       
      +
      logb (T... args)
       
      +
      wctob (T... args)
       
      +
      atomic_load (T... args)
       
      +
      search_n (T... args)
       
      +
      toupper (T... args)
       
      +
      move_backward (T... args)
       
      +
      is_sorted (T... args)
       
      +
      strtoull (T... args)
       
      +
      iswblank (T... args)
       
      +
      get_pointer_safety (T... args)
       
      +
      get_unexpected (T... args)
       
      +
      sscanf (T... args)
       
      +
      fesetenv (T... args)
       
      +
      atomic_store_explicit (T... args)
       
      +
      strtold (T... args)
       
      +
      fread (T... args)
       
      +
      memchr (T... args)
       
      +
      btowc (T... args)
       
      +
      replace_if (T... args)
       
      +
      strcoll (T... args)
       
      +
      vsprintf (T... args)
       
      +
      mismatch (T... args)
       
      +
      getchar (T... args)
       
      +
      islower (T... args)
       
      +
      tmpnam (T... args)
       
      +
      nanl (T... args)
       
      +
      fopen (T... args)
       
      +
      for_each (T... args)
       
      +
      fegetround (T... args)
       
      +
      ungetc (T... args)
       
      +
      internal (T... args)
       
      +
      vfwscanf (T... args)
       
      +
      fgetc (T... args)
       
      +
      wcstof (T... args)
       
      +
      bind (T... args)
       
      +
      skipws (T... args)
       
      +
      iswprint (T... args)
       
      +
      wcstombs (T... args)
       
      +
      inplace_merge (T... args)
       
      +
      copysign (T... args)
       
      +
      putwchar (T... args)
       
      +
      wcsstr (T... args)
       
      +
      fegetenv (T... args)
       
      +
      longjmp (T... args)
       
      +
      iswcntrl (T... args)
       
      +
      declare_no_pointers (T... args)
       
      +
      isnormal (T... args)
       
      +
      swap_ranges (T... args)
       
      +
      minmax (T... args)
       
      +
      defaultfloat (T... args)
       
      +
      rename (T... args)
       
      +
      snprintf (T... args)
       
      +
      try_lock (T... args)
       
      +
      stoul (T... args)
       
      +
      fgetpos (T... args)
       
      +
      partition_copy (T... args)
       
      +
      vscanf (T... args)
       
      +
      front_inserter (T... args)
       
      +
      get_terminate (T... args)
       
      +
      cosh (T... args)
       
      +
      prev (T... args)
       
      +
      strchr (T... args)
       
      +
      strstr (T... args)
       
      +
      printf (T... args)
       
      +
      setfill (T... args)
       
      +
      inner_product (T... args)
       

      Detailed Description

      -

      STL namespace.

      +

      STL namespace.

      diff --git a/d8/dcc/namespacestd.js b/d8/dcc/namespacestd.js index 224293bfa..62907375b 100644 --- a/d8/dcc/namespacestd.js +++ b/d8/dcc/namespacestd.js @@ -19,11 +19,11 @@ var namespacestd = [ "sleep_until", "http://en.cppreference.com/w/cpp/thread/sleep_until.html", null ], [ "yield", "http://en.cppreference.com/w/cpp/thread/yield.html", null ] ] ], - [ "is_integral< uint128_t >", "d2/dd4/structstd_1_1is__integral_3_01uint128__t_01_4.html", null ], [ "is_arithmetic< uint128_t >", "d2/dfc/structstd_1_1is__arithmetic_3_01uint128__t_01_4.html", null ], - [ "is_unsigned< uint128_t >", "d5/d25/structstd_1_1is__unsigned_3_01uint128__t_01_4.html", null ], - [ "is_integral< uint256_t >", "d7/d47/structstd_1_1is__integral_3_01uint256__t_01_4.html", null ], [ "is_arithmetic< uint256_t >", "dc/d6d/structstd_1_1is__arithmetic_3_01uint256__t_01_4.html", null ], + [ "is_integral< uint128_t >", "d2/dd4/structstd_1_1is__integral_3_01uint128__t_01_4.html", null ], + [ "is_integral< uint256_t >", "d7/d47/structstd_1_1is__integral_3_01uint256__t_01_4.html", null ], + [ "is_unsigned< uint128_t >", "d5/d25/structstd_1_1is__unsigned_3_01uint128__t_01_4.html", null ], [ "is_unsigned< uint256_t >", "df/d99/structstd_1_1is__unsigned_3_01uint256__t_01_4.html", null ], [ "_Exit", "http://en.cppreference.com/w/cpp/utility/program/_Exit.html", null ], [ "abort", "http://en.cppreference.com/w/cpp/utility/program/abort.html", null ], diff --git a/d8/dcd/namespacelru__cache.html b/d8/dcd/namespacelru__cache.html index 7d5a06557..7439b10fe 100644 --- a/d8/dcd/namespacelru__cache.html +++ b/d8/dcd/namespacelru__cache.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: lru_cache Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d8/dcd/namespacelru__cache.html','../.
      -
      -
      lru_cache Namespace Reference
      +
      lru_cache Namespace Reference
      -

      Implementation of the LRU caching algorithm +

      Implementation of the LRU caching algorithm More...

      Detailed Description

      -

      Implementation of the LRU caching algorithm

      +

      Implementation of the LRU caching algorithm

      diff --git a/d8/dd5/check__factorial_8cpp.html b/d8/dd5/check__factorial_8cpp.html index 1d3248b79..d3b7a1b5f 100644 --- a/d8/dd5/check__factorial_8cpp.html +++ b/d8/dd5/check__factorial_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: math/check_factorial.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d8/dd5/check__factorial_8cpp.html','..
      -
      -
      check_factorial.cpp File Reference
      +
      check_factorial.cpp File Reference
      @@ -108,7 +107,7 @@ Include dependency graph for check_factorial.cpp:
      - @@ -118,10 +117,10 @@ Functions

      +

      Functions

      bool is_factorial (uint64_t n)
       
       

      Detailed Description

      -

      A simple program to check if the given number is a factorial of some number or not.

      -
      Author
      Divyajyoti Ukirde
      +

      A simple program to check if the given number is a factorial of some number or not.

      +
      Author
      Divyajyoti Ukirde

      Function Documentation

      - +

      ◆ is_factorial()

      @@ -136,33 +135,33 @@ Functions
      -

      Function to check if the given number is factorial of some number or not.

      Parameters
      +

      Function to check if the given number is factorial of some number or not.

      Parameters
      nnumber to be checked.
      Returns
      if number is a factorial, returns true, else false.
      -
      16  {
      -
      17  if (n <= 0) {
      -
      18  return false;
      -
      19  }
      -
      20  for (uint32_t i = 1;; i++) {
      -
      21  if (n % i != 0) {
      -
      22  break;
      -
      23  }
      -
      24  n = n / i;
      -
      25  }
      -
      26  if (n == 1) {
      -
      27  return true;
      -
      28  } else {
      -
      29  return false;
      -
      30  }
      -
      31 }
      +
      16 {
      +
      17 if (n <= 0) {
      +
      18 return false;
      +
      19 }
      +
      20 for (uint32_t i = 1;; i++) {
      +
      21 if (n % i != 0) {
      +
      22 break;
      +
      23 }
      +
      24 n = n / i;
      +
      25 }
      +
      26 if (n == 1) {
      +
      27 return true;
      +
      28 } else {
      +
      29 return false;
      +
      30 }
      +
      31}
      - +

      ◆ main()

      @@ -177,11 +176,11 @@ Functions
      -

      Main function

      Returns
      0 on exit
      -
      61  {
      -
      62  tests();
      -
      63  return 0;
      -
      64 }
      +

      Main function

      Returns
      0 on exit
      +
      61 {
      +
      62 tests();
      +
      63 return 0;
      +
      64}
      void tests()
      Definition: check_factorial.cpp:36
      Here is the call graph for this function:
      @@ -192,7 +191,7 @@ Here is the call graph for this function:
      - +

      ◆ tests()

      @@ -206,28 +205,28 @@ Here is the call graph for this function:
      -

      Test function

      Returns
      void
      -
      36  {
      -
      37  std::cout << "Test 1:\t n=50\n";
      -
      38  assert(is_factorial(50) == false);
      -
      39  std::cout << "passed\n";
      -
      40 
      -
      41  std::cout << "Test 2:\t n=720\n";
      -
      42  assert(is_factorial(720) == true);
      -
      43  std::cout << "passed\n";
      -
      44 
      -
      45  std::cout << "Test 3:\t n=0\n";
      -
      46  assert(is_factorial(0) == false);
      -
      47  std::cout << "passed\n";
      -
      48 
      -
      49  std::cout << "Test 4:\t n=479001600\n";
      -
      50  assert(is_factorial(479001600) == true);
      -
      51  std::cout << "passed\n";
      -
      52 
      -
      53  std::cout << "Test 5:\t n=-24\n";
      -
      54  assert(is_factorial(-24) == false);
      -
      55  std::cout << "passed\n";
      -
      56 }
      +

      Test function

      Returns
      void
      +
      36 {
      +
      37 std::cout << "Test 1:\t n=50\n";
      +
      38 assert(is_factorial(50) == false);
      +
      39 std::cout << "passed\n";
      +
      40
      +
      41 std::cout << "Test 2:\t n=720\n";
      +
      42 assert(is_factorial(720) == true);
      +
      43 std::cout << "passed\n";
      +
      44
      +
      45 std::cout << "Test 3:\t n=0\n";
      +
      46 assert(is_factorial(0) == false);
      +
      47 std::cout << "passed\n";
      +
      48
      +
      49 std::cout << "Test 4:\t n=479001600\n";
      +
      50 assert(is_factorial(479001600) == true);
      +
      51 std::cout << "passed\n";
      +
      52
      +
      53 std::cout << "Test 5:\t n=-24\n";
      +
      54 assert(is_factorial(-24) == false);
      +
      55 std::cout << "passed\n";
      +
      56}
      bool is_factorial(uint64_t n)
      Definition: check_factorial.cpp:16
      @@ -245,7 +244,7 @@ Here is the call graph for this function:
      diff --git a/d8/dd5/check__factorial_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg b/d8/dd5/check__factorial_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg index a91a6a786..e94fd35f4 100644 --- a/d8/dd5/check__factorial_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg +++ b/d8/dd5/check__factorial_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: math/sieve_of_eratosthenes.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d8/ddf/sieve__of__eratosthenes_8cpp.ht
      -
      -
      sieve_of_eratosthenes.cpp File Reference
      +
      sieve_of_eratosthenes.cpp File Reference
      @@ -109,10 +108,10 @@ Include dependency graph for sieve_of_eratosthenes.cpp:
      - - - + + @@ -121,13 +120,13 @@ Functions

      +

      Functions

      std::vector< bool > sieve (uint32_t N)
       
      std::vector< bool > sieve (uint32_t N)
       
      void print (uint32_t N, const std::vector< bool > &is_prime)
       
      void tests ()
       

      Detailed Description

      -

      Get list of prime numbers using Sieve of Eratosthenes.

      -

      Sieve of Eratosthenes is an algorithm that finds all the primes between 2 and N.

      -

      Time Complexity : \(O(N \cdot\log \log N)\)
      +

      Get list of prime numbers using Sieve of Eratosthenes.

      +

      Sieve of Eratosthenes is an algorithm that finds all the primes between 2 and N.

      +

      Time Complexity : \(O(N \cdot\log \log N)\)
      Space Complexity : \(O(N)\)

      See also
      primes_up_to_billion.cpp prime_numbers.cpp

      Function Documentation

      - +

      ◆ main()

      @@ -142,21 +141,21 @@ Space Complexity : \(O(N)\)

      -

      Main function

      -
      65  {
      -
      66  tests();
      -
      67 
      -
      68  uint32_t N = 100;
      - -
      70  print(N, is_prime);
      -
      71  return 0;
      -
      72 }
      +

      Main function

      +
      65 {
      +
      66 tests();
      +
      67
      +
      68 uint32_t N = 100;
      + +
      70 print(N, is_prime);
      +
      71 return 0;
      +
      72}
      bool is_prime(T num)
      Definition: check_prime.cpp:22
      constexpr uint32_t N
      A struct to represent sparse table for min() as their invariant function, for the given array A....
      Definition: sparse_table.cpp:47
      void print(uint32_t N, const std::vector< bool > &is_prime)
      Definition: sieve_of_eratosthenes.cpp:44
      -
      std::vector< bool > sieve(uint32_t N)
      Definition: sieve_of_eratosthenes.cpp:26
      +
      std::vector< bool > sieve(uint32_t N)
      Definition: sieve_of_eratosthenes.cpp:26
      void tests()
      Definition: sieve_of_eratosthenes.cpp:56
      - +
      Here is the call graph for this function:
      @@ -166,7 +165,7 @@ Here is the call graph for this function:
      - +

      ◆ print()

      @@ -191,21 +190,21 @@ Here is the call graph for this function:
      -

      This function prints out the primes to STDOUT

      Parameters
      +

      This function prints out the primes to STDOUT

      Parameters
      Nnumber of primes to check
      is_primea vector of N + 1 booleans identifying if i^th number is a prime or not
      -
      44  {
      -
      45  for (uint32_t i = 2; i <= N; i++) {
      -
      46  if (is_prime[i]) {
      -
      47  std::cout << i << ' ';
      -
      48  }
      -
      49  }
      - -
      51 }
      +
      44 {
      +
      45 for (uint32_t i = 2; i <= N; i++) {
      +
      46 if (is_prime[i]) {
      +
      47 std::cout << i << ' ';
      +
      48 }
      +
      49 }
      + +
      51}
      T endl(T... args)
      @@ -217,14 +216,14 @@ Here is the call graph for this function:
      - -

      ◆ sieve()

      + +

      ◆ sieve()

      - + @@ -232,35 +231,35 @@ Here is the call graph for this function:
      std::vector<bool> sieve std::vector< bool > sieve ( uint32_t  N)
      -

      This is the function that finds the primes and eliminates the multiples. Contains a common optimization to start eliminating multiples of a prime p starting from p * p since all of the lower multiples have been already eliminated.

      Parameters
      +

      This is the function that finds the primes and eliminates the multiples. Contains a common optimization to start eliminating multiples of a prime p starting from p * p since all of the lower multiples have been already eliminated.

      Parameters
      Nnumber of primes to check
      Returns
      is_prime a vector of N + 1 booleans identifying if i^th number is a prime or not
      -
      26  {
      -
      27  std::vector<bool> is_prime(N + 1, true);
      -
      28  is_prime[0] = is_prime[1] = false;
      -
      29  for (uint32_t i = 2; i * i <= N; i++) {
      -
      30  if (is_prime[i]) {
      -
      31  for (uint32_t j = i * i; j <= N; j += i) {
      -
      32  is_prime[j] = false;
      -
      33  }
      -
      34  }
      -
      35  }
      -
      36  return is_prime;
      -
      37 }
      +
      26 {
      +
      27 std::vector<bool> is_prime(N + 1, true);
      +
      28 is_prime[0] = is_prime[1] = false;
      +
      29 for (uint32_t i = 2; i * i <= N; i++) {
      +
      30 if (is_prime[i]) {
      +
      31 for (uint32_t j = i * i; j <= N; j += i) {
      +
      32 is_prime[j] = false;
      +
      33 }
      +
      34 }
      +
      35 }
      +
      36 return is_prime;
      +
      37}
      Here is the call graph for this function:
      -
      +
      - +

      ◆ tests()

      @@ -274,12 +273,12 @@ Here is the call graph for this function:
      -

      Test implementations

      -
      56  {
      -
      57  // 0 1 2 3 4 5 6 7 8 9 10
      -
      58  std::vector<bool> ans{false, false, true, true, false, true, false, true, false, false, false};
      -
      59  assert(sieve(10) == ans);
      -
      60 }
      +

      Test implementations

      +
      56 {
      +
      57 // 0 1 2 3 4 5 6 7 8 9 10
      +
      58 std::vector<bool> ans{false, false, true, true, false, true, false, true, false, false, false};
      +
      59 assert(sieve(10) == ans);
      +
      60}
      ll ans(ll n)
      Definition: matrix_exponentiation.cpp:91
      Here is the call graph for this function:
      @@ -296,7 +295,7 @@ Here is the call graph for this function:
      diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp.js b/d8/ddf/sieve__of__eratosthenes_8cpp.js index 97b7488fc..2bb2cb4e7 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp.js +++ b/d8/ddf/sieve__of__eratosthenes_8cpp.js @@ -2,6 +2,6 @@ var sieve__of__eratosthenes_8cpp = [ [ "main", "d8/ddf/sieve__of__eratosthenes_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "print", "d8/ddf/sieve__of__eratosthenes_8cpp.html#a235843bdf82d2a6cc8596ae8fd3b8df9", null ], - [ "sieve", "d8/ddf/sieve__of__eratosthenes_8cpp.html#a60fa6579eab0db3c1c0ab1bf6d651be3", null ], + [ "sieve", "d8/ddf/sieve__of__eratosthenes_8cpp.html#a7eebd5e7686a8db363f937b2f30d3818", null ], [ "tests", "d8/ddf/sieve__of__eratosthenes_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9", null ] ]; \ No newline at end of file diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.svg b/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.svg index 96511a6cf..00f3c3730 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.svg +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.svg @@ -1,7 +1,7 @@ - - - + diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 b/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 index 7cbabae43..f0b5a237f 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 @@ -1 +1 @@ -c8a37f929d53cdd8771c77f29ae37f88 \ No newline at end of file +22f81b079611b763df85f7dde7633cdf \ No newline at end of file diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg b/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg index fc2e84e99..83e220927 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + sieve diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 9945c6a76..06ab319fd 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -2,7 +2,7 @@ - + diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 419977b90..75d42cfc8 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -e2ac51f1772d88e2ca7d3064024667e6 \ No newline at end of file +1322414ac99b02b42ed9f079121b0540 \ No newline at end of file diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 3b523a0ea..3873ae603 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - Node5 - + sieve diff --git a/d8/de0/radix__sort2_8cpp__incl.svg b/d8/de0/radix__sort2_8cpp__incl.svg index 7258c7e71..13bbba41c 100644 --- a/d8/de0/radix__sort2_8cpp__incl.svg +++ b/d8/de0/radix__sort2_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: data_structures/avltree.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -94,8 +94,7 @@ $(document).ready(function(){initNavTree('d8/dee/avltree_8cpp.html','../../'); i Classes | Typedefs | Functions -
      -
      avltree.cpp File Reference
      +
      avltree.cpp File Reference
      @@ -111,53 +110,53 @@ Include dependency graph for avltree.cpp:
      -

      +

      Classes

      class  node< Kind >
       
      - -

      +

      Typedefs

      +
      typedef struct node node
       
      - - - + + - - - - - - - - - - + + + + + + + + + +

      +

      Functions

      nodecreateNode (int data)
       
      nodecreateNode (int data)
       
      int height (node *root)
       
      int getBalance (node *root)
       
      noderightRotate (node *root)
       
      nodeleftRotate (node *root)
       
      nodeminValue (node *root)
       
      nodeinsert (node *root, int item)
       
      nodedeleteNode (node *root, int key)
       
      noderightRotate (node *root)
       
      nodeleftRotate (node *root)
       
      nodeminValue (node *root)
       
      nodeinsert (node *root, int item)
       
      nodedeleteNode (node *root, int key)
       
      void levelOrder (node *root)
       
      int main ()
       

      Detailed Description

      -

      A simple tree implementation using nodes.

      +

      A simple tree implementation using nodes.

      Todo:
      update code to use C++ STL library features and OO structure
      Warning
      This program is a poor implementation and does not utilize any of the C++ STL features.

      Function Documentation

      - -

      ◆ createNode()

      + +

      ◆ createNode()

      - + @@ -165,29 +164,29 @@ Functions
      node* createNode node * createNode ( int  data)
      -

      Create and return a new Node

      -
      21  {
      -
      22  node *nn = new node();
      -
      23  nn->data = data;
      -
      24  nn->height = 0;
      -
      25  nn->left = NULL;
      -
      26  nn->right = NULL;
      -
      27  return nn;
      -
      28 }
      +

      Create and return a new Node

      +
      21 {
      +
      22 node *nn = new node();
      +
      23 nn->data = data;
      +
      24 nn->height = 0;
      +
      25 nn->left = NULL;
      +
      26 nn->right = NULL;
      +
      27 return nn;
      +
      28}
      int data[MAX]
      test data
      Definition: hash_search.cpp:24
      struct list node
      Definition: avltree.cpp:13
      - -

      ◆ deleteNode()

      + +

      ◆ deleteNode()

      - + @@ -205,43 +204,42 @@ Functions
      node* deleteNode node * deleteNode ( node root,
      -

      Balanced Deletion

      -
      88  {
      -
      89  if (root == NULL)
      -
      90  return root;
      -
      91  if (key < root->data)
      -
      92  root->left = deleteNode(root->left, key);
      -
      93  else if (key > root->data)
      -
      94  root->right = deleteNode(root->right, key);
      -
      95 
      -
      96  else {
      -
      97  // Node to be deleted is leaf node or have only one Child
      -
      98  if (!root->right) {
      -
      99  node *temp = root->left;
      -
      100  delete (root);
      -
      101  root = NULL;
      -
      102  return temp;
      -
      103  } else if (!root->left) {
      -
      104  node *temp = root->right;
      -
      105  delete (root);
      -
      106  root = NULL;
      -
      107  return temp;
      -
      108  }
      -
      109  // Node to be deleted have both left and right subtrees
      -
      110  node *temp = minValue(root->right);
      -
      111  root->data = temp->data;
      -
      112  root->right = deleteNode(root->right, temp->data);
      -
      113  }
      -
      114  // Balancing Tree after deletion
      -
      115  return root;
      -
      116 }
      -
      node * deleteNode(node *root, int key)
      Definition: avltree.cpp:88
      -
      node * minValue(node *root)
      Definition: avltree.cpp:59
      -
      T data(T... args)
      +

      Balanced Deletion

      +
      88 {
      +
      89 if (root == NULL)
      +
      90 return root;
      +
      91 if (key < root->data)
      +
      92 root->left = deleteNode(root->left, key);
      +
      93 else if (key > root->data)
      +
      94 root->right = deleteNode(root->right, key);
      +
      95
      +
      96 else {
      +
      97 // Node to be deleted is leaf node or have only one Child
      +
      98 if (!root->right) {
      +
      99 node *temp = root->left;
      +
      100 delete (root);
      +
      101 root = NULL;
      +
      102 return temp;
      +
      103 } else if (!root->left) {
      +
      104 node *temp = root->right;
      +
      105 delete (root);
      +
      106 root = NULL;
      +
      107 return temp;
      +
      108 }
      +
      109 // Node to be deleted have both left and right subtrees
      +
      110 node *temp = minValue(root->right);
      +
      111 root->data = temp->data;
      +
      112 root->right = deleteNode(root->right, temp->data);
      +
      113 }
      +
      114 // Balancing Tree after deletion
      +
      115 return root;
      +
      116}
      +
      node * minValue(node *root)
      Definition: avltree.cpp:59
      +
      node * deleteNode(node *root, int key)
      Definition: avltree.cpp:88
      - +

      ◆ getBalance()

      @@ -256,13 +254,13 @@ Functions
      -

      Returns difference between height of left and right subtree

      -
      38 { return height(root->left) - height(root->right); }
      +

      Returns difference between height of left and right subtree

      +
      38{ return height(root->left) - height(root->right); }
      int height(node *root)
      Definition: avltree.cpp:31
      - +

      ◆ height()

      @@ -277,24 +275,24 @@ Functions
      -

      Returns height of tree

      -
      31  {
      -
      32  if (root == NULL)
      -
      33  return 0;
      -
      34  return 1 + std::max(height(root->left), height(root->right));
      -
      35 }
      +

      Returns height of tree

      +
      31 {
      +
      32 if (root == NULL)
      +
      33 return 0;
      +
      34 return 1 + std::max(height(root->left), height(root->right));
      +
      35}
      T max(T... args)
      - -

      ◆ insert()

      + +

      ◆ insert()

      - + @@ -312,43 +310,43 @@ Functions
      node* insert node * insert ( node root,
      -

      Balanced Insertion

      -
      66  {
      -
      67  node *nn = createNode(item);
      -
      68  if (root == NULL)
      -
      69  return nn;
      -
      70  if (item < root->data)
      -
      71  root->left = insert(root->left, item);
      -
      72  else
      -
      73  root->right = insert(root->right, item);
      -
      74  int b = getBalance(root);
      -
      75  if (b > 1) {
      -
      76  if (getBalance(root->left) < 0)
      -
      77  root->left = leftRotate(root->left); // Left-Right Case
      -
      78  return rightRotate(root); // Left-Left Case
      -
      79  } else if (b < -1) {
      -
      80  if (getBalance(root->right) > 0)
      -
      81  root->right = rightRotate(root->right); // Right-Left Case
      -
      82  return leftRotate(root); // Right-Right Case
      -
      83  }
      -
      84  return root;
      -
      85 }
      -
      node * createNode(int data)
      Definition: avltree.cpp:21
      -
      node * rightRotate(node *root)
      Definition: avltree.cpp:41
      -
      node * insert(node *root, int item)
      Definition: avltree.cpp:66
      +

      Balanced Insertion

      +
      66 {
      +
      67 node *nn = createNode(item);
      +
      68 if (root == NULL)
      +
      69 return nn;
      +
      70 if (item < root->data)
      +
      71 root->left = insert(root->left, item);
      +
      72 else
      +
      73 root->right = insert(root->right, item);
      +
      74 int b = getBalance(root);
      +
      75 if (b > 1) {
      +
      76 if (getBalance(root->left) < 0)
      +
      77 root->left = leftRotate(root->left); // Left-Right Case
      +
      78 return rightRotate(root); // Left-Left Case
      +
      79 } else if (b < -1) {
      +
      80 if (getBalance(root->right) > 0)
      +
      81 root->right = rightRotate(root->right); // Right-Left Case
      +
      82 return leftRotate(root); // Right-Right Case
      +
      83 }
      +
      84 return root;
      +
      85}
      +
      node * insert(node *root, int item)
      Definition: avltree.cpp:66
      +
      node * leftRotate(node *root)
      Definition: avltree.cpp:50
      +
      node * createNode(int data)
      Definition: avltree.cpp:21
      int getBalance(node *root)
      Definition: avltree.cpp:38
      -
      node * leftRotate(node *root)
      Definition: avltree.cpp:50
      +
      node * rightRotate(node *root)
      Definition: avltree.cpp:41
      - -

      ◆ leftRotate()

      + +

      ◆ leftRotate()

      - + @@ -356,18 +354,18 @@ Functions
      node* leftRotate node * leftRotate ( node root)
      -

      Returns Node after Left Rotation

      -
      50  {
      -
      51  node *t = root->right;
      -
      52  node *u = t->left;
      -
      53  t->left = root;
      -
      54  root->right = u;
      -
      55  return t;
      -
      56 }
      +

      Returns Node after Left Rotation

      +
      50 {
      +
      51 node *t = root->right;
      +
      52 node *u = t->left;
      +
      53 t->left = root;
      +
      54 root->right = u;
      +
      55 return t;
      +
      56}
      - +

      ◆ levelOrder()

      @@ -382,26 +380,26 @@ Functions
      -

      LevelOrder (Breadth First Search)

      -
      119  {
      - -
      121  q.push(root);
      -
      122  while (!q.empty()) {
      -
      123  root = q.front();
      -
      124  std::cout << root->data << " ";
      -
      125  q.pop();
      -
      126  if (root->left)
      -
      127  q.push(root->left);
      -
      128  if (root->right)
      -
      129  q.push(root->right);
      -
      130  }
      -
      131 }
      +

      LevelOrder (Breadth First Search)

      +
      119 {
      + +
      121 q.push(root);
      +
      122 while (!q.empty()) {
      +
      123 root = q.front();
      +
      124 std::cout << root->data << " ";
      +
      125 q.pop();
      +
      126 if (root->left)
      +
      127 q.push(root->left);
      +
      128 if (root->right)
      +
      129 q.push(root->right);
      +
      130 }
      +
      131}
      - +

      ◆ main()

      @@ -416,34 +414,34 @@ Functions
      -

      Main function

      -
      134  {
      -
      135  // Testing AVL Tree
      -
      136  node *root = NULL;
      -
      137  int i;
      -
      138  for (i = 1; i <= 7; i++) root = insert(root, i);
      -
      139  std::cout << "LevelOrder: ";
      -
      140  levelOrder(root);
      -
      141  root = deleteNode(root, 1); // Deleting key with value 1
      -
      142  std::cout << "\nLevelOrder: ";
      -
      143  levelOrder(root);
      -
      144  root = deleteNode(root, 4); // Deletin key with value 4
      -
      145  std::cout << "\nLevelOrder: ";
      -
      146  levelOrder(root);
      -
      147  return 0;
      -
      148 }
      +

      Main function

      +
      134 {
      +
      135 // Testing AVL Tree
      +
      136 node *root = NULL;
      +
      137 int i;
      +
      138 for (i = 1; i <= 7; i++) root = insert(root, i);
      +
      139 std::cout << "LevelOrder: ";
      +
      140 levelOrder(root);
      +
      141 root = deleteNode(root, 1); // Deleting key with value 1
      +
      142 std::cout << "\nLevelOrder: ";
      +
      143 levelOrder(root);
      +
      144 root = deleteNode(root, 4); // Deletin key with value 4
      +
      145 std::cout << "\nLevelOrder: ";
      +
      146 levelOrder(root);
      +
      147 return 0;
      +
      148}
      void levelOrder(node *root)
      Definition: avltree.cpp:119
      - -

      ◆ minValue()

      + +

      ◆ minValue()

      - + @@ -451,23 +449,23 @@ Functions
      node* minValue node * minValue ( node root)
      -

      Returns node with minimum value in the tree

      -
      59  {
      -
      60  if (root->left == NULL)
      -
      61  return root;
      -
      62  return minValue(root->left);
      -
      63 }
      +

      Returns node with minimum value in the tree

      +
      59 {
      +
      60 if (root->left == NULL)
      +
      61 return root;
      +
      62 return minValue(root->left);
      +
      63}
      - -

      ◆ rightRotate()

      + +

      ◆ rightRotate()

      - + @@ -475,14 +473,14 @@ Functions
      node* rightRotate node * rightRotate ( node root)
      -

      Returns Node after Right Rotation

      -
      41  {
      -
      42  node *t = root->left;
      -
      43  node *u = t->right;
      -
      44  t->right = root;
      -
      45  root->left = u;
      -
      46  return t;
      -
      47 }
      +

      Returns Node after Right Rotation

      +
      41 {
      +
      42 node *t = root->left;
      +
      43 node *u = t->right;
      +
      44 t->right = root;
      +
      45 root->left = u;
      +
      46 return t;
      +
      47}
      @@ -492,7 +490,7 @@ Functions diff --git a/d8/dee/avltree_8cpp.js b/d8/dee/avltree_8cpp.js index 45fea15e8..155b7106b 100644 --- a/d8/dee/avltree_8cpp.js +++ b/d8/dee/avltree_8cpp.js @@ -1,15 +1,14 @@ var avltree_8cpp = [ - [ "node", "d5/da1/structnode.html", "d5/da1/structnode" ], - [ "node", "d8/dee/avltree_8cpp.html#af4aeda155dbe167f1c1cf38cb65bf324", null ], - [ "createNode", "d8/dee/avltree_8cpp.html#a1ecfaaea49d452772dbb2b28133e36e0", null ], - [ "deleteNode", "d8/dee/avltree_8cpp.html#a8286388b0743a716145639df3a33e541", null ], + [ "node< Kind >", "d5/da1/structnode.html", "d5/da1/structnode" ], + [ "createNode", "d8/dee/avltree_8cpp.html#a48d897353aeb6a721dbc6b6c57e035e6", null ], + [ "deleteNode", "d8/dee/avltree_8cpp.html#a9977e004a42fade067836b295a0aa7c1", null ], [ "getBalance", "d8/dee/avltree_8cpp.html#aaa457ffec24c9643f2768e7a65e96546", null ], [ "height", "d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83", null ], - [ "insert", "d8/dee/avltree_8cpp.html#aa7cd8a68075fae1c33df41233c1bed6a", null ], - [ "leftRotate", "d8/dee/avltree_8cpp.html#aed58f3cea338a9d7bdcb9a4cfc6c7a78", null ], + [ "insert", "d8/dee/avltree_8cpp.html#a2473fe7416332495b2678ebe89652e4b", null ], + [ "leftRotate", "d8/dee/avltree_8cpp.html#a473eee1803e4e44a54d685e4b0eef5a6", null ], [ "levelOrder", "d8/dee/avltree_8cpp.html#ae197eb50188fb761346952b9b5f6be59", null ], [ "main", "d8/dee/avltree_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "minValue", "d8/dee/avltree_8cpp.html#adb8e952bf1c266bae84111b9d6a12015", null ], - [ "rightRotate", "d8/dee/avltree_8cpp.html#a4d93589966920b2756b84f8b92c54d1c", null ] + [ "minValue", "d8/dee/avltree_8cpp.html#a5fa160a678a34dd51c0aea1c0c00ed5e", null ], + [ "rightRotate", "d8/dee/avltree_8cpp.html#adfc1d482a564c041756719667b955b8c", null ] ]; \ No newline at end of file diff --git a/d8/df0/queue__using__array_8cpp.html b/d8/df0/queue__using__array_8cpp.html index a1f86ea8f..0a85b23fd 100644 --- a/d8/df0/queue__using__array_8cpp.html +++ b/d8/df0/queue__using__array_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: data_structures/queue_using_array.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -95,12 +95,11 @@ $(document).ready(function(){initNavTree('d8/df0/queue__using__array_8cpp.html', Namespaces | Functions | Variables
      -
      -
      queue_using_array.cpp File Reference
      +
      queue_using_array.cpp File Reference
      -

      Implementation of Linear Queue using array. +

      Implementation of Linear Queue using array. More...

      #include <array>
      #include <iostream>
      @@ -111,45 +110,45 @@ Include dependency graph for queue_using_array.cpp:
      -

      +

      Classes

      class  data_structures::queue_using_array::Queue_Array
       Queue_Array class containing the main data and also index of head and tail of the array. More...
       
      - - + - - + +

      +

      Namespaces

       data_structures
      namespace  data_structures
       Data Structures algorithms.
       
       queue_using_array
       Functions for Queue using Array implementation.
      namespace  queue_using_array
       Functions for Queue using Array implementation.
       
      -

      +

      Functions

      int main ()
       Main function. More...
       
      -

      +

      Variables

      constexpr uint16_t max_size {10}
       for io operations More...
       

      Detailed Description

      -

      Implementation of Linear Queue using array.

      -

      The Linear Queue is a data structure used for holding a sequence of values, which can be added to the end line (enqueue), removed from head of line (dequeue) and displayed.

      +

      Implementation of Linear Queue using array.

      +

      The Linear Queue is a data structure used for holding a sequence of values, which can be added to the end line (enqueue), removed from head of line (dequeue) and displayed.

      Algorithm

      -

      Values can be added by increasing the rear variable by 1 (which points to the end of the array), then assigning new value to rear's element of the array.

      -

      Values can be removed by increasing the front variable by 1 (which points to the first of the array), so it cannot reached any more.

      -
      Author
      Pooja
      +

      Values can be added by increasing the rear variable by 1 (which points to the end of the array), then assigning new value to rear's element of the array.

      +

      Values can be removed by increasing the front variable by 1 (which points to the first of the array), so it cannot reached any more.

      +
      Author
      Pooja
      -Farbod Ahmadian
      +Farbod Ahmadian

      Function Documentation

      - +

      ◆ main()

      @@ -166,36 +165,36 @@ Algorithm

      Main function.

      -

      Allows the user to add and delete values from the queue. Also allows user to display values in the queue.

      Returns
      0 on exit
      -
      111  {
      -
      112  int op{0}, data{0};
      - -
      114 
      -
      115  std::cout << "\n1. enqueue(Insertion) ";
      -
      116  std::cout << "\n2. dequeue(Deletion)";
      -
      117  std::cout << "\n3. Display";
      -
      118  std::cout << "\n4. Exit";
      -
      119  while (true) {
      -
      120  std::cout << "\nEnter your choice ";
      -
      121  std::cin >> op;
      -
      122  if (op == 1) {
      -
      123  std::cout << "Enter data ";
      -
      124  std::cin >> data;
      -
      125  ob.enqueue(data);
      -
      126  } else if (op == 2) {
      -
      127  data = ob.dequeue();
      -
      128  std::cout << "\ndequeue element is:\t" << data;
      -
      129  } else if (op == 3) {
      -
      130  ob.display();
      -
      131  } else if (op == 4) {
      -
      132  exit(0);
      -
      133  } else {
      -
      134  std::cout << "\nWrong choice ";
      -
      135  }
      -
      136  }
      -
      137 
      -
      138  return 0;
      -
      139 }
      +

      Allows the user to add and delete values from the queue. Also allows user to display values in the queue.

      Returns
      0 on exit
      +
      111 {
      +
      112 int op{0}, data{0};
      + +
      114
      +
      115 std::cout << "\n1. enqueue(Insertion) ";
      +
      116 std::cout << "\n2. dequeue(Deletion)";
      +
      117 std::cout << "\n3. Display";
      +
      118 std::cout << "\n4. Exit";
      +
      119 while (true) {
      +
      120 std::cout << "\nEnter your choice ";
      +
      121 std::cin >> op;
      +
      122 if (op == 1) {
      +
      123 std::cout << "Enter data ";
      +
      124 std::cin >> data;
      +
      125 ob.enqueue(data);
      +
      126 } else if (op == 2) {
      +
      127 data = ob.dequeue();
      +
      128 std::cout << "\ndequeue element is:\t" << data;
      +
      129 } else if (op == 3) {
      +
      130 ob.display();
      +
      131 } else if (op == 4) {
      +
      132 exit(0);
      +
      133 } else {
      +
      134 std::cout << "\nWrong choice ";
      +
      135 }
      +
      136 }
      +
      137
      +
      138 return 0;
      +
      139}
      Queue_Array class containing the main data and also index of head and tail of the array.
      Definition: queue_using_array.cpp:43
      @@ -207,14 +206,14 @@ Algorithm
      Here is the call graph for this function:
      -
      +

      Variable Documentation

      - +

      ◆ max_size

      @@ -235,7 +234,7 @@ Here is the call graph for this function:

      for io operations

      -

      for std::array Maximum size of the queue

      +

      for std::array Maximum size of the queue

      @@ -245,7 +244,7 @@ Here is the call graph for this function:
      diff --git a/d8/df0/queue__using__array_8cpp.js b/d8/df0/queue__using__array_8cpp.js index 5db8787b7..0fb0f786d 100644 --- a/d8/df0/queue__using__array_8cpp.js +++ b/d8/df0/queue__using__array_8cpp.js @@ -1,6 +1,6 @@ var queue__using__array_8cpp = [ - [ "Queue_Array", "d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array.html", "d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array" ], + [ "data_structures::queue_using_array::Queue_Array", "d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array.html", "d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array" ], [ "main", "d8/df0/queue__using__array_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "max_size", "d8/df0/queue__using__array_8cpp.html#a2d49e79bd164c298912db252970520d8", null ] ]; \ No newline at end of file diff --git a/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 1d328c96a..1c85c5d20 100644 --- a/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,8 +1,6 @@ - - - - + + diff --git a/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 19a93fb78..041b63ad0 100644 --- a/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -ae0b29215619114ddbad32fe8de68466 \ No newline at end of file +28dd15df655902594bbd3578cf9d9c7c \ No newline at end of file diff --git a/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index cf8785b3c..a98f0002a 100644 --- a/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,14 +1,14 @@ - - + main - + Node1 @@ -35,10 +35,10 @@ - - -Node4 - + + +Node3 + data_structures::queue _using_array::Queue_Array @@ -46,16 +46,16 @@ - - -Node1->Node4 + + +Node1->Node3 - - -Node5 - + + +Node4 + data_structures::queue _using_array::Queue_Array @@ -63,47 +63,11 @@ - - -Node1->Node5 + + +Node1->Node4 - - -Node3 - - -std::array::at - - - - - -Node2->Node3 - - - - - -Node4->Node3 - - - - - -Node6 - - -std::array::size - - - - - -Node5->Node6 - - - diff --git a/d8/df6/jumpgame_8cpp__incl.svg b/d8/df6/jumpgame_8cpp__incl.svg index 2b255f4ea..f1a400699 100644 --- a/d8/df6/jumpgame_8cpp__incl.svg +++ b/d8/df6/jumpgame_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: math/factorial.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('d9/d00/factorial_8cpp.html','../../');
      -
      -
      factorial.cpp File Reference
      +
      factorial.cpp File Reference
      @@ -107,7 +106,7 @@ Include dependency graph for factorial.cpp:
      - @@ -115,9 +114,9 @@ Functions

      +

      Functions

      unsigned int factorial (unsigned int n)
       
       

      Detailed Description

      -

      C++ program to find factorial of given number.

      +

      C++ program to find factorial of given number.

      Function Documentation

      - +

      ◆ factorial()

      @@ -132,17 +131,23 @@ Functions
      -

      function to find factorial of given number

      -
      8  {
      -
      9  if (n == 0)
      -
      10  return 1;
      -
      11  return n * factorial(n - 1);
      -
      12 }
      +

      function to find factorial of given number

      +
      8 {
      +
      9 if (n == 0)
      +
      10 return 1;
      +
      11 return n * factorial(n - 1);
      +
      12}
      unsigned int factorial(unsigned int n)
      Definition: factorial.cpp:8
      -
      +
      +Here is the call graph for this function:
      +
      +
      - + +
      +
      +

      ◆ main()

      @@ -157,19 +162,19 @@ Functions
      -

      Main function

      -
      15  {
      -
      16  int num = 5;
      -
      17  std::cout << "Factorial of " << num << " is " << factorial(num)
      -
      18  << std::endl;
      -
      19  return 0;
      -
      20 }
      +

      Main function

      +
      15 {
      +
      16 int num = 5;
      +
      17 std::cout << "Factorial of " << num << " is " << factorial(num)
      +
      18 << std::endl;
      +
      19 return 0;
      +
      20}
      T endl(T... args)
      Here is the call graph for this function:
      -
      +
      @@ -181,7 +186,7 @@ Here is the call graph for this function:
      diff --git a/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 438559c03..477fcf6ed 100644 --- a/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,5 +1,5 @@ - + - + diff --git a/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 79d0c5657..57e77e40d 100644 --- a/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -7e08c8f9d3ee3af014bc2a8217968099 \ No newline at end of file +1a7151825b7a0d3ab2f8b802c5f0dfd6 \ No newline at end of file diff --git a/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 521cba263..ca5038575 100644 --- a/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d9/d00/factorial_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,20 +1,20 @@ - - - + + main - + Node1 - -main + +main @@ -22,16 +22,16 @@ Node2 - -std::endl + +std::endl Node1->Node2 - - + + @@ -45,8 +45,14 @@ Node1->Node3 - - + + + + + +Node3->Node3 + + diff --git a/d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.map b/d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.map new file mode 100644 index 000000000..a11494550 --- /dev/null +++ b/d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.md5 b/d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.md5 new file mode 100644 index 000000000..302018ac3 --- /dev/null +++ b/d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.md5 @@ -0,0 +1 @@ +36de275d59e099f8c9727543efa634e9 \ No newline at end of file diff --git a/d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.svg b/d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.svg new file mode 100644 index 000000000..fa1d49821 --- /dev/null +++ b/d9/d00/factorial_8cpp_ae9945c15826a9c1b5c141db314b7f8b4_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +factorial + + + +Node1 + + +factorial + + + + + +Node1->Node1 + + + + + diff --git a/d9/d02/linear__search_8cpp.html b/d9/d02/linear__search_8cpp.html index 6bc52827c..6fb7fe652 100644 --- a/d9/d02/linear__search_8cpp.html +++ b/d9/d02/linear__search_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: search/linear_search.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('d9/d02/linear__search_8cpp.html','../.
      -
      -
      linear_search.cpp File Reference
      +
      linear_search.cpp File Reference
      -

      Linear search algorithm +

      Linear search algorithm More...

      #include <iostream>
      @@ -107,7 +106,7 @@ Include dependency graph for linear_search.cpp:
      - @@ -115,9 +114,9 @@ Functions

      +

      Functions

      int LinearSearch (int *array, int size, int key)
       
       

      Detailed Description

      -

      Linear search algorithm

      +

      Function Documentation

      - +

      ◆ LinearSearch()

      @@ -148,7 +147,7 @@ Functions
      -

      Algorithm implementation

      Parameters
      +

      Algorithm implementation

      Parameters
      @@ -159,19 +158,19 @@ Functions
      Returns
      index where the key-value occurs in the array
      -1 if key-value not found
      -
      16  {
      -
      17  for (int i = 0; i < size; ++i) {
      -
      18  if (array[i] == key) {
      -
      19  return i;
      -
      20  }
      -
      21  }
      -
      22 
      -
      23  return -1;
      -
      24 }
      +
      16 {
      +
      17 for (int i = 0; i < size; ++i) {
      +
      18 if (array[i] == key) {
      +
      19 return i;
      +
      20 }
      +
      21 }
      +
      22
      +
      23 return -1;
      +
      24}
      - +

      ◆ main()

      @@ -186,34 +185,34 @@ Functions
      [in]arrayarray to search in
      [in]sizelength of array
      -

      main function

      -
      27  {
      -
      28  int size;
      -
      29  std::cout << "\nEnter the size of the Array : ";
      -
      30  std::cin >> size;
      -
      31 
      -
      32  int *array = new int[size];
      -
      33  int key;
      -
      34 
      -
      35  // Input array
      -
      36  std::cout << "\nEnter the Array of " << size << " numbers : ";
      -
      37  for (int i = 0; i < size; i++) {
      -
      38  std::cin >> array[i];
      -
      39  }
      -
      40 
      -
      41  std::cout << "\nEnter the number to be searched : ";
      -
      42  std::cin >> key;
      -
      43 
      -
      44  int index = LinearSearch(array, size, key);
      -
      45  if (index != -1) {
      -
      46  std::cout << "\nNumber found at index : " << index;
      -
      47  } else {
      -
      48  std::cout << "\nNot found";
      -
      49  }
      -
      50 
      -
      51  delete[] array;
      -
      52  return 0;
      -
      53 }
      +

      main function

      +
      27 {
      +
      28 int size;
      +
      29 std::cout << "\nEnter the size of the Array : ";
      +
      30 std::cin >> size;
      +
      31
      +
      32 int *array = new int[size];
      +
      33 int key;
      +
      34
      +
      35 // Input array
      +
      36 std::cout << "\nEnter the Array of " << size << " numbers : ";
      +
      37 for (int i = 0; i < size; i++) {
      +
      38 std::cin >> array[i];
      +
      39 }
      +
      40
      +
      41 std::cout << "\nEnter the number to be searched : ";
      +
      42 std::cin >> key;
      +
      43
      +
      44 int index = LinearSearch(array, size, key);
      +
      45 if (index != -1) {
      +
      46 std::cout << "\nNumber found at index : " << index;
      +
      47 } else {
      +
      48 std::cout << "\nNot found";
      +
      49 }
      +
      50
      +
      51 delete[] array;
      +
      52 return 0;
      +
      53}
      int LinearSearch(int *array, int size, int key)
      Definition: linear_search.cpp:16
      @@ -226,7 +225,7 @@ Functions diff --git a/d9/d03/namespacestring__search.html b/d9/d03/namespacestring__search.html index fd275cb1e..ad7b12758 100644 --- a/d9/d03/namespacestring__search.html +++ b/d9/d03/namespacestring__search.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: string_search Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -92,20 +92,19 @@ $(document).ready(function(){initNavTree('d9/d03/namespacestring__search.html','
      -
      -
      string_search Namespace Reference
      +
      string_search Namespace Reference

      String search algorithms. More...

      - - - + + @@ -118,9 +117,9 @@ Functions

      +

      Functions

      int brute_force (const std::string &text, const std::string &pattern)
       
      std::vector< int > getFailureArray (const std::string &pattern)
       
      std::vector< int > getFailureArray (const std::string &pattern)
       
      bool kmp (const std::string &pattern, const std::string &text)
       
      int64_t create_hash (const std::string &s, int n)
       

      Detailed Description

      -

      String search algorithms.

      +

      String search algorithms.

      Function Documentation

      - +

      ◆ brute_force()

      @@ -145,7 +144,7 @@ Functions
      -

      Find a pattern in a string by comparing the pattern to every substring.

      Parameters
      +

      Find a pattern in a string by comparing the pattern to every substring.

      Parameters
      @@ -155,21 +154,21 @@ Functions
      Returns
      Index where the pattern starts in the text
      -1 if the pattern was not found.
      -
      21  {
      -
      22  size_t pat_l = pattern.length();
      -
      23  size_t txt_l = text.length();
      -
      24  int index = -1;
      -
      25  if (pat_l <= txt_l) {
      -
      26  for (size_t i = 0; i < txt_l - pat_l + 1; i++) {
      -
      27  std::string s = text.substr(i, pat_l);
      -
      28  if (s == pattern) {
      -
      29  index = i;
      -
      30  break;
      -
      31  }
      -
      32  }
      -
      33  }
      -
      34  return index;
      -
      35 }
      +
      21 {
      +
      22 size_t pat_l = pattern.length();
      +
      23 size_t txt_l = text.length();
      +
      24 int index = -1;
      +
      25 if (pat_l <= txt_l) {
      +
      26 for (size_t i = 0; i < txt_l - pat_l + 1; i++) {
      +
      27 std::string s = text.substr(i, pat_l);
      +
      28 if (s == pattern) {
      +
      29 index = i;
      +
      30 break;
      +
      31 }
      +
      32 }
      +
      33 }
      +
      34 return index;
      +
      35}
      T length(T... args)
      T substr(T... args)
      @@ -182,7 +181,7 @@ Here is the call graph for this function:
      - +

      ◆ check_if_equal()

      @@ -231,7 +230,7 @@ Here is the call graph for this function:
      textAny string that might contain the pattern.
      patternString that we are searching for.
      -

      compare if two sub-strings are equal

      Parameters
      +

      compare if two sub-strings are equal

      Parameters
      @@ -244,23 +243,23 @@ Here is the call graph for this function:
      false if pattern was not found
      Note
      can this be replaced by std::string::compare?
      -
      61  {
      -
      62  if (end1 - start1 != end2 - start2) {
      -
      63  return false;
      -
      64  }
      -
      65  while (start1 <= end1 && start2 <= end2) {
      -
      66  if (str1[start1] != str2[start2]) {
      -
      67  return false;
      -
      68  }
      -
      69  start1++;
      -
      70  start2++;
      -
      71  }
      -
      72  return true;
      -
      73 }
      +
      61 {
      +
      62 if (end1 - start1 != end2 - start2) {
      +
      63 return false;
      +
      64 }
      +
      65 while (start1 <= end1 && start2 <= end2) {
      +
      66 if (str1[start1] != str2[start2]) {
      +
      67 return false;
      +
      68 }
      +
      69 start1++;
      +
      70 start2++;
      +
      71 }
      +
      72 return true;
      +
      73}
      - +

      ◆ create_hash()

      @@ -285,7 +284,7 @@ Here is the call graph for this function:
      [in]str1string pattern to search
      [in]str2text in which to search
      -

      convert a string to an intger - called as hashing function

      Parameters
      +

      convert a string to an intger - called as hashing function

      Parameters
      @@ -293,27 +292,25 @@ Here is the call graph for this function:
      Returns
      hash integer
      -
      25  {
      -
      26  int64_t result = 0;
      -
      27  for (int i = 0; i < n; ++i) {
      -
      28  result += (int64_t)(s[i] * (int64_t)pow(PRIME, i));
      -
      29  }
      -
      30  return result;
      -
      31 }
      -
      uint64_t result(uint64_t n)
      Definition: fibonacci_sum.cpp:76
      -
      T pow(T... args)
      +
      25 {
      +
      26 int64_t result = 0;
      +
      27 for (int i = 0; i < n; ++i) {
      +
      28 result += (int64_t)(s[i] * (int64_t)pow(PRIME, i));
      +
      29 }
      +
      30 return result;
      +
      31}
      #define PRIME
      Prime modulus for hash functions.
      Definition: rabin_karp.cpp:16
      - -

      ◆ getFailureArray()

      + +

      ◆ getFailureArray()

      [in]ssource of string to hash
      [in]nlength of substring to hash
      - + @@ -321,39 +318,39 @@ Here is the call graph for this function:
      std::vector<int> string_search::getFailureArray std::vector< int > string_search::getFailureArray ( const std::string pattern)
      -

      Generate the partial match table aka failure function for a pattern to search.

      Parameters
      +

      Generate the partial match table aka failure function for a pattern to search.

      Parameters
      [in]patterntext for which to create the partial match table
      Returns
      the partial match table as a vector array
      -
      33  {
      -
      34  int pattern_length = pattern.size();
      -
      35  std::vector<int> failure(pattern_length + 1);
      -
      36  failure[0] = -1;
      -
      37  int j = -1;
      -
      38 
      -
      39  for (int i = 0; i < pattern_length; i++) {
      -
      40  while (j != -1 && pattern[j] != pattern[i]) {
      -
      41  j = failure[j];
      -
      42  }
      -
      43  j++;
      -
      44  failure[i + 1] = j;
      -
      45  }
      -
      46  return failure;
      -
      47 }
      - +
      33 {
      +
      34 int pattern_length = pattern.size();
      +
      35 std::vector<int> failure(pattern_length + 1);
      +
      36 failure[0] = -1;
      +
      37 int j = -1;
      +
      38
      +
      39 for (int i = 0; i < pattern_length; i++) {
      +
      40 while (j != -1 && pattern[j] != pattern[i]) {
      +
      41 j = failure[j];
      +
      42 }
      +
      43 j++;
      +
      44 failure[i + 1] = j;
      +
      45 }
      +
      46 return failure;
      +
      47}
      +
      Here is the call graph for this function:
      -
      +
      - +

      ◆ kmp()

      @@ -378,7 +375,7 @@ Here is the call graph for this function:
      -

      KMP algorithm to find a pattern in a text

      Parameters
      +

      KMP algorithm to find a pattern in a text

      Parameters
      @@ -388,22 +385,22 @@ Here is the call graph for this function:
      Returns
      true if pattern was found
      false if pattern was not found
      -
      56  {
      -
      57  int text_length = text.size(), pattern_length = pattern.size();
      -
      58  std::vector<int> failure = getFailureArray(pattern);
      -
      59 
      -
      60  int k = 0;
      -
      61  for (int j = 0; j < text_length; j++) {
      -
      62  while (k != -1 && pattern[k] != text[j]) {
      -
      63  k = failure[k];
      -
      64  }
      -
      65  k++;
      -
      66  if (k == pattern_length)
      -
      67  return true;
      -
      68  }
      -
      69  return false;
      -
      70 }
      -
      std::vector< int > getFailureArray(const std::string &pattern)
      Definition: knuth_morris_pratt.cpp:33
      +
      56 {
      +
      57 int text_length = text.size(), pattern_length = pattern.size();
      +
      58 std::vector<int> failure = getFailureArray(pattern);
      +
      59
      +
      60 int k = 0;
      +
      61 for (int j = 0; j < text_length; j++) {
      +
      62 while (k != -1 && pattern[k] != text[j]) {
      +
      63 k = failure[k];
      +
      64 }
      +
      65 k++;
      +
      66 if (k == pattern_length)
      +
      67 return true;
      +
      68 }
      +
      69 return false;
      +
      70}
      +
      std::vector< int > getFailureArray(const std::string &pattern)
      Definition: knuth_morris_pratt.cpp:33
      Here is the call graph for this function:
      @@ -413,7 +410,7 @@ Here is the call graph for this function:
      - +

      ◆ rabin_karp()

      @@ -438,7 +435,7 @@ Here is the call graph for this function:
      [in]patternstring pattern to search
      [in]texttext in which to search
      -

      Perform string pattern search using Rabin-Karp algorithm

      Parameters
      +

      Perform string pattern search using Rabin-Karp algorithm

      Parameters
      @@ -448,22 +445,22 @@ Here is the call graph for this function:
      Returns
      index of first occurrence of pattern
      -1 if pattern not found
      -
      83  {
      -
      84  int64_t pat_hash = create_hash(pat, pat.size());
      -
      85  int64_t str_hash = create_hash(str, pat.size());
      -
      86  for (int i = 0; i <= str.size() - pat.size(); ++i) {
      -
      87  if (pat_hash == str_hash &&
      -
      88  check_if_equal(str, pat, i, i + pat.size() - 1, 0,
      -
      89  pat.size() - 1)) {
      -
      90  return i;
      -
      91  }
      -
      92  if (i < str.size() - pat.size()) {
      -
      93  str_hash =
      -
      94  recalculate_hash(str, i, i + pat.size(), str_hash, pat.size());
      -
      95  }
      -
      96  }
      -
      97  return -1; // return -1 if given pattern not found
      -
      98 }
      +
      83 {
      +
      84 int64_t pat_hash = create_hash(pat, pat.size());
      +
      85 int64_t str_hash = create_hash(str, pat.size());
      +
      86 for (int i = 0; i <= str.size() - pat.size(); ++i) {
      +
      87 if (pat_hash == str_hash &&
      +
      88 check_if_equal(str, pat, i, i + pat.size() - 1, 0,
      +
      89 pat.size() - 1)) {
      +
      90 return i;
      +
      91 }
      +
      92 if (i < str.size() - pat.size()) {
      +
      93 str_hash =
      +
      94 recalculate_hash(str, i, i + pat.size(), str_hash, pat.size());
      +
      95 }
      +
      96 }
      +
      97 return -1; // return -1 if given pattern not found
      +
      98}
      int64_t create_hash(const std::string &s, int n)
      Definition: rabin_karp.cpp:25
      bool check_if_equal(const std::string &str1, const std::string &str2, int start1, int end1, int start2, int end2)
      Definition: rabin_karp.cpp:60
      int64_t recalculate_hash(const std::string &s, int old_index, int new_index, int64_t old_hash, int patLength)
      Definition: rabin_karp.cpp:42
      @@ -476,7 +473,7 @@ Here is the call graph for this function:
      - +

      ◆ recalculate_hash()

      @@ -519,7 +516,7 @@ Here is the call graph for this function:
      [in]strstring to search in
      [in]patpattern to search for
      -

      re-hash a string using known existing hash

      Parameters
      +

      re-hash a string using known existing hash

      Parameters
      @@ -530,12 +527,12 @@ Here is the call graph for this function:
      Returns
      new hash integer
      -
      43  {
      -
      44  int64_t new_hash = old_hash - s[old_index];
      -
      45  new_hash /= PRIME;
      -
      46  new_hash += (int64_t)(s[new_index] * (int64_t)pow(PRIME, patLength - 1));
      -
      47  return new_hash;
      -
      48 }
      +
      43 {
      +
      44 int64_t new_hash = old_hash - s[old_index];
      +
      45 new_hash /= PRIME;
      +
      46 new_hash += (int64_t)(s[new_index] * (int64_t)pow(PRIME, patLength - 1));
      +
      47 return new_hash;
      +
      48}
      @@ -545,7 +542,7 @@ Here is the call graph for this function: diff --git a/d9/d03/namespacestring__search_a21c673d56cbf67b1d2ee4d869185b7d9_cgraph.svg b/d9/d03/namespacestring__search_a21c673d56cbf67b1d2ee4d869185b7d9_cgraph.svg index 7b7d23a85..9633b4067 100644 --- a/d9/d03/namespacestring__search_a21c673d56cbf67b1d2ee4d869185b7d9_cgraph.svg +++ b/d9/d03/namespacestring__search_a21c673d56cbf67b1d2ee4d869185b7d9_cgraph.svg @@ -1,7 +1,7 @@ - - + diff --git a/d9/d03/namespacestring__search_a26a58225ce7d3fa9d4c2f5349a65ed93_cgraph.md5 b/d9/d03/namespacestring__search_a26a58225ce7d3fa9d4c2f5349a65ed93_cgraph.md5 index 14c2f4e4a..00a2e93fb 100644 --- a/d9/d03/namespacestring__search_a26a58225ce7d3fa9d4c2f5349a65ed93_cgraph.md5 +++ b/d9/d03/namespacestring__search_a26a58225ce7d3fa9d4c2f5349a65ed93_cgraph.md5 @@ -1 +1 @@ -9c08115b4b7c2b6ba79ae2f4af807fd4 \ No newline at end of file +ec9c71066ae420a2c33317c5b2d92b7b \ No newline at end of file diff --git a/d9/d03/namespacestring__search_a26a58225ce7d3fa9d4c2f5349a65ed93_cgraph.svg b/d9/d03/namespacestring__search_a26a58225ce7d3fa9d4c2f5349a65ed93_cgraph.svg index 8256667f4..4fd6accfa 100644 --- a/d9/d03/namespacestring__search_a26a58225ce7d3fa9d4c2f5349a65ed93_cgraph.svg +++ b/d9/d03/namespacestring__search_a26a58225ce7d3fa9d4c2f5349a65ed93_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + string_search::getFailure Array diff --git a/d9/d03/namespacestring__search_aa422aab133d4ed5e5d6022a7f701271f_cgraph.map b/d9/d03/namespacestring__search_a996573527312d5255e1495b879e8a34f_cgraph.map similarity index 100% rename from d9/d03/namespacestring__search_aa422aab133d4ed5e5d6022a7f701271f_cgraph.map rename to d9/d03/namespacestring__search_a996573527312d5255e1495b879e8a34f_cgraph.map diff --git a/d9/d03/namespacestring__search_aa422aab133d4ed5e5d6022a7f701271f_cgraph.md5 b/d9/d03/namespacestring__search_a996573527312d5255e1495b879e8a34f_cgraph.md5 similarity index 100% rename from d9/d03/namespacestring__search_aa422aab133d4ed5e5d6022a7f701271f_cgraph.md5 rename to d9/d03/namespacestring__search_a996573527312d5255e1495b879e8a34f_cgraph.md5 diff --git a/d9/d03/namespacestring__search_aa422aab133d4ed5e5d6022a7f701271f_cgraph.svg b/d9/d03/namespacestring__search_a996573527312d5255e1495b879e8a34f_cgraph.svg similarity index 96% rename from d9/d03/namespacestring__search_aa422aab133d4ed5e5d6022a7f701271f_cgraph.svg rename to d9/d03/namespacestring__search_a996573527312d5255e1495b879e8a34f_cgraph.svg index 44346751c..efb2cf1de 100644 --- a/d9/d03/namespacestring__search_aa422aab133d4ed5e5d6022a7f701271f_cgraph.svg +++ b/d9/d03/namespacestring__search_a996573527312d5255e1495b879e8a34f_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - + +Algorithms_in_C++: others::iterative_tree_traversals::BinaryTree Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
      [in]ssource of string to hash
      [in]old_indexprevious index of string
      -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -93,15 +93,14 @@ $(document).ready(function(){initNavTree('d9/d12/classothers_1_1iterative__tree_ -
      -
      others::iterative_tree_traversals::BinaryTree Class Reference
      +
      others::iterative_tree_traversals::BinaryTree Class Reference

      defines the functions associated with the binary tree More...

      - @@ -117,9 +116,9 @@ Public Member Functions

      +

      Public Member Functions

      NodecreateNewNode (int64_t)
       function that will create new node for insertion. More...
       

      Detailed Description

      -

      defines the functions associated with the binary tree

      +

      defines the functions associated with the binary tree

      Member Function Documentation

      - +

      ◆ createNewNode()

      @@ -136,7 +135,7 @@ Public Member Functions

      function that will create new node for insertion.

      -

      will allocate the memory for a node and, along the data and return the node.

      +

      will allocate the memory for a node and, along the data and return the node.

      Parameters
      @@ -144,12 +143,12 @@ Public Member Functions
      Returns
      pointer to the newly created node with assigned data.
      -
      88  {
      -
      89  Node *node = new Node();
      -
      90  node->data = data;
      -
      91  node->left = node->right = nullptr;
      -
      92  return node;
      -
      93 }
      +
      88 {
      +
      89 Node *node = new Node();
      +
      90 node->data = data;
      +
      91 node->left = node->right = nullptr;
      +
      92 return node;
      +
      93}
      int data[MAX]
      test data
      Definition: hash_search.cpp:24
      struct list node
      Definition: linkedlist_implentation_usingarray.cpp:14
      @@ -157,7 +156,7 @@ Public Member Functions
      - +

      ◆ inOrderIterative()

      @@ -174,7 +173,7 @@ Public Member Functions

      inOrderIterative() function that will perform the inorder traversal iteratively, and return the result array that contain the inorder traversal of a tree.

      -

      function that takes root of the tree as an argument, and returns its inorder traversal.

      +

      function that takes root of the tree as an argument, and returns its inorder traversal.

      Parameters
      datavalue that a particular node will contain.
      @@ -182,27 +181,27 @@ Public Member Functions
      Returns
      result that is containing the inorder traversal of a tree
      -

      < is used to find and traverse the child nodes.

      -

      < List of values, sorted in in-order.

      -
      164  {
      - -
      166  stack; ///< is used to find and traverse the child nodes.
      -
      167  std::vector<int64_t> result; ///< List of values, sorted in in-order.
      -
      168 
      -
      169  Node *current = root;
      -
      170 
      -
      171  while (!stack.empty() || current) {
      -
      172  while (current) {
      -
      173  stack.push(current);
      -
      174  current = current->left;
      -
      175  }
      -
      176  current = stack.top();
      -
      177  stack.pop();
      -
      178  result.push_back(current->data);
      -
      179  current = current->right;
      -
      180  }
      -
      181  return result;
      -
      182 }
      +

      < is used to find and traverse the child nodes.

      +

      < List of values, sorted in in-order.

      +
      164 {
      + +
      166 stack; ///< is used to find and traverse the child nodes.
      +
      167 std::vector<int64_t> result; ///< List of values, sorted in in-order.
      +
      168
      +
      169 Node *current = root;
      +
      170
      +
      171 while (!stack.empty() || current) {
      +
      172 while (current) {
      +
      173 stack.push(current);
      +
      174 current = current->left;
      +
      175 }
      +
      176 current = stack.top();
      +
      177 stack.pop();
      +
      178 result.push_back(current->data);
      +
      179 current = current->right;
      +
      180 }
      +
      181 return result;
      +
      182}
      Definition: stack.h:26
      Type top()
      Definition: stack.h:93
      void push(Type item)
      Definition: stack.h:83
      @@ -210,11 +209,11 @@ Public Member Functions
      uint64_t result(uint64_t n)
      Definition: fibonacci_sum.cpp:76
      char stack[MAX]
      Definition: paranthesis_matching.cpp:20
      - +
      - +

      ◆ postOrderIterative()

      @@ -231,7 +230,7 @@ Public Member Functions

      postOrderIterative() function that will perform the postorder traversal iteratively, and return the result array that contain the postorder traversal of a tree.

      -

      function that takes root of the tree as an argument, and returns its postorder traversal.

      +

      function that takes root of the tree as an argument, and returns its postorder traversal.

      Parameters
      roothead/root node of a tree
      @@ -239,37 +238,37 @@ Public Member Functions
      Returns
      result that is containing the postorder traversal of a tree
      -

      < is used to find and traverse the child nodes.

      -

      < List of values, sorted in post-order.

      -
      132  {
      - -
      134  stack; ///< is used to find and traverse the child nodes.
      -
      135  std::vector<int64_t> result; ///< List of values, sorted in post-order.
      -
      136 
      -
      137  stack.push(root);
      -
      138 
      -
      139  while (!stack.empty()) {
      -
      140  result.push_back(stack.top()->data);
      -
      141  Node *current = stack.top();
      -
      142  stack.pop();
      -
      143 
      -
      144  if (current->left) {
      -
      145  stack.push(current->left);
      -
      146  }
      -
      147  if (current->right) {
      -
      148  stack.push(current->right);
      -
      149  }
      -
      150  }
      -
      151 
      -
      152  reverse(result.begin(), result.end());
      -
      153 
      -
      154  return result;
      -
      155 }
      +

      < is used to find and traverse the child nodes.

      +

      < List of values, sorted in post-order.

      +
      132 {
      + +
      134 stack; ///< is used to find and traverse the child nodes.
      +
      135 std::vector<int64_t> result; ///< List of values, sorted in post-order.
      +
      136
      +
      137 stack.push(root);
      +
      138
      +
      139 while (!stack.empty()) {
      +
      140 result.push_back(stack.top()->data);
      +
      141 Node *current = stack.top();
      +
      142 stack.pop();
      +
      143
      +
      144 if (current->left) {
      +
      145 stack.push(current->left);
      +
      146 }
      +
      147 if (current->right) {
      +
      148 stack.push(current->right);
      +
      149 }
      +
      150 }
      +
      151
      +
      152 reverse(result.begin(), result.end());
      +
      153
      +
      154 return result;
      +
      155}
      T reverse(T... args)
      - +

      ◆ preOrderIterative()

      @@ -286,7 +285,7 @@ Public Member Functions

      preOrderIterative() function that will perform the preorder traversal iteratively, and return the result array that contain the preorder traversal of a tree.

      -

      function that takes root of the tree as an argument, and returns its preorder traversal.

      +

      function that takes root of the tree as an argument, and returns its preorder traversal.

      Parameters
      roothead/root node of a tree
      @@ -294,30 +293,30 @@ Public Member Functions
      Returns
      result that is containing the preorder traversal of a tree
      -

      < is used to find and traverse the child nodes.

      -

      < list of values, sorted in pre-order.

      -
      102  {
      - -
      104  stack; ///< is used to find and traverse the child nodes.
      -
      105  std::vector<int64_t> result; ///< list of values, sorted in pre-order.
      -
      106 
      -
      107  stack.push(root);
      -
      108 
      -
      109  while (!stack.empty()) {
      -
      110  result.push_back(stack.top()->data);
      -
      111  Node *current = stack.top();
      -
      112  stack.pop();
      -
      113 
      -
      114  if (current->right) {
      -
      115  stack.push(current->right);
      -
      116  }
      -
      117  if (current->left) {
      -
      118  stack.push(current->left);
      -
      119  }
      -
      120  }
      -
      121 
      -
      122  return result;
      -
      123 }
      +

      < is used to find and traverse the child nodes.

      +

      < list of values, sorted in pre-order.

      +
      102 {
      + +
      104 stack; ///< is used to find and traverse the child nodes.
      +
      105 std::vector<int64_t> result; ///< list of values, sorted in pre-order.
      +
      106
      +
      107 stack.push(root);
      +
      108
      +
      109 while (!stack.empty()) {
      +
      110 result.push_back(stack.top()->data);
      +
      111 Node *current = stack.top();
      +
      112 stack.pop();
      +
      113
      +
      114 if (current->right) {
      +
      115 stack.push(current->right);
      +
      116 }
      +
      117 if (current->left) {
      +
      118 stack.push(current->left);
      +
      119 }
      +
      120 }
      +
      121
      +
      122 return result;
      +
      123}
      @@ -330,7 +329,7 @@ Public Member Functions diff --git a/d9/d13/namespaceinversion.html b/d9/d13/namespaceinversion.html index a76ef04c6..7eeac6984 100644 --- a/d9/d13/namespaceinversion.html +++ b/d9/d13/namespaceinversion.html @@ -2,8 +2,8 @@ - - + +Algorithms_in_C++: inversion Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
      roothead/root node of a tree
      -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d9/d13/namespaceinversion.html','../..
      -
      -
      inversion Namespace Reference
      +
      inversion Namespace Reference

      Functions for counting inversions using Merge Sort algorithm. More...

      Detailed Description

      -

      Functions for counting inversions using Merge Sort algorithm.

      +

      Functions for counting inversions using Merge Sort algorithm.

      diff --git a/d9/d21/classmachine__learning_1_1adaline-members.html b/d9/d21/classmachine__learning_1_1adaline-members.html index e86a118f6..a4eb5675e 100644 --- a/d9/d21/classmachine__learning_1_1adaline-members.html +++ b/d9/d21/classmachine__learning_1_1adaline-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,29 +90,28 @@ $(document).ready(function(){initNavTree('d6/d30/classmachine__learning_1_1adali
      -
      -
      machine_learning::adaline Member List
      +
      machine_learning::adaline Member List

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

      - + - + - + - + - +
      accuracymachine_learning::adalineprivate
      activation(double x)machine_learning::adalineinline
      activation(double x)machine_learning::adalineinline
      adaline(int num_features, const double eta=0.01f, const double accuracy=1e-5)machine_learning::adalineinlineexplicit
      check_size_match(const std::vector< double > &x)machine_learning::adalineinlineprivate
      check_size_match(const std::vector< double > &x)machine_learning::adalineinlineprivate
      etamachine_learning::adalineprivate
      fit(const std::vector< double > &x, const int &y)machine_learning::adalineinline
      fit(const std::vector< double > &x, const int &y)machine_learning::adalineinline
      fit(std::array< std::vector< double >, N > const &X, std::array< int, N > const &Y)machine_learning::adalineinline
      operator<<(std::ostream &out, const adaline &ada)machine_learning::adalinefriend
      operator<<machine_learning::adalinefriend
      predict(const std::vector< double > &x, double *out=nullptr)machine_learning::adalineinline
      weightsmachine_learning::adalineprivate
      weightsmachine_learning::adalineprivate
      diff --git a/d9/d21/namespacewave__sort.html b/d9/d21/namespacewave__sort.html index c635587a7..68c13a73d 100644 --- a/d9/d21/namespacewave__sort.html +++ b/d9/d21/namespacewave__sort.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: wave_sort Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d9/d21/namespacewave__sort.html','../.
      -
      -
      wave_sort Namespace Reference
      +
      wave_sort Namespace Reference
      -

      Functions for the Wave sort implementation. +

      Functions for the Wave sort implementation. More...

      Detailed Description

      -

      Functions for the Wave sort implementation.

      +

      Functions for the Wave sort implementation.

      diff --git a/d9/d23/classgraph_1_1_lowest_common_ancestor.html b/d9/d23/classgraph_1_1_lowest_common_ancestor.html index da113f51a..37cac705c 100644 --- a/d9/d23/classgraph_1_1_lowest_common_ancestor.html +++ b/d9/d23/classgraph_1_1_lowest_common_ancestor.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: graph::LowestCommonAncestor Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -95,18 +95,17 @@ $(document).ready(function(){initNavTree('d9/d23/classgraph_1_1_lowest_common_an Public Attributes | Protected Member Functions | List of all members -
      -
      graph::LowestCommonAncestor Class Reference
      +
      graph::LowestCommonAncestor Class Reference
      Collaboration diagram for graph::LowestCommonAncestor:
      -
      +
      [legend]
      - @@ -115,25 +114,25 @@ Public Member Functions

      +

      Public Member Functions

       LowestCommonAncestor (const RootedTree &tree_)
       Stores the tree and precomputs "up lifts". More...
       Query the structure to find the lowest common ancestor. Assumes that the provided numbers are valid indices of vertices. Iterativelly modifies ("lifts") u an v until it finnds their lowest common ancestor. More...
       
      - - - +

      +

      Public Attributes

      +
      const RootedTreetree
       
      -std::vector< std::vector< int > > up
      +std::vector< std::vector< int > > up
       for every vertex stores a list of its ancestors by powers of two For each vertex, the first element of the corresponding list contains the index of its parent. The i-th element of the list is an index of the (2^i)-th ancestor of the vertex.
       
      -

      +

      Protected Member Functions

      void populate_up ()
       

      Detailed Description

      -

      A structure that holds a rooted tree and allow for effecient queries of the lowest common ancestor of two given vertices in the tree.

      +

      A structure that holds a rooted tree and allow for effecient queries of the lowest common ancestor of two given vertices in the tree.

      Constructor & Destructor Documentation

      - +

      ◆ LowestCommonAncestor()

      @@ -164,21 +163,21 @@ Protected Member Functions -
      151  : tree(tree_) {
      -
      152  populate_up();
      -
      153  }
      +
      151 : tree(tree_) {
      +
      152 populate_up();
      +
      153 }
      void populate_up()
      Definition: lowest_common_ancestor.cpp:212
      Here is the call graph for this function:
      -
      +

      Member Function Documentation

      - +

      ◆ lowest_common_ancestor()

      @@ -221,39 +220,39 @@ Here is the call graph for this function:
      Returns
      index of the vertex which is the lowet common ancestor of u and v
      -
      164  {
      -
      165  // Ensure u is the deeper (higher level) of the two vertices
      -
      166  if (tree.level[v] > tree.level[u]) {
      -
      167  std::swap(u, v);
      -
      168  }
      -
      169 
      -
      170  // "Lift" u to the same level as v.
      -
      171  int level_diff = tree.level[u] - tree.level[v];
      -
      172  for (int i = 0; (1 << i) <= level_diff; ++i) {
      -
      173  if (level_diff & (1 << i)) {
      -
      174  u = up[u][i];
      -
      175  }
      -
      176  }
      -
      177  assert(tree.level[u] == tree.level[v]);
      -
      178 
      -
      179  if (u == v) {
      -
      180  return u;
      -
      181  }
      -
      182 
      -
      183  // "Lift" u and v to their 2^i th ancestor if they are different
      -
      184  for (int i = static_cast<int>(up[u].size()) - 1; i >= 0; --i) {
      -
      185  if (up[u][i] != up[v][i]) {
      -
      186  u = up[u][i];
      -
      187  v = up[v][i];
      -
      188  }
      -
      189  }
      -
      190 
      -
      191  // As we regressed u an v such that they cannot further be lifted so
      -
      192  // that their ancestor would be different, the only logical
      -
      193  // consequence is that their parent is the sought answer.
      -
      194  assert(up[u][0] == up[v][0]);
      -
      195  return up[u][0];
      -
      196  }
      +
      164 {
      +
      165 // Ensure u is the deeper (higher level) of the two vertices
      +
      166 if (tree.level[v] > tree.level[u]) {
      +
      167 std::swap(u, v);
      +
      168 }
      +
      169
      +
      170 // "Lift" u to the same level as v.
      +
      171 int level_diff = tree.level[u] - tree.level[v];
      +
      172 for (int i = 0; (1 << i) <= level_diff; ++i) {
      +
      173 if (level_diff & (1 << i)) {
      +
      174 u = up[u][i];
      +
      175 }
      +
      176 }
      +
      177 assert(tree.level[u] == tree.level[v]);
      +
      178
      +
      179 if (u == v) {
      +
      180 return u;
      +
      181 }
      +
      182
      +
      183 // "Lift" u and v to their 2^i th ancestor if they are different
      +
      184 for (int i = static_cast<int>(up[u].size()) - 1; i >= 0; --i) {
      +
      185 if (up[u][i] != up[v][i]) {
      +
      186 u = up[u][i];
      +
      187 v = up[v][i];
      +
      188 }
      +
      189 }
      +
      190
      +
      191 // As we regressed u an v such that they cannot further be lifted so
      +
      192 // that their ancestor would be different, the only logical
      +
      193 // consequence is that their parent is the sought answer.
      +
      194 assert(up[u][0] == up[v][0]);
      +
      195 return up[u][0];
      +
      196 }
      std::vector< std::vector< int > > up
      for every vertex stores a list of its ancestors by powers of two For each vertex, the first element o...
      Definition: lowest_common_ancestor.cpp:206
      std::vector< int > level
      Stores the distance from the root.
      Definition: lowest_common_ancestor.cpp:106
      T swap(T... args)
      @@ -266,7 +265,7 @@ Here is the call graph for this function:
      - +

      ◆ populate_up()

      @@ -288,29 +287,27 @@ Here is the call graph for this function:
      -

      Populate the "up" structure. See above.

      -
      212  {
      -
      213  up.resize(tree.number_of_vertices());
      -
      214  for (int vertex = 0; vertex < tree.number_of_vertices(); ++vertex) {
      -
      215  up[vertex].push_back(tree.parent[vertex]);
      -
      216  }
      -
      217  for (int level = 0; (1 << level) < tree.number_of_vertices(); ++level) {
      -
      218  for (int vertex = 0; vertex < tree.number_of_vertices(); ++vertex) {
      -
      219  // up[vertex][level + 1] = 2^(level + 1) th ancestor of vertex =
      -
      220  // = 2^level th ancestor of 2^level th ancestor of vertex =
      -
      221  // = 2^level th ancestor of up[vertex][level]
      -
      222  up[vertex].push_back(up[up[vertex][level]][level]);
      -
      223  }
      -
      224  }
      -
      225  }
      +

      Populate the "up" structure. See above.

      +
      212 {
      +
      213 up.resize(tree.number_of_vertices());
      +
      214 for (int vertex = 0; vertex < tree.number_of_vertices(); ++vertex) {
      +
      215 up[vertex].push_back(tree.parent[vertex]);
      +
      216 }
      +
      217 for (int level = 0; (1 << level) < tree.number_of_vertices(); ++level) {
      +
      218 for (int vertex = 0; vertex < tree.number_of_vertices(); ++vertex) {
      +
      219 // up[vertex][level + 1] = 2^(level + 1) th ancestor of vertex =
      +
      220 // = 2^level th ancestor of 2^level th ancestor of vertex =
      +
      221 // = 2^level th ancestor of up[vertex][level]
      +
      222 up[vertex].push_back(up[up[vertex][level]][level]);
      +
      223 }
      +
      224 }
      +
      225 }
      int number_of_vertices() const
      Definition: lowest_common_ancestor.cpp:74
      std::vector< int > parent
      Stores parent of every vertex and for root its own index. The root is technically not its own parent,...
      Definition: lowest_common_ancestor.cpp:104
      -
      T push_back(T... args)
      -
      T resize(T... args)
      Here is the call graph for this function:
      -
      +
      @@ -325,7 +322,7 @@ Here is the call graph for this function:
      diff --git a/d9/d23/classgraph_1_1_lowest_common_ancestor.js b/d9/d23/classgraph_1_1_lowest_common_ancestor.js index 19f9a254f..7d1ff3ea7 100644 --- a/d9/d23/classgraph_1_1_lowest_common_ancestor.js +++ b/d9/d23/classgraph_1_1_lowest_common_ancestor.js @@ -3,6 +3,5 @@ var classgraph_1_1_lowest_common_ancestor = [ "LowestCommonAncestor", "d9/d23/classgraph_1_1_lowest_common_ancestor.html#a80825a4fd4c41860b689d253dd2c8e93", null ], [ "lowest_common_ancestor", "d9/d23/classgraph_1_1_lowest_common_ancestor.html#a60151e19512b48cc0b14ea121df00488", null ], [ "populate_up", "d9/d23/classgraph_1_1_lowest_common_ancestor.html#a42589cc39d6bbff6c997152f1b96e356", null ], - [ "tree", "d9/d23/classgraph_1_1_lowest_common_ancestor.html#ad6ae1f39c3ce27fc009970e6aa3c022a", null ], [ "up", "d9/d23/classgraph_1_1_lowest_common_ancestor.html#a46d10f669791e3da9a4809bd8ff8d3ad", null ] ]; \ No newline at end of file diff --git a/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.map b/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.map index 1ef1172e5..055e7bdf8 100644 --- a/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.map +++ b/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.map @@ -1,7 +1,4 @@ - - - - - + + diff --git a/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.md5 b/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.md5 index e6131b6b4..ae0892b91 100644 --- a/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.md5 +++ b/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.md5 @@ -1 +1 @@ -ad85deb9bcf5bf2960d5ba1dab3445de \ No newline at end of file +9588c04de542f08ab30836e3f70f9b1b \ No newline at end of file diff --git a/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.svg b/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.svg index d0198e363..0d4478004 100644 --- a/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.svg +++ b/d9/d23/classgraph_1_1_lowest_common_ancestor_a42589cc39d6bbff6c997152f1b96e356_cgraph.svg @@ -1,21 +1,21 @@ - - - + + graph::LowestCommonAncestor::populate_up - + Node1 - -graph::LowestCommonAncestor -::populate_up + +graph::LowestCommonAncestor +::populate_up @@ -23,62 +23,17 @@ Node2 - -graph::Graph::number -_of_vertices + +graph::Graph::number +_of_vertices Node1->Node2 - - - - - -Node4 - - -std::vector::push_back - - - - - -Node1->Node4 - - - - - -Node5 - - -std::vector::resize - - - - - -Node1->Node5 - - - - - -Node3 - - -std::vector::size - - - - - -Node2->Node3 - - + + diff --git a/d9/d23/classgraph_1_1_lowest_common_ancestor_a60151e19512b48cc0b14ea121df00488_cgraph.svg b/d9/d23/classgraph_1_1_lowest_common_ancestor_a60151e19512b48cc0b14ea121df00488_cgraph.svg index bf5139e19..5aeead136 100644 --- a/d9/d23/classgraph_1_1_lowest_common_ancestor_a60151e19512b48cc0b14ea121df00488_cgraph.svg +++ b/d9/d23/classgraph_1_1_lowest_common_ancestor_a60151e19512b48cc0b14ea121df00488_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - + + + diff --git a/d9/d23/classgraph_1_1_lowest_common_ancestor_a80825a4fd4c41860b689d253dd2c8e93_cgraph.md5 b/d9/d23/classgraph_1_1_lowest_common_ancestor_a80825a4fd4c41860b689d253dd2c8e93_cgraph.md5 index 1aea5071a..9ba789c8f 100644 --- a/d9/d23/classgraph_1_1_lowest_common_ancestor_a80825a4fd4c41860b689d253dd2c8e93_cgraph.md5 +++ b/d9/d23/classgraph_1_1_lowest_common_ancestor_a80825a4fd4c41860b689d253dd2c8e93_cgraph.md5 @@ -1 +1 @@ -976e653cb1a919f9d66cf962510482e3 \ No newline at end of file +a0b8642808c402946645aa6404f11fa5 \ No newline at end of file diff --git a/d9/d23/classgraph_1_1_lowest_common_ancestor_a80825a4fd4c41860b689d253dd2c8e93_cgraph.svg b/d9/d23/classgraph_1_1_lowest_common_ancestor_a80825a4fd4c41860b689d253dd2c8e93_cgraph.svg index 0c4e75aea..132670c30 100644 --- a/d9/d23/classgraph_1_1_lowest_common_ancestor_a80825a4fd4c41860b689d253dd2c8e93_cgraph.svg +++ b/d9/d23/classgraph_1_1_lowest_common_ancestor_a80825a4fd4c41860b689d253dd2c8e93_cgraph.svg @@ -1,10 +1,10 @@ - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -large_number::operator*= - - - -Node1 - - -large_number::operator*= - - - - - -Node2 - - -large_number::multiply - - - - - -Node1->Node2 - - - - - -Node3 - - -large_number::add_digit - - - - - -Node2->Node3 - - - - - -Node5 - - -large_number::num_digits - - - - - -Node2->Node5 - - - - - -Node4 - - -std::vector::push_back - - - - - -Node3->Node4 - - - - - -Node6 - - -std::vector::size - - - - - -Node5->Node6 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.map b/db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.map deleted file mode 100644 index bd8763b46..000000000 --- a/db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.md5 b/db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.md5 deleted file mode 100644 index d5ceb1dad..000000000 --- a/db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -ef4020145a632765ace38dc1d385a8c6 \ No newline at end of file diff --git a/db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.svg b/db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.svg deleted file mode 100644 index 88e0de078..000000000 --- a/db/d82/classlarge__number_ac09a05ec4aafb4d9e0b4440d6f0e2a93_cgraph.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -large_number::num_digits - - - -Node1 - - -large_number::num_digits - - - - - -Node2 - - -std::vector::size - - - - - -Node1->Node2 - - - - - diff --git a/db/d82/classlarge__number_ac27b399ed872731758ec33ebb102730e_cgraph.md5 b/db/d82/classlarge__number_ac27b399ed872731758ec33ebb102730e_cgraph.md5 deleted file mode 100644 index 5cd3c426e..000000000 --- a/db/d82/classlarge__number_ac27b399ed872731758ec33ebb102730e_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -1f10fda0776222b581f6c34d54e5d6f7 \ No newline at end of file diff --git a/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.map b/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.map index f1ca6ade2..e673e6be1 100644 --- a/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.map +++ b/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.map @@ -1,5 +1,4 @@ - diff --git a/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.md5 b/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.md5 index c9d781d07..f0996efad 100644 --- a/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.md5 +++ b/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.md5 @@ -1 +1 @@ -1b704cdb509162bccc805d672123ef01 \ No newline at end of file +4ae61451467c2d18aab6898221cf3a6d \ No newline at end of file diff --git a/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.svg b/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.svg index b338d878b..bcde849ca 100644 --- a/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.svg +++ b/db/d82/classlarge__number_ae35a55607cf52c0b0d485f2129bd39ac_cgraph.svg @@ -1,14 +1,14 @@ - - + large_number::digit_char - + Node1 @@ -33,20 +33,5 @@ - - -Node3 - - -std::vector::size - - - - - -Node2->Node3 - - - diff --git a/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.map b/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.map index f83ec13ac..87e53de22 100644 --- a/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.map +++ b/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.map @@ -1,5 +1,4 @@ - diff --git a/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.md5 b/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.md5 index 97acccbeb..79a450aad 100644 --- a/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.md5 +++ b/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.md5 @@ -1 +1 @@ -f8dc5b273e6d1578521c084c3527a28e \ No newline at end of file +ea2ca093d2adcc7355d81c80a0b0af1d \ No newline at end of file diff --git a/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.svg b/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.svg index 9a2eeb196..aa3413cbb 100644 --- a/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.svg +++ b/db/d82/classlarge__number_af4598f1f2794b5e17e10c25e0501e41a_cgraph.svg @@ -1,14 +1,14 @@ - - + large_number::large_number - + Node1 @@ -34,20 +34,5 @@ - - -Node3 - - -std::vector::push_back - - - - - -Node2->Node3 - - - diff --git a/db/d8b/struct_node.html b/db/d8b/struct_node.html index 583bda4b5..0065a79f6 100644 --- a/db/d8b/struct_node.html +++ b/db/d8b/struct_node.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Node Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
      Algorithms_in_C++ -  1.0.0 +
      Algorithms_in_C++ 1.0.0
      Set of algorithms implemented in C++.
      @@ -42,21 +41,22 @@
      - + +/* @license-end */ +
      @@ -70,7 +70,7 @@ $(function() {
      @@ -94,8 +94,7 @@ $(document).ready(function(){initNavTree('db/d8b/struct_node.html','../../'); in Public Member Functions | Public Attributes | List of all members
      -
      -
      Node Class Reference
      +
      Node Class Reference
      @@ -105,27 +104,64 @@ Collaboration diagram for Node:
      [legend]
      - - +

      +

      Public Member Functions

      Node (int v, Node *n)
       Node (int v, Node *n)
       
      - - - - -

      +

      Public Attributes

      +
      int data
       
      +
      int next
       
      +
      int val
       
      +
      Nodenext
       
      +

      Constructor & Destructor Documentation

      + +

      ◆ Node()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + + + +
      Node::Node (int v,
      Noden 
      )
      +
      +inline
      +
      +
      8: val(v), next(n) {} // Default constructor for Node
      +
      +
      +

      The documentation for this class was generated from the following files:
      • data_structures/linkedlist_implentation_usingarray.cpp
      • operations_on_datastructures/get_size_of_linked_list.cpp
      • @@ -136,7 +172,7 @@ int val diff --git a/db/d8b/struct_node.js b/db/d8b/struct_node.js deleted file mode 100644 index b9ee795f0..000000000 --- a/db/d8b/struct_node.js +++ /dev/null @@ -1,8 +0,0 @@ -var struct_node = -[ - [ "Node", "db/d8b/struct_node.html#a66af34de5f6c4d108abd948f341e6470", null ], - [ "data", "db/d8b/struct_node.html#a87c003c9f600e3fc58e6e90835f0b605", null ], - [ "next", "db/d8b/struct_node.html#a80be4538a9184fa43c1dee17641e819b", null ], - [ "next", "db/d8b/struct_node.html#a2559a716f69ccaa76d648d9f1b83065e", null ], - [ "val", "db/d8b/struct_node.html#ab1d228a881cf7465b2d42ea135781427", null ] -]; \ No newline at end of file diff --git a/db/d8e/lowest__common__ancestor_8cpp__incl.svg b/db/d8e/lowest__common__ancestor_8cpp__incl.svg index ac962865d..5ae90d491 100644 --- a/db/d8e/lowest__common__ancestor_8cpp__incl.svg +++ b/db/d8e/lowest__common__ancestor_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: math/check_prime.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('db/d93/check__prime_8cpp.html','../../
        -
        -
        check_prime.cpp File Reference
        +
        check_prime.cpp File Reference
        @@ -108,7 +107,7 @@ Include dependency graph for check_prime.cpp:
        - @@ -117,11 +116,11 @@ Functions

        +

        Functions

        template<typename T >
        bool is_prime (T num)
         

        Detailed Description

        -

        Reduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+2 jumping on all odd numbers only. If number is <= 1 or if it is even except 2, break the loop and return false telling number is not prime.

        -

        Copyright 2020

        Author
        omkarlanghe
        +

        Reduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+2 jumping on all odd numbers only. If number is <= 1 or if it is even except 2, break the loop and return false telling number is not prime.

        +

        Copyright 2020

        Author
        omkarlanghe

        A simple program to check if the given number if prime or not.

        Function Documentation

        - +

        ◆ is_prime()

        @@ -138,37 +137,37 @@ template<typename T >
        -

        Function to check if the given number is prime or not.

        Parameters
        +

        Function to check if the given number is prime or not.

        Parameters
        numnumber to be checked.
        Returns
        if number is prime, it returns @ true, else it returns @ false.
        -
        22  {
        -
        23  bool result = true;
        -
        24  if (num <= 1) {
        -
        25  return false;
        -
        26  } else if (num == 2) {
        -
        27  return true;
        -
        28  } else if ((num & 1) == 0) {
        -
        29  return false;
        -
        30  }
        -
        31  if (num >= 3) {
        -
        32  for (T i = 3; (i * i) <= (num); i = (i + 2)) {
        -
        33  if ((num % i) == 0) {
        -
        34  result = false;
        -
        35  break;
        -
        36  }
        -
        37  }
        -
        38  }
        -
        39  return (result);
        -
        40 }
        +
        22 {
        +
        23 bool result = true;
        +
        24 if (num <= 1) {
        +
        25 return false;
        +
        26 } else if (num == 2) {
        +
        27 return true;
        +
        28 } else if ((num & 1) == 0) {
        +
        29 return false;
        +
        30 }
        +
        31 if (num >= 3) {
        +
        32 for (T i = 3; (i * i) <= (num); i = (i + 2)) {
        +
        33 if ((num % i) == 0) {
        +
        34 result = false;
        +
        35 break;
        +
        36 }
        +
        37 }
        +
        38 }
        +
        39 return (result);
        +
        40}
        uint64_t result(uint64_t n)
        Definition: fibonacci_sum.cpp:76
        - +

        ◆ main()

        @@ -183,24 +182,24 @@ template<typename T >
        -

        Main function

        -
        45  {
        -
        46  // perform self-test
        -
        47  assert(is_prime(50) == false);
        -
        48  assert(is_prime(115249) == true);
        -
        49 
        -
        50  int num = 0;
        -
        51  std::cout << "Enter the number to check if it is prime or not" << std::endl;
        -
        52  std::cin >> num;
        -
        53  bool result = is_prime(num);
        -
        54  if (result) {
        -
        55  std::cout << num << " is a prime number" << std::endl;
        -
        56  } else {
        -
        57  std::cout << num << " is not a prime number" << std::endl;
        -
        58  }
        -
        59 
        -
        60  return 0;
        -
        61 }
        +

        Main function

        +
        45 {
        +
        46 // perform self-test
        +
        47 assert(is_prime(50) == false);
        +
        48 assert(is_prime(115249) == true);
        +
        49
        +
        50 int num = 0;
        +
        51 std::cout << "Enter the number to check if it is prime or not" << std::endl;
        +
        52 std::cin >> num;
        +
        53 bool result = is_prime(num);
        +
        54 if (result) {
        +
        55 std::cout << num << " is a prime number" << std::endl;
        +
        56 } else {
        +
        57 std::cout << num << " is not a prime number" << std::endl;
        +
        58 }
        +
        59
        +
        60 return 0;
        +
        61}
        bool is_prime(T num)
        Definition: check_prime.cpp:22
        @@ -220,7 +219,7 @@ Here is the call graph for this function:
        diff --git a/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 393b05b5a..10371fb8d 100644 --- a/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: uint128_t Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -96,8 +96,7 @@ $(document).ready(function(){initNavTree('db/d9a/classuint128__t.html','../../') Private Attributes | Friends | List of all members -
        -
        uint128_t Class Reference
        +
        uint128_t Class Reference
        @@ -106,7 +105,7 @@ $(document).ready(function(){initNavTree('db/d9a/classuint128__t.html','../../')

        #include <uint128_t.hpp>

        - @@ -124,8 +123,8 @@ Public Member Functions - + @@ -147,20 +146,20 @@ Public Member Functions - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -168,16 +167,16 @@ Public Member Functions - - - - - - - - - - + + + + + + + + + + @@ -191,19 +190,19 @@ Public Member Functions - - - + + + - - - - - - - + + + + + + + @@ -211,16 +210,16 @@ Public Member Functions - - - - - - - - - - + + + + + + + + + + @@ -228,13 +227,13 @@ Public Member Functions - - - - - - - + + + + + + + @@ -242,13 +241,13 @@ Public Member Functions - - - - - - - + + + + + + + @@ -318,18 +317,18 @@ Public Member Functions - - - - + + + + - - - - + + + + @@ -337,13 +336,13 @@ Public Member Functions - - - - - - - + + + + + + + @@ -351,13 +350,13 @@ Public Member Functions - - - - - - - + + + + + + + @@ -365,39 +364,39 @@ Public Member Functions - - - - - - - + + + + + + +

        +

        Public Member Functions

        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
         uint128_t (T low)
         uint128_t (uint128_t &&num) noexcept
         Move constructor. More...
         
        ~uint128_t ()=default
        ~uint128_t ()=default
         Destructor for uint128_t.
         
        uint32_t _lez ()
        uint64_t upper () const
         returns upper 64-bit integer part More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator= (const T &p)
         operator = for other types More...
         
        uint128_toperator= (const std::string &p)
         operator = for type string More...
         
        uint128_toperator= (const uint128_t &p)=default
         operator = for uint128_t More...
         
        -uint128_toperator= (uint128_t &&p)=default
         Move assignment operator.
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator= (const T &p)
         operator = for other types More...
         
        uint128_toperator= (const std::string &p)
         operator = for type string More...
         
        uint128_toperator= (const uint128_t &p)=default
         operator = for uint128_t More...
         
        +uint128_toperator= (uint128_t &&p)=default
         Move assignment operator.
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_t operator+ (const T p)
         operator + for uint128_t and other integer types. More...
        uint128_t operator+ (const uint128_t &p)
         operator + for uint128_t and other integer types. More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator+= (const T p)
         operator += for uint128_t and other integer types. More...
         
        uint128_toperator+= (const uint128_t &p)
         operator += for uint128_t More...
         
        uint128_toperator++ ()
         pre-increment operator More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator+= (const T p)
         operator += for uint128_t and other integer types. More...
         
        uint128_toperator+= (const uint128_t &p)
         operator += for uint128_t More...
         
        uint128_toperator++ ()
         pre-increment operator More...
         
        uint128_t operator++ (int)
         post-increment operator More...
         
        uint128_t operator- ()
         operator - using twos complement More...
         
        uint128_toperator-- ()
         operator – (pre-decrement) More...
         
        uint128_toperator-- ()
         operator – (pre-decrement) More...
         
        uint128_t operator-- (int p)
         operator – (post-decrement) More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator-= (const T &p)
         operator -= for uint128_t and other integer types. More...
         
        uint128_toperator-= (const uint128_t &p)
         operator -= for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator-= (const T &p)
         operator -= for uint128_t and other integer types. More...
         
        uint128_toperator-= (const uint128_t &p)
         operator -= for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_t operator* (const T p)
         operator * for uint128_t and other integer types. More...
        uint128_t operator* (const uint128_t &p)
         operator * for uint128_t and other integer types. More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator*= (const T p)
         operator *= for uint128_t and other integer types. More...
         
        uint128_toperator*= (const uint128_t &p)
         operator *= for uint128_t and other integer types. More...
         
        std::pair< uint128_t, uint128_tdivide (const uint128_t &p)
         divide function for uint128_t and other integer types. More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator*= (const T p)
         operator *= for uint128_t and other integer types. More...
         
        uint128_toperator*= (const uint128_t &p)
         operator *= for uint128_t and other integer types. More...
         
        std::pair< uint128_t, uint128_tdivide (const uint128_t &p)
         divide function for uint128_t and other integer types. More...
         
        uint128_t operator/ (const uint128_t &p)
         operator / for uint128_t and other integer types. More...
         
        uint128_t operator/ (const T p)
         operator / for uint128_t and other integer types. More...
         
        uint128_toperator/= (const uint128_t &p)
         operator /= for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator/= (const T p)
         operator /= for uint128_t and other integer types. More...
         
        uint128_toperator/= (const uint128_t &p)
         operator /= for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator/= (const T p)
         operator /= for uint128_t and other integer types. More...
         
        uint128_t operator% (const uint128_t &p)
         operator % for uint128_t More...
         
        uint128_t operator% (const T &p)
         operator % for uint128_t and other integer types. More...
         
        uint128_toperator%= (const uint128_t &p)
         operator %= for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator%= (const T &p)
         operator %= for uint128_t More...
         
        uint128_toperator%= (const uint128_t &p)
         operator %= for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator%= (const T &p)
         operator %= for uint128_t More...
         
        bool operator< (const uint128_t &other)
         operator < for uint128_t More...
         
        uint128_t operator<< (const T p)
         operator << for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator<<= (const T p)
         operator <<= for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator<<= (const T p)
         operator <<= for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_t operator>> (const T p)
         operator >> for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator>>= (const T p)
         operator >>= for uint128_t More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator>>= (const T p)
         operator >>= for uint128_t More...
         
        uint128_t operator& (const uint128_t &p)
         operator & for uint128_t (bitwise operator) More...
         
        uint128_t operator& (const T p)
         operator & for other types (bitwise operator) More...
         
        uint128_toperator&= (const uint128_t &p)
         operator &= for uint128_t (bitwise operator) More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator&= (const T p)
         operator &= for other types (bitwise operator) More...
         
        uint128_toperator&= (const uint128_t &p)
         operator &= for uint128_t (bitwise operator) More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator&= (const T p)
         operator &= for other types (bitwise operator) More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_t operator| (const T p)
         operator | for other types (bitwise operator) More...
        uint128_t operator| (const uint128_t &p)
         operator | for uint128_t (bitwise operator) More...
         
        uint128_toperator|= (const uint128_t &p)
         operator |= for uint128_t (bitwise operator) More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator|= (const T p)
         operator |= for other types (bitwise operator) More...
         
        uint128_toperator|= (const uint128_t &p)
         operator |= for uint128_t (bitwise operator) More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator|= (const T p)
         operator |= for other types (bitwise operator) More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_t operator^ (const T p)
         operator ^ for other types (bitwise operator) More...
        uint128_t operator^ (const uint128_t &p)
         operator ^ for uint128_t (bitwise operator) More...
         
        uint128_toperator^= (const uint128_t &p)
         operator ^= for uint128_t (bitwise operator) More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator^= (const T &p)
         operator ^= for other types (bitwise operator) More...
         
        uint128_toperator^= (const uint128_t &p)
         operator ^= for uint128_t (bitwise operator) More...
         
        template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
        uint128_toperator^= (const T &p)
         operator ^= for other types (bitwise operator) More...
         
        -

        +

        Private Member Functions

        void __get_integer_from_string (const std::string &str)
         First and second half of 128 bit number. More...
         
        - - -

        +

        Private Attributes

        +
        uint64_t f {}
         
        +
        uint64_t s {}
         
        - - - - + + +

        +

        Friends

        std::ostreamoperator<< (std::ostream &op, const uint128_t &p)
         operator << for printing uint128_t integer More...
         
        std::ostreamoperator<< (std::ostream &op, const uint128_t &p)
         operator << for printing uint128_t integer More...
         

        Detailed Description

        -

        class for 128-bit unsigned integer

        +

        class for 128-bit unsigned integer

        Constructor & Destructor Documentation

        - +

        ◆ uint128_t() [1/5]

        @@ -436,11 +435,11 @@ template<typename T , typename = typename std::enable_if< -
        100 : s(low) {}
        +
        100: s(low) {}
        - +

        ◆ uint128_t() [2/5]

        @@ -471,9 +470,9 @@ template<typename T , typename = typename std::enable_if< -
        106  {
        - -
        108  }
        +
        106 {
        + +
        108 }
        void __get_integer_from_string(const std::string &str)
        First and second half of 128 bit number.
        Definition: uint128_t.hpp:69
        Here is the call graph for this function:
        @@ -484,7 +483,7 @@ Here is the call graph for this function:
        - +

        ◆ uint128_t() [3/5]

        @@ -526,11 +525,11 @@ Here is the call graph for this function:
        -
        115 : f(high), s(low) {}
        +
        115: f(high), s(low) {}
        - +

        ◆ uint128_t() [4/5]

        @@ -564,7 +563,7 @@ Here is the call graph for this function:
        - +

        ◆ uint128_t() [5/5]

        @@ -595,12 +594,12 @@ Here is the call graph for this function:
        -
        127 : f(num.f), s(num.s) {}
        +
        127: f(num.f), s(num.s) {}

        Member Function Documentation

        - +

        ◆ __get_integer_from_string()

        @@ -625,34 +624,34 @@ Here is the call graph for this function:

        First and second half of 128 bit number.

        -

        Get integer from given string.

        -

        Create an integer from a given string

        Parameters
        +

        Get integer from given string.

        +

        Create an integer from a given string

        Parameters
        strinteger string, can be hexadecimal (starting on 0x... or number)
        Returns
        void
        -
        69  {
        -
        70  this->f = this->s = 0;
        -
        71  if (str.size() > 1 && str[1] == 'x') { // if hexadecimal
        -
        72  for (auto i = 2; i < str.size(); ++i) {
        -
        73  *this *= 16LL;
        -
        74  if (str[i] >= '0' && str[i] <= '9') {
        -
        75  *this += (str[i] - '0');
        -
        76  } else if (str[i] >= 'A' && str[i] <= 'F') {
        -
        77  *this += (str[i] - 'A' + 10);
        -
        78  } else if (str[i] >= 'a' && str[i] <= 'f') {
        -
        79  *this += (str[i] - 'a' + 10);
        -
        80  }
        -
        81  }
        -
        82  } else { // if decimal
        -
        83  for (auto &x : str) {
        -
        84  *this *= 10LL;
        -
        85  *this += (x - '0');
        -
        86  }
        -
        87  }
        -
        88  }
        +
        69 {
        +
        70 this->f = this->s = 0;
        +
        71 if (str.size() > 1 && str[1] == 'x') { // if hexadecimal
        +
        72 for (auto i = 2; i < str.size(); ++i) {
        +
        73 *this *= 16LL;
        +
        74 if (str[i] >= '0' && str[i] <= '9') {
        +
        75 *this += (str[i] - '0');
        +
        76 } else if (str[i] >= 'A' && str[i] <= 'F') {
        +
        77 *this += (str[i] - 'A' + 10);
        +
        78 } else if (str[i] >= 'a' && str[i] <= 'f') {
        +
        79 *this += (str[i] - 'a' + 10);
        +
        80 }
        +
        81 }
        +
        82 } else { // if decimal
        +
        83 for (auto &x : str) {
        +
        84 *this *= 10LL;
        +
        85 *this += (x - '0');
        +
        86 }
        +
        87 }
        +
        88 }
        T size(T... args)
        Here is the call graph for this function:
        @@ -663,7 +662,7 @@ Here is the call graph for this function:
        - +

        ◆ _lez()

        @@ -687,28 +686,28 @@ Here is the call graph for this function:

        Leading zeroes in binary.

        -

        Calculates leading zeros in 128-bit integer

        Returns
        Integer denoting leading zeroes
        -
        139  {
        -
        140 #ifndef _MSC_VER
        -
        141  if (f) {
        -
        142  return __builtin_clzll(f);
        -
        143  }
        -
        144  return 64 + __builtin_clzll(s);
        -
        145 #else
        -
        146  unsigned long r = 0;
        -
        147  _BitScanForward64(&r, f);
        -
        148  if (r == 64) {
        -
        149  unsigned long l = 0;
        -
        150  _BitScanForward64(&l, s);
        -
        151  return 64 + l;
        -
        152  }
        -
        153  return r;
        -
        154 #endif
        -
        155  }
        +

        Calculates leading zeros in 128-bit integer

        Returns
        Integer denoting leading zeroes
        +
        139 {
        +
        140#ifndef _MSC_VER
        +
        141 if (f) {
        +
        142 return __builtin_clzll(f);
        +
        143 }
        +
        144 return 64 + __builtin_clzll(s);
        +
        145#else
        +
        146 unsigned long r = 0;
        +
        147 _BitScanForward64(&r, f);
        +
        148 if (r == 64) {
        +
        149 unsigned long l = 0;
        +
        150 _BitScanForward64(&l, s);
        +
        151 return 64 + l;
        +
        152 }
        +
        153 return r;
        +
        154#endif
        +
        155 }
        - +

        ◆ _trz()

        @@ -732,29 +731,29 @@ Here is the call graph for this function:

        Trailing zeroes in binary.

        -

        Calculates leading zeros in 128-bit integer

        Returns
        Integer denoting Trailing zeroes
        -
        162  {
        -
        163 #ifndef _MSC_VER
        -
        164  if (f) {
        -
        165  return __builtin_ctzll(f);
        -
        166  }
        -
        167  return 64 + __builtin_ctzll(s);
        -
        168 #else
        -
        169  unsigned long r = 0;
        -
        170  _BitScanReverse64(&r, s);
        -
        171  if (r == 64) {
        -
        172  unsigned long l = 0;
        -
        173  _BitScanReverse64(&l, f);
        -
        174  return 64 + l;
        -
        175  }
        -
        176  return r;
        -
        177 #endif
        -
        178  }
        +

        Calculates leading zeros in 128-bit integer

        Returns
        Integer denoting Trailing zeroes
        +
        162 {
        +
        163#ifndef _MSC_VER
        +
        164 if (f) {
        +
        165 return __builtin_ctzll(f);
        +
        166 }
        +
        167 return 64 + __builtin_ctzll(s);
        +
        168#else
        +
        169 unsigned long r = 0;
        +
        170 _BitScanReverse64(&r, s);
        +
        171 if (r == 64) {
        +
        172 unsigned long l = 0;
        +
        173 _BitScanReverse64(&l, f);
        +
        174 return 64 + l;
        +
        175 }
        +
        176 return r;
        +
        177#endif
        +
        178 }
        - -

        ◆ divide()

        + +

        ◆ divide()

        @@ -763,7 +762,7 @@ Here is the call graph for this function:
        - + @@ -778,54 +777,54 @@ Here is the call graph for this function:

        divide function for uint128_t and other integer types.

        -

        divide this value and

        Parameters
        +

        divide this value and

        Parameters
        std::pair<uint128_t, uint128_t> uint128_t::divide std::pair< uint128_t, uint128_t > uint128_t::divide ( const uint128_t p)
        p128-bit unsigned integer
        Returns
        pair denoting quotient and remainder.
        -
        454  {
        -
        455  if (*this < p) { // if this is less than divisor
        -
        456  return {uint128_t(0), *this};
        -
        457  } else if (*this == p) { // if this is equal to divisor
        -
        458  return {uint128_t(1), uint128_t(0)};
        -
        459  }
        -
        460  uint128_t tmp = p, tmp2 = *this;
        -
        461  uint16_t left = tmp._lez() - _lez();
        -
        462  tmp <<= left;
        -
        463  uint128_t quotient(0);
        -
        464  uint128_t zero(0);
        -
        465  while (left >= 0 && tmp2 >= p) {
        -
        466  uint16_t shf = tmp2._lez() - tmp._lez();
        -
        467  if (shf) {
        -
        468  tmp >>= shf;
        -
        469  quotient <<= shf;
        -
        470  left -= shf;
        -
        471  }
        -
        472  if (tmp2 < tmp) {
        -
        473  tmp >>= 1;
        -
        474  quotient <<= 1;
        -
        475  --left;
        -
        476  }
        -
        477  tmp2 -= tmp;
        -
        478  ++quotient;
        -
        479  }
        -
        480  return {quotient << left, tmp2};
        -
        481  }
        +
        454 {
        +
        455 if (*this < p) { // if this is less than divisor
        +
        456 return {uint128_t(0), *this};
        +
        457 } else if (*this == p) { // if this is equal to divisor
        +
        458 return {uint128_t(1), uint128_t(0)};
        +
        459 }
        +
        460 uint128_t tmp = p, tmp2 = *this;
        +
        461 uint16_t left = tmp._lez() - _lez();
        +
        462 tmp <<= left;
        +
        463 uint128_t quotient(0);
        +
        464 uint128_t zero(0);
        +
        465 while (left >= 0 && tmp2 >= p) {
        +
        466 uint16_t shf = tmp2._lez() - tmp._lez();
        +
        467 if (shf) {
        +
        468 tmp >>= shf;
        +
        469 quotient <<= shf;
        +
        470 left -= shf;
        +
        471 }
        +
        472 if (tmp2 < tmp) {
        +
        473 tmp >>= 1;
        +
        474 quotient <<= 1;
        +
        475 --left;
        +
        476 }
        +
        477 tmp2 -= tmp;
        +
        478 ++quotient;
        +
        479 }
        +
        480 return {quotient << left, tmp2};
        +
        481 }
        class for 128-bit unsigned integer
        Definition: uint128_t.hpp:59
        uint32_t _lez()
        Leading zeroes in binary.
        Definition: uint128_t.hpp:139
        T left(T... args)
        Here is the call graph for this function:
        -
        +
        - +

        ◆ lower()

        @@ -850,11 +849,11 @@ Here is the call graph for this function:

        returns lower 64-bit integer part

        Returns
        returns lower 64-bit integer part
        -
        201 { return s; }
        +
        201{ return s; }
        - +

        ◆ operator bool()

        @@ -879,11 +878,11 @@ Here is the call graph for this function:

        casting operator to boolean value

        Returns
        true if value of this is non-zero, else false
        -
        184 { return (f || s); }
        +
        184{ return (f || s); }
        - +

        ◆ operator T()

        @@ -916,13 +915,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        integer value casted to mentioned type
        -
        193  {
        -
        194  return static_cast<T>(s);
        -
        195  }
        +
        193 {
        +
        194 return static_cast<T>(s);
        +
        195 }
        - +

        ◆ operator!()

        @@ -947,11 +946,11 @@ template<typename T , typename = typename std::enable_if<

        operator ! for uint128_t

        Returns
        true if this has zero value, else false
        -
        627 { return !f && !s; }
        +
        627{ return !f && !s; }
        - +

        ◆ operator!=() [1/2]

        @@ -991,13 +990,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is not equal to other, else false
        -
        721  {
        -
        722  return *this != uint128_t(other);
        -
        723  }
        +
        721 {
        +
        722 return *this != uint128_t(other);
        +
        723 }
        - +

        ◆ operator!=() [2/2]

        @@ -1029,13 +1028,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is not equal than other, else false
        -
        619  {
        -
        620  return f != other.f || s != other.s;
        -
        621  }
        +
        619 {
        +
        620 return f != other.f || s != other.s;
        +
        621 }
        - +

        ◆ operator%() [1/2]

        @@ -1075,13 +1074,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        unsigned 128-bit remainder.
        -
        542  {
        -
        543  return *this % uint128_t(p);
        -
        544  }
        +
        542 {
        +
        543 return *this % uint128_t(p);
        +
        544 }
        - +

        ◆ operator%() [2/2]

        @@ -1113,8 +1112,8 @@ template<typename T , typename = typename std::enable_if<
        Returns
        unsigned 128-bit remainder.
        -
        532 { return divide(p).second; }
        -
        std::pair< uint128_t, uint128_t > divide(const uint128_t &p)
        divide function for uint128_t and other integer types.
        Definition: uint128_t.hpp:454
        +
        532{ return divide(p).second; }
        +
        std::pair< uint128_t, uint128_t > divide(const uint128_t &p)
        divide function for uint128_t and other integer types.
        Definition: uint128_t.hpp:454
        Here is the call graph for this function:
        @@ -1124,8 +1123,8 @@ Here is the call graph for this function:
        - -

        ◆ operator%=() [1/2]

        + +

        ◆ operator%=() [1/2]

        @@ -1136,7 +1135,7 @@ template<typename T , typename = typename std::enable_if< - + @@ -1164,15 +1163,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this set as unsigned 128-bit remainder.
        -
        564  {
        -
        565  *this %= uint128_t(p);
        -
        566  return *this;
        -
        567  }
        +
        564 {
        +
        565 *this %= uint128_t(p);
        +
        566 return *this;
        +
        567 }
        - -

        ◆ operator%=() [2/2]

        + +

        ◆ operator%=() [2/2]

        @@ -1181,7 +1180,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator%= uint128_t & uint128_t::operator%= ( const T &  p) - + @@ -1203,20 +1202,20 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this set as unsigned 128-bit remainder.
        -
        551  {
        -
        552  *this = divide(p).second;
        -
        553  return *this;
        -
        554  }
        +
        551 {
        +
        552 *this = divide(p).second;
        +
        553 return *this;
        +
        554 }
        Here is the call graph for this function:
        -
        +
        - +

        ◆ operator&() [1/2]

        @@ -1256,14 +1255,14 @@ template<typename T , typename = typename std::enable_if<
        Returns
        value of this & p (& is bit-wise operator)
        -
        855  {
        -
        856  uint128_t tmp = *this;
        -
        857  return tmp & uint128_t(p);
        -
        858  }
        +
        855 {
        +
        856 uint128_t tmp = *this;
        +
        857 return tmp & uint128_t(p);
        +
        858 }
        - +

        ◆ operator&() [2/2]

        @@ -1295,13 +1294,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        value of this & p (& is bit-wise operator)
        -
        843  {
        -
        844  return uint128_t(this->f & p.f, this->s & p.s);
        -
        845  }
        +
        843 {
        +
        844 return uint128_t(this->f & p.f, this->s & p.s);
        +
        845 }
        - +

        ◆ operator&&() [1/2]

        @@ -1341,13 +1340,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is both values are non-zero, else false
        -
        733  {
        -
        734  return (f || s) && b;
        -
        735  }
        +
        733 {
        +
        734 return (f || s) && b;
        +
        735 }
        - +

        ◆ operator&&() [2/2]

        @@ -1379,14 +1378,14 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if both of the values are not zero, else false
        -
        634  {
        -
        635  return (s || f) && (b.s || b.f);
        -
        636  }
        +
        634 {
        +
        635 return (s || f) && (b.s || b.f);
        +
        636 }
        - -

        ◆ operator&=() [1/2]

        + +

        ◆ operator&=() [1/2]

        @@ -1397,7 +1396,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator%= uint128_t & uint128_t::operator%= ( const uint128_t p) - + @@ -1425,15 +1424,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this = this & p (& is bit-wise operator)
        -
        879  {
        -
        880  *this &= uint128_t(p);
        -
        881  return *this;
        -
        882  }
        +
        879 {
        +
        880 *this &= uint128_t(p);
        +
        881 return *this;
        +
        882 }
        - -

        ◆ operator&=() [2/2]

        + +

        ◆ operator&=() [2/2]

        @@ -1442,7 +1441,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator&= uint128_t & uint128_t::operator&= ( const T  p) - + @@ -1464,15 +1463,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this = this & p (& is bit-wise operator)
        -
        865  {
        -
        866  this->f &= p.f;
        -
        867  this->s &= p.s;
        -
        868  return *this;
        -
        869  }
        +
        865 {
        +
        866 this->f &= p.f;
        +
        867 this->s &= p.s;
        +
        868 return *this;
        +
        869 }
        - +

        ◆ operator()()

        @@ -1497,11 +1496,11 @@ template<typename T , typename = typename std::enable_if<

        operator () for uint128_t

        Returns
        true if this value is non-zero, else false
        -
        651 { return s || f; }
        +
        651{ return s || f; }
        - +

        ◆ operator*() [1/2]

        @@ -1541,13 +1540,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        multiplication of this and p, returning uint128_t integer
        -
        392  {
        -
        393  return *this * uint128_t(p);
        -
        394  }
        +
        392 {
        +
        393 return *this * uint128_t(p);
        +
        394 }
        - +

        ◆ operator*() [2/2]

        @@ -1579,24 +1578,24 @@ template<typename T , typename = typename std::enable_if<
        Returns
        multiplication of this and p, returning uint128_t integer
        -
        401  {
        -
        402  uint64_t f_first = s >> 32, f_second = s & 0xFFFFFFFF,
        -
        403  s_first = p.s >> 32, s_second = p.s & 0xFFFFFFFF;
        -
        404  uint64_t fi = f_first * s_first, se = f_first * s_second,
        -
        405  th = s_first * f_second, fo = s_second * f_second;
        -
        406  uint64_t tmp = ((se & 0xFFFFFFFF) << 32), tmp2 = (th & 0xFFFFFFFF)
        -
        407  << 32;
        -
        408  int cc = (tmp + tmp2 < tmp);
        -
        409  tmp += tmp2;
        -
        410  cc += (tmp + fo < tmp);
        -
        411  uint64_t carry = fi + (se >> 32) + (th >> 32);
        -
        412  return uint128_t(this->f * p.s + this->s * p.f + carry + cc, tmp + fo);
        -
        413  }
        +
        401 {
        +
        402 uint64_t f_first = s >> 32, f_second = s & 0xFFFFFFFF,
        +
        403 s_first = p.s >> 32, s_second = p.s & 0xFFFFFFFF;
        +
        404 uint64_t fi = f_first * s_first, se = f_first * s_second,
        +
        405 th = s_first * f_second, fo = s_second * f_second;
        +
        406 uint64_t tmp = ((se & 0xFFFFFFFF) << 32), tmp2 = (th & 0xFFFFFFFF)
        +
        407 << 32;
        +
        408 int cc = (tmp + tmp2 < tmp);
        +
        409 tmp += tmp2;
        +
        410 cc += (tmp + fo < tmp);
        +
        411 uint64_t carry = fi + (se >> 32) + (th >> 32);
        +
        412 return uint128_t(this->f * p.s + this->s * p.f + carry + cc, tmp + fo);
        +
        413 }
        - -

        ◆ operator*=() [1/2]

        + +

        ◆ operator*=() [1/2]

        @@ -1607,7 +1606,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator&= uint128_t & uint128_t::operator&= ( const uint128_t p) - + @@ -1635,15 +1634,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        multiplication of this and p, returning this
        -
        423  {
        -
        424  *this *= uint128_t(p);
        -
        425  return *this;
        -
        426  }
        +
        423 {
        +
        424 *this *= uint128_t(p);
        +
        425 return *this;
        +
        426 }
        - -

        ◆ operator*=() [2/2]

        + +

        ◆ operator*=() [2/2]

        @@ -1652,7 +1651,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator*= uint128_t & uint128_t::operator*= ( const T  p) - + @@ -1674,24 +1673,24 @@ template<typename T , typename = typename std::enable_if<
        Returns
        multiplication of this and p, returning this
        -
        433  {
        -
        434  uint64_t f_first = s >> 32, f_second = s & 0xFFFFFFFF,
        -
        435  s_first = p.s >> 32, s_second = p.s & 0xFFFFFFFF;
        -
        436  uint64_t fi = f_first * s_first, se = f_first * s_second,
        -
        437  th = s_first * f_second, fo = s_second * f_second;
        -
        438  uint64_t tmp = (se << 32), tmp2 = (th << 32);
        -
        439  int cc = (tmp + tmp2 < tmp);
        -
        440  tmp += tmp2;
        -
        441  cc += (tmp + fo < tmp);
        -
        442  uint64_t carry = fi + (se >> 32) + (th >> 32);
        -
        443  f = this->f * p.s + this->s * p.f + carry + cc;
        -
        444  s = tmp + fo;
        -
        445  return *this;
        -
        446  }
        +
        433 {
        +
        434 uint64_t f_first = s >> 32, f_second = s & 0xFFFFFFFF,
        +
        435 s_first = p.s >> 32, s_second = p.s & 0xFFFFFFFF;
        +
        436 uint64_t fi = f_first * s_first, se = f_first * s_second,
        +
        437 th = s_first * f_second, fo = s_second * f_second;
        +
        438 uint64_t tmp = (se << 32), tmp2 = (th << 32);
        +
        439 int cc = (tmp + tmp2 < tmp);
        +
        440 tmp += tmp2;
        +
        441 cc += (tmp + fo < tmp);
        +
        442 uint64_t carry = fi + (se >> 32) + (th >> 32);
        +
        443 f = this->f * p.s + this->s * p.f + carry + cc;
        +
        444 s = tmp + fo;
        +
        445 return *this;
        +
        446 }
        - +

        ◆ operator+() [1/2]

        @@ -1731,13 +1730,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        addition of this and p, returning uint128_t integer
        -
        252  {
        -
        253  return uint128_t(f + (p + s < s), p + s);
        -
        254  }
        +
        252 {
        +
        253 return uint128_t(f + (p + s < s), p + s);
        +
        254 }
        - +

        ◆ operator+() [2/2]

        @@ -1769,14 +1768,14 @@ template<typename T , typename = typename std::enable_if<
        Returns
        addition of this and p, returning uint128_t integer
        -
        261  {
        -
        262  return uint128_t(f + (p.s + s < s) + p.f, p.s + s);
        -
        263  }
        +
        261 {
        +
        262 return uint128_t(f + (p.s + s < s) + p.f, p.s + s);
        +
        263 }
        - -

        ◆ operator++() [1/2]

        + +

        ◆ operator++() [1/2]

        @@ -1785,7 +1784,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator*= uint128_t & uint128_t::operator*= ( const uint128_t p) - + @@ -1800,14 +1799,14 @@ template<typename T , typename = typename std::enable_if<

        pre-increment operator

        Returns
        incremented value of this.
        -
        296  {
        -
        297  *this += 1;
        -
        298  return *this;
        -
        299  }
        +
        296 {
        +
        297 *this += 1;
        +
        298 return *this;
        +
        299 }
        - +

        ◆ operator++() [2/2]

        @@ -1833,15 +1832,15 @@ template<typename T , typename = typename std::enable_if<

        post-increment operator

        Returns
        incremented value of this.
        -
        305  {
        -
        306  ++*this;
        -
        307  return *this;
        -
        308  }
        +
        305 {
        +
        306 ++*this;
        +
        307 return *this;
        +
        308 }
        - -

        ◆ operator+=() [1/2]

        + +

        ◆ operator+=() [1/2]

        @@ -1852,7 +1851,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator++ uint128_t & uint128_t::operator++ ( ) - + @@ -1880,17 +1879,17 @@ template<typename T , typename = typename std::enable_if<
        Returns
        addition of this and p, returning this
        -
        273  {
        -
        274  bool app = p + s < s;
        -
        275  this->f += app;
        -
        276  this->s += p;
        -
        277  return *this;
        -
        278  }
        +
        273 {
        +
        274 bool app = p + s < s;
        +
        275 this->f += app;
        +
        276 this->s += p;
        +
        277 return *this;
        +
        278 }
        - -

        ◆ operator+=() [2/2]

        + +

        ◆ operator+=() [2/2]

        @@ -1899,7 +1898,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator+= uint128_t & uint128_t::operator+= ( const T  p) - + @@ -1921,16 +1920,16 @@ template<typename T , typename = typename std::enable_if<
        Returns
        addition of this and p, returning this
        -
        285  {
        -
        286  bool app = p.s + s < s;
        -
        287  f = f + app + p.f;
        -
        288  s = p.s + s;
        -
        289  return *this;
        -
        290  }
        +
        285 {
        +
        286 bool app = p.s + s < s;
        +
        287 f = f + app + p.f;
        +
        288 s = p.s + s;
        +
        289 return *this;
        +
        290 }
        - +

        ◆ operator-() [1/3]

        @@ -1955,11 +1954,11 @@ template<typename T , typename = typename std::enable_if<

        operator - using twos complement

        Returns
        2's complement of this.
        -
        337 { return ~*this + uint128_t(1); }
        +
        337{ return ~*this + uint128_t(1); }
        - +

        ◆ operator-() [2/3]

        @@ -1999,14 +1998,14 @@ template<typename T , typename = typename std::enable_if<
        Returns
        subtraction of this and p, returning uint128_t integer
        -
        318  {
        -
        319  bool app = p > s;
        -
        320  return uint128_t(f - app, s - p);
        -
        321  }
        +
        318 {
        +
        319 bool app = p > s;
        +
        320 return uint128_t(f - app, s - p);
        +
        321 }
        - +

        ◆ operator-() [3/3]

        @@ -2038,15 +2037,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        subtraction of this and p, returning uint128_t integer
        -
        328  {
        -
        329  bool app = p.s > s;
        -
        330  return uint128_t(f - p.f - app, s - p.s);
        -
        331  }
        +
        328 {
        +
        329 bool app = p.s > s;
        +
        330 return uint128_t(f - p.f - app, s - p.s);
        +
        331 }
        - -

        ◆ operator--() [1/2]

        + +

        ◆ operator--() [1/2]

        @@ -2055,7 +2054,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator+= uint128_t & uint128_t::operator+= ( const uint128_t p) - + @@ -2070,14 +2069,14 @@ template<typename T , typename = typename std::enable_if<

        operator – (pre-decrement)

        Returns
        decremented value of this
        -
        343  {
        -
        344  *this -= 1;
        -
        345  return *this;
        -
        346  }
        +
        343 {
        +
        344 *this -= 1;
        +
        345 return *this;
        +
        346 }
        - +

        ◆ operator--() [2/2]

        @@ -2103,15 +2102,15 @@ template<typename T , typename = typename std::enable_if<

        operator – (post-decrement)

        Returns
        decremented value of this
        -
        352  {
        -
        353  --*this;
        -
        354  return *this;
        -
        355  }
        +
        352 {
        +
        353 --*this;
        +
        354 return *this;
        +
        355 }
        - -

        ◆ operator-=() [1/2]

        + +

        ◆ operator-=() [1/2]

        @@ -2122,7 +2121,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator-- uint128_t & uint128_t::operator-- ( ) - + @@ -2150,17 +2149,17 @@ template<typename T , typename = typename std::enable_if<
        Returns
        subtraction of this and p, returning this
        -
        365  {
        -
        366  bool app = p > s;
        -
        367  f -= app;
        -
        368  s -= p;
        -
        369  return *this;
        -
        370  }
        +
        365 {
        +
        366 bool app = p > s;
        +
        367 f -= app;
        +
        368 s -= p;
        +
        369 return *this;
        +
        370 }
        - -

        ◆ operator-=() [2/2]

        + +

        ◆ operator-=() [2/2]

        @@ -2169,7 +2168,7 @@ template<typename T , typename = typename std::enable_if<
        @@ -42,21 +41,22 @@
        uint128_t& uint128_t::operator-= uint128_t & uint128_t::operator-= ( const T &  p) - + @@ -2191,16 +2190,16 @@ template<typename T , typename = typename std::enable_if<
        Returns
        subtraction of this and p, returning this
        -
        377  {
        -
        378  bool app = p.s > s;
        -
        379  f = f - p.f - app;
        -
        380  s = s - p.s;
        -
        381  return *this;
        -
        382  }
        +
        377 {
        +
        378 bool app = p.s > s;
        +
        379 f = f - p.f - app;
        +
        380 s = s - p.s;
        +
        381 return *this;
        +
        382 }
        - +

        ◆ operator/() [1/2]

        @@ -2240,15 +2239,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        unsigned 128-bit quotient.
        -
        498  {
        -
        499  uint128_t tmp = *this;
        -
        500  tmp /= uint128_t(0, p);
        -
        501  return tmp;
        -
        502  }
        +
        498 {
        +
        499 uint128_t tmp = *this;
        +
        500 tmp /= uint128_t(0, p);
        +
        501 return tmp;
        +
        502 }
        - +

        ◆ operator/() [2/2]

        @@ -2280,7 +2279,7 @@ template<typename T , typename = typename std::enable_if<
        Returns
        unsigned 128-bit quotient.
        -
        488 { return divide(p).first; }
        +
        488{ return divide(p).first; }
        Here is the call graph for this function:
        @@ -2290,8 +2289,8 @@ Here is the call graph for this function:
        - -

        ◆ operator/=() [1/2]

        + +

        ◆ operator/=() [1/2]

        @@ -2302,7 +2301,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator-= uint128_t & uint128_t::operator-= ( const uint128_t p) - + @@ -2330,15 +2329,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this set as unsigned 128-bit quotient.
        -
        522  {
        -
        523  *this /= uint128_t(0, p);
        -
        524  return *this;
        -
        525  }
        +
        522 {
        +
        523 *this /= uint128_t(0, p);
        +
        524 return *this;
        +
        525 }
        - -

        ◆ operator/=() [2/2]

        + +

        ◆ operator/=() [2/2]

        @@ -2347,7 +2346,7 @@ template<typename T , typename = typename std::enable_if<
        @@ -42,21 +41,22 @@
        uint128_t& uint128_t::operator/= uint128_t & uint128_t::operator/= ( const T  p) - + @@ -2369,20 +2368,20 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this set as unsigned 128-bit quotient.
        -
        509  {
        -
        510  *this = divide(p).first;
        -
        511  return *this;
        -
        512  }
        +
        509 {
        +
        510 *this = divide(p).first;
        +
        511 return *this;
        +
        512 }
        Here is the call graph for this function:
        -
        +
        - +

        ◆ operator<() [1/2]

        @@ -2422,13 +2421,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is less than other, else false
        -
        661  {
        -
        662  return *this < uint128_t(other);
        -
        663  }
        +
        661 {
        +
        662 return *this < uint128_t(other);
        +
        663 }
        - +

        ◆ operator<() [2/2]

        @@ -2460,13 +2459,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is less than other, else false
        -
        574  {
        -
        575  return f < other.f || (f == other.f && s < other.s);
        -
        576  }
        +
        574 {
        +
        575 return f < other.f || (f == other.f && s < other.s);
        +
        576 }
        - +

        ◆ operator<<()

        @@ -2506,22 +2505,22 @@ template<typename T , typename = typename std::enable_if<
        Returns
        value of this shifted by p to left
        -
        764  {
        -
        765  if (!p) {
        -
        766  return uint128_t(f, s);
        -
        767  } else if (p >= 64 && p <= 128) {
        -
        768  return uint128_t((this->s << (p - 64)), 0);
        -
        769  } else if (p < 64 && p > 0) {
        -
        770  return uint128_t((this->f << p) + ((this->s >> (64 - p))),
        -
        771  this->s << p);
        -
        772  }
        -
        773  return uint128_t(0);
        -
        774  }
        +
        764 {
        +
        765 if (!p) {
        +
        766 return uint128_t(f, s);
        +
        767 } else if (p >= 64 && p <= 128) {
        +
        768 return uint128_t((this->s << (p - 64)), 0);
        +
        769 } else if (p < 64 && p > 0) {
        +
        770 return uint128_t((this->f << p) + ((this->s >> (64 - p))),
        +
        771 this->s << p);
        +
        772 }
        +
        773 return uint128_t(0);
        +
        774 }
        - -

        ◆ operator<<=()

        + +

        ◆ operator<<=()

        @@ -2532,7 +2531,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator/= uint128_t & uint128_t::operator/= ( const uint128_t p) - + @@ -2560,22 +2559,22 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this shifted by p to left
        -
        784  {
        -
        785  if (p) {
        -
        786  if (p >= 64 && p <= 128) {
        -
        787  this->f = (this->s << (p - 64));
        -
        788  this->s = 0;
        -
        789  } else {
        -
        790  f = ((this->f << p) + (this->s >> (64 - p)));
        -
        791  s = (this->s << p);
        -
        792  }
        -
        793  }
        -
        794  return *this;
        -
        795  }
        +
        784 {
        +
        785 if (p) {
        +
        786 if (p >= 64 && p <= 128) {
        +
        787 this->f = (this->s << (p - 64));
        +
        788 this->s = 0;
        +
        789 } else {
        +
        790 f = ((this->f << p) + (this->s >> (64 - p)));
        +
        791 s = (this->s << p);
        +
        792 }
        +
        793 }
        +
        794 return *this;
        +
        795 }
        - +

        ◆ operator<=() [1/2]

        @@ -2615,13 +2614,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is less than or equal to other, else false
        -
        673  {
        -
        674  return *this <= uint128_t(other);
        -
        675  }
        +
        673 {
        +
        674 return *this <= uint128_t(other);
        +
        675 }
        - +

        ◆ operator<=() [2/2]

        @@ -2653,14 +2652,14 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is less than or equal to other, else false
        -
        583  {
        -
        584  return f < other.f || (f == other.f && s <= other.s);
        -
        585  }
        +
        583 {
        +
        584 return f < other.f || (f == other.f && s <= other.s);
        +
        585 }
        - -

        ◆ operator=() [1/3]

        + +

        ◆ operator=() [1/3]

        @@ -2669,7 +2668,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator<<= uint128_t & uint128_t::operator<<= ( const T  p) - + @@ -2691,21 +2690,21 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this pointer with it's value equal to p
        -
        227  {
        -
        228  this->__get_integer_from_string(p);
        -
        229  return *this;
        -
        230  }
        +
        227 {
        + +
        229 return *this;
        +
        230 }
        Here is the call graph for this function:
        -
        +
        - -

        ◆ operator=() [2/3]

        + +

        ◆ operator=() [2/3]

        @@ -2716,7 +2715,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator= uint128_t & uint128_t::operator= ( const std::string p) - + @@ -2744,15 +2743,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this pointer with it's value equal to p
        -
        217  {
        -
        218  this->s = p;
        -
        219  return *this;
        -
        220  }
        +
        217 {
        +
        218 this->s = p;
        +
        219 return *this;
        +
        220 }
        - -

        ◆ operator=() [3/3]

        + +

        ◆ operator=() [3/3]

        @@ -2761,7 +2760,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator= uint128_t & uint128_t::operator= ( const T &  p) - + @@ -2786,7 +2785,7 @@ template<typename T , typename = typename std::enable_if< - +

        ◆ operator==() [1/2]

        @@ -2826,13 +2825,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is equal to other, else false
        -
        709  {
        -
        710  return *this == uint128_t(other);
        -
        711  }
        +
        709 {
        +
        710 return *this == uint128_t(other);
        +
        711 }
        - +

        ◆ operator==() [2/2]

        @@ -2864,13 +2863,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is equal than other, else false
        -
        610  {
        -
        611  return f == other.f && s == other.s;
        -
        612  }
        +
        610 {
        +
        611 return f == other.f && s == other.s;
        +
        612 }
        - +

        ◆ operator>() [1/2]

        @@ -2910,13 +2909,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is greater than other, else false
        -
        685  {
        -
        686  return *this > uint128_t(other);
        -
        687  }
        +
        685 {
        +
        686 return *this > uint128_t(other);
        +
        687 }
        - +

        ◆ operator>() [2/2]

        @@ -2948,13 +2947,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is greater than other, else false
        -
        592  {
        -
        593  return f > other.f || (f == other.f && s > other.s);
        -
        594  }
        +
        592 {
        +
        593 return f > other.f || (f == other.f && s > other.s);
        +
        594 }
        - +

        ◆ operator>=() [1/2]

        @@ -2994,13 +2993,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is greater than or equal other, else false
        -
        697  {
        -
        698  return *this >= uint128_t(other);
        -
        699  }
        +
        697 {
        +
        698 return *this >= uint128_t(other);
        +
        699 }
        - +

        ◆ operator>=() [2/2]

        @@ -3032,13 +3031,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is greater than or equal than other, else false
        -
        601  {
        -
        602  return (f > other.f) || (f == other.f && s >= other.s);
        -
        603  }
        +
        601 {
        +
        602 return (f > other.f) || (f == other.f && s >= other.s);
        +
        603 }
        - +

        ◆ operator>>()

        @@ -3078,22 +3077,22 @@ template<typename T , typename = typename std::enable_if<
        Returns
        value of this shifted by p to right
        -
        805  {
        -
        806  if (!p) {
        -
        807  return uint128_t(this->f, this->s);
        -
        808  } else if (p >= 64 && p <= 128) {
        -
        809  return uint128_t(0, (this->f >> (p - 64)));
        -
        810  } else if (p < 64 && p > 0) {
        -
        811  return uint128_t((this->f >> p),
        -
        812  (this->s >> p) + (this->f << (64 - p)));
        -
        813  }
        -
        814  return uint128_t(0);
        -
        815  }
        +
        805 {
        +
        806 if (!p) {
        +
        807 return uint128_t(this->f, this->s);
        +
        808 } else if (p >= 64 && p <= 128) {
        +
        809 return uint128_t(0, (this->f >> (p - 64)));
        +
        810 } else if (p < 64 && p > 0) {
        +
        811 return uint128_t((this->f >> p),
        +
        812 (this->s >> p) + (this->f << (64 - p)));
        +
        813 }
        +
        814 return uint128_t(0);
        +
        815 }
        - -

        ◆ operator>>=()

        + +

        ◆ operator>>=()

        @@ -3104,7 +3103,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator= uint128_t & uint128_t::operator= ( const uint128_t p) - + @@ -3132,22 +3131,22 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this shifted by p to right
        -
        825  {
        -
        826  if (p) {
        -
        827  if (p >= 64) {
        -
        828  f = 0;
        -
        829  s = (this->f >> (p - 64));
        -
        830  } else {
        -
        831  s = (this->s >> p) + (this->f << (64 - p));
        -
        832  f = (this->f >> p);
        -
        833  }
        -
        834  }
        -
        835  return *this;
        -
        836  }
        +
        825 {
        +
        826 if (p) {
        +
        827 if (p >= 64) {
        +
        828 f = 0;
        +
        829 s = (this->f >> (p - 64));
        +
        830 } else {
        +
        831 s = (this->s >> p) + (this->f << (64 - p));
        +
        832 f = (this->f >> p);
        +
        833 }
        +
        834 }
        +
        835 return *this;
        +
        836 }
        - +

        ◆ operator^() [1/2]

        @@ -3187,13 +3186,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        value of this ^ p (^ is bit-wise XOR operator)
        -
        937  {
        -
        938  return uint128_t(this->f, this->s ^ p);
        -
        939  }
        +
        937 {
        +
        938 return uint128_t(this->f, this->s ^ p);
        +
        939 }
        - +

        ◆ operator^() [2/2]

        @@ -3225,14 +3224,14 @@ template<typename T , typename = typename std::enable_if<
        Returns
        value of this ^ p (^ is bit-wise XOR operator)
        -
        946  {
        -
        947  return uint128_t(this->f ^ p.f, this->s ^ p.s);
        -
        948  }
        +
        946 {
        +
        947 return uint128_t(this->f ^ p.f, this->s ^ p.s);
        +
        948 }
        - -

        ◆ operator^=() [1/2]

        + +

        ◆ operator^=() [1/2]

        @@ -3243,7 +3242,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator>>= uint128_t & uint128_t::operator>>= ( const T  p) - + @@ -3271,15 +3270,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this = this ^ p (^ is bit-wise XOR operator)
        -
        969  {
        -
        970  s ^= p;
        -
        971  return *this;
        -
        972  }
        +
        969 {
        +
        970 s ^= p;
        +
        971 return *this;
        +
        972 }
        - -

        ◆ operator^=() [2/2]

        + +

        ◆ operator^=() [2/2]

        @@ -3288,7 +3287,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator^= uint128_t & uint128_t::operator^= ( const T &  p) - + @@ -3310,15 +3309,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this = this ^ p (^ is bit-wise XOR operator)
        -
        955  {
        -
        956  f ^= p.f;
        -
        957  s ^= p.s;
        -
        958  return *this;
        -
        959  }
        +
        955 {
        +
        956 f ^= p.f;
        +
        957 s ^= p.s;
        +
        958 return *this;
        +
        959 }
        - +

        ◆ operator|() [1/2]

        @@ -3358,13 +3357,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        value of this | p (| is bit-wise operator)
        -
        892  {
        -
        893  return uint128_t(p | s);
        -
        894  }
        +
        892 {
        +
        893 return uint128_t(p | s);
        +
        894 }
        - +

        ◆ operator|() [2/2]

        @@ -3396,14 +3395,14 @@ template<typename T , typename = typename std::enable_if<
        Returns
        value of this | p (| is bit-wise OR operator)
        -
        901  {
        -
        902  return uint128_t(this->f | p.f, this->s | p.s);
        -
        903  }
        +
        901 {
        +
        902 return uint128_t(this->f | p.f, this->s | p.s);
        +
        903 }
        - -

        ◆ operator|=() [1/2]

        + +

        ◆ operator|=() [1/2]

        @@ -3414,7 +3413,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator^= uint128_t & uint128_t::operator^= ( const uint128_t p) - + @@ -3442,15 +3441,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this = this | p (| is bit-wise OR operator)
        -
        924  {
        -
        925  s |= p.s;
        -
        926  return *this;
        -
        927  }
        +
        924 {
        +
        925 s |= p.s;
        +
        926 return *this;
        +
        927 }
        - -

        ◆ operator|=() [2/2]

        + +

        ◆ operator|=() [2/2]

        @@ -3459,7 +3458,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator|= uint128_t & uint128_t::operator|= ( const T  p) - + @@ -3481,15 +3480,15 @@ template<typename T , typename = typename std::enable_if<
        Returns
        this = this | p (| is bit-wise OR operator)
        -
        910  {
        -
        911  f |= p.f;
        -
        912  s |= p.s;
        -
        913  return *this;
        -
        914  }
        +
        910 {
        +
        911 f |= p.f;
        +
        912 s |= p.s;
        +
        913 return *this;
        +
        914 }
        - +

        ◆ operator||() [1/2]

        @@ -3529,13 +3528,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if this is either one of the values are non-zero, else false
        -
        746  {
        -
        747  return (f || s) || b;
        -
        748  }
        +
        746 {
        +
        747 return (f || s) || b;
        +
        748 }
        - +

        ◆ operator||() [2/2]

        @@ -3567,13 +3566,13 @@ template<typename T , typename = typename std::enable_if<
        Returns
        true if one of the values are not zero, else false
        -
        643  {
        -
        644  return (s || f) || (b.s || b.f);
        -
        645  }
        +
        643 {
        +
        644 return (s || f) || (b.s || b.f);
        +
        645 }
        - +

        ◆ operator~()

        @@ -3598,11 +3597,11 @@ template<typename T , typename = typename std::enable_if<

        operator ~ for uint128_t

        Returns
        1's complement of this number
        -
        754 { return uint128_t(~this->f, ~this->s); }
        +
        754{ return uint128_t(~this->f, ~this->s); }
        - +

        ◆ upper()

        @@ -3627,13 +3626,13 @@ template<typename T , typename = typename std::enable_if<

        returns upper 64-bit integer part

        Returns
        returns upper 64-bit integer part
        -
        207 { return f; }
        +
        207{ return f; }

        Friends And Related Function Documentation

        - -

        ◆ operator<<

        + +

        ◆ operator<<

        @@ -3642,7 +3641,7 @@ template<typename T , typename = typename std::enable_if<
        uint128_t& uint128_t::operator|= uint128_t & uint128_t::operator|= ( const uint128_t p) - + @@ -3667,7 +3666,7 @@ template<typename T , typename = typename std::enable_if<

        operator << for printing uint128_t integer

        -

        Prints the uint128_t integer in decimal form

        Note
        Note that this operator is costly since it uses strings to print the value
        +

        Prints the uint128_t integer in decimal form

        Note
        Note that this operator is costly since it uses strings to print the value
        Parameters
        std::ostream& operator<< std::ostream & operator<< ( std::ostream op,
        @@ -3676,27 +3675,27 @@ template<typename T , typename = typename std::enable_if<
        Returns
        op, ostream object.
        -
        983  {
        -
        984  if (!p.f) {
        -
        985  op << p.s;
        -
        986  } else {
        -
        987  std::string out = "0", p_2 = "1";
        -
        988  for (int i = 0; i < 64; ++i) {
        -
        989  if (p.s & (1LL << i)) {
        -
        990  out = add(out, p_2);
        -
        991  }
        -
        992  p_2 = add(p_2, p_2);
        -
        993  }
        -
        994  for (int i = 0; i < 64; ++i) {
        -
        995  if (p.f & (1LL << i)) {
        -
        996  out = add(out, p_2);
        -
        997  }
        -
        998  p_2 = add(p_2, p_2);
        -
        999  }
        -
        1000  op << out;
        -
        1001  }
        -
        1002  return op;
        -
        1003  }
        +
        983 {
        +
        984 if (!p.f) {
        +
        985 op << p.s;
        +
        986 } else {
        +
        987 std::string out = "0", p_2 = "1";
        +
        988 for (int i = 0; i < 64; ++i) {
        +
        989 if (p.s & (1LL << i)) {
        +
        990 out = add(out, p_2);
        +
        991 }
        +
        992 p_2 = add(p_2, p_2);
        +
        993 }
        +
        994 for (int i = 0; i < 64; ++i) {
        +
        995 if (p.f & (1LL << i)) {
        +
        996 out = add(out, p_2);
        +
        997 }
        +
        998 p_2 = add(p_2, p_2);
        +
        999 }
        +
        1000 op << out;
        +
        1001 }
        +
        1002 return op;
        +
        1003 }
        std::string add(const std::string &first, const std::string &second)
        Adding two string.
        Definition: uint128_t.hpp:37
        @@ -3711,7 +3710,7 @@ template<typename T , typename = typename std::enable_if< diff --git a/db/d9a/classuint128__t.js b/db/d9a/classuint128__t.js index 92fd831ac..b7f8c9825 100644 --- a/db/d9a/classuint128__t.js +++ b/db/d9a/classuint128__t.js @@ -1,6 +1,5 @@ var classuint128__t = [ - [ "uint128_t", "db/d9a/classuint128__t.html#ac1c41fea46bdf7b24a96ccce24e5ddf5", null ], [ "uint128_t", "db/d9a/classuint128__t.html#adce2432b148fe18179a5ea272f4eb040", null ], [ "uint128_t", "db/d9a/classuint128__t.html#a0b6612186d8f678452e011d08ee1f5ac", null ], [ "uint128_t", "db/d9a/classuint128__t.html#a95ac8be8f414fcbce09301b912f5079d", null ], @@ -10,7 +9,7 @@ var classuint128__t = [ "__get_integer_from_string", "db/d9a/classuint128__t.html#a857a3c69c1e775a1bd3935c2bfbb02df", null ], [ "_lez", "db/d9a/classuint128__t.html#af139bb6e630f1a61919f180978611cd2", null ], [ "_trz", "db/d9a/classuint128__t.html#a7d2285a8a6e20b77f82f1f0351afe76e", null ], - [ "divide", "db/d9a/classuint128__t.html#ab044d69154b2eedc2874ad67886bd009", null ], + [ "divide", "db/d9a/classuint128__t.html#a8bf81f7f5f5c98f197822ec88e106c6c", null ], [ "lower", "db/d9a/classuint128__t.html#aa69e1064c0b0b1df1c61acd2ea04fabd", null ], [ "operator bool", "db/d9a/classuint128__t.html#a6d45302022ef7f5195458f41b8aedb6e", null ], [ "operator T", "db/d9a/classuint128__t.html#a75767cb2b6fd47ecb1f721755fdc7639", null ], @@ -19,46 +18,46 @@ var classuint128__t = [ "operator!=", "db/d9a/classuint128__t.html#ab3359b104bbb5a31c11c2027387c4b4e", null ], [ "operator%", "db/d9a/classuint128__t.html#add9938b97fc66560cec2d32e8c83eaad", null ], [ "operator%", "db/d9a/classuint128__t.html#abfc6a8765039cacc829a5cd386b5a066", null ], - [ "operator%=", "db/d9a/classuint128__t.html#a22cce998dfbad044c27326e967130ab5", null ], - [ "operator%=", "db/d9a/classuint128__t.html#a59e50792c542a57392f9edd99b567845", null ], + [ "operator%=", "db/d9a/classuint128__t.html#a0500a90bcde5a8254750c361eed9bc40", null ], + [ "operator%=", "db/d9a/classuint128__t.html#a279209a184db20a7ffc8e687fdb05be2", null ], [ "operator&", "db/d9a/classuint128__t.html#a9fa81ef0d54ecb9050d0be4249358ca4", null ], [ "operator&", "db/d9a/classuint128__t.html#ad1717d3a38391258befa413b7e2b9244", null ], [ "operator&&", "db/d9a/classuint128__t.html#a0ad881643c707f6ae3c5de3822a8cb8a", null ], [ "operator&&", "db/d9a/classuint128__t.html#ab07413c67d205e406abf3a9f554d59e1", null ], - [ "operator&=", "db/d9a/classuint128__t.html#a26a54600c1abdd30624bb8dac1bfc1ce", null ], - [ "operator&=", "db/d9a/classuint128__t.html#a57fb828b2844d633d3eb5c85ed69642e", null ], + [ "operator&=", "db/d9a/classuint128__t.html#a225146042c6456a3c5595645870ca640", null ], + [ "operator&=", "db/d9a/classuint128__t.html#ac7d55ed3bac01075b9cd11cc59508050", null ], [ "operator()", "db/d9a/classuint128__t.html#af4ce01d81a0369218f7d46567d136733", null ], [ "operator*", "db/d9a/classuint128__t.html#a488e65a14d4c32a096011aa4725cdb30", null ], [ "operator*", "db/d9a/classuint128__t.html#a44e472cf685cac6edc5172eac2e66860", null ], - [ "operator*=", "db/d9a/classuint128__t.html#af41320931969def869da9da5f2d8ce86", null ], - [ "operator*=", "db/d9a/classuint128__t.html#ade8aea54bdccb23966b1ce76afb82792", null ], + [ "operator*=", "db/d9a/classuint128__t.html#a3016b71f92a0c7e090a7c5b6a3935092", null ], + [ "operator*=", "db/d9a/classuint128__t.html#a96fc7c2df4325bb1a0c22b566bcc6295", null ], [ "operator+", "db/d9a/classuint128__t.html#a5133f854a93efe47fd1f0f6a9589856d", null ], [ "operator+", "db/d9a/classuint128__t.html#a0fd125cc2b7702370a4aefa740d57606", null ], - [ "operator++", "db/d9a/classuint128__t.html#a3508c1ef4fac555d6b71baa8856b1b16", null ], + [ "operator++", "db/d9a/classuint128__t.html#ac8d293d20cdf65c48d8d1e0ba7034c8e", null ], [ "operator++", "db/d9a/classuint128__t.html#af71990a1fba93a5528ddb1e6662bffd6", null ], - [ "operator+=", "db/d9a/classuint128__t.html#ae5f249fa10c37953b5b6884ad5cb97b7", null ], - [ "operator+=", "db/d9a/classuint128__t.html#a1431adb28b705ac49f83efe1c03d7899", null ], + [ "operator+=", "db/d9a/classuint128__t.html#a55a3f122c4d982c60c2eb9fc09b9e004", null ], + [ "operator+=", "db/d9a/classuint128__t.html#a9704e6a4d32750461bff663e40e537cb", null ], [ "operator-", "db/d9a/classuint128__t.html#a07945fe010079a35e18812636d5c70c3", null ], [ "operator-", "db/d9a/classuint128__t.html#a6824700c9c732a4200e7493fe7ed0eec", null ], [ "operator-", "db/d9a/classuint128__t.html#a81a568510e6d0b0950133dd9fc37fc0c", null ], - [ "operator--", "db/d9a/classuint128__t.html#aebf705017634dec823ffab7b04f58042", null ], + [ "operator--", "db/d9a/classuint128__t.html#a1d390c6ea5450680dcaff341235f0fed", null ], [ "operator--", "db/d9a/classuint128__t.html#a2ecb71686e1c9ed0267124580c91c414", null ], - [ "operator-=", "db/d9a/classuint128__t.html#a8eb5facc7a3bf93ab26fdd766b43d353", null ], - [ "operator-=", "db/d9a/classuint128__t.html#abe9cd035edb769bf5151b4647da06d11", null ], + [ "operator-=", "db/d9a/classuint128__t.html#a0a4623fae71566dfcf2e742c8c156798", null ], + [ "operator-=", "db/d9a/classuint128__t.html#abea727c69c2acd74ffe21464199d27c8", null ], [ "operator/", "db/d9a/classuint128__t.html#aed49b24b99293ae6b14ac9850f5deb94", null ], [ "operator/", "db/d9a/classuint128__t.html#a3072a7e43da3600c345c81bc80c957ee", null ], - [ "operator/=", "db/d9a/classuint128__t.html#afd6d067b0982cb5170c85618244732cf", null ], - [ "operator/=", "db/d9a/classuint128__t.html#a5dfcc1adafb21f0449e8581730970f7d", null ], + [ "operator/=", "db/d9a/classuint128__t.html#aaacb9fda7adcfee224f1b09124c0438b", null ], + [ "operator/=", "db/d9a/classuint128__t.html#a300ed88fe2054788cc6e0b6a8fdf66db", null ], [ "operator<", "db/d9a/classuint128__t.html#a56f579c802a6cc16f31e43af274453dc", null ], [ "operator<", "db/d9a/classuint128__t.html#ac9a4365fb9ea5e2d2c751258f09168a4", null ], [ "operator<<", "db/d9a/classuint128__t.html#a16e7e1211ba6c27e9a229d97fb0d9190", null ], - [ "operator<<=", "db/d9a/classuint128__t.html#a24d984cacaae7d2d682be960b547176a", null ], + [ "operator<<=", "db/d9a/classuint128__t.html#aa5b93187b1d199071f204b9987d5d16a", null ], [ "operator<=", "db/d9a/classuint128__t.html#a4562c218813c8705bccb25d8786ca77c", null ], [ "operator<=", "db/d9a/classuint128__t.html#a16eb351c1d0ed3b89c771c63808e035a", null ], - [ "operator=", "db/d9a/classuint128__t.html#af5eddcc1c4c1e19fc5bd4341842340f6", null ], - [ "operator=", "db/d9a/classuint128__t.html#afb16ce982ab5ad2863e390a4f56959d0", null ], - [ "operator=", "db/d9a/classuint128__t.html#af97e0bb47e0c4a693d53cf136fb36c0e", null ], - [ "operator=", "db/d9a/classuint128__t.html#af922e0caa4a12cde919f376c4ebd489c", null ], + [ "operator=", "db/d9a/classuint128__t.html#abae08ef3c1d6dc512edd68ca68327f74", null ], + [ "operator=", "db/d9a/classuint128__t.html#ac924cc09bbb919532dc42f1f93f6f544", null ], + [ "operator=", "db/d9a/classuint128__t.html#ab6aa4d14ed52c7c640468c45350da0c5", null ], + [ "operator=", "db/d9a/classuint128__t.html#a3c4a7e775a0820196fc08303bbeed44a", null ], [ "operator==", "db/d9a/classuint128__t.html#a7a95e3accdac1cb38c9767f9550c0896", null ], [ "operator==", "db/d9a/classuint128__t.html#a7b1de5584505c189664d0edd306e979e", null ], [ "operator>", "db/d9a/classuint128__t.html#a82c63f8c18b8d2d255b8b0d373ac7d6e", null ], @@ -66,20 +65,18 @@ var classuint128__t = [ "operator>=", "db/d9a/classuint128__t.html#a334bc710f411f108a0243b24ac73b481", null ], [ "operator>=", "db/d9a/classuint128__t.html#ae7af1bad048942eeabc092d8e0194292", null ], [ "operator>>", "db/d9a/classuint128__t.html#a6f24982de03e0e3d04ac7f8ae30f5848", null ], - [ "operator>>=", "db/d9a/classuint128__t.html#ad6c67329be74fdf38281b23e3cc4b537", null ], + [ "operator>>=", "db/d9a/classuint128__t.html#a0ae5fc0c2bcc9138b32d7582466aa7f9", null ], [ "operator^", "db/d9a/classuint128__t.html#aab88fd72d0370b12e4a257e378b82d37", null ], [ "operator^", "db/d9a/classuint128__t.html#a9487ed06019d846add5dc8874e41eb8b", null ], - [ "operator^=", "db/d9a/classuint128__t.html#a63bce15907cc6f1cd0386e63a940677c", null ], - [ "operator^=", "db/d9a/classuint128__t.html#a97691ca0a018d1c9b347f9008a1c5267", null ], + [ "operator^=", "db/d9a/classuint128__t.html#a44fd2a4a4cc1d13f93ac222db5a46c67", null ], + [ "operator^=", "db/d9a/classuint128__t.html#ae3f0ef8a3f68d9cbd9d99e772f1a947a", null ], [ "operator|", "db/d9a/classuint128__t.html#a3facc74d6d078604fe2c80d0abfd3304", null ], [ "operator|", "db/d9a/classuint128__t.html#a2fda65032d9fdbaf9142a6322654dbdd", null ], - [ "operator|=", "db/d9a/classuint128__t.html#a16f6a627d283757b3620d098576b6f0e", null ], - [ "operator|=", "db/d9a/classuint128__t.html#a4c3a955f98a973d1e0c8cc2a68c4c1cb", null ], + [ "operator|=", "db/d9a/classuint128__t.html#a6110aa452a6d114fcd2f42d2bc106fee", null ], + [ "operator|=", "db/d9a/classuint128__t.html#ab88330f3c4f3bcde75dc5ef9eb8eb39d", null ], [ "operator||", "db/d9a/classuint128__t.html#a817b66c32268cf46244058a50db99503", null ], [ "operator||", "db/d9a/classuint128__t.html#a312509b1c5b3ae5eaaf342f2ba131d03", null ], [ "operator~", "db/d9a/classuint128__t.html#a43eafd4824666b413befe5edbc90ae7f", null ], [ "upper", "db/d9a/classuint128__t.html#a1ee2f1ffbd9984faad34883eb45e9705", null ], - [ "operator<<", "db/d9a/classuint128__t.html#a4e02c2c3a6df546d0ec8ceb0ecdc56a6", null ], - [ "f", "db/d9a/classuint128__t.html#ad567aa737bcaf2a21f93658f6162f8e4", null ], - [ "s", "db/d9a/classuint128__t.html#aefd58689b18b82b29dd191cfb713496d", null ] + [ "operator<<", "db/d9a/classuint128__t.html#a5f2ace9fdcd459f74f8e43ef30a2a953", null ] ]; \ No newline at end of file diff --git a/db/d9a/classuint128__t_a0b6612186d8f678452e011d08ee1f5ac_cgraph.svg b/db/d9a/classuint128__t_a0b6612186d8f678452e011d08ee1f5ac_cgraph.svg index b3433c0e7..33f884aba 100644 --- a/db/d9a/classuint128__t_a0b6612186d8f678452e011d08ee1f5ac_cgraph.svg +++ b/db/d9a/classuint128__t_a0b6612186d8f678452e011d08ee1f5ac_cgraph.svg @@ -1,7 +1,7 @@ - - + diff --git a/db/d9a/classuint128__t_a279209a184db20a7ffc8e687fdb05be2_cgraph.md5 b/db/d9a/classuint128__t_a279209a184db20a7ffc8e687fdb05be2_cgraph.md5 new file mode 100644 index 000000000..eaa7ac122 --- /dev/null +++ b/db/d9a/classuint128__t_a279209a184db20a7ffc8e687fdb05be2_cgraph.md5 @@ -0,0 +1 @@ +6597a97cbb833da691520081670564e9 \ No newline at end of file diff --git a/db/d9a/classuint128__t_a59e50792c542a57392f9edd99b567845_cgraph.svg b/db/d9a/classuint128__t_a279209a184db20a7ffc8e687fdb05be2_cgraph.svg similarity index 95% rename from db/d9a/classuint128__t_a59e50792c542a57392f9edd99b567845_cgraph.svg rename to db/d9a/classuint128__t_a279209a184db20a7ffc8e687fdb05be2_cgraph.svg index e9dd71fae..3d436913e 100644 --- a/db/d9a/classuint128__t_a59e50792c542a57392f9edd99b567845_cgraph.svg +++ b/db/d9a/classuint128__t_a279209a184db20a7ffc8e687fdb05be2_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + uint128_t::divide diff --git a/db/d9a/classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.map b/db/d9a/classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.map similarity index 87% rename from db/d9a/classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.map rename to db/d9a/classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.map index 79a8f3982..64f4a4a80 100644 --- a/db/d9a/classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.map +++ b/db/d9a/classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/db/d9a/classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.md5 b/db/d9a/classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.md5 new file mode 100644 index 000000000..12bea6a20 --- /dev/null +++ b/db/d9a/classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.md5 @@ -0,0 +1 @@ +c2435e44656fe943d55cce7a8fe5619a \ No newline at end of file diff --git a/db/d9a/classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.svg b/db/d9a/classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.svg similarity index 95% rename from db/d9a/classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.svg rename to db/d9a/classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.svg index 86087fd70..d90a0d11d 100644 --- a/db/d9a/classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.svg +++ b/db/d9a/classuint128__t_a300ed88fe2054788cc6e0b6a8fdf66db_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + uint128_t::divide diff --git a/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.map b/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.map index b25eba072..e442ce40e 100644 --- a/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.map +++ b/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.md5 b/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.md5 index b502f23f5..5ec485d5f 100644 --- a/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.md5 +++ b/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.md5 @@ -1 +1 @@ -4c33dffe255207f6dc5c9503fe6fcae0 \ No newline at end of file +561cc670cfa5b4dc78e5f311dee1cd25 \ No newline at end of file diff --git a/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.svg b/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.svg index 150254807..b1b1c178d 100644 --- a/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.svg +++ b/db/d9a/classuint128__t_a3072a7e43da3600c345c81bc80c957ee_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + uint128_t::divide diff --git a/db/d9a/classuint128__t_a59e50792c542a57392f9edd99b567845_cgraph.md5 b/db/d9a/classuint128__t_a59e50792c542a57392f9edd99b567845_cgraph.md5 deleted file mode 100644 index 90643656e..000000000 --- a/db/d9a/classuint128__t_a59e50792c542a57392f9edd99b567845_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -858ead6bee94659a728d63ae8d784ffd \ No newline at end of file diff --git a/db/d9a/classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.md5 b/db/d9a/classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.md5 deleted file mode 100644 index 85c313c3c..000000000 --- a/db/d9a/classuint128__t_a5dfcc1adafb21f0449e8581730970f7d_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -4243f635d2a11bec1bae2988dd08ff02 \ No newline at end of file diff --git a/db/d9a/classuint128__t_a857a3c69c1e775a1bd3935c2bfbb02df_cgraph.svg b/db/d9a/classuint128__t_a857a3c69c1e775a1bd3935c2bfbb02df_cgraph.svg index 671617c32..503fb26ab 100644 --- a/db/d9a/classuint128__t_a857a3c69c1e775a1bd3935c2bfbb02df_cgraph.svg +++ b/db/d9a/classuint128__t_a857a3c69c1e775a1bd3935c2bfbb02df_cgraph.svg @@ -1,7 +1,7 @@ - - - - + diff --git a/db/d9a/classuint128__t_abfc6a8765039cacc829a5cd386b5a066_cgraph.md5 b/db/d9a/classuint128__t_abfc6a8765039cacc829a5cd386b5a066_cgraph.md5 index fbb4b9748..018f1c669 100644 --- a/db/d9a/classuint128__t_abfc6a8765039cacc829a5cd386b5a066_cgraph.md5 +++ b/db/d9a/classuint128__t_abfc6a8765039cacc829a5cd386b5a066_cgraph.md5 @@ -1 +1 @@ -8eb3bdfd080123c6582585abd5c0ce44 \ No newline at end of file +ad78d41a135761fe742221a3ad2a61ee \ No newline at end of file diff --git a/db/d9a/classuint128__t_abfc6a8765039cacc829a5cd386b5a066_cgraph.svg b/db/d9a/classuint128__t_abfc6a8765039cacc829a5cd386b5a066_cgraph.svg index f740222a4..582260e7d 100644 --- a/db/d9a/classuint128__t_abfc6a8765039cacc829a5cd386b5a066_cgraph.svg +++ b/db/d9a/classuint128__t_abfc6a8765039cacc829a5cd386b5a066_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + uint128_t::divide diff --git a/db/da8/subset__sum_8cpp__incl.svg b/db/da8/subset__sum_8cpp__incl.svg index 2669204f7..a3b11c944 100644 --- a/db/da8/subset__sum_8cpp__incl.svg +++ b/db/da8/subset__sum_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: queue< Kind > Class Template Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
        @@ -42,21 +41,22 @@
        opostream object
        -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -94,14 +94,13 @@ $(document).ready(function(){initNavTree('db/da9/classqueue.html','../../'); ini Public Member Functions | Private Attributes | List of all members -
        -
        queue< Kind > Class Template Reference
        +
        queue< Kind > Class Template Reference

        #include <queue.h>

        - @@ -120,23 +119,21 @@ Public Member Functions

        +

        Public Member Functions

        void display ()
         
        void clear ()
         
        - -

        +

        Private Attributes

        node< Kind > * queueFront
         
        node< Kind > * queueRear
         
        +
        int size
         

        Detailed Description

        -

        template<class Kind>
        -class queue< Kind >

        - -

        Definition of the queue class

        +
        template<class Kind>
        +class queue< Kind >

        Definition of the queue class

        Constructor & Destructor Documentation

        - +

        ◆ queue()

        @@ -160,18 +157,18 @@ template<class Kind >
        -

        Default constructor

        -
        32  {
        -
        33  queueFront = NULL;
        -
        34  queueRear = NULL;
        -
        35  size = 0;
        -
        36  }
        +

        Default constructor

        +
        32 {
        +
        33 queueFront = NULL;
        +
        34 queueRear = NULL;
        +
        35 size = 0;
        +
        36 }
        node< Kind > * queueFront
        Definition: queue.h:83
        node< Kind > * queueRear
        Definition: queue.h:84
        - +

        ◆ ~queue()

        @@ -195,13 +192,13 @@ template<class Kind >
        -

        Destructor

        -
        39 {}
        +

        Destructor

        +
        39{}

        Member Function Documentation

        - +

        ◆ clear()

        @@ -225,12 +222,12 @@ template<class Kind >
        -

        Clear queue

        -
        80 { queueFront = NULL; }
        +

        Clear queue

        +
        80{ queueFront = NULL; }
        - +

        ◆ deQueue()

        @@ -254,18 +251,18 @@ template<class Kind >
        -

        Remove the top element of the queue

        -
        67  {
        -
        68  node<Kind> *temp;
        -
        69  if (!isEmptyQueue()) {
        -
        70  temp = queueFront;
        -
        71  queueFront = queueFront->next;
        -
        72  delete temp;
        -
        73  size--;
        -
        74  } else {
        -
        75  std::cout << "Queue is empty !" << std::endl;
        -
        76  }
        -
        77  }
        +

        Remove the top element of the queue

        +
        67 {
        +
        68 node<Kind> *temp;
        +
        69 if (!isEmptyQueue()) {
        +
        70 temp = queueFront;
        +
        71 queueFront = queueFront->next;
        +
        72 delete temp;
        +
        73 size--;
        +
        74 } else {
        +
        75 std::cout << "Queue is empty !" << std::endl;
        +
        76 }
        +
        77 }
        bool isEmptyQueue()
        Definition: queue.h:42
        T endl(T... args)
        @@ -279,7 +276,7 @@ Here is the call graph for this function:
        - +

        ◆ display()

        @@ -303,17 +300,17 @@ template<class Kind >
        -

        Show queue

        -
        20  {
        -
        21  node<Kind> *current = queueFront;
        -
        22  std::cout << "Front --> ";
        -
        23  while (current != NULL) {
        -
        24  std::cout << current->data << " ";
        -
        25  current = current->next;
        -
        26  }
        - -
        28  std::cout << "Size of queue: " << size << std::endl;
        -
        29  }
        +

        Show queue

        +
        20 {
        +
        21 node<Kind> *current = queueFront;
        +
        22 std::cout << "Front --> ";
        +
        23 while (current != NULL) {
        +
        24 std::cout << current->data << " ";
        +
        25 current = current->next;
        +
        26 }
        + +
        28 std::cout << "Size of queue: " << size << std::endl;
        +
        29 }
        Here is the call graph for this function:
        @@ -323,7 +320,7 @@ Here is the call graph for this function:
        - +

        ◆ enQueue()

        @@ -348,25 +345,25 @@ template<class Kind >
        -

        Add new item to the queue

        -
        45  {
        -
        46  node<Kind> *newNode;
        -
        47  newNode = new node<Kind>;
        -
        48  newNode->data = item;
        -
        49  newNode->next = NULL;
        -
        50  if (queueFront == NULL) {
        -
        51  queueFront = newNode;
        -
        52  queueRear = newNode;
        -
        53  } else {
        -
        54  queueRear->next = newNode;
        -
        55  queueRear = queueRear->next;
        -
        56  }
        -
        57  size++;
        -
        58  }
        +

        Add new item to the queue

        +
        45 {
        +
        46 node<Kind> *newNode;
        +
        47 newNode = new node<Kind>;
        +
        48 newNode->data = item;
        +
        49 newNode->next = NULL;
        +
        50 if (queueFront == NULL) {
        +
        51 queueFront = newNode;
        +
        52 queueRear = newNode;
        +
        53 } else {
        +
        54 queueRear->next = newNode;
        +
        55 queueRear = queueRear->next;
        +
        56 }
        +
        57 size++;
        +
        58 }
        - +

        ◆ front()

        @@ -390,15 +387,15 @@ template<class Kind >
        -

        Return the first element of the queue

        -
        61  {
        -
        62  assert(queueFront != NULL);
        -
        63  return queueFront->data;
        -
        64  }
        +

        Return the first element of the queue

        +
        61 {
        +
        62 assert(queueFront != NULL);
        +
        63 return queueFront->data;
        +
        64 }
        - +

        ◆ isEmptyQueue()

        @@ -422,13 +419,13 @@ template<class Kind >
        -

        Determine whether the queue is empty

        -
        42 { return (queueFront == NULL); }
        +

        Determine whether the queue is empty

        +
        42{ return (queueFront == NULL); }

        Member Data Documentation

        - +

        ◆ queueFront

        @@ -449,11 +446,11 @@ template<class Kind >
        -

        Pointer to the front of the queue

        +

        Pointer to the front of the queue

        - +

        ◆ queueRear

        @@ -474,7 +471,7 @@ template<class Kind >
        -

        Pointer to the rear of the queue
        +

        Pointer to the rear of the queue

        @@ -488,7 +485,7 @@ template<class Kind > diff --git a/db/da9/classqueue.js b/db/da9/classqueue.js index 543bc04e3..b172d5207 100644 --- a/db/da9/classqueue.js +++ b/db/da9/classqueue.js @@ -9,6 +9,5 @@ var classqueue = [ "front", "db/da9/classqueue.html#a36d47fdbedc199609818385110d9f922", null ], [ "isEmptyQueue", "db/da9/classqueue.html#ac2fff88dce4d7d2eb7134af382bd1b31", null ], [ "queueFront", "db/da9/classqueue.html#ac16ccadebb765e1ddbe415cdce1a17a5", null ], - [ "queueRear", "db/da9/classqueue.html#ae2a7a36270f5d15218a180fa59e5b3a5", null ], - [ "size", "db/da9/classqueue.html#ab45a4bfef7eba256a9c027bae86fc196", null ] + [ "queueRear", "db/da9/classqueue.html#ae2a7a36270f5d15218a180fa59e5b3a5", null ] ]; \ No newline at end of file diff --git a/db/da9/classqueue_a089d4af5532e0a801f560070da6e1f86_cgraph.svg b/db/da9/classqueue_a089d4af5532e0a801f560070da6e1f86_cgraph.svg index 7e8c78afc..f8ebe3c1a 100644 --- a/db/da9/classqueue_a089d4af5532e0a801f560070da6e1f86_cgraph.svg +++ b/db/da9/classqueue_a089d4af5532e0a801f560070da6e1f86_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: data_structures/tree_234.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
        -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -94,8 +94,7 @@ $(document).ready(function(){initNavTree('db/dbc/tree__234_8cpp.html','../../'); Classes | Namespaces | Functions -
        -
        tree_234.cpp File Reference
        +
        tree_234.cpp File Reference
        @@ -115,7 +114,7 @@ Include dependency graph for tree_234.cpp:
        - @@ -124,20 +123,19 @@ Classes

        +

        Classes

        class  data_structures::tree_234::Node
         2-3-4 tree node class More...
         2-3-4 tree class More...
         
        - - + - - + +

        +

        Namespaces

         data_structures
        namespace  data_structures
         Data Structures algorithms.
         
         tree_234
         Functions for 2–3–4 tree
        namespace  tree_234
         Functions for 2–3–4 tree
         
        - - - + + @@ -147,10 +145,10 @@ static void 

        +

        Functions

        -static void test1 ()
         simple test to insert a given array and delete some item, and print the tree
        static void test1 ()
         simple test to insert a given array and delete some item, and print the tree More...
         
        static void test2 (int64_t n)
         simple test to insert continuous number of range [0, n), and print the tree More...
         

        Detailed Description

        -

        A demo 2-3-4 tree implementation.

        -

        2–3–4 tree is a self-balancing data structure that is an isometry of red–black trees. Though we seldom use them in practice, we study them to understand the theory behind Red-Black tree. Please read following links for more infomation. 2–3–4 tree 2-3-4 Trees: A Visual Introduction We Only implement some basic and complicated operations in this demo. Other operations should be easy to be added.

        Author
        liuhuan
        +

        A demo 2-3-4 tree implementation.

        +

        2–3–4 tree is a self-balancing data structure that is an isometry of red–black trees. Though we seldom use them in practice, we study them to understand the theory behind Red-Black tree. Please read following links for more infomation. 2–3–4 tree 2-3-4 Trees: A Visual Introduction We Only implement some basic and complicated operations in this demo. Other operations should be easy to be added.

        Author
        liuhuan

        Function Documentation

        - +

        ◆ main()

        @@ -185,15 +183,15 @@ static void 
        Returns
        0 on exit
        -
        1298  {
        -
        1299  if (argc < 2) {
        -
        1300  test1(); // execute 1st test
        -
        1301  } else {
        -
        1302  test2(std::stoi(argv[1])); // execute 2nd test
        -
        1303  }
        -
        1304 
        -
        1305  return 0;
        -
        1306 }
        +
        1298 {
        +
        1299 if (argc < 2) {
        +
        1300 test1(); // execute 1st test
        +
        1301 } else {
        +
        1302 test2(std::stoi(argv[1])); // execute 2nd test
        +
        1303 }
        +
        1304
        +
        1305 return 0;
        +
        1306}
        T stoi(T... args)
        static void test1()
        simple test to insert a given array and delete some item, and print the tree
        Definition: tree_234.cpp:1263
        static void test2(int64_t n)
        simple test to insert continuous number of range [0, n), and print the tree
        Definition: tree_234.cpp:1281
        @@ -206,7 +204,57 @@ Here is the call graph for this function:
        - + +

        ◆ test1()

        + +
        +
        + + + + + +
        + + + + + + + +
        static void test1 ()
        +
        +static
        +
        + +

        simple test to insert a given array and delete some item, and print the tree

        +
        1263 {
        +
        1264 std::array<int16_t, 13> arr = {3, 1, 5, 4, 2, 9, 10, 8, 7, 6, 16, 13, 14};
        + +
        1266
        +
        1267 for (auto i : arr) {
        +
        1268 tree.Insert(i);
        +
        1269 }
        +
        1270
        +
        1271 // tree.Remove(10);
        +
        1272 tree.Remove(5);
        +
        1273 tree.Print();
        +
        1274}
        + +
        2-3-4 tree class
        Definition: tree_234.cpp:323
        +
        void Print(const char *file_name=nullptr)
        Print tree into a dot file.
        Definition: tree_234.cpp:1131
        +
        bool Remove(int64_t item)
        Remove item from tree.
        Definition: tree_234.cpp:929
        +
        void Insert(int64_t item)
        Insert item to tree.
        Definition: tree_234.cpp:655
        +
        +Here is the call graph for this function:
        +
        +
        +
        +
        + +
        +
        +

        ◆ test2()

        @@ -237,25 +285,22 @@ Here is the call graph for this function:
        -
        1281  {
        - -
        1283 
        -
        1284  for (int64_t i = 0; i < n; i++) {
        -
        1285  tree.Insert(i);
        -
        1286  }
        -
        1287 
        -
        1288  tree.Traverse();
        -
        1289  tree.Print((std::to_string(n) + ".dot").c_str());
        -
        1290 }
        -
        2-3-4 tree class
        Definition: tree_234.cpp:323
        -
        void Print(const char *file_name=nullptr)
        Print tree into a dot file.
        Definition: tree_234.cpp:1131
        -
        void Insert(int64_t item)
        Insert item to tree.
        Definition: tree_234.cpp:655
        +
        1281 {
        + +
        1283
        +
        1284 for (int64_t i = 0; i < n; i++) {
        +
        1285 tree.Insert(i);
        +
        1286 }
        +
        1287
        +
        1288 tree.Traverse();
        +
        1289 tree.Print((std::to_string(n) + ".dot").c_str());
        +
        1290}
        void Traverse()
        In-order traverse.
        Definition: tree_234.cpp:562
        T to_string(T... args)
        Here is the call graph for this function:
        -
        +
        @@ -267,7 +312,7 @@ Here is the call graph for this function:
        diff --git a/db/dbc/tree__234_8cpp.js b/db/dbc/tree__234_8cpp.js index 02d33a20a..02ed40340 100644 --- a/db/dbc/tree__234_8cpp.js +++ b/db/dbc/tree__234_8cpp.js @@ -1,7 +1,7 @@ var tree__234_8cpp = [ - [ "Node", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html", "dd/d40/classdata__structures_1_1tree__234_1_1_node" ], - [ "Tree234", "d3/d95/classdata__structures_1_1tree__234_1_1_tree234.html", "d3/d95/classdata__structures_1_1tree__234_1_1_tree234" ], + [ "data_structures::tree_234::Node", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html", "dd/d40/classdata__structures_1_1tree__234_1_1_node" ], + [ "data_structures::tree_234::Tree234", "d3/d95/classdata__structures_1_1tree__234_1_1_tree234.html", "d3/d95/classdata__structures_1_1tree__234_1_1_tree234" ], [ "main", "db/dbc/tree__234_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ], [ "test1", "db/dbc/tree__234_8cpp.html#ae7880ce913f3058a35ff106d5be9e243", null ], [ "test2", "db/dbc/tree__234_8cpp.html#af1ac73779b0fcfbbdce3976c0ca57342", null ] diff --git a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map index 42180378a..0c28857ee 100644 --- a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map +++ b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -1,11 +1,11 @@ - - - - - - - + + + + + + + @@ -22,9 +22,9 @@ - - + + - + diff --git a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 index 4a008dd18..60a791ed5 100644 --- a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 +++ b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -1 +1 @@ -a65bd9b6649de600f3e0700785918a19 \ No newline at end of file +4bedd8a6f45471523de6bef1ba2cac34 \ No newline at end of file diff --git a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg index f3bf1b879..24929ef0e 100644 --- a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg +++ b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -1,7 +1,7 @@ - @@ -59,8 +59,8 @@ var sectionId = 'dynsection-1'; Node1 - -main + +main @@ -68,94 +68,94 @@ var sectionId = 'dynsection-1'; Node2 - -std::stoi + +std::stoi Node1->Node2 - - + + Node3 - -test1 + +test1 Node1->Node3 - - + + Node26 - -test2 + +test2 Node1->Node26 - - + + Node4 - -data_structures::tree -_234::Tree234::Insert + +data_structures::tree +_234::Tree234::Insert Node3->Node4 - - + + Node6 - -data_structures::tree -_234::Tree234::Print + +data_structures::tree +_234::Tree234::Print Node3->Node6 - - + + Node11 - -data_structures::tree -_234::Tree234::Remove + +data_structures::tree +_234::Tree234::Remove Node3->Node11 - - + + @@ -170,8 +170,8 @@ var sectionId = 'dynsection-1'; Node4->Node5 - - + + @@ -185,8 +185,8 @@ var sectionId = 'dynsection-1'; Node6->Node7 - - + + @@ -200,8 +200,8 @@ var sectionId = 'dynsection-1'; Node6->Node8 - - + + @@ -215,8 +215,8 @@ var sectionId = 'dynsection-1'; Node6->Node9 - - + + @@ -231,8 +231,8 @@ var sectionId = 'dynsection-1'; Node6->Node10 - - + + @@ -247,8 +247,8 @@ var sectionId = 'dynsection-1'; Node11->Node12 - - + + @@ -413,7 +413,7 @@ var sectionId = 'dynsection-1'; Node15 - + data_structures::tree _234::Node::GetRightmostChild @@ -429,7 +429,7 @@ var sectionId = 'dynsection-1'; Node17 - + data_structures::tree _234::Node::GetLeftmostChild @@ -461,29 +461,29 @@ var sectionId = 'dynsection-1'; Node26->Node4 - - + + Node26->Node6 - - + + Node27 - -std::to_string + +std::to_string Node26->Node27 - - + + @@ -498,8 +498,8 @@ var sectionId = 'dynsection-1'; Node26->Node28 - - + + @@ -507,6 +507,12 @@ var sectionId = 'dynsection-1'; + + +Node28->Node28 + + + diff --git a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg index df45b3e0c..4bf8eb14b 100644 --- a/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg +++ b/db/dbc/tree__234_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg @@ -1,7 +1,7 @@ - Node1 - -main + +main @@ -22,94 +22,94 @@ Node2 - -std::stoi + +std::stoi Node1->Node2 - - + + Node3 - -test1 + +test1 Node1->Node3 - - + + Node26 - -test2 + +test2 Node1->Node26 - - + + Node4 - -data_structures::tree -_234::Tree234::Insert + +data_structures::tree +_234::Tree234::Insert Node3->Node4 - - + + Node6 - -data_structures::tree -_234::Tree234::Print + +data_structures::tree +_234::Tree234::Print Node3->Node6 - - + + Node11 - -data_structures::tree -_234::Tree234::Remove + +data_structures::tree +_234::Tree234::Remove Node3->Node11 - - + + @@ -124,8 +124,8 @@ Node4->Node5 - - + + @@ -139,8 +139,8 @@ Node6->Node7 - - + + @@ -154,8 +154,8 @@ Node6->Node8 - - + + @@ -169,8 +169,8 @@ Node6->Node9 - - + + @@ -185,8 +185,8 @@ Node6->Node10 - - + + @@ -201,8 +201,8 @@ Node11->Node12 - - + + @@ -367,7 +367,7 @@ Node15 - + data_structures::tree _234::Node::GetRightmostChild @@ -383,7 +383,7 @@ Node17 - + data_structures::tree _234::Node::GetLeftmostChild @@ -415,29 +415,29 @@ Node26->Node4 - - + + Node26->Node6 - - + + Node27 - -std::to_string + +std::to_string Node26->Node27 - - + + @@ -452,8 +452,8 @@ Node26->Node28 - - + + @@ -461,5 +461,11 @@ + + +Node28->Node28 + + + diff --git a/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.map b/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.map new file mode 100644 index 000000000..01b1f6f24 --- /dev/null +++ b/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.map @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 b/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 new file mode 100644 index 000000000..5096ca9f1 --- /dev/null +++ b/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 @@ -0,0 +1 @@ +118c37d7763028521e7a0ce1e4aaa256 \ No newline at end of file diff --git a/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg b/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg new file mode 100644 index 000000000..b90928105 --- /dev/null +++ b/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test1 + + + +Node1 + + +test1 + + + + + +Node2 + + +data_structures::tree +_234::Tree234::Insert + + + + + +Node1->Node2 + + + + + +Node4 + + +data_structures::tree +_234::Tree234::Print + + + + + +Node1->Node4 + + + + + +Node9 + + +data_structures::tree +_234::Tree234::Remove + + + + + +Node1->Node9 + + + + + +Node3 + + +data_structures::tree +_234::Tree234::InsertPreSplit + + + + + +Node2->Node3 + + + + + +Node5 + + +std::ofstream::close + + + + + +Node4->Node5 + + + + + +Node6 + + +std::endl + + + + + +Node4->Node6 + + + + + +Node7 + + +std::ofstream::open + + + + + +Node4->Node7 + + + + + +Node8 + + +data_structures::tree +_234::Tree234::PrintNode + + + + + +Node4->Node8 + + + + + +Node10 + + +data_structures::tree +_234::Tree234::RemovePreMerge + + + + + +Node9->Node10 + + + + + +Node11 + + +data_structures::tree +_234::Tree234::GetTreeMaxItem + + + + + +Node10->Node11 + + + + + +Node14 + + +data_structures::tree +_234::Tree234::GetTreeMinItem + + + + + +Node10->Node14 + + + + + +Node17 + + +data_structures::tree +_234::Node::Is2Node + + + + + +Node10->Node17 + + + + + +Node18 + + +data_structures::tree +_234::Node::Is34Node + + + + + +Node10->Node18 + + + + + +Node19 + + +data_structures::tree +_234::Tree234::LeftRotate + + + + + +Node10->Node19 + + + + + +Node20 + + +data_structures::tree +_234::Tree234::Merge + + + + + +Node10->Node20 + + + + + +Node21 + + +data_structures::tree +_234::Tree234::RightRotate + + + + + +Node10->Node21 + + + + + +Node22 + + +data_structures::tree +_234::Tree234::TryLeftRotate + + + + + +Node10->Node22 + + + + + +Node23 + + +data_structures::tree +_234::Tree234::TryRightRotate + + + + + +Node10->Node23 + + + + + +Node12 + + +data_structures::tree +_234::Node::GetMaxItem + + + + + +Node11->Node12 + + + + + +Node13 + + +data_structures::tree +_234::Node::GetRightmostChild + + + + + +Node11->Node13 + + + + + +Node15 + + +data_structures::tree +_234::Node::GetLeftmostChild + + + + + +Node14->Node15 + + + + + +Node16 + + +data_structures::tree +_234::Node::GetMinItem + + + + + +Node14->Node16 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph_org.svg b/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph_org.svg new file mode 100644 index 000000000..d24f759a0 --- /dev/null +++ b/db/dbc/tree__234_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph_org.svg @@ -0,0 +1,371 @@ + + + + + + +test1 + + + +Node1 + + +test1 + + + + + +Node2 + + +data_structures::tree +_234::Tree234::Insert + + + + + +Node1->Node2 + + + + + +Node4 + + +data_structures::tree +_234::Tree234::Print + + + + + +Node1->Node4 + + + + + +Node9 + + +data_structures::tree +_234::Tree234::Remove + + + + + +Node1->Node9 + + + + + +Node3 + + +data_structures::tree +_234::Tree234::InsertPreSplit + + + + + +Node2->Node3 + + + + + +Node5 + + +std::ofstream::close + + + + + +Node4->Node5 + + + + + +Node6 + + +std::endl + + + + + +Node4->Node6 + + + + + +Node7 + + +std::ofstream::open + + + + + +Node4->Node7 + + + + + +Node8 + + +data_structures::tree +_234::Tree234::PrintNode + + + + + +Node4->Node8 + + + + + +Node10 + + +data_structures::tree +_234::Tree234::RemovePreMerge + + + + + +Node9->Node10 + + + + + +Node11 + + +data_structures::tree +_234::Tree234::GetTreeMaxItem + + + + + +Node10->Node11 + + + + + +Node14 + + +data_structures::tree +_234::Tree234::GetTreeMinItem + + + + + +Node10->Node14 + + + + + +Node17 + + +data_structures::tree +_234::Node::Is2Node + + + + + +Node10->Node17 + + + + + +Node18 + + +data_structures::tree +_234::Node::Is34Node + + + + + +Node10->Node18 + + + + + +Node19 + + +data_structures::tree +_234::Tree234::LeftRotate + + + + + +Node10->Node19 + + + + + +Node20 + + +data_structures::tree +_234::Tree234::Merge + + + + + +Node10->Node20 + + + + + +Node21 + + +data_structures::tree +_234::Tree234::RightRotate + + + + + +Node10->Node21 + + + + + +Node22 + + +data_structures::tree +_234::Tree234::TryLeftRotate + + + + + +Node10->Node22 + + + + + +Node23 + + +data_structures::tree +_234::Tree234::TryRightRotate + + + + + +Node10->Node23 + + + + + +Node12 + + +data_structures::tree +_234::Node::GetMaxItem + + + + + +Node11->Node12 + + + + + +Node13 + + +data_structures::tree +_234::Node::GetRightmostChild + + + + + +Node11->Node13 + + + + + +Node15 + + +data_structures::tree +_234::Node::GetLeftmostChild + + + + + +Node14->Node15 + + + + + +Node16 + + +data_structures::tree +_234::Node::GetMinItem + + + + + +Node14->Node16 + + + + + diff --git a/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.map b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.map index 13b032520..79171e9f1 100644 --- a/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.map +++ b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.map @@ -1,12 +1,12 @@ - - - - - + + + + + - + diff --git a/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.md5 b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.md5 index 03c461a6d..d835aaf65 100644 --- a/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.md5 +++ b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.md5 @@ -1 +1 @@ -eb7c8d7c530a2ebbf532ae98502f7615 \ No newline at end of file +d6cf29a188d8d73c7e1e2e9df3f69ec5 \ No newline at end of file diff --git a/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.svg b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.svg index 5688f2c16..ba4a35097 100644 --- a/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.svg +++ b/db/dbc/tree__234_8cpp_af1ac73779b0fcfbbdce3976c0ca57342_cgraph.svg @@ -1,20 +1,20 @@ - - - + + test2 - + Node1 - -test2 + +test2 @@ -22,48 +22,48 @@ Node2 - -data_structures::tree -_234::Tree234::Insert + +data_structures::tree +_234::Tree234::Insert Node1->Node2 - - + + Node4 - -data_structures::tree -_234::Tree234::Print + +data_structures::tree +_234::Tree234::Print Node1->Node4 - - + + Node9 - -std::to_string + +std::to_string Node1->Node9 - - + + @@ -78,91 +78,97 @@ Node1->Node10 - - + + Node3 - -data_structures::tree -_234::Tree234::InsertPreSplit + +data_structures::tree +_234::Tree234::InsertPreSplit Node2->Node3 - - + + Node5 - -std::ofstream::close + +std::ofstream::close Node4->Node5 - - + + Node6 - -std::endl + +std::endl Node4->Node6 - - + + Node7 - -std::ofstream::open + +std::ofstream::open Node4->Node7 - - + + Node8 - -data_structures::tree -_234::Tree234::PrintNode + +data_structures::tree +_234::Tree234::PrintNode Node4->Node8 - - + + Node10->Node6 - - + + + + + +Node10->Node10 + + diff --git a/db/dc0/namespacebacktracking.html b/db/dc0/namespacebacktracking.html index f415b9dbc..7017f2d61 100644 --- a/db/dc0/namespacebacktracking.html +++ b/db/dc0/namespacebacktracking.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: backtracking Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
        -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,15 +92,14 @@ $(document).ready(function(){initNavTree('db/dc0/namespacebacktracking.html','..
        -
        -
        backtracking Namespace Reference
        +
        backtracking Namespace Reference

        Backtracking algorithms. More...

        - @@ -131,16 +130,16 @@ Functions

        +

        Functions

        template<size_t V>
        void printSolution (const std::array< int, V > &color)
         

        Detailed Description

        -

        Backtracking algorithms.

        -

        for std::vector

        -

        for std::count for assert for IO operations for std::list for std::accumulate

        -

        Backtracking algorithms

        -

        for assert for IO operations for unordered_map

        -

        Backtracking algorithms

        -

        for assert for IO operations

        -

        Backtracking algorithms

        +

        Backtracking algorithms.

        +

        for std::vector

        +

        for std::count for assert for IO operations for std::list for std::accumulate

        +

        Backtracking algorithms

        +

        for assert for IO operations for unordered_map

        +

        Backtracking algorithms

        +

        for assert for IO operations

        +

        Backtracking algorithms

        Function Documentation

        - +

        ◆ graphColoring()

        @@ -179,7 +178,7 @@ template<size_t V>
        -

        A recursive utility function to solve m coloring problem

        Template Parameters
        +

        A recursive utility function to solve m coloring problem

        Template Parameters
        Vnumber of vertices in the graph
        @@ -194,33 +193,33 @@ template<size_t V>
        -
        73  {
        -
        74  // base case:
        -
        75  // If all vertices are assigned a color then return true
        -
        76  if (v == V) {
        -
        77  backtracking::printSolution<V>(color);
        -
        78  return;
        -
        79  }
        -
        80 
        -
        81  // Consider this vertex v and try different colors
        -
        82  for (int c = 1; c <= m; c++) {
        -
        83  // Check if assignment of color c to v is fine
        -
        84  if (backtracking::isSafe<V>(v, graph, color, c)) {
        -
        85  color[v] = c;
        -
        86 
        -
        87  // recur to assign colors to rest of the vertices
        -
        88  backtracking::graphColoring<V>(graph, m, color, v + 1);
        -
        89 
        -
        90  // If assigning color c doesn't lead to a solution then remove it
        -
        91  color[v] = 0;
        -
        92  }
        -
        93  }
        -
        94 }
        +
        73 {
        +
        74 // base case:
        +
        75 // If all vertices are assigned a color then return true
        +
        76 if (v == V) {
        +
        77 backtracking::printSolution<V>(color);
        +
        78 return;
        +
        79 }
        +
        80
        +
        81 // Consider this vertex v and try different colors
        +
        82 for (int c = 1; c <= m; c++) {
        +
        83 // Check if assignment of color c to v is fine
        +
        84 if (backtracking::isSafe<V>(v, graph, color, c)) {
        +
        85 color[v] = c;
        +
        86
        +
        87 // recur to assign colors to rest of the vertices
        +
        88 backtracking::graphColoring<V>(graph, m, color, v + 1);
        +
        89
        +
        90 // If assigning color c doesn't lead to a solution then remove it
        +
        91 color[v] = 0;
        +
        92 }
        +
        93 }
        +
        94}
        Graph Algorithms.
        - +

        ◆ isPossible()

        @@ -265,7 +264,7 @@ template<size_t V>
        -

        Checks if it's possible to place a number 'no'

        Template Parameters
        +

        Checks if it's possible to place a number 'no'

        Template Parameters
        Vnumber of vertices in the array
        @@ -284,34 +283,34 @@ template<size_t V>
        Returns
        true if 'mat' is different from 'no'
        false if 'mat' equals to 'no'
        -

        'no' shouldn't be present in either row i or column j

        -

        'no' shouldn't be present in the 3*3 subgrid

        -
        36  {
        -
        37  /// 'no' shouldn't be present in either row i or column j
        -
        38  for (int x = 0; x < n; x++) {
        -
        39  if (mat[x][j] == no || mat[i][x] == no) {
        -
        40  return false;
        -
        41  }
        -
        42  }
        -
        43 
        -
        44  /// 'no' shouldn't be present in the 3*3 subgrid
        -
        45  int sx = (i / 3) * 3;
        -
        46  int sy = (j / 3) * 3;
        -
        47 
        -
        48  for (int x = sx; x < sx + 3; x++) {
        -
        49  for (int y = sy; y < sy + 3; y++) {
        -
        50  if (mat[x][y] == no) {
        -
        51  return false;
        -
        52  }
        -
        53  }
        -
        54  }
        -
        55 
        -
        56  return true;
        -
        57  }
        +

        'no' shouldn't be present in either row i or column j

        +

        'no' shouldn't be present in the 3*3 subgrid

        +
        36 {
        +
        37 /// 'no' shouldn't be present in either row i or column j
        +
        38 for (int x = 0; x < n; x++) {
        +
        39 if (mat[x][j] == no || mat[i][x] == no) {
        +
        40 return false;
        +
        41 }
        +
        42 }
        +
        43
        +
        44 /// 'no' shouldn't be present in the 3*3 subgrid
        +
        45 int sx = (i / 3) * 3;
        +
        46 int sy = (j / 3) * 3;
        +
        47
        +
        48 for (int x = sx; x < sx + 3; x++) {
        +
        49 for (int y = sy; y < sy + 3; y++) {
        +
        50 if (mat[x][y] == no) {
        +
        51 return false;
        +
        52 }
        +
        53 }
        +
        54 }
        +
        55
        +
        56 return true;
        +
        57 }
        - +

        ◆ isSafe()

        @@ -350,7 +349,7 @@ template<size_t V>
        -

        A utility function to check if the current color assignment is safe for vertex v

        Template Parameters
        +

        A utility function to check if the current color assignment is safe for vertex v

        Template Parameters
        Vnumber of vertices in the graph
        @@ -368,18 +367,18 @@ template<size_t V>
        Returns
        true if the color is safe to be assigned to the node
        false if the color is not safe to be assigned to the node
        -
        54  {
        -
        55  for (int i = 0; i < V; i++) {
        -
        56  if (graph[v][i] && c == color[i]) {
        -
        57  return false;
        -
        58  }
        -
        59  }
        -
        60  return true;
        -
        61 }
        +
        54 {
        +
        55 for (int i = 0; i < V; i++) {
        +
        56 if (graph[v][i] && c == color[i]) {
        +
        57 return false;
        +
        58 }
        +
        59 }
        +
        60 return true;
        +
        61}
        - +

        ◆ issafe()

        @@ -412,7 +411,7 @@ template<size_t V>
        -

        A utility function to check if i,j are valid indexes for N*N chessboard

        Template Parameters
        +

        A utility function to check if i,j are valid indexes for N*N chessboard

        Template Parameters
        Vnumber of vertices in array
        @@ -429,13 +428,13 @@ template<size_t V>
        Returns
        true if ....
        false if ....
        -
        33  {
        -
        34  return (x < V && x >= 0 && y < V && y >= 0 && sol[x][y] == -1);
        -
        35  }
        +
        33 {
        +
        34 return (x < V && x >= 0 && y < V && y >= 0 && sol[x][y] == -1);
        +
        35 }
        - +

        ◆ minimax()

        @@ -480,7 +479,7 @@ template<size_t T>
        -

        Check which number is the maximum/minimum in the array

        Parameters
        +

        Check which number is the maximum/minimum in the array

        Parameters
        @@ -491,19 +490,18 @@ template<size_t T>
        Returns
        maximum or minimum number
        -
        39  {
        -
        40  if (depth == height) {
        -
        41  return scores[node_index];
        -
        42  }
        -
        43 
        -
        44  int v1 = minimax(depth + 1, node_index * 2, !is_max, scores, height);
        -
        45  int v2 = minimax(depth + 1, node_index * 2 + 1, !is_max, scores, height);
        -
        46 
        -
        47  return is_max ? std::max(v1, v2) : std::min(v1, v2);
        -
        48 }
        +
        39 {
        +
        40 if (depth == height) {
        +
        41 return scores[node_index];
        +
        42 }
        +
        43
        +
        44 int v1 = minimax(depth + 1, node_index * 2, !is_max, scores, height);
        +
        45 int v2 = minimax(depth + 1, node_index * 2 + 1, !is_max, scores, height);
        +
        46
        +
        47 return is_max ? std::max(v1, v2) : std::min(v1, v2);
        +
        48}
        int height(node *root)
        Definition: avltree.cpp:31
        T max(T... args)
        -
        T min(T... args)
        int minimax(int depth, int node_index, bool is_max, const std::array< int, T > &scores, double height)
        Definition: minimax.cpp:38
        STL namespace.
        @@ -515,7 +513,7 @@ Here is the call graph for this function:
        - +

        ◆ printMat()

        @@ -548,7 +546,7 @@ template<size_t V>
        depthcurrent depth in game tree
        node_indexcurrent index in array
        -

        Utility function to print matrix

        Template Parameters
        +

        Utility function to print matrix

        Template Parameters
        Vnumber of vertices in array
        @@ -563,24 +561,24 @@ template<size_t V>
        Returns
        void
        -
        67  {
        -
        68  for (int i = 0; i < n; i++) {
        -
        69  for (int j = 0; j < n; j++) {
        -
        70  if (starting_mat[i][j] != mat[i][j]) {
        -
        71  std::cout << "\033[93m" << mat[i][j] << "\033[0m" << " ";
        -
        72  } else {
        -
        73  std::cout << mat[i][j] << " ";
        -
        74  }
        -
        75  if ((j + 1) % 3 == 0) {
        -
        76  std::cout << '\t';
        -
        77  }
        -
        78  }
        -
        79  if ((i + 1) % 3 == 0) {
        - -
        81  }
        - -
        83  }
        -
        84  }
        +
        67 {
        +
        68 for (int i = 0; i < n; i++) {
        +
        69 for (int j = 0; j < n; j++) {
        +
        70 if (starting_mat[i][j] != mat[i][j]) {
        +
        71 std::cout << "\033[93m" << mat[i][j] << "\033[0m" << " ";
        +
        72 } else {
        +
        73 std::cout << mat[i][j] << " ";
        +
        74 }
        +
        75 if ((j + 1) % 3 == 0) {
        +
        76 std::cout << '\t';
        +
        77 }
        +
        78 }
        +
        79 if ((i + 1) % 3 == 0) {
        + +
        81 }
        + +
        83 }
        +
        84 }
        T endl(T... args)
        @@ -592,7 +590,7 @@ Here is the call graph for this function:
        - +

        ◆ printSolution()

        @@ -609,7 +607,7 @@ template<size_t V>
        -

        A utility function to print solution

        Template Parameters
        +

        A utility function to print solution

        Template Parameters
        Vnumber of vertices in the graph
        @@ -621,13 +619,13 @@ template<size_t V>
        -
        34  {
        -
        35  std::cout << "Following are the assigned colors" << std::endl;
        -
        36  for (auto& col : color) {
        -
        37  std::cout << col;
        -
        38  }
        - -
        40 }
        +
        34 {
        +
        35 std::cout << "Following are the assigned colors" << std::endl;
        +
        36 for (auto& col : color) {
        +
        37 std::cout << col;
        +
        38 }
        + +
        40}
        Here is the call graph for this function:
        @@ -637,7 +635,7 @@ Here is the call graph for this function:
        - +

        ◆ solve()

        @@ -688,7 +686,7 @@ template<size_t V>
        -

        Knight's tour algorithm

        Template Parameters
        +

        Knight's tour algorithm

        Template Parameters
        Vnumber of vertices in array
        @@ -708,30 +706,30 @@ template<size_t V>
        Returns
        true if solution exists
        false if solution does not exist
        -
        51  {
        -
        52  int k, xnext, ynext;
        -
        53 
        -
        54  if (mov == V * V) {
        -
        55  return true;
        -
        56  }
        -
        57 
        -
        58  for (k = 0; k < V; k++) {
        -
        59  xnext = x + xmov[k];
        -
        60  ynext = y + ymov[k];
        -
        61 
        -
        62  if (backtracking::issafe<V>(xnext, ynext, sol)) {
        -
        63  sol[xnext][ynext] = mov;
        -
        64 
        -
        65  if (backtracking::solve<V>(xnext, ynext, mov + 1, sol, xmov, ymov) == true) {
        -
        66  return true;
        -
        67  }
        -
        68  else {
        -
        69  sol[xnext][ynext] = -1;
        -
        70  }
        -
        71  }
        -
        72  }
        -
        73  return false;
        -
        74  }
        +
        51 {
        +
        52 int k, xnext, ynext;
        +
        53
        +
        54 if (mov == V * V) {
        +
        55 return true;
        +
        56 }
        +
        57
        +
        58 for (k = 0; k < V; k++) {
        +
        59 xnext = x + xmov[k];
        +
        60 ynext = y + ymov[k];
        +
        61
        +
        62 if (backtracking::issafe<V>(xnext, ynext, sol)) {
        +
        63 sol[xnext][ynext] = mov;
        +
        64
        +
        65 if (backtracking::solve<V>(xnext, ynext, mov + 1, sol, xmov, ymov) == true) {
        +
        66 return true;
        +
        67 }
        +
        68 else {
        +
        69 sol[xnext][ynext] = -1;
        +
        70 }
        +
        71 }
        +
        72 }
        +
        73 return false;
        +
        74 }
        void mov(tower *From, tower *To)
        Definition: tower_of_hanoi.cpp:39
        Here is the call graph for this function:
        @@ -742,7 +740,7 @@ Here is the call graph for this function:
        - +

        ◆ solveSudoku()

        @@ -781,7 +779,7 @@ template<size_t V>
        -

        Sudoku algorithm

        Template Parameters
        +

        Sudoku algorithm

        Template Parameters
        Vnumber of vertices in array
        @@ -799,49 +797,49 @@ template<size_t V>
        Returns
        true if 'no' was placed
        false if 'no' was not placed
        -

        Base Case

        -

        Solved for 9 rows already

        -

        Crossed the last Cell in the row

        -

        Blue Cell - Skip

        -

        White Cell Try to place every possible no

        -

        Place the 'no' - assuming a solution will exist

        -

        Couldn't find a solution loop will place the next no.

        -

        Solution couldn't be found for any of the numbers provided

        -
        97  {
        -
        98  /// Base Case
        -
        99  if (i == 9) {
        -
        100  /// Solved for 9 rows already
        -
        101  backtracking::printMat<V>(mat, starting_mat, 9);
        -
        102  return true;
        -
        103  }
        -
        104 
        -
        105  /// Crossed the last Cell in the row
        -
        106  if (j == 9) {
        -
        107  return backtracking::solveSudoku<V>(mat, starting_mat, i + 1, 0);
        -
        108  }
        -
        109 
        -
        110  /// Blue Cell - Skip
        -
        111  if (mat[i][j] != 0) {
        -
        112  return backtracking::solveSudoku<V>(mat, starting_mat, i, j + 1);
        -
        113  }
        -
        114  /// White Cell
        -
        115  /// Try to place every possible no
        -
        116  for (int no = 1; no <= 9; no++) {
        -
        117  if (backtracking::isPossible<V>(mat, i, j, no, 9)) {
        -
        118  /// Place the 'no' - assuming a solution will exist
        -
        119  mat[i][j] = no;
        -
        120  bool solution_found = backtracking::solveSudoku<V>(mat, starting_mat, i, j + 1);
        -
        121  if (solution_found) {
        -
        122  return true;
        -
        123  }
        -
        124  /// Couldn't find a solution
        -
        125  /// loop will place the next no.
        -
        126  }
        -
        127  }
        -
        128  /// Solution couldn't be found for any of the numbers provided
        -
        129  mat[i][j] = 0;
        -
        130  return false;
        -
        131  }
        +

        Base Case

        +

        Solved for 9 rows already

        +

        Crossed the last Cell in the row

        +

        Blue Cell - Skip

        +

        White Cell Try to place every possible no

        +

        Place the 'no' - assuming a solution will exist

        +

        Couldn't find a solution loop will place the next no.

        +

        Solution couldn't be found for any of the numbers provided

        +
        97 {
        +
        98 /// Base Case
        +
        99 if (i == 9) {
        +
        100 /// Solved for 9 rows already
        +
        101 backtracking::printMat<V>(mat, starting_mat, 9);
        +
        102 return true;
        +
        103 }
        +
        104
        +
        105 /// Crossed the last Cell in the row
        +
        106 if (j == 9) {
        +
        107 return backtracking::solveSudoku<V>(mat, starting_mat, i + 1, 0);
        +
        108 }
        +
        109
        +
        110 /// Blue Cell - Skip
        +
        111 if (mat[i][j] != 0) {
        +
        112 return backtracking::solveSudoku<V>(mat, starting_mat, i, j + 1);
        +
        113 }
        +
        114 /// White Cell
        +
        115 /// Try to place every possible no
        +
        116 for (int no = 1; no <= 9; no++) {
        +
        117 if (backtracking::isPossible<V>(mat, i, j, no, 9)) {
        +
        118 /// Place the 'no' - assuming a solution will exist
        +
        119 mat[i][j] = no;
        +
        120 bool solution_found = backtracking::solveSudoku<V>(mat, starting_mat, i, j + 1);
        +
        121 if (solution_found) {
        +
        122 return true;
        +
        123 }
        +
        124 /// Couldn't find a solution
        +
        125 /// loop will place the next no.
        +
        126 }
        +
        127 }
        +
        128 /// Solution couldn't be found for any of the numbers provided
        +
        129 mat[i][j] = 0;
        +
        130 return false;
        +
        131 }
        @@ -851,7 +849,7 @@ template<size_t V> diff --git a/db/dc0/namespacebacktracking_a78540bcb5ef3473b2348cbc34748ec50_cgraph.md5 b/db/dc0/namespacebacktracking_a78540bcb5ef3473b2348cbc34748ec50_cgraph.md5 index 060f5cff8..7be097c1e 100644 --- a/db/dc0/namespacebacktracking_a78540bcb5ef3473b2348cbc34748ec50_cgraph.md5 +++ b/db/dc0/namespacebacktracking_a78540bcb5ef3473b2348cbc34748ec50_cgraph.md5 @@ -1 +1 @@ -5c5399e4c33743f7a1baf71fe7f9d8ff \ No newline at end of file +64ee8950ed22a67c715fd9a460d662f0 \ No newline at end of file diff --git a/db/dc0/namespacebacktracking_a78540bcb5ef3473b2348cbc34748ec50_cgraph.svg b/db/dc0/namespacebacktracking_a78540bcb5ef3473b2348cbc34748ec50_cgraph.svg index a4bc1a64d..37fe07fea 100644 --- a/db/dc0/namespacebacktracking_a78540bcb5ef3473b2348cbc34748ec50_cgraph.svg +++ b/db/dc0/namespacebacktracking_a78540bcb5ef3473b2348cbc34748ec50_cgraph.svg @@ -1,7 +1,7 @@ - + + +Node1->Node1 + + + Node2 diff --git a/db/dc0/namespacebacktracking_a8cfb2d08840766ac4402196079308a36_cgraph.svg b/db/dc0/namespacebacktracking_a8cfb2d08840766ac4402196079308a36_cgraph.svg index 10f0f9c51..58fb5009d 100644 --- a/db/dc0/namespacebacktracking_a8cfb2d08840766ac4402196079308a36_cgraph.svg +++ b/db/dc0/namespacebacktracking_a8cfb2d08840766ac4402196079308a36_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - + + Algorithms_in_C++: search/floyd_cycle_detection_algo.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('db/dc4/floyd__cycle__detection__algo_8 -
        -
        floyd_cycle_detection_algo.cpp File Reference
        +
        floyd_cycle_detection_algo.cpp File Reference
        -

        Implementation of Floyd's Cycle Detection algorithm. +

        Implementation of Floyd's Cycle Detection algorithm. More...

        #include <cassert>
        #include <iostream>
        @@ -110,16 +109,16 @@ Include dependency graph for floyd_cycle_detection_algo.cpp:
        - - + - - + +

        +

        Namespaces

         search
        namespace  search
         for std::vector
         
         cycle_detection
         Functions for the Floyd's Cycle Detection algorithm.
        namespace  cycle_detection
         Functions for the Floyd's Cycle Detection algorithm.
         
        - @@ -133,10 +132,10 @@ Functions

        +

        Functions

        template<typename T >
        int32_t search::cycle_detection::duplicateNumber (const std::vector< T > &in_arr, const uint32_t &n)
         

        Detailed Description

        -

        Implementation of Floyd's Cycle Detection algorithm.

        -

        Given an array of integers containing 'n + 1' integers, where each integer is in the range [1, n] inclusive. If there is only one duplicate number in the input array, this algorithm returns the duplicate number in O(1) space and the time complexity is less than O(n^2) without modifying the original array, otherwise, it returns -1.

        Author
        Swastika Gupta
        +

        Implementation of Floyd's Cycle Detection algorithm.

        +

        Given an array of integers containing 'n + 1' integers, where each integer is in the range [1, n] inclusive. If there is only one duplicate number in the input array, this algorithm returns the duplicate number in O(1) space and the time complexity is less than O(n^2) without modifying the original array, otherwise, it returns -1.

        Author
        Swastika Gupta

        Function Documentation

        - +

        ◆ duplicateNumber()

        @@ -179,24 +178,26 @@ template<typename T >
        Returns
        the duplicate number
        -
        37  {
        -
        38  if (n == 0 || n == 1) { // to find duplicate in an array its size should be atleast 2
        -
        39  return -1;
        -
        40  }
        -
        41  uint32_t tortoise = in_arr[0]; // variable tortoise is used for the longer
        -
        42  // jumps in the array
        -
        43  uint32_t hare = in_arr[0]; // variable hare is used for shorter jumps in the array
        -
        44  do {
        -
        45  tortoise = in_arr[tortoise];
        -
        46  hare = in_arr[in_arr[hare]];
        -
        47  } while (tortoise != hare);
        -
        48  tortoise = in_arr[0];
        -
        49  while (tortoise != hare) {
        -
        50  tortoise = in_arr[tortoise];
        -
        51  hare = in_arr[hare];
        -
        52  }
        -
        53  return tortoise;
        -
        54 }
        +
        37 {
        +
        38 if (n == 0 ||
        +
        39 n == 1) { // to find duplicate in an array its size should be atleast 2
        +
        40 return -1;
        +
        41 }
        +
        42 uint32_t tortoise = in_arr[0]; // variable tortoise is used for the longer
        +
        43 // jumps in the array
        +
        44 uint32_t hare =
        +
        45 in_arr[0]; // variable hare is used for shorter jumps in the array
        +
        46 do {
        +
        47 tortoise = in_arr[tortoise];
        +
        48 hare = in_arr[in_arr[hare]];
        +
        49 } while (tortoise != hare);
        +
        50 tortoise = in_arr[0];
        +
        51 while (tortoise != hare) {
        +
        52 tortoise = in_arr[tortoise];
        +
        53 hare = in_arr[hare];
        +
        54 }
        +
        55 return tortoise;
        +
        56}
        Here is the call graph for this function:
        @@ -206,7 +207,7 @@ Here is the call graph for this function:
        - +

        ◆ main()

        @@ -224,11 +225,11 @@ Here is the call graph for this function:

        Main function.

        Returns
        0 on exit
        -
        93  {
        -
        94  test(); // run self-test implementations
        -
        95  return 0;
        -
        96 }
        -
        static void test()
        Self-test implementations.
        Definition: floyd_cycle_detection_algo.cpp:62
        +
        95 {
        +
        96 test(); // run self-test implementations
        +
        97 return 0;
        +
        98}
        +
        static void test()
        Self-test implementations.
        Definition: floyd_cycle_detection_algo.cpp:64
        Here is the call graph for this function:
        @@ -238,7 +239,7 @@ Here is the call graph for this function:
        - +

        ◆ test()

        @@ -263,32 +264,32 @@ Here is the call graph for this function:

        Self-test implementations.

        Returns
        void
        -
        62  {
        -
        63  // 1st test
        -
        64  // [3, 4, 8, 5, 9, 1, 2, 6, 7, 4] return 4
        -
        65  std::vector<uint32_t> array1 = {3, 4, 8, 5, 9, 1, 2, 6, 7, 4};
        -
        66  std::cout << "Test 1... ";
        -
        67  assert(search::cycle_detection::duplicateNumber(array1, array1.size()) ==
        -
        68  4); // here the duplicate number is 4
        -
        69  std::cout << "passed" << std::endl;
        -
        70 
        -
        71  // 2nd test
        -
        72  // [1, 2, 3, 4, 2] return 2
        -
        73  std::vector<uint32_t> array2 = {1, 2, 3, 4, 2};
        -
        74  std::cout << "Test 2... ";
        -
        75  assert(search::cycle_detection::duplicateNumber(array2, array2.size()) ==
        -
        76  2); // here the duplicate number is 2
        -
        77  std::cout << "passed" << std::endl;
        -
        78 
        -
        79  // 3rd test
        -
        80  // [] return -1
        -
        81  std::vector<uint32_t> array3 = {};
        -
        82  std::cout << "Test 3... ";
        -
        83  assert(search::cycle_detection::duplicateNumber(array3, array3.size()) ==
        -
        84  -1); // since the input array is empty no duplicate number exists in
        -
        85  // this case
        -
        86  std::cout << "passed" << std::endl;
        -
        87 }
        +
        64 {
        +
        65 // 1st test
        +
        66 // [3, 4, 8, 5, 9, 1, 2, 6, 7, 4] return 4
        +
        67 std::vector<uint32_t> array1 = {3, 4, 8, 5, 9, 1, 2, 6, 7, 4};
        +
        68 std::cout << "Test 1... ";
        +
        69 assert(search::cycle_detection::duplicateNumber(array1, array1.size()) ==
        +
        70 4); // here the duplicate number is 4
        +
        71 std::cout << "passed" << std::endl;
        +
        72
        +
        73 // 2nd test
        +
        74 // [1, 2, 3, 4, 2] return 2
        +
        75 std::vector<uint32_t> array2 = {1, 2, 3, 4, 2};
        +
        76 std::cout << "Test 2... ";
        +
        77 assert(search::cycle_detection::duplicateNumber(array2, array2.size()) ==
        +
        78 2); // here the duplicate number is 2
        +
        79 std::cout << "passed" << std::endl;
        +
        80
        +
        81 // 3rd test
        +
        82 // [] return -1
        +
        83 std::vector<uint32_t> array3 = {};
        +
        84 std::cout << "Test 3... ";
        +
        85 assert(search::cycle_detection::duplicateNumber(array3, array3.size()) ==
        +
        86 -1); // since the input array is empty no duplicate number exists in
        +
        87 // this case
        +
        88 std::cout << "passed" << std::endl;
        +
        89}
        T endl(T... args)
        T size(T... args)
        @@ -308,7 +309,7 @@ Here is the call graph for this function:
        diff --git a/db/dc4/floyd__cycle__detection__algo_8cpp_a81ffc7a2c6bf530c8a496864e7a3ad88_cgraph.svg b/db/dc4/floyd__cycle__detection__algo_8cpp_a81ffc7a2c6bf530c8a496864e7a3ad88_cgraph.svg index 9174697e2..200b78086 100644 --- a/db/dc4/floyd__cycle__detection__algo_8cpp_a81ffc7a2c6bf530c8a496864e7a3ad88_cgraph.svg +++ b/db/dc4/floyd__cycle__detection__algo_8cpp_a81ffc7a2c6bf530c8a496864e7a3ad88_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: dynamic_programming/kadane2.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('db/dca/kadane2_8cpp.html','../../'); i -
        -
        kadane2.cpp File Reference
        +
        kadane2.cpp File Reference
        -

        Implementation of Kadane Algorithm +

        Implementation of Kadane Algorithm More...

        #include <array>
        #include <climits>
        @@ -110,16 +109,16 @@ Include dependency graph for kadane2.cpp:
        - - + - - + +

        +

        Namespaces

         dynamic_programming
        namespace  dynamic_programming
         Dynamic Programming algorithms.
         
         kadane
         Functions for Kadane algorithm.
        namespace  kadane
         Functions for Kadane algorithm.
         
        - @@ -130,14 +129,14 @@ Functions

        +

        Functions

        template<size_t N>
        int dynamic_programming::kadane::maxSubArray (const std::array< int, N > &n)
         

        Detailed Description

        -

        Implementation of Kadane Algorithm

        -

        Kadane algorithm is used to find the maximum sum subarray in an array and maximum sum subarray problem is the task of finding a contiguous subarray with the largest sum

        +

        Implementation of Kadane Algorithm

        +

        Kadane algorithm is used to find the maximum sum subarray in an array and maximum sum subarray problem is the task of finding a contiguous subarray with the largest sum

        Algorithm

        -

        The simple idea of the algorithm is to search for all positive contiguous segments of the array and keep track of maximum sum contiguous segment among all positive segments(curr_sum is used for this) Each time we get a positive sum we compare it with max_sum and update max_sum if it is greater than curr_sum

        -
        Author
        Ayush Singh
        +

        The simple idea of the algorithm is to search for all positive contiguous segments of the array and keep track of maximum sum contiguous segment among all positive segments(curr_sum is used for this) Each time we get a positive sum we compare it with max_sum and update max_sum if it is greater than curr_sum

        +
        Author
        Ayush Singh

        Function Documentation

        - +

        ◆ main()

        @@ -155,21 +154,21 @@ Algorithm

        Main function.

        Returns
        0 on exit
        -
        60  {
        -
        61  const int N = 5;
        -
        62  std::array<int, N> n{}; // declaring array
        -
        63  // taking values of elements from user
        -
        64  for (int i = 0; i < n.size(); i++) {
        -
        65  std::cout << "Enter value of n[" << i << "]"
        -
        66  << "\n";
        -
        67  std::cin >> n[i];
        -
        68  }
        -
        69  int max_sum = dynamic_programming::kadane::maxSubArray<N>(
        -
        70  n); // calling maxSubArray function
        -
        71  std::cout << "Maximum subarray sum is " << max_sum; // Printing the answer
        -
        72 
        -
        73  return 0;
        -
        74 }
        +
        60 {
        +
        61 const int N = 5;
        +
        62 std::array<int, N> n{}; // declaring array
        +
        63 // taking values of elements from user
        +
        64 for (int i = 0; i < n.size(); i++) {
        +
        65 std::cout << "Enter value of n[" << i << "]"
        +
        66 << "\n";
        +
        67 std::cin >> n[i];
        +
        68 }
        +
        69 int max_sum = dynamic_programming::kadane::maxSubArray<N>(
        +
        70 n); // calling maxSubArray function
        +
        71 std::cout << "Maximum subarray sum is " << max_sum; // Printing the answer
        +
        72
        +
        73 return 0;
        +
        74}
        @@ -177,7 +176,7 @@ Algorithm
        - +

        ◆ maxSubArray()

        @@ -209,17 +208,17 @@ template<size_t N>
        Returns
        the value of maximum subarray sum
        -
        42  {
        -
        43  int curr_sum =
        -
        44  0; // declaring a variable named as curr_sum and initialized it to 0
        -
        45  int max_sum = INT_MIN; // Initialized max_sum to INT_MIN
        -
        46  for (int i : n) { // for loop to iterate over the elements of the array
        -
        47  curr_sum += n[i];
        -
        48  max_sum = std::max(max_sum, curr_sum); // getting the maximum value
        -
        49  curr_sum = std::max(curr_sum, 0); // updating the value of curr_sum
        -
        50  }
        -
        51  return max_sum; // returning the value of max_sum
        -
        52 }
        +
        42 {
        +
        43 int curr_sum =
        +
        44 0; // declaring a variable named as curr_sum and initialized it to 0
        +
        45 int max_sum = INT_MIN; // Initialized max_sum to INT_MIN
        +
        46 for (int i : n) { // for loop to iterate over the elements of the array
        +
        47 curr_sum += n[i];
        +
        48 max_sum = std::max(max_sum, curr_sum); // getting the maximum value
        +
        49 curr_sum = std::max(curr_sum, 0); // updating the value of curr_sum
        +
        50 }
        +
        51 return max_sum; // returning the value of max_sum
        +
        52}
        T max(T... args)
        Here is the call graph for this function:
        @@ -236,7 +235,7 @@ Here is the call graph for this function:
        diff --git a/db/dca/kadane2_8cpp_af3029007a422a914a85c0b0122f1c7b4_cgraph.svg b/db/dca/kadane2_8cpp_af3029007a422a914a85c0b0122f1c7b4_cgraph.svg index 32123089f..da2a54f76 100644 --- a/db/dca/kadane2_8cpp_af3029007a422a914a85c0b0122f1c7b4_cgraph.svg +++ b/db/dca/kadane2_8cpp_af3029007a422a914a85c0b0122f1c7b4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: numerical_methods/ode_forward_euler.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('db/dd3/ode__forward__euler_8cpp.html',
        -
        -
        ode_forward_euler.cpp File Reference
        +
        ode_forward_euler.cpp File Reference
        -

        Solve a multivariable first order ordinary differential equation (ODEs) using forward Euler method +

        Solve a multivariable first order ordinary differential equation (ODEs) using forward Euler method More...

        #include <cmath>
        #include <ctime>
        @@ -111,7 +110,7 @@ Include dependency graph for ode_forward_euler.cpp:
        - @@ -131,8 +130,8 @@ Functions

        +

        Functions

        void problem (const double &x, std::valarray< double > *y, std::valarray< double > *dy)
         Problem statement for a system with first-order differential equations. Updates the system differential variables. More...
         

        Detailed Description

        -

        Solve a multivariable first order ordinary differential equation (ODEs) using forward Euler method

        -
        Authors
        Krishna Vedala
        +

        Solve a multivariable first order ordinary differential equation (ODEs) using forward Euler method

        +
        Authors
        Krishna Vedala

        The ODE being solved is:

        \begin{eqnarray*} \dot{u} &=& v\\ \dot{v} &=& -\omega^2 u\\ \omega &=& 1\\ [x_0, u_0, v_0] &=& [0,1,0]\qquad\ldots\text{(initial values)} \end{eqnarray*}

        @@ -140,12 +139,12 @@ Functions \begin{eqnarray*} u(x) &=& \cos(x)\\ v(x) &=& -\sin(x)\\ \end{eqnarray*}

        The computation results are stored to a text file forward_euler.csv and the exact soltuion results in exact.csv for comparison. Implementation solution

        -

        To implement Van der Pol oscillator, change the problem function to:

        const double mu = 2.0;
        +

        To implement Van der Pol oscillator, change the problem function to:

        const double mu = 2.0;
        dy[0] = y[1];
        dy[1] = mu * (1.f - y[0] * y[0]) * y[1] - y[0];
        See also
        ode_midpoint_euler.cpp, ode_semi_implicit_euler.cpp

        Function Documentation

        - +

        ◆ exact_solution()

        @@ -179,10 +178,10 @@ Functions -
        67  {
        -
        68  y[0][0] = std::cos(x);
        -
        69  y[0][1] = -std::sin(x);
        -
        70 }
        +
        67 {
        +
        68 y[0][0] = std::cos(x);
        +
        69 y[0][1] = -std::sin(x);
        +
        70}
        T cos(T... args)
        T sin(T... args)
        @@ -194,7 +193,7 @@ Here is the call graph for this function:
        - +

        ◆ main()

        @@ -219,36 +218,36 @@ Here is the call graph for this function:
        -

        Main Function

        -
        189  {
        -
        190  double X0 = 0.f; /* initial value of x0 */
        -
        191  double X_MAX = 10.F; /* upper limit of integration */
        -
        192  std::valarray<double> Y0{1.f, 0.f}; /* initial value Y = y(x = x_0) */
        -
        193  double step_size = NAN;
        -
        194 
        -
        195  if (argc == 1) {
        -
        196  std::cout << "\nEnter the step size: ";
        -
        197  std::cin >> step_size;
        -
        198  } else {
        -
        199  // use commandline argument as independent variable step size
        -
        200  step_size = std::atof(argv[1]);
        -
        201  }
        -
        202 
        -
        203  // get approximate solution
        -
        204  double total_time = forward_euler(step_size, X0, X_MAX, &Y0, true);
        -
        205  std::cout << "\tTime = " << total_time << " ms\n";
        -
        206 
        -
        207  /* compute exact solution for comparion */
        -
        208  save_exact_solution(X0, X_MAX, step_size, Y0);
        -
        209 
        -
        210  return 0;
        -
        211 }
        +

        Main Function

        +
        189 {
        +
        190 double X0 = 0.f; /* initial value of x0 */
        +
        191 double X_MAX = 10.F; /* upper limit of integration */
        +
        192 std::valarray<double> Y0{1.f, 0.f}; /* initial value Y = y(x = x_0) */
        +
        193 double step_size = NAN;
        +
        194
        +
        195 if (argc == 1) {
        +
        196 std::cout << "\nEnter the step size: ";
        +
        197 std::cin >> step_size;
        +
        198 } else {
        +
        199 // use commandline argument as independent variable step size
        +
        200 step_size = std::atof(argv[1]);
        +
        201 }
        +
        202
        +
        203 // get approximate solution
        +
        204 double total_time = forward_euler(step_size, X0, X_MAX, &Y0, true);
        +
        205 std::cout << "\tTime = " << total_time << " ms\n";
        +
        206
        +
        207 /* compute exact solution for comparion */
        +
        208 save_exact_solution(X0, X_MAX, step_size, Y0);
        +
        209
        +
        210 return 0;
        +
        211}
        T atof(T... args)
        double forward_euler(double dx, double x0, double x_max, std::valarray< double > *y, bool save_to_file=false)
        Compute approximation using the forward-Euler method in the given limits.
        Definition: ode_forward_euler.cpp:102
        void save_exact_solution(const double &X0, const double &X_MAX, const double &step_size, const std::valarray< double > &Y0)
        Definition: ode_forward_euler.cpp:153
        - +
        Here is the call graph for this function:
        @@ -258,7 +257,7 @@ Here is the call graph for this function:
        - +

        ◆ problem()

        @@ -300,15 +299,15 @@ Here is the call graph for this function:
        -
        55  {
        -
        56  const double omega = 1.F; // some const for the problem
        -
        57  (*dy)[0] = (*y)[1]; // x dot // NOLINT
        -
        58  (*dy)[1] = -omega * omega * (*y)[0]; // y dot // NOLINT
        -
        59 }
        +
        55 {
        +
        56 const double omega = 1.F; // some const for the problem
        +
        57 (*dy)[0] = (*y)[1]; // x dot // NOLINT
        +
        58 (*dy)[1] = -omega * omega * (*y)[0]; // y dot // NOLINT
        +
        59}
        - +

        ◆ save_exact_solution()

        @@ -345,7 +344,7 @@ Here is the call graph for this function:
        -

        Function to compute and save exact solution for comparison

        +

        Function to compute and save exact solution for comparison

        Parameters
        @@ -355,36 +354,36 @@ Here is the call graph for this function:
        [in]X0initial value of independent variable
        -
        155  {
        -
        156  double x = X0;
        -
        157  std::valarray<double> y(Y0);
        -
        158 
        -
        159  std::ofstream fp("exact.csv", std::ostream::out);
        -
        160  if (!fp.is_open()) {
        -
        161  std::perror("Error! ");
        -
        162  return;
        -
        163  }
        -
        164  std::cout << "Finding exact solution\n";
        -
        165 
        -
        166  std::clock_t t1 = std::clock();
        -
        167  do {
        -
        168  fp << x << ",";
        -
        169  for (int i = 0; i < y.size() - 1; i++) {
        -
        170  fp << y[i] << ","; // NOLINT
        -
        171  }
        -
        172  fp << y[y.size() - 1] << "\n"; // NOLINT
        -
        173 
        -
        174  exact_solution(x, &y);
        -
        175 
        -
        176  x += step_size;
        -
        177  } while (x <= X_MAX);
        -
        178 
        -
        179  std::clock_t t2 = std::clock();
        -
        180  double total_time = static_cast<double>(t2 - t1) / CLOCKS_PER_SEC;
        -
        181  std::cout << "\tTime = " << total_time << " ms\n";
        -
        182 
        -
        183  fp.close();
        -
        184 }
        +
        155 {
        +
        156 double x = X0;
        + +
        158
        +
        159 std::ofstream fp("exact.csv", std::ostream::out);
        +
        160 if (!fp.is_open()) {
        +
        161 std::perror("Error! ");
        +
        162 return;
        +
        163 }
        +
        164 std::cout << "Finding exact solution\n";
        +
        165
        + +
        167 do {
        +
        168 fp << x << ",";
        +
        169 for (int i = 0; i < y.size() - 1; i++) {
        +
        170 fp << y[i] << ","; // NOLINT
        +
        171 }
        +
        172 fp << y[y.size() - 1] << "\n"; // NOLINT
        +
        173
        +
        174 exact_solution(x, &y);
        +
        175
        +
        176 x += step_size;
        +
        177 } while (x <= X_MAX);
        +
        178
        + +
        180 double total_time = static_cast<double>(t2 - t1) / CLOCKS_PER_SEC;
        +
        181 std::cout << "\tTime = " << total_time << " ms\n";
        +
        182
        +
        183 fp.close();
        +
        184}
        T clock(T... args)
        @@ -405,7 +404,7 @@ Here is the call graph for this function:
        diff --git a/db/dd3/ode__forward__euler_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/db/dd3/ode__forward__euler_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg index afe77ad19..5aac7c376 100644 --- a/db/dd3/ode__forward__euler_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg +++ b/db/dd3/ode__forward__euler_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - - - diff --git a/db/ddb/classhash__chain__coll__graph.md5 b/db/ddb/classhash__chain__coll__graph.md5 deleted file mode 100644 index 3b55a8617..000000000 --- a/db/ddb/classhash__chain__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -684d0e13cb53a171dbe65822b8749b3d \ No newline at end of file diff --git a/db/ddb/classhash__chain__coll__graph.svg b/db/ddb/classhash__chain__coll__graph.svg deleted file mode 100644 index b4ee4a9fe..000000000 --- a/db/ddb/classhash__chain__coll__graph.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - -hash_chain - - - -Node1 - - -hash_chain - - - - - -Node2 - - -std::shared_ptr< struct - Node > - - - - - -Node2->Node1 - - - next - - - -Node3 - - -std::vector< std::shared -_ptr< Node > > - - - - - -Node3->Node1 - - - head - - - -Node4 - - -std::shared_ptr< Node > - - - - - -Node4->Node3 - - - elements - - - diff --git a/db/ddc/namespaceaystar__search.html b/db/ddc/namespaceaystar__search.html index b5dcd6f52..6d4c9d72f 100644 --- a/db/ddc/namespaceaystar__search.html +++ b/db/ddc/namespaceaystar__search.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: aystar_search Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('db/ddc/namespaceaystar__search.html','
        -
        -
        aystar_search Namespace Reference
        +
        aystar_search Namespace Reference
        -

        Functions for A* Search implementation. +

        Functions for A* Search implementation. More...

        Detailed Description

        -

        Functions for A* Search implementation.

        +

        Functions for A* Search implementation.

        diff --git a/db/df0/insertion__sort_8cpp__incl.svg b/db/df0/insertion__sort_8cpp__incl.svg index 3b5018f1e..3c0fa61a8 100644 --- a/db/df0/insertion__sort_8cpp__incl.svg +++ b/db/df0/insertion__sort_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,38 +90,37 @@ $(document).ready(function(){initNavTree('dd/d9c/classmachine__learning_1_1aysta
        -
        -
        machine_learning::aystar_search::EightPuzzle< N > Member List
        +
        machine_learning::aystar_search::EightPuzzle< N > Member List

        This is the complete list of members for machine_learning::aystar_search::EightPuzzle< N >, including all inherited members.

        - + - + - - - + + + - + - + - + - - - + + +
        board (defined in machine_learning::aystar_search::EightPuzzle< N >)machine_learning::aystar_search::EightPuzzle< N >private
        EightPuzzle()machine_learning::aystar_search::EightPuzzle< N >inline
        EightPuzzle()machine_learning::aystar_search::EightPuzzle< N >inline
        EightPuzzle(const std::array< std::array< uint32_t, N >, N > &init)machine_learning::aystar_search::EightPuzzle< N >inlineexplicit
        EightPuzzle(const EightPuzzle< N > &A)machine_learning::aystar_search::EightPuzzle< N >inline
        EightPuzzle(const EightPuzzle< N > &A)machine_learning::aystar_search::EightPuzzle< N >inline
        EightPuzzle(const EightPuzzle< N > &&A) noexceptmachine_learning::aystar_search::EightPuzzle< N >inline
        find_zero()machine_learning::aystar_search::EightPuzzle< N >inlineprivate
        generate_possible_moves()machine_learning::aystar_search::EightPuzzle< N >inline
        get(size_t i, size_t j) constmachine_learning::aystar_search::EightPuzzle< N >inline
        find_zero()machine_learning::aystar_search::EightPuzzle< N >inlineprivate
        generate_possible_moves()machine_learning::aystar_search::EightPuzzle< N >inline
        get(size_t i, size_t j) constmachine_learning::aystar_search::EightPuzzle< N >inline
        get_size() constmachine_learning::aystar_search::EightPuzzle< N >inline
        get_state()machine_learning::aystar_search::EightPuzzle< N >inline
        get_state()machine_learning::aystar_search::EightPuzzle< N >inline
        in_range(const uint32_t value) constmachine_learning::aystar_search::EightPuzzle< N >inlineprivate
        movesmachine_learning::aystar_search::EightPuzzle< N >private
        movesmachine_learning::aystar_search::EightPuzzle< N >private
        operator<(const EightPuzzle< N > &check) constmachine_learning::aystar_search::EightPuzzle< N >inline
        operator<<(std::ostream &op, const EightPuzzle< N > &SomeState)machine_learning::aystar_search::EightPuzzle< N >friend
        operator<<machine_learning::aystar_search::EightPuzzle< N >friend
        operator<=(const EightPuzzle< N > &check) constmachine_learning::aystar_search::EightPuzzle< N >inline
        operator=(const EightPuzzle &A)machine_learning::aystar_search::EightPuzzle< N >inline
        operator=(EightPuzzle &&A) noexceptmachine_learning::aystar_search::EightPuzzle< N >inline
        operator==(const EightPuzzle< N > &check) constmachine_learning::aystar_search::EightPuzzle< N >inline
        operator=(const EightPuzzle &A)machine_learning::aystar_search::EightPuzzle< N >inline
        operator=(EightPuzzle &&A) noexceptmachine_learning::aystar_search::EightPuzzle< N >inline
        operator==(const EightPuzzle< N > &check) constmachine_learning::aystar_search::EightPuzzle< N >inline
        ~EightPuzzle()=defaultmachine_learning::aystar_search::EightPuzzle< N >
        diff --git a/db/df3/happy__number_8cpp.html b/db/df3/happy__number_8cpp.html index a114fe98b..239b622ff 100644 --- a/db/df3/happy__number_8cpp.html +++ b/db/df3/happy__number_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: others/happy_number.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('db/df3/happy__number_8cpp.html','../..
        -
        -
        happy_number.cpp File Reference
        +
        happy_number.cpp File Reference
        @@ -107,7 +106,7 @@ Include dependency graph for happy_number.cpp:
        - @@ -116,9 +115,9 @@ Functions

        +

        Functions

        template<typename T >
        bool is_happy (T n)
         

        Detailed Description

        -

        A happy number is a number whose sum of digits is calculated until the sum is a single digit, and this sum turns out to be 1.

        +

        A happy number is a number whose sum of digits is calculated until the sum is a single digit, and this sum turns out to be 1.

        Function Documentation

        - +

        ◆ is_happy()

        @@ -135,24 +134,24 @@ template<typename T >
        -

        Checks if a decimal number is a happy number

        Returns
        true if happy else false
        -
        14  {
        -
        15  T s = 0; // stores sum of digits
        -
        16  while (n > 9) { // while number is > 9, there are more than 1 digit
        -
        17  while (n != 0) { // get digit
        -
        18  T d = n % 10;
        -
        19  s += d;
        -
        20  n /= 10;
        -
        21  }
        -
        22  n = s;
        -
        23  s = 0;
        -
        24  }
        -
        25  return (n == 1) ? true : false; // true if k == 1
        -
        26 }
        +

        Checks if a decimal number is a happy number

        Returns
        true if happy else false
        +
        14 {
        +
        15 T s = 0; // stores sum of digits
        +
        16 while (n > 9) { // while number is > 9, there are more than 1 digit
        +
        17 while (n != 0) { // get digit
        +
        18 T d = n % 10;
        +
        19 s += d;
        +
        20 n /= 10;
        +
        21 }
        +
        22 n = s;
        +
        23 s = 0;
        +
        24 }
        +
        25 return (n == 1) ? true : false; // true if k == 1
        +
        26}
        - +

        ◆ main()

        @@ -167,18 +166,18 @@ template<typename T >
        -

        Main function

        -
        29  {
        -
        30  int n;
        -
        31  std::cout << "Enter a number:";
        -
        32  std::cin >> n;
        -
        33 
        -
        34  if (is_happy(n))
        -
        35  std::cout << n << " is a happy number" << std::endl;
        -
        36  else
        -
        37  std::cout << n << " is not a happy number" << std::endl;
        -
        38  return 0;
        -
        39 }
        +

        Main function

        +
        29 {
        +
        30 int n;
        +
        31 std::cout << "Enter a number:";
        +
        32 std::cin >> n;
        +
        33
        +
        34 if (is_happy(n))
        +
        35 std::cout << n << " is a happy number" << std::endl;
        +
        36 else
        +
        37 std::cout << n << " is not a happy number" << std::endl;
        +
        38 return 0;
        +
        39}
        T endl(T... args)
        @@ -198,7 +197,7 @@ Here is the call graph for this function:
        diff --git a/db/df3/happy__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/db/df3/happy__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 9c6d99b4e..0671eeaa1 100644 --- a/db/df3/happy__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/db/df3/happy__number_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,47 +90,46 @@ $(document).ready(function(){initNavTree('d3/d95/classdata__structures_1_1tree__
        -
        -
        data_structures::tree_234::Tree234 Member List
        +
        data_structures::tree_234::Tree234 Member List

        This is the complete list of members for data_structures::tree_234::Tree234, including all inherited members.

        - + - + - + - + - + - + - + - + - + - + - + - + - + - +
        DeleteNode(Node *tree)data_structures::tree_234::Tree234private
        GetTreeMaxItem(Node *tree)data_structures::tree_234::Tree234private
        GetTreeMaxItem(Node *tree)data_structures::tree_234::Tree234private
        GetTreeMinItem(Node *tree)data_structures::tree_234::Tree234private
        Insert(int64_t item)data_structures::tree_234::Tree234
        Insert(int64_t item)data_structures::tree_234::Tree234
        Insert(Node *tree, int64_t item)data_structures::tree_234::Tree234private
        InsertPostMerge(int64_t item)data_structures::tree_234::Tree234private
        InsertPostMerge(int64_t item)data_structures::tree_234::Tree234private
        InsertPreSplit(int64_t item)data_structures::tree_234::Tree234private
        LeftRotate(Node *parent, int8_t index)data_structures::tree_234::Tree234private
        LeftRotate(Node *parent, int8_t index)data_structures::tree_234::Tree234private
        Merge(Node *parent, int8_t index)data_structures::tree_234::Tree234private
        MergeNode(Node *dst_node, Node *node)data_structures::tree_234::Tree234private
        MergeNode(Node *dst_node, Node *node)data_structures::tree_234::Tree234private
        MergeNodeNotFull(Node *dst_node, Node *node)data_structures::tree_234::Tree234private
        operator=(const Tree234 &)=delete (defined in data_structures::tree_234::Tree234)data_structures::tree_234::Tree234
        operator=(const Tree234 &)=delete (defined in data_structures::tree_234::Tree234)data_structures::tree_234::Tree234
        operator=(const Tree234 &&)=delete (defined in data_structures::tree_234::Tree234)data_structures::tree_234::Tree234
        Print(const char *file_name=nullptr)data_structures::tree_234::Tree234
        Print(const char *file_name=nullptr)data_structures::tree_234::Tree234
        PrintNode(std::ofstream &ofs, Node *node, int64_t parent_index, int64_t index, int8_t parent_child_index)data_structures::tree_234::Tree234private
        Remove(int64_t item)data_structures::tree_234::Tree234
        Remove(int64_t item)data_structures::tree_234::Tree234
        RemovePreMerge(Node *node, int64_t item)data_structures::tree_234::Tree234private
        RightRotate(Node *parent, int8_t index)data_structures::tree_234::Tree234private
        RightRotate(Node *parent, int8_t index)data_structures::tree_234::Tree234private
        root_data_structures::tree_234::Tree234private
        SplitNode(Node *node)data_structures::tree_234::Tree234private
        SplitNode(Node *node)data_structures::tree_234::Tree234private
        Traverse()data_structures::tree_234::Tree234
        Traverse(Node *tree)data_structures::tree_234::Tree234private
        Traverse(Node *tree)data_structures::tree_234::Tree234private
        Tree234()=default (defined in data_structures::tree_234::Tree234)data_structures::tree_234::Tree234
        Tree234(const Tree234 &)=delete (defined in data_structures::tree_234::Tree234)data_structures::tree_234::Tree234
        Tree234(const Tree234 &)=delete (defined in data_structures::tree_234::Tree234)data_structures::tree_234::Tree234
        Tree234(const Tree234 &&)=delete (defined in data_structures::tree_234::Tree234)data_structures::tree_234::Tree234
        TryLeftRotate(Node *parent, Node *to_child)data_structures::tree_234::Tree234private
        TryLeftRotate(Node *parent, Node *to_child)data_structures::tree_234::Tree234private
        TryRightRotate(Node *parent, Node *to_child)data_structures::tree_234::Tree234private
        ~Tree234() (defined in data_structures::tree_234::Tree234)data_structures::tree_234::Tree234
        ~Tree234() (defined in data_structures::tree_234::Tree234)data_structures::tree_234::Tree234
        diff --git a/dc/d14/wildcard__matching_8cpp.html b/dc/d14/wildcard__matching_8cpp.html index 2b6f26c51..3db656397 100644 --- a/dc/d14/wildcard__matching_8cpp.html +++ b/dc/d14/wildcard__matching_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: backtracking/wildcard_matching.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('dc/d14/wildcard__matching_8cpp.html',' Namespaces | Functions | Variables -
        -
        wildcard_matching.cpp File Reference
        +
        wildcard_matching.cpp File Reference
        -

        Implementation of the Wildcard Matching problem. +

        Implementation of the Wildcard Matching problem. More...

        #include <cassert>
        #include <iostream>
        @@ -111,19 +110,18 @@ Include dependency graph for wildcard_matching.cpp:
        - - + - - + +

        +

        Namespaces

         backtracking
        namespace  backtracking
         Backtracking algorithms.
         
         wildcard_matching
         Functions for the Wildcard Matching problem.
        namespace  wildcard_matching
         Functions for the Wildcard Matching problem.
         
        - - + @@ -132,17 +130,17 @@ bool 

        +

        Functions

        -bool backtracking::wildcard_matching::wildcard_matching (std::string s, std::string p, uint32_t pos1, uint32_t pos2)
        bool backtracking::wildcard_matching::wildcard_matching (std::string s, std::string p, uint32_t pos1, uint32_t pos2)
         
        static void test ()
         Self-test implementations. More...
        backtracking::wildcar
         Main function. More...
         
        - - - - + + +

        +

        Variables

        std::vector< std::vector< int64_t > > backtracking::wildcard_matching::dpTable (1000, std::vector< int64_t >(1000, -1))
         The main function implements if pattern can be matched with given string. More...
         
        std::vector< std::vector< int64_t > > backtracking::wildcard_matching::dpTable (1000, std::vector< int64_t >(1000, -1))
         The main function implements if pattern can be matched with given string. More...
         

        Detailed Description

        -

        Implementation of the Wildcard Matching problem.

        -

        Given a matching string and a pattern, implement wildcard pattern matching with support for ? and *. ? matches any single character. * matches any sequence of characters (including the empty sequence). The matching should cover the entire matching string (not partial). The task is to determine if the pattern matches with the matching string

        Author
        Swastika Gupta
        +

        Implementation of the Wildcard Matching problem.

        +

        Given a matching string and a pattern, implement wildcard pattern matching with support for ? and *. ? matches any single character. * matches any sequence of characters (including the empty sequence). The matching should cover the entire matching string (not partial). The task is to determine if the pattern matches with the matching string

        Author
        Swastika Gupta

        Function Documentation

        - +

        ◆ main()

        @@ -160,10 +158,10 @@ Variables

        Main function.

        Returns
        0 on exit
        -
        152  {
        -
        153  test(); // run self-test implementations
        -
        154  return 0;
        -
        155 }
        +
        152 {
        +
        153 test(); // run self-test implementations
        +
        154 return 0;
        +
        155}
        static void test()
        Self-test implementations.
        Definition: wildcard_matching.cpp:101
        Here is the call graph for this function:
        @@ -174,7 +172,7 @@ Here is the call graph for this function:
        - +

        ◆ test()

        @@ -199,67 +197,163 @@ Here is the call graph for this function:

        Self-test implementations.

        Returns
        void
        -
        101  {
        -
        102  // 1st test
        -
        103  std::cout << "1st test ";
        -
        104  std::string matching1 = "baaabab";
        -
        105  std::string pattern1 = "*****ba*****ab";
        -
        106  assert(backtracking::wildcard_matching::wildcard_matching(matching1,
        -
        107  pattern1, 0, 0) ==
        -
        108  1); // here the pattern matches with given string
        -
        109  std::cout << "passed" << std::endl;
        -
        110 
        -
        111  // 2nd test
        -
        112  std::cout << "2nd test ";
        -
        113  std::string matching2 = "baaabab";
        -
        114  std::string pattern2 = "ba*****ab";
        -
        115  assert(backtracking::wildcard_matching::wildcard_matching(matching2,
        -
        116  pattern2, 0, 0) ==
        -
        117  1); // here the pattern matches with given string
        -
        118  std::cout << "passed" << std::endl;
        -
        119 
        -
        120  // 3rd test
        -
        121  std::cout << "3rd test ";
        -
        122  std::string matching3 = "baaabab";
        -
        123  std::string pattern3 = "ba*ab";
        -
        124  assert(backtracking::wildcard_matching::wildcard_matching(matching3,
        -
        125  pattern3, 0, 0) ==
        -
        126  1); // here the pattern matches with given string
        -
        127  std::cout << "passed" << std::endl;
        -
        128 
        -
        129  // 4th test
        -
        130  std::cout << "4th test ";
        -
        131  std::string matching4 = "baaabab";
        -
        132  std::string pattern4 = "a*ab";
        -
        133  assert(backtracking::wildcard_matching::wildcard_matching(matching4,
        -
        134  pattern4, 0, 0) ==
        -
        135  1); // here the pattern matches with given string
        -
        136  std::cout << "passed" << std::endl;
        -
        137 
        -
        138  // 5th test
        -
        139  std::cout << "5th test ";
        -
        140  std::string matching5 = "baaabab";
        -
        141  std::string pattern5 = "aa?ab";
        -
        142  assert(backtracking::wildcard_matching::wildcard_matching(matching5,
        -
        143  pattern5, 0, 0) ==
        -
        144  1); // here the pattern matches with given string
        -
        145  std::cout << "passed" << std::endl;
        -
        146 }
        +
        101 {
        +
        102 // 1st test
        +
        103 std::cout << "1st test ";
        +
        104 std::string matching1 = "baaabab";
        +
        105 std::string pattern1 = "*****ba*****ab";
        +
        106 assert(backtracking::wildcard_matching::wildcard_matching(matching1,
        +
        107 pattern1, 0, 0) ==
        +
        108 1); // here the pattern matches with given string
        +
        109 std::cout << "passed" << std::endl;
        +
        110
        +
        111 // 2nd test
        +
        112 std::cout << "2nd test ";
        +
        113 std::string matching2 = "baaabab";
        +
        114 std::string pattern2 = "ba*****ab";
        +
        115 assert(backtracking::wildcard_matching::wildcard_matching(matching2,
        +
        116 pattern2, 0, 0) ==
        +
        117 1); // here the pattern matches with given string
        +
        118 std::cout << "passed" << std::endl;
        +
        119
        +
        120 // 3rd test
        +
        121 std::cout << "3rd test ";
        +
        122 std::string matching3 = "baaabab";
        +
        123 std::string pattern3 = "ba*ab";
        +
        124 assert(backtracking::wildcard_matching::wildcard_matching(matching3,
        +
        125 pattern3, 0, 0) ==
        +
        126 1); // here the pattern matches with given string
        +
        127 std::cout << "passed" << std::endl;
        +
        128
        +
        129 // 4th test
        +
        130 std::cout << "4th test ";
        +
        131 std::string matching4 = "baaabab";
        +
        132 std::string pattern4 = "a*ab";
        +
        133 assert(backtracking::wildcard_matching::wildcard_matching(matching4,
        +
        134 pattern4, 0, 0) ==
        +
        135 1); // here the pattern matches with given string
        +
        136 std::cout << "passed" << std::endl;
        +
        137
        +
        138 // 5th test
        +
        139 std::cout << "5th test ";
        +
        140 std::string matching5 = "baaabab";
        +
        141 std::string pattern5 = "aa?ab";
        +
        142 assert(backtracking::wildcard_matching::wildcard_matching(matching5,
        +
        143 pattern5, 0, 0) ==
        +
        144 1); // here the pattern matches with given string
        +
        145 std::cout << "passed" << std::endl;
        +
        146}
        T endl(T... args)
        -

        Variable Documentation

        - -

        ◆ dpTable

        + +

        ◆ wildcard_matching()

        - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        std::vector<std::vector<int64_t> > backtracking::wildcard_matching::dpTable(1000, std::vector< int64_t >(1000, -1)) bool backtracking::wildcard_matching::wildcard_matching (std::string s,
        std::string p,
        uint32_t pos1,
        uint32_t pos2 
        )
        +
        +
        40 {
        +
        41 uint32_t n = s.length();
        +
        42 uint32_t m = p.length();
        +
        43 // matching is successfull if both strings are done
        +
        44 if (pos1 == n && pos2 == m) {
        +
        45 return true;
        +
        46 }
        +
        47
        +
        48 // matching is unsuccessfull if pattern is not finished but matching string
        +
        49 // is
        +
        50 if (pos1 != n && pos2 == m) {
        +
        51 return false;
        +
        52 }
        +
        53
        +
        54 // all the remaining characters of patterns must be * inorder to match with
        +
        55 // finished string
        +
        56 if (pos1 == n && pos2 != m) {
        +
        57 while (pos2 < m && p[pos2] == '*') {
        +
        58 pos2++;
        +
        59 }
        +
        60
        +
        61 return pos2 == m;
        +
        62 }
        +
        63
        +
        64 // if already calculted for these positions
        +
        65 if (dpTable[pos1][pos2] != -1) {
        +
        66 return dpTable[pos1][pos2];
        +
        67 }
        +
        68
        +
        69 // if the characters are same just go ahead in both the string
        +
        70 if (s[pos1] == p[pos2]) {
        +
        71 return dpTable[pos1][pos2] =
        +
        72 wildcard_matching(s, p, pos1 + 1, pos2 + 1);
        +
        73 }
        +
        74
        +
        75 else {
        +
        76 // can only single character
        +
        77 if (p[pos2] == '?') {
        +
        78 return dpTable[pos1][pos2] =
        +
        79 wildcard_matching(s, p, pos1 + 1, pos2 + 1);
        +
        80 }
        +
        81 // have choice either to match one or more charcters
        +
        82 else if (p[pos2] == '*') {
        +
        83 return dpTable[pos1][pos2] =
        +
        84 wildcard_matching(s, p, pos1, pos2 + 1) ||
        +
        85 wildcard_matching(s, p, pos1 + 1, pos2);
        +
        86 }
        +
        87 // not possible to match
        +
        88 else {
        +
        89 return dpTable[pos1][pos2] = 0;
        +
        90 }
        +
        91 }
        +
        92}
        +
        Functions for the Wildcard Matching problem.
        +
        T length(T... args)
        +
        std::vector< std::vector< int64_t > > dpTable(1000, std::vector< int64_t >(1000, -1))
        The main function implements if pattern can be matched with given string.
        +
        +
        +
        +

        Variable Documentation

        + +

        ◆ dpTable

        + +
        +
        + + + @@ -298,7 +392,7 @@ Here is the call graph for this function: diff --git a/dc/d14/wildcard__matching_8cpp.js b/dc/d14/wildcard__matching_8cpp.js index 505866978..675b8340b 100644 --- a/dc/d14/wildcard__matching_8cpp.js +++ b/dc/d14/wildcard__matching_8cpp.js @@ -2,6 +2,5 @@ var wildcard__matching_8cpp = [ [ "main", "dc/d14/wildcard__matching_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "test", "dc/d14/wildcard__matching_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ], - [ "wildcard_matching", "dc/d14/wildcard__matching_8cpp.html#a182d0f016b34e40f86be8d6df05dc9ac", null ], - [ "dpTable", "dc/d14/wildcard__matching_8cpp.html#a597f5c6e23f88d339c80eb83f8a6e8ff", null ] + [ "dpTable", "dc/d14/wildcard__matching_8cpp.html#a4a5b107f93db24e424b12899fa692c5a", null ] ]; \ No newline at end of file diff --git a/dc/d14/wildcard__matching_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/dc/d14/wildcard__matching_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index f65d95095..e49c6cf6e 100644 --- a/dc/d14/wildcard__matching_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/dc/d14/wildcard__matching_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + +Algorithms_in_C++: others/pascal_triangle.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
        std::vector< std::vector< int64_t > > backtracking::wildcard_matching::dpTable(1000, std::vector< int64_t >(1000, -1)) ( 1000  ,
        -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('dc/d1a/pascal__triangle_8cpp.html','..
        -
        -
        pascal_triangle.cpp File Reference
        +
        pascal_triangle.cpp File Reference
        @@ -109,19 +108,19 @@ Include dependency graph for pascal_triangle.cpp:
        - - - + +

        +

        Functions

        void show_pascal (int **arr, int n)
         
        int ** pascal_triangle (int **arr, int n)
         
        int ** pascal_triangle (int **arr, int n)
         
        int main ()
         

        Detailed Description

        -

        Pascal's triangle implementation.

        +

        Pascal's triangle implementation.

        Function Documentation

        - +

        ◆ main()

        @@ -136,37 +135,37 @@ Functions
        -

        main function

        -
        52  {
        -
        53  int n = 0;
        -
        54 
        -
        55  std::cout << "Set Pascal's Triangle Height" << std::endl;
        -
        56  std::cin >> n;
        -
        57 
        -
        58  // memory allocation (Assign two-dimensional array to store Pascal triangle)
        -
        59  int **arr = new int *[n];
        -
        60  for (int i = 0; i < n; ++i) {
        -
        61  arr[i] = new int[2 * n - 1];
        -
        62  memset(arr[i], 0, sizeof(int) * (2 * n - 1));
        -
        63  }
        -
        64 
        -
        65  pascal_triangle(arr, n);
        -
        66  show_pascal(arr, n);
        -
        67 
        -
        68  // deallocation
        -
        69  for (int i = 0; i < n; ++i) {
        -
        70  delete[] arr[i];
        -
        71  }
        -
        72  delete[] arr;
        -
        73 
        -
        74  return 0;
        -
        75 }
        +

        main function

        +
        52 {
        +
        53 int n = 0;
        +
        54
        +
        55 std::cout << "Set Pascal's Triangle Height" << std::endl;
        +
        56 std::cin >> n;
        +
        57
        +
        58 // memory allocation (Assign two-dimensional array to store Pascal triangle)
        +
        59 int **arr = new int *[n];
        +
        60 for (int i = 0; i < n; ++i) {
        +
        61 arr[i] = new int[2 * n - 1];
        +
        62 memset(arr[i], 0, sizeof(int) * (2 * n - 1));
        +
        63 }
        +
        64
        +
        65 pascal_triangle(arr, n);
        +
        66 show_pascal(arr, n);
        +
        67
        +
        68 // deallocation
        +
        69 for (int i = 0; i < n; ++i) {
        +
        70 delete[] arr[i];
        +
        71 }
        +
        72 delete[] arr;
        +
        73
        +
        74 return 0;
        +
        75}
        T endl(T... args)
        T memset(T... args)
        +
        int ** pascal_triangle(int **arr, int n)
        Definition: pascal_triangle.cpp:36
        void show_pascal(int **arr, int n)
        Definition: pascal_triangle.cpp:18
        -
        int ** pascal_triangle(int **arr, int n)
        Definition: pascal_triangle.cpp:36
        Here is the call graph for this function:
        @@ -176,14 +175,14 @@ Here is the call graph for this function:
        - -

        ◆ pascal_triangle()

        + +

        ◆ pascal_triangle()

        - + @@ -201,7 +200,7 @@ Here is the call graph for this function:
        int** pascal_triangle int ** pascal_triangle ( int **  arr,
        -

        Print the triangle

        Parameters
        +

        Print the triangle

        Parameters
        @@ -209,22 +208,22 @@ Here is the call graph for this function:
        Returns
        arr pointer returned
        -
        36  {
        -
        37  for (int i = 0; i < n; ++i) {
        -
        38  for (int j = n - i - 1; j < n + i; ++j) {
        -
        39  if (j == n - i - 1 || j == n + i - 1)
        -
        40  arr[i][j] = 1; // The edge of the Pascal triangle goes in 1
        -
        41  else
        -
        42  arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j + 1];
        -
        43  }
        -
        44  }
        -
        45 
        -
        46  return arr;
        -
        47 }
        +
        36 {
        +
        37 for (int i = 0; i < n; ++i) {
        +
        38 for (int j = n - i - 1; j < n + i; ++j) {
        +
        39 if (j == n - i - 1 || j == n + i - 1)
        +
        40 arr[i][j] = 1; // The edge of the Pascal triangle goes in 1
        +
        41 else
        +
        42 arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j + 1];
        +
        43 }
        +
        44 }
        +
        45
        +
        46 return arr;
        +
        47}
        - +

        ◆ show_pascal()

        @@ -249,24 +248,24 @@ Here is the call graph for this function:
        [in,out]arrarray containing Pascal numbers
        [in]ndepth of Pascal triangle to print
        -

        Print the triangle

        Parameters
        +

        Print the triangle

        Parameters
        [in]arr2D-array containing Pascal numbers
        [in]ndepth of Pascal triangle to print
        -
        18  {
        -
        19  for (int i = 0; i < n; ++i) {
        -
        20  for (int j = 0; j < n + i; ++j) {
        -
        21  if (arr[i][j] == 0)
        -
        22  std::cout << std::setw(4) << " ";
        -
        23  else
        -
        24  std::cout << std::setw(4) << arr[i][j];
        -
        25  }
        - -
        27  }
        -
        28 }
        +
        18 {
        +
        19 for (int i = 0; i < n; ++i) {
        +
        20 for (int j = 0; j < n + i; ++j) {
        +
        21 if (arr[i][j] == 0)
        +
        22 std::cout << std::setw(4) << " ";
        +
        23 else
        +
        24 std::cout << std::setw(4) << arr[i][j];
        +
        25 }
        + +
        27 }
        +
        28}
        T setw(T... args)
        Here is the call graph for this function:
        @@ -283,7 +282,7 @@ Here is the call graph for this function:
        diff --git a/dc/d1a/pascal__triangle_8cpp.js b/dc/d1a/pascal__triangle_8cpp.js index 877243304..6946280e3 100644 --- a/dc/d1a/pascal__triangle_8cpp.js +++ b/dc/d1a/pascal__triangle_8cpp.js @@ -1,6 +1,6 @@ var pascal__triangle_8cpp = [ [ "main", "dc/d1a/pascal__triangle_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "pascal_triangle", "dc/d1a/pascal__triangle_8cpp.html#afd3f52dd56ddedbf7af5d26a202a199e", null ], + [ "pascal_triangle", "dc/d1a/pascal__triangle_8cpp.html#a4fc0e5a112f715c3a73989450b2cc5fd", null ], [ "show_pascal", "dc/d1a/pascal__triangle_8cpp.html#ad7a31d9cb2818d21b1ba12aead7f4c5c", null ] ]; \ No newline at end of file diff --git a/dc/d1a/pascal__triangle_8cpp_ad7a31d9cb2818d21b1ba12aead7f4c5c_cgraph.svg b/dc/d1a/pascal__triangle_8cpp_ad7a31d9cb2818d21b1ba12aead7f4c5c_cgraph.svg index 46b831630..dbf22c0dc 100644 --- a/dc/d1a/pascal__triangle_8cpp_ad7a31d9cb2818d21b1ba12aead7f4c5c_cgraph.svg +++ b/dc/d1a/pascal__triangle_8cpp_ad7a31d9cb2818d21b1ba12aead7f4c5c_cgraph.svg @@ -1,7 +1,7 @@ - - + diff --git a/dc/d1a/pascal__triangle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/dc/d1a/pascal__triangle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index d648abf4a..0ec703721 100644 --- a/dc/d1a/pascal__triangle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/dc/d1a/pascal__triangle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -88556e3ec7db7d41c6501ec715ba0c56 \ No newline at end of file +e0fa8c6c2734b0e25c032ae3cffc7e2c \ No newline at end of file diff --git a/dc/d1a/pascal__triangle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/dc/d1a/pascal__triangle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index f73ccd5d9..3ff32f495 100644 --- a/dc/d1a/pascal__triangle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/dc/d1a/pascal__triangle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + pascal_triangle diff --git a/dc/d25/structdata__structures_1_1_node-members.html b/dc/d25/structdata__structures_1_1_node-members.html index d35d6a039..b394a1ef2 100644 --- a/dc/d25/structdata__structures_1_1_node-members.html +++ b/dc/d25/structdata__structures_1_1_node-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,23 +90,22 @@ $(document).ready(function(){initNavTree('d9/d49/structdata__structures_1_1_node
        -
        -
        data_structures::Node Member List
        +
        data_structures::Node Member List

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

        - + - +
        forwarddata_structures::Node
        keydata_structures::Node
        keydata_structures::Node
        Node(int key, int level, void *value=nullptr)data_structures::Nodeinline
        valuedata_structures::Node
        valuedata_structures::Node
        diff --git a/dc/d29/coin__change__topdown_8cpp__incl.svg b/dc/d29/coin__change__topdown_8cpp__incl.svg index 951444f7f..2b3c10d68 100644 --- a/dc/d29/coin__change__topdown_8cpp__incl.svg +++ b/dc/d29/coin__change__topdown_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: count_of_trailing_ciphers_in_factorial_n Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('dc/d2f/namespacecount__of__trailing__c
        -
        -
        count_of_trailing_ciphers_in_factorial_n Namespace Reference
        +
        count_of_trailing_ciphers_in_factorial_n Namespace Reference
        -

        Functions for the Count the number of ciphers in n! implementation. +

        Functions for the Count the number of ciphers in n! implementation. More...

        Detailed Description

        -

        Functions for the Count the number of ciphers in n! implementation.

        +

        Functions for the Count the number of ciphers in n! implementation.

        diff --git a/dc/d37/lu__decompose_8cpp__incl.svg b/dc/d37/lu__decompose_8cpp__incl.svg index c0e90bca2..279bb709b 100644 --- a/dc/d37/lu__decompose_8cpp__incl.svg +++ b/dc/d37/lu__decompose_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: machine_learning/ordinary_least_squares_regressor.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('dc/d38/ordinary__least__squares__regre
        -
        -
        ordinary_least_squares_regressor.cpp File Reference
        +
        ordinary_least_squares_regressor.cpp File Reference
        -

        Linear regression example using Ordinary least squares +

        Linear regression example using Ordinary least squares More...

        #include <cassert>
        #include <cmath>
        @@ -111,62 +110,62 @@ Include dependency graph for ordinary_least_squares_regressor.cpp:
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

        +

        Functions

        template<typename T >
        std::ostreamoperator<< (std::ostream &out, std::vector< std::vector< T >> const &v)
         
        template<typename T >
        std::ostreamoperator<< (std::ostream &out, std::vector< T > const &v)
         
        template<typename T >
        bool is_square (std::vector< std::vector< T >> const &A)
         
        template<typename T >
        std::vector< std::vector< T > > operator* (std::vector< std::vector< T >> const &A, std::vector< std::vector< T >> const &B)
         
        template<typename T >
        std::vector< T > operator* (std::vector< std::vector< T >> const &A, std::vector< T > const &B)
         
        template<typename T >
        std::vector< float > operator* (float const scalar, std::vector< T > const &A)
         
        template<typename T >
        std::vector< float > operator* (std::vector< T > const &A, float const scalar)
         
        template<typename T >
        std::vector< float > operator/ (std::vector< T > const &A, float const scalar)
         
        template<typename T >
        std::vector< T > operator- (std::vector< T > const &A, std::vector< T > const &B)
         
        template<typename T >
        std::vector< T > operator+ (std::vector< T > const &A, std::vector< T > const &B)
         
        template<typename T >
        std::vector< std::vector< float > > get_inverse (std::vector< std::vector< T >> const &A)
         
        template<typename T >
        std::vector< std::vector< T > > get_transpose (std::vector< std::vector< T >> const &A)
         
        template<typename T >
        std::vector< float > fit_OLS_regressor (std::vector< std::vector< T >> const &X, std::vector< T > const &Y)
         
        template<typename T >
        std::vector< float > predict_OLS_regressor (std::vector< std::vector< T >> const &X, std::vector< float > const &beta)
         
        template<typename T >
        std::ostreamoperator<< (std::ostream &out, std::vector< std::vector< T > > const &v)
         
        template<typename T >
        std::ostreamoperator<< (std::ostream &out, std::vector< T > const &v)
         
        template<typename T >
        bool is_square (std::vector< std::vector< T > > const &A)
         
        template<typename T >
        std::vector< std::vector< T > > operator* (std::vector< std::vector< T > > const &A, std::vector< std::vector< T > > const &B)
         
        template<typename T >
        std::vector< T > operator* (std::vector< std::vector< T > > const &A, std::vector< T > const &B)
         
        template<typename T >
        std::vector< float > operator* (float const scalar, std::vector< T > const &A)
         
        template<typename T >
        std::vector< float > operator* (std::vector< T > const &A, float const scalar)
         
        template<typename T >
        std::vector< float > operator/ (std::vector< T > const &A, float const scalar)
         
        template<typename T >
        std::vector< T > operator- (std::vector< T > const &A, std::vector< T > const &B)
         
        template<typename T >
        std::vector< T > operator+ (std::vector< T > const &A, std::vector< T > const &B)
         
        template<typename T >
        std::vector< std::vector< float > > get_inverse (std::vector< std::vector< T > > const &A)
         
        template<typename T >
        std::vector< std::vector< T > > get_transpose (std::vector< std::vector< T > > const &A)
         
        template<typename T >
        std::vector< float > fit_OLS_regressor (std::vector< std::vector< T > > const &X, std::vector< T > const &Y)
         
        template<typename T >
        std::vector< float > predict_OLS_regressor (std::vector< std::vector< T > > const &X, std::vector< float > const &beta)
         
        void ols_test ()
         
        int main ()
         

        Detailed Description

        -

        Linear regression example using Ordinary least squares

        -

        Program that gets the number of data samples and number of features per sample along with output per sample. It applies OLS regression to compute the regression output for additional test data samples.

        -
        Author
        Krishna Vedala
        +

        Linear regression example using Ordinary least squares

        +

        Program that gets the number of data samples and number of features per sample along with output per sample. It applies OLS regression to compute the regression output for additional test data samples.

        +
        Author
        Krishna Vedala

        Function Documentation

        - -

        ◆ fit_OLS_regressor()

        + +

        ◆ fit_OLS_regressor()

        @@ -174,9 +173,9 @@ Functions template<typename T >
        - + - + @@ -192,7 +191,7 @@ template<typename T >
        std::vector<float> fit_OLS_regressor std::vector< float > fit_OLS_regressor (std::vector< std::vector< T >> const & std::vector< std::vector< T > > const &  X,
        -

        Perform Ordinary Least Squares curve fit. This operation is defined as

        +

        Perform Ordinary Least Squares curve fit. This operation is defined as

        \[\beta = \left(X^TXX^T\right)Y\]

        Parameters
        @@ -203,41 +202,41 @@ template<typename T >
        Returns
        fitted regression model polynomial coefficients
        -
        322  {
        -
        323  // NxF
        - -
        325  for (size_t i = 0; i < X2.size(); i++) {
        -
        326  // add Y-intercept -> Nx(F+1)
        -
        327  X2[i].push_back(1);
        -
        328  }
        -
        329  // (F+1)xN
        - -
        331  // (F+1)x(F+1)
        -
        332  std::vector<std::vector<T>> tmp = get_inverse(Xt * X2);
        -
        333  // (F+1)xN
        -
        334  std::vector<std::vector<float>> out = tmp * Xt;
        -
        335  // cout << endl
        -
        336  // << "Projection matrix: " << X2 * out << endl;
        -
        337 
        -
        338  // Fx1,1 -> (F+1)^th element is the independent constant
        -
        339  return out * Y;
        -
        340 }
        -
        std::vector< std::vector< T > > get_transpose(std::vector< std::vector< T >> const &A)
        Definition: ordinary_least_squares_regressor.cpp:300
        -
        std::vector< std::vector< float > > get_inverse(std::vector< std::vector< T >> const &A)
        Definition: ordinary_least_squares_regressor.cpp:226
        +
        322 {
        +
        323 // NxF
        + +
        325 for (size_t i = 0; i < X2.size(); i++) {
        +
        326 // add Y-intercept -> Nx(F+1)
        +
        327 X2[i].push_back(1);
        +
        328 }
        +
        329 // (F+1)xN
        + +
        331 // (F+1)x(F+1)
        + +
        333 // (F+1)xN
        +
        334 std::vector<std::vector<float>> out = tmp * Xt;
        +
        335 // cout << endl
        +
        336 // << "Projection matrix: " << X2 * out << endl;
        +
        337
        +
        338 // Fx1,1 -> (F+1)^th element is the independent constant
        +
        339 return out * Y;
        +
        340}
        +
        std::vector< std::vector< T > > get_transpose(std::vector< std::vector< T > > const &A)
        Definition: ordinary_least_squares_regressor.cpp:300
        +
        std::vector< std::vector< float > > get_inverse(std::vector< std::vector< T > > const &A)
        Definition: ordinary_least_squares_regressor.cpp:226
        T push_back(T... args)
        T size(T... args)
        Here is the call graph for this function:
        -
        +
        - -

        ◆ get_inverse()

        + +

        ◆ get_inverse()

        @@ -245,97 +244,97 @@ Here is the call graph for this function:
        template<typename T >
        - + - +
        std::vector<std::vector<float> > get_inverse std::vector< std::vector< float > > get_inverse (std::vector< std::vector< T >> const & std::vector< std::vector< T > > const &  A)
        -

        Get matrix inverse using Row-trasnformations. Given matrix must be a square and non-singular.

        Returns
        inverse matrix
        -
        227  {
        -
        228  // Assuming A is square matrix
        -
        229  size_t N = A.size();
        -
        230 
        -
        231  std::vector<std::vector<float>> inverse(N);
        -
        232  for (size_t row = 0; row < N; row++) {
        -
        233  // preallocatae a resultant identity matrix
        -
        234  inverse[row] = std::vector<float>(N);
        -
        235  for (size_t col = 0; col < N; col++) {
        -
        236  inverse[row][col] = (row == col) ? 1.f : 0.f;
        -
        237  }
        -
        238  }
        -
        239 
        -
        240  if (!is_square(A)) {
        -
        241  std::cerr << "A must be a square matrix!" << std::endl;
        -
        242  return inverse;
        -
        243  }
        -
        244 
        -
        245  // preallocatae a temporary matrix identical to A
        - -
        247  for (size_t row = 0; row < N; row++) {
        -
        248  std::vector<float> v(N);
        -
        249  for (size_t col = 0; col < N; col++) {
        -
        250  v[col] = static_cast<float>(A[row][col]);
        -
        251  }
        -
        252  temp[row] = v;
        -
        253  }
        -
        254 
        -
        255  // start transformations
        -
        256  for (size_t row = 0; row < N; row++) {
        -
        257  for (size_t row2 = row; row2 < N && temp[row][row] == 0; row2++) {
        -
        258  // this to ensure diagonal elements are not 0
        -
        259  temp[row] = temp[row] + temp[row2];
        -
        260  inverse[row] = inverse[row] + inverse[row2];
        -
        261  }
        -
        262 
        -
        263  for (size_t col2 = row; col2 < N && temp[row][row] == 0; col2++) {
        -
        264  // this to further ensure diagonal elements are not 0
        -
        265  for (size_t row2 = 0; row2 < N; row2++) {
        -
        266  temp[row2][row] = temp[row2][row] + temp[row2][col2];
        -
        267  inverse[row2][row] = inverse[row2][row] + inverse[row2][col2];
        -
        268  }
        -
        269  }
        -
        270 
        -
        271  if (temp[row][row] == 0) {
        -
        272  // Probably a low-rank matrix and hence singular
        -
        273  std::cerr << "Low-rank matrix, no inverse!" << std::endl;
        -
        274  return inverse;
        -
        275  }
        -
        276 
        -
        277  // set diagonal to 1
        -
        278  auto divisor = static_cast<float>(temp[row][row]);
        -
        279  temp[row] = temp[row] / divisor;
        -
        280  inverse[row] = inverse[row] / divisor;
        -
        281  // Row transformations
        -
        282  for (size_t row2 = 0; row2 < N; row2++) {
        -
        283  if (row2 == row) {
        -
        284  continue;
        -
        285  }
        -
        286  float factor = temp[row2][row];
        -
        287  temp[row2] = temp[row2] - factor * temp[row];
        -
        288  inverse[row2] = inverse[row2] - factor * inverse[row];
        -
        289  }
        -
        290  }
        -
        291 
        -
        292  return inverse;
        -
        293 }
        +

        Get matrix inverse using Row-trasnformations. Given matrix must be a square and non-singular.

        Returns
        inverse matrix
        +
        227 {
        +
        228 // Assuming A is square matrix
        +
        229 size_t N = A.size();
        +
        230
        + +
        232 for (size_t row = 0; row < N; row++) {
        +
        233 // preallocatae a resultant identity matrix
        +
        234 inverse[row] = std::vector<float>(N);
        +
        235 for (size_t col = 0; col < N; col++) {
        +
        236 inverse[row][col] = (row == col) ? 1.f : 0.f;
        +
        237 }
        +
        238 }
        +
        239
        +
        240 if (!is_square(A)) {
        +
        241 std::cerr << "A must be a square matrix!" << std::endl;
        +
        242 return inverse;
        +
        243 }
        +
        244
        +
        245 // preallocatae a temporary matrix identical to A
        + +
        247 for (size_t row = 0; row < N; row++) {
        + +
        249 for (size_t col = 0; col < N; col++) {
        +
        250 v[col] = static_cast<float>(A[row][col]);
        +
        251 }
        +
        252 temp[row] = v;
        +
        253 }
        +
        254
        +
        255 // start transformations
        +
        256 for (size_t row = 0; row < N; row++) {
        +
        257 for (size_t row2 = row; row2 < N && temp[row][row] == 0; row2++) {
        +
        258 // this to ensure diagonal elements are not 0
        +
        259 temp[row] = temp[row] + temp[row2];
        +
        260 inverse[row] = inverse[row] + inverse[row2];
        +
        261 }
        +
        262
        +
        263 for (size_t col2 = row; col2 < N && temp[row][row] == 0; col2++) {
        +
        264 // this to further ensure diagonal elements are not 0
        +
        265 for (size_t row2 = 0; row2 < N; row2++) {
        +
        266 temp[row2][row] = temp[row2][row] + temp[row2][col2];
        +
        267 inverse[row2][row] = inverse[row2][row] + inverse[row2][col2];
        +
        268 }
        +
        269 }
        +
        270
        +
        271 if (temp[row][row] == 0) {
        +
        272 // Probably a low-rank matrix and hence singular
        +
        273 std::cerr << "Low-rank matrix, no inverse!" << std::endl;
        +
        274 return inverse;
        +
        275 }
        +
        276
        +
        277 // set diagonal to 1
        +
        278 auto divisor = static_cast<float>(temp[row][row]);
        +
        279 temp[row] = temp[row] / divisor;
        +
        280 inverse[row] = inverse[row] / divisor;
        +
        281 // Row transformations
        +
        282 for (size_t row2 = 0; row2 < N; row2++) {
        +
        283 if (row2 == row) {
        +
        284 continue;
        +
        285 }
        +
        286 float factor = temp[row2][row];
        +
        287 temp[row2] = temp[row2] - factor * temp[row];
        +
        288 inverse[row2] = inverse[row2] - factor * inverse[row];
        +
        289 }
        +
        290 }
        +
        291
        +
        292 return inverse;
        +
        293}
        constexpr uint32_t N
        A struct to represent sparse table for min() as their invariant function, for the given array A....
        Definition: sparse_table.cpp:47
        T endl(T... args)
        -
        bool is_square(std::vector< std::vector< T >> const &A)
        Definition: ordinary_least_squares_regressor.cpp:59
        +
        bool is_square(std::vector< std::vector< T > > const &A)
        Definition: ordinary_least_squares_regressor.cpp:59
        Here is the call graph for this function:
        -
        +
        - -

        ◆ get_transpose()

        + +

        ◆ get_transpose()

        @@ -343,32 +342,32 @@ Here is the call graph for this function:
        template<typename T >
        - + - +
        std::vector<std::vector<T> > get_transpose std::vector< std::vector< T > > get_transpose (std::vector< std::vector< T >> const & std::vector< std::vector< T > > const &  A)
        -

        matrix transpose

        Returns
        resultant matrix
        -
        301  {
        -
        302  std::vector<std::vector<T>> result(A[0].size());
        -
        303 
        -
        304  for (size_t row = 0; row < A[0].size(); row++) {
        -
        305  std::vector<T> v(A.size());
        -
        306  for (size_t col = 0; col < A.size(); col++) v[col] = A[col][row];
        -
        307 
        -
        308  result[row] = v;
        -
        309  }
        -
        310  return result;
        -
        311 }
        +

        matrix transpose

        Returns
        resultant matrix
        +
        301 {
        + +
        303
        +
        304 for (size_t row = 0; row < A[0].size(); row++) {
        +
        305 std::vector<T> v(A.size());
        +
        306 for (size_t col = 0; col < A.size(); col++) v[col] = A[col][row];
        +
        307
        +
        308 result[row] = v;
        +
        309 }
        +
        310 return result;
        +
        311}
        uint64_t result(uint64_t n)
        Definition: fibonacci_sum.cpp:76
        - -

        ◆ is_square()

        + +

        ◆ is_square()

        @@ -381,7 +380,7 @@ template<typename T >
        bool is_square ( - std::vector< std::vector< T >> const &  + std::vector< std::vector< T > > const &  A) @@ -392,21 +391,21 @@ template<typename T >
        -

        function to check if given matrix is a square matrix

        Returns
        1 if true, 0 if false
        -
        59  {
        -
        60  // Assuming A is square matrix
        -
        61  size_t N = A.size();
        -
        62  for (size_t i = 0; i < N; i++) {
        -
        63  if (A[i].size() != N) {
        -
        64  return false;
        -
        65  }
        -
        66  }
        -
        67  return true;
        -
        68 }
        +

        function to check if given matrix is a square matrix

        Returns
        1 if true, 0 if false
        +
        59 {
        +
        60 // Assuming A is square matrix
        +
        61 size_t N = A.size();
        +
        62 for (size_t i = 0; i < N; i++) {
        +
        63 if (A[i].size() != N) {
        +
        64 return false;
        +
        65 }
        +
        66 }
        +
        67 return true;
        +
        68}
        - +

        ◆ main()

        @@ -421,65 +420,65 @@ template<typename T >
        -

        main function

        -
        423  {
        -
        424  ols_test();
        -
        425 
        -
        426  size_t N = 0, F = 0;
        -
        427 
        -
        428  std::cout << "Enter number of features: ";
        -
        429  // number of features = columns
        -
        430  std::cin >> F;
        -
        431  std::cout << "Enter number of samples: ";
        -
        432  // number of samples = rows
        -
        433  std::cin >> N;
        -
        434 
        - -
        436  std::vector<float> Y(N);
        -
        437 
        -
        438  std::cout
        -
        439  << "Enter training data. Per sample, provide features and one output."
        -
        440  << std::endl;
        -
        441 
        -
        442  for (size_t rows = 0; rows < N; rows++) {
        -
        443  std::vector<float> v(F);
        -
        444  std::cout << "Sample# " << rows + 1 << ": ";
        -
        445  for (size_t cols = 0; cols < F; cols++) {
        -
        446  // get the F features
        -
        447  std::cin >> v[cols];
        -
        448  }
        -
        449  data[rows] = v;
        -
        450  // get the corresponding output
        -
        451  std::cin >> Y[rows];
        -
        452  }
        -
        453 
        - -
        455  std::cout << std::endl << std::endl << "beta:" << beta << std::endl;
        -
        456 
        -
        457  size_t T = 0;
        -
        458  std::cout << "Enter number of test samples: ";
        -
        459  // number of test sample inputs
        -
        460  std::cin >> T;
        - -
        462  // vector<float> Y2(T);
        -
        463 
        -
        464  for (size_t rows = 0; rows < T; rows++) {
        -
        465  std::cout << "Sample# " << rows + 1 << ": ";
        -
        466  std::vector<float> v(F);
        -
        467  for (size_t cols = 0; cols < F; cols++) std::cin >> v[cols];
        -
        468  data2[rows] = v;
        -
        469  }
        -
        470 
        -
        471  std::vector<float> out = predict_OLS_regressor(data2, beta);
        -
        472  for (size_t rows = 0; rows < T; rows++) std::cout << out[rows] << std::endl;
        -
        473 
        -
        474  return 0;
        -
        475 }
        +

        main function

        +
        423 {
        +
        424 ols_test();
        +
        425
        +
        426 size_t N = 0, F = 0;
        +
        427
        +
        428 std::cout << "Enter number of features: ";
        +
        429 // number of features = columns
        +
        430 std::cin >> F;
        +
        431 std::cout << "Enter number of samples: ";
        +
        432 // number of samples = rows
        +
        433 std::cin >> N;
        +
        434
        + + +
        437
        + +
        439 << "Enter training data. Per sample, provide features and one output."
        +
        440 << std::endl;
        +
        441
        +
        442 for (size_t rows = 0; rows < N; rows++) {
        + +
        444 std::cout << "Sample# " << rows + 1 << ": ";
        +
        445 for (size_t cols = 0; cols < F; cols++) {
        +
        446 // get the F features
        +
        447 std::cin >> v[cols];
        +
        448 }
        +
        449 data[rows] = v;
        +
        450 // get the corresponding output
        +
        451 std::cin >> Y[rows];
        +
        452 }
        +
        453
        + +
        455 std::cout << std::endl << std::endl << "beta:" << beta << std::endl;
        +
        456
        +
        457 size_t T = 0;
        +
        458 std::cout << "Enter number of test samples: ";
        +
        459 // number of test sample inputs
        +
        460 std::cin >> T;
        + +
        462 // vector<float> Y2(T);
        +
        463
        +
        464 for (size_t rows = 0; rows < T; rows++) {
        +
        465 std::cout << "Sample# " << rows + 1 << ": ";
        + +
        467 for (size_t cols = 0; cols < F; cols++) std::cin >> v[cols];
        +
        468 data2[rows] = v;
        +
        469 }
        +
        470
        +
        471 std::vector<float> out = predict_OLS_regressor(data2, beta);
        +
        472 for (size_t rows = 0; rows < T; rows++) std::cout << out[rows] << std::endl;
        +
        473
        +
        474 return 0;
        +
        475}
        int data[MAX]
        test data
        Definition: hash_search.cpp:24
        -
        std::vector< float > fit_OLS_regressor(std::vector< std::vector< T >> const &X, std::vector< T > const &Y)
        Definition: ordinary_least_squares_regressor.cpp:321
        void ols_test()
        Definition: ordinary_least_squares_regressor.cpp:369
        -
        std::vector< float > predict_OLS_regressor(std::vector< std::vector< T >> const &X, std::vector< float > const &beta)
        Definition: ordinary_least_squares_regressor.cpp:352
        +
        std::vector< float > fit_OLS_regressor(std::vector< std::vector< T > > const &X, std::vector< T > const &Y)
        Definition: ordinary_least_squares_regressor.cpp:321
        +
        std::vector< float > predict_OLS_regressor(std::vector< std::vector< T > > const &X, std::vector< float > const &beta)
        Definition: ordinary_least_squares_regressor.cpp:352
        Here is the call graph for this function:
        @@ -489,7 +488,7 @@ Here is the call graph for this function:
        - +

        ◆ ols_test()

        @@ -503,57 +502,57 @@ Here is the call graph for this function:
        -

        Self test checks

        -
        369  {
        -
        370  int F = 3, N = 5;
        -
        371 
        -
        372  /* test function = x^2 -5 */
        -
        373  std::cout << "Test 1 (quadratic function)....";
        -
        374  // create training data set with features = x, x^2, x^3
        - -
        376  {{-5, 25, -125}, {-1, 1, -1}, {0, 0, 0}, {1, 1, 1}, {6, 36, 216}});
        -
        377  // create corresponding outputs
        -
        378  std::vector<float> Y1({20, -4, -5, -4, 31});
        -
        379  // perform regression modelling
        -
        380  std::vector<float> beta1 = fit_OLS_regressor(data1, Y1);
        -
        381  // create test data set with same features = x, x^2, x^3
        -
        382  std::vector<std::vector<float>> test_data1(
        -
        383  {{-2, 4, -8}, {2, 4, 8}, {-10, 100, -1000}, {10, 100, 1000}});
        -
        384  // expected regression outputs
        -
        385  std::vector<float> expected1({-1, -1, 95, 95});
        -
        386  // predicted regression outputs
        -
        387  std::vector<float> out1 = predict_OLS_regressor(test_data1, beta1);
        -
        388  // compare predicted results are within +-0.01 limit of expected
        -
        389  for (size_t rows = 0; rows < out1.size(); rows++) {
        -
        390  assert(std::abs(out1[rows] - expected1[rows]) < 0.01);
        -
        391  }
        -
        392  std::cout << "passed\n";
        -
        393 
        -
        394  /* test function = x^3 + x^2 - 100 */
        -
        395  std::cout << "Test 2 (cubic function)....";
        -
        396  // create training data set with features = x, x^2, x^3
        - -
        398  {{-5, 25, -125}, {-1, 1, -1}, {0, 0, 0}, {1, 1, 1}, {6, 36, 216}});
        -
        399  // create corresponding outputs
        -
        400  std::vector<float> Y2({-200, -100, -100, 98, 152});
        -
        401  // perform regression modelling
        -
        402  std::vector<float> beta2 = fit_OLS_regressor(data2, Y2);
        -
        403  // create test data set with same features = x, x^2, x^3
        -
        404  std::vector<std::vector<float>> test_data2(
        -
        405  {{-2, 4, -8}, {2, 4, 8}, {-10, 100, -1000}, {10, 100, 1000}});
        -
        406  // expected regression outputs
        -
        407  std::vector<float> expected2({-104, -88, -1000, 1000});
        -
        408  // predicted regression outputs
        -
        409  std::vector<float> out2 = predict_OLS_regressor(test_data2, beta2);
        -
        410  // compare predicted results are within +-0.01 limit of expected
        -
        411  for (size_t rows = 0; rows < out2.size(); rows++) {
        -
        412  assert(std::abs(out2[rows] - expected2[rows]) < 0.01);
        -
        413  }
        -
        414  std::cout << "passed\n";
        -
        415 
        -
        416  std::cout << std::endl; // ensure test results are displayed on screen
        -
        417  // (flush stdout)
        -
        418 }
        +

        Self test checks

        +
        369 {
        +
        370 int F = 3, N = 5;
        +
        371
        +
        372 /* test function = x^2 -5 */
        +
        373 std::cout << "Test 1 (quadratic function)....";
        +
        374 // create training data set with features = x, x^2, x^3
        + +
        376 {{-5, 25, -125}, {-1, 1, -1}, {0, 0, 0}, {1, 1, 1}, {6, 36, 216}});
        +
        377 // create corresponding outputs
        +
        378 std::vector<float> Y1({20, -4, -5, -4, 31});
        +
        379 // perform regression modelling
        +
        380 std::vector<float> beta1 = fit_OLS_regressor(data1, Y1);
        +
        381 // create test data set with same features = x, x^2, x^3
        + +
        383 {{-2, 4, -8}, {2, 4, 8}, {-10, 100, -1000}, {10, 100, 1000}});
        +
        384 // expected regression outputs
        +
        385 std::vector<float> expected1({-1, -1, 95, 95});
        +
        386 // predicted regression outputs
        +
        387 std::vector<float> out1 = predict_OLS_regressor(test_data1, beta1);
        +
        388 // compare predicted results are within +-0.01 limit of expected
        +
        389 for (size_t rows = 0; rows < out1.size(); rows++) {
        +
        390 assert(std::abs(out1[rows] - expected1[rows]) < 0.01);
        +
        391 }
        +
        392 std::cout << "passed\n";
        +
        393
        +
        394 /* test function = x^3 + x^2 - 100 */
        +
        395 std::cout << "Test 2 (cubic function)....";
        +
        396 // create training data set with features = x, x^2, x^3
        + +
        398 {{-5, 25, -125}, {-1, 1, -1}, {0, 0, 0}, {1, 1, 1}, {6, 36, 216}});
        +
        399 // create corresponding outputs
        +
        400 std::vector<float> Y2({-200, -100, -100, 98, 152});
        +
        401 // perform regression modelling
        +
        402 std::vector<float> beta2 = fit_OLS_regressor(data2, Y2);
        +
        403 // create test data set with same features = x, x^2, x^3
        + +
        405 {{-2, 4, -8}, {2, 4, 8}, {-10, 100, -1000}, {10, 100, 1000}});
        +
        406 // expected regression outputs
        +
        407 std::vector<float> expected2({-104, -88, -1000, 1000});
        +
        408 // predicted regression outputs
        +
        409 std::vector<float> out2 = predict_OLS_regressor(test_data2, beta2);
        +
        410 // compare predicted results are within +-0.01 limit of expected
        +
        411 for (size_t rows = 0; rows < out2.size(); rows++) {
        +
        412 assert(std::abs(out2[rows] - expected2[rows]) < 0.01);
        +
        413 }
        +
        414 std::cout << "passed\n";
        +
        415
        +
        416 std::cout << std::endl; // ensure test results are displayed on screen
        +
        417 // (flush stdout)
        +
        418}
        Here is the call graph for this function:
        @@ -563,8 +562,8 @@ Here is the call graph for this function:
        - -

        ◆ operator*() [1/4]

        + +

        ◆ operator*() [1/4]

        @@ -572,7 +571,7 @@ Here is the call graph for this function:
        template<typename T >
        - + @@ -590,30 +589,30 @@ template<typename T >
        std::vector<float> operator* std::vector< float > operator* ( float const  scalar,
        -

        pre-multiplication of a vector by a scalar

        Returns
        resultant vector
        -
        138  {
        -
        139  // Number of rows in A
        -
        140  size_t N_A = A.size();
        -
        141 
        - -
        143 
        -
        144  for (size_t row = 0; row < N_A; row++) {
        -
        145  result[row] += A[row] * static_cast<float>(scalar);
        -
        146  }
        -
        147 
        -
        148  return result;
        -
        149 }
        +

        pre-multiplication of a vector by a scalar

        Returns
        resultant vector
        +
        138 {
        +
        139 // Number of rows in A
        +
        140 size_t N_A = A.size();
        +
        141
        + +
        143
        +
        144 for (size_t row = 0; row < N_A; row++) {
        +
        145 result[row] += A[row] * static_cast<float>(scalar);
        +
        146 }
        +
        147
        +
        148 return result;
        +
        149}
        Here is the call graph for this function:
        -
        +
        - -

        ◆ operator*() [2/4]

        + +

        ◆ operator*() [2/4]

        @@ -621,15 +620,15 @@ Here is the call graph for this function:
        template<typename T >
        - + - + - + @@ -639,40 +638,40 @@ template<typename T >
        std::vector<std::vector<T> > operator* std::vector< std::vector< T > > operator* (std::vector< std::vector< T >> const & std::vector< std::vector< T > > const &  A,
        std::vector< std::vector< T >> const & std::vector< std::vector< T > > const &  B 
        -

        Matrix multiplication such that if A is size (mxn) and B is of size (pxq) then the multiplication is defined only when n = p and the resultant matrix is of size (mxq)

        +

        Matrix multiplication such that if A is size (mxn) and B is of size (pxq) then the multiplication is defined only when n = p and the resultant matrix is of size (mxq)

        Returns
        resultant matrix
        -
        79  {
        -
        80  // Number of rows in A
        -
        81  size_t N_A = A.size();
        -
        82  // Number of columns in B
        -
        83  size_t N_B = B[0].size();
        -
        84 
        - -
        86 
        -
        87  if (A[0].size() != B.size()) {
        -
        88  std::cerr << "Number of columns in A != Number of rows in B ("
        -
        89  << A[0].size() << ", " << B.size() << ")" << std::endl;
        -
        90  return result;
        -
        91  }
        -
        92 
        -
        93  for (size_t row = 0; row < N_A; row++) {
        -
        94  std::vector<T> v(N_B);
        -
        95  for (size_t col = 0; col < N_B; col++) {
        -
        96  v[col] = static_cast<T>(0);
        -
        97  for (size_t j = 0; j < B.size(); j++) {
        -
        98  v[col] += A[row][j] * B[j][col];
        -
        99  }
        -
        100  }
        -
        101  result[row] = v;
        -
        102  }
        -
        103 
        -
        104  return result;
        -
        105 }
        +
        79 {
        +
        80 // Number of rows in A
        +
        81 size_t N_A = A.size();
        +
        82 // Number of columns in B
        +
        83 size_t N_B = B[0].size();
        +
        84
        + +
        86
        +
        87 if (A[0].size() != B.size()) {
        +
        88 std::cerr << "Number of columns in A != Number of rows in B ("
        +
        89 << A[0].size() << ", " << B.size() << ")" << std::endl;
        +
        90 return result;
        +
        91 }
        +
        92
        +
        93 for (size_t row = 0; row < N_A; row++) {
        +
        94 std::vector<T> v(N_B);
        +
        95 for (size_t col = 0; col < N_B; col++) {
        +
        96 v[col] = static_cast<T>(0);
        +
        97 for (size_t j = 0; j < B.size(); j++) {
        +
        98 v[col] += A[row][j] * B[j][col];
        +
        99 }
        +
        100 }
        +
        101 result[row] = v;
        +
        102 }
        +
        103
        +
        104 return result;
        +
        105}
        - -

        ◆ operator*() [3/4]

        + +

        ◆ operator*() [3/4]

        @@ -680,9 +679,9 @@ template<typename T >
        template<typename T >
        - + - + @@ -698,31 +697,31 @@ template<typename T >
        std::vector<T> operator* std::vector< T > operator* (std::vector< std::vector< T >> const & std::vector< std::vector< T > > const &  A,
        -

        multiplication of a matrix with a column vector

        Returns
        resultant vector
        -
        113  {
        -
        114  // Number of rows in A
        -
        115  size_t N_A = A.size();
        -
        116 
        -
        117  std::vector<T> result(N_A);
        -
        118 
        -
        119  if (A[0].size() != B.size()) {
        -
        120  std::cerr << "Number of columns in A != Number of rows in B ("
        -
        121  << A[0].size() << ", " << B.size() << ")" << std::endl;
        -
        122  return result;
        -
        123  }
        -
        124 
        -
        125  for (size_t row = 0; row < N_A; row++) {
        -
        126  result[row] = static_cast<T>(0);
        -
        127  for (size_t j = 0; j < B.size(); j++) result[row] += A[row][j] * B[j];
        -
        128  }
        -
        129 
        -
        130  return result;
        -
        131 }
        +

        multiplication of a matrix with a column vector

        Returns
        resultant vector
        +
        113 {
        +
        114 // Number of rows in A
        +
        115 size_t N_A = A.size();
        +
        116
        + +
        118
        +
        119 if (A[0].size() != B.size()) {
        +
        120 std::cerr << "Number of columns in A != Number of rows in B ("
        +
        121 << A[0].size() << ", " << B.size() << ")" << std::endl;
        +
        122 return result;
        +
        123 }
        +
        124
        +
        125 for (size_t row = 0; row < N_A; row++) {
        +
        126 result[row] = static_cast<T>(0);
        +
        127 for (size_t j = 0; j < B.size(); j++) result[row] += A[row][j] * B[j];
        +
        128 }
        +
        129
        +
        130 return result;
        +
        131}
        - -

        ◆ operator*() [4/4]

        + +

        ◆ operator*() [4/4]

        @@ -730,7 +729,7 @@ template<typename T >
        template<typename T >
        - + @@ -748,30 +747,30 @@ template<typename T >
        std::vector<float> operator* std::vector< float > operator* ( std::vector< T > const &  A,
        -

        post-multiplication of a vector by a scalar

        Returns
        resultant vector
        -
        156  {
        -
        157  // Number of rows in A
        -
        158  size_t N_A = A.size();
        -
        159 
        - -
        161 
        -
        162  for (size_t row = 0; row < N_A; row++) {
        -
        163  result[row] = A[row] * static_cast<float>(scalar);
        -
        164  }
        -
        165 
        -
        166  return result;
        -
        167 }
        +

        post-multiplication of a vector by a scalar

        Returns
        resultant vector
        +
        156 {
        +
        157 // Number of rows in A
        +
        158 size_t N_A = A.size();
        +
        159
        + +
        161
        +
        162 for (size_t row = 0; row < N_A; row++) {
        +
        163 result[row] = A[row] * static_cast<float>(scalar);
        +
        164 }
        +
        165
        +
        166 return result;
        +
        167}
        Here is the call graph for this function:
        -
        +
        - -

        ◆ operator+()

        + +

        ◆ operator+()

        @@ -779,7 +778,7 @@ Here is the call graph for this function:
        template<typename T >
        - + @@ -797,33 +796,33 @@ template<typename T >
        std::vector<T> operator+ std::vector< T > operator+ ( std::vector< T > const &  A,
        -

        addition of two vectors of identical lengths

        Returns
        resultant vector
        -
        204  {
        -
        205  // Number of rows in A
        -
        206  size_t N = A.size();
        -
        207 
        - -
        209 
        -
        210  if (B.size() != N) {
        -
        211  std::cerr << "Vector dimensions shouldbe identical!" << std::endl;
        -
        212  return A;
        -
        213  }
        -
        214 
        -
        215  for (size_t row = 0; row < N; row++) result[row] = A[row] + B[row];
        -
        216 
        -
        217  return result;
        -
        218 }
        +

        addition of two vectors of identical lengths

        Returns
        resultant vector
        +
        204 {
        +
        205 // Number of rows in A
        +
        206 size_t N = A.size();
        +
        207
        + +
        209
        +
        210 if (B.size() != N) {
        +
        211 std::cerr << "Vector dimensions shouldbe identical!" << std::endl;
        +
        212 return A;
        +
        213 }
        +
        214
        +
        215 for (size_t row = 0; row < N; row++) result[row] = A[row] + B[row];
        +
        216
        +
        217 return result;
        +
        218}
        Here is the call graph for this function:
        -
        +
        - -

        ◆ operator-()

        + +

        ◆ operator-()

        @@ -831,7 +830,7 @@ Here is the call graph for this function:
        template<typename T >
        - + @@ -849,33 +848,33 @@ template<typename T >
        std::vector<T> operator- std::vector< T > operator- ( std::vector< T > const &  A,
        -

        subtraction of two vectors of identical lengths

        Returns
        resultant vector
        -
        183  {
        -
        184  // Number of rows in A
        -
        185  size_t N = A.size();
        -
        186 
        - -
        188 
        -
        189  if (B.size() != N) {
        -
        190  std::cerr << "Vector dimensions shouldbe identical!" << std::endl;
        -
        191  return A;
        -
        192  }
        -
        193 
        -
        194  for (size_t row = 0; row < N; row++) result[row] = A[row] - B[row];
        -
        195 
        -
        196  return result;
        -
        197 }
        +

        subtraction of two vectors of identical lengths

        Returns
        resultant vector
        +
        183 {
        +
        184 // Number of rows in A
        +
        185 size_t N = A.size();
        +
        186
        + +
        188
        +
        189 if (B.size() != N) {
        +
        190 std::cerr << "Vector dimensions shouldbe identical!" << std::endl;
        +
        191 return A;
        +
        192 }
        +
        193
        +
        194 for (size_t row = 0; row < N; row++) result[row] = A[row] - B[row];
        +
        195
        +
        196 return result;
        +
        197}
        Here is the call graph for this function:
        -
        +
        - -

        ◆ operator/()

        + +

        ◆ operator/()

        @@ -883,7 +882,7 @@ Here is the call graph for this function:
        template<typename T >
        - + @@ -901,15 +900,15 @@ template<typename T >
        std::vector<float> operator/ std::vector< float > operator/ ( std::vector< T > const &  A,
        -

        division of a vector by a scalar

        Returns
        resultant vector
        -
        174  {
        -
        175  return (1.f / scalar) * A;
        -
        176 }
        +

        division of a vector by a scalar

        Returns
        resultant vector
        +
        174 {
        +
        175 return (1.f / scalar) * A;
        +
        176}
        - -

        ◆ operator<<() [1/2]

        + +

        ◆ operator<<() [1/2]

        @@ -917,7 +916,7 @@ template<typename T >
        template<typename T >
        - + @@ -925,7 +924,7 @@ template<typename T > - + @@ -935,35 +934,35 @@ template<typename T >
        std::ostream& operator<< std::ostream & operator<< ( std::ostream out,
        std::vector< std::vector< T >> const & std::vector< std::vector< T > > const &  v 
        -

        operator to print a matrix

        -
        23  {
        -
        24  const int width = 10;
        -
        25  const char separator = ' ';
        -
        26 
        -
        27  for (size_t row = 0; row < v.size(); row++) {
        -
        28  for (size_t col = 0; col < v[row].size(); col++) {
        -
        29  out << std::left << std::setw(width) << std::setfill(separator)
        -
        30  << v[row][col];
        -
        31  }
        -
        32  out << std::endl;
        -
        33  }
        -
        34 
        -
        35  return out;
        -
        36 }
        +

        operator to print a matrix

        +
        23 {
        +
        24 const int width = 10;
        +
        25 const char separator = ' ';
        +
        26
        +
        27 for (size_t row = 0; row < v.size(); row++) {
        +
        28 for (size_t col = 0; col < v[row].size(); col++) {
        +
        29 out << std::left << std::setw(width) << std::setfill(separator)
        +
        30 << v[row][col];
        +
        31 }
        +
        32 out << std::endl;
        +
        33 }
        +
        34
        +
        35 return out;
        +
        36}
        T left(T... args)
        T setfill(T... args)
        T setw(T... args)
        Here is the call graph for this function:
        -
        +
        - -

        ◆ operator<<() [2/2]

        + +

        ◆ operator<<() [2/2]

        @@ -971,7 +970,7 @@ Here is the call graph for this function:
        template<typename T >
        - + @@ -989,29 +988,29 @@ template<typename T >
        std::ostream& operator<< std::ostream & operator<< ( std::ostream out,
        -

        operator to print a vector

        -
        42  {
        -
        43  const int width = 15;
        -
        44  const char separator = ' ';
        -
        45 
        -
        46  for (size_t row = 0; row < v.size(); row++) {
        -
        47  out << std::left << std::setw(width) << std::setfill(separator)
        -
        48  << v[row];
        -
        49  }
        -
        50 
        -
        51  return out;
        -
        52 }
        +

        operator to print a vector

        +
        42 {
        +
        43 const int width = 15;
        +
        44 const char separator = ' ';
        +
        45
        +
        46 for (size_t row = 0; row < v.size(); row++) {
        +
        47 out << std::left << std::setw(width) << std::setfill(separator)
        +
        48 << v[row];
        +
        49 }
        +
        50
        +
        51 return out;
        +
        52}
        Here is the call graph for this function:
        -
        +
        - -

        ◆ predict_OLS_regressor()

        + +

        ◆ predict_OLS_regressor()

        @@ -1019,9 +1018,9 @@ Here is the call graph for this function:
        template<typename T >
        - + - + @@ -1037,7 +1036,7 @@ template<typename T >
        std::vector<float> predict_OLS_regressor std::vector< float > predict_OLS_regressor (std::vector< std::vector< T >> const & std::vector< std::vector< T > > const &  X,
        -

        Given data and OLS model coeffficients, predict regression estimates. This operation is defined as

        +

        Given data and OLS model coeffficients, predict regression estimates. This operation is defined as

        \[y_{\text{row}=i} = \sum_{j=\text{columns}}\beta_j\cdot X_{i,j}\]

        Parameters
        @@ -1048,19 +1047,19 @@ template<typename T >
        Returns
        vector with regression values for each sample
        -
        354  {
        - -
        356 
        -
        357  for (size_t rows = 0; rows < X.size(); rows++) {
        -
        358  // -> start with constant term
        -
        359  result[rows] = beta[X[0].size()];
        -
        360  for (size_t cols = 0; cols < X[0].size(); cols++) {
        -
        361  result[rows] += beta[cols] * X[rows][cols];
        -
        362  }
        -
        363  }
        -
        364  // Nx1
        -
        365  return result;
        -
        366 }
        +
        354 {
        + +
        356
        +
        357 for (size_t rows = 0; rows < X.size(); rows++) {
        +
        358 // -> start with constant term
        +
        359 result[rows] = beta[X[0].size()];
        +
        360 for (size_t cols = 0; cols < X[0].size(); cols++) {
        +
        361 result[rows] += beta[cols] * X[rows][cols];
        +
        362 }
        +
        363 }
        +
        364 // Nx1
        +
        365 return result;
        +
        366}
        @@ -1070,7 +1069,7 @@ template<typename T > diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp.js b/dc/d38/ordinary__least__squares__regressor_8cpp.js index 9868769f4..24b195c9a 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp.js +++ b/dc/d38/ordinary__least__squares__regressor_8cpp.js @@ -1,19 +1,19 @@ var ordinary__least__squares__regressor_8cpp = [ - [ "fit_OLS_regressor", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a38ff1d954e9b7de93eb20e2dd101a045", null ], - [ "get_inverse", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a98ab8f75d981088369b89b8be2182483", null ], - [ "get_transpose", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a889f9de199fa793497c864d8e493af05", null ], - [ "is_square", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a4921874435266592b222e3f2eda0e01f", null ], + [ "fit_OLS_regressor", "dc/d38/ordinary__least__squares__regressor_8cpp.html#aaddc683af581b51351e1023d2a01ef3b", null ], + [ "get_inverse", "dc/d38/ordinary__least__squares__regressor_8cpp.html#af7243bdc6ae3c7169f01b85bb226e66a", null ], + [ "get_transpose", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a21c80569aaffb7bf1657e54fa4b97deb", null ], + [ "is_square", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a8fa731952b0ee3bc7ec51c51ed21911e", null ], [ "main", "dc/d38/ordinary__least__squares__regressor_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "ols_test", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a4261f3c3c3dfdb86f3004eb8aaffea8d", null ], - [ "operator*", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a9b2b5da35a6ba8ae203c33739ef0b91d", null ], - [ "operator*", "dc/d38/ordinary__least__squares__regressor_8cpp.html#ab6171f4db68a5e50ae0f3500a63acd26", null ], - [ "operator*", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a64d9dd5c5816d6d907b00e5f4b0372a5", null ], - [ "operator*", "dc/d38/ordinary__least__squares__regressor_8cpp.html#aecef32c2a4f39a3f7398949256d180a6", null ], - [ "operator+", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a67249e31221231cf3aaf3cfd870372d0", null ], - [ "operator-", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a31be3fe36e76b87d5616ff8e7918cd24", null ], - [ "operator/", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a30acf52af3184bc22274234ef5a73536", null ], - [ "operator<<", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a98eb5807f21b783c341cab402ced6732", null ], - [ "operator<<", "dc/d38/ordinary__least__squares__regressor_8cpp.html#aa799b4cec1681219887d89d037cfab50", null ], - [ "predict_OLS_regressor", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a4bcaaf41c66da4d3a471dacef133def7", null ] + [ "operator*", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a207b3a99fd5974d3117e0b0ac0aad234", null ], + [ "operator*", "dc/d38/ordinary__least__squares__regressor_8cpp.html#ae2edd40354a1ca7aeaee3d1e3589e713", null ], + [ "operator*", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a865e8d26a01962cc93aca66e71346f37", null ], + [ "operator*", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a42535e20e97d85aa61271e0894cc0359", null ], + [ "operator+", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a01e6c7bf2b09272578b9c5819ce0f36f", null ], + [ "operator-", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a4a6a560dbdd0177633783b72db37dc19", null ], + [ "operator/", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a7a2d742b9a3ae7b85292e1f86428bb4f", null ], + [ "operator<<", "dc/d38/ordinary__least__squares__regressor_8cpp.html#a7075a0fccad9b2d79be0275bfe8948d4", null ], + [ "operator<<", "dc/d38/ordinary__least__squares__regressor_8cpp.html#ab1ad727903d7817c2758d25bcb52cbc8", null ], + [ "predict_OLS_regressor", "dc/d38/ordinary__least__squares__regressor_8cpp.html#ade6e463f37878fe2a219f927c65b5493", null ] ]; \ No newline at end of file diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a67249e31221231cf3aaf3cfd870372d0_cgraph.map b/dc/d38/ordinary__least__squares__regressor_8cpp_a01e6c7bf2b09272578b9c5819ce0f36f_cgraph.map similarity index 100% rename from dc/d38/ordinary__least__squares__regressor_8cpp_a67249e31221231cf3aaf3cfd870372d0_cgraph.map rename to dc/d38/ordinary__least__squares__regressor_8cpp_a01e6c7bf2b09272578b9c5819ce0f36f_cgraph.map diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a67249e31221231cf3aaf3cfd870372d0_cgraph.md5 b/dc/d38/ordinary__least__squares__regressor_8cpp_a01e6c7bf2b09272578b9c5819ce0f36f_cgraph.md5 similarity index 100% rename from dc/d38/ordinary__least__squares__regressor_8cpp_a67249e31221231cf3aaf3cfd870372d0_cgraph.md5 rename to dc/d38/ordinary__least__squares__regressor_8cpp_a01e6c7bf2b09272578b9c5819ce0f36f_cgraph.md5 diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a67249e31221231cf3aaf3cfd870372d0_cgraph.svg b/dc/d38/ordinary__least__squares__regressor_8cpp_a01e6c7bf2b09272578b9c5819ce0f36f_cgraph.svg similarity index 97% rename from dc/d38/ordinary__least__squares__regressor_8cpp_a67249e31221231cf3aaf3cfd870372d0_cgraph.svg rename to dc/d38/ordinary__least__squares__regressor_8cpp_a01e6c7bf2b09272578b9c5819ce0f36f_cgraph.svg index 10f2e30cf..88b711e21 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_a67249e31221231cf3aaf3cfd870372d0_cgraph.svg +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_a01e6c7bf2b09272578b9c5819ce0f36f_cgraph.svg @@ -1,7 +1,7 @@ - - - - + - - - + + + - + diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a4261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.md5 b/dc/d38/ordinary__least__squares__regressor_8cpp_a4261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.md5 index b8c482427..130a3d088 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_a4261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.md5 +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_a4261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.md5 @@ -1 +1 @@ -b41e39198c313401444f601cb48cb02f \ No newline at end of file +20f8eecc6023e78f6bd8e374c7bf9598 \ No newline at end of file diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a4261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.svg b/dc/d38/ordinary__least__squares__regressor_8cpp_a4261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.svg index 058f0849e..10c9a5678 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_a4261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.svg +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_a4261f3c3c3dfdb86f3004eb8aaffea8d_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + fit_OLS_regressor @@ -66,7 +66,7 @@ Node9 - + predict_OLS_regressor @@ -81,7 +81,7 @@ Node4 - + get_inverse @@ -96,7 +96,7 @@ Node6 - + get_transpose @@ -138,7 +138,7 @@ Node5 - + is_square diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a31be3fe36e76b87d5616ff8e7918cd24_cgraph.map b/dc/d38/ordinary__least__squares__regressor_8cpp_a4a6a560dbdd0177633783b72db37dc19_cgraph.map similarity index 100% rename from dc/d38/ordinary__least__squares__regressor_8cpp_a31be3fe36e76b87d5616ff8e7918cd24_cgraph.map rename to dc/d38/ordinary__least__squares__regressor_8cpp_a4a6a560dbdd0177633783b72db37dc19_cgraph.map diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a31be3fe36e76b87d5616ff8e7918cd24_cgraph.md5 b/dc/d38/ordinary__least__squares__regressor_8cpp_a4a6a560dbdd0177633783b72db37dc19_cgraph.md5 similarity index 100% rename from dc/d38/ordinary__least__squares__regressor_8cpp_a31be3fe36e76b87d5616ff8e7918cd24_cgraph.md5 rename to dc/d38/ordinary__least__squares__regressor_8cpp_a4a6a560dbdd0177633783b72db37dc19_cgraph.md5 diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a31be3fe36e76b87d5616ff8e7918cd24_cgraph.svg b/dc/d38/ordinary__least__squares__regressor_8cpp_a4a6a560dbdd0177633783b72db37dc19_cgraph.svg similarity index 97% rename from dc/d38/ordinary__least__squares__regressor_8cpp_a31be3fe36e76b87d5616ff8e7918cd24_cgraph.svg rename to dc/d38/ordinary__least__squares__regressor_8cpp_a4a6a560dbdd0177633783b72db37dc19_cgraph.svg index 10302b08d..e55a995fa 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_a31be3fe36e76b87d5616ff8e7918cd24_cgraph.svg +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_a4a6a560dbdd0177633783b72db37dc19_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + - + diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_aaddc683af581b51351e1023d2a01ef3b_cgraph.md5 b/dc/d38/ordinary__least__squares__regressor_8cpp_aaddc683af581b51351e1023d2a01ef3b_cgraph.md5 new file mode 100644 index 000000000..1e069b33b --- /dev/null +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_aaddc683af581b51351e1023d2a01ef3b_cgraph.md5 @@ -0,0 +1 @@ +a676c3b9f0e8c83ea213364781bf7f2f \ No newline at end of file diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a38ff1d954e9b7de93eb20e2dd101a045_cgraph.svg b/dc/d38/ordinary__least__squares__regressor_8cpp_aaddc683af581b51351e1023d2a01ef3b_cgraph.svg similarity index 95% rename from dc/d38/ordinary__least__squares__regressor_8cpp_a38ff1d954e9b7de93eb20e2dd101a045_cgraph.svg rename to dc/d38/ordinary__least__squares__regressor_8cpp_aaddc683af581b51351e1023d2a01ef3b_cgraph.svg index cf3dee639..7f5d6a438 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_a38ff1d954e9b7de93eb20e2dd101a045_cgraph.svg +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_aaddc683af581b51351e1023d2a01ef3b_cgraph.svg @@ -1,7 +1,7 @@ - Node2 - + get_inverse @@ -36,7 +36,7 @@ Node5 - + get_transpose @@ -96,7 +96,7 @@ Node4 - + is_square diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_aa799b4cec1681219887d89d037cfab50_cgraph.map b/dc/d38/ordinary__least__squares__regressor_8cpp_ab1ad727903d7817c2758d25bcb52cbc8_cgraph.map similarity index 100% rename from dc/d38/ordinary__least__squares__regressor_8cpp_aa799b4cec1681219887d89d037cfab50_cgraph.map rename to dc/d38/ordinary__least__squares__regressor_8cpp_ab1ad727903d7817c2758d25bcb52cbc8_cgraph.map diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_aa799b4cec1681219887d89d037cfab50_cgraph.md5 b/dc/d38/ordinary__least__squares__regressor_8cpp_ab1ad727903d7817c2758d25bcb52cbc8_cgraph.md5 similarity index 100% rename from dc/d38/ordinary__least__squares__regressor_8cpp_aa799b4cec1681219887d89d037cfab50_cgraph.md5 rename to dc/d38/ordinary__least__squares__regressor_8cpp_ab1ad727903d7817c2758d25bcb52cbc8_cgraph.md5 diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_aa799b4cec1681219887d89d037cfab50_cgraph.svg b/dc/d38/ordinary__least__squares__regressor_8cpp_ab1ad727903d7817c2758d25bcb52cbc8_cgraph.svg similarity index 98% rename from dc/d38/ordinary__least__squares__regressor_8cpp_aa799b4cec1681219887d89d037cfab50_cgraph.svg rename to dc/d38/ordinary__least__squares__regressor_8cpp_ab1ad727903d7817c2758d25bcb52cbc8_cgraph.svg index 4d9bceb79..0429ea0f3 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_aa799b4cec1681219887d89d037cfab50_cgraph.svg +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_ab1ad727903d7817c2758d25bcb52cbc8_cgraph.svg @@ -1,7 +1,7 @@ - - + - - - + + + - + diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 5d5db2815..8c4241131 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -5c454d87fa5c41e1db467dc8dbfaac75 \ No newline at end of file +fb33991d565279acecdff0753d140bfc \ No newline at end of file diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index a59f5d936..94b280720 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - @@ -82,7 +82,7 @@ var sectionId = 'dynsection-3'; Node3 - + fit_OLS_regressor @@ -112,7 +112,7 @@ var sectionId = 'dynsection-3'; Node10 - + predict_OLS_regressor @@ -127,7 +127,7 @@ var sectionId = 'dynsection-3'; Node4 - + get_inverse @@ -142,7 +142,7 @@ var sectionId = 'dynsection-3'; Node6 - + get_transpose @@ -193,7 +193,7 @@ var sectionId = 'dynsection-3'; Node5 - + is_square diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg b/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg index 0779a8492..6e21fc774 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg @@ -1,7 +1,7 @@ - Node3 - + fit_OLS_regressor @@ -66,7 +66,7 @@ Node10 - + predict_OLS_regressor @@ -81,7 +81,7 @@ Node4 - + get_inverse @@ -96,7 +96,7 @@ Node6 - + get_transpose @@ -147,7 +147,7 @@ Node5 - + is_square diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a98ab8f75d981088369b89b8be2182483_cgraph.map b/dc/d38/ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.map similarity index 86% rename from dc/d38/ordinary__least__squares__regressor_8cpp_a98ab8f75d981088369b89b8be2182483_cgraph.map rename to dc/d38/ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.map index a078bf33a..495c0455e 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_a98ab8f75d981088369b89b8be2182483_cgraph.map +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.md5 b/dc/d38/ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.md5 new file mode 100644 index 000000000..a38f651bd --- /dev/null +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.md5 @@ -0,0 +1 @@ +c4465ebf17ab4116040a9ef4bc512035 \ No newline at end of file diff --git a/dc/d38/ordinary__least__squares__regressor_8cpp_a98ab8f75d981088369b89b8be2182483_cgraph.svg b/dc/d38/ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.svg similarity index 94% rename from dc/d38/ordinary__least__squares__regressor_8cpp_a98ab8f75d981088369b89b8be2182483_cgraph.svg rename to dc/d38/ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.svg index 5b25485ee..abe008d0b 100644 --- a/dc/d38/ordinary__least__squares__regressor_8cpp_a98ab8f75d981088369b89b8be2182483_cgraph.svg +++ b/dc/d38/ordinary__least__squares__regressor_8cpp_af7243bdc6ae3c7169f01b85bb226e66a_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + is_square diff --git a/dc/d40/fast__integer__input_8cpp__incl.svg b/dc/d40/fast__integer__input_8cpp__incl.svg index 62fdea1d7..8ba2237ca 100644 --- a/dc/d40/fast__integer__input_8cpp__incl.svg +++ b/dc/d40/fast__integer__input_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: backtracking/rat_maze.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('dc/d5a/rat__maze_8cpp.html','../../'); -
        -
        rat_maze.cpp File Reference
        +
        rat_maze.cpp File Reference
        @@ -111,17 +110,17 @@ Include dependency graph for rat_maze.cpp:
        - - + - +

        +

        Namespaces

         backtracking
        namespace  backtracking
         Backtracking algorithms.
         
         rat_maze
        namespace  rat_maze
         Functions for <a href="https://www.codesdope.com/blog/article/backtracking-to- solve-a-rat-in-a-maze-c-java-pytho/".
         
        - @@ -135,15 +134,15 @@ Functions

        +

        Functions

        template<size_t size>
        bool backtracking::rat_maze::solveMaze (int currposrow, int currposcol, const std::array< std::array< int, size >, size > &maze, std::array< std::array< int, size >, size > soln)
         

        Detailed Description

        -

        Implements <a href="https://www.codesdope.com/blog/article/backtracking-to- +

        Implements <a href="https://www.codesdope.com/blog/article/backtracking-to- solve-a-rat-in-a-maze-c-java-pytho/".

        -

        >Rat in a Maze algorithm

        -

        A Maze is given as N*N binary matrix of blocks where source block is the upper left most block i.e., maze[0][0] and destination block is lower rightmost block i.e., maze[N-1][N-1]. A rat starts from source and has to reach destination. The rat can move only in two directions: forward and down. In the maze matrix, 0 means the block is dead end and 1 means the block can be used in the path from source to destination.

        -
        Author
        Vaibhav Thakkar
        +

        target="_blank" >Rat in a Maze algorithm

        +

        A Maze is given as N*N binary matrix of blocks where source block is the upper left most block i.e., maze[0][0] and destination block is lower rightmost block i.e., maze[N-1][N-1]. A rat starts from source and has to reach destination. The rat can move only in two directions: forward and down. In the maze matrix, 0 means the block is dead end and 1 means the block can be used in the path from source to destination.

        +
        Author
        Vaibhav Thakkar
        -David Leal
        +David Leal

        Function Documentation

        - +

        ◆ main()

        @@ -161,10 +160,10 @@ solve-a-rat-in-a-maze-c-java-pytho/".

        Main function.

        Returns
        0 on exit
        -
        110  {
        -
        111  test(); // run the tests
        -
        112  return 0;
        -
        113 }
        +
        110 {
        +
        111 test(); // run the tests
        +
        112 return 0;
        +
        113}
        static void test()
        Test implementations.
        Definition: rat_maze.cpp:84
        Here is the call graph for this function:
        @@ -175,7 +174,7 @@ Here is the call graph for this function:
        - +

        ◆ solveMaze()

        @@ -232,36 +231,36 @@ template<size_t size>
        Returns
        0 on end
        -
        47  {
        -
        48  if ((currposrow == size - 1) && (currposcol == size - 1)) {
        -
        49  soln[currposrow][currposcol] = 1;
        -
        50  for (int i = 0; i < size; ++i) {
        -
        51  for (int j = 0; j < size; ++j) {
        -
        52  std::cout << soln[i][j] << " ";
        -
        53  }
        - -
        55  }
        -
        56  return true;
        -
        57  } else {
        -
        58  soln[currposrow][currposcol] = 1;
        -
        59 
        -
        60  // if there exist a solution by moving one step ahead in a column
        -
        61  if ((currposcol < size - 1) && maze[currposrow][currposcol + 1] == 1 &&
        -
        62  solveMaze(currposrow, currposcol + 1, maze, soln)) {
        -
        63  return true;
        -
        64  }
        -
        65 
        -
        66  // if there exists a solution by moving one step ahead in a row
        -
        67  if ((currposrow < size - 1) && maze[currposrow + 1][currposcol] == 1 &&
        -
        68  solveMaze(currposrow + 1, currposcol, maze, soln)) {
        -
        69  return true;
        -
        70  }
        -
        71 
        -
        72  // the backtracking part
        -
        73  soln[currposrow][currposcol] = 0;
        -
        74  return false;
        -
        75  }
        -
        76 }
        +
        47 {
        +
        48 if ((currposrow == size - 1) && (currposcol == size - 1)) {
        +
        49 soln[currposrow][currposcol] = 1;
        +
        50 for (int i = 0; i < size; ++i) {
        +
        51 for (int j = 0; j < size; ++j) {
        +
        52 std::cout << soln[i][j] << " ";
        +
        53 }
        + +
        55 }
        +
        56 return true;
        +
        57 } else {
        +
        58 soln[currposrow][currposcol] = 1;
        +
        59
        +
        60 // if there exist a solution by moving one step ahead in a column
        +
        61 if ((currposcol < size - 1) && maze[currposrow][currposcol + 1] == 1 &&
        +
        62 solveMaze(currposrow, currposcol + 1, maze, soln)) {
        +
        63 return true;
        +
        64 }
        +
        65
        +
        66 // if there exists a solution by moving one step ahead in a row
        +
        67 if ((currposrow < size - 1) && maze[currposrow + 1][currposcol] == 1 &&
        +
        68 solveMaze(currposrow + 1, currposcol, maze, soln)) {
        +
        69 return true;
        +
        70 }
        +
        71
        +
        72 // the backtracking part
        +
        73 soln[currposrow][currposcol] = 0;
        +
        74 return false;
        +
        75 }
        +
        76}
        T endl(T... args)
        bool solveMaze(int currposrow, int currposcol, const std::array< std::array< int, size >, size > &maze, std::array< std::array< int, size >, size > soln)
        Solve rat maze problem.
        Definition: rat_maze.cpp:45
        @@ -274,7 +273,7 @@ Here is the call graph for this function:
        - +

        ◆ test()

        @@ -301,27 +300,27 @@ Here is the call graph for this function:
        Returns
        void
        Examples
        /Users/runner/work/C-Plus-Plus/C-Plus-Plus/numerical_methods/rungekutta.cpp, and /Users/runner/work/C-Plus-Plus/C-Plus-Plus/sorting/wiggle_sort.cpp.
        -
        84  {
        -
        85  const int size = 4;
        -
        86  std::array<std::array<int, size>, size> maze = {
        -
        87  std::array<int, size>{1, 0, 1, 0}, std::array<int, size>{1, 0, 1, 1},
        -
        88  std::array<int, size>{1, 0, 0, 1}, std::array<int, size>{1, 1, 1, 1}};
        -
        89 
        - -
        91 
        -
        92  // Backtracking: setup matrix solution to zero
        -
        93  for (int i = 0; i < size; ++i) {
        -
        94  for (int j = 0; j < size; ++j) {
        -
        95  soln[i][j] = 0;
        -
        96  }
        -
        97  }
        -
        98 
        -
        99  int currposrow = 0; // Current position in rows
        -
        100  int currposcol = 0; // Current position in columns
        -
        101 
        -
        102  assert(backtracking::rat_maze::solveMaze<size>(currposrow, currposcol, maze,
        -
        103  soln) == 1);
        -
        104 }
        +
        84 {
        +
        85 const int size = 4;
        + +
        87 std::array<int, size>{1, 0, 1, 0}, std::array<int, size>{1, 0, 1, 1},
        +
        88 std::array<int, size>{1, 0, 0, 1}, std::array<int, size>{1, 1, 1, 1}};
        +
        89
        + +
        91
        +
        92 // Backtracking: setup matrix solution to zero
        +
        93 for (int i = 0; i < size; ++i) {
        +
        94 for (int j = 0; j < size; ++j) {
        +
        95 soln[i][j] = 0;
        +
        96 }
        +
        97 }
        +
        98
        +
        99 int currposrow = 0; // Current position in rows
        +
        100 int currposcol = 0; // Current position in columns
        +
        101
        +
        102 assert(backtracking::rat_maze::solveMaze<size>(currposrow, currposcol, maze,
        +
        103 soln) == 1);
        +
        104}
        @@ -332,7 +331,7 @@ Here is the call graph for this function: diff --git a/dc/d5a/rat__maze_8cpp_ab99107bfb4c6934cd4691868c66c0aa3_cgraph.svg b/dc/d5a/rat__maze_8cpp_ab99107bfb4c6934cd4691868c66c0aa3_cgraph.svg index 6b80ce12e..151eb5d5b 100644 --- a/dc/d5a/rat__maze_8cpp_ab99107bfb4c6934cd4691868c66c0aa3_cgraph.svg +++ b/dc/d5a/rat__maze_8cpp_ab99107bfb4c6934cd4691868c66c0aa3_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,30 +90,29 @@ $(document).ready(function(){initNavTree('da/d70/structmachine__learning_1_1ayst
        -
        -
        machine_learning::aystar_search::AyStarSearch< Puzzle >::Info Member List
        +
        machine_learning::aystar_search::AyStarSearch< Puzzle >::Info Member List

        This is the complete list of members for machine_learning::aystar_search::AyStarSearch< Puzzle >::Info, including all inherited members.

        - + - + - + - - - + + +
        depthmachine_learning::aystar_search::AyStarSearch< Puzzle >::Info
        heuristic_valuemachine_learning::aystar_search::AyStarSearch< Puzzle >::Info
        heuristic_valuemachine_learning::aystar_search::AyStarSearch< Puzzle >::Info
        Info()=defaultmachine_learning::aystar_search::AyStarSearch< Puzzle >::Info
        Info(const Puzzle &A)machine_learning::aystar_search::AyStarSearch< Puzzle >::Infoinlineexplicit
        Info(const Puzzle &A)machine_learning::aystar_search::AyStarSearch< Puzzle >::Infoinlineexplicit
        Info(const Puzzle &A, size_t h_value, size_t d)machine_learning::aystar_search::AyStarSearch< Puzzle >::Infoinline
        Info(const Info &A)machine_learning::aystar_search::AyStarSearch< Puzzle >::Infoinline
        Info(const Info &A)machine_learning::aystar_search::AyStarSearch< Puzzle >::Infoinline
        Info(const Info &&A) noexceptmachine_learning::aystar_search::AyStarSearch< Puzzle >::Infoinline
        operator=(const Info &A)machine_learning::aystar_search::AyStarSearch< Puzzle >::Infoinline
        operator=(Info &&A) noexceptmachine_learning::aystar_search::AyStarSearch< Puzzle >::Infoinline
        state (defined in machine_learning::aystar_search::AyStarSearch< Puzzle >::Info)machine_learning::aystar_search::AyStarSearch< Puzzle >::Info
        operator=(const Info &A)machine_learning::aystar_search::AyStarSearch< Puzzle >::Infoinline
        operator=(Info &&A) noexceptmachine_learning::aystar_search::AyStarSearch< Puzzle >::Infoinline
        state (defined in machine_learning::aystar_search::AyStarSearch< Puzzle >::Info)machine_learning::aystar_search::AyStarSearch< Puzzle >::Info
        ~Info()=defaultmachine_learning::aystar_search::AyStarSearch< Puzzle >::Info
        diff --git a/dc/d5f/qr__decompose_8h__dep__incl.svg b/dc/d5f/qr__decompose_8h__dep__incl.svg index 0f04e2214..2d431d53b 100644 --- a/dc/d5f/qr__decompose_8h__dep__incl.svg +++ b/dc/d5f/qr__decompose_8h__dep__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: graph::Graph< T > Class Template Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -95,8 +95,7 @@ $(document).ready(function(){initNavTree('dc/d61/classgraph_1_1_graph.html','../ Public Attributes | Private Attributes | List of all members -
        -
        graph::Graph< T > Class Template Reference
        +
        graph::Graph< T > Class Template Reference
        @@ -105,44 +104,36 @@ Inheritance diagram for graph::Graph< T >:
        [legend]
        -
        -Collaboration diagram for graph::Graph< T >:
        -
        -
        -
        -
        [legend]
        - - - + +

        +

        Public Member Functions

        void add_edge (T u, T v, bool bidir=true)
         
        std::map< T, bool > breadth_first_search (T src)
         
        std::map< T, bool > breadth_first_search (T src)
         
         Graph (size_t N, const std::vector< std::pair< int, int > > &undirected_edges)
         Populate the adjacency list for each vertex in the graph. Assumes that evey edge is a pair of valid vertex indices. More...
         
        int number_of_vertices () const
         
        - - +

        +

        Public Attributes

        -std::vector< std::vector< int > > neighbors
        +std::vector< std::vector< int > > neighbors
         for each vertex it stores a list indicies of its neighbors
         
        -

        +

        Private Attributes

        std::map< T, std::list< T > > adjacency_list
         

        Detailed Description

        -

        template<typename T>
        -class graph::Graph< T >

        - -

        Class for representing a graph as an adjacency list. Its vertices are indexed 0, 1, ..., N - 1.

        +
        template<typename T>
        +class graph::Graph< T >

        Class for representing a graph as an adjacency list. Its vertices are indexed 0, 1, ..., N - 1.

        Constructor & Destructor Documentation

        - +

        ◆ Graph()

        @@ -186,27 +177,19 @@ template<typename T >
        -
        62  {
        -
        63  neighbors.resize(N);
        -
        64  for (auto &edge : undirected_edges) {
        -
        65  neighbors[edge.first].push_back(edge.second);
        -
        66  neighbors[edge.second].push_back(edge.first);
        -
        67  }
        -
        68  }
        +
        62 {
        +
        63 neighbors.resize(N);
        +
        64 for (auto &edge : undirected_edges) {
        +
        65 neighbors[edge.first].push_back(edge.second);
        +
        66 neighbors[edge.second].push_back(edge.first);
        +
        67 }
        +
        68 }
        std::vector< std::vector< int > > neighbors
        for each vertex it stores a list indicies of its neighbors
        Definition: lowest_common_ancestor.cpp:77
        -
        T push_back(T... args)
        -
        T resize(T... args)
        -
        -Here is the call graph for this function:
        -
        -
        -
        -
        - +

        Member Function Documentation

        - +

        ◆ add_edge()

        @@ -247,30 +230,30 @@ template<typename T >
        -

        add_edge(u,v,bidir) is used to add an edge between node u and node v by default , bidir is made true , i.e graph is bidirectional . It means if edge(u,v) is added then u-->v and v-->u both edges exist.

        -

        to make the graph unidirectional pass the third parameter of add_edge as false which will

        -
        74  {
        -
        75  /**
        -
        76  * add_edge(u,v,bidir) is used to add an edge between node u and
        -
        77  * node v by default , bidir is made true , i.e graph is
        -
        78  * bidirectional . It means if edge(u,v) is added then u-->v and
        -
        79  * v-->u both edges exist.
        -
        80  *
        -
        81  * to make the graph unidirectional pass the third parameter of
        -
        82  * add_edge as false which will
        -
        83  */
        -
        84  adjacency_list[u].push_back(v); // u-->v edge added
        -
        85  if (bidir == true) {
        -
        86  // if graph is bidirectional
        -
        87  adjacency_list[v].push_back(u); // v-->u edge added
        -
        88  }
        -
        89  }
        +

        add_edge(u,v,bidir) is used to add an edge between node u and node v by default , bidir is made true , i.e graph is bidirectional . It means if edge(u,v) is added then u-->v and v-->u both edges exist.

        +

        to make the graph unidirectional pass the third parameter of add_edge as false which will

        +
        74 {
        +
        75 /**
        +
        76 * add_edge(u,v,bidir) is used to add an edge between node u and
        +
        77 * node v by default , bidir is made true , i.e graph is
        +
        78 * bidirectional . It means if edge(u,v) is added then u-->v and
        +
        79 * v-->u both edges exist.
        +
        80 *
        +
        81 * to make the graph unidirectional pass the third parameter of
        +
        82 * add_edge as false which will
        +
        83 */
        +
        84 adjacency_list[u].push_back(v); // u-->v edge added
        +
        85 if (bidir == true) {
        +
        86 // if graph is bidirectional
        +
        87 adjacency_list[v].push_back(u); // v-->u edge added
        +
        88 }
        +
        89 }
        std::map< T, std::list< T > > adjacency_list
        Definition: breadth_first_search.cpp:69
        - -

        ◆ breadth_first_search()

        + +

        ◆ breadth_first_search()

        @@ -281,7 +264,7 @@ template<typename T >
        - + @@ -294,55 +277,55 @@ template<typename T >
        std::map<T, bool> graph::Graph< T >::breadth_first_search std::map< T, bool > graph::Graph< T >::breadth_first_search ( src)
        -

        this function performs the breadth first search on graph and return a mapping which maps the nodes to a boolean value representing whether the node was traversed or not.

        -

        mapping to keep track of all visited nodes

        -

        initialise every possible vertex to map to false initially none of the vertices are unvisited

        -

        queue to store the nodes which are yet to be traversed

        -

        push the source vertex to queue to begin traversing

        -

        mark the source vertex as visited

        -

        traverse the graph till no connected vertex are left extract a node from queue for further traversal

        -

        remove the node from the queue

        -

        check every vertex connected to the node which are still unvisited

        -

        if the neighbour is unvisited , push it into the queue

        -

        mark the neighbour as visited

        -
        96  {
        -
        97  /// mapping to keep track of all visited nodes
        -
        98  std::map<T, bool> visited;
        -
        99  /// initialise every possible vertex to map to false
        -
        100  /// initially none of the vertices are unvisited
        -
        101  for (auto const &adjlist : adjacency_list) {
        -
        102  visited[adjlist.first] = false;
        -
        103  for (auto const &node : adjacency_list[adjlist.first]) {
        -
        104  visited[node] = false;
        -
        105  }
        -
        106  }
        -
        107 
        -
        108  /// queue to store the nodes which are yet to be traversed
        -
        109  std::queue<T> tracker;
        -
        110 
        -
        111  /// push the source vertex to queue to begin traversing
        -
        112  tracker.push(src);
        -
        113  /// mark the source vertex as visited
        -
        114  visited[src] = true;
        -
        115  while (!tracker.empty()) {
        -
        116  /// traverse the graph till no connected vertex are left
        -
        117  /// extract a node from queue for further traversal
        -
        118  T node = tracker.front();
        -
        119  /// remove the node from the queue
        -
        120  tracker.pop();
        -
        121  for (T const &neighbour : adjacency_list[node]) {
        -
        122  /// check every vertex connected to the node which are still
        -
        123  /// unvisited
        -
        124  if (!visited[neighbour]) {
        -
        125  /// if the neighbour is unvisited , push it into the queue
        -
        126  tracker.push(neighbour);
        -
        127  /// mark the neighbour as visited
        -
        128  visited[neighbour] = true;
        -
        129  }
        -
        130  }
        -
        131  }
        -
        132  return visited;
        -
        133  }
        +

        this function performs the breadth first search on graph and return a mapping which maps the nodes to a boolean value representing whether the node was traversed or not.

        +

        mapping to keep track of all visited nodes

        +

        initialise every possible vertex to map to false initially none of the vertices are unvisited

        +

        queue to store the nodes which are yet to be traversed

        +

        push the source vertex to queue to begin traversing

        +

        mark the source vertex as visited

        +

        traverse the graph till no connected vertex are left extract a node from queue for further traversal

        +

        remove the node from the queue

        +

        check every vertex connected to the node which are still unvisited

        +

        if the neighbour is unvisited , push it into the queue

        +

        mark the neighbour as visited

        +
        96 {
        +
        97 /// mapping to keep track of all visited nodes
        +
        98 std::map<T, bool> visited;
        +
        99 /// initialise every possible vertex to map to false
        +
        100 /// initially none of the vertices are unvisited
        +
        101 for (auto const &adjlist : adjacency_list) {
        +
        102 visited[adjlist.first] = false;
        +
        103 for (auto const &node : adjacency_list[adjlist.first]) {
        +
        104 visited[node] = false;
        +
        105 }
        +
        106 }
        +
        107
        +
        108 /// queue to store the nodes which are yet to be traversed
        +
        109 std::queue<T> tracker;
        +
        110
        +
        111 /// push the source vertex to queue to begin traversing
        +
        112 tracker.push(src);
        +
        113 /// mark the source vertex as visited
        +
        114 visited[src] = true;
        +
        115 while (!tracker.empty()) {
        +
        116 /// traverse the graph till no connected vertex are left
        +
        117 /// extract a node from queue for further traversal
        +
        118 T node = tracker.front();
        +
        119 /// remove the node from the queue
        +
        120 tracker.pop();
        +
        121 for (T const &neighbour : adjacency_list[node]) {
        +
        122 /// check every vertex connected to the node which are still
        +
        123 /// unvisited
        +
        124 if (!visited[neighbour]) {
        +
        125 /// if the neighbour is unvisited , push it into the queue
        +
        126 tracker.push(neighbour);
        +
        127 /// mark the neighbour as visited
        +
        128 visited[neighbour] = true;
        +
        129 }
        +
        130 }
        +
        131 }
        +
        132 return visited;
        +
        133 }
        T empty(T... args)
        T front(T... args)
        struct list node
        @@ -354,13 +337,13 @@ template<typename T >
        Here is the call graph for this function:
        -
        +
        - +

        ◆ number_of_vertices()

        @@ -384,20 +367,13 @@ template<typename T >
        -

        Function to get the number of vertices in the graph

        Returns
        the number of vertices in the graph.
        -
        74 { return neighbors.size(); }
        -
        T size(T... args)
        -
        -Here is the call graph for this function:
        -
        -
        -
        -
        - +

        Function to get the number of vertices in the graph

        Returns
        the number of vertices in the graph.
        +
        74{ return neighbors.size(); }
        +

        Member Data Documentation

        - +

        ◆ adjacency_list

        @@ -418,7 +394,7 @@ template<typename T >
        -

        adjacency_list maps every vertex to the list of its neighbours in the order in which they are added.

        +

        adjacency_list maps every vertex to the list of its neighbours in the order in which they are added.

        @@ -432,7 +408,7 @@ template<typename T > diff --git a/dc/d61/classgraph_1_1_graph.js b/dc/d61/classgraph_1_1_graph.js index 7fd8859cc..93fbaacdf 100644 --- a/dc/d61/classgraph_1_1_graph.js +++ b/dc/d61/classgraph_1_1_graph.js @@ -1,9 +1,8 @@ var classgraph_1_1_graph = [ - [ "Graph", "dc/d61/classgraph_1_1_graph.html#a190c0eb4739b6a8dfc1c3f684e66d937", null ], [ "Graph", "dc/d61/classgraph_1_1_graph.html#a8839fa14bff19d2deab4a618447c13e5", null ], [ "add_edge", "dc/d61/classgraph_1_1_graph.html#a877b2cba40d8d46dde6fb4209effed19", null ], - [ "breadth_first_search", "dc/d61/classgraph_1_1_graph.html#ab1a1a96cd4cddf0d4feb02855c4c16af", null ], + [ "breadth_first_search", "dc/d61/classgraph_1_1_graph.html#a3755ec9e6a842238c7f4aac10b661981", null ], [ "number_of_vertices", "dc/d61/classgraph_1_1_graph.html#a8930d1470d132b19e430d1c71f94c904", null ], [ "adjacency_list", "dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0", null ], [ "neighbors", "dc/d61/classgraph_1_1_graph.html#a59940c462861f2fcf4951d1b6c084e6a", null ] diff --git a/dc/d61/classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.map b/dc/d61/classgraph_1_1_graph_a3755ec9e6a842238c7f4aac10b661981_cgraph.map similarity index 100% rename from dc/d61/classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.map rename to dc/d61/classgraph_1_1_graph_a3755ec9e6a842238c7f4aac10b661981_cgraph.map diff --git a/dc/d61/classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.md5 b/dc/d61/classgraph_1_1_graph_a3755ec9e6a842238c7f4aac10b661981_cgraph.md5 similarity index 100% rename from dc/d61/classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.md5 rename to dc/d61/classgraph_1_1_graph_a3755ec9e6a842238c7f4aac10b661981_cgraph.md5 diff --git a/dc/d61/classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.svg b/dc/d61/classgraph_1_1_graph_a3755ec9e6a842238c7f4aac10b661981_cgraph.svg similarity index 98% rename from dc/d61/classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.svg rename to dc/d61/classgraph_1_1_graph_a3755ec9e6a842238c7f4aac10b661981_cgraph.svg index 9c4a051b5..49ee726d6 100644 --- a/dc/d61/classgraph_1_1_graph_ab1a1a96cd4cddf0d4feb02855c4c16af_cgraph.svg +++ b/dc/d61/classgraph_1_1_graph_a3755ec9e6a842238c7f4aac10b661981_cgraph.svg @@ -1,7 +1,7 @@ - - - - - diff --git a/dc/d61/classgraph_1_1_graph_a8839fa14bff19d2deab4a618447c13e5_cgraph.md5 b/dc/d61/classgraph_1_1_graph_a8839fa14bff19d2deab4a618447c13e5_cgraph.md5 deleted file mode 100644 index a65066fa8..000000000 --- a/dc/d61/classgraph_1_1_graph_a8839fa14bff19d2deab4a618447c13e5_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -e538c988bc33576564824cdee89b0e2a \ No newline at end of file diff --git a/dc/d61/classgraph_1_1_graph_a8839fa14bff19d2deab4a618447c13e5_cgraph.svg b/dc/d61/classgraph_1_1_graph_a8839fa14bff19d2deab4a618447c13e5_cgraph.svg deleted file mode 100644 index b81881cdd..000000000 --- a/dc/d61/classgraph_1_1_graph_a8839fa14bff19d2deab4a618447c13e5_cgraph.svg +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - -graph::Graph::Graph - - - -Node1 - - -graph::Graph::Graph - - - - - -Node2 - - -std::vector::push_back - - - - - -Node1->Node2 - - - - - -Node3 - - -std::vector::resize - - - - - -Node1->Node3 - - - - - diff --git a/dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.map b/dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.map deleted file mode 100644 index afd8c74a5..000000000 --- a/dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.md5 b/dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.md5 deleted file mode 100644 index 592b059e7..000000000 --- a/dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -f53c0fb8b60b21d44b94c1e93215a573 \ No newline at end of file diff --git a/dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.svg b/dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.svg deleted file mode 100644 index 4213642de..000000000 --- a/dc/d61/classgraph_1_1_graph_a8930d1470d132b19e430d1c71f94c904_cgraph.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - -graph::Graph::number_of_vertices - - - -Node1 - - -graph::Graph::number -_of_vertices - - - - - -Node2 - - -std::vector::size - - - - - -Node1->Node2 - - - - - diff --git a/dc/d64/md__coding_guidelines.html b/dc/d64/md__coding_guidelines.html index 431635398..aa13ffa58 100644 --- a/dc/d64/md__coding_guidelines.html +++ b/dc/d64/md__coding_guidelines.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Code style convention @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -89,24 +89,23 @@ $(document).ready(function(){initNavTree('dc/d64/md__coding_guidelines.html','.. -
        -
        -
        Code style convention
        +
        +
        Code style convention
        -

        Please orient on this guide before you sent a pull request.
        +

        Please orient on this guide before you sent a pull request.


        User-interface

        -

        Please write a simple user interface for your programs. Not a blinking cursor!
        +

        Please write a simple user interface for your programs. Not a blinking cursor!
        What does the program do?
        What want the program an user informations?


        Code style conventions

        -

        See here
        +

        See here
        Don't push all code in one line!

        @@ -115,7 +114,7 @@ Code style conventions diff --git a/dc/d67/classgraph_1_1is__graph__bipartite_1_1_graph-members.html b/dc/d67/classgraph_1_1is__graph__bipartite_1_1_graph-members.html index ded7cdb51..dbc53aee5 100644 --- a/dc/d67/classgraph_1_1is__graph__bipartite_1_1_graph-members.html +++ b/dc/d67/classgraph_1_1is__graph__bipartite_1_1_graph-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,25 +90,24 @@ $(document).ready(function(){initNavTree('de/d00/classgraph_1_1is__graph__bipart
        -
        -
        graph::is_graph_bipartite::Graph Member List
        +
        graph::is_graph_bipartite::Graph Member List
        diff --git a/dc/d6d/structstd_1_1is__arithmetic_3_01uint256__t_01_4.html b/dc/d6d/structstd_1_1is__arithmetic_3_01uint256__t_01_4.html index 679a3b915..6e14f7f15 100644 --- a/dc/d6d/structstd_1_1is__arithmetic_3_01uint256__t_01_4.html +++ b/dc/d6d/structstd_1_1is__arithmetic_3_01uint256__t_01_4.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: std::is_arithmetic< uint256_t > Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,8 +90,7 @@ $(document).ready(function(){initNavTree('dc/d6d/structstd_1_1is__arithmetic_3_0
        -
        -
        std::is_arithmetic< uint256_t > Struct Reference
        +
        std::is_arithmetic< uint256_t > Struct Reference
        @@ -115,7 +114,7 @@ Collaboration diagram for std::is_arithmetic< uint256_t >:
        diff --git a/dc/d79/wave__sort_8cpp__incl.svg b/dc/d79/wave__sort_8cpp__incl.svg index 979887d56..219790f5f 100644 --- a/dc/d79/wave__sort_8cpp__incl.svg +++ b/dc/d79/wave__sort_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: machine_learning::neural_network::layers::DenseLayer Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -94,56 +94,55 @@ $(document).ready(function(){initNavTree('dc/d93/classmachine__learning_1_1neura Public Member Functions | Public Attributes | List of all members -
        -
        machine_learning::neural_network::layers::DenseLayer Class Reference
        +
        machine_learning::neural_network::layers::DenseLayer Class Reference
        Collaboration diagram for machine_learning::neural_network::layers::DenseLayer:
        -
        +
        [legend]
        - - - + + - - + + - - + +

        +

        Public Member Functions

         DenseLayer (const int &neurons, const std::string &activation, const std::pair< size_t, size_t > &kernel_shape, const bool &random_kernel)
         
         DenseLayer (const int &neurons, const std::string &activation, const std::vector< std::valarray< double >> &kernel)
         
         DenseLayer (const int &neurons, const std::string &activation, const std::vector< std::valarray< double > > &kernel)
         
         DenseLayer (const DenseLayer &layer)=default
         
         ~DenseLayer ()=default
         
        DenseLayeroperator= (const DenseLayer &layer)=default
         
        DenseLayeroperator= (const DenseLayer &layer)=default
         
         DenseLayer (DenseLayer &&)=default
         
        DenseLayeroperator= (DenseLayer &&)=default
         
        DenseLayeroperator= (DenseLayer &&)=default
         
        - - - - - -

        +

        Public Attributes

        +
        double(* activation_function )(const double &)
         
        +
        double(* dactivation_function )(const double &)
         
        +
        int neurons
         
        +
        std::string activation
         
        +
        std::vector< std::valarray< double > > kernel
         

        Detailed Description

        -

        neural_network::layers::DenseLayer class is used to store all necessary information about the layers (i.e. neurons, activation and kernel). This class is used by NeuralNetwork class to store layers.

        +

        neural_network::layers::DenseLayer class is used to store all necessary information about the layers (i.e. neurons, activation and kernel). This class is used by NeuralNetwork class to store layers.

        Constructor & Destructor Documentation

        - +

        ◆ DenseLayer() [1/4]

        @@ -188,7 +187,7 @@ int neurons
        -

        Constructor for neural_network::layers::DenseLayer class

        Parameters
        +

        Constructor for neural_network::layers::DenseLayer class

        Parameters
        @@ -197,45 +196,45 @@ int 
        neuronsnumber of neurons
        activationactivation function for layer
        neurons
        -
        143  {
        -
        144  // Choosing activation (and it's derivative)
        -
        145  if (activation == "sigmoid") {
        -
        146  activation_function = neural_network::activations::sigmoid;
        -
        147  dactivation_function = neural_network::activations::sigmoid;
        -
        148  } else if (activation == "relu") {
        -
        149  activation_function = neural_network::activations::relu;
        -
        150  dactivation_function = neural_network::activations::drelu;
        -
        151  } else if (activation == "tanh") {
        -
        152  activation_function = neural_network::activations::tanh;
        -
        153  dactivation_function = neural_network::activations::dtanh;
        -
        154  } else if (activation == "none") {
        -
        155  // Set identity function in casse of none is supplied
        -
        156  activation_function =
        -
        157  neural_network::util_functions::identity_function;
        -
        158  dactivation_function =
        -
        159  neural_network::util_functions::identity_function;
        -
        160  } else {
        -
        161  // If supplied activation is invalid
        -
        162  std::cerr << "ERROR (" << __func__ << ") : ";
        -
        163  std::cerr << "Invalid argument. Expected {none, sigmoid, relu, "
        -
        164  "tanh} got ";
        -
        165  std::cerr << activation << std::endl;
        -
        166  std::exit(EXIT_FAILURE);
        -
        167  }
        -
        168  this->activation = activation; // Setting activation name
        -
        169  this->neurons = neurons; // Setting number of neurons
        -
        170  // Initialize kernel according to flag
        -
        171  if (random_kernel) {
        -
        172  uniform_random_initialization(kernel, kernel_shape, -1.0, 1.0);
        -
        173  } else {
        -
        174  unit_matrix_initialization(kernel, kernel_shape);
        -
        175  }
        -
        176  }
        +
        143 {
        +
        144 // Choosing activation (and it's derivative)
        +
        145 if (activation == "sigmoid") {
        +
        146 activation_function = neural_network::activations::sigmoid;
        +
        147 dactivation_function = neural_network::activations::sigmoid;
        +
        148 } else if (activation == "relu") {
        +
        149 activation_function = neural_network::activations::relu;
        +
        150 dactivation_function = neural_network::activations::drelu;
        +
        151 } else if (activation == "tanh") {
        +
        152 activation_function = neural_network::activations::tanh;
        +
        153 dactivation_function = neural_network::activations::dtanh;
        +
        154 } else if (activation == "none") {
        +
        155 // Set identity function in casse of none is supplied
        +
        156 activation_function =
        +
        157 neural_network::util_functions::identity_function;
        +
        158 dactivation_function =
        +
        159 neural_network::util_functions::identity_function;
        +
        160 } else {
        +
        161 // If supplied activation is invalid
        +
        162 std::cerr << "ERROR (" << __func__ << ") : ";
        +
        163 std::cerr << "Invalid argument. Expected {none, sigmoid, relu, "
        +
        164 "tanh} got ";
        +
        165 std::cerr << activation << std::endl;
        +
        166 std::exit(EXIT_FAILURE);
        +
        167 }
        +
        168 this->activation = activation; // Setting activation name
        +
        169 this->neurons = neurons; // Setting number of neurons
        +
        170 // Initialize kernel according to flag
        +
        171 if (random_kernel) {
        +
        172 uniform_random_initialization(kernel, kernel_shape, -1.0, 1.0);
        +
        173 } else {
        +
        174 unit_matrix_initialization(kernel, kernel_shape);
        +
        175 }
        +
        176 }
        T endl(T... args)
        T exit(T... args)
        -
        void uniform_random_initialization(std::vector< std::valarray< T >> &A, const std::pair< size_t, size_t > &shape, const T &low, const T &high)
        Definition: vector_ops.hpp:166
        -
        void unit_matrix_initialization(std::vector< std::valarray< T >> &A, const std::pair< size_t, size_t > &shape)
        Definition: vector_ops.hpp:193
        +
        void unit_matrix_initialization(std::vector< std::valarray< T > > &A, const std::pair< size_t, size_t > &shape)
        Definition: vector_ops.hpp:193
        +
        void uniform_random_initialization(std::vector< std::valarray< T > > &A, const std::pair< size_t, size_t > &shape, const T &low, const T &high)
        Definition: vector_ops.hpp:166
        Here is the call graph for this function:
        @@ -245,8 +244,8 @@ Here is the call graph for this function:
        - -

        ◆ DenseLayer() [2/4]

        + +

        ◆ DenseLayer() [2/4]

        @@ -269,7 +268,7 @@ Here is the call graph for this function:
        - const std::vector< std::valarray< double >> &  + const std::vector< std::valarray< double > > &  kernel  @@ -284,7 +283,7 @@ Here is the call graph for this function:
        -

        Constructor for neural_network::layers::DenseLayer class

        Parameters
        +

        Constructor for neural_network::layers::DenseLayer class

        Parameters
        @@ -292,45 +291,45 @@ Here is the call graph for this function:
        neuronsnumber of neurons
        activationactivation function for layer
        -
        184  {
        -
        185  // Choosing activation (and it's derivative)
        -
        186  if (activation == "sigmoid") {
        -
        187  activation_function = neural_network::activations::sigmoid;
        -
        188  dactivation_function = neural_network::activations::sigmoid;
        -
        189  } else if (activation == "relu") {
        -
        190  activation_function = neural_network::activations::relu;
        -
        191  dactivation_function = neural_network::activations::drelu;
        -
        192  } else if (activation == "tanh") {
        -
        193  activation_function = neural_network::activations::tanh;
        -
        194  dactivation_function = neural_network::activations::dtanh;
        -
        195  } else if (activation == "none") {
        -
        196  // Set identity function in casse of none is supplied
        -
        197  activation_function =
        -
        198  neural_network::util_functions::identity_function;
        -
        199  dactivation_function =
        -
        200  neural_network::util_functions::identity_function;
        -
        201  } else {
        -
        202  // If supplied activation is invalid
        -
        203  std::cerr << "ERROR (" << __func__ << ") : ";
        -
        204  std::cerr << "Invalid argument. Expected {none, sigmoid, relu, "
        -
        205  "tanh} got ";
        -
        206  std::cerr << activation << std::endl;
        -
        207  std::exit(EXIT_FAILURE);
        -
        208  }
        -
        209  this->activation = activation; // Setting activation name
        -
        210  this->neurons = neurons; // Setting number of neurons
        -
        211  this->kernel = kernel; // Setting supplied kernel values
        -
        212  }
        +
        184 {
        +
        185 // Choosing activation (and it's derivative)
        +
        186 if (activation == "sigmoid") {
        +
        187 activation_function = neural_network::activations::sigmoid;
        +
        188 dactivation_function = neural_network::activations::sigmoid;
        +
        189 } else if (activation == "relu") {
        +
        190 activation_function = neural_network::activations::relu;
        +
        191 dactivation_function = neural_network::activations::drelu;
        +
        192 } else if (activation == "tanh") {
        +
        193 activation_function = neural_network::activations::tanh;
        +
        194 dactivation_function = neural_network::activations::dtanh;
        +
        195 } else if (activation == "none") {
        +
        196 // Set identity function in casse of none is supplied
        +
        197 activation_function =
        +
        198 neural_network::util_functions::identity_function;
        +
        199 dactivation_function =
        +
        200 neural_network::util_functions::identity_function;
        +
        201 } else {
        +
        202 // If supplied activation is invalid
        +
        203 std::cerr << "ERROR (" << __func__ << ") : ";
        +
        204 std::cerr << "Invalid argument. Expected {none, sigmoid, relu, "
        +
        205 "tanh} got ";
        +
        206 std::cerr << activation << std::endl;
        +
        207 std::exit(EXIT_FAILURE);
        +
        208 }
        +
        209 this->activation = activation; // Setting activation name
        +
        210 this->neurons = neurons; // Setting number of neurons
        +
        211 this->kernel = kernel; // Setting supplied kernel values
        +
        212 }
        Here is the call graph for this function:
        -
        +
        - +

        ◆ DenseLayer() [3/4]

        @@ -353,7 +352,7 @@ Here is the call graph for this function:
        -

        Copy Constructor for class DenseLayer.

        +

        Copy Constructor for class DenseLayer.

        Parameters
        @@ -363,7 +362,7 @@ Here is the call graph for this function: - +

        ◆ ~DenseLayer()

        @@ -385,11 +384,11 @@ Here is the call graph for this function:
        modelinstance of class to be copied.
        -

        Destructor for class DenseLayer.

        +

        Destructor for class DenseLayer.

        - +

        ◆ DenseLayer() [4/4]

        @@ -412,13 +411,13 @@ Here is the call graph for this function:
        -

        Move constructor for class DenseLayer

        +

        Move constructor for class DenseLayer

        Member Function Documentation

        - -

        ◆ operator=() [1/2]

        + +

        ◆ operator=() [1/2]

        @@ -427,7 +426,7 @@ Here is the call graph for this function:
        - + @@ -440,12 +439,12 @@ Here is the call graph for this function:
        DenseLayer& machine_learning::neural_network::layers::DenseLayer::operator= DenseLayer & machine_learning::neural_network::layers::DenseLayer::operator= ( const DenseLayer layer)
        -

        Copy assignment operator for class DenseLayer

        +

        Copy assignment operator for class DenseLayer

        - -

        ◆ operator=() [2/2]

        + +

        ◆ operator=() [2/2]

        @@ -454,7 +453,7 @@ Here is the call graph for this function:
        - + @@ -467,7 +466,7 @@ Here is the call graph for this function:
        DenseLayer& machine_learning::neural_network::layers::DenseLayer::operator= DenseLayer & machine_learning::neural_network::layers::DenseLayer::operator= ( DenseLayer &&  )
        -

        Move assignment operator for class DenseLayer

        +

        Move assignment operator for class DenseLayer

        @@ -480,7 +479,7 @@ Here is the call graph for this function: diff --git a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.js b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.js index 78046d566..b4e4b458f 100644 --- a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.js +++ b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.js @@ -1,15 +1,10 @@ var classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer = [ [ "DenseLayer", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#a11046825be0b6dbb73fbe834aa49200e", null ], - [ "DenseLayer", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#a35ab6f1b2840f89a858ca36b78739b69", null ], + [ "DenseLayer", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#af136ec31dbd35b1be2eb9a057677c704", null ], [ "DenseLayer", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#a2871146feaaa453558239df67b21e0d2", null ], [ "~DenseLayer", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#ac9cda9453c4a0caf5bae7f9213b019a0", null ], [ "DenseLayer", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#a6c859e3737aa88b29854df0347b29f4e", null ], - [ "operator=", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#a8809e6df990f37c85c06474dd955cb2b", null ], - [ "operator=", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#a6385ad4d8186b8a74b17e4a8dc41da11", null ], - [ "activation", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#a891264e2eb1357b2b3282e5532250869", null ], - [ "activation_function", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#a8e4c57922478ccc2b7c6277c05608714", null ], - [ "dactivation_function", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#acc6cfdcc9d6e5170340abae63234a442", null ], - [ "kernel", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#a494d39f6c367071d1fd31b3c1caf1a7d", null ], - [ "neurons", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#ace9c37dd1322d3745de9713c90df8003", null ] + [ "operator=", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#ae077132526d2863e46aa77cb0f7d6aa2", null ], + [ "operator=", "dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer.html#a19aaccad279b22dbbb6c55e5697b4114", null ] ]; \ No newline at end of file diff --git a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.map b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.map index 839c81410..da34b24f3 100644 --- a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.map +++ b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.map @@ -2,7 +2,7 @@ - - + + diff --git a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.md5 b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.md5 index 17dbfd184..8ffedeea8 100644 --- a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.md5 +++ b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.md5 @@ -1 +1 @@ -8e779f1ecedb6bceec329abc6db927a0 \ No newline at end of file +58d3b0ef795906c90a92aa345fdf488d \ No newline at end of file diff --git a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.svg b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.svg index 740b2e8da..4b6929b13 100644 --- a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.svg +++ b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a11046825be0b6dbb73fbe834aa49200e_cgraph.svg @@ -1,7 +1,7 @@ - Node4 - + machine_learning::uniform _random_initialization @@ -69,7 +69,7 @@ Node6 - + machine_learning::unit _matrix_initialization diff --git a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a35ab6f1b2840f89a858ca36b78739b69_cgraph.map b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_af136ec31dbd35b1be2eb9a057677c704_cgraph.map similarity index 100% rename from dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a35ab6f1b2840f89a858ca36b78739b69_cgraph.map rename to dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_af136ec31dbd35b1be2eb9a057677c704_cgraph.map diff --git a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a35ab6f1b2840f89a858ca36b78739b69_cgraph.md5 b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_af136ec31dbd35b1be2eb9a057677c704_cgraph.md5 similarity index 100% rename from dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a35ab6f1b2840f89a858ca36b78739b69_cgraph.md5 rename to dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_af136ec31dbd35b1be2eb9a057677c704_cgraph.md5 diff --git a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a35ab6f1b2840f89a858ca36b78739b69_cgraph.svg b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_af136ec31dbd35b1be2eb9a057677c704_cgraph.svg similarity index 97% rename from dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a35ab6f1b2840f89a858ca36b78739b69_cgraph.svg rename to dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_af136ec31dbd35b1be2eb9a057677c704_cgraph.svg index 93dfdccca..453914f84 100644 --- a/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_a35ab6f1b2840f89a858ca36b78739b69_cgraph.svg +++ b/dc/d93/classmachine__learning_1_1neural__network_1_1layers_1_1_dense_layer_af136ec31dbd35b1be2eb9a057677c704_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: data_structures/trie_modern.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('dc/d93/trie__modern_8cpp.html','../../ -
        -
        trie_modern.cpp File Reference
        +
        trie_modern.cpp File Reference
        @@ -110,23 +109,23 @@ Include dependency graph for trie_modern.cpp:
        -

        +

        Classes

        class  Trie
         
        struct  Trie::TrieNode
         
        -

        +

        Functions

        int main ()
         

        Detailed Description

        -

        A basic implementation of trie class to store only lower-case strings.

        +

        A basic implementation of trie class to store only lower-case strings.

        Author
        Anmol3299

        Function Documentation

        - +

        ◆ main()

        @@ -141,16 +140,16 @@ Functions
        -

        Main function

        -
        160  {
        -
        161  Trie trie;
        -
        162  trie.insert("hel");
        -
        163  trie.insert("hello");
        -
        164  trie.removeWord("hel");
        -
        165  std::cout << trie.search("hello") << '\n';
        -
        166 
        -
        167  return 0;
        -
        168 }
        +

        Main function

        +
        160 {
        +
        161 Trie trie;
        +
        162 trie.insert("hel");
        +
        163 trie.insert("hello");
        +
        164 trie.removeWord("hel");
        +
        165 std::cout << trie.search("hello") << '\n';
        +
        166
        +
        167 return 0;
        +
        168}
        Definition: trie_modern.cpp:16
        bool search(const std::string &word)
        Definition: trie_modern.cpp:132
        @@ -170,7 +169,7 @@ Here is the call graph for this function:
        diff --git a/dc/d93/trie__modern_8cpp.js b/dc/d93/trie__modern_8cpp.js index 7f7d32601..8e04d8de4 100644 --- a/dc/d93/trie__modern_8cpp.js +++ b/dc/d93/trie__modern_8cpp.js @@ -1,6 +1,6 @@ var trie__modern_8cpp = [ [ "Trie", "dd/d2f/class_trie.html", "dd/d2f/class_trie" ], - [ "TrieNode", "de/d48/struct_trie_1_1_trie_node.html", "de/d48/struct_trie_1_1_trie_node" ], + [ "Trie::TrieNode", "de/d48/struct_trie_1_1_trie_node.html", null ], [ "main", "dc/d93/trie__modern_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] ]; \ No newline at end of file diff --git a/dc/d93/trie__modern_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/dc/d93/trie__modern_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index afeebff8c..5c4c61118 100644 --- a/dc/d93/trie__modern_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/dc/d93/trie__modern_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Guidelines for reviewers and maintainers @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -89,12 +89,11 @@ $(document).ready(function(){initNavTree('dc/db4/md__r_e_v_i_e_w_e_r__c_o_d_e.ht
        -
        -
        -
        Guidelines for reviewers and maintainers
        +
        +
        Guidelines for reviewers and maintainers
        -

        Following are some guidelines for contributors who are providing reviews to the pull-requests.

        +

        Following are some guidelines for contributors who are providing reviews to the pull-requests.

        1. On any given pull-request, there only one reviewer should be active at a time. Once the reviewer is done, others may add short comments or any further reviews as needed. Again, one at a time.
        2. Assigning reviewers should be avoided unless the pull-request is for a particular task the reviewer is more proficient in.
        3. @@ -112,7 +111,7 @@ $(document).ready(function(){initNavTree('dc/db4/md__r_e_v_i_e_w_e_r__c_o_d_e.ht diff --git a/dc/db5/struct_queue.html b/dc/db5/struct_queue.html index 077ffdfc1..34d40a6b8 100644 --- a/dc/db5/struct_queue.html +++ b/dc/db5/struct_queue.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Queue Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
          Algorithms_in_C++ -  1.0.0 +
          Algorithms_in_C++ 1.0.0
          Set of algorithms implemented in C++.
          @@ -42,21 +41,22 @@
          - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -95,8 +95,7 @@ $(document).ready(function(){initNavTree('dc/db5/struct_queue.html','../../'); i Public Attributes | Private Attributes | List of all members
        -
        -
        Queue Class Reference
        +
        Queue Class Reference
        @@ -106,42 +105,185 @@ Collaboration diagram for Queue:
        [legend]
        - - + - + - + - +

        +

        Public Member Functions

        -void createNode (int val)
        void createNode (int val)
         
        -void enqueue (int val)
        void enqueue (int val)
         
        -void dequeue ()
        void dequeue ()
         
        -void traverse ()
        void traverse ()
         
        - - - -

        +

        Public Attributes

        +
        nodet [100]
         
        +
        int front
         
        +
        int rear
         
        - - -

        +

        Private Attributes

        +
        nodefront =nullptr
         
        +
        noderear =nullptr
         
        +

        Member Function Documentation

        + +

        ◆ createNode()

        + +
        +
        + + + + + +
        + + + + + + + + +
        void Queue::createNode (int val)
        +
        +inline
        +
        +
        13 {
        +
        14 auto* nn = new node;
        +
        15 nn->data = val;
        +
        16 nn->next = nullptr;
        +
        17 front = nn;
        +
        18 rear = nn;
        +
        19 }
        +
        struct list node
        +
        struct list * next
        pointer to next link in the chain
        Definition: hash_search.cpp:31
        +
        +
        +
        + +

        ◆ dequeue()

        + +
        +
        + + + + + +
        + + + + + + + +
        void Queue::dequeue ()
        +
        +inline
        +
        +
        33 {
        +
        34 node* n;
        +
        35 n = front;
        +
        36 if (n) {
        +
        37 front = front->next;
        +
        38 delete n;
        +
        39 }
        +
        40 }
        +
        Definition: avltree.cpp:13
        +
        +
        +
        + +

        ◆ enqueue()

        + +
        +
        + + + + + +
        + + + + + + + + +
        void Queue::enqueue (int val)
        +
        +inline
        +
        +
        20 {
        +
        21 if (front == nullptr || rear == nullptr) {
        +
        22 createNode(val);
        +
        23 }
        +
        24 else {
        +
        25 node* nn;
        +
        26 nn = new node;
        +
        27 nn->data = val;
        +
        28 rear->next = nn;
        +
        29 nn->next = front;
        +
        30 rear = nn;
        +
        31 }
        +
        32 }
        +
        +
        +
        + +

        ◆ traverse()

        + +
        +
        + + + + + +
        + + + + + + + +
        void Queue::traverse ()
        +
        +inline
        +
        +
        41 {
        +
        42 node* ptr;
        +
        43 ptr = front;
        +
        44 if (ptr) {
        +
        45 do {
        +
        46 std::cout << ptr->data << " ";
        +
        47 ptr = ptr->next;
        +
        48 } while (ptr != rear->next);
        +
        49 std::cout << front->data << std::endl;
        +
        50 }
        +
        51 }
        + +
        T endl(T... args)
        +
        +
        +

        The documentation for this class was generated from the following files:
        • data_structures/binary_search_tree.cpp
        • data_structures/circular_queue_using_linked_list.cpp
        • @@ -152,7 +294,7 @@ Private Attributes diff --git a/dc/db5/struct_queue.js b/dc/db5/struct_queue.js deleted file mode 100644 index 193de5ee4..000000000 --- a/dc/db5/struct_queue.js +++ /dev/null @@ -1,13 +0,0 @@ -var struct_queue = -[ - [ "Queue", "dc/db5/struct_queue.html#a1e85ea19bc49931cfcc392533735b0c5", null ], - [ "createNode", "dc/db5/struct_queue.html#a7df5a5794b817bccb0d288e3e7893326", null ], - [ "dequeue", "dc/db5/struct_queue.html#aa01ff898c2bdab7e804bf243eb5bfb31", null ], - [ "enqueue", "dc/db5/struct_queue.html#a8e9326b15e162c2d7d663c5cfbdd4405", null ], - [ "traverse", "dc/db5/struct_queue.html#af679dbf13749275935f617ac6ab0f9e9", null ], - [ "front", "dc/db5/struct_queue.html#aa14801d5c5fea47f3d08483d103e0b57", null ], - [ "front", "dc/db5/struct_queue.html#a31b892ad81d0e915c20c8f6a88e75f02", null ], - [ "rear", "dc/db5/struct_queue.html#a8303807ce298d63d958f7e5765034d70", null ], - [ "rear", "dc/db5/struct_queue.html#a3ed9e95fefd0c13071d192c1512c8db3", null ], - [ "t", "dc/db5/struct_queue.html#abab0f9fbb31ee24a0130523c3562c863", null ] -]; \ No newline at end of file diff --git a/dc/db5/text__search_8cpp.html b/dc/db5/text__search_8cpp.html index 0ce52eb44..9fe8a8267 100644 --- a/dc/db5/text__search_8cpp.html +++ b/dc/db5/text__search_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: search/text_search.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
          Algorithms_in_C++ -  1.0.0 +
          Algorithms_in_C++ 1.0.0
          Set of algorithms implemented in C++.
          @@ -42,21 +41,22 @@
          - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('dc/db5/text__search_8cpp.html','../../
        -
        -
        text_search.cpp File Reference
        +
        text_search.cpp File Reference
        @@ -109,15 +108,15 @@ Include dependency graph for text_search.cpp:
        -

        +

        Functions

        int main ()
         

        Detailed Description

        -

        Search for words in a long textual paragraph.

        +

        Search for words in a long textual paragraph.

        Function Documentation

        - +

        ◆ main()

        @@ -132,35 +131,35 @@ Functions
        -

        Main function

        -
        15  {
        -
        16  std::string paragraph;
        -
        17  std::cout << "Please enter your paragraph: \n";
        -
        18  std::getline(std::cin, paragraph);
        -
        19  std::cout << "\nHello, your paragraph is:\n " << paragraph << "!\n";
        -
        20  std::cout << "\nThe size of your paragraph = " << paragraph.size()
        -
        21  << " characters. \n\n";
        -
        22 
        -
        23  if (paragraph.empty()) {
        -
        24  std::cout << "\nThe paragraph is empty" << std::endl;
        -
        25  } else {
        -
        26  while (true) {
        -
        27  std::string word;
        -
        28  std::cout << "Please enter the word you are searching for: ";
        -
        29  std::getline(std::cin, word);
        -
        30  std::cout << "Hello, your word is " << word << "!\n";
        -
        31  if (paragraph.find(word) == std::string::npos) {
        -
        32  std::cout << word << " does not exist in the sentence"
        -
        33  << std::endl;
        -
        34  } else {
        -
        35  std::cout << "The word " << word << " is now found at location "
        -
        36  << paragraph.find(word) << std::endl
        -
        37  << std::endl;
        -
        38  }
        -
        39  std::cin.get();
        -
        40  }
        -
        41  }
        -
        42 }
        +

        Main function

        +
        15 {
        +
        16 std::string paragraph;
        +
        17 std::cout << "Please enter your paragraph: \n";
        +
        18 std::getline(std::cin, paragraph);
        +
        19 std::cout << "\nHello, your paragraph is:\n " << paragraph << "!\n";
        +
        20 std::cout << "\nThe size of your paragraph = " << paragraph.size()
        +
        21 << " characters. \n\n";
        +
        22
        +
        23 if (paragraph.empty()) {
        +
        24 std::cout << "\nThe paragraph is empty" << std::endl;
        +
        25 } else {
        +
        26 while (true) {
        +
        27 std::string word;
        +
        28 std::cout << "Please enter the word you are searching for: ";
        + +
        30 std::cout << "Hello, your word is " << word << "!\n";
        +
        31 if (paragraph.find(word) == std::string::npos) {
        +
        32 std::cout << word << " does not exist in the sentence"
        +
        33 << std::endl;
        +
        34 } else {
        +
        35 std::cout << "The word " << word << " is now found at location "
        +
        36 << paragraph.find(word) << std::endl
        +
        37 << std::endl;
        +
        38 }
        +
        39 std::cin.get();
        +
        40 }
        +
        41 }
        +
        42}
        @@ -184,7 +183,7 @@ Here is the call graph for this function:
        diff --git a/dc/db5/text__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/dc/db5/text__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index a4ac778e2..347f2d51e 100644 --- a/dc/db5/text__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/dc/db5/text__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: /Users/runner/work/C-Plus-Plus/C-Plus-Plus/numerical_methods/rungekutta.cpp @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,11 +90,10 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
        -
        -
        /Users/runner/work/C-Plus-Plus/C-Plus-Plus/numerical_methods/rungekutta.cpp
        +
        /Users/runner/work/C-Plus-Plus/C-Plus-Plus/numerical_methods/rungekutta.cpp
        -

        it solves \frac{\mathrm{d} y}{\mathrm{d} x}= \frac{\left ( x-y \right )}{2} given x for given initial conditions There can be many such equations

        +

        it solves \frac{\mathrm{d} y}{\mathrm{d} x}= \frac{\left ( x-y \right )}{2} given x for given initial conditions There can be many such equations

        /**
        * @{
        * \file
        @@ -127,19 +126,19 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
        * @param y is the value corresponding to the y coordinate
        * @returns the computed function value at that call
        */
        -
        static double change(double x, double y) { return ((x - y) / 2.0); }
        +
        static double change(double x, double y) { return ((x - y) / 2.0); }
        /**
        * @namespace numerical_methods
        * @brief Numerical Methods
        */
        -
        namespace numerical_methods {
        +
        namespace numerical_methods {
        /**
        * @namespace runge_kutta
        * @brief Functions for [Runge Kutta fourth
        * order](https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods) method
        */
        -
        namespace runge_kutta {
        +
        namespace runge_kutta {
        /**
        * @brief the Runge Kutta method finds the value of integration of a function in
        * the given limits. the lower limit of integration as the initial value and the
        @@ -151,8 +150,8 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
        * @returns the value of y at thr required value of x from the initial
        * conditions
        */
        -
        double rungeKutta(double init_x, const double &init_y, const double &x,
        -
        const double &h) {
        +
        double rungeKutta(double init_x, const double &init_y, const double &x,
        +
        const double &h) {
        // Count number of iterations
        // using step size or
        // step height h
        @@ -161,9 +160,9 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
        // k1, k2, k3, k4 are the Runge Kutta variables
        // used for calculation of y at each iteration
        -
        auto n = static_cast<uint64_t>((x - init_x) / h);
        +
        auto n = static_cast<uint64_t>((x - init_x) / h);
        // used a vector container for the variables
        - +
        // Iterate for number of iterations
        @@ -171,10 +170,10 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
        for (int i = 1; i <= n; ++i) {
        // Apply Runge Kutta Formulas
        // to find next value of y
        -
        k[0] = h * change(init_x, y);
        -
        k[1] = h * change(init_x + 0.5 * h, y + 0.5 * k[0]);
        -
        k[2] = h * change(init_x + 0.5 * h, y + 0.5 * k[1]);
        -
        k[3] = h * change(init_x + h, y + k[2]);
        +
        k[0] = h * change(init_x, y);
        +
        k[1] = h * change(init_x + 0.5 * h, y + 0.5 * k[0]);
        +
        k[2] = h * change(init_x + 0.5 * h, y + 0.5 * k[1]);
        +
        k[3] = h * change(init_x + h, y + k[2]);
        // Update next value of y
        @@ -182,7 +181,7 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
        // Update next value of x
        -
        init_x += h;
        +
        init_x += h;
        }
        return y;
        @@ -194,38 +193,38 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
        * @brief Tests to check algorithm implementation.
        * @returns void
        */
        -
        static void test() {
        -
        std::cout << "The Runge Kutta function will be tested on the basis of "
        +
        static void test() {
        +
        std::cout << "The Runge Kutta function will be tested on the basis of "
        "precomputed values\n";
        -
        std::cout << "Test 1...."
        +
        std::cout << "Test 1...."
        << "\n";
        - +
        2, 3, 4, 0.2); // Tests the function with pre calculated values
        assert(valfirst == 3.10363932323749570);
        -
        std::cout << "Passed Test 1\n";
        +
        std::cout << "Passed Test 1\n";
        -
        std::cout << "Test 2...."
        +
        std::cout << "Test 2...."
        << "\n";
        - +
        1, 2, 5, 0.1); // The value of step changed
        assert(valsec == 3.40600589380261409);
        -
        std::cout << "Passed Test 2\n";
        +
        std::cout << "Passed Test 2\n";
        -
        std::cout << "Test 3...."
        +
        std::cout << "Test 3...."
        << "\n";
        - +
        -1, 3, 4, 0.1); // Tested with negative value
        assert(valthird == 2.49251005860244268);
        -
        std::cout << "Passed Test 3\n";
        +
        std::cout << "Passed Test 3\n";
        }
        /**
        * @brief Main function
        * @returns 0 on exit
        */
        -
        int main() {
        -
        test(); // Execute the tests
        +
        int main() {
        +
        test(); // Execute the tests
        return 0;
        }
        @@ -236,13 +235,13 @@ $(document).ready(function(){initNavTree('dc/dc4/_2_users_2runner_2work_2_c-_plu
        static void test()
        Test implementations.
        Definition: rat_maze.cpp:84
        static double change(double x, double y)
        for using the vector container
        Definition: rungekutta.cpp:33
        double rungeKutta(double init_x, const double &init_y, const double &x, const double &h)
        the Runge Kutta method finds the value of integration of a function in the given limits....
        Definition: rungekutta.cpp:57
        - +
        diff --git a/dc/dc5/ode__forward__euler_8cpp__incl.svg b/dc/dc5/ode__forward__euler_8cpp__incl.svg index d51831590..bcb4b4672 100644 --- a/dc/dc5/ode__forward__euler_8cpp__incl.svg +++ b/dc/dc5/ode__forward__euler_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: others/paranthesis_matching.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,8 +93,7 @@ $(document).ready(function(){initNavTree('dc/dc5/paranthesis__matching_8cpp.html -
        -
        paranthesis_matching.cpp File Reference
        +
        paranthesis_matching.cpp File Reference
        @@ -109,41 +108,38 @@ Include dependency graph for paranthesis_matching.cpp:
        -

        +

        Macros

        #define MAX   100
         
        - - + - + - - + + - - + +

        +

        Functions

        char opening (char ch)
         
        -int main ()
        int main ()
         
        char stack [MAX]
         
        -int stack_idx = -1
        +int stack_idx = -1
         pointer to track stack index
         
        -void push (char ch)
         push byte to stack variable
        void push (char ch)
         push byte to stack variable More...
         
        -char pop ()
         pop a byte out of stack variable
        char pop ()
         pop a byte out of stack variable More...
         

        Detailed Description

        -

        Perform paranthesis matching.

        +

        Perform paranthesis matching.

        Note
        Do not know the application of this, however.
        Implementation is C-type and does not utilize the C++ constructs
        Todo:
        implement as a C++ class

        Macro Definition Documentation

        - +

        ◆ MAX

        @@ -154,12 +150,65 @@ Implementation is C-type and does not utilize the C++ constructs
        -

        check number

        +

        check number

        Function Documentation

        - + +

        ◆ main()

        + +
        +
        + + + + + + + + +
        int main (void )
        +
        +
        50 {
        + +
        52 int valid = 1, i = 0;
        +
        53 std::cout << "Enter The Expression : ";
        +
        54 std::cin >> exp;
        +
        55
        +
        56 while (valid == 1 && i < exp.length()) {
        +
        57 if (exp[i] == '(' || exp[i] == '{' || exp[i] == '[' || exp[i] == '<') {
        +
        58 push(exp[i]);
        +
        59 } else if (stack_idx >= 0 && stack[stack_idx] == opening(exp[i])) {
        +
        60 pop();
        +
        61 } else {
        +
        62 valid = 0;
        +
        63 }
        +
        64 i++;
        +
        65 }
        +
        66
        +
        67 // makes sure the stack is empty after processsing (above)
        +
        68 if (valid == 1 && stack_idx == -1) {
        +
        69 std::cout << "\nCorrect Expression";
        +
        70 } else {
        +
        71 std::cout << "\nWrong Expression";
        +
        72 }
        +
        73
        +
        74 return 0;
        +
        75}
        + + + +
        Definition: stack.h:26
        +
        uint256_t exp(uint256_t number, uint256_t power, const uint256_t &mod)
        This function calculates number raised to exponent power under modulo mod using Modular Exponentiatio...
        Definition: elliptic_curve_key_exchange.cpp:78
        +
        char pop()
        pop a byte out of stack variable
        Definition: paranthesis_matching.cpp:29
        +
        void push(char ch)
        push byte to stack variable
        Definition: paranthesis_matching.cpp:26
        +
        char opening(char ch)
        Definition: paranthesis_matching.cpp:36
        +
        int stack_idx
        pointer to track stack index
        Definition: paranthesis_matching.cpp:23
        +
        +
        +
        +

        ◆ opening()

        @@ -174,30 +223,71 @@ Implementation is C-type and does not utilize the C++ constructs
        -

        return opening paranthesis corresponding to the close paranthesis

        Parameters
        +

        return opening paranthesis corresponding to the close paranthesis

        Parameters
        [in]chclosed paranthesis character
        -
        36  {
        -
        37  switch (ch) {
        -
        38  case '}':
        -
        39  return '{';
        -
        40  case ']':
        -
        41  return '[';
        -
        42  case ')':
        -
        43  return '(';
        -
        44  case '>':
        -
        45  return '<';
        -
        46  }
        -
        47  return '\0';
        -
        48 }
        +
        36 {
        +
        37 switch (ch) {
        +
        38 case '}':
        +
        39 return '{';
        +
        40 case ']':
        +
        41 return '[';
        +
        42 case ')':
        +
        43 return '(';
        +
        44 case '>':
        +
        45 return '<';
        +
        46 }
        +
        47 return '\0';
        +
        48}
        +
        +
        +
        + +

        ◆ pop()

        + +
        +
        + + + + + + + +
        char pop ()
        +
        + +

        pop a byte out of stack variable

        +
        29{ return stack[stack_idx--]; }
        +
        +
        +
        + +

        ◆ push()

        + +
        +
        + + + + + + + + +
        void push (char ch)
        +
        + +

        push byte to stack variable

        +
        26{ stack[++stack_idx] = ch; }

        Variable Documentation

        - +

        ◆ stack

        @@ -208,7 +298,7 @@ Implementation is C-type and does not utilize the C++ constructs
        -

        -----------— stack -----------— global stack

        +

        -----------— stack -----------— global stack

        @@ -218,7 +308,7 @@ Implementation is C-type and does not utilize the C++ constructs diff --git a/dc/dc5/paranthesis__matching_8cpp.js b/dc/dc5/paranthesis__matching_8cpp.js index 948b48305..adf0801b2 100644 --- a/dc/dc5/paranthesis__matching_8cpp.js +++ b/dc/dc5/paranthesis__matching_8cpp.js @@ -1,7 +1,6 @@ var paranthesis__matching_8cpp = [ [ "MAX", "dc/dc5/paranthesis__matching_8cpp.html#a392fb874e547e582e9c66a08a1f23326", null ], - [ "main", "dc/dc5/paranthesis__matching_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "opening", "dc/dc5/paranthesis__matching_8cpp.html#ade525d33459755a32ba21e1b6910ff21", null ], [ "pop", "dc/dc5/paranthesis__matching_8cpp.html#a6d25c7dfbfeb52c3cb9d1b56ab49b664", null ], [ "push", "dc/dc5/paranthesis__matching_8cpp.html#aae41c72130114bf31204cde6873b6095", null ], diff --git a/dc/dc7/rungekutta_8cpp__incl.svg b/dc/dc7/rungekutta_8cpp__incl.svg index 3f4eb8cef..f97af2da2 100644 --- a/dc/dc7/rungekutta_8cpp__incl.svg +++ b/dc/dc7/rungekutta_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,8 +90,7 @@ $(document).ready(function(){initNavTree('d3/d2a/structmachine__learning_1_1ayst
        -
        -
        machine_learning::aystar_search::AyStarSearch< Puzzle >::comparison_operator Member List
        +
        machine_learning::aystar_search::AyStarSearch< Puzzle >::comparison_operator Member List
        @@ -103,7 +102,7 @@ $(document).ready(function(){initNavTree('d3/d2a/structmachine__learning_1_1ayst diff --git a/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.map b/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.map index 4f6f267aa..93213981b 100644 --- a/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.map +++ b/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.map @@ -1,10 +1,5 @@ - - - - - - - - + + + diff --git a/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.md5 b/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.md5 index fab4aa754..e6ab0d663 100644 --- a/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.md5 +++ b/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.md5 @@ -1 +1 @@ -263b7e3caf52e5fffe38a69897c21083 \ No newline at end of file +0d6902849303905cd17d404a329a289a \ No newline at end of file diff --git a/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.svg b/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.svg index 99894a5b0..366686c00 100644 --- a/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.svg +++ b/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph.svg @@ -1,68 +1,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + range_queries::heavy_light_decomposition::HLD< X > - + Node1 - -range_queries::heavy -_light_decomposition -::HLD< X > + +range_queries::heavy +_light_decomposition +::HLD< X > @@ -70,183 +24,35 @@ var sectionId = 'dynsection-1'; Node2 - -range_queries::heavy -_light_decomposition -::Tree< X > + +range_queries::heavy +_light_decomposition +::Tree< X > Node2->Node1 - - + + Node3 - - -std::vector< std::vector -< int > > + + +range_queries::heavy +_light_decomposition +::SG< X > - + -Node3->Node2 - - - t_par - - - -Node4 - - -std::vector< int > - - - - - -Node4->Node1 - - - h_heavychlid -h_label -h_parent - - - -Node4->Node2 - - - t_depth -t_size - - - -Node4->Node3 - - - elements - - - -Node5 - - -std::vector< std::list -< int > > - - - - - -Node5->Node2 - - - t_adj - - - -Node6 - - -std::list< int > - - - - - -Node6->Node5 - - - elements - - - -Node7 - - -std::vector< X > - - - - - -Node7->Node2 - - - t_val - - - -Node8 - - -range_queries::heavy -_light_decomposition -::SG< X > - - - - - -Node7->Node8 - - - s_tree - - - -Node8->Node1 - - +Node3->Node1 + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph_org.svg b/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph_org.svg deleted file mode 100644 index e56219f8c..000000000 --- a/dc/dd9/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d__coll__graph_org.svg +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - -range_queries::heavy_light_decomposition::HLD< X > - - - -Node1 - - -range_queries::heavy -_light_decomposition -::HLD< X > - - - - - -Node2 - - -range_queries::heavy -_light_decomposition -::Tree< X > - - - - - -Node2->Node1 - - - - - -Node3 - - -std::vector< std::vector -< int > > - - - - - -Node3->Node2 - - - t_par - - - -Node4 - - -std::vector< int > - - - - - -Node4->Node1 - - - h_heavychlid -h_label -h_parent - - - -Node4->Node2 - - - t_depth -t_size - - - -Node4->Node3 - - - elements - - - -Node5 - - -std::vector< std::list -< int > > - - - - - -Node5->Node2 - - - t_adj - - - -Node6 - - -std::list< int > - - - - - -Node6->Node5 - - - elements - - - -Node7 - - -std::vector< X > - - - - - -Node7->Node2 - - - t_val - - - -Node8 - - -range_queries::heavy -_light_decomposition -::SG< X > - - - - - -Node7->Node8 - - - s_tree - - - -Node8->Node1 - - - - - diff --git a/dc/dd9/strand__sort_8cpp.html b/dc/dd9/strand__sort_8cpp.html index c03a1c5af..73502617f 100644 --- a/dc/dd9/strand__sort_8cpp.html +++ b/dc/dd9/strand__sort_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: sorting/strand_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('dc/dd9/strand__sort_8cpp.html','../../ -
        -
        strand_sort.cpp File Reference
        +
        strand_sort.cpp File Reference
        -

        Implementation of Strand Sort algorithm. +

        Implementation of Strand Sort algorithm. More...

        #include <iostream>
        #include <list>
        @@ -109,21 +108,21 @@ Include dependency graph for strand_sort.cpp:
        - - + - - + +

        +

        Namespaces

         sorting
        namespace  sorting
         Sorting algorithms.
         
         strand
         Functions for Strand Sort algorithm.
        namespace  strand
         Functions for Strand Sort algorithm.
         
        - - - - - + + + + @@ -132,12 +131,12 @@ Functions

        +

        Functions

        template<typename T >
        std::list< T > sorting::strand::strand_sort (std::list< T > lst)
         Apply sorting. More...
         
        template<typename T >
        std::list< T > sorting::strand::strand_sort (std::list< T > lst)
         Apply sorting. More...
         
        static void test ()
         Function for testing. More...
         
         

        Detailed Description

        -

        Implementation of Strand Sort algorithm.

        -

        Strand Sort is a sorting algorithm that works in \(O(n)\) time if list is already sorted and works in \(O(n^2)\) in worst case.

        -

        It is passed over the array to be sorted once and the ascending (sequential) numbers are taken. After the first iteration, the sequential sub-array is put on the empty sorted array. The main sequence is passed over again and a new sub-sequence is created in order. Now that the sorted array is not empty, the newly extracted substring is merged with the sorted array. Repeat types 3 and 4 until the sub-sequence and main sequence are empty.

        -
        Author
        Mertcan Davulcu
        +

        Implementation of Strand Sort algorithm.

        +

        Strand Sort is a sorting algorithm that works in \(O(n)\) time if list is already sorted and works in \(O(n^2)\) in worst case.

        +

        It is passed over the array to be sorted once and the ascending (sequential) numbers are taken. After the first iteration, the sequential sub-array is put on the empty sorted array. The main sequence is passed over again and a new sub-sequence is created in order. Now that the sorted array is not empty, the newly extracted substring is merged with the sorted array. Repeat types 3 and 4 until the sub-sequence and main sequence are empty.

        +
        Author
        Mertcan Davulcu

        Function Documentation

        - +

        ◆ main()

        @@ -155,10 +154,10 @@ Functions

        Main function.

        Returns
        0 on exit
        -
        84  {
        -
        85  test();
        -
        86  return 0;
        -
        87 }
        +
        84 {
        +
        85 test();
        +
        86 return 0;
        +
        87}
        static void test()
        Function for testing.
        Definition: strand_sort.cpp:64
        Here is the call graph for this function:
        @@ -169,8 +168,8 @@ Here is the call graph for this function:
        - -

        ◆ strand_sort()

        + +

        ◆ strand_sort()

        @@ -178,7 +177,7 @@ Here is the call graph for this function:
        template<typename T >
        - + @@ -201,27 +200,27 @@ template<typename T >
        Returns
        Sorted list<T> instance
        -
        36  {
        -
        37  if (lst.size() < 2) { // Returns list if empty or contains only one element
        -
        38  return lst; // Returns list
        -
        39  }
        -
        40  std::list<T> result; // Define new "result" named list instance.
        -
        41  std::list<T> sorted; // Define new "sorted" named list instance.
        -
        42  while(!lst.empty()) /* if lst is not empty */ {
        -
        43  sorted.push_back(lst.front()); // Adds the first element of "lst" list to the bottom of the "sorted" list.
        -
        44  lst.pop_front(); // Remove first element of "lst" list.
        -
        45  for (auto it = lst.begin(); it != lst.end(); ) { // Return the loop as long as the current iterator is not equal to the last literator of the "lst" list.
        -
        46  if (sorted.back() <= *it) { // If the last reference of the "sorted" list is less than or equal to the current iterator reference.
        -
        47  sorted.push_back(*it); // Adds the iterator retrieved in the loop under the "sorted" list.
        -
        48  it = lst.erase(it); // Deletes the element with the current iterator and assigns the deleted element to the iterator.
        -
        49  } else {
        -
        50  it++; // Next iterator.
        -
        51  }
        -
        52  }
        -
        53  result.merge(sorted); // Merge "result" list with "sorted" list.
        -
        54  }
        -
        55  return result; // Returns sorted list
        -
        56  }
        +
        36 {
        +
        37 if (lst.size() < 2) { // Returns list if empty or contains only one element
        +
        38 return lst; // Returns list
        +
        39 }
        +
        40 std::list<T> result; // Define new "result" named list instance.
        +
        41 std::list<T> sorted; // Define new "sorted" named list instance.
        +
        42 while(!lst.empty()) /* if lst is not empty */ {
        +
        43 sorted.push_back(lst.front()); // Adds the first element of "lst" list to the bottom of the "sorted" list.
        +
        44 lst.pop_front(); // Remove first element of "lst" list.
        +
        45 for (auto it = lst.begin(); it != lst.end(); ) { // Return the loop as long as the current iterator is not equal to the last literator of the "lst" list.
        +
        46 if (sorted.back() <= *it) { // If the last reference of the "sorted" list is less than or equal to the current iterator reference.
        +
        47 sorted.push_back(*it); // Adds the iterator retrieved in the loop under the "sorted" list.
        +
        48 it = lst.erase(it); // Deletes the element with the current iterator and assigns the deleted element to the iterator.
        +
        49 } else {
        +
        50 it++; // Next iterator.
        +
        51 }
        +
        52 }
        +
        53 result.merge(sorted); // Merge "result" list with "sorted" list.
        +
        54 }
        +
        55 return result; // Returns sorted list
        +
        56 }
        T back(T... args)
        T begin(T... args)
        T empty(T... args)
        @@ -236,13 +235,13 @@ template<typename T >
        Here is the call graph for this function:
        -
        +
        - +

        ◆ test()

        @@ -267,23 +266,23 @@ Here is the call graph for this function:

        Function for testing.

        Returns
        N/A
        -
        64  {
        -
        65  std::list<int> lst = { -333, 525, 1, 0, 94, 52, 33 };
        -
        66 
        -
        67  std::cout << "Before: ";
        -
        68  for(auto item: lst) {
        -
        69  std::cout << item << " ";
        -
        70  }
        -
        71 
        -
        72  lst = sorting::strand::strand_sort(lst); // Sort list.
        -
        73 
        -
        74  std::cout << "\nAfter: ";
        -
        75  for(auto item: lst) {
        -
        76  std::cout << item << " ";
        -
        77  }
        -
        78 }
        +
        64 {
        +
        65 std::list<int> lst = { -333, 525, 1, 0, 94, 52, 33 };
        +
        66
        +
        67 std::cout << "Before: ";
        +
        68 for(auto item: lst) {
        +
        69 std::cout << item << " ";
        +
        70 }
        +
        71
        +
        72 lst = sorting::strand::strand_sort(lst); // Sort list.
        +
        73
        +
        74 std::cout << "\nAfter: ";
        +
        75 for(auto item: lst) {
        +
        76 std::cout << item << " ";
        +
        77 }
        +
        78}
        -
        std::list< T > strand_sort(std::list< T > lst)
        Apply sorting.
        Definition: strand_sort.cpp:36
        +
        std::list< T > strand_sort(std::list< T > lst)
        Apply sorting.
        Definition: strand_sort.cpp:36
        @@ -293,7 +292,7 @@ Here is the call graph for this function: diff --git a/dc/dd9/strand__sort_8cpp.js b/dc/dd9/strand__sort_8cpp.js index f0b6d255b..082185c18 100644 --- a/dc/dd9/strand__sort_8cpp.js +++ b/dc/dd9/strand__sort_8cpp.js @@ -1,6 +1,6 @@ var strand__sort_8cpp = [ [ "main", "dc/dd9/strand__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "strand_sort", "dc/dd9/strand__sort_8cpp.html#ad75dc6a599ecfe31dadfaf449ee565f6", null ], + [ "strand_sort", "dc/dd9/strand__sort_8cpp.html#a2bea2fe5dd38ed63610fdeaddf5785cd", null ], [ "test", "dc/dd9/strand__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/dc/dd9/strand__sort_8cpp_ad75dc6a599ecfe31dadfaf449ee565f6_cgraph.map b/dc/dd9/strand__sort_8cpp_a2bea2fe5dd38ed63610fdeaddf5785cd_cgraph.map similarity index 100% rename from dc/dd9/strand__sort_8cpp_ad75dc6a599ecfe31dadfaf449ee565f6_cgraph.map rename to dc/dd9/strand__sort_8cpp_a2bea2fe5dd38ed63610fdeaddf5785cd_cgraph.map diff --git a/dc/dd9/strand__sort_8cpp_ad75dc6a599ecfe31dadfaf449ee565f6_cgraph.md5 b/dc/dd9/strand__sort_8cpp_a2bea2fe5dd38ed63610fdeaddf5785cd_cgraph.md5 similarity index 100% rename from dc/dd9/strand__sort_8cpp_ad75dc6a599ecfe31dadfaf449ee565f6_cgraph.md5 rename to dc/dd9/strand__sort_8cpp_a2bea2fe5dd38ed63610fdeaddf5785cd_cgraph.md5 diff --git a/dc/dd9/strand__sort_8cpp_ad75dc6a599ecfe31dadfaf449ee565f6_cgraph.svg b/dc/dd9/strand__sort_8cpp_a2bea2fe5dd38ed63610fdeaddf5785cd_cgraph.svg similarity index 99% rename from dc/dd9/strand__sort_8cpp_ad75dc6a599ecfe31dadfaf449ee565f6_cgraph.svg rename to dc/dd9/strand__sort_8cpp_a2bea2fe5dd38ed63610fdeaddf5785cd_cgraph.svg index 77a447607..18b38344c 100644 --- a/dc/dd9/strand__sort_8cpp_ad75dc6a599ecfe31dadfaf449ee565f6_cgraph.svg +++ b/dc/dd9/strand__sort_8cpp_a2bea2fe5dd38ed63610fdeaddf5785cd_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - - + +Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
        std::list<T> sorting::strand::strand_sort std::list< T > sorting::strand::strand_sort ( std::list< T >  lst)
        -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,33 +90,32 @@ $(document).ready(function(){initNavTree('d8/d69/classgraph_1_1_h_k_graph.html',
        -
        -
        graph::HKGraph Member List
        +
        graph::HKGraph Member List
        diff --git a/dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.map b/dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.map deleted file mode 100644 index c6bd16278..000000000 --- a/dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.md5 b/dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.md5 deleted file mode 100644 index e6df5c5c7..000000000 --- a/dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -72d46db2c3fff769bbf5e4069c28d1f3 \ No newline at end of file diff --git a/dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.svg b/dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.svg deleted file mode 100644 index 38b6274e2..000000000 --- a/dc/df6/classoperations__on__datastructures_1_1trie__operations_1_1_tnode__coll__graph.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - -operations_on_datastructures::trie_operations::Tnode - - - -Node1 - - -operations_on_datastructures -::trie_operations::Tnode - - - - - -Node2 - - -std::vector< operations -_on_datastructures::trie -_operations::Tnode * > - - - - - -Node1->Node2 - - - elements - - - -Node2->Node1 - - - english - - - diff --git a/dc/dfa/heap__sort_8cpp__incl.svg b/dc/dfa/heap__sort_8cpp__incl.svg index 355c646d8..6efcb0740 100644 --- a/dc/dfa/heap__sort_8cpp__incl.svg +++ b/dc/dfa/heap__sort_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: search/ternary_search.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('dc/dfe/ternary__search_8cpp.html','../ -
        -
        ternary_search.cpp File Reference
        +
        ternary_search.cpp File Reference
        -

        Ternary search algorithm +

        Ternary search algorithm More...

        #include <iostream>
        @@ -108,18 +107,18 @@ Include dependency graph for ternary_search.cpp:
        - - +

        +

        Macros

        #define absolutePrecision   10
         
        #define _target   10
         
        -#define MAX   10000000
        +#define MAX   10000000
         Maximum length of array.
         
        - @@ -133,14 +132,14 @@ Functions

        +

        Functions

        void get_input ()
         
         

        Detailed Description

        -

        Ternary search algorithm

        -

        This is a divide and conquer algorithm. It does this by dividing the search space by 3 parts and using its property (usually monotonic property) to find the desired index.

        +

        Ternary search algorithm

        +

        This is a divide and conquer algorithm. It does this by dividing the search space by 3 parts and using its property (usually monotonic property) to find the desired index.

        • Time Complexity : O(log3 n)
        • Space Complexity : O(1) (without the array)

        Macro Definition Documentation

        - +

        ◆ _target

        @@ -151,11 +150,11 @@ Functions
        -

        The value of _target should be decided or can be decided later by using the variable of the function.

        +

        The value of _target should be decided or can be decided later by using the variable of the function.

        - +

        ◆ absolutePrecision

        @@ -166,12 +165,12 @@ Functions
        -

        The absolutePrecision can be modified to fit preference but it is recommended to not go lower than 10 due to errors that may occur.

        +

        The absolutePrecision can be modified to fit preference but it is recommended to not go lower than 10 due to errors that may occur.

        Function Documentation

        - +

        ◆ get_input()

        @@ -185,12 +184,12 @@ Functions
        -

        get_input function is to receive input from standard IO

        Todo:
        @christianbender Get input from STDIO or write input to memory as done above.
        -
        36 {}
        +

        get_input function is to receive input from standard IO

        Todo:
        @christianbender Get input from STDIO or write input to memory as done above.
        +
        36{}
        - +

        ◆ it_ternary_search()

        @@ -227,7 +226,7 @@ Functions
        -

        This is the iterative method of the ternary search which returns the index of the element.

        Parameters
        +

        This is the iterative method of the ternary search which returns the index of the element.

        Parameters
        @@ -239,43 +238,43 @@ Functions
        Returns
        index where the target value was found
        -1 if target value not found
        -
        48  {
        -
        49  while (1) {
        -
        50  if (left < right) {
        -
        51  if (right - left < absolutePrecision) {
        -
        52  for (int i = left; i <= right; i++)
        -
        53  if (A[i] == target)
        -
        54  return i;
        -
        55 
        -
        56  return -1;
        -
        57  }
        -
        58 
        -
        59  int oneThird = (left + right) / 3 + 1;
        -
        60  int twoThird = (left + right) * 2 / 3 + 1;
        -
        61 
        -
        62  if (A[oneThird] == target)
        -
        63  return oneThird;
        -
        64  else if (A[twoThird] == target)
        -
        65  return twoThird;
        -
        66 
        -
        67  else if (target > A[twoThird])
        -
        68  left = twoThird + 1;
        -
        69  else if (target < A[oneThird])
        -
        70  right = oneThird - 1;
        -
        71 
        -
        72  else
        -
        73  left = oneThird + 1, right = twoThird - 1;
        -
        74  } else {
        -
        75  return -1;
        -
        76  }
        -
        77  }
        -
        78 }
        +
        48 {
        +
        49 while (1) {
        +
        50 if (left < right) {
        +
        51 if (right - left < absolutePrecision) {
        +
        52 for (int i = left; i <= right; i++)
        +
        53 if (A[i] == target)
        +
        54 return i;
        +
        55
        +
        56 return -1;
        +
        57 }
        +
        58
        +
        59 int oneThird = (left + right) / 3 + 1;
        +
        60 int twoThird = (left + right) * 2 / 3 + 1;
        +
        61
        +
        62 if (A[oneThird] == target)
        +
        63 return oneThird;
        +
        64 else if (A[twoThird] == target)
        +
        65 return twoThird;
        +
        66
        +
        67 else if (target > A[twoThird])
        +
        68 left = twoThird + 1;
        +
        69 else if (target < A[oneThird])
        +
        70 right = oneThird - 1;
        +
        71
        +
        72 else
        +
        73 left = oneThird + 1, right = twoThird - 1;
        +
        74 } else {
        +
        75 return -1;
        +
        76 }
        +
        77 }
        +
        78}
        T right(T... args)
        #define absolutePrecision
        Definition: ternary_search.cpp:22
        - +

        ◆ main()

        @@ -290,14 +289,14 @@ Functions
        [in]leftlower interval limit
        [in]rightupper interval limit
        -

        Main function

        -
        134  {
        -
        135  int N = 21;
        -
        136  int A[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 10};
        -
        137  get_input();
        -
        138  ternary_search(N, A, _target);
        -
        139  return 0;
        -
        140 }
        +

        Main function

        +
        134 {
        +
        135 int N = 21;
        +
        136 int A[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 10};
        +
        137 get_input();
        +
        138 ternary_search(N, A, _target);
        +
        139 return 0;
        +
        140}
        constexpr uint32_t N
        A struct to represent sparse table for min() as their invariant function, for the given array A....
        Definition: sparse_table.cpp:47
        #define _target
        Definition: ternary_search.cpp:27
        void get_input()
        Definition: ternary_search.cpp:36
        @@ -305,13 +304,13 @@ Functions
        Here is the call graph for this function:
        -
        +
        - +

        ◆ rec_ternary_search()

        @@ -348,7 +347,7 @@ Here is the call graph for this function:
        -

        This is the recursive method of the ternary search which returns the index of the element.

        Parameters
        +

        This is the recursive method of the ternary search which returns the index of the element.

        Parameters
        @@ -360,39 +359,45 @@ Here is the call graph for this function:
        Returns
        index where the target value was found
        -1 if target value not found
        -
        90  {
        -
        91  if (left < right) {
        -
        92  if (right - left < absolutePrecision) {
        -
        93  for (int i = left; i <= right; i++)
        -
        94  if (A[i] == target)
        -
        95  return i;
        -
        96 
        -
        97  return -1;
        -
        98  }
        -
        99 
        -
        100  int oneThird = (left + right) / 3 + 1;
        -
        101  int twoThird = (left + right) * 2 / 3 + 1;
        -
        102 
        -
        103  if (A[oneThird] == target)
        -
        104  return oneThird;
        -
        105  if (A[twoThird] == target)
        -
        106  return twoThird;
        -
        107 
        -
        108  if (target < A[oneThird])
        -
        109  return rec_ternary_search(left, oneThird - 1, A, target);
        -
        110  if (target > A[twoThird])
        -
        111  return rec_ternary_search(twoThird + 1, right, A, target);
        -
        112 
        -
        113  return rec_ternary_search(oneThird + 1, twoThird - 1, A, target);
        -
        114  } else {
        -
        115  return -1;
        -
        116  }
        -
        117 }
        +
        90 {
        +
        91 if (left < right) {
        +
        92 if (right - left < absolutePrecision) {
        +
        93 for (int i = left; i <= right; i++)
        +
        94 if (A[i] == target)
        +
        95 return i;
        +
        96
        +
        97 return -1;
        +
        98 }
        +
        99
        +
        100 int oneThird = (left + right) / 3 + 1;
        +
        101 int twoThird = (left + right) * 2 / 3 + 1;
        +
        102
        +
        103 if (A[oneThird] == target)
        +
        104 return oneThird;
        +
        105 if (A[twoThird] == target)
        +
        106 return twoThird;
        +
        107
        +
        108 if (target < A[oneThird])
        +
        109 return rec_ternary_search(left, oneThird - 1, A, target);
        +
        110 if (target > A[twoThird])
        +
        111 return rec_ternary_search(twoThird + 1, right, A, target);
        +
        112
        +
        113 return rec_ternary_search(oneThird + 1, twoThird - 1, A, target);
        +
        114 } else {
        +
        115 return -1;
        +
        116 }
        +
        117}
        int rec_ternary_search(int left, int right, int A[], int target)
        Definition: ternary_search.cpp:90
        -
        +
        +Here is the call graph for this function:
        +
        +
        - + + + +

        ◆ ternary_search()

        @@ -423,7 +428,7 @@ Here is the call graph for this function:
        [in]leftlower interval limit
        [in]rightupper interval limit
        -

        ternary_search is a template function You could either use it_ternary_search or rec_ternary_search according to preference.

        Parameters
        +

        ternary_search is a template function You could either use it_ternary_search or rec_ternary_search according to preference.

        Parameters
        @@ -431,18 +436,18 @@ Here is the call graph for this function:
        [in]Nlength of array
        [in]Aarray to search in
        -
        127  {
        -
        128  std::cout << it_ternary_search(0, N - 1, A, target) << '\t';
        -
        129  std::cout << rec_ternary_search(0, N - 1, A, target) << '\t';
        -
        130  std::cout << std::endl;
        -
        131 }
        +
        127 {
        +
        128 std::cout << it_ternary_search(0, N - 1, A, target) << '\t';
        +
        129 std::cout << rec_ternary_search(0, N - 1, A, target) << '\t';
        + +
        131}
        T endl(T... args)
        int it_ternary_search(int left, int right, int A[], int target)
        Definition: ternary_search.cpp:48
        Here is the call graph for this function:
        -
        +
        @@ -454,7 +459,7 @@ Here is the call graph for this function:
        diff --git a/dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.map b/dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.map new file mode 100644 index 000000000..8dc9acf4f --- /dev/null +++ b/dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.md5 b/dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.md5 new file mode 100644 index 000000000..ad99d6c4a --- /dev/null +++ b/dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.md5 @@ -0,0 +1 @@ +57ecd0392b535021dc55ed478ff69538 \ No newline at end of file diff --git a/dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.svg b/dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.svg new file mode 100644 index 000000000..6566f18e6 --- /dev/null +++ b/dc/dfe/ternary__search_8cpp_a93d0099db95022f1eb90ddfd68f73ead_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +rec_ternary_search + + + +Node1 + + +rec_ternary_search + + + + + +Node1->Node1 + + + + + diff --git a/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index c6ebf0fac..33163f261 100644 --- a/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -4,5 +4,5 @@ - + diff --git a/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 714e4b9c6..fd4c84a29 100644 --- a/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -97aaba396c4d83b9550cb879e7e61fa5 \ No newline at end of file +03d311023a199fc336fe8ddd1aefd246 \ No newline at end of file diff --git a/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 50646f0c3..51578bf96 100644 --- a/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/dc/dfe/ternary__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,20 +1,20 @@ - - - + + main - + Node1 - -main + +main @@ -22,61 +22,61 @@ Node2 - -get_input + +get_input Node1->Node2 - - + + Node3 - -ternary_search + +ternary_search Node1->Node3 - - + + Node4 - -std::endl + +std::endl Node3->Node4 - - + + Node5 - -it_ternary_search + +it_ternary_search Node3->Node5 - - + + @@ -90,8 +90,14 @@ Node3->Node6 - - + + + + + +Node6->Node6 + + diff --git a/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.map b/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.map index ce6ecefa9..5addbe70f 100644 --- a/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.map +++ b/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.map @@ -2,5 +2,5 @@ - + diff --git a/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.md5 b/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.md5 index f6c35d61f..3433e4f7a 100644 --- a/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.md5 +++ b/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.md5 @@ -1 +1 @@ -188e87669e8512387a07cc73a2aadb75 \ No newline at end of file +fdb0324d32fd0081dfadd3a8e8aee036 \ No newline at end of file diff --git a/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.svg b/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.svg index 5e2c09e2f..c5eb5f2fe 100644 --- a/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.svg +++ b/dc/dfe/ternary__search_8cpp_aef655a27eb82efa299bf9d0becf6e9c8_cgraph.svg @@ -1,20 +1,20 @@ - - - + + ternary_search - + Node1 - -ternary_search + +ternary_search @@ -22,31 +22,31 @@ Node2 - -std::endl + +std::endl Node1->Node2 - - + + Node3 - -it_ternary_search + +it_ternary_search Node1->Node3 - - + + @@ -60,8 +60,14 @@ Node1->Node4 - - + + + + + +Node4->Node4 + + diff --git a/dd/d05/manacher__algorithm_8cpp__incl.svg b/dd/d05/manacher__algorithm_8cpp__incl.svg index 1950eb086..87268ba4f 100644 --- a/dd/d05/manacher__algorithm_8cpp__incl.svg +++ b/dd/d05/manacher__algorithm_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: graph/hamiltons_cycle.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('dd/d0c/hamiltons__cycle_8cpp.html','..
        -
        -
        hamiltons_cycle.cpp File Reference
        +
        hamiltons_cycle.cpp File Reference
        -

        The implementation of Hamilton's cycle dynamic solution for vertices number less than 20. +

        The implementation of Hamilton's cycle dynamic solution for vertices number less than 20. More...

        #include <cassert>
        #include <iostream>
        @@ -109,10 +108,10 @@ Include dependency graph for hamiltons_cycle.cpp:
        - - - + + @@ -123,15 +122,15 @@ Functions

        +

        Functions

        bool hamilton_cycle (const std::vector< std::vector< bool >> &routes)
         
        bool hamilton_cycle (const std::vector< std::vector< bool > > &routes)
         
        static void test1 ()
         
        static void test2 ()
         

        Detailed Description

        -

        The implementation of Hamilton's cycle dynamic solution for vertices number less than 20.

        -

        I use \(2^n\times n\) matrix and for every \([i, j]\) ( \(i < 2^n\) and \(j < n\)) in the matrix I store true if it is possible to get to all vertices on which position in i's binary representation is 1 so as \(j\) would be the last one.

        -

        In the the end if any cell in \((2^n - 1)^{\mbox{th}}\) row is true there exists hamiltonian cycle.

        -
        Author
        vakhokoto
        +

        The implementation of Hamilton's cycle dynamic solution for vertices number less than 20.

        +

        I use \(2^n\times n\) matrix and for every \([i, j]\) ( \(i < 2^n\) and \(j < n\)) in the matrix I store true if it is possible to get to all vertices on which position in i's binary representation is 1 so as \(j\) would be the last one.

        +

        In the the end if any cell in \((2^n - 1)^{\mbox{th}}\) row is true there exists hamiltonian cycle.

        +
        Author
        vakhokoto
        -Krishna Vedala
        +Krishna Vedala

        Function Documentation

        - -

        ◆ hamilton_cycle()

        + +

        ◆ hamilton_cycle()

        @@ -139,13 +138,13 @@ Functions bool hamilton_cycle ( - const std::vector< std::vector< bool >> &  + const std::vector< std::vector< bool > > &  routes)
        -

        The function determines if there is a hamilton's cycle in the graph

        +

        The function determines if there is a hamilton's cycle in the graph

        Parameters
        @@ -155,51 +154,51 @@ Functions
        Returns
        true if there is Hamiltonian cycle in the graph
        false if there is no Hamiltonian cycle in the graph
        -
        30  {
        -
        31  const size_t n = routes.size();
        -
        32  // height of dp array which is 2^n
        -
        33  const size_t height = 1 << n;
        - -
        35 
        -
        36  // to fill in the [2^i, i] cells with true
        -
        37  for (size_t i = 0; i < n; ++i) {
        -
        38  dp[1 << i][i] = true;
        -
        39  }
        -
        40  for (size_t i = 1; i < height; i++) {
        -
        41  std::vector<size_t> zeros, ones;
        -
        42  // finding positions with 1s and 0s and separate them
        -
        43  for (size_t pos = 0; pos < n; ++pos) {
        -
        44  if ((1 << pos) & i) {
        -
        45  ones.push_back(pos);
        -
        46  } else {
        -
        47  zeros.push_back(pos);
        -
        48  }
        -
        49  }
        -
        50 
        -
        51  for (auto &o : ones) {
        -
        52  if (!dp[i][o]) {
        -
        53  continue;
        -
        54  }
        -
        55 
        -
        56  for (auto &z : zeros) {
        -
        57  if (!routes[o][z]) {
        -
        58  continue;
        -
        59  }
        -
        60  dp[i + (1 << z)][z] = true;
        -
        61  }
        -
        62  }
        -
        63  }
        -
        64 
        -
        65  bool is_cycle = false;
        -
        66  for (size_t i = 0; i < n; i++) {
        -
        67  is_cycle |= dp[height - 1][i];
        -
        68  if (is_cycle) { // if true, all subsequent loop will be true. hence
        -
        69  // break
        -
        70  break;
        -
        71  }
        -
        72  }
        -
        73  return is_cycle;
        -
        74 }
        +
        30 {
        +
        31 const size_t n = routes.size();
        +
        32 // height of dp array which is 2^n
        +
        33 const size_t height = 1 << n;
        + +
        35
        +
        36 // to fill in the [2^i, i] cells with true
        +
        37 for (size_t i = 0; i < n; ++i) {
        +
        38 dp[1 << i][i] = true;
        +
        39 }
        +
        40 for (size_t i = 1; i < height; i++) {
        +
        41 std::vector<size_t> zeros, ones;
        +
        42 // finding positions with 1s and 0s and separate them
        +
        43 for (size_t pos = 0; pos < n; ++pos) {
        +
        44 if ((1 << pos) & i) {
        +
        45 ones.push_back(pos);
        +
        46 } else {
        +
        47 zeros.push_back(pos);
        +
        48 }
        +
        49 }
        +
        50
        +
        51 for (auto &o : ones) {
        +
        52 if (!dp[i][o]) {
        +
        53 continue;
        +
        54 }
        +
        55
        +
        56 for (auto &z : zeros) {
        +
        57 if (!routes[o][z]) {
        +
        58 continue;
        +
        59 }
        +
        60 dp[i + (1 << z)][z] = true;
        +
        61 }
        +
        62 }
        +
        63 }
        +
        64
        +
        65 bool is_cycle = false;
        +
        66 for (size_t i = 0; i < n; i++) {
        +
        67 is_cycle |= dp[height - 1][i];
        +
        68 if (is_cycle) { // if true, all subsequent loop will be true. hence
        +
        69 // break
        +
        70 break;
        +
        71 }
        +
        72 }
        +
        73 return is_cycle;
        +
        74}
        int height(node *root)
        Definition: avltree.cpp:31
        T push_back(T... args)
        T size(T... args)
        @@ -207,13 +206,13 @@ Functions
        Here is the call graph for this function:
        -
        +
        - +

        ◆ main()

        @@ -238,7 +237,7 @@ Here is the call graph for this function:
        routesnxn boolean matrix of \([i, j]\) where \([i, j]\) is true if there is a road from \(i\) to \(j\)
        -

        Main function

        +

        Main function

        Parameters
        @@ -246,12 +245,12 @@ Here is the call graph for this function:
        argccommandline argument count (ignored)
        -
        142  {
        -
        143  test1();
        -
        144  test2();
        -
        145  test3();
        -
        146  return 0;
        -
        147 }
        +
        142 {
        +
        143 test1();
        +
        144 test2();
        +
        145 test3();
        +
        146 return 0;
        +
        147}
        static void test3()
        Definition: hamiltons_cycle.cpp:122
        static void test2()
        Definition: hamiltons_cycle.cpp:103
        static void test1()
        Definition: hamiltons_cycle.cpp:81
        @@ -264,7 +263,7 @@ Here is the call graph for this function:
        - +

        ◆ test1()

        @@ -286,21 +285,21 @@ Here is the call graph for this function:
        -

        this test is testing if hamilton_cycle returns true for graph: 1 -> 2 -> 3 -> 4

        Returns
        None
        -
        81  {
        - -
        83  std::vector<bool>({true, true, false, false}),
        -
        84  std::vector<bool>({false, true, true, false}),
        -
        85  std::vector<bool>({false, false, true, true}),
        -
        86  std::vector<bool>({false, false, false, true})};
        -
        87 
        -
        88  bool ans = hamilton_cycle(arr);
        -
        89  std::cout << "Test 1... ";
        -
        90  assert(ans);
        -
        91  std::cout << "passed\n";
        -
        92 }
        +

        this test is testing if hamilton_cycle returns true for graph: 1 -> 2 -> 3 -> 4

        Returns
        None
        +
        81 {
        + +
        83 std::vector<bool>({true, true, false, false}),
        +
        84 std::vector<bool>({false, true, true, false}),
        +
        85 std::vector<bool>({false, false, true, true}),
        +
        86 std::vector<bool>({false, false, false, true})};
        +
        87
        +
        88 bool ans = hamilton_cycle(arr);
        +
        89 std::cout << "Test 1... ";
        +
        90 assert(ans);
        +
        91 std::cout << "passed\n";
        +
        92}
        -
        bool hamilton_cycle(const std::vector< std::vector< bool >> &routes)
        Definition: hamiltons_cycle.cpp:30
        +
        bool hamilton_cycle(const std::vector< std::vector< bool > > &routes)
        Definition: hamiltons_cycle.cpp:30
        ll ans(ll n)
        Definition: matrix_exponentiation.cpp:91
        Here is the call graph for this function:
        @@ -311,7 +310,7 @@ Here is the call graph for this function:
        - +

        ◆ test2()

        @@ -333,25 +332,25 @@ Here is the call graph for this function:
        -

        this test is testing if hamilton_cycle returns false for
        +

        this test is testing if hamilton_cycle returns false for
        graph:

          1 -> 2 -> 3
               |
               V
               4
        Returns
        None
        -
        103  {
        - -
        105  std::vector<bool>({true, true, false, false}),
        -
        106  std::vector<bool>({false, true, true, true}),
        -
        107  std::vector<bool>({false, false, true, false}),
        -
        108  std::vector<bool>({false, false, false, true})};
        -
        109 
        -
        110  bool ans = hamilton_cycle(arr);
        -
        111 
        -
        112  std::cout << "Test 2... ";
        -
        113  assert(!ans); // not a cycle
        -
        114  std::cout << "passed\n";
        -
        115 }
        +
        103 {
        + +
        105 std::vector<bool>({true, true, false, false}),
        +
        106 std::vector<bool>({false, true, true, true}),
        +
        107 std::vector<bool>({false, false, true, false}),
        +
        108 std::vector<bool>({false, false, false, true})};
        +
        109
        +
        110 bool ans = hamilton_cycle(arr);
        +
        111
        +
        112 std::cout << "Test 2... ";
        +
        113 assert(!ans); // not a cycle
        +
        114 std::cout << "passed\n";
        +
        115}
        Here is the call graph for this function:
        @@ -361,7 +360,7 @@ Here is the call graph for this function:
        - +

        ◆ test3()

        @@ -383,20 +382,20 @@ Here is the call graph for this function:
        -

        this test is testing if hamilton_cycle returns true for clique with 4 vertices

        Returns
        None
        -
        122  {
        - -
        124  std::vector<bool>({true, true, true, true}),
        -
        125  std::vector<bool>({true, true, true, true}),
        -
        126  std::vector<bool>({true, true, true, true}),
        -
        127  std::vector<bool>({true, true, true, true})};
        -
        128 
        -
        129  bool ans = hamilton_cycle(arr);
        -
        130 
        -
        131  std::cout << "Test 3... ";
        -
        132  assert(ans);
        -
        133  std::cout << "passed\n";
        -
        134 }
        +

        this test is testing if hamilton_cycle returns true for clique with 4 vertices

        Returns
        None
        +
        122 {
        + +
        124 std::vector<bool>({true, true, true, true}),
        +
        125 std::vector<bool>({true, true, true, true}),
        +
        126 std::vector<bool>({true, true, true, true}),
        +
        127 std::vector<bool>({true, true, true, true})};
        +
        128
        +
        129 bool ans = hamilton_cycle(arr);
        +
        130
        +
        131 std::cout << "Test 3... ";
        +
        132 assert(ans);
        +
        133 std::cout << "passed\n";
        +
        134}
        Here is the call graph for this function:
        @@ -412,7 +411,7 @@ Here is the call graph for this function:
        diff --git a/dd/d0c/hamiltons__cycle_8cpp.js b/dd/d0c/hamiltons__cycle_8cpp.js index 24b23b1d2..88fc6f52e 100644 --- a/dd/d0c/hamiltons__cycle_8cpp.js +++ b/dd/d0c/hamiltons__cycle_8cpp.js @@ -1,6 +1,6 @@ var hamiltons__cycle_8cpp = [ - [ "hamilton_cycle", "dd/d0c/hamiltons__cycle_8cpp.html#a0ceb473236b5dc53a85e281ef528dd96", null ], + [ "hamilton_cycle", "dd/d0c/hamiltons__cycle_8cpp.html#abcf824e347eecfeeb69ea0280f34f3e4", null ], [ "main", "dd/d0c/hamiltons__cycle_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], [ "test1", "dd/d0c/hamiltons__cycle_8cpp.html#ae7880ce913f3058a35ff106d5be9e243", null ], [ "test2", "dd/d0c/hamiltons__cycle_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae", null ], diff --git a/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.map b/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.map index 5e4a6877c..8750b1fd3 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.map +++ b/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.map @@ -1,7 +1,7 @@ - + diff --git a/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.md5 b/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.md5 index 09c159f7b..2213b59a0 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.md5 +++ b/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.md5 @@ -1 +1 @@ -c9fb64687827805178b579a7cad80005 \ No newline at end of file +d74592d45bac4bbf819145821fc34328 \ No newline at end of file diff --git a/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.svg b/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.svg index 9bf763c88..ca3bae8ad 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.svg +++ b/dd/d0c/hamiltons__cycle_8cpp_a0cc94918b6831f308d4fe4fa27f08299_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + hamilton_cycle diff --git a/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map index 7ba2a0197..fb4492833 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map +++ b/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -4,7 +4,7 @@ - + diff --git a/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 index 254ab9710..a0ba0e2da 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 +++ b/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -1 +1 @@ -00c9c17264adce893482d6408df8ecfc \ No newline at end of file +b7b656fde3f2a3f77f93166856457702 \ No newline at end of file diff --git a/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg index 1ff9e8066..edf9d9bfb 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg +++ b/dd/d0c/hamiltons__cycle_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -1,7 +1,7 @@ - Node4 - + hamilton_cycle diff --git a/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map b/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map index e25a59901..9fc5f138b 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map +++ b/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map @@ -1,7 +1,7 @@ - + diff --git a/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 b/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 index c005186ff..2d6b92ccd 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 +++ b/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 @@ -1 +1 @@ -0f682526c23cd458b370ed83d29d90e9 \ No newline at end of file +752e3edf7c4679a2b2e93734bd55b6b1 \ No newline at end of file diff --git a/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg b/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg index be91f2a6a..c464718fa 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg +++ b/dd/d0c/hamiltons__cycle_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + hamilton_cycle diff --git a/dd/d0c/hamiltons__cycle_8cpp_a0ceb473236b5dc53a85e281ef528dd96_cgraph.map b/dd/d0c/hamiltons__cycle_8cpp_abcf824e347eecfeeb69ea0280f34f3e4_cgraph.map similarity index 100% rename from dd/d0c/hamiltons__cycle_8cpp_a0ceb473236b5dc53a85e281ef528dd96_cgraph.map rename to dd/d0c/hamiltons__cycle_8cpp_abcf824e347eecfeeb69ea0280f34f3e4_cgraph.map diff --git a/dd/d0c/hamiltons__cycle_8cpp_a0ceb473236b5dc53a85e281ef528dd96_cgraph.md5 b/dd/d0c/hamiltons__cycle_8cpp_abcf824e347eecfeeb69ea0280f34f3e4_cgraph.md5 similarity index 100% rename from dd/d0c/hamiltons__cycle_8cpp_a0ceb473236b5dc53a85e281ef528dd96_cgraph.md5 rename to dd/d0c/hamiltons__cycle_8cpp_abcf824e347eecfeeb69ea0280f34f3e4_cgraph.md5 diff --git a/dd/d0c/hamiltons__cycle_8cpp_a0ceb473236b5dc53a85e281ef528dd96_cgraph.svg b/dd/d0c/hamiltons__cycle_8cpp_abcf824e347eecfeeb69ea0280f34f3e4_cgraph.svg similarity index 97% rename from dd/d0c/hamiltons__cycle_8cpp_a0ceb473236b5dc53a85e281ef528dd96_cgraph.svg rename to dd/d0c/hamiltons__cycle_8cpp_abcf824e347eecfeeb69ea0280f34f3e4_cgraph.svg index 03dd0f944..e548c5b3d 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_a0ceb473236b5dc53a85e281ef528dd96_cgraph.svg +++ b/dd/d0c/hamiltons__cycle_8cpp_abcf824e347eecfeeb69ea0280f34f3e4_cgraph.svg @@ -1,7 +1,7 @@ - - + diff --git a/dd/d0c/hamiltons__cycle_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 b/dd/d0c/hamiltons__cycle_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 index 63bafa7f3..9adaa3150 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 +++ b/dd/d0c/hamiltons__cycle_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 @@ -1 +1 @@ -6a09d43074bc45c5d9af24f72de91ab9 \ No newline at end of file +4dc895d429b5b134b98dc5a8bc9492ba \ No newline at end of file diff --git a/dd/d0c/hamiltons__cycle_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg b/dd/d0c/hamiltons__cycle_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg index 15379f667..12c218550 100644 --- a/dd/d0c/hamiltons__cycle_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg +++ b/dd/d0c/hamiltons__cycle_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + hamilton_cycle diff --git a/dd/d0d/insertion__sort_8cpp.html b/dd/d0d/insertion__sort_8cpp.html index f5a7f83ad..2d32d393d 100644 --- a/dd/d0d/insertion__sort_8cpp.html +++ b/dd/d0d/insertion__sort_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: sorting/insertion_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('dd/d0d/insertion__sort_8cpp.html','../ -
        -
        insertion_sort.cpp File Reference
        +
        insertion_sort.cpp File Reference
        -

        Insertion Sort Algorithm (Insertion Sort) +

        Insertion Sort Algorithm (Insertion Sort) More...

        #include <algorithm>
        #include <cassert>
        @@ -111,13 +110,13 @@ Include dependency graph for insertion_sort.cpp:
        - - +

        +

        Namespaces

         sorting
        namespace  sorting
         Sorting algorithms.
         
        - @@ -136,16 +135,16 @@ Functions

        +

        Functions

        template<typename T >
        void sorting::insertionSort (T *arr, int n)
         

        Detailed Description

        -

        Insertion Sort Algorithm (Insertion Sort)

        -

        Insertion sort is a simple sorting algorithm that builds the final sorted array one at a time. It is much less efficient compared to other sorting algorithms like heap sort, merge sort or quick sort. However it has several advantages such as

          +

          Insertion Sort Algorithm (Insertion Sort)

          +

          Insertion sort is a simple sorting algorithm that builds the final sorted array one at a time. It is much less efficient compared to other sorting algorithms like heap sort, merge sort or quick sort. However it has several advantages such as

          1. Easy to implement
          2. For small set of data it is quite efficient
          3. More efficient that other Quadratic complexity algorithms like Selection sort or bubble sort.
          4. It's stable that is it does not change the relative order of elements with equal keys
          5. Works on hand means it can sort the array or list as it receives.
          -

          It is based on the same idea that people use to sort the playing cards in their hands. the algorithms goes in the manner that we start iterating over the array of elements as soon as we find a unsorted element that is a misplaced element we place it at a sorted position.

          -

          Example execution steps:

            +

            It is based on the same idea that people use to sort the playing cards in their hands. the algorithms goes in the manner that we start iterating over the array of elements as soon as we find a unsorted element that is a misplaced element we place it at a sorted position.

            +

            Example execution steps:

            1. Suppose initially we have

              \begin{bmatrix}4 &3 &2 &5 &1\end{bmatrix}

              @@ -164,7 +163,7 @@ Functions

          Function Documentation

          - +

          ◆ create_random_array()

          @@ -214,12 +213,12 @@ template<typename T >
          -
          101  {
          -
          102  while (N--) {
          -
          103  double r = (std::rand() % 10000 - 5000) / 100.f;
          -
          104  arr[N] = static_cast<T>(r);
          -
          105  }
          -
          106 }
          +
          101 {
          +
          102 while (N--) {
          +
          103 double r = (std::rand() % 10000 - 5000) / 100.f;
          +
          104 arr[N] = static_cast<T>(r);
          +
          105 }
          +
          106}
          constexpr uint32_t N
          A struct to represent sparse table for min() as their invariant function, for the given array A....
          Definition: sparse_table.cpp:47
          T rand(T... args)
          @@ -231,7 +230,7 @@ Here is the call graph for this function:
        - +

        ◆ main()

        @@ -246,39 +245,39 @@ Here is the call graph for this function:
        -

        Main Function

        -

        Running predefined tests to test algorithm

        -

        For user insteraction

        -
        150  {
        -
        151  /// Running predefined tests to test algorithm
        -
        152  tests();
        -
        153 
        -
        154  /// For user insteraction
        -
        155  size_t n;
        -
        156  std::cout << "Enter the length of your array (0 to exit): ";
        -
        157  std::cin >> n;
        -
        158  if (n == 0) {
        -
        159  return 0;
        -
        160  }
        -
        161 
        -
        162  int *arr = new int[n];
        -
        163  std::cout << "Enter any " << n << " Numbers for Unsorted Array : ";
        -
        164 
        -
        165  for (int i = 0; i < n; i++) {
        -
        166  std::cin >> arr[i];
        -
        167  }
        -
        168 
        -
        169  sorting::insertionSort(arr, n);
        -
        170 
        -
        171  std::cout << "\nSorted Array : ";
        -
        172  for (int i = 0; i < n; i++) {
        -
        173  std::cout << arr[i] << " ";
        -
        174  }
        -
        175 
        -
        176  std::cout << std::endl;
        -
        177  delete[] arr;
        -
        178  return 0;
        -
        179 }
        +

        Main Function

        +

        Running predefined tests to test algorithm

        +

        For user insteraction

        +
        150 {
        +
        151 /// Running predefined tests to test algorithm
        +
        152 tests();
        +
        153
        +
        154 /// For user insteraction
        +
        155 size_t n;
        +
        156 std::cout << "Enter the length of your array (0 to exit): ";
        +
        157 std::cin >> n;
        +
        158 if (n == 0) {
        +
        159 return 0;
        +
        160 }
        +
        161
        +
        162 int *arr = new int[n];
        +
        163 std::cout << "Enter any " << n << " Numbers for Unsorted Array : ";
        +
        164
        +
        165 for (int i = 0; i < n; i++) {
        +
        166 std::cin >> arr[i];
        +
        167 }
        +
        168
        + +
        170
        +
        171 std::cout << "\nSorted Array : ";
        +
        172 for (int i = 0; i < n; i++) {
        +
        173 std::cout << arr[i] << " ";
        +
        174 }
        +
        175
        + +
        177 delete[] arr;
        +
        178 return 0;
        +
        179}
        T endl(T... args)
        @@ -293,7 +292,7 @@ Here is the call graph for this function:
        - +

        ◆ tests()

        @@ -307,46 +306,46 @@ Here is the call graph for this function:
        -

        Test Cases to test algorithm

        -
        109  {
        -
        110  int arr1[10] = {78, 34, 35, 6, 34, 56, 3, 56, 2, 4};
        -
        111  std::cout << "Test 1... ";
        -
        112  sorting::insertionSort(arr1, 10);
        -
        113  assert(std::is_sorted(arr1, arr1 + 10));
        -
        114  std::cout << "passed" << std::endl;
        -
        115 
        -
        116  int arr2[5] = {5, -3, 7, -2, 1};
        -
        117  std::cout << "Test 2... ";
        -
        118  sorting::insertionSort(arr2, 5);
        -
        119  assert(std::is_sorted(arr2, arr2 + 5));
        -
        120  std::cout << "passed" << std::endl;
        -
        121 
        -
        122  float arr3[5] = {5.6, -3.1, -3.0, -2.1, 1.8};
        -
        123  std::cout << "Test 3... ";
        -
        124  sorting::insertionSort(arr3, 5);
        -
        125  assert(std::is_sorted(arr3, arr3 + 5));
        -
        126  std::cout << "passed" << std::endl;
        -
        127 
        -
        128  std::vector<float> arr4({5.6, -3.1, -3.0, -2.1, 1.8});
        -
        129  std::cout << "Test 4... ";
        -
        130  sorting::insertionSort(&arr4);
        -
        131  assert(std::is_sorted(std::begin(arr4), std::end(arr4)));
        -
        132  std::cout << "passed" << std::endl;
        -
        133 
        -
        134  int arr5[50];
        -
        135  std::cout << "Test 5... ";
        -
        136  create_random_array(arr5, 50);
        -
        137  sorting::insertionSort(arr5, 50);
        -
        138  assert(std::is_sorted(arr5, arr5 + 50));
        -
        139  std::cout << "passed" << std::endl;
        -
        140 
        -
        141  float arr6[50];
        -
        142  std::cout << "Test 6... ";
        -
        143  create_random_array(arr6, 50);
        -
        144  sorting::insertionSort(arr6, 50);
        -
        145  assert(std::is_sorted(arr6, arr6 + 50));
        -
        146  std::cout << "passed" << std::endl;
        -
        147 }
        +

        Test Cases to test algorithm

        +
        109 {
        +
        110 int arr1[10] = {78, 34, 35, 6, 34, 56, 3, 56, 2, 4};
        +
        111 std::cout << "Test 1... ";
        +
        112 sorting::insertionSort(arr1, 10);
        +
        113 assert(std::is_sorted(arr1, arr1 + 10));
        +
        114 std::cout << "passed" << std::endl;
        +
        115
        +
        116 int arr2[5] = {5, -3, 7, -2, 1};
        +
        117 std::cout << "Test 2... ";
        +
        118 sorting::insertionSort(arr2, 5);
        +
        119 assert(std::is_sorted(arr2, arr2 + 5));
        +
        120 std::cout << "passed" << std::endl;
        +
        121
        +
        122 float arr3[5] = {5.6, -3.1, -3.0, -2.1, 1.8};
        +
        123 std::cout << "Test 3... ";
        +
        124 sorting::insertionSort(arr3, 5);
        +
        125 assert(std::is_sorted(arr3, arr3 + 5));
        +
        126 std::cout << "passed" << std::endl;
        +
        127
        +
        128 std::vector<float> arr4({5.6, -3.1, -3.0, -2.1, 1.8});
        +
        129 std::cout << "Test 4... ";
        + +
        131 assert(std::is_sorted(std::begin(arr4), std::end(arr4)));
        +
        132 std::cout << "passed" << std::endl;
        +
        133
        +
        134 int arr5[50];
        +
        135 std::cout << "Test 5... ";
        +
        136 create_random_array(arr5, 50);
        +
        137 sorting::insertionSort(arr5, 50);
        +
        138 assert(std::is_sorted(arr5, arr5 + 50));
        +
        139 std::cout << "passed" << std::endl;
        +
        140
        +
        141 float arr6[50];
        +
        142 std::cout << "Test 6... ";
        +
        143 create_random_array(arr6, 50);
        +
        144 sorting::insertionSort(arr6, 50);
        +
        145 assert(std::is_sorted(arr6, arr6 + 50));
        +
        146 std::cout << "passed" << std::endl;
        +
        147}
        T begin(T... args)
        T end(T... args)
        static void create_random_array(T *arr, int N)
        Create a random array objecthelper function to create a random array.
        Definition: insertion_sort.cpp:101
        @@ -367,7 +366,7 @@ Here is the call graph for this function:
        diff --git a/dd/d0d/insertion__sort_8cpp_a59914553f24088342c139645a02a8a49_cgraph.svg b/dd/d0d/insertion__sort_8cpp_a59914553f24088342c139645a02a8a49_cgraph.svg index c9dd243e5..a797ac69f 100644 --- a/dd/d0d/insertion__sort_8cpp_a59914553f24088342c139645a02a8a49_cgraph.svg +++ b/dd/d0d/insertion__sort_8cpp_a59914553f24088342c139645a02a8a49_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - + + Algorithms_in_C++: ciphers/vigenere_cipher.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('dd/d12/vigenere__cipher_8cpp.html','.. -
        -
        vigenere_cipher.cpp File Reference
        +
        vigenere_cipher.cpp File Reference
        -

        Implementation of Vigenère cipher algorithm. +

        Implementation of Vigenère cipher algorithm. More...

        #include <iostream>
        #include <string>
        @@ -110,16 +109,16 @@ Include dependency graph for vigenere_cipher.cpp:
        - - - + + - - + +

        +

        Namespaces

         ciphers
         Base64 Encoding and Decoding
        namespace  ciphers
         Base64 Encoding and Decoding
         
         vigenere
         Functions for vigenère cipher algorithm.
        namespace  vigenere
         Functions for vigenère cipher algorithm.
         
        - @@ -131,26 +130,26 @@ Functions

        +

        Functions

        std::string ciphers::vigenere::encrypt (const std::string &text, const std::string &key)
         
         

        Detailed Description

        -

        Implementation of Vigenère cipher algorithm.

        -

        The Vigenère cipher is a method of encrypting alphabetic text by using a series of interwoven vigenere ciphers, based on the letters of a keyword. It employs a form of polyalphabetic substitution.

        +

        Implementation of Vigenère cipher algorithm.

        +

        The Vigenère cipher is a method of encrypting alphabetic text by using a series of interwoven vigenere ciphers, based on the letters of a keyword. It employs a form of polyalphabetic substitution.

        Algorithm

        -

        The encryption can also be represented using modular arithmetic by first transforming the letters into numbers, according to the scheme, A → 0, B → 1, ..., Z → 25. Encryption of \(i^{th}\) character in Message M by key K can be described mathematically as,

        +

        The encryption can also be represented using modular arithmetic by first transforming the letters into numbers, according to the scheme, A → 0, B → 1, ..., Z → 25. Encryption of \(i^{th}\) character in Message M by key K can be described mathematically as,

        \[ E_{K}(M_{i}) = (M_{i} + K_{i})\;\mbox{mod}\; 26\]

        -

        while decryption of \(i^{th}\) character in Cipher C by key K can be described mathematically as,

        +

        while decryption of \(i^{th}\) character in Cipher C by key K can be described mathematically as,

        \[ D_{k}(C_{i}) = (C_{i} - K_{i} + 26)\;\mbox{mod}\; 26\]

        -

        Where \(K_{i}\) denotes corresponding character in key. If \(|key| < |text|\) than same key is repeated untill their lengths are equal.

        -

        For Example, If M = "ATTACKATDAWN" and K = "LEMON" than K becomes "LEMONLEMONLE".

        +

        Where \(K_{i}\) denotes corresponding character in key. If \(|key| < |text|\) than same key is repeated untill their lengths are equal.

        +

        For Example, If M = "ATTACKATDAWN" and K = "LEMON" than K becomes "LEMONLEMONLE".

        Note
        Rather than creating new key of equal length this program does this by using modular index for key (i.e. \((j + 1) \;\mbox{mod}\; |\mbox{key}|\))
        This program implements Vigenère cipher for only uppercase English alphabet characters (i.e. A-Z).
        -
        Author
        Deep Raval
        +
        Author
        Deep Raval

        Function Documentation

        - +

        ◆ decrypt()

        @@ -175,7 +174,7 @@ This program implements Vigenère cipher for only uppercase English alphabet cha
        -

        Decrypt given text using vigenere cipher.

        Parameters
        +

        Decrypt given text using vigenere cipher.

        Parameters
        @@ -183,19 +182,19 @@ This program implements Vigenère cipher for only uppercase English alphabet cha
        Returns
        new decrypted text
        -
        92  {
        -
        93  // Going through each character of text and key
        -
        94  // Note that key is visited in circular way hence j = (j + 1) % |key|
        -
        95  std::string decrypted_text = ""; // Empty string to store decrypted text
        -
        96  for(size_t i = 0, j = 0; i < text.length(); i++, j = (j + 1) % key.length()) {
        -
        97  int place_value_text = get_value(text[i]); // Getting value of character in text
        -
        98  int place_value_key = get_value(key[j]); // Getting value of character in key
        -
        99  place_value_text = (place_value_text - place_value_key + 26) % 26; // Applying decryption
        -
        100  char decrypted_char = get_char(place_value_text); // Getting new character from decrypted value
        -
        101  decrypted_text += decrypted_char; // Appending decrypted character
        -
        102  }
        -
        103  return decrypted_text; // Returning decrypted text
        -
        104  }
        +
        92 {
        +
        93 // Going through each character of text and key
        +
        94 // Note that key is visited in circular way hence j = (j + 1) % |key|
        +
        95 std::string decrypted_text = ""; // Empty string to store decrypted text
        +
        96 for(size_t i = 0, j = 0; i < text.length(); i++, j = (j + 1) % key.length()) {
        +
        97 int place_value_text = get_value(text[i]); // Getting value of character in text
        +
        98 int place_value_key = get_value(key[j]); // Getting value of character in key
        +
        99 place_value_text = (place_value_text - place_value_key + 26) % 26; // Applying decryption
        +
        100 char decrypted_char = get_char(place_value_text); // Getting new character from decrypted value
        +
        101 decrypted_text += decrypted_char; // Appending decrypted character
        +
        102 }
        +
        103 return decrypted_text; // Returning decrypted text
        +
        104 }
        T length(T... args)
        @@ -207,7 +206,7 @@ Here is the call graph for this function:
        - +

        ◆ encrypt()

        @@ -232,7 +231,7 @@ Here is the call graph for this function:
        texttext to be decrypted
        keykey to be used for decryption
        -

        Encrypt given text using vigenere cipher.

        Parameters
        +

        Encrypt given text using vigenere cipher.

        Parameters
        @@ -240,19 +239,19 @@ Here is the call graph for this function:
        Returns
        new encrypted text
        -
        73  {
        -
        74  std::string encrypted_text = ""; // Empty string to store encrypted text
        -
        75  // Going through each character of text and key
        -
        76  // Note that key is visited in circular way hence j = (j + 1) % |key|
        -
        77  for(size_t i = 0, j = 0; i < text.length(); i++, j = (j + 1) % key.length()) {
        -
        78  int place_value_text = get_value(text[i]); // Getting value of character in text
        -
        79  int place_value_key = get_value(key[j]); // Getting value of character in key
        -
        80  place_value_text = (place_value_text + place_value_key) % 26; // Applying encryption
        -
        81  char encrypted_char = get_char(place_value_text); // Getting new character from encrypted value
        -
        82  encrypted_text += encrypted_char; // Appending encrypted character
        -
        83  }
        -
        84  return encrypted_text; // Returning encrypted text
        -
        85  }
        +
        73 {
        +
        74 std::string encrypted_text = ""; // Empty string to store encrypted text
        +
        75 // Going through each character of text and key
        +
        76 // Note that key is visited in circular way hence j = (j + 1) % |key|
        +
        77 for(size_t i = 0, j = 0; i < text.length(); i++, j = (j + 1) % key.length()) {
        +
        78 int place_value_text = get_value(text[i]); // Getting value of character in text
        +
        79 int place_value_key = get_value(key[j]); // Getting value of character in key
        +
        80 place_value_text = (place_value_text + place_value_key) % 26; // Applying encryption
        +
        81 char encrypted_char = get_char(place_value_text); // Getting new character from encrypted value
        +
        82 encrypted_text += encrypted_char; // Appending encrypted character
        +
        83 }
        +
        84 return encrypted_text; // Returning encrypted text
        +
        85 }
        Here is the call graph for this function:
        @@ -262,7 +261,7 @@ Here is the call graph for this function:
        - +

        ◆ main()

        @@ -277,12 +276,12 @@ Here is the call graph for this function:
        texttext to be encrypted
        keyto be used for encryption
        -

        Driver Code

        -
        131  {
        -
        132  // Testing
        -
        133  test();
        -
        134  return 0;
        -
        135 }
        +

        Driver Code

        +
        131 {
        +
        132 // Testing
        +
        133 test();
        +
        134 return 0;
        +
        135}
        void test()
        Definition: vigenere_cipher.cpp:111
        Here is the call graph for this function:
        @@ -293,7 +292,7 @@ Here is the call graph for this function:
        - +

        ◆ test()

        @@ -307,25 +306,25 @@ Here is the call graph for this function:
        -

        Function to test above algorithm

        -
        111  {
        -
        112  // Test 1
        -
        113  std::string text1 = "NIKOLATESLA";
        -
        114  std::string encrypted1 = ciphers::vigenere::encrypt(text1, "TESLA");
        -
        115  std::string decrypted1 = ciphers::vigenere::decrypt(encrypted1, "TESLA");
        -
        116  assert(text1 == decrypted1);
        -
        117  std::cout << "Original text : " << text1;
        -
        118  std::cout << " , Encrypted text (with key = TESLA) : " << encrypted1;
        -
        119  std::cout << " , Decrypted text : "<< decrypted1 << std::endl;
        -
        120  // Test 2
        -
        121  std::string text2 = "GOOGLEIT";
        -
        122  std::string encrypted2 = ciphers::vigenere::encrypt(text2, "REALLY");
        -
        123  std::string decrypted2 = ciphers::vigenere::decrypt(encrypted2, "REALLY");
        -
        124  assert(text2 == decrypted2);
        -
        125  std::cout << "Original text : " << text2;
        -
        126  std::cout << " , Encrypted text (with key = REALLY) : " << encrypted2;
        -
        127  std::cout << " , Decrypted text : "<< decrypted2 << std::endl;
        -
        128 }
        +

        Function to test above algorithm

        +
        111 {
        +
        112 // Test 1
        +
        113 std::string text1 = "NIKOLATESLA";
        +
        114 std::string encrypted1 = ciphers::vigenere::encrypt(text1, "TESLA");
        +
        115 std::string decrypted1 = ciphers::vigenere::decrypt(encrypted1, "TESLA");
        +
        116 assert(text1 == decrypted1);
        +
        117 std::cout << "Original text : " << text1;
        +
        118 std::cout << " , Encrypted text (with key = TESLA) : " << encrypted1;
        +
        119 std::cout << " , Decrypted text : "<< decrypted1 << std::endl;
        +
        120 // Test 2
        +
        121 std::string text2 = "GOOGLEIT";
        +
        122 std::string encrypted2 = ciphers::vigenere::encrypt(text2, "REALLY");
        +
        123 std::string decrypted2 = ciphers::vigenere::decrypt(encrypted2, "REALLY");
        +
        124 assert(text2 == decrypted2);
        +
        125 std::cout << "Original text : " << text2;
        +
        126 std::cout << " , Encrypted text (with key = REALLY) : " << encrypted2;
        +
        127 std::cout << " , Decrypted text : "<< decrypted2 << std::endl;
        +
        128}
        T endl(T... args)
        std::string decrypt(const std::string &text, const std::string &key)
        Definition: vigenere_cipher.cpp:92
        @@ -345,7 +344,7 @@ Here is the call graph for this function:
        diff --git a/dd/d12/vigenere__cipher_8cpp_a3cfc3f9b20a0f230a2fcefd31dc6848e_cgraph.svg b/dd/d12/vigenere__cipher_8cpp_a3cfc3f9b20a0f230a2fcefd31dc6848e_cgraph.svg index df4b5d690..742b8c923 100644 --- a/dd/d12/vigenere__cipher_8cpp_a3cfc3f9b20a0f230a2fcefd31dc6848e_cgraph.svg +++ b/dd/d12/vigenere__cipher_8cpp_a3cfc3f9b20a0f230a2fcefd31dc6848e_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - + + Algorithms_in_C++: query Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,20 +93,19 @@ $(document).ready(function(){initNavTree('dd/d1b/structquery.html','../../'); in -
        -
        query Struct Reference
        +
        query Struct Reference
        - - - -

        +

        Public Attributes

        +
        int l
         
        +
        int r
         
        +
        int i
         
        @@ -119,7 +118,7 @@ int i diff --git a/dd/d1b/structquery.js b/dd/d1b/structquery.js deleted file mode 100644 index 88ddd6cf0..000000000 --- a/dd/d1b/structquery.js +++ /dev/null @@ -1,6 +0,0 @@ -var structquery = -[ - [ "i", "dd/d1b/structquery.html#a1442afb70f26fd0655914632c0dcadcd", null ], - [ "l", "dd/d1b/structquery.html#aedd873fb96eb4f83fb4289b1c58ce794", null ], - [ "r", "dd/d1b/structquery.html#a748f5dfd8faf440897bab39091f0a5ca", null ] -]; \ No newline at end of file diff --git a/dd/d1c/classhash__chain.html b/dd/d1c/classhash__chain.html index 679ec9617..826aee4bf 100644 --- a/dd/d1c/classhash__chain.html +++ b/dd/d1c/classhash__chain.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: hash_chain Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -95,21 +95,14 @@ $(document).ready(function(){initNavTree('dd/d1c/classhash__chain.html','../../' Private Types | Private Attributes | List of all members -
        -
        hash_chain Class Reference
        +
        hash_chain Class Reference

        Chain class with a given modulus. More...

        -
        -Collaboration diagram for hash_chain:
        -
        -
        -
        -
        [legend]
        - @@ -117,9 +110,8 @@ Public Member Functions - - + + @@ -128,32 +120,32 @@ void 

        +

        Public Member Functions

         hash_chain (int mod)
         Construct a new chain object. More...
        void add (int x, int h)
         create and add a new node with a give value and at a given height More...
         
        -void display ()
         Display the chain.
        void display ()
         Display the chain. More...
         
        virtual int hash (int x) const
         Compute the hash of a value for current chain. More...
         Find if a value and corresponding hash exist. More...
         
        - - - - + + +

        +

        Private Types

        -using Node = struct Node { int data{}
         data stored in the node
         
        +using Node = Node { int data{}
         data stored in the node
         
        - - + - + - +

        +

        Private Attributes

        -std::shared_ptr< struct Nodenext
        +std::shared_ptr< struct Nodenext
         pointer to the next node
         
        -std::vector< std::shared_ptr< Node > > head
        +std::vector< std::shared_ptr< Node > > head
         array of nodes
         
        -int _mod
        +int _mod
         modulus of the class
         

        Detailed Description

        -

        Chain class with a given modulus.

        +

        Chain class with a given modulus.

        Constructor & Destructor Documentation

        - +

        ◆ hash_chain()

        @@ -184,23 +176,16 @@ int 
        35  : _mod(mod) {
        -
        36  while (mod--) head.push_back(nullptr);
        -
        37  }
        +
        35 : _mod(mod) {
        +
        36 while (mod--) head.push_back(nullptr);
        +
        37 }
        std::vector< std::shared_ptr< Node > > head
        array of nodes
        Definition: chaining.cpp:24
        int _mod
        modulus of the class
        Definition: chaining.cpp:27
        -
        T push_back(T... args)
        -
        -Here is the call graph for this function:
        -
        -
        -
        -
        - +

        Member Function Documentation

        - +

        ◆ add()

        @@ -242,22 +227,22 @@ Here is the call graph for this function:
        -
        45  {
        - -
        47  std::shared_ptr<Node> temp(new Node);
        -
        48  temp->data = x;
        -
        49  temp->next = nullptr;
        -
        50  if (!head[h]) {
        -
        51  head[h] = temp;
        -
        52  curr = head[h];
        -
        53  } else {
        -
        54  curr = head[h];
        -
        55  while (curr->next) curr = curr->next;
        -
        56  curr->next = temp;
        -
        57  }
        -
        58  }
        +
        45 {
        + + +
        48 temp->data = x;
        +
        49 temp->next = nullptr;
        +
        50 if (!head[h]) {
        +
        51 head[h] = temp;
        +
        52 curr = head[h];
        +
        53 } else {
        +
        54 curr = head[h];
        +
        55 while (curr->next) curr = curr->next;
        +
        56 curr->next = temp;
        +
        57 }
        +
        58 }
        int h(int key)
        Definition: hash_search.cpp:45
        - +
        Definition: linkedlist_implentation_usingarray.cpp:14
        Here is the call graph for this function:
        @@ -268,7 +253,60 @@ Here is the call graph for this function:
        - + +

        ◆ display()

        + +
        +
        + + + + + +
        + + + + + + + +
        void hash_chain::display ()
        +
        +inline
        +
        + +

        Display the chain.

        +
        63 {
        +
        64 std::shared_ptr<Node> temp = nullptr;
        +
        65 int i = 0;
        +
        66 for (i = 0; i < _mod; i++) {
        +
        67 if (!head[i]) {
        +
        68 std::cout << "Key " << i << " is empty" << std::endl;
        +
        69 } else {
        +
        70 std::cout << "Key " << i << " has values = " << std::endl;
        +
        71 temp = head[i];
        +
        72 while (temp->next) {
        +
        73 std::cout << temp->data << " " << std::endl;
        +
        74 temp = temp->next;
        +
        75 }
        +
        76 std::cout << temp->data;
        + +
        78 }
        +
        79 }
        +
        80 }
        + +
        T endl(T... args)
        +
        +Here is the call graph for this function:
        +
        +
        +
        +
        + +
        +
        +

        ◆ find()

        @@ -313,35 +351,33 @@ Here is the call graph for this function:
        Returns
        true if element found
        false if element not found
        -
        101  {
        -
        102  std::shared_ptr<Node> temp = head[h];
        -
        103  if (!head[h]) {
        -
        104  // index does not exist!
        -
        105  std::cout << "Element not found" << std::endl;
        -
        106  return false;
        -
        107  }
        -
        108 
        -
        109  // scan for data value
        -
        110  while (temp->data != x && temp->next) temp = temp->next;
        -
        111 
        -
        112  if (temp->next) {
        -
        113  std::cout << "Element found" << std::endl;
        -
        114  return true;
        -
        115  }
        -
        116 
        -
        117  // implicit else condition
        -
        118  // i.e., temp->next == nullptr
        -
        119  if (temp->data == x) {
        -
        120  std::cout << "Element found" << std::endl;
        -
        121  return true;
        -
        122  }
        -
        123 
        -
        124  // further implicit else condition
        -
        125  std::cout << "Element not found" << std::endl;
        -
        126  return false;
        -
        127  }
        - -
        T endl(T... args)
        +
        101 {
        + +
        103 if (!head[h]) {
        +
        104 // index does not exist!
        +
        105 std::cout << "Element not found" << std::endl;
        +
        106 return false;
        +
        107 }
        +
        108
        +
        109 // scan for data value
        +
        110 while (temp->data != x && temp->next) temp = temp->next;
        +
        111
        +
        112 if (temp->next) {
        +
        113 std::cout << "Element found" << std::endl;
        +
        114 return true;
        +
        115 }
        +
        116
        +
        117 // implicit else condition
        +
        118 // i.e., temp->next == nullptr
        +
        119 if (temp->data == x) {
        +
        120 std::cout << "Element found" << std::endl;
        +
        121 return true;
        +
        122 }
        +
        123
        +
        124 // further implicit else condition
        +
        125 std::cout << "Element not found" << std::endl;
        +
        126 return false;
        +
        127 }
        Here is the call graph for this function:
        @@ -351,7 +387,7 @@ Here is the call graph for this function:
        - +

        ◆ hash()

        @@ -383,8 +419,8 @@ Here is the call graph for this function:
        Returns
        modulus of x
        -
        Note
        declared as a virtual so that custom implementations of the class can modify the hash function.
        -
        91 { return x % _mod; }
        +
        Note
        declared as a virtual so that custom implementations of the class can modify the hash function.
        +
        91{ return x % _mod; }
        @@ -397,7 +433,7 @@ Here is the call graph for this function: diff --git a/dd/d1c/classhash__chain.js b/dd/d1c/classhash__chain.js index d59453f3e..398599c99 100644 --- a/dd/d1c/classhash__chain.js +++ b/dd/d1c/classhash__chain.js @@ -1,6 +1,6 @@ var classhash__chain = [ - [ "Node", "dd/d1c/classhash__chain.html#a21172d047bb9621385f2426ce25e71aa", null ], + [ "Node", "dd/d1c/classhash__chain.html#a28d3adffc0126beeef63bce0846fb8f5", null ], [ "hash_chain", "dd/d1c/classhash__chain.html#a80c8b902a15b4fd062ed727ecf8f3595", null ], [ "add", "dd/d1c/classhash__chain.html#a6b4b4de1a8c96f98a63a77f650a9dcff", null ], [ "display", "dd/d1c/classhash__chain.html#a706964ad13587fc9a8b3fe8381d410ed", null ], diff --git a/dd/d1c/classhash__chain_a55aa5c6753cb8853152d469c375d946a_cgraph.svg b/dd/d1c/classhash__chain_a55aa5c6753cb8853152d469c375d946a_cgraph.svg index 93222fbf2..b83b320fc 100644 --- a/dd/d1c/classhash__chain_a55aa5c6753cb8853152d469c375d946a_cgraph.svg +++ b/dd/d1c/classhash__chain_a55aa5c6753cb8853152d469c375d946a_cgraph.svg @@ -1,7 +1,7 @@ - - + + + diff --git a/dd/d1c/classhash__chain_a706964ad13587fc9a8b3fe8381d410ed_cgraph.md5 b/dd/d1c/classhash__chain_a706964ad13587fc9a8b3fe8381d410ed_cgraph.md5 new file mode 100644 index 000000000..e5a4f14c0 --- /dev/null +++ b/dd/d1c/classhash__chain_a706964ad13587fc9a8b3fe8381d410ed_cgraph.md5 @@ -0,0 +1 @@ +fe5a31b1ceecc3640d3bd888940862ea \ No newline at end of file diff --git a/dd/d1c/classhash__chain_a706964ad13587fc9a8b3fe8381d410ed_cgraph.svg b/dd/d1c/classhash__chain_a706964ad13587fc9a8b3fe8381d410ed_cgraph.svg new file mode 100644 index 000000000..55c872b94 --- /dev/null +++ b/dd/d1c/classhash__chain_a706964ad13587fc9a8b3fe8381d410ed_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +hash_chain::display + + + +Node1 + + +hash_chain::display + + + + + +Node2 + + +std::endl + + + + + +Node1->Node2 + + + + + diff --git a/dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.map b/dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.map deleted file mode 100644 index 301cb0720..000000000 --- a/dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.md5 b/dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.md5 deleted file mode 100644 index eb8472bce..000000000 --- a/dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -276f5eee7cebc61b8fb81a010ebe6472 \ No newline at end of file diff --git a/dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.svg b/dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.svg deleted file mode 100644 index 27c94e7e8..000000000 --- a/dd/d1c/classhash__chain_a80c8b902a15b4fd062ed727ecf8f3595_cgraph.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -hash_chain::hash_chain - - - -Node1 - - -hash_chain::hash_chain - - - - - -Node2 - - -std::vector::push_back - - - - - -Node1->Node2 - - - - - diff --git a/dd/d24/namespacedynamic__programming.html b/dd/d24/namespacedynamic__programming.html index 80c589864..b07ebd52c 100644 --- a/dd/d24/namespacedynamic__programming.html +++ b/dd/d24/namespacedynamic__programming.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: dynamic_programming Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,35 +92,34 @@ $(document).ready(function(){initNavTree('dd/d24/namespacedynamic__programming.h
        -
        -
        dynamic_programming Namespace Reference
        +
        dynamic_programming Namespace Reference

        Dynamic Programming algorithms. More...

        -

        +

        Functions

        uint64_t LIS (const std::vector< uint64_t > &a, const uint32_t &n)
         Calculate the longest increasing subsequence for the specified numbers. More...
         

        Detailed Description

        -

        Dynamic Programming algorithms.

        -

        Dynamic programming algorithms.

        -

        for std::vector

        -

        Dynamic Programming algorithm.

        -

        Dynamic Programming Algorithms.

        -

        for assert for IO operations for std::string library for std::vector STL library

        -

        for assert for std::max for io operations

        -

        Dynamic Programming algorithms

        -

        for assert for std::max for IO operations

        -

        Dynamic Programming algorithms

        -

        for assert for IO operations

        -

        Dynamic Programming algorithms

        +

        Dynamic Programming algorithms.

        +

        Dynamic programming algorithms.

        +

        for std::vector

        +

        Dynamic Programming algorithm.

        +

        Dynamic Programming Algorithms.

        +

        for assert for IO operations for std::string library for std::vector STL library

        +

        for assert for std::max for io operations

        +

        Dynamic Programming algorithms

        +

        for assert for std::max for IO operations

        +

        Dynamic Programming algorithms

        +

        for assert for IO operations

        +

        Dynamic Programming algorithms

        Function Documentation

        - +

        ◆ LIS()

        @@ -155,26 +154,26 @@ Functions
        Returns
        the length of the longest increasing subsequence in the a array of size n
        -
        39  {
        -
        40  std::vector<int> lis(n);
        -
        41  for (int i = 0; i < n; ++i) {
        -
        42  lis[i] = 1;
        -
        43  }
        -
        44  for (int i = 0; i < n; ++i) {
        -
        45  for (int j = 0; j < i; ++j) {
        -
        46  if (a[i] > a[j] && lis[i] < lis[j] + 1) {
        -
        47  lis[i] = lis[j] + 1;
        -
        48  }
        -
        49  }
        -
        50  }
        -
        51  int res = 0;
        -
        52  for (int i = 0; i < n; ++i) {
        -
        53  res = std::max(res, lis[i]);
        -
        54  }
        -
        55  return res;
        -
        56 }
        +
        39 {
        +
        40 std::vector<int> lis(n);
        +
        41 for (int i = 0; i < n; ++i) {
        +
        42 lis[i] = 1;
        +
        43 }
        +
        44 for (int i = 0; i < n; ++i) {
        +
        45 for (int j = 0; j < i; ++j) {
        +
        46 if (a[i] > a[j] && lis[i] < lis[j] + 1) {
        +
        47 lis[i] = lis[j] + 1;
        +
        48 }
        +
        49 }
        +
        50 }
        +
        51 int res = 0;
        +
        52 for (int i = 0; i < n; ++i) {
        +
        53 res = std::max(res, lis[i]);
        +
        54 }
        +
        55 return res;
        +
        56}
        T max(T... args)
        - +
        Here is the call graph for this function:
        @@ -190,7 +189,7 @@ Here is the call graph for this function:
        diff --git a/dd/d24/namespacedynamic__programming_a0a2215194e58786c34db1ccaf8031079_cgraph.svg b/dd/d24/namespacedynamic__programming_a0a2215194e58786c34db1ccaf8031079_cgraph.svg index 5b0f1dc4c..10e2ce086 100644 --- a/dd/d24/namespacedynamic__programming_a0a2215194e58786c34db1ccaf8031079_cgraph.svg +++ b/dd/d24/namespacedynamic__programming_a0a2215194e58786c34db1ccaf8031079_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: numerical_methods/false_position.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('dd/d29/false__position_8cpp.html','../ -
        -
        false_position.cpp File Reference
        +
        false_position.cpp File Reference
        -

        Solve the equation \(f(x)=0\) using false position method, also known as the Secant method. +

        Solve the equation \(f(x)=0\) using false position method, also known as the Secant method. More...

        #include <cmath>
        #include <iostream>
        @@ -109,16 +108,16 @@ Include dependency graph for false_position.cpp:
        - - + - - + +

        +

        Namespaces

         numerical_methods
        namespace  numerical_methods
         for io operations
         
         false_position
         Functions for False Position method.
        namespace  false_position
         Functions for False Position method.
         
        - @@ -134,18 +133,18 @@ Functions

        +

        Functions

        static float numerical_methods::false_position::eq (float x)
         This function gives the value of f(x) for given x. More...
         

        Detailed Description

        -

        Solve the equation \(f(x)=0\) using false position method, also known as the Secant method.

        -

        First, multiple intervals are selected with the interval gap provided. Separate recursive function called for every root. Roots are printed Separatelt.

        -

        For an interval [a,b] \(a\) and \(b\) such that \(f(a)<0\) and \(f(b)>0\), then the \((i+1)^\text{th}\) approximation is given by:

        +

        Solve the equation \(f(x)=0\) using false position method, also known as the Secant method.

        +

        First, multiple intervals are selected with the interval gap provided. Separate recursive function called for every root. Roots are printed Separatelt.

        +

        For an interval [a,b] \(a\) and \(b\) such that \(f(a)<0\) and \(f(b)>0\), then the \((i+1)^\text{th}\) approximation is given by:

        \[ x_{i+1} = \frac{a_i\cdot f(b_i) - b_i\cdot f(a_i)}{f(b_i) - f(a_i)} \]

        For the next iteration, the interval is selected as: \([a,x]\) if \(x>0\) or \([x,b]\) if \(x<0\). The Process is continued till a close enough approximation is achieved.

        See also
        newton_raphson_method.cpp, bisection_method.cpp
        Author
        Unknown author
        -Samruddha Patil
        +Samruddha Patil

        Function Documentation

        - +

        ◆ eq()

        @@ -177,9 +176,9 @@ Functions
        Returns
        value of f(x) for given x.
        -
        44  {
        -
        45  return (x * x - x); // original equation
        -
        46 }
        +
        44 {
        +
        45 return (x * x - x); // original equation
        +
        46}
        Here is the call graph for this function:
        @@ -189,7 +188,7 @@ Here is the call graph for this function:
        - +

        ◆ main()

        @@ -207,40 +206,40 @@ Here is the call graph for this function:

        Main function.

        Returns
        0 on exit
        -
        102  {
        -
        103  float a = 0, b = 0, i = 0, root = 0;
        -
        104  int16_t count = 0;
        -
        105  float range =
        -
        106  100000; // Range in which we have to find the root. (-range,range)
        -
        107  float gap = 0.5; // interval gap. lesser the gap more the accuracy
        -
        108  a = numerical_methods::false_position::eq((-1) * range);
        -
        109  i = ((-1) * range + gap);
        -
        110  // while loop for selecting proper interval in provided range and with
        -
        111  // provided interval gap.
        -
        112  while (i <= range) {
        - -
        114  if (b == 0) {
        -
        115  count++;
        - -
        117  }
        -
        118  if (a * b < 0) {
        - -
        120  a, b);
        -
        121  count++;
        - -
        123  }
        -
        124  a = b;
        -
        125  i += gap;
        -
        126  }
        -
        127  return 0;
        -
        128 }
        +
        102 {
        +
        103 float a = 0, b = 0, i = 0, root = 0;
        +
        104 int16_t count = 0;
        +
        105 float range =
        +
        106 100000; // Range in which we have to find the root. (-range,range)
        +
        107 float gap = 0.5; // interval gap. lesser the gap more the accuracy
        + +
        109 i = ((-1) * range + gap);
        +
        110 // while loop for selecting proper interval in provided range and with
        +
        111 // provided interval gap.
        +
        112 while (i <= range) {
        + +
        114 if (b == 0) {
        +
        115 count++;
        + +
        117 }
        +
        118 if (a * b < 0) {
        + +
        120 a, b);
        +
        121 count++;
        + +
        123 }
        +
        124 a = b;
        +
        125 i += gap;
        +
        126 }
        +
        127 return 0;
        +
        128}
        static float regula_falsi(float x1, float x2, float y1, float y2)
        This function finds root of the equation in given interval i.e. (x1,x2).
        Definition: false_position.cpp:55
        static float eq(float x)
        This function gives the value of f(x) for given x.
        Definition: false_position.cpp:44
        void printRoot(float root, const int16_t &count)
        This function prints roots of the equation.
        Definition: false_position.cpp:84
        - +

        ◆ printRoot()

        @@ -274,17 +273,17 @@ Here is the call graph for this function:
        -
        84  {
        -
        85  if (count == 1) {
        -
        86  std::cout << "Your 1st root is : " << root << std::endl;
        -
        87  } else if (count == 2) {
        -
        88  std::cout << "Your 2nd root is : " << root << std::endl;
        -
        89  } else if (count == 3) {
        -
        90  std::cout << "Your 3rd root is : " << root << std::endl;
        -
        91  } else {
        -
        92  std::cout << "Your " << count << "th root is : " << root << std::endl;
        -
        93  }
        -
        94 }
        +
        84 {
        +
        85 if (count == 1) {
        +
        86 std::cout << "Your 1st root is : " << root << std::endl;
        +
        87 } else if (count == 2) {
        +
        88 std::cout << "Your 2nd root is : " << root << std::endl;
        +
        89 } else if (count == 3) {
        +
        90 std::cout << "Your 3rd root is : " << root << std::endl;
        +
        91 } else {
        +
        92 std::cout << "Your " << count << "th root is : " << root << std::endl;
        +
        93 }
        +
        94}
        T endl(T... args)
        @@ -296,7 +295,7 @@ Here is the call graph for this function:
        - +

        ◆ regula_falsi()

        @@ -351,29 +350,29 @@ Here is the call graph for this function:
        Returns
        root of the equation in the given interval.
        -
        55  {
        -
        56  float diff = x1 - x2;
        -
        57  if (diff < 0) {
        -
        58  diff = (-1) * diff;
        -
        59  }
        -
        60  if (diff < 0.00001) {
        -
        61  if (y1 < 0) {
        -
        62  y1 = -y1;
        -
        63  }
        -
        64  if (y2 < 0) {
        -
        65  y2 = -y2;
        -
        66  }
        -
        67  if (y1 < y2) {
        -
        68  return x1;
        -
        69  } else {
        -
        70  return x2;
        -
        71  }
        -
        72  }
        -
        73  float x3 = 0, y3 = 0;
        -
        74  x3 = x1 - (x1 - x2) * (y1) / (y1 - y2);
        -
        75  y3 = eq(x3);
        -
        76  return regula_falsi(x2, x3, y2, y3);
        -
        77 }
        +
        55 {
        +
        56 float diff = x1 - x2;
        +
        57 if (diff < 0) {
        +
        58 diff = (-1) * diff;
        +
        59 }
        +
        60 if (diff < 0.00001) {
        +
        61 if (y1 < 0) {
        +
        62 y1 = -y1;
        +
        63 }
        +
        64 if (y2 < 0) {
        +
        65 y2 = -y2;
        +
        66 }
        +
        67 if (y1 < y2) {
        +
        68 return x1;
        +
        69 } else {
        +
        70 return x2;
        +
        71 }
        +
        72 }
        +
        73 float x3 = 0, y3 = 0;
        +
        74 x3 = x1 - (x1 - x2) * (y1) / (y1 - y2);
        +
        75 y3 = eq(x3);
        +
        76 return regula_falsi(x2, x3, y2, y3);
        +
        77}
        Here is the call graph for this function:
        @@ -389,7 +388,7 @@ Here is the call graph for this function:
        diff --git a/dd/d29/false__position_8cpp_a7d69b49dc37da1c02b3ab8c7fe783494_cgraph.svg b/dd/d29/false__position_8cpp_a7d69b49dc37da1c02b3ab8c7fe783494_cgraph.svg index 794af60ec..19ca66b64 100644 --- a/dd/d29/false__position_8cpp_a7d69b49dc37da1c02b3ab8c7fe783494_cgraph.svg +++ b/dd/d29/false__position_8cpp_a7d69b49dc37da1c02b3ab8c7fe783494_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: Trie Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -98,62 +98,82 @@ $(document).ready(function(){initNavTree('dd/d2f/class_trie.html','../../'); ini Private Attributes | Static Private Attributes | List of all members -
        -
        Trie Class Reference
        +
        Trie Class Reference
        -
        -Collaboration diagram for Trie:
        -
        -
        -
        -
        [legend]
        -

        +

        Classes

        struct  TrieNode
         
        - - - + + - +

        +

        Public Member Functions

        Trie ()
         constructor to initialise the root of the trie.
         Trie ()
         constructor to initialise the root of the trie. More...
         
        void insert (const std::string &word)
         
        bool search (const std::string &word)
         
        -void removeWord (const std::string &word)
        void removeWord (const std::string &word)
         
        - - - + +

        +

        Private Member Functions

        std::shared_ptr< TrieNoderemoveWordHelper (const std::string &word, std::shared_ptr< TrieNode > curr, size_t index)
         
        std::shared_ptr< TrieNoderemoveWordHelper (const std::string &word, std::shared_ptr< TrieNode > curr, size_t index)
         
        -

        +

        Static Private Member Functions

        static bool hasChildren (std::shared_ptr< TrieNode > node)
         
        - -

        +

        Private Attributes

        +
        std::shared_ptr< TrieNodem_root
         
        - -

        +

        Static Private Attributes

        +
        static constexpr size_t ALPHABETS = 26
         

        Detailed Description

        -

        A basic implementation of trie class to store only lower-case strings. You can extend the implementation to all the ASCII characters by changing the value of @ ALPHABETS to 128.

        -

        Member Function Documentation

        - +

        A basic implementation of trie class to store only lower-case strings. You can extend the implementation to all the ASCII characters by changing the value of @ ALPHABETS to 128.

        +

        Constructor & Destructor Documentation

        + +

        ◆ Trie()

        + +
        +
        + + + + + +
        + + + + + + + +
        Trie::Trie ()
        +
        +inline
        +
        + +

        constructor to initialise the root of the trie.

        +
        103: m_root(std::make_shared<TrieNode>()) {}
        +
        +
        +
        +

        Member Function Documentation

        +

        ◆ hasChildren()

        @@ -176,7 +196,7 @@ static constexpr size_t AL
        -

        Function to check if a node has some children which can form words.

        Parameters
        +

        Function to check if a node has some children which can form words.

        Parameters
        nodewhose character array of pointers need to be checked for children.
        @@ -185,19 +205,19 @@ static constexpr size_t AL
        Returns
        true if a child is found
        false if a child is not found
        -
        41  {
        -
        42  for (size_t i = 0; i < ALPHABETS; i++) {
        -
        43  if (node->character[i]) {
        -
        44  return true;
        -
        45  }
        -
        46  }
        -
        47  return false;
        -
        48  }
        +
        41 {
        +
        42 for (size_t i = 0; i < ALPHABETS; i++) {
        +
        43 if (node->character[i]) {
        +
        44 return true;
        +
        45 }
        +
        46 }
        +
        47 return false;
        +
        48 }
        Definition: avltree.cpp:13
        - +

        ◆ insert()

        @@ -220,32 +240,32 @@ static constexpr size_t AL
        -

        Insert a word into the trie.

        Parameters
        +

        Insert a word into the trie.

        Parameters
        wordwhich needs to be inserted into the string.
        -
        109  {
        -
        110  auto curr = m_root;
        -
        111  for (char ch : word) {
        -
        112  size_t index = ch - 'a';
        -
        113 
        -
        114  // if a node for current word is not already present in trie, create
        -
        115  // a new node for it.
        -
        116  if (!curr->character[index]) {
        -
        117  curr->character[index] = std::make_shared<TrieNode>();
        -
        118  }
        -
        119 
        -
        120  curr = curr->character[index];
        -
        121  }
        -
        122  curr->isEndOfWord = true;
        -
        123  }
        +
        109 {
        +
        110 auto curr = m_root;
        +
        111 for (char ch : word) {
        +
        112 size_t index = ch - 'a';
        +
        113
        +
        114 // if a node for current word is not already present in trie, create
        +
        115 // a new node for it.
        +
        116 if (!curr->character[index]) {
        +
        117 curr->character[index] = std::make_shared<TrieNode>();
        +
        118 }
        +
        119
        +
        120 curr = curr->character[index];
        +
        121 }
        +
        122 curr->isEndOfWord = true;
        +
        123 }
        - -

        ◆ removeWordHelper()

        + +

        ◆ removeWord()

        @@ -254,7 +274,37 @@ static constexpr size_t AL - + + + + + + +
        std::shared_ptr<TrieNode> Trie::removeWordHelper void Trie::removeWord (const std::stringword)
        + + +inline + + +
        +
        148 {
        +
        149 m_root = removeWordHelper(word, m_root, 0);
        +
        150 }
        +
        std::shared_ptr< TrieNode > removeWordHelper(const std::string &word, std::shared_ptr< TrieNode > curr, size_t index)
        Definition: trie_modern.cpp:64
        +
        +
        +
        + +

        ◆ removeWordHelper()

        + +
        +
        + + +
        + + + @@ -283,7 +333,7 @@ static constexpr size_t 
        std::shared_ptr< TrieNode > Trie::removeWordHelper ( const std::string word, AL
        -

        A recursive helper function to remove a word from the trie. First, it recursively traverses to the location of last character of word in the trie. However, if the word is not found, the function returns a runtime error. Upon successfully reaching the last character of word in trie, if sets the isEndOfWord to false and deletes the node if and only if it has no children, else it returns the current node.

        Parameters
        +

        A recursive helper function to remove a word from the trie. First, it recursively traverses to the location of last character of word in the trie. However, if the word is not found, the function returns a runtime error. Upon successfully reaching the last character of word in trie, if sets the isEndOfWord to false and deletes the node if and only if it has no children, else it returns the current node.

        Parameters
        @@ -298,56 +348,55 @@ static constexpr size_t 
        wordis the string which needs to be removed from trie.
        curris the current node we are at.
        AL
        -
        66  {
        -
        67  if (word.size() == index) {
        -
        68  if (curr->isEndOfWord) {
        -
        69  curr->isEndOfWord = false;
        -
        70  }
        -
        71  if (hasChildren(curr)) {
        -
        72  return curr;
        -
        73  }
        -
        74  return nullptr;
        -
        75  }
        -
        76 
        -
        77  size_t idx = word[index] - 'a';
        -
        78 
        -
        79  // Throw a runtime error in case the user enters a word which is not
        -
        80  // present in the trie.
        -
        81  if (!curr->character[idx]) {
        -
        82  throw std::runtime_error(std::move(std::string("Word not found.")));
        -
        83  }
        -
        84 
        -
        85  curr->character[idx] =
        -
        86  removeWordHelper(word, curr->character[idx], index + 1);
        -
        87 
        -
        88  // This if condition checks if the node has some childern.
        -
        89  // The 1st if check, i.e. (curr->character[idx]) is checked specifically
        -
        90  // because if the older string is a prefix of some other string, then,
        -
        91  // there would be no need to check all 26 characters. Example- str1 =
        -
        92  // abbey, str2 = abbex and we want to delete string "abbey", then in
        -
        93  // this case, there would be no need to check all characters for the
        -
        94  // chars a,b,b.
        -
        95  if (curr->character[idx] || hasChildren(curr)) {
        -
        96  return curr;
        -
        97  }
        -
        98  return nullptr;
        -
        99  }
        +
        66 {
        +
        67 if (word.size() == index) {
        +
        68 if (curr->isEndOfWord) {
        +
        69 curr->isEndOfWord = false;
        +
        70 }
        +
        71 if (hasChildren(curr)) {
        +
        72 return curr;
        +
        73 }
        +
        74 return nullptr;
        +
        75 }
        +
        76
        +
        77 size_t idx = word[index] - 'a';
        +
        78
        +
        79 // Throw a runtime error in case the user enters a word which is not
        +
        80 // present in the trie.
        +
        81 if (!curr->character[idx]) {
        +
        82 throw std::runtime_error(std::move(std::string("Word not found.")));
        +
        83 }
        +
        84
        +
        85 curr->character[idx] =
        +
        86 removeWordHelper(word, curr->character[idx], index + 1);
        +
        87
        +
        88 // This if condition checks if the node has some childern.
        +
        89 // The 1st if check, i.e. (curr->character[idx]) is checked specifically
        +
        90 // because if the older string is a prefix of some other string, then,
        +
        91 // there would be no need to check all 26 characters. Example- str1 =
        +
        92 // abbey, str2 = abbex and we want to delete string "abbey", then in
        +
        93 // this case, there would be no need to check all characters for the
        +
        94 // chars a,b,b.
        +
        95 if (curr->character[idx] || hasChildren(curr)) {
        +
        96 return curr;
        +
        97 }
        +
        98 return nullptr;
        +
        99 }
        static bool hasChildren(std::shared_ptr< TrieNode > node)
        Definition: trie_modern.cpp:41
        -
        std::shared_ptr< TrieNode > removeWordHelper(const std::string &word, std::shared_ptr< TrieNode > curr, size_t index)
        Definition: trie_modern.cpp:64
        T move(T... args)
        T size(T... args)
        Here is the call graph for this function:
        -
        +
        - +

        ◆ search()

        @@ -370,7 +419,7 @@ Here is the call graph for this function:
        -

        Search if a word is present in trie or not.

        Parameters
        +

        Search if a word is present in trie or not.

        Parameters
        wordwhich is needed to be searched in the trie.
        @@ -379,20 +428,20 @@ Here is the call graph for this function:
        Returns
        True if the word is found in trie and isEndOfWord is set to true.
        False if word is not found in trie or isEndOfWord is set to false.
        -
        132  {
        -
        133  auto curr = m_root;
        -
        134  for (char ch : word) {
        -
        135  size_t index = ch - 'a';
        -
        136 
        -
        137  // if any node for a character is not found, then return that the
        -
        138  // word cannot be formed.
        -
        139  if (!curr->character[index]) {
        -
        140  return false;
        -
        141  }
        -
        142  curr = curr->character[index];
        -
        143  }
        -
        144  return curr->isEndOfWord;
        -
        145  }
        +
        132 {
        +
        133 auto curr = m_root;
        +
        134 for (char ch : word) {
        +
        135 size_t index = ch - 'a';
        +
        136
        +
        137 // if any node for a character is not found, then return that the
        +
        138 // word cannot be formed.
        +
        139 if (!curr->character[index]) {
        +
        140 return false;
        +
        141 }
        +
        142 curr = curr->character[index];
        +
        143 }
        +
        144 return curr->isEndOfWord;
        +
        145 }
        @@ -405,7 +454,7 @@ False if word is not found in trie or isEndOfWord is set to false. diff --git a/dd/d2f/class_trie.js b/dd/d2f/class_trie.js index 2661e64da..98819b54d 100644 --- a/dd/d2f/class_trie.js +++ b/dd/d2f/class_trie.js @@ -1,12 +1,9 @@ var class_trie = [ - [ "TrieNode", "de/d48/struct_trie_1_1_trie_node.html", "de/d48/struct_trie_1_1_trie_node" ], + [ "TrieNode", "de/d48/struct_trie_1_1_trie_node.html", null ], [ "Trie", "dd/d2f/class_trie.html#a6af57e9f25d0d0a2d59eea5a4a802908", null ], [ "hasChildren", "dd/d2f/class_trie.html#a6d10eb1669453395d1900ebd401954fb", null ], [ "insert", "dd/d2f/class_trie.html#afd8b79959009b554e98ea7128b2886f2", null ], - [ "removeWord", "dd/d2f/class_trie.html#a734a08b52b8ad73bdd1f36ae8348056e", null ], - [ "removeWordHelper", "dd/d2f/class_trie.html#a95216ffc56cb9f8cede982cecb872af4", null ], - [ "search", "dd/d2f/class_trie.html#a411e77126930a0942dd7b65e96b15206", null ], - [ "ALPHABETS", "dd/d2f/class_trie.html#a7c3ba4caf24378826a789848629177bd", null ], - [ "m_root", "dd/d2f/class_trie.html#a58b359fad33ca0064bd75a0d41a7b66d", null ] + [ "removeWordHelper", "dd/d2f/class_trie.html#a26941759ecf94d67a27d4a610bc0f63d", null ], + [ "search", "dd/d2f/class_trie.html#a411e77126930a0942dd7b65e96b15206", null ] ]; \ No newline at end of file diff --git a/dd/d2f/class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.map b/dd/d2f/class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.map similarity index 100% rename from dd/d2f/class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.map rename to dd/d2f/class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.map diff --git a/dd/d2f/class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.md5 b/dd/d2f/class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.md5 new file mode 100644 index 000000000..ba945bd32 --- /dev/null +++ b/dd/d2f/class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.md5 @@ -0,0 +1 @@ +49f37747ae0a788844deebf481f9c846 \ No newline at end of file diff --git a/dd/d2f/class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.svg b/dd/d2f/class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.svg similarity index 88% rename from dd/d2f/class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.svg rename to dd/d2f/class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.svg index 0bd7440ad..2d5830a4c 100644 --- a/dd/d2f/class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.svg +++ b/dd/d2f/class_trie_a26941759ecf94d67a27d4a610bc0f63d_cgraph.svg @@ -1,7 +1,7 @@ - + + +Node1->Node1 + + + Node2 @@ -58,7 +64,7 @@ - + Node1->Node4 diff --git a/dd/d2f/class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.md5 b/dd/d2f/class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.md5 deleted file mode 100644 index 20af936bc..000000000 --- a/dd/d2f/class_trie_a95216ffc56cb9f8cede982cecb872af4_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -9a766095fb839cbad3c0e066810b3e24 \ No newline at end of file diff --git a/dd/d30/matrix__exponentiation_8cpp__incl.svg b/dd/d30/matrix__exponentiation_8cpp__incl.svg index 68c1c2230..72a65af81 100644 --- a/dd/d30/matrix__exponentiation_8cpp__incl.svg +++ b/dd/d30/matrix__exponentiation_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: data_structures::tree_234::Node Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -94,21 +94,14 @@ $(document).ready(function(){initNavTree('dd/d40/classdata__structures_1_1tree__ Public Member Functions | Private Attributes | List of all members -
        -
        data_structures::tree_234::Node Class Reference
        +
        data_structures::tree_234::Node Class Reference

        2-3-4 tree node class More...

        -
        -Collaboration diagram for data_structures::tree_234::Node:
        -
        -
        -
        -
        [legend]
        - @@ -155,53 +148,53 @@ Public Member Functions - - - + + + - - - + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + +

        +

        Public Member Functions

         Node (int64_t item)
         Node constructor. More...
        void InsertItemByIndex (int8_t index, int64_t item, Node *with_child, bool to_left=true)
         Insert a value to the index position. More...
         
        NodeRemoveItemByIndex (int8_t index, bool keep_left)
         Insert a value to the index position. More...
         
        NodeRemoveItemByIndex (int8_t index, bool keep_left)
         Insert a value to the index position. More...
         
        int8_t GetChildIndex (Node *child)
         Get the child's index of the children array. More...
         
        NodeGetChild (int8_t index)
         Get the child pointer at position of index. More...
         
        NodeGetChild (int8_t index)
         Get the child pointer at position of index. More...
         
        void SetChild (int8_t index, Node *child)
         Set child pointer to the position of index. More...
         
        NodeGetRightmostChild ()
         Get rightmose child of the current node. More...
         
        NodeGetLeftmostChild ()
         Get leftmose child of the current node. More...
         
        NodeGetItemLeftChild (int8_t item_index)
         Get left child of item at item_index. More...
         
        NodeGetItemRightChild (int8_t item_index)
         Get right child of item at item_index. More...
         
        NodeGetNextPossibleChild (int64_t item)
         Get next node which is possibly contains item. More...
         
        NodeGetRightmostChild ()
         Get rightmose child of the current node. More...
         
        NodeGetLeftmostChild ()
         Get leftmose child of the current node. More...
         
        NodeGetItemLeftChild (int8_t item_index)
         Get left child of item at item_index. More...
         
        NodeGetItemRightChild (int8_t item_index)
         Get right child of item at item_index. More...
         
        NodeGetNextPossibleChild (int64_t item)
         Get next node which is possibly contains item. More...
         
        - - + - + - +

        +

        Private Attributes

        -std::array< int64_t, 3 > items
        +std::array< int64_t, 3 > items
         store items
         
        -std::array< Node *, 4 > children
        +std::array< Node *, 4 > children
         store the children pointers
         
        -int8_t count = 0
        +int8_t count = 0
         track the current item count
         

        Detailed Description

        -

        2-3-4 tree node class

        +

        2-3-4 tree node class

        Constructor & Destructor Documentation

        - +

        ◆ Node()

        @@ -232,9 +225,9 @@ int8_t 
        42  : count(1),
        -
        43  items({{item, 0, 0}}),
        -
        44  children({{nullptr, nullptr, nullptr, nullptr}}) {}
        +
        42 : count(1),
        +
        43 items({{item, 0, 0}}),
        +
        44 children({{nullptr, nullptr, nullptr, nullptr}}) {}
        std::array< int64_t, 3 > items
        store items
        Definition: tree_234.cpp:315
        int8_t count
        track the current item count
        Definition: tree_234.cpp:319
        std::array< Node *, 4 > children
        store the children pointers
        Definition: tree_234.cpp:317
        @@ -242,7 +235,7 @@ int8_t Member Function Documentation - +

        ◆ Contains()

        @@ -274,19 +267,19 @@ int8_t 
        Returns
        true if item in the node, otherwise false
        -
        92  {
        -
        93  for (int8_t i = 0; i < count; i++) {
        -
        94  if (item == items[i]) {
        -
        95  return true;
        -
        96  }
        -
        97  }
        -
        98  return false;
        -
        99  }
        +
        92 {
        +
        93 for (int8_t i = 0; i < count; i++) {
        +
        94 if (item == items[i]) {
        +
        95 return true;
        +
        96 }
        +
        97 }
        +
        98 return false;
        +
        99 }
        - -

        ◆ GetChild()

        + +

        ◆ GetChild()

        @@ -295,7 +288,7 @@ int8_t  - + @@ -317,11 +310,11 @@ int8_t 
        Node* data_structures::tree_234::Node::GetChild Node * data_structures::tree_234::Node::GetChild ( int8_t  index)
        Returns
        the child pointer
        -
        252 { return children[index]; }
        +
        252{ return children[index]; }
        - +

        ◆ GetChildIndex()

        @@ -353,19 +346,19 @@ int8_t 
        Returns
        the index of child
        -
        237  {
        -
        238  for (int8_t i = 0; i < count + 1; i++) {
        -
        239  if (children[i] == child) {
        -
        240  return i;
        -
        241  }
        -
        242  }
        -
        243 
        -
        244  return -1;
        -
        245  }
        +
        237 {
        +
        238 for (int8_t i = 0; i < count + 1; i++) {
        +
        239 if (children[i] == child) {
        +
        240 return i;
        +
        241 }
        +
        242 }
        +
        243
        +
        244 return -1;
        +
        245 }
        - +

        ◆ GetCount()

        @@ -390,11 +383,11 @@ int8_t 
        Returns
        item count
        -
        50 { return count; }
        +
        50{ return count; }
        - +

        ◆ GetItem()

        @@ -426,11 +419,11 @@ int8_t 
        Returns
        the item
        -
        133 { return items[index]; }
        +
        133{ return items[index]; }
        - +

        ◆ GetItemIndex()

        @@ -462,19 +455,19 @@ int8_t 
        Returns
        0-based index of the item in the node, if not in the node, -1 is returned
        -
        107  {
        -
        108  for (int8_t i = 0; i < count; i++) {
        -
        109  if (items[i] == item) {
        -
        110  return i;
        -
        111  }
        -
        112  }
        -
        113  return -1;
        -
        114  }
        +
        107 {
        +
        108 for (int8_t i = 0; i < count; i++) {
        +
        109 if (items[i] == item) {
        +
        110 return i;
        +
        111 }
        +
        112 }
        +
        113 return -1;
        +
        114 }
        - -

        ◆ GetItemLeftChild()

        + +

        ◆ GetItemLeftChild()

        @@ -483,7 +476,7 @@ int8_t 
        - + @@ -505,18 +498,18 @@ int8_t 
        Node* data_structures::tree_234::Node::GetItemLeftChild Node * data_structures::tree_234::Node::GetItemLeftChild ( int8_t  item_index)
        Returns
        left child of items[index]'s
        -
        278  {
        -
        279  if (item_index < 0 || item_index > count - 1) {
        -
        280  return nullptr;
        -
        281  }
        -
        282 
        -
        283  return children[item_index];
        -
        284  }
        +
        278 {
        +
        279 if (item_index < 0 || item_index > count - 1) {
        +
        280 return nullptr;
        +
        281 }
        +
        282
        +
        283 return children[item_index];
        +
        284 }
        - -

        ◆ GetItemRightChild()

        + +

        ◆ GetItemRightChild()

        @@ -525,7 +518,7 @@ int8_t 
        - + @@ -547,18 +540,18 @@ int8_t 
        Node* data_structures::tree_234::Node::GetItemRightChild Node * data_structures::tree_234::Node::GetItemRightChild ( int8_t  item_index)
        Returns
        right child of items[index]'s
        -
        291  {
        -
        292  if (item_index < 0 || item_index > count - 1) {
        -
        293  return nullptr;
        -
        294  }
        -
        295 
        -
        296  return children[item_index + 1];
        -
        297  }
        +
        291 {
        +
        292 if (item_index < 0 || item_index > count - 1) {
        +
        293 return nullptr;
        +
        294 }
        +
        295
        +
        296 return children[item_index + 1];
        +
        297 }
        - -

        ◆ GetLeftmostChild()

        + +

        ◆ GetLeftmostChild()

        @@ -567,7 +560,7 @@ int8_t 
        - + @@ -582,11 +575,11 @@ int8_t 
        Node* data_structures::tree_234::Node::GetLeftmostChild Node * data_structures::tree_234::Node::GetLeftmostChild ( )
        Returns
        the leftmost child
        -
        271 { return children[0]; }
        +
        271{ return children[0]; }
        - +

        ◆ GetMaxItem()

        @@ -611,11 +604,11 @@ int8_t 
        Returns
        max item
        -
        120 { return items[count - 1]; }
        +
        120{ return items[count - 1]; }
        - +

        ◆ GetMinItem()

        @@ -640,12 +633,12 @@ int8_t 
        Returns
        min item
        -
        126 { return items[0]; }
        +
        126{ return items[0]; }
        - -

        ◆ GetNextPossibleChild()

        + +

        ◆ GetNextPossibleChild()

        @@ -654,7 +647,7 @@ int8_t 
        - + @@ -676,20 +669,20 @@ int8_t  @@ -42,21 +41,22 @@
        Node* data_structures::tree_234::Node::GetNextPossibleChild Node * data_structures::tree_234::Node::GetNextPossibleChild ( int64_t  item)
        Returns
        the next node that possibly contains item
        -
        304  {
        -
        305  int i = 0;
        -
        306  for (i = 0; i < count; i++) {
        -
        307  if (items[i] > item) {
        -
        308  break;
        -
        309  }
        -
        310  }
        -
        311  return children[i];
        -
        312  }
        +
        304 {
        +
        305 int i = 0;
        +
        306 for (i = 0; i < count; i++) {
        +
        307 if (items[i] > item) {
        +
        308 break;
        +
        309 }
        +
        310 }
        +
        311 return children[i];
        +
        312 }
        - -

        ◆ GetRightmostChild()

        + +

        ◆ GetRightmostChild()

        @@ -698,7 +691,7 @@ int8_t 
        - + @@ -713,11 +706,11 @@ int8_t 
        Node* data_structures::tree_234::Node::GetRightmostChild Node * data_structures::tree_234::Node::GetRightmostChild ( )
        Returns
        the rightmost child
        -
        265 { return children[count]; }
        +
        265{ return children[count]; }
        - +

        ◆ InsertItem()

        @@ -742,7 +735,7 @@ int8_t 

        Insert item to the proper position of the node and return the position index.

        -

        This is a helper function we use during insertion. Please mind that when insert a item, we aslo need to take care of two child pointers. One is the original child pointer at the insertion position. It can be placed as new item's either left child or right child. And the other is the new child that should be added. For our dedicated situation here, we choose to use the original child as the new item's left child, and add a null pointer to its right child. So after use the function, please update these two children pointer manually.

        +

        This is a helper function we use during insertion. Please mind that when insert a item, we aslo need to take care of two child pointers. One is the original child pointer at the insertion position. It can be placed as new item's either left child or right child. And the other is the new child that should be added. For our dedicated situation here, we choose to use the original child as the new item's left child, and add a null pointer to its right child. So after use the function, please update these two children pointer manually.

        Parameters
        @@ -750,23 +743,23 @@ int8_t 
        itemvalue to be inserted to the node
        Returns
        index where item is inserted, caller can use this index to update its left and right child
        -
        163  {
        -
        164  assert(!IsFull());
        -
        165 
        -
        166  if (Contains(item)) {
        -
        167  return -1;
        -
        168  }
        -
        169 
        -
        170  int8_t i = 0;
        -
        171  for (i = 0; i < count; i++) {
        -
        172  if (items[i] > item) {
        -
        173  break;
        -
        174  }
        -
        175  }
        -
        176 
        -
        177  InsertItemByIndex(i, item, nullptr, true);
        -
        178  return i;
        -
        179  }
        +
        163 {
        +
        164 assert(!IsFull());
        +
        165
        +
        166 if (Contains(item)) {
        +
        167 return -1;
        +
        168 }
        +
        169
        +
        170 int8_t i = 0;
        +
        171 for (i = 0; i < count; i++) {
        +
        172 if (items[i] > item) {
        +
        173 break;
        +
        174 }
        +
        175 }
        +
        176
        +
        177 InsertItemByIndex(i, item, nullptr, true);
        +
        178 return i;
        +
        179 }
        bool Contains(int64_t item)
        Check if item is in the node.
        Definition: tree_234.cpp:92
        void InsertItemByIndex(int8_t index, int64_t item, Node *with_child, bool to_left=true)
        Insert a value to the index position.
        Definition: tree_234.cpp:189
        bool IsFull()
        Check if node is a full (4-node)
        Definition: tree_234.cpp:73
        @@ -779,7 +772,7 @@ Here is the call graph for this function:
        - +

        ◆ InsertItemByIndex()

        @@ -835,29 +828,29 @@ Here is the call graph for this function:
        -
        190  {
        -
        191  assert(count < 3 && index >= 0 && index < 3);
        -
        192 
        -
        193  for (int8_t i = count - 1; i >= index; i--) {
        -
        194  items[i + 1] = items[i];
        -
        195  }
        -
        196 
        -
        197  items[index] = item;
        -
        198 
        -
        199  int8_t start_index = to_left ? index : index + 1;
        -
        200 
        -
        201  for (int8_t i = count; i >= start_index; i--) {
        -
        202  children[i + 1] = children[i];
        -
        203  }
        -
        204 
        -
        205  children[start_index] = with_child;
        -
        206 
        -
        207  count++;
        -
        208  }
        +
        190 {
        +
        191 assert(count < 3 && index >= 0 && index < 3);
        +
        192
        +
        193 for (int8_t i = count - 1; i >= index; i--) {
        +
        194 items[i + 1] = items[i];
        +
        195 }
        +
        196
        +
        197 items[index] = item;
        +
        198
        +
        199 int8_t start_index = to_left ? index : index + 1;
        +
        200
        +
        201 for (int8_t i = count; i >= start_index; i--) {
        +
        202 children[i + 1] = children[i];
        +
        203 }
        +
        204
        +
        205 children[start_index] = with_child;
        +
        206
        +
        207 count++;
        +
        208 }
        - +

        ◆ Is2Node()

        @@ -882,11 +875,11 @@ Here is the call graph for this function:

        Check if node is a 2-node.

        Returns
        true if node is 2-node, otherwise false
        -
        79 { return count == 1; }
        +
        79{ return count == 1; }
        - +

        ◆ Is34Node()

        @@ -911,11 +904,11 @@ Here is the call graph for this function:

        Check if node is a 3-node or 4-node, this is useful when we delete item from 2-3-4 tree.

        Returns
        true if node is 3-node or 4-node, false otherwise
        -
        85 { return count == 2 || count == 3; }
        +
        85{ return count == 2 || count == 3; }
        - +

        ◆ IsFull()

        @@ -940,11 +933,11 @@ Here is the call graph for this function:

        Check if node is a full (4-node)

        Returns
        true if node is full (4-node), false otherwise
        -
        73 { return count == 3; }
        +
        73{ return count == 3; }
        - +

        ◆ IsLeaf()

        @@ -969,12 +962,12 @@ Here is the call graph for this function:

        Check if node is a leaf.

        Returns
        true if node is leaf, false otherwise
        -
        67 { return children[0] == nullptr; }
        +
        67{ return children[0] == nullptr; }
        - -

        ◆ RemoveItemByIndex()

        + +

        ◆ RemoveItemByIndex()

        @@ -983,7 +976,7 @@ Here is the call graph for this function:
        - + @@ -1016,25 +1009,25 @@ Here is the call graph for this function:
        Returns
        the removed child pointer
        -
        217  {
        -
        218  assert(index >= 0 && index < count);
        -
        219  Node *removed_child = keep_left ? children[index + 1] : children[index];
        -
        220  for (int8_t i = index; i < count - 1; i++) {
        -
        221  items[i] = items[i + 1];
        -
        222  }
        -
        223 
        -
        224  for (int8_t i = keep_left ? index + 1 : index; i < count; i++) {
        -
        225  children[i] = children[i + 1];
        -
        226  }
        -
        227 
        -
        228  count--;
        -
        229  return removed_child;
        -
        230  }
        +
        217 {
        +
        218 assert(index >= 0 && index < count);
        +
        219 Node *removed_child = keep_left ? children[index + 1] : children[index];
        +
        220 for (int8_t i = index; i < count - 1; i++) {
        +
        221 items[i] = items[i + 1];
        +
        222 }
        +
        223
        +
        224 for (int8_t i = keep_left ? index + 1 : index; i < count; i++) {
        +
        225 children[i] = children[i + 1];
        +
        226 }
        +
        227
        +
        228 count--;
        +
        229 return removed_child;
        +
        230 }
        Definition: linkedlist_implentation_usingarray.cpp:14
        - +

        ◆ SetChild()

        @@ -1076,11 +1069,11 @@ Here is the call graph for this function:
        Node* data_structures::tree_234::Node::RemoveItemByIndex Node * data_structures::tree_234::Node::RemoveItemByIndex ( int8_t  index,
        -
        259 { children[index] = child; }
        +
        259{ children[index] = child; }
        - +

        ◆ SetCount()

        @@ -1105,18 +1098,18 @@ Here is the call graph for this function:

        Set the item count of the node.

        -

        This is only used when we spliting and merging node where we need to do some raw operation manually. In common inserting and removing operation the count is maintained automatically.

        +

        This is only used when we spliting and merging node where we need to do some raw operation manually. In common inserting and removing operation the count is maintained automatically.

        Parameters
        cthe count to set
        -
        61 { count = c; }
        +
        61{ count = c; }
        - +

        ◆ SetItem()

        @@ -1158,11 +1151,11 @@ Here is the call graph for this function:
        -
        140  {
        -
        141  assert(index >= 0 && index <= 2);
        -
        142 
        -
        143  items[index] = new_item;
        -
        144  }
        +
        140 {
        +
        141 assert(index >= 0 && index <= 2);
        +
        142
        +
        143 items[index] = new_item;
        +
        144 }
        @@ -1175,7 +1168,7 @@ Here is the call graph for this function: diff --git a/dd/d40/classdata__structures_1_1tree__234_1_1_node.js b/dd/d40/classdata__structures_1_1tree__234_1_1_node.js index f3f05102b..ccb47dec4 100644 --- a/dd/d40/classdata__structures_1_1tree__234_1_1_node.js +++ b/dd/d40/classdata__structures_1_1tree__234_1_1_node.js @@ -2,25 +2,25 @@ var classdata__structures_1_1tree__234_1_1_node = [ [ "Node", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#ad5219979ea9a8baa3a273a9ec0f0c670", null ], [ "Contains", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a22fd25c6c811c64b6b27b0850d8c532f", null ], - [ "GetChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a5f6d943abaac52a236fe5d945e9d0e25", null ], + [ "GetChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a164574a9209b5df66368530d090b32c4", null ], [ "GetChildIndex", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#ad632a0440295bc88ceadae7478fe0d37", null ], [ "GetCount", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#aac82e17daa088ede9ee00dc69c1e6f06", null ], [ "GetItem", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a4808acb43668ff8cfd6f7cb44ceedad3", null ], [ "GetItemIndex", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a650f0ef26b7450e1addb5d80bb0ed629", null ], - [ "GetItemLeftChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a9ba4f652baa900f0634822ec380a6996", null ], - [ "GetItemRightChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a976998a7553ab92ef79cc04fac305e5b", null ], - [ "GetLeftmostChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a692a971c577511abdf7027e7e92a031b", null ], + [ "GetItemLeftChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#ab654d7376d3449fdc78edab0e7fed06e", null ], + [ "GetItemRightChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a441cbee9896391f2b167d5aa7b4f8c95", null ], + [ "GetLeftmostChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#ac6f619a1605cb46196360889fff4529e", null ], [ "GetMaxItem", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a2753b6053b8c86c5bd987a44fdfa0a57", null ], [ "GetMinItem", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a5438d0a47850f520b2262b5a42f75b71", null ], - [ "GetNextPossibleChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a0f60199d0d175c248c67bfad9b9bdafe", null ], - [ "GetRightmostChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#abe9725b6422fd974642f9c9618b0f3be", null ], + [ "GetNextPossibleChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a91322b3bb0b2b2175eb56e9e10d7db46", null ], + [ "GetRightmostChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a731f9ae385840cf0a06d55e7f9924a94", null ], [ "InsertItem", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a8e809ae85ae00e937f67ddb76951b6bb", null ], [ "InsertItemByIndex", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a306a30931f54c84098b38d6bc8f4a956", null ], [ "Is2Node", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#afd9f83e2d5d7f22f79c1348e98914631", null ], [ "Is34Node", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a6c5f929afcbad5219646990edee22e18", null ], [ "IsFull", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a4a37381c0ef93d5ae2118b2e554974dd", null ], [ "IsLeaf", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a607d8201b00b142bf1d6a34df2f936e8", null ], - [ "RemoveItemByIndex", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a8384b8c0fdc8e5e443010d2eb1187847", null ], + [ "RemoveItemByIndex", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#a28944bb16ec22650b47fe3e80e3e13f8", null ], [ "SetChild", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#ab4e5f7b7b260bb81d9441652cc124c74", null ], [ "SetCount", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#af564fd4b0992fff69f90de201542d3d1", null ], [ "SetItem", "dd/d40/classdata__structures_1_1tree__234_1_1_node.html#aaa89a3016b5dd1be3552321c34343cbc", null ], diff --git a/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.svg b/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.svg index fab6ec52d..874620b53 100644 --- a/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.svg +++ b/dd/d40/classdata__structures_1_1tree__234_1_1_node_a8e809ae85ae00e937f67ddb76951b6bb_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: math Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
        -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,15 +92,14 @@ $(document).ready(function(){initNavTree('dd/d47/namespacemath.html','../../');
        -
        -
        math Namespace Reference
        +
        math Namespace Reference

        for IO operations More...

        - @@ -129,37 +128,37 @@ Functions

        +

        Functions

        double integral_approx (double lb, double ub, const std::function< double(double)> &func, double delta=.0001)
         Computes integral approximation. More...
         

        Detailed Description

        -

        for IO operations

        -

        Math algorithms.

        -

        for std::cin and std::cout

        -

        for std::cout

        -

        for io operations

        -

        Evaluate recurrence relation using matrix exponentiation.

        -

        for assert

        -

        for std::vector

        -

        for assert for int32_t type for atoi

        -

        Mathematical algorithms

        -

        for assert for std::cin and std::cout

        -

        Mathematical algorithms

        -

        for assert for mathematical functions for passing in functions

        -

        Mathematical functions

        -

        for std::cin and std::cout

        -

        Mathematical algorithms

        -

        Given a recurrence relation; evaluate the value of nth term. For e.g., For fibonacci series, recurrence series is f(n) = f(n-1) + f(n-2) where f(0) = 0 and f(1) = 1. Note that the method used only demonstrates recurrence relation with one variable (n), unlike nCr problem, since it has two (n, r)

        +

        for IO operations

        +

        Math algorithms.

        +

        for std::cin and std::cout

        +

        for std::cout

        +

        for io operations

        +

        Evaluate recurrence relation using matrix exponentiation.

        +

        for assert

        +

        for std::vector

        +

        for assert for int32_t type for atoi

        +

        Mathematical algorithms

        +

        for assert for std::cin and std::cout

        +

        Mathematical algorithms

        +

        for assert for mathematical functions for passing in functions

        +

        Mathematical functions

        +

        for std::cin and std::cout

        +

        Mathematical algorithms

        +

        Given a recurrence relation; evaluate the value of nth term. For e.g., For fibonacci series, recurrence series is f(n) = f(n-1) + f(n-2) where f(0) = 0 and f(1) = 1. Note that the method used only demonstrates recurrence relation with one variable (n), unlike nCr problem, since it has two (n, r)

        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
        +

        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

        -

        Mathematical algorithms

        -

        for std::is_equal, std::swap for assert for IO operations

        -

        Mathematical algorithms

        -

        for assert for io operations

        -

        Mathematical algorithms

        -

        Mathematical algorithms

        +

        for assert

        +

        Mathematical algorithms

        +

        for std::is_equal, std::swap for assert for IO operations

        +

        Mathematical algorithms

        +

        for assert for io operations

        +

        Mathematical algorithms

        +

        Mathematical algorithms

        Function Documentation

        - +

        ◆ binomialCoeffSum()

        @@ -174,21 +173,21 @@ Algorithm
        -

        Function to calculate sum of binomial coefficients

        Parameters
        +

        Function to calculate sum of binomial coefficients

        Parameters
        nnumber
        Returns
        Sum of binomial coefficients of number
        -
        26  {
        -
        27  // Calculating 2^n
        -
        28  return (1 << n);
        -
        29 }
        +
        26 {
        +
        27 // Calculating 2^n
        +
        28 return (1 << n);
        +
        29}
        - +

        ◆ integral_approx()

        @@ -237,23 +236,20 @@ Algorithm
        Returns
        integral approximation of function from [lb, ub]
        -
        33  {
        -
        34  double result = 0;
        -
        35  uint64_t numDeltas = static_cast<uint64_t>((ub - lb) / delta);
        -
        36  for (int i = 0; i < numDeltas; i++) {
        -
        37  double begin = lb + i * delta;
        -
        38  double end = lb + (i + 1) * delta;
        -
        39  result += delta * (func(begin) + func(end)) / 2;
        -
        40  }
        -
        41  return result;
        -
        42 }
        -
        T begin(T... args)
        -
        T end(T... args)
        -
        uint64_t result(uint64_t n)
        Definition: fibonacci_sum.cpp:76
        +
        33 {
        +
        34 double result = 0;
        +
        35 uint64_t numDeltas = static_cast<uint64_t>((ub - lb) / delta);
        +
        36 for (int i = 0; i < numDeltas; i++) {
        +
        37 double begin = lb + i * delta;
        +
        38 double end = lb + (i + 1) * delta;
        +
        39 result += delta * (func(begin) + func(end)) / 2;
        +
        40 }
        +
        41 return result;
        +
        42}
        - +

        ◆ largestPower()

        @@ -288,22 +284,22 @@ Algorithm
        Returns
        largest power
        -
        27  {
        -
        28  // Initialize result
        -
        29  int x = 0;
        -
        30 
        -
        31  // Calculate result
        -
        32  while (n)
        -
        33  {
        -
        34  n /= p;
        -
        35  x += n;
        -
        36  }
        -
        37  return x;
        -
        38  }
        +
        27 {
        +
        28 // Initialize result
        +
        29 int x = 0;
        +
        30
        +
        31 // Calculate result
        +
        32 while (n)
        +
        33 {
        +
        34 n /= p;
        +
        35 x += n;
        +
        36 }
        +
        37 return x;
        +
        38 }
        - +

        ◆ lcmSum()

        @@ -318,47 +314,47 @@ Algorithm
        -

        Function to compute sum of euler totients in sumOfEulerTotient vector

        Parameters
        +

        Function to compute sum of euler totients in sumOfEulerTotient vector

        Parameters
        numinput number
        Returns
        int Sum of LCMs, i.e. ∑LCM(i, num) from i = 1 to num
        -
        29  {
        -
        30  uint64_t i = 0, j = 0;
        -
        31  std::vector<uint64_t> eulerTotient(num + 1);
        -
        32  std::vector<uint64_t> sumOfEulerTotient(num + 1);
        -
        33 
        -
        34  // storing initial values in eulerTotient vector
        -
        35  for (i = 1; i <= num; i++) {
        -
        36  eulerTotient[i] = i;
        -
        37  }
        -
        38 
        -
        39  // applying totient sieve
        -
        40  for (i = 2; i <= num; i++) {
        -
        41  if (eulerTotient[i] == i) {
        -
        42  for (j = i; j <= num; j += i) {
        -
        43  eulerTotient[j] = eulerTotient[j] / i;
        -
        44  eulerTotient[j] = eulerTotient[j] * (i - 1);
        -
        45  }
        -
        46  }
        -
        47  }
        -
        48 
        -
        49  // computing sum of euler totients
        -
        50  for (i = 1; i <= num; i++) {
        -
        51  for (j = i; j <= num; j += i) {
        -
        52  sumOfEulerTotient[j] += eulerTotient[i] * i;
        -
        53  }
        -
        54  }
        -
        55 
        -
        56  return ((sumOfEulerTotient[num] + 1) * num) / 2;
        -
        57 }
        - +
        29 {
        +
        30 uint64_t i = 0, j = 0;
        +
        31 std::vector<uint64_t> eulerTotient(num + 1);
        +
        32 std::vector<uint64_t> sumOfEulerTotient(num + 1);
        +
        33
        +
        34 // storing initial values in eulerTotient vector
        +
        35 for (i = 1; i <= num; i++) {
        +
        36 eulerTotient[i] = i;
        +
        37 }
        +
        38
        +
        39 // applying totient sieve
        +
        40 for (i = 2; i <= num; i++) {
        +
        41 if (eulerTotient[i] == i) {
        +
        42 for (j = i; j <= num; j += i) {
        +
        43 eulerTotient[j] = eulerTotient[j] / i;
        +
        44 eulerTotient[j] = eulerTotient[j] * (i - 1);
        +
        45 }
        +
        46 }
        +
        47 }
        +
        48
        +
        49 // computing sum of euler totients
        +
        50 for (i = 1; i <= num; i++) {
        +
        51 for (j = i; j <= num; j += i) {
        +
        52 sumOfEulerTotient[j] += eulerTotient[i] * i;
        +
        53 }
        +
        54 }
        +
        55
        +
        56 return ((sumOfEulerTotient[num] + 1) * num) / 2;
        +
        57}
        +
        - +

        ◆ magic_number()

        @@ -373,30 +369,30 @@ Algorithm
        -

        Function to check if the given number is magic number or not.

        Parameters
        +

        Function to check if the given number is magic number or not.

        Parameters
        nnumber to be checked.
        Returns
        if number is a magic number, returns true, else false.
        -
        32  {
        -
        33  if (n <= 0) {
        -
        34  return false;
        -
        35  }
        -
        36  // result stores the modulus of @param n with 9
        -
        37  uint64_t result = n % 9;
        -
        38  // if result is 1 then the number is a magic number else not
        -
        39  if (result == 1) {
        -
        40  return true;
        -
        41  } else {
        -
        42  return false;
        -
        43  }
        -
        44 }
        +
        32 {
        +
        33 if (n <= 0) {
        +
        34 return false;
        +
        35 }
        +
        36 // result stores the modulus of @param n with 9
        +
        37 uint64_t result = n % 9;
        +
        38 // if result is 1 then the number is a magic number else not
        +
        39 if (result == 1) {
        +
        40 return true;
        +
        41 } else {
        +
        42 return false;
        +
        43 }
        +
        44}
        - +

        ◆ n_choose_r()

        @@ -425,7 +421,7 @@ template<class T >

        This is the function implementation of \( \binom{n}{r} \).

        -

        We are calculating the ans with iterations instead of calculating three different factorials. Also, we are using the fact that \( \frac{n!}{r! (n-r)!} = \frac{(n - r + 1) \times \cdots \times n}{1 \times \cdots \times r} \)

        Template Parameters
        +

        We are calculating the ans with iterations instead of calculating three different factorials. Also, we are using the fact that \( \frac{n!}{r! (n-r)!} = \frac{(n - r + 1) \times \cdots \times n}{1 \times \cdots \times r} \)

        Template Parameters
        TOnly for integer types such as long, int_64 etc
        @@ -439,17 +435,17 @@ template<class T >
        Returns
        ans \( \binom{n}{r} \)
        -
        35  {
        -
        36  if (r > n / 2) {
        -
        37  r = n - r; // Because of the fact that nCr(n, r) == nCr(n, n - r)
        -
        38  }
        -
        39  T ans = 1;
        -
        40  for (int i = 1; i <= r; i++) {
        -
        41  ans *= n - r + i;
        -
        42  ans /= i;
        -
        43  }
        -
        44  return ans;
        -
        45 }
        +
        35 {
        +
        36 if (r > n / 2) {
        +
        37 r = n - r; // Because of the fact that nCr(n, r) == nCr(n, n - r)
        +
        38 }
        +
        39 T ans = 1;
        +
        40 for (int i = 1; i <= r; i++) {
        +
        41 ans *= n - r + i;
        +
        42 ans /= i;
        +
        43 }
        +
        44 return ans;
        +
        45}
        ll ans(ll n)
        Definition: matrix_exponentiation.cpp:91
        Here is the call graph for this function:
        @@ -460,7 +456,7 @@ Here is the call graph for this function:
        - +

        ◆ power()

        @@ -502,29 +498,29 @@ Here is the call graph for this function:
        Returns
        a raised to power b modulo c
        -

        Initialize the answer to be returned

        -

        Update a if it is more than or equal to c

        -

        In case a is divisible by c;

        -

        If b is odd, multiply a with answer

        -

        b must be even now

        -

        b = b/2

        -
        35  {
        -
        36  uint64_t ans = 1; /// Initialize the answer to be returned
        -
        37  a = a % c; /// Update a if it is more than or equal to c
        -
        38  if (a == 0) {
        -
        39  return 0; /// In case a is divisible by c;
        -
        40  }
        -
        41  while (b > 0) {
        -
        42  /// If b is odd, multiply a with answer
        -
        43  if (b & 1) {
        -
        44  ans = ((ans % c) * (a % c)) % c;
        -
        45  }
        -
        46  /// b must be even now
        -
        47  b = b >> 1; /// b = b/2
        -
        48  a = ((a % c) * (a % c)) % c;
        -
        49  }
        -
        50  return ans;
        -
        51 }
        +

        Initialize the answer to be returned

        +

        Update a if it is more than or equal to c

        +

        In case a is divisible by c;

        +

        If b is odd, multiply a with answer

        +

        b must be even now

        +

        b = b/2

        +
        35 {
        +
        36 uint64_t ans = 1; /// Initialize the answer to be returned
        +
        37 a = a % c; /// Update a if it is more than or equal to c
        +
        38 if (a == 0) {
        +
        39 return 0; /// In case a is divisible by c;
        +
        40 }
        +
        41 while (b > 0) {
        +
        42 /// If b is odd, multiply a with answer
        +
        43 if (b & 1) {
        +
        44 ans = ((ans % c) * (a % c)) % c;
        +
        45 }
        +
        46 /// b must be even now
        +
        47 b = b >> 1; /// b = b/2
        +
        48 a = ((a % c) * (a % c)) % c;
        +
        49 }
        +
        50 return ans;
        +
        51}
        Here is the call graph for this function:
        @@ -534,7 +530,7 @@ Here is the call graph for this function:
        - +

        ◆ power_of_two()

        @@ -558,34 +554,34 @@ Here is the call graph for this function:
        Returns
        void
        -

        This function finds whether a number is power of 2 or not

        Parameters
        +

        This function finds whether a number is power of 2 or not

        Parameters
        nvalue for which we want to check prints the result, as "Yes, the number n is a power of 2" or "No, the number is not a power of 2" without quotes

        result stores the bitwise and of n and n-1

        -
        36  {
        -
        37  /**
        -
        38  * This function finds whether a number is power of 2 or not
        -
        39  * @param n value for which we want to check
        -
        40  * prints the result, as "Yes, the number n is a power of 2" or
        -
        41  * "No, the number is not a power of 2" without quotes
        -
        42  */
        -
        43  /// result stores the
        -
        44  /// bitwise and of n and n-1
        -
        45  int result = n & (n - 1);
        -
        46  if (result == 0) {
        -
        47  std::cout << "Yes, the number " << n << " is a power of 2";
        -
        48  } else {
        -
        49  std::cout << "No, the number " << n << " is not a power of 2";
        -
        50  }
        -
        51 }
        +
        36 {
        +
        37 /**
        +
        38 * This function finds whether a number is power of 2 or not
        +
        39 * @param n value for which we want to check
        +
        40 * prints the result, as "Yes, the number n is a power of 2" or
        +
        41 * "No, the number is not a power of 2" without quotes
        +
        42 */
        +
        43 /// result stores the
        +
        44 /// bitwise and of n and n-1
        +
        45 int result = n & (n - 1);
        +
        46 if (result == 0) {
        +
        47 std::cout << "Yes, the number " << n << " is a power of 2";
        +
        48 } else {
        +
        49 std::cout << "No, the number " << n << " is not a power of 2";
        +
        50 }
        +
        51}
        - +

        ◆ test_eval()

        @@ -626,10 +622,10 @@ Here is the call graph for this function:
        -
        51  {
        -
        52  assert(approx >= expected * (1 - threshold));
        -
        53  assert(approx <= expected * (1 + threshold));
        -
        54 }
        +
        51 {
        +
        52 assert(approx >= expected * (1 - threshold));
        +
        53 assert(approx <= expected * (1 + threshold));
        +
        54}
        @@ -639,7 +635,7 @@ Here is the call graph for this function:
        diff --git a/dd/d47/namespacemath.js b/dd/d47/namespacemath.js index 760f0b36a..4f31e1119 100644 --- a/dd/d47/namespacemath.js +++ b/dd/d47/namespacemath.js @@ -4,30 +4,23 @@ var namespacemath = [ "calculate", "d8/db1/binomial__calculate_8cpp.html#aae407a2a13362c4c64fbe509ff325978", null ] ] ], [ "fibonacci_sum", null, [ - [ "matrix", "de/dc3/fibonacci__sum_8cpp.html#ae18ea07a8d7fe90ff25abb7c7d1ee5b1", null ], [ "fiboSum", "de/dc3/fibonacci__sum_8cpp.html#a493fbaa7a94e3b7ca573111237bb3742", null ], [ "multiply", "de/dc3/fibonacci__sum_8cpp.html#a9c83cca09a3e4ff2a25c816a9303448e", null ], [ "power", "de/dc3/fibonacci__sum_8cpp.html#a7cf5feaf168b88e74544da59ed830311", null ], [ "result", "de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa", null ] ] ], - [ "linear_recurrence_matrix", null, [ - [ "get_nth_term_of_recurrence_series", "dc/d52/linear__recurrence__matrix_8cpp.html#af5e240c0cfaabed122a0596f800b3d14", null ], - [ "is_zero_matrix", "dc/d52/linear__recurrence__matrix_8cpp.html#a7487322bae85648c89da86f34431c103", null ], - [ "matrix_exponentiation", "dc/d52/linear__recurrence__matrix_8cpp.html#ab55e45ae404ea360e9eebac8f63692f7", null ], - [ "matrix_multiplication", "dc/d52/linear__recurrence__matrix_8cpp.html#a759a232b9d5ab032062b8560343c6af3", null ] - ] ], [ "modular_division", null, [ [ "mod_division", "df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7", null ], [ "power", "df/d72/modular__division_8cpp.html#a66cdf93153cbd1408bd74ac68961d179", null ] ] ], [ "n_bonacci", null, [ - [ "N_bonacci", "db/d27/n__bonacci_8cpp.html#a767bc5427e0ebaf88ab5a7572a7d852e", null ] + [ "N_bonacci", "db/d27/n__bonacci_8cpp.html#a6849b68f760be628d5975ab3eddec63d", null ] ] ], [ "ncr_modulo_p", null, [ [ "NCRModuloP", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p" ] ] ], [ "vector_cross", null, [ - [ "cross", "df/d66/vector__cross__product_8cpp.html#abed307975124243d63fe2e118254defe", null ], + [ "cross", "df/d66/vector__cross__product_8cpp.html#a225732399c5c076976eae5b180a9f8c9", null ], [ "mag", "df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8", null ] ] ], [ "binomialCoeffSum", "dd/d47/namespacemath.html#ae1ca505751f5a6d3977b86372cfe75ea", null ], diff --git a/dd/d47/namespacemath_a6e2dff75c5de70455b90c799d6ad6967_cgraph.svg b/dd/d47/namespacemath_a6e2dff75c5de70455b90c799d6ad6967_cgraph.svg index f8317e262..b6664234e 100644 --- a/dd/d47/namespacemath_a6e2dff75c5de70455b90c799d6ad6967_cgraph.svg +++ b/dd/d47/namespacemath_a6e2dff75c5de70455b90c799d6ad6967_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - + + Algorithms_in_C++: Solution Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -95,50 +95,146 @@ $(document).ready(function(){initNavTree('dd/d4f/class_solution.html','../../'); Private Member Functions | Private Attributes | List of all members
        -
        -
        Solution Class Reference
        +
        Solution Class Reference
        -
        -Collaboration diagram for Solution:
        -
        -
        -
        -
        [legend]
        - - - + +

        +

        Public Member Functions

        -std::vector< std::vector< int > > search_bridges (int n, const std::vector< std::vector< int >> &connections)
         
        std::vector< std::vector< int > > search_bridges (int n, const std::vector< std::vector< int > > &connections)
         
        - - +

        +

        Private Member Functions

        -void dfs (int current_node, int parent)
        void dfs (int current_node, int parent)
         
        - - - - - - -

        +

        Private Attributes

        +
        std::vector< std::vector< int > > graph
         
        +
        std::vector< int > in_time
         
        +
        std::vector< int > out_time
         
        +
        int timer = 0
         
        +
        std::vector< std::vector< int > > bridge
         
        +
        std::vector< bool > visited
         
        +

        Member Function Documentation

        + +

        ◆ dfs()

        + +
        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + +
        void Solution::dfs (int current_node,
        int parent 
        )
        +
        +inlineprivate
        +
        +
        17 {
        +
        18 visited.at(current_node) = true;
        +
        19 in_time[current_node] = out_time[current_node] = timer++;
        +
        20 for (auto& itr : graph[current_node]) {
        +
        21 if (itr == parent) {
        +
        22 continue;
        +
        23 }
        +
        24 if (!visited[itr]) {
        +
        25 dfs(itr, current_node);
        +
        26 if (out_time[itr] > in_time[current_node]) {
        +
        27 bridge.push_back({itr, current_node});
        +
        28 }
        +
        29 }
        +
        30 out_time[current_node] =
        +
        31 std::min(out_time[current_node], out_time[itr]);
        +
        32 }
        +
        33 }
        +
        T min(T... args)
        +
        Graph Algorithms.
        +
        +
        +
        + +

        ◆ search_bridges()

        + +
        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + +
        std::vector< std::vector< int > > Solution::search_bridges (int n,
        const std::vector< std::vector< int > > & connections 
        )
        +
        +inline
        +
        +
        37 {
        +
        38 timer = 0;
        +
        39 graph.resize(n);
        +
        40 in_time.assign(n, 0);
        +
        41 visited.assign(n, false);
        +
        42 out_time.assign(n, 0);
        +
        43 for (auto& itr : connections) {
        +
        44 graph.at(itr[0]).push_back(itr[1]);
        +
        45 graph.at(itr[1]).push_back(itr[0]);
        +
        46 }
        +
        47 dfs(0, -1);
        +
        48 return bridge;
        +
        49 }
        +
        +
        +

        The documentation for this class was generated from the following file:
        • graph/bridge_finding_with_tarjan_algorithm.cpp
        @@ -148,7 +244,7 @@ int timer = 0
          - +
        diff --git a/dd/d4f/class_solution.js b/dd/d4f/class_solution.js deleted file mode 100644 index 233ccdef7..000000000 --- a/dd/d4f/class_solution.js +++ /dev/null @@ -1,11 +0,0 @@ -var class_solution = -[ - [ "dfs", "dd/d4f/class_solution.html#a29d19d87d54fe43d3f22221b8fe1b0bc", null ], - [ "search_bridges", "dd/d4f/class_solution.html#a7ee66ff56c3262f49139516c366a2529", null ], - [ "bridge", "dd/d4f/class_solution.html#a216a0a43fbf11d0bbe8f77205b0d4ad6", null ], - [ "graph", "dd/d4f/class_solution.html#a064ff4943e3860399f8f6873862071c9", null ], - [ "in_time", "dd/d4f/class_solution.html#a4a7040c6f21dacd58b63e9c3aeecab86", null ], - [ "out_time", "dd/d4f/class_solution.html#af1fcd3d8160363baa35a079244eb2e91", null ], - [ "timer", "dd/d4f/class_solution.html#ae8ca86dfb0d034665027aa99af3c88c6", null ], - [ "visited", "dd/d4f/class_solution.html#a315f536a234d4397d5b07b3c5795973c", null ] -]; \ No newline at end of file diff --git a/dd/d51/classstack-members.html b/dd/d51/classstack-members.html index c5d08d979..b90e3926c 100644 --- a/dd/d51/classstack-members.html +++ b/dd/d51/classstack-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,31 +90,30 @@ $(document).ready(function(){initNavTree('d1/dc2/classstack.html','../../'); ini
        -
        -
        stack< Type > Member List
        +
        stack< Type > Member List

        This is the complete list of members for stack< Type >, including all inherited members.

        - + - + - + - + - + - +
        clear()stack< Type >inline
        display()stack< Type >inline
        display()stack< Type >inline
        isEmptyStack()stack< Type >inline
        operator=(const stack< Type > &otherStack)stack< Type >inline
        operator=(const stack< Type > &otherStack)stack< Type >inline
        pop()stack< Type >inline
        push(Type item)stack< Type >inline
        push(Type item)stack< Type >inline
        sizestack< Type >private
        stack()stack< Type >inline
        stack()stack< Type >inline
        stack(const stack< Type > &otherStack)stack< Type >inlineexplicit
        stackTopstack< Type >private
        stackTopstack< Type >private
        top()stack< Type >inline
        ~stack()stack< Type >inline
        ~stack()stack< Type >inline
        diff --git a/dd/d53/structdouble__hashing_1_1_entry-members.html b/dd/d53/structdouble__hashing_1_1_entry-members.html index 0aefc0ba5..a77b1f764 100644 --- a/dd/d53/structdouble__hashing_1_1_entry-members.html +++ b/dd/d53/structdouble__hashing_1_1_entry-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,21 +90,20 @@ $(document).ready(function(){initNavTree('d9/dde/structdouble__hashing_1_1_entry
        -
        -
        double_hashing::Entry Member List
        +
        double_hashing::Entry Member List

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

        - +
        Entry(int key=notPresent)double_hashing::Entryinlineexplicit
        keydouble_hashing::Entry
        keydouble_hashing::Entry
        diff --git a/dd/d59/hamiltons__cycle_8cpp__incl.svg b/dd/d59/hamiltons__cycle_8cpp__incl.svg index 50b659cd0..585dfa1b9 100644 --- a/dd/d59/hamiltons__cycle_8cpp__incl.svg +++ b/dd/d59/hamiltons__cycle_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: numerical_methods/lu_decompose.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('dd/d65/lu__decompose_8cpp.html','../..
        -
        -
        lu_decompose.cpp File Reference
        +
        lu_decompose.cpp File Reference
        -

        LU decomposition of a square matrix +

        LU decomposition of a square matrix More...

        #include <cassert>
        #include <ctime>
        @@ -111,11 +110,11 @@ Include dependency graph for lu_decompose.cpp:
        - - - - + + + @@ -124,10 +123,10 @@ Functions

        +

        Functions

        template<typename T >
        std::ostreamoperator<< (std::ostream &out, matrix< T > const &v)
         
        template<typename T >
        std::ostreamoperator<< (std::ostream &out, matrix< T > const &v)
         
        void test1 ()
         
        void test2 ()
         

        Detailed Description

        -

        LU decomposition of a square matrix

        -
        Author
        Krishna Vedala
        +

        LU decomposition of a square matrix

        +
        Author
        Krishna Vedala

        Function Documentation

        - +

        ◆ main()

        @@ -152,14 +151,14 @@ Functions
        -

        Main function

        -
        84  {
        -
        85  std::srand(std::time(NULL)); // random number initializer
        -
        86 
        -
        87  test1();
        -
        88  test2();
        -
        89  return 0;
        -
        90 }
        +

        Main function

        +
        84 {
        +
        85 std::srand(std::time(NULL)); // random number initializer
        +
        86
        +
        87 test1();
        +
        88 test2();
        +
        89 return 0;
        +
        90}
        void test2()
        Definition: lu_decompose.cpp:66
        void test1()
        Definition: lu_decompose.cpp:36
        T srand(T... args)
        @@ -173,8 +172,8 @@ Here is the call graph for this function:
        - -

        ◆ operator<<()

        + +

        ◆ operator<<()

        @@ -182,7 +181,7 @@ Here is the call graph for this function:
        template<typename T >
        - + @@ -200,20 +199,20 @@ template<typename T >
        std::ostream& operator<< std::ostream & operator<< ( std::ostream out,
        -

        operator to print a matrix

        -
        18  {
        -
        19  const int width = 10;
        -
        20  const char separator = ' ';
        -
        21 
        -
        22  for (size_t row = 0; row < v.size(); row++) {
        -
        23  for (size_t col = 0; col < v[row].size(); col++)
        -
        24  out << std::left << std::setw(width) << std::setfill(separator)
        -
        25  << v[row][col];
        -
        26  out << std::endl;
        -
        27  }
        -
        28 
        -
        29  return out;
        -
        30 }
        +

        operator to print a matrix

        +
        18 {
        +
        19 const int width = 10;
        +
        20 const char separator = ' ';
        +
        21
        +
        22 for (size_t row = 0; row < v.size(); row++) {
        +
        23 for (size_t col = 0; col < v[row].size(); col++)
        +
        24 out << std::left << std::setw(width) << std::setfill(separator)
        +
        25 << v[row][col];
        +
        26 out << std::endl;
        +
        27 }
        +
        28
        +
        29 return out;
        +
        30}
        T endl(T... args)
        T left(T... args)
        T setfill(T... args)
        @@ -222,13 +221,13 @@ template<typename T >
        Here is the call graph for this function:
        -
        +
        - +

        ◆ test1()

        @@ -242,40 +241,40 @@ Here is the call graph for this function:
        -

        Test LU decomposition

        Todo:
        better ways to self-check a matrix output?
        -
        36  {
        -
        37  int mat_size = 3; // default matrix size
        -
        38  const int range = 50;
        -
        39  const int range2 = range >> 1;
        -
        40 
        -
        41  /* Create a square matrix with random values */
        - - - -
        45  for (int i = 0; i < mat_size; i++) {
        -
        46  // calloc so that all valeus are '0' by default
        -
        47  for (int j = 0; j < mat_size; j++)
        -
        48  /* create random values in the limits [-range2, range-1] */
        -
        49  A[i][j] = static_cast<double>(std::rand() % range - range2);
        -
        50  }
        -
        51 
        -
        52  std::clock_t start_t = std::clock();
        -
        53  lu_decomposition(A, &L, &U);
        -
        54  std::clock_t end_t = std::clock();
        -
        55  std::cout << "Time taken: "
        -
        56  << static_cast<double>(end_t - start_t) / CLOCKS_PER_SEC << "\n";
        -
        57 
        -
        58  std::cout << "A = \n" << A << "\n";
        -
        59  std::cout << "L = \n" << L << "\n";
        -
        60  std::cout << "U = \n" << U << "\n";
        -
        61 }
        +

        Test LU decomposition

        Todo:
        better ways to self-check a matrix output?
        +
        36 {
        +
        37 int mat_size = 3; // default matrix size
        +
        38 const int range = 50;
        +
        39 const int range2 = range >> 1;
        +
        40
        +
        41 /* Create a square matrix with random values */
        + + + +
        45 for (int i = 0; i < mat_size; i++) {
        +
        46 // calloc so that all valeus are '0' by default
        +
        47 for (int j = 0; j < mat_size; j++)
        +
        48 /* create random values in the limits [-range2, range-1] */
        +
        49 A[i][j] = static_cast<double>(std::rand() % range - range2);
        +
        50 }
        +
        51
        +
        52 std::clock_t start_t = std::clock();
        +
        53 lu_decomposition(A, &L, &U);
        +
        54 std::clock_t end_t = std::clock();
        +
        55 std::cout << "Time taken: "
        +
        56 << static_cast<double>(end_t - start_t) / CLOCKS_PER_SEC << "\n";
        +
        57
        +
        58 std::cout << "A = \n" << A << "\n";
        +
        59 std::cout << "L = \n" << L << "\n";
        +
        60 std::cout << "U = \n" << U << "\n";
        +
        61}
        T clock(T... args)
        int lu_decomposition(const matrix< T > &A, matrix< double > *L, matrix< double > *U)
        Definition: lu_decomposition.h:29
        ll mat_size
        Definition: matrix_exponentiation.cpp:45
        T rand(T... args)
        - +
        Here is the call graph for this function:
        @@ -286,7 +285,7 @@ Here is the call graph for this function:
        - +

        ◆ test2()

        @@ -300,23 +299,23 @@ Here is the call graph for this function:
        -

        Test determinant computation using LU decomposition

        -
        66  {
        -
        67  std::cout << "Determinant test 1...";
        -
        68  matrix<int> A1({{1, 2, 3}, {4, 9, 6}, {7, 8, 9}});
        -
        69  assert(determinant_lu(A1) == -48);
        -
        70  std::cout << "passed\n";
        -
        71 
        -
        72  std::cout << "Determinant test 2...";
        -
        73  matrix<int> A2({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
        -
        74  assert(determinant_lu(A2) == 0);
        -
        75  std::cout << "passed\n";
        -
        76 
        -
        77  std::cout << "Determinant test 3...";
        -
        78  matrix<float> A3({{1.2, 2.3, 3.4}, {4.5, 5.6, 6.7}, {7.8, 8.9, 9.0}});
        -
        79  assert(determinant_lu(A3) == 3.63);
        -
        80  std::cout << "passed\n";
        -
        81 }
        +

        Test determinant computation using LU decomposition

        +
        66 {
        +
        67 std::cout << "Determinant test 1...";
        +
        68 matrix<int> A1({{1, 2, 3}, {4, 9, 6}, {7, 8, 9}});
        +
        69 assert(determinant_lu(A1) == -48);
        +
        70 std::cout << "passed\n";
        +
        71
        +
        72 std::cout << "Determinant test 2...";
        +
        73 matrix<int> A2({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
        +
        74 assert(determinant_lu(A2) == 0);
        +
        75 std::cout << "passed\n";
        +
        76
        +
        77 std::cout << "Determinant test 3...";
        +
        78 matrix<float> A3({{1.2, 2.3, 3.4}, {4.5, 5.6, 6.7}, {7.8, 8.9, 9.0}});
        +
        79 assert(determinant_lu(A3) == 3.63);
        +
        80 std::cout << "passed\n";
        +
        81}
        double determinant_lu(const matrix< T > &A)
        Definition: lu_decomposition.h:90
        Here is the call graph for this function:
        @@ -333,7 +332,7 @@ Here is the call graph for this function:
        diff --git a/dd/d65/lu__decompose_8cpp.js b/dd/d65/lu__decompose_8cpp.js index b85e24209..e2aa693bb 100644 --- a/dd/d65/lu__decompose_8cpp.js +++ b/dd/d65/lu__decompose_8cpp.js @@ -1,7 +1,7 @@ var lu__decompose_8cpp = [ [ "main", "dd/d65/lu__decompose_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], - [ "operator<<", "dd/d65/lu__decompose_8cpp.html#a9459fcd1f020373d73eae2bad43786d0", null ], + [ "operator<<", "dd/d65/lu__decompose_8cpp.html#a575c989afcc78e875031cd4273e62a3e", null ], [ "test1", "dd/d65/lu__decompose_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0", null ], [ "test2", "dd/d65/lu__decompose_8cpp.html#a0283886819c7c140a023582b7269e2d0", null ] ]; \ No newline at end of file diff --git a/dd/d65/lu__decompose_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg b/dd/d65/lu__decompose_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg index 17bd5d134..f814447f2 100644 --- a/dd/d65/lu__decompose_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg +++ b/dd/d65/lu__decompose_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg @@ -1,7 +1,7 @@ - - - diff --git a/dd/d65/lu__decompose_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg b/dd/d65/lu__decompose_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg index 34b4563d1..144a19364 100644 --- a/dd/d65/lu__decompose_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg +++ b/dd/d65/lu__decompose_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: range_queries Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,32 +92,31 @@ $(document).ready(function(){initNavTree('dd/d69/namespacerange__queries.html','
        -
        -
        range_queries Namespace Reference
        +
        range_queries Namespace Reference

        Algorithms and Data Structures that support range queries and updates. More...

        -

        +

        Classes

        class  perSegTree
         Range query here is range sum, but the code can be modified to make different queries like range max or min. More...
         

        Detailed Description

        -

        Algorithms and Data Structures that support range queries and updates.

        -

        Range Queries algorithms.

        -

        Range queries algorithms.

        -

        for IO operations to manage dynamic memory for std::vector

        +

        Algorithms and Data Structures that support range queries and updates.

        +

        Range Queries algorithms.

        +

        Range queries algorithms.

        +

        for IO operations to manage dynamic memory for std::vector

        diff --git a/dd/d69/namespacerange__queries.js b/dd/d69/namespacerange__queries.js index 6b190d2db..b67ae91f1 100644 --- a/dd/d69/namespacerange__queries.js +++ b/dd/d69/namespacerange__queries.js @@ -1,13 +1,13 @@ var namespacerange__queries = [ [ "heavy_light_decomposition", null, [ - [ "Tree", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree" ], + [ "HLD", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d" ], [ "SG", "d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g.html", "d9/d35/classrange__queries_1_1heavy__light__decomposition_1_1_s_g" ], - [ "HLD", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d.html", "d2/d8a/classrange__queries_1_1heavy__light__decomposition_1_1_h_l_d" ] + [ "Tree", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree.html", "d1/d51/classrange__queries_1_1heavy__light__decomposition_1_1_tree" ] ] ], [ "sparse_table", null, [ - [ "buildTable", "d4/d96/range__queries_2sparse__table_8cpp.html#a328ed1c01cccd07aeb1500c11b609be3", null ], - [ "computeLogs", "d4/d96/range__queries_2sparse__table_8cpp.html#ad71ae7840af3a52e7ee56186bb0c3063", null ], + [ "buildTable", "d4/d96/range__queries_2sparse__table_8cpp.html#a803a2451e87021d14ae06f148383e6bc", null ], + [ "computeLogs", "d4/d96/range__queries_2sparse__table_8cpp.html#a40810d8c0fe3f8cf432ab128b1ae0300", null ], [ "getMinimum", "d4/d96/range__queries_2sparse__table_8cpp.html#a932816c3de9e5ad122b180de60978e8f", null ] ] ], [ "perSegTree", "d8/d28/classrange__queries_1_1per_seg_tree.html", "d8/d28/classrange__queries_1_1per_seg_tree" ] diff --git a/dd/d73/namespaceiterative__tree__traversals.html b/dd/d73/namespaceiterative__tree__traversals.html index 2e8b78674..194dacf18 100644 --- a/dd/d73/namespaceiterative__tree__traversals.html +++ b/dd/d73/namespaceiterative__tree__traversals.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: iterative_tree_traversals Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('dd/d73/namespaceiterative__tree__trave
        -
        -
        iterative_tree_traversals Namespace Reference
        +
        iterative_tree_traversals Namespace Reference
        -

        Functions for the Traversal of the Tree algorithm. +

        Functions for the Traversal of the Tree algorithm. More...

        Detailed Description

        -

        Functions for the Traversal of the Tree algorithm.

        +

        Functions for the Traversal of the Tree algorithm.

        diff --git a/dd/d74/namespaceinorder__successor__of__bst.html b/dd/d74/namespaceinorder__successor__of__bst.html index 1168ade2a..9d88890df 100644 --- a/dd/d74/namespaceinorder__successor__of__bst.html +++ b/dd/d74/namespaceinorder__successor__of__bst.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: inorder_successor_of_bst Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('dd/d74/namespaceinorder__successor__of
        -
        -
        inorder_successor_of_bst Namespace Reference
        +
        inorder_successor_of_bst Namespace Reference
        -

        Functions for the Inorder successor of a binary search tree implementation. +

        Functions for the Inorder successor of a binary search tree implementation. More...

        Detailed Description

        -

        Functions for the Inorder successor of a binary search tree implementation.

        +

        Functions for the Inorder successor of a binary search tree implementation.

        diff --git a/dd/d7a/classdouble__linked__list-members.html b/dd/d7a/classdouble__linked__list-members.html index 68f9f7d5c..3cd27283e 100644 --- a/dd/d7a/classdouble__linked__list-members.html +++ b/dd/d7a/classdouble__linked__list-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,25 +90,24 @@ $(document).ready(function(){initNavTree('d9/dee/classdouble__linked__list.html'
        -
        -
        double_linked_list Member List
        +
        double_linked_list Member List

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

        - + - + - +
        double_linked_list() (defined in double_linked_list)double_linked_listinline
        insert(int x) (defined in double_linked_list)double_linked_list
        insert(int x) (defined in double_linked_list)double_linked_list
        remove(int x) (defined in double_linked_list)double_linked_list
        reverseShow() (defined in double_linked_list)double_linked_list
        reverseShow() (defined in double_linked_list)double_linked_list
        search(int x) (defined in double_linked_list)double_linked_list
        show() (defined in double_linked_list)double_linked_list
        show() (defined in double_linked_list)double_linked_list
        diff --git a/dd/d7f/classstack__linked_list__coll__graph.svg b/dd/d7f/classstack__linked_list__coll__graph.svg index de7f38d25..6c5ef7c7f 100644 --- a/dd/d7f/classstack__linked_list__coll__graph.svg +++ b/dd/d7f/classstack__linked_list__coll__graph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: caesar Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('dd/d81/namespacecaesar.html','../../')
        -
        -
        caesar Namespace Reference
        +
        caesar Namespace Reference
        -

        Functions for Caesar cipher algorithm. +

        Functions for Caesar cipher algorithm. More...

        Detailed Description

        -

        Functions for Caesar cipher algorithm.

        +

        Functions for Caesar cipher algorithm.

        diff --git a/dd/d82/large__number_8h__incl.svg b/dd/d82/large__number_8h__incl.svg index 1d2b1a60a..b8c2510dc 100644 --- a/dd/d82/large__number_8h__incl.svg +++ b/dd/d82/large__number_8h__incl.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: FenwickTree Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -95,18 +95,11 @@ $(document).ready(function(){initNavTree('dd/d91/class_fenwick_tree.html','../.. Private Member Functions | Private Attributes | List of all members -
        -
        FenwickTree Class Reference
        +
        FenwickTree Class Reference
        -
        -Collaboration diagram for FenwickTree:
        -
        -
        -
        -
        [legend]
        - @@ -119,24 +112,24 @@ Public Member Functions

        +

        Public Member Functions

         FenwickTree (const std::vector< int > &arr)
         
        int sum_range (int l, int r)
         
        -

        +

        Private Member Functions

        int offset (int x)
         
        - - -

        +

        Private Attributes

        +
        int n
         
        +
        std::vector< int > bit
         

        Detailed Description

        -

        n --> No. of elements present in input array. bit[0..n] --> Array that represents Binary Indexed Tree.

        +

        n --> No. of elements present in input array. bit[0..n] --> Array that represents Binary Indexed Tree.

        Constructor & Destructor Documentation

        - +

        ◆ FenwickTree() [1/2]

        @@ -159,20 +152,19 @@ int n
        -

        Constructor

        Parameters
        +

        Constructor

        Parameters
        [in]arr--> Input array for which prefix sum is evaluated.
        -
        28  {
        -
        29  n = arr.size();
        -
        30  bit.assign(n + 1, 0);
        -
        31  for (int i = 0; i < n; ++i) {
        -
        32  update(i, arr[i]);
        -
        33  }
        -
        34  }
        -
        T assign(T... args)
        +
        28 {
        +
        29 n = arr.size();
        +
        30 bit.assign(n + 1, 0);
        +
        31 for (int i = 0; i < n; ++i) {
        +
        32 update(i, arr[i]);
        +
        33 }
        +
        34 }
        void update(int id, int val)
        Definition: fenwick_tree.cpp:45
        T size(T... args)
        @@ -184,7 +176,7 @@ Here is the call graph for this function:
        - +

        ◆ FenwickTree() [2/2]

        @@ -207,16 +199,16 @@ Here is the call graph for this function:
        -

        Constructor

        Parameters
        +

        Constructor

        Parameters
        [in]x--> Size of array that represents Binary Indexed Tree.
        -
        39  {
        -
        40  n = x;
        -
        41  bit.assign(n + 1, 0);
        -
        42  }
        +
        39 {
        +
        40 n = x;
        +
        41 bit.assign(n + 1, 0);
        +
        42 }
        Here is the call graph for this function:
        @@ -227,7 +219,7 @@ Here is the call graph for this function:

        Member Function Documentation

        - +

        ◆ offset()

        @@ -250,12 +242,12 @@ Here is the call graph for this function:
        -

        Returns the highest power of two which is not more than x

        -
        22 { return (x & (-x)); }
        +

        Returns the highest power of two which is not more than x

        +
        22{ return (x & (-x)); }
        - +

        ◆ sum()

        @@ -278,16 +270,16 @@ Here is the call graph for this function:
        -

        Get prefix sum upto id

        -
        54  {
        -
        55  id++;
        -
        56  int res = 0;
        -
        57  while (id > 0) {
        -
        58  res += bit[id];
        -
        59  id -= offset(id);
        -
        60  }
        -
        61  return res;
        -
        62  }
        +

        Get prefix sum upto id

        +
        54 {
        +
        55 id++;
        +
        56 int res = 0;
        +
        57 while (id > 0) {
        +
        58 res += bit[id];
        +
        59 id -= offset(id);
        +
        60 }
        +
        61 return res;
        +
        62 }
        int offset(int x)
        Definition: fenwick_tree.cpp:22
        Here is the call graph for this function:
        @@ -298,7 +290,7 @@ Here is the call graph for this function:
        - +

        ◆ sum_range()

        @@ -331,8 +323,8 @@ Here is the call graph for this function:
        -

        Returns the prefix sum in range from l to r

        -
        65 { return sum(r) - sum(l - 1); }
        +

        Returns the prefix sum in range from l to r

        +
        65{ return sum(r) - sum(l - 1); }
        int sum(int id)
        Definition: fenwick_tree.cpp:54
        Here is the call graph for this function:
        @@ -343,7 +335,7 @@ Here is the call graph for this function:
        - +

        ◆ update()

        @@ -376,14 +368,14 @@ Here is the call graph for this function:
        -

        Add val at id

        -
        45  {
        -
        46  id++;
        -
        47  while (id <= n) {
        -
        48  bit[id] += val;
        -
        49  id += offset(id);
        -
        50  }
        -
        51  }
        +

        Add val at id

        +
        45 {
        +
        46 id++;
        +
        47 while (id <= n) {
        +
        48 bit[id] += val;
        +
        49 id += offset(id);
        +
        50 }
        +
        51 }
        Here is the call graph for this function:
        @@ -402,7 +394,7 @@ Here is the call graph for this function:
        diff --git a/dd/d91/class_fenwick_tree.js b/dd/d91/class_fenwick_tree.js index e7f227e73..27b628fb1 100644 --- a/dd/d91/class_fenwick_tree.js +++ b/dd/d91/class_fenwick_tree.js @@ -5,7 +5,5 @@ var class_fenwick_tree = [ "offset", "dd/d91/class_fenwick_tree.html#aaae15ea71455315e257baa11017cec10", null ], [ "sum", "dd/d91/class_fenwick_tree.html#ade1d6a3d49af9d9df33e2fb26cab1699", null ], [ "sum_range", "dd/d91/class_fenwick_tree.html#a115ff5c548b429b737ea09f75817d1f9", null ], - [ "update", "dd/d91/class_fenwick_tree.html#a2e9ea4fcbe0786487f4535c1cfc7aa00", null ], - [ "bit", "dd/d91/class_fenwick_tree.html#aa8ecebf6f4ad9faaf4b826668d9409bb", null ], - [ "n", "dd/d91/class_fenwick_tree.html#a4816596da965b5f0871d77b5a1985aa1", null ] + [ "update", "dd/d91/class_fenwick_tree.html#a2e9ea4fcbe0786487f4535c1cfc7aa00", null ] ]; \ No newline at end of file diff --git a/dd/d91/class_fenwick_tree_a115ff5c548b429b737ea09f75817d1f9_cgraph.svg b/dd/d91/class_fenwick_tree_a115ff5c548b429b737ea09f75817d1f9_cgraph.svg index 61b1bdf20..b5d658980 100644 --- a/dd/d91/class_fenwick_tree_a115ff5c548b429b737ea09f75817d1f9_cgraph.svg +++ b/dd/d91/class_fenwick_tree_a115ff5c548b429b737ea09f75817d1f9_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - - - + + Algorithms_in_C++: machine_learning::aystar_search::EightPuzzle< N > Class Template Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -96,35 +96,26 @@ $(document).ready(function(){initNavTree('dd/d9c/classmachine__learning_1_1aysta Private Attributes | Friends | List of all members -
        -
        machine_learning::aystar_search::EightPuzzle< N > Class Template Reference
        +
        machine_learning::aystar_search::EightPuzzle< N > Class Template Reference
        -

        A class defining EightPuzzle/15-Puzzle game. +

        A class defining EightPuzzle/15-Puzzle game. More...

        -
        -Collaboration diagram for machine_learning::aystar_search::EightPuzzle< N >:
        -
        -
        -
        -
        [legend]
        - - - - + + + - - + + @@ -135,19 +126,19 @@ Public Member Functions - + - - - - - - - - - + + + + + + + + + @@ -158,44 +149,79 @@ Public Member Functions

        +

        Public Member Functions

        uint32_t get (size_t i, size_t j) const
         get the value from i units from right and j units from left side of the board More...
         
        -std::array< std::array< uint32_t, N >, N > get_state ()
         Returns the current state of the board.
         
        std::array< std::array< uint32_t, N >, N > get_state ()
         Returns the current state of the board. More...
         
        size_t get_size () const
         returns the size of the EightPuzzle (number of row / column) More...
         
        EightPuzzle ()
         Default constructor for EightPuzzle.
         EightPuzzle ()
         Default constructor for EightPuzzle. More...
         
         EightPuzzle (const std::array< std::array< uint32_t, N >, N > &init)
         Parameterized Constructor for EightPuzzle. More...
         EightPuzzle (const EightPuzzle< N > &&A) noexcept
         Move constructor. More...
         
        ~EightPuzzle ()=default
        ~EightPuzzle ()=default
         Destructor of EightPuzzle.
         
        EightPuzzleoperator= (const EightPuzzle &A)
         Copy assignment operator. More...
         
        EightPuzzleoperator= (EightPuzzle &&A) noexcept
         Move assignment operator. More...
         
        std::vector< EightPuzzle< N > > generate_possible_moves ()
         Find all possible states after processing all possible moves, given the current state of the puzzle. More...
         
        EightPuzzleoperator= (const EightPuzzle &A)
         Copy assignment operator. More...
         
        EightPuzzleoperator= (EightPuzzle &&A) noexcept
         Move assignment operator. More...
         
        std::vector< EightPuzzle< N > > generate_possible_moves ()
         Find all possible states after processing all possible moves, given the current state of the puzzle. More...
         
        bool operator== (const EightPuzzle< N > &check) const
         check whether two boards are equal More...
         
         check whether one board is lexicographically smaller or equal More...
         
        - - - - + + +

        +

        Private Member Functions

        std::pair< uint32_t, uint32_t > find_zero ()
         A helper array to evaluate the next state from current state;. More...
         
        std::pair< uint32_t, uint32_t > find_zero ()
         A helper array to evaluate the next state from current state;. More...
         
        bool in_range (const uint32_t value) const
         check whether the index value is bounded within the puzzle area More...
         
        - -

        +

        Private Attributes

        +
        std::array< std::array< uint32_t, N >, N > board
         
        std::vector< std::pair< int8_t, int8_t > > moves
         N x N array to store the current state of the Puzzle. More...
         
        - - - - + + +

        +

        Friends

        std::ostreamoperator<< (std::ostream &op, const EightPuzzle< N > &SomeState)
         friend operator to display EightPuzzle<> More...
         
        std::ostreamoperator<< (std::ostream &op, const EightPuzzle< N > &SomeState)
         friend operator to display EightPuzzle<> More...
         

        Detailed Description

        -

        template<size_t N = 3>
        -class machine_learning::aystar_search::EightPuzzle< N >

        - -

        A class defining EightPuzzle/15-Puzzle game.

        -

        A well known 3 x 3 puzzle of the form ` 1 2 3 4 5 6 7 8 0 where0` represents an empty space in the puzzle Given any random state, the goal is to achieve the above configuration (or any other configuration if possible)

        Template Parameters
        +
        template<size_t N = 3>
        +class machine_learning::aystar_search::EightPuzzle< N >

        A class defining EightPuzzle/15-Puzzle game.

        +

        A well known 3 x 3 puzzle of the form ` 1 2 3 4 5 6 7 8 0 where0` represents an empty space in the puzzle Given any random state, the goal is to achieve the above configuration (or any other configuration if possible)

        Template Parameters
        Nsize of the square Puzzle, default is set to 3 (since it is EightPuzzle)

        Constructor & Destructor Documentation

        - -

        ◆ EightPuzzle() [1/3]

        + +

        ◆ EightPuzzle() [1/4]

        + +
        +
        +
        +template<size_t N = 3>
        + + + + + +
        + + + + + + + +
        machine_learning::aystar_search::EightPuzzle< N >::EightPuzzle ()
        +
        +inline
        +
        + +

        Default constructor for EightPuzzle.

        +
        121 {
        +
        122 for (size_t i = 0; i < N; ++i) {
        +
        123 for (size_t j = 0; j < N; ++j) {
        +
        124 board[i][j] = ((i * 3 + j + 1) % (N * N));
        +
        125 }
        +
        126 }
        +
        127 }
        +
        constexpr uint32_t N
        A struct to represent sparse table for min() as their invariant function, for the given array A....
        Definition: sparse_table.cpp:47
        +
        +
        +
        + +

        ◆ EightPuzzle() [2/4]

        @@ -227,12 +253,12 @@ template<size_t N = 3>
        -
        133  : board(init) {}
        +
        133 : board(init) {}
        - -

        ◆ EightPuzzle() [2/3]

        + +

        ◆ EightPuzzle() [3/4]

        @@ -264,12 +290,12 @@ template<size_t N = 3>
        -
        139 : board(A.board) {}
        +
        139: board(A.board) {}
        - -

        ◆ EightPuzzle() [3/3]

        + +

        ◆ EightPuzzle() [4/4]

        @@ -301,14 +327,14 @@ template<size_t N = 3>
        -
        146  : board(std::move(A.board)) {}
        +
        146 : board(std::move(A.board)) {}
        T move(T... args)

        Member Function Documentation

        - -

        ◆ find_zero()

        + +

        ◆ find_zero()

        @@ -319,7 +345,7 @@ template<size_t N = 3>
        - + @@ -333,23 +359,22 @@ template<size_t N = 3>

        A helper array to evaluate the next state from current state;.

        -

        Finds an empty space in puzzle (in this case; a zero)

        Returns
        a pair indicating integer distances from top and right respectively, else returns -1, -1
        -
        75  {
        -
        76  for (size_t i = 0; i < N; ++i) {
        -
        77  for (size_t j = 0; j < N; ++j) {
        -
        78  if (!board[i][j]) {
        -
        79  return {i, j};
        -
        80  }
        -
        81  }
        -
        82  }
        -
        83  return {-1, -1};
        -
        84  }
        -
        constexpr uint32_t N
        A struct to represent sparse table for min() as their invariant function, for the given array A....
        Definition: sparse_table.cpp:47
        +

        Finds an empty space in puzzle (in this case; a zero)

        Returns
        a pair indicating integer distances from top and right respectively, else returns -1, -1
        +
        75 {
        +
        76 for (size_t i = 0; i < N; ++i) {
        +
        77 for (size_t j = 0; j < N; ++j) {
        +
        78 if (!board[i][j]) {
        +
        79 return {i, j};
        +
        80 }
        +
        81 }
        +
        82 }
        +
        83 return {-1, -1};
        +
        84 }
        - -

        ◆ generate_possible_moves()

        + +

        ◆ generate_possible_moves()

        @@ -360,7 +385,7 @@ template<size_t N = 3>
        @@ -42,21 +41,22 @@
        std::pair<uint32_t, uint32_t> machine_learning::aystar_search::EightPuzzle< N >::find_zero std::pair< uint32_t, uint32_t > machine_learning::aystar_search::EightPuzzle< N >::find_zero ( ) - + @@ -376,28 +401,28 @@ template<size_t N = 3>

        Find all possible states after processing all possible moves, given the current state of the puzzle.

        Returns
        list of vector containing all possible next moves
        Note
        the implementation is compulsory to create A* search
        -
        176  {
        -
        177  auto zero_pos = find_zero();
        -
        178  // vector which will contain all possible state from current state
        -
        179  std::vector<EightPuzzle<N>> NewStates;
        -
        180  for (auto &move : moves) {
        -
        181  if (in_range(zero_pos.first + move.first) &&
        -
        182  in_range(zero_pos.second + move.second)) {
        -
        183  // swap with the possible moves
        -
        184  std::array<std::array<uint32_t, N>, N> new_config = board;
        -
        185  std::swap(new_config[zero_pos.first][zero_pos.second],
        -
        186  new_config[zero_pos.first + move.first]
        -
        187  [zero_pos.second + move.second]);
        -
        188  EightPuzzle<N> new_state(new_config);
        -
        189  // Store new state and calculate heuristic value, and depth
        -
        190  NewStates.emplace_back(new_state);
        -
        191  }
        -
        192  }
        -
        193  return NewStates;
        -
        194  }
        +
        176 {
        +
        177 auto zero_pos = find_zero();
        +
        178 // vector which will contain all possible state from current state
        + +
        180 for (auto &move : moves) {
        +
        181 if (in_range(zero_pos.first + move.first) &&
        +
        182 in_range(zero_pos.second + move.second)) {
        +
        183 // swap with the possible moves
        +
        184 std::array<std::array<uint32_t, N>, N> new_config = board;
        +
        185 std::swap(new_config[zero_pos.first][zero_pos.second],
        +
        186 new_config[zero_pos.first + move.first]
        +
        187 [zero_pos.second + move.second]);
        +
        188 EightPuzzle<N> new_state(new_config);
        +
        189 // Store new state and calculate heuristic value, and depth
        +
        190 NewStates.emplace_back(new_state);
        +
        191 }
        +
        192 }
        +
        193 return NewStates;
        +
        194 }
        -
        std::pair< uint32_t, uint32_t > find_zero()
        A helper array to evaluate the next state from current state;.
        Definition: a_star_search.cpp:75
        bool in_range(const uint32_t value) const
        check whether the index value is bounded within the puzzle area
        Definition: a_star_search.cpp:90
        +
        std::pair< uint32_t, uint32_t > find_zero()
        A helper array to evaluate the next state from current state;.
        Definition: a_star_search.cpp:75
        std::vector< std::pair< int8_t, int8_t > > moves
        N x N array to store the current state of the Puzzle.
        Definition: a_star_search.cpp:64
        T emplace_back(T... args)
        T swap(T... args)
        @@ -405,13 +430,13 @@ template<size_t N = 3>
        Here is the call graph for this function:
        -
        +
        - +

        ◆ get()

        @@ -458,12 +483,12 @@ template<size_t N = 3>
        Returns
        non-negative integer denoting the value at ith row and jth column
        -1 if invalid i or j position
        -
        102  {
        -
        103  if (in_range(i) && in_range(j)) {
        -
        104  return board[i][j];
        -
        105  }
        -
        106  return -1;
        -
        107  }
        +
        102 {
        +
        103 if (in_range(i) && in_range(j)) {
        +
        104 return board[i][j];
        +
        105 }
        +
        106 return -1;
        +
        107 }
        Here is the call graph for this function:
        @@ -473,7 +498,7 @@ Here is the call graph for this function:
        - +

        ◆ get_size()

        @@ -500,11 +525,41 @@ template<size_t N = 3>

        returns the size of the EightPuzzle (number of row / column)

        Returns
        N, the size of the puzzle.
        -
        117 { return N; }
        +
        117{ return N; }
        - + +

        ◆ get_state()

        + +
        +
        +
        +template<size_t N = 3>
        +
        std::vector<EightPuzzle<N> > machine_learning::aystar_search::EightPuzzle< N >::generate_possible_moves std::vector< EightPuzzle< N > > machine_learning::aystar_search::EightPuzzle< N >::generate_possible_moves ( )
        + + + + +
        + + + + + + + +
        std::array< std::array< uint32_t, N >, N > machine_learning::aystar_search::EightPuzzle< N >::get_state ()
        +
        +inline
        +
        + +

        Returns the current state of the board.

        +
        111{ return board; }
        +
        +
        + +

        ◆ in_range()

        @@ -538,11 +593,11 @@ template<size_t N = 3>
        Returns
        true if index is within the board, else false
        -
        90 { return value < N; }
        +
        90{ return value < N; }
        - +

        ◆ operator<()

        @@ -570,21 +625,21 @@ template<size_t N = 3>

        check whether one board is lexicographically smaller

        Returns
        true if this->state is lexicographically smaller than check.state, else false
        -
        218  {
        -
        219  for (size_t i = 0; i < N; ++i) {
        -
        220  for (size_t j = 0; j < N; ++j) {
        -
        221  if (board[i][j] != check.board[i][j]) {
        -
        222  return board[i][j] < check.board[i][j];
        -
        223  }
        -
        224  }
        -
        225  }
        -
        226  return false;
        -
        227  }
        +
        218 {
        +
        219 for (size_t i = 0; i < N; ++i) {
        +
        220 for (size_t j = 0; j < N; ++j) {
        +
        221 if (board[i][j] != check.board[i][j]) {
        +
        222 return board[i][j] < check.board[i][j];
        +
        223 }
        +
        224 }
        +
        225 }
        +
        226 return false;
        +
        227 }
        bool check(const std::string &s, const std::unordered_set< std::string > &strSet, int pos, std::vector< int > *dp)
        Function that checks if the string passed in param can be segmented from position 'pos',...
        Definition: word_break.cpp:80
        - +

        ◆ operator<=()

        @@ -612,21 +667,21 @@ template<size_t N = 3>

        check whether one board is lexicographically smaller or equal

        Returns
        true if this->state is lexicographically smaller than check.state or same, else false
        -
        233  {
        -
        234  for (size_t i = 0; i < N; ++i) {
        -
        235  for (size_t j = 0; j < N; ++j) {
        -
        236  if (board[i][j] != check.board[i][j]) {
        -
        237  return board[i][j] < check.board[i][j];
        -
        238  }
        -
        239  }
        -
        240  }
        -
        241  return true;
        -
        242  }
        +
        233 {
        +
        234 for (size_t i = 0; i < N; ++i) {
        +
        235 for (size_t j = 0; j < N; ++j) {
        +
        236 if (board[i][j] != check.board[i][j]) {
        +
        237 return board[i][j] < check.board[i][j];
        +
        238 }
        +
        239 }
        +
        240 }
        +
        241 return true;
        +
        242 }
        - -

        ◆ operator=() [1/2]

        + +

        ◆ operator=() [1/2]

        @@ -637,7 +692,7 @@ template<size_t N = 3>
        - + @@ -658,15 +713,15 @@ template<size_t N = 3>
        EightPuzzle& machine_learning::aystar_search::EightPuzzle< N >::operator= EightPuzzle & machine_learning::aystar_search::EightPuzzle< N >::operator= ( const EightPuzzle< N > &  A)
        -
        156  {
        -
        157  board = A.board;
        -
        158  return *this;
        -
        159  }
        +
        156 {
        +
        157 board = A.board;
        +
        158 return *this;
        +
        159 }
        - -

        ◆ operator=() [2/2]

        + +

        ◆ operator=() [2/2]

        @@ -677,7 +732,7 @@ template<size_t N = 3>
        - + @@ -698,20 +753,20 @@ template<size_t N = 3>
        EightPuzzle& machine_learning::aystar_search::EightPuzzle< N >::operator= EightPuzzle & machine_learning::aystar_search::EightPuzzle< N >::operator= ( EightPuzzle< N > &&  A)
        -
        165  {
        -
        166  board = std::move(A.board);
        -
        167  return *this;
        -
        168  }
        +
        165 {
        +
        166 board = std::move(A.board);
        +
        167 return *this;
        +
        168 }
        Here is the call graph for this function:
        -
        +
        - +

        ◆ operator==()

        @@ -739,25 +794,25 @@ template<size_t N = 3>

        check whether two boards are equal

        Returns
        true if check.state is equal to this->state, else false
        -
        200  {
        -
        201  if (check.get_size() != N) {
        -
        202  return false;
        -
        203  }
        -
        204  for (size_t i = 0; i < N; ++i) {
        -
        205  for (size_t j = 0; j < N; ++j) {
        -
        206  if (board[i][j] != check.board[i][j]) {
        -
        207  return false;
        -
        208  }
        -
        209  }
        -
        210  }
        -
        211  return true;
        -
        212  }
        +
        200 {
        +
        201 if (check.get_size() != N) {
        +
        202 return false;
        +
        203 }
        +
        204 for (size_t i = 0; i < N; ++i) {
        +
        205 for (size_t j = 0; j < N; ++j) {
        +
        206 if (board[i][j] != check.board[i][j]) {
        +
        207 return false;
        +
        208 }
        +
        209 }
        +
        210 }
        +
        211 return true;
        +
        212 }

        Friends And Related Function Documentation

        - -

        ◆ operator<<

        + +

        ◆ operator<<

        @@ -768,7 +823,7 @@ template<size_t N = 3>
        - + @@ -801,20 +856,20 @@ template<size_t N = 3>
        Returns
        ostream operator op
        -
        251  {
        -
        252  for (size_t i = 0; i < N; ++i) {
        -
        253  for (size_t j = 0; j < N; ++j) {
        -
        254  op << SomeState.board[i][j] << " ";
        -
        255  }
        -
        256  op << "\n";
        -
        257  }
        -
        258  return op;
        -
        259  }
        +
        251 {
        +
        252 for (size_t i = 0; i < N; ++i) {
        +
        253 for (size_t j = 0; j < N; ++j) {
        +
        254 op << SomeState.board[i][j] << " ";
        +
        255 }
        +
        256 op << "\n";
        +
        257 }
        +
        258 return op;
        +
        259 }

        Member Data Documentation

        - +

        ◆ moves

        @@ -855,7 +910,7 @@ template<size_t N = 3>
        diff --git a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.js b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.js index 8f9f54da5..16b4a0bd6 100644 --- a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.js +++ b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.js @@ -5,18 +5,17 @@ var classmachine__learning_1_1aystar__search_1_1_eight_puzzle = [ "EightPuzzle", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#ad45fde095ac00effe1fe00b1d85ff9c7", null ], [ "EightPuzzle", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#af22395b8e9e04222aa93a329523faef9", null ], [ "~EightPuzzle", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a194c2973b51a5467fc17064a4ea4e6f9", null ], - [ "find_zero", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a01564e5136ca270c45382e5ea55dc6ec", null ], - [ "generate_possible_moves", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#af8cc0c234ebd261ee27bc3c391f837e3", null ], + [ "find_zero", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a94f794bf44f424b1b0ca6ef9f4f6ebd3", null ], + [ "generate_possible_moves", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a26a976171392d257ca0f814ed73e0658", null ], [ "get", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#aa5c0486c7f29f323a2aced2ab33af420", null ], [ "get_size", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#ae145ac4a0d2ec58945b58fad3c04f00f", null ], - [ "get_state", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a104ce464744254f6be45781e65c40404", null ], + [ "get_state", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#ade14b0e1a88543b91426e2008e4d0f99", null ], [ "in_range", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a48d054230468b79037964f474d842b6e", null ], [ "operator<", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a64815f10cf9fb9fdb4cc92731ccf10ba", null ], [ "operator<=", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#af778034b2942ecac6df1e9ec8b5412ee", null ], - [ "operator=", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a079587a19a47c75c51a5a726d9263fb9", null ], - [ "operator=", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a2ac8dff819bc37f2136951a5bc9fc799", null ], + [ "operator=", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a467e722dc1fcc82bfb4cef55744e04e2", null ], + [ "operator=", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a1802cf6197a255055cb734d626abc101", null ], [ "operator==", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#aa17e0227321b109ed91e156ac1332915", null ], - [ "operator<<", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a53237f6f7d19e9601a1e6ba90749a20d", null ], - [ "board", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a35d8f14ca17218f236c09ff9ad864f9c", null ], + [ "operator<<", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#a9517e162e2988f7db052296bd550a742", null ], [ "moves", "dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle.html#aa73857052e69b86347859d9148933f71", null ] ]; \ No newline at end of file diff --git a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a2ac8dff819bc37f2136951a5bc9fc799_cgraph.map b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a1802cf6197a255055cb734d626abc101_cgraph.map similarity index 100% rename from dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a2ac8dff819bc37f2136951a5bc9fc799_cgraph.map rename to dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a1802cf6197a255055cb734d626abc101_cgraph.map diff --git a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a2ac8dff819bc37f2136951a5bc9fc799_cgraph.md5 b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a1802cf6197a255055cb734d626abc101_cgraph.md5 similarity index 100% rename from dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a2ac8dff819bc37f2136951a5bc9fc799_cgraph.md5 rename to dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a1802cf6197a255055cb734d626abc101_cgraph.md5 diff --git a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a2ac8dff819bc37f2136951a5bc9fc799_cgraph.svg b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a1802cf6197a255055cb734d626abc101_cgraph.svg similarity index 96% rename from dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a2ac8dff819bc37f2136951a5bc9fc799_cgraph.svg rename to dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a1802cf6197a255055cb734d626abc101_cgraph.svg index 7129cdd4c..97f6e1723 100644 --- a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a2ac8dff819bc37f2136951a5bc9fc799_cgraph.svg +++ b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a1802cf6197a255055cb734d626abc101_cgraph.svg @@ -1,7 +1,7 @@ - - + diff --git a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a26a976171392d257ca0f814ed73e0658_cgraph.md5 b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a26a976171392d257ca0f814ed73e0658_cgraph.md5 new file mode 100644 index 000000000..fa4825c72 --- /dev/null +++ b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a26a976171392d257ca0f814ed73e0658_cgraph.md5 @@ -0,0 +1 @@ +9587a9f4140752406f33d625a35358f4 \ No newline at end of file diff --git a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_af8cc0c234ebd261ee27bc3c391f837e3_cgraph.svg b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a26a976171392d257ca0f814ed73e0658_cgraph.svg similarity index 96% rename from dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_af8cc0c234ebd261ee27bc3c391f837e3_cgraph.svg rename to dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a26a976171392d257ca0f814ed73e0658_cgraph.svg index 9a6027a52..a4f95837c 100644 --- a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_af8cc0c234ebd261ee27bc3c391f837e3_cgraph.svg +++ b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_a26a976171392d257ca0f814ed73e0658_cgraph.svg @@ -1,7 +1,7 @@ - Node3 - + machine_learning::aystar _search::EightPuzzle::find_zero diff --git a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_aa5c0486c7f29f323a2aced2ab33af420_cgraph.svg b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_aa5c0486c7f29f323a2aced2ab33af420_cgraph.svg index 6d532d3bf..8fa7ee2d3 100644 --- a/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_aa5c0486c7f29f323a2aced2ab33af420_cgraph.svg +++ b/dd/d9c/classmachine__learning_1_1aystar__search_1_1_eight_puzzle_aa5c0486c7f29f323a2aced2ab33af420_cgraph.svg @@ -1,7 +1,7 @@ - - - - - diff --git a/dd/d9d/structdata__structures_1_1list__array_1_1list__coll__graph.md5 b/dd/d9d/structdata__structures_1_1list__array_1_1list__coll__graph.md5 deleted file mode 100644 index 8cb958e64..000000000 --- a/dd/d9d/structdata__structures_1_1list__array_1_1list__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -500447622d08d9f56b3b5119c0944fb5 \ No newline at end of file diff --git a/dd/d9d/structdata__structures_1_1list__array_1_1list__coll__graph.svg b/dd/d9d/structdata__structures_1_1list__array_1_1list__coll__graph.svg deleted file mode 100644 index 1e3baf886..000000000 --- a/dd/d9d/structdata__structures_1_1list__array_1_1list__coll__graph.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - -data_structures::list_array::list - - - -Node1 - - -data_structures::list -_array::list - - - - - -Node2 - - -std::array< uint64 -_t, 50 > - - - - - -Node2->Node1 - - - data - - - -Node3 - - -std::uint64_t - - - - - -Node3->Node2 - - - elements - - - diff --git a/dd/d9f/count__of__set__bits_8cpp__incl.svg b/dd/d9f/count__of__set__bits_8cpp__incl.svg index 91a76cc91..753b51c09 100644 --- a/dd/d9f/count__of__set__bits_8cpp__incl.svg +++ b/dd/d9f/count__of__set__bits_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + +Algorithms_in_C++: Todo List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ @@ -42,21 +41,22 @@
        std::ostream& operator<< std::ostream & operator<< ( std::ostream op,
        -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -89,9 +89,8 @@ $(document).ready(function(){initNavTree('dd/da0/todo.html','../../'); initResiz -
        -
        -
        Todo List
        +
        +
        Todo List
        @@ -130,7 +129,7 @@ $(document).ready(function(){initNavTree('dd/da0/todo.html','../../'); initResiz diff --git a/dd/da8/pigeonhole__sort_8cpp.html b/dd/da8/pigeonhole__sort_8cpp.html index f33b2f9c4..1d5cfb9f3 100644 --- a/dd/da8/pigeonhole__sort_8cpp.html +++ b/dd/da8/pigeonhole__sort_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: sorting/pigeonhole_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
        -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('dd/da8/pigeonhole__sort_8cpp.html','.. -
        -
        pigeonhole_sort.cpp File Reference
        +
        pigeonhole_sort.cpp File Reference
        -

        Implementation of Pigeonhole Sort algorithm +

        Implementation of Pigeonhole Sort algorithm More...

        #include <algorithm>
        #include <array>
        @@ -111,17 +110,17 @@ Include dependency graph for pigeonhole_sort.cpp:
        - - +

        +

        Namespaces

         sorting
        namespace  sorting
         Sorting algorithms.
         
        - - - - + + + @@ -132,12 +131,12 @@ Functions

        +

        Functions

        template<std::size_t N>
        std::array< int, N > sorting::pigeonSort (std::array< int, N > arr)
         
        template<std::size_t N>
        std::array< int, N > sorting::pigeonSort (std::array< int, N > arr)
         
        static void test_1 ()
         
        static void test_2 ()
         

        Detailed Description

        -

        Implementation of Pigeonhole Sort algorithm

        -
        Author
        Lownish
        +

        Implementation of Pigeonhole Sort algorithm

        +
        Author
        Lownish

        Pigeonhole sorting is a sorting algorithm that is suitable for sorting lists of elements where the number of elements and the number of possible key values are approximately the same. It requires O(n + Range) time where n is number of elements in input array and ‘Range’ is number of possible values in array.

        -

        The time Complexity of the algorithm is \(O(n+N)\).

        +

        The time Complexity of the algorithm is \(O(n+N)\).

        Function Documentation

        - +

        ◆ main()

        @@ -152,14 +151,14 @@ Functions
        -

        Main function

        -
        127  {
        -
        128  test_1();
        -
        129  test_2();
        -
        130  test_3();
        -
        131 
        -
        132  return 0;
        -
        133 }
        +

        Main function

        +
        127 {
        +
        128 test_1();
        +
        129 test_2();
        +
        130 test_3();
        +
        131
        +
        132 return 0;
        +
        133}
        static void test_1()
        Definition: pigeonhole_sort.cpp:68
        static void test_2()
        Definition: pigeonhole_sort.cpp:88
        static void test_3()
        Definition: pigeonhole_sort.cpp:109
        @@ -172,7 +171,7 @@ Here is the call graph for this function:
        - +

        ◆ test_1()

        @@ -194,21 +193,21 @@ Here is the call graph for this function:
        -

        Test function 1 with unsorted array {8, 3, 2, 7, 4, 6, 8}

        Returns
        none
        -
        68  {
        -
        69  const int n = 7;
        -
        70  std::array<int, n> test_array = {8, 3, 2, 7, 4, 6, 8};
        -
        71 
        -
        72  test_array = sorting::pigeonSort<n>(test_array);
        -
        73 
        -
        74  assert(std::is_sorted(std::begin(test_array), std::end(test_array)));
        -
        75 
        -
        76  // Printing sorted array
        -
        77  for (int i = 0; i < n; i++) {
        -
        78  std::cout << test_array.at(i) << " ";
        -
        79  }
        -
        80  std::cout << "\nPassed\n";
        -
        81 }
        +

        Test function 1 with unsorted array {8, 3, 2, 7, 4, 6, 8}

        Returns
        none
        +
        68 {
        +
        69 const int n = 7;
        +
        70 std::array<int, n> test_array = {8, 3, 2, 7, 4, 6, 8};
        +
        71
        +
        72 test_array = sorting::pigeonSort<n>(test_array);
        +
        73
        +
        74 assert(std::is_sorted(std::begin(test_array), std::end(test_array)));
        +
        75
        +
        76 // Printing sorted array
        +
        77 for (int i = 0; i < n; i++) {
        +
        78 std::cout << test_array.at(i) << " ";
        +
        79 }
        +
        80 std::cout << "\nPassed\n";
        +
        81}
        T at(T... args)
        @@ -224,7 +223,7 @@ Here is the call graph for this function:
        - +

        ◆ test_2()

        @@ -246,22 +245,22 @@ Here is the call graph for this function:
        -

        Test function 2 with unsorted array {802, 630, 20, 745, 52, 300, 612, 932, 78, 187}

        Returns
        none
        -
        88  {
        -
        89  const int n = 10;
        -
        90  std::array<int, n> test_array = {802, 630, 20, 745, 52,
        -
        91  300, 612, 932, 78, 187};
        -
        92 
        -
        93  test_array = sorting::pigeonSort<n>(test_array);
        -
        94 
        -
        95  assert(std::is_sorted(std::begin(test_array), std::end(test_array)));
        -
        96 
        -
        97  // Printing sorted array
        -
        98  for (int i = 0; i < n; i++) {
        -
        99  std::cout << test_array.at(i) << " ";
        -
        100  }
        -
        101  std::cout << "\nPassed\n";
        -
        102 }
        +

        Test function 2 with unsorted array {802, 630, 20, 745, 52, 300, 612, 932, 78, 187}

        Returns
        none
        +
        88 {
        +
        89 const int n = 10;
        +
        90 std::array<int, n> test_array = {802, 630, 20, 745, 52,
        +
        91 300, 612, 932, 78, 187};
        +
        92
        +
        93 test_array = sorting::pigeonSort<n>(test_array);
        +
        94
        +
        95 assert(std::is_sorted(std::begin(test_array), std::end(test_array)));
        +
        96
        +
        97 // Printing sorted array
        +
        98 for (int i = 0; i < n; i++) {
        +
        99 std::cout << test_array.at(i) << " ";
        +
        100 }
        +
        101 std::cout << "\nPassed\n";
        +
        102}
        Here is the call graph for this function:
        @@ -271,7 +270,7 @@ Here is the call graph for this function:
        - +

        ◆ test_3()

        @@ -293,21 +292,21 @@ Here is the call graph for this function:
        -

        Test function 1 with unsorted array {11,13,12,14}

        Returns
        none
        -
        109  {
        -
        110  const int n = 4;
        -
        111  std::array<int, n> test_array = {11, 13, 12, 14};
        -
        112 
        -
        113  test_array = sorting::pigeonSort<n>(test_array);
        -
        114 
        -
        115  assert(std::is_sorted(std::begin(test_array), std::end(test_array)));
        -
        116 
        -
        117  // Printing sorted array
        -
        118  for (int i = 0; i < n; i++) {
        -
        119  std::cout << test_array.at(i) << " ";
        -
        120  }
        -
        121  std::cout << "\nPassed\n";
        -
        122 }
        +

        Test function 1 with unsorted array {11,13,12,14}

        Returns
        none
        +
        109 {
        +
        110 const int n = 4;
        +
        111 std::array<int, n> test_array = {11, 13, 12, 14};
        +
        112
        +
        113 test_array = sorting::pigeonSort<n>(test_array);
        +
        114
        +
        115 assert(std::is_sorted(std::begin(test_array), std::end(test_array)));
        +
        116
        +
        117 // Printing sorted array
        +
        118 for (int i = 0; i < n; i++) {
        +
        119 std::cout << test_array.at(i) << " ";
        +
        120 }
        +
        121 std::cout << "\nPassed\n";
        +
        122}
        Here is the call graph for this function:
        @@ -323,7 +322,7 @@ Here is the call graph for this function:
        diff --git a/dd/da8/pigeonhole__sort_8cpp.js b/dd/da8/pigeonhole__sort_8cpp.js index 904247b22..122e45b67 100644 --- a/dd/da8/pigeonhole__sort_8cpp.js +++ b/dd/da8/pigeonhole__sort_8cpp.js @@ -1,7 +1,7 @@ var pigeonhole__sort_8cpp = [ [ "main", "dd/da8/pigeonhole__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "pigeonSort", "dd/da8/pigeonhole__sort_8cpp.html#a2f6a7a66934f345f86038a280234e706", null ], + [ "pigeonSort", "dd/da8/pigeonhole__sort_8cpp.html#a0e9e1b21a1684585e9e50f9afe4d53a3", null ], [ "test_1", "dd/da8/pigeonhole__sort_8cpp.html#a34b8683a2b429de5cce57e6d733ec817", null ], [ "test_2", "dd/da8/pigeonhole__sort_8cpp.html#a458410412185a5f09199deaff7157a8d", null ], [ "test_3", "dd/da8/pigeonhole__sort_8cpp.html#af31ec5409537703d9c8a47350386b32a", null ] diff --git a/dd/da8/pigeonhole__sort_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.svg b/dd/da8/pigeonhole__sort_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.svg index f4f20535b..38a8cb58a 100644 --- a/dd/da8/pigeonhole__sort_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.svg +++ b/dd/da8/pigeonhole__sort_8cpp_a34b8683a2b429de5cce57e6d733ec817_cgraph.svg @@ -1,7 +1,7 @@ - - - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('d4/db4/struct_segment_intersection.htm
        -
        -
        SegmentIntersection Member List
        +
        SegmentIntersection Member List

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

        - +
        direction(Point first_point, Point second_point, Point third_point)SegmentIntersectioninline
        intersect(Point first_point, Point second_point, Point third_point, Point forth_point) (defined in SegmentIntersection)SegmentIntersectioninline
        intersect(Point first_point, Point second_point, Point third_point, Point forth_point) (defined in SegmentIntersection)SegmentIntersectioninline
        on_segment(Point first_point, Point second_point, Point third_point)SegmentIntersectioninline
        diff --git a/dd/dad/power__of__two_8cpp__incl.svg b/dd/dad/power__of__two_8cpp__incl.svg index 69249f01e..3ba38c83f 100644 --- a/dd/dad/power__of__two_8cpp__incl.svg +++ b/dd/dad/power__of__two_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: count_of_set_bits Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('dd/dae/namespacecount__of__set__bits.h
        -
        -
        count_of_set_bits Namespace Reference
        +
        count_of_set_bits Namespace Reference
        -

        Functions for the count sets bits implementation. +

        Functions for the count sets bits implementation. More...

        Detailed Description

        -

        Functions for the count sets bits implementation.

        +

        Functions for the count sets bits implementation.

        diff --git a/dd/dae/structquadratic__probing_1_1_entry-members.html b/dd/dae/structquadratic__probing_1_1_entry-members.html index e1bc0b15a..911f6a4ca 100644 --- a/dd/dae/structquadratic__probing_1_1_entry-members.html +++ b/dd/dae/structquadratic__probing_1_1_entry-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,21 +90,20 @@ $(document).ready(function(){initNavTree('da/dd1/structquadratic__probing_1_1_en
        -
        -
        quadratic_probing::Entry Member List
        +
        quadratic_probing::Entry Member List

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

        - +
        Entry(int key=notPresent)quadratic_probing::Entryinlineexplicit
        keyquadratic_probing::Entry
        keyquadratic_probing::Entry
        diff --git a/dd/db0/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plus-_plus_2sorting_2wiggle_sort_8cpp-example.html b/dd/db0/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plus-_plus_2sorting_2wiggle_sort_8cpp-example.html index cfabcd5c3..5e4ce087a 100644 --- a/dd/db0/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plus-_plus_2sorting_2wiggle_sort_8cpp-example.html +++ b/dd/db0/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plus-_plus_2sorting_2wiggle_sort_8cpp-example.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: /Users/runner/work/C-Plus-Plus/C-Plus-Plus/sorting/wiggle_sort.cpp @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,11 +90,10 @@ $(document).ready(function(){initNavTree('dd/db0/_2_users_2runner_2work_2_c-_plu
        -
        -
        /Users/runner/work/C-Plus-Plus/C-Plus-Plus/sorting/wiggle_sort.cpp
        +
        /Users/runner/work/C-Plus-Plus/C-Plus-Plus/sorting/wiggle_sort.cpp
        -

        arr = [1,1,5,6,1,4], after wiggle sort arr will become equal to [1,1,6,1,5,4] arr = [2,8,9,1,7], after wiggle sort arr will become equal to [8,2,9,1,7]

        +

        arr = [1,1,5,6,1,4], after wiggle sort arr will become equal to [1,1,6,1,5,4] arr = [2,8,9,1,7], after wiggle sort arr will become equal to [8,2,9,1,7]

        /**
        * \addtogroup sorting Sorting Algorithms
        * @{
        @@ -124,13 +123,13 @@ $(document).ready(function(){initNavTree('dd/db0/_2_users_2runner_2work_2_c-_plu
        * @namespace sorting
        * @brief Sorting algorithms
        */
        -
        namespace sorting {
        +
        namespace sorting {
        /**
        * @namespace wiggle_sort
        * @brief Functions for [Wiggle
        * Sort](https://leetcode.com/problems/wiggle-sort-ii/) algorithm
        */
        -
        namespace wiggle_sort {
        +
        namespace wiggle_sort {
        /**
        *
        @@ -147,20 +146,20 @@ $(document).ready(function(){initNavTree('dd/db0/_2_users_2runner_2work_2_c-_plu
        */
        template <typename T> // this allows to have vectors of ints, double, float,
        // etc
        - -
        uint32_t size = arr.size();
        + +
        uint32_t size = arr.size();
        - +
        arr); // create a copy of input vector. this way, the original input
        // vector does not get modified. a sorted array is is returned.
        for (int i = 0; i < size; i += 2) {
        if (i > 0 && out[i - 1] > out[i]) {
        -
        std::swap(out[i], out[i - 1]); // swapping the two values
        +
        std::swap(out[i], out[i - 1]); // swapping the two values
        }
        if (i < size - 1 && out[i] < out[i + 1]) {
        -
        std::swap(out[i], out[i + 1]); // swapping the two values
        +
        std::swap(out[i], out[i + 1]); // swapping the two values
        }
        }
        @@ -179,50 +178,50 @@ $(document).ready(function(){initNavTree('dd/db0/_2_users_2runner_2work_2_c-_plu
        *
        */
        template <typename T>
        -
        static void displayElements(const std::vector<T> &arr) {
        -
        uint32_t size = arr.size();
        +
        static void displayElements(const std::vector<T> &arr) {
        +
        uint32_t size = arr.size();
        -
        std::cout << "Sorted elements are as follows: ";
        +
        std::cout << "Sorted elements are as follows: ";
        -
        std::cout << "[";
        +
        std::cout << "[";
        for (int i = 0; i < size; i++) {
        -
        std::cout << arr[i];
        +
        std::cout << arr[i];
        if (i != size - 1) {
        -
        std::cout << ", ";
        +
        std::cout << ", ";
        }
        }
        -
        std::cout << "]" << std::endl;
        +
        std::cout << "]" << std::endl;
        }
        /**
        * Test function
        * @returns void
        */
        -
        static void test() {
        -
        std::srand(std::time(nullptr)); // initialize random number generator
        +
        static void test() {
        +
        std::srand(std::time(nullptr)); // initialize random number generator
        -
        std::vector<float> data1(100);
        +
        std::vector<float> data1(100);
        for (auto &d : data1) { // generate random numbers between -5.0 and 4.99
        -
        d = float(std::rand() % 1000 - 500) / 100.f;
        +
        d = float(std::rand() % 1000 - 500) / 100.f;
        }
        -
        std::vector<float> sorted = sorting::wiggle_sort::wiggleSort<float>(data1);
        +
        std::vector<float> sorted = sorting::wiggle_sort::wiggleSort<float>(data1);
        -
        displayElements(sorted);
        +
        displayElements(sorted);
        for (uint32_t j = 0; j < data1.size(); j += 2) {
        assert(data1[j] <= data1[j + 1] &&
        data1[j + 1] >= data1[j + 2]); // check the validation condition
        }
        -
        std::cout << "Test 1 passed\n";
        +
        std::cout << "Test 1 passed\n";
        }
        /** Driver Code */
        -
        int main() {
        -
        test();
        +
        int main() {
        +
        test();
        return 0;
        }
        @@ -240,13 +239,13 @@ $(document).ready(function(){initNavTree('dd/db0/_2_users_2runner_2work_2_c-_plu
        T swap(T... args)
        T time(T... args)
        -
        std::vector< T > wiggleSort(const std::vector< T > &arr)
        Function used for sorting the elements in wave form.
        Definition: wiggle_sort.cpp:53
        +
        std::vector< T > wiggleSort(const std::vector< T > &arr)
        Function used for sorting the elements in wave form.
        Definition: wiggle_sort.cpp:53
        diff --git a/dd/db5/nqueen__print__all__solutions_8cpp__incl.svg b/dd/db5/nqueen__print__all__solutions_8cpp__incl.svg index 158aa64e8..cb59163f1 100644 --- a/dd/db5/nqueen__print__all__solutions_8cpp__incl.svg +++ b/dd/db5/nqueen__print__all__solutions_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: binary_search_tree< T >::bst_node Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -94,26 +94,19 @@ $(document).ready(function(){initNavTree('dd/db6/structbinary__search__tree_1_1b Public Member Functions | Public Attributes | List of all members -
        -
        binary_search_tree< T >::bst_node Struct Reference
        +
        binary_search_tree< T >::bst_node Struct Reference

        A struct to represent a node in the Binary Search Tree. More...

        -
        -Collaboration diagram for binary_search_tree< T >::bst_node:
        -
        -
        -
        -
        [legend]
        -

        +

        Public Member Functions

         bst_node (T _value)
         
        - @@ -123,12 +116,10 @@ Public Attributes

        +

        Public Attributes

        value
         
         

        Detailed Description

        -

        template<class T>
        -struct binary_search_tree< T >::bst_node

        - -

        A struct to represent a node in the Binary Search Tree.

        +
        template<class T>
        +struct binary_search_tree< T >::bst_node

        A struct to represent a node in the Binary Search Tree.

        Constructor & Destructor Documentation

        - +

        ◆ bst_node()

        @@ -153,17 +144,17 @@ template<class T >
        -

        Constructor for bst_node, used to simplify node construction and smart pointer construction.

        Parameters
        +

        Constructor for bst_node, used to simplify node construction and smart pointer construction.

        Parameters
        _valueThe value of the constructed node.
        -
        34  {
        -
        35  value = _value;
        -
        36  left = nullptr;
        -
        37  right = nullptr;
        -
        38  }
        +
        34 {
        +
        35 value = _value;
        +
        36 left = nullptr;
        +
        37 right = nullptr;
        +
        38 }
        std::unique_ptr< bst_node > right
        Definition: binary_search_tree2.cpp:27
        T value
        Definition: binary_search_tree2.cpp:25
        std::unique_ptr< bst_node > left
        Definition: binary_search_tree2.cpp:26
        @@ -171,7 +162,7 @@ template<class T >

        Member Data Documentation

        - +

        ◆ left

        @@ -184,11 +175,11 @@ template<class T >
        -

        Pointer to left subtree.

        +

        Pointer to left subtree.

        - +

        ◆ right

        @@ -201,11 +192,11 @@ template<class T >
        -

        Pointer to right subtree.

        +

        Pointer to right subtree.

        - +

        ◆ value

        @@ -218,7 +209,7 @@ template<class T >
        -

        The value/key of the node.

        +

        The value/key of the node.

        @@ -231,7 +222,7 @@ template<class T > diff --git a/dd/dba/namespacedivide__and__conquer.html b/dd/dba/namespacedivide__and__conquer.html index 34a3944a0..5ca89196d 100644 --- a/dd/dba/namespacedivide__and__conquer.html +++ b/dd/dba/namespacedivide__and__conquer.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: divide_and_conquer Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,24 +90,23 @@ $(document).ready(function(){initNavTree('dd/dba/namespacedivide__and__conquer.h
        -
        -
        divide_and_conquer Namespace Reference
        +
        divide_and_conquer Namespace Reference

        for std::vector More...

        Detailed Description

        -

        for std::vector

        -

        for assert for string for IO operations

        -

        Divide and Conquer algorithms

        +

        for std::vector

        +

        for assert for string for IO operations

        +

        Divide and Conquer algorithms

        diff --git a/dd/ded/fibonacci__matrix__exponentiation_8cpp__incl.svg b/dd/ded/fibonacci__matrix__exponentiation_8cpp__incl.svg index 18f6bc327..b1b96b58b 100644 --- a/dd/ded/fibonacci__matrix__exponentiation_8cpp__incl.svg +++ b/dd/ded/fibonacci__matrix__exponentiation_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,54 +90,53 @@ $(document).ready(function(){initNavTree('d2/d8a/classrange__queries_1_1heavy__l
        -
        -
        range_queries::heavy_light_decomposition::HLD< X > Member List
        +
        range_queries::heavy_light_decomposition::HLD< X > Member List

        This is the complete list of members for range_queries::heavy_light_decomposition::HLD< X >, including all inherited members.

        - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
        add_edge(const int u, const int v)range_queries::heavy_light_decomposition::Tree< X >inline
        chain_query(int a, int b)range_queries::heavy_light_decomposition::HLD< X >inlineprivate
        chain_query(int a, int b)range_queries::heavy_light_decomposition::HLD< X >inlineprivate
        change_root(int new_root)range_queries::heavy_light_decomposition::Tree< X >inline
        combine(X lhs, X rhs)range_queries::heavy_light_decomposition::SG< X >inlineprivate
        combine(X lhs, X rhs)range_queries::heavy_light_decomposition::SG< X >inlineprivate
        dfs_hc(int u, int p=-1)range_queries::heavy_light_decomposition::HLD< X >inlineprivate
        dfs_labels(int u, int p=-1)range_queries::heavy_light_decomposition::HLD< X >inlineprivate
        dfs_labels(int u, int p=-1)range_queries::heavy_light_decomposition::HLD< X >inlineprivate
        dfs_lca(int u, int p=-1)range_queries::heavy_light_decomposition::Tree< X >inlineprivate
        dfs_par(int u, int p=-1)range_queries::heavy_light_decomposition::HLD< X >inlineprivate
        dfs_par(int u, int p=-1)range_queries::heavy_light_decomposition::HLD< X >inlineprivate
        dfs_size(int u, int p=-1)range_queries::heavy_light_decomposition::Tree< X >inlineprivate
        h_heavychlidrange_queries::heavy_light_decomposition::HLD< X >private
        h_heavychlidrange_queries::heavy_light_decomposition::HLD< X >private
        h_labelrange_queries::heavy_light_decomposition::HLD< X >private
        h_parentrange_queries::heavy_light_decomposition::HLD< X >private
        h_parentrange_queries::heavy_light_decomposition::HLD< X >private
        HLD(int nodes)range_queries::heavy_light_decomposition::HLD< X >inlineexplicit
        init()range_queries::heavy_light_decomposition::HLD< X >inline
        init()range_queries::heavy_light_decomposition::HLD< X >inline
        kth_ancestor(int p, const int &dist)range_queries::heavy_light_decomposition::Tree< X >inline
        labelrange_queries::heavy_light_decomposition::HLD< X >private
        labelrange_queries::heavy_light_decomposition::HLD< X >private
        lca(int a, int b)range_queries::heavy_light_decomposition::Tree< X >inline
        lift(int *const p, int dist)range_queries::heavy_light_decomposition::Tree< X >inline
        lift(int *const p, int dist)range_queries::heavy_light_decomposition::Tree< X >inline
        query(int a, int b)range_queries::heavy_light_decomposition::HLD< X >inline
        s_sizerange_queries::heavy_light_decomposition::SG< X >private
        s_sizerange_queries::heavy_light_decomposition::SG< X >private
        s_treerange_queries::heavy_light_decomposition::SG< X >private
        set_node_val(const std::vector< X > &node_val)range_queries::heavy_light_decomposition::Tree< X >inline
        set_node_val(const std::vector< X > &node_val)range_queries::heavy_light_decomposition::Tree< X >inline
        set_sret_init(X new_sret_init)range_queries::heavy_light_decomposition::SG< X >inlineprivate
        SG(int size)range_queries::heavy_light_decomposition::SG< X >inlineexplicitprivate
        SG(int size)range_queries::heavy_light_decomposition::SG< X >inlineexplicitprivate
        sret_initrange_queries::heavy_light_decomposition::SG< X >private
        t_adjrange_queries::heavy_light_decomposition::Tree< X >private
        t_adjrange_queries::heavy_light_decomposition::Tree< X >private
        t_depthrange_queries::heavy_light_decomposition::Tree< X >private
        t_maxliftrange_queries::heavy_light_decomposition::Tree< X >private
        t_maxliftrange_queries::heavy_light_decomposition::Tree< X >private
        t_nodesrange_queries::heavy_light_decomposition::Tree< X >private
        t_parrange_queries::heavy_light_decomposition::Tree< X >private
        t_parrange_queries::heavy_light_decomposition::Tree< X >private
        t_rootrange_queries::heavy_light_decomposition::Tree< X >private
        t_sizerange_queries::heavy_light_decomposition::Tree< X >private
        t_sizerange_queries::heavy_light_decomposition::Tree< X >private
        t_valrange_queries::heavy_light_decomposition::Tree< X >private
        Tree(int nodes)range_queries::heavy_light_decomposition::Tree< X >inlineexplicit
        Tree(int nodes)range_queries::heavy_light_decomposition::Tree< X >inlineexplicit
        update(int node, X val)range_queries::heavy_light_decomposition::HLD< X >inline
        diff --git a/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html b/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html index 42ce4c17a..80050f33d 100644 --- a/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html +++ b/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: graph::is_graph_bipartite::Graph Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -94,21 +94,14 @@ $(document).ready(function(){initNavTree('de/d00/classgraph_1_1is__graph__bipart Public Member Functions | Private Attributes | List of all members -
        -
        graph::is_graph_bipartite::Graph Class Reference
        +
        graph::is_graph_bipartite::Graph Class Reference

        Class for representing graph as an adjacency list. More...

        -
        -Collaboration diagram for graph::is_graph_bipartite::Graph:
        -
        -
        -
        -
        [legend]
        - @@ -120,25 +113,25 @@ Public Member Functions

        +

        Public Member Functions

         Graph (int size)
         Constructor that initializes the graph on creation. More...
         function to add edges to our graph More...
         
        - - + - + - +

        +

        Private Attributes

        -int n
        +int n
         size of the graph
         
        -std::vector< std::vector< int > > adj
        +std::vector< std::vector< int > > adj
         adj stores the graph as an adjacency list
         
        -std::vector< int > side
        +std::vector< int > side
         stores the side of the vertex
         

        Detailed Description

        -

        Class for representing graph as an adjacency list.

        +

        Class for representing graph as an adjacency list.

        Constructor & Destructor Documentation

        - +

        ◆ Graph()

        @@ -169,20 +162,19 @@ int 
        65  {
        -
        66  n = size;
        -
        67  adj.resize(n);
        -
        68  side.resize(n, -1);
        -
        69  }
        +
        65 {
        +
        66 n = size;
        +
        67 adj.resize(n);
        +
        68 side.resize(n, -1);
        +
        69 }
        std::vector< int > side
        stores the side of the vertex
        Definition: is_graph_bipartite.cpp:58
        std::vector< std::vector< int > > adj
        adj stores the graph as an adjacency list
        Definition: is_graph_bipartite.cpp:56
        int n
        size of the graph
        Definition: is_graph_bipartite.cpp:53
        -
        T resize(T... args)

        Member Function Documentation

        - +

        ◆ addEdge()

        @@ -216,21 +208,14 @@ int 
        83  {
        -
        84  adj[u - 1].push_back(v - 1);
        -
        85  adj[v - 1].push_back(u - 1);
        -
        86 }
        -
        T push_back(T... args)
        -
        -Here is the call graph for this function:
        -
        -
        +
        83 {
        +
        84 adj[u - 1].push_back(v - 1);
        +
        85 adj[v - 1].push_back(u - 1);
        +
        86}
        +
        - -
        - - +

        ◆ is_bipartite()

        @@ -246,34 +231,34 @@ Here is the call graph for this function:

        function to add edges to our graph

        -

        function that checks whether the graph is bipartite or not the function returns true if the graph is a bipartite graph the function returns false if the graph is not a bipartite graph

        -

        Here, side refers to the two disjoint subsets of the bipartite graph. Initially, the values of side are set to -1 which is an unassigned state. A for loop is run for every vertex of the graph. If the current edge has no side assigned to it, then a Breadth First Search operation is performed. If two neighbours have the same side then the graph will not be bipartite and the value of check becomes false. If and only if each pair of neighbours have different sides, the value of check will be true and hence the graph bipartite.

        +

        function that checks whether the graph is bipartite or not the function returns true if the graph is a bipartite graph the function returns false if the graph is not a bipartite graph

        +

        Here, side refers to the two disjoint subsets of the bipartite graph. Initially, the values of side are set to -1 which is an unassigned state. A for loop is run for every vertex of the graph. If the current edge has no side assigned to it, then a Breadth First Search operation is performed. If two neighbours have the same side then the graph will not be bipartite and the value of check becomes false. If and only if each pair of neighbours have different sides, the value of check will be true and hence the graph bipartite.

        Returns
        true if th graph is bipartite
        false otherwise
        -
        106  {
        -
        107  bool check = true;
        -
        108  std::queue<int> q;
        -
        109  for (int current_edge = 0; current_edge < n; ++current_edge) {
        -
        110  if (side[current_edge] == -1) {
        -
        111  q.push(current_edge);
        -
        112  side[current_edge] = 0;
        -
        113  while (q.size()) {
        -
        114  int current = q.front();
        -
        115  q.pop();
        -
        116  for (auto neighbour : adj[current]) {
        -
        117  if (side[neighbour] == -1) {
        -
        118  side[neighbour] = (1 ^ side[current]);
        -
        119  q.push(neighbour);
        -
        120  } else {
        -
        121  check &= (side[neighbour] != side[current]);
        -
        122  }
        -
        123  }
        -
        124  }
        -
        125  }
        -
        126  }
        -
        127  return check;
        -
        128 }
        +
        106 {
        +
        107 bool check = true;
        + +
        109 for (int current_edge = 0; current_edge < n; ++current_edge) {
        +
        110 if (side[current_edge] == -1) {
        +
        111 q.push(current_edge);
        +
        112 side[current_edge] = 0;
        +
        113 while (q.size()) {
        +
        114 int current = q.front();
        +
        115 q.pop();
        +
        116 for (auto neighbour : adj[current]) {
        +
        117 if (side[neighbour] == -1) {
        +
        118 side[neighbour] = (1 ^ side[current]);
        +
        119 q.push(neighbour);
        +
        120 } else {
        +
        121 check &= (side[neighbour] != side[current]);
        +
        122 }
        +
        123 }
        +
        124 }
        +
        125 }
        +
        126 }
        +
        127 return check;
        +
        128}
        bool check(const std::string &s, const std::unordered_set< std::string > &strSet, int pos, std::vector< int > *dp)
        Function that checks if the string passed in param can be segmented from position 'pos',...
        Definition: word_break.cpp:80
        @@ -288,7 +273,7 @@ Here is the call graph for this function:
        diff --git a/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.map b/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.map deleted file mode 100644 index 6fab3ba00..000000000 --- a/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.md5 b/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.md5 deleted file mode 100644 index 43c59c05f..000000000 --- a/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -1d4c77e8b001dd4fa41ca0c561614ebc \ No newline at end of file diff --git a/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.svg b/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.svg deleted file mode 100644 index d446673f9..000000000 --- a/de/d00/classgraph_1_1is__graph__bipartite_1_1_graph_ad8c10df34357b2cd865c81e0c4f0bd8c_cgraph.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - -graph::is_graph_bipartite::Graph::addEdge - - - -Node1 - - -graph::is_graph_bipartite -::Graph::addEdge - - - - - -Node2 - - -std::vector::push_back - - - - - -Node1->Node2 - - - - - diff --git a/de/d02/knight__tour_8cpp__incl.svg b/de/d02/knight__tour_8cpp__incl.svg index 102db1ba7..f8665f6f5 100644 --- a/de/d02/knight__tour_8cpp__incl.svg +++ b/de/d02/knight__tour_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: sorting/cycle_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('de/d07/cycle__sort_8cpp.html','../../' -
        -
        cycle_sort.cpp File Reference
        +
        cycle_sort.cpp File Reference
        -

        Implementation of Cycle sort algorithm. +

        Implementation of Cycle sort algorithm. More...

        #include <algorithm>
        #include <cassert>
        @@ -111,21 +110,21 @@ Include dependency graph for cycle_sort.cpp:
        - - + - - + +

        +

        Namespaces

         sorting
        namespace  sorting
         Sorting algorithms.
         
         cycle_sort
         Functions for Cycle sort algorithm.
        namespace  cycle_sort
         Functions for Cycle sort algorithm.
         
        - - - - - + + + + @@ -134,11 +133,11 @@ Functions

        +

        Functions

        template<typename T >
        std::vector< T > sorting::cycle_sort::cycleSort (const std::vector< T > &in_arr)
         The main function implements cycleSort. More...
         
        template<typename T >
        std::vector< T > sorting::cycle_sort::cycleSort (const std::vector< T > &in_arr)
         The main function implements cycleSort. More...
         
        static void test ()
         Test implementations. More...
         
         

        Detailed Description

        -

        Implementation of Cycle sort algorithm.

        -

        Cycle Sort is a sorting algorithm that works in \(O(n^2)\) time in the best case and works in \(O(n^2)\) in worst case. If a element is already at its correct position, do nothing. If a element is not at its correct position, we then need to move it to its correct position by computing the correct positions.Therefore, we should make sure the duplicate elements.

        Author
        TsungHan Ho
        +

        Implementation of Cycle sort algorithm.

        +

        Cycle Sort is a sorting algorithm that works in \(O(n^2)\) time in the best case and works in \(O(n^2)\) in worst case. If a element is already at its correct position, do nothing. If a element is not at its correct position, we then need to move it to its correct position by computing the correct positions.Therefore, we should make sure the duplicate elements.

        Author
        TsungHan Ho

        Function Documentation

        - -

        ◆ cycleSort()

        + +

        ◆ cycleSort()

        @@ -146,7 +145,7 @@ Functions template<typename T >
        - + @@ -169,65 +168,65 @@ template<typename T >
        Returns
        void
        -
        37  {
        -
        38  std::vector<T> arr(in_arr);
        -
        39  for (int cycle_start = 0; cycle_start <= arr.size() - 1; cycle_start++) {
        -
        40  // initialize item
        -
        41  T item = arr[cycle_start];
        -
        42 
        -
        43  // Count the number of elements smaller than item, this number is the
        -
        44  // correct index of item.
        -
        45  int pos = cycle_start;
        -
        46  for (int i = cycle_start + 1; i < arr.size(); i++) {
        -
        47  if (arr[i] < item) {
        -
        48  pos++;
        -
        49  }
        -
        50  }
        -
        51 
        -
        52  // item is already in correct position
        -
        53  if (pos == cycle_start) {
        -
        54  continue;
        -
        55  }
        -
        56 
        -
        57  // duplicate elements
        -
        58  while (item == arr[pos]) pos += 1;
        -
        59  if (pos == cycle_start) {
        -
        60  continue;
        -
        61  } else {
        -
        62  std::swap(item, arr[pos]);
        -
        63  }
        -
        64  // Rest of the elements
        -
        65  while (pos != cycle_start) {
        -
        66  pos = cycle_start;
        -
        67  // Find position where we put the element
        -
        68  for (size_t i = cycle_start + 1; i < arr.size(); i++) {
        -
        69  if (arr[i] < item) {
        -
        70  pos += 1;
        -
        71  }
        -
        72  }
        -
        73  // duplicate elements
        -
        74  while (item == arr[pos]) pos += 1;
        -
        75  if (item == arr[pos]) {
        -
        76  continue;
        -
        77  } else {
        -
        78  std::swap(item, arr[pos]);
        -
        79  }
        -
        80  }
        -
        81  }
        -
        82  return arr;
        -
        83 }
        +
        37 {
        +
        38 std::vector<T> arr(in_arr);
        +
        39 for (int cycle_start = 0; cycle_start <= arr.size() - 1; cycle_start++) {
        +
        40 // initialize item
        +
        41 T item = arr[cycle_start];
        +
        42
        +
        43 // Count the number of elements smaller than item, this number is the
        +
        44 // correct index of item.
        +
        45 int pos = cycle_start;
        +
        46 for (int i = cycle_start + 1; i < arr.size(); i++) {
        +
        47 if (arr[i] < item) {
        +
        48 pos++;
        +
        49 }
        +
        50 }
        +
        51
        +
        52 // item is already in correct position
        +
        53 if (pos == cycle_start) {
        +
        54 continue;
        +
        55 }
        +
        56
        +
        57 // duplicate elements
        +
        58 while (item == arr[pos]) pos += 1;
        +
        59 if (pos == cycle_start) {
        +
        60 continue;
        +
        61 } else {
        +
        62 std::swap(item, arr[pos]);
        +
        63 }
        +
        64 // Rest of the elements
        +
        65 while (pos != cycle_start) {
        +
        66 pos = cycle_start;
        +
        67 // Find position where we put the element
        +
        68 for (size_t i = cycle_start + 1; i < arr.size(); i++) {
        +
        69 if (arr[i] < item) {
        +
        70 pos += 1;
        +
        71 }
        +
        72 }
        +
        73 // duplicate elements
        +
        74 while (item == arr[pos]) pos += 1;
        +
        75 if (item == arr[pos]) {
        +
        76 continue;
        +
        77 } else {
        +
        78 std::swap(item, arr[pos]);
        +
        79 }
        +
        80 }
        +
        81 }
        +
        82 return arr;
        +
        83}
        T swap(T... args)
        Here is the call graph for this function:
        -
        +
        - +

        ◆ main()

        @@ -245,10 +244,10 @@ Here is the call graph for this function:

        Main function.

        Returns
        0 on exit
        -
        127  {
        -
        128  test(); // execute the test
        -
        129  return 0;
        -
        130 }
        +
        127 {
        +
        128 test(); // execute the test
        +
        129 return 0;
        +
        130}
        static void test()
        Test implementations.
        Definition: cycle_sort.cpp:91
        Here is the call graph for this function:
        @@ -259,7 +258,7 @@ Here is the call graph for this function:
        - +

        ◆ test()

        @@ -284,40 +283,40 @@ Here is the call graph for this function:

        Test implementations.

        Returns
        void
        -
        91  {
        -
        92  // Test 1
        -
        93  // [4, 3, 2, 1] return [1, 2, 3, 4]
        -
        94  std::vector<uint32_t> array1 = {4, 3, 2, 1};
        -
        95  std::cout << "Test 1... ";
        - -
        97  assert(std::is_sorted(std::begin(arr1), std::end(arr1)));
        -
        98  std::cout << "passed" << std::endl;
        -
        99 
        -
        100  // [4.3, -6.5, -7.4, 0, 2.7, 1.8] return [-7.4, -6.5, 0, 1.8, 2.7, 4.3]
        -
        101  std::vector<double> array2 = {4.3, -6.5, -7.4, 0, 2.7, 1.8};
        -
        102  std::cout << "Test 2... ";
        - -
        104  assert(std::is_sorted(std::begin(arr2), std::end(arr2)));
        -
        105  std::cout << "passed" << std::endl;
        -
        106 
        -
        107  // Test 3
        -
        108  // [3, 3, 3, 3] return [3, 3, 3, 3]
        -
        109  std::vector<uint32_t> array3 = {3, 3, 3, 3};
        -
        110  std::cout << "Test 3... ";
        - -
        112  assert(std::is_sorted(std::begin(arr3), std::end(arr3)));
        -
        113  std::cout << "passed" << std::endl;
        -
        114 
        -
        115  // [9, 4, 6, 8, 14, 3] return [9, 4, 6, 8, 14, 3]
        -
        116  std::vector<uint32_t> array4 = {3, 4, 6, 8, 9, 14};
        -
        117  std::cout << "Test 4... ";
        - -
        119  assert(std::is_sorted(std::begin(arr4), std::end(arr4)));
        -
        120  std::cout << "passed" << std::endl;
        -
        121 }
        +
        91 {
        +
        92 // Test 1
        +
        93 // [4, 3, 2, 1] return [1, 2, 3, 4]
        +
        94 std::vector<uint32_t> array1 = {4, 3, 2, 1};
        +
        95 std::cout << "Test 1... ";
        + +
        97 assert(std::is_sorted(std::begin(arr1), std::end(arr1)));
        +
        98 std::cout << "passed" << std::endl;
        +
        99
        +
        100 // [4.3, -6.5, -7.4, 0, 2.7, 1.8] return [-7.4, -6.5, 0, 1.8, 2.7, 4.3]
        +
        101 std::vector<double> array2 = {4.3, -6.5, -7.4, 0, 2.7, 1.8};
        +
        102 std::cout << "Test 2... ";
        + +
        104 assert(std::is_sorted(std::begin(arr2), std::end(arr2)));
        +
        105 std::cout << "passed" << std::endl;
        +
        106
        +
        107 // Test 3
        +
        108 // [3, 3, 3, 3] return [3, 3, 3, 3]
        +
        109 std::vector<uint32_t> array3 = {3, 3, 3, 3};
        +
        110 std::cout << "Test 3... ";
        + +
        112 assert(std::is_sorted(std::begin(arr3), std::end(arr3)));
        +
        113 std::cout << "passed" << std::endl;
        +
        114
        +
        115 // [9, 4, 6, 8, 14, 3] return [9, 4, 6, 8, 14, 3]
        +
        116 std::vector<uint32_t> array4 = {3, 4, 6, 8, 9, 14};
        +
        117 std::cout << "Test 4... ";
        + +
        119 assert(std::is_sorted(std::begin(arr4), std::end(arr4)));
        +
        120 std::cout << "passed" << std::endl;
        +
        121}
        T begin(T... args)
        -
        std::vector< T > cycleSort(const std::vector< T > &in_arr)
        The main function implements cycleSort.
        Definition: cycle_sort.cpp:37
        +
        std::vector< T > cycleSort(const std::vector< T > &in_arr)
        The main function implements cycleSort.
        Definition: cycle_sort.cpp:37
        T end(T... args)
        T endl(T... args)
        T is_sorted(T... args)
        @@ -336,7 +335,7 @@ Here is the call graph for this function:
        diff --git a/de/d07/cycle__sort_8cpp.js b/de/d07/cycle__sort_8cpp.js index 2e9fff939..3e23de3a1 100644 --- a/de/d07/cycle__sort_8cpp.js +++ b/de/d07/cycle__sort_8cpp.js @@ -1,6 +1,6 @@ var cycle__sort_8cpp = [ - [ "cycleSort", "de/d07/cycle__sort_8cpp.html#ad0cfe2e54b1d3f9d0ca648265d917c6a", null ], + [ "cycleSort", "de/d07/cycle__sort_8cpp.html#ae79a9d247691fce0d655fce75f1c04fa", null ], [ "main", "de/d07/cycle__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "test", "de/d07/cycle__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] ]; \ No newline at end of file diff --git a/de/d07/cycle__sort_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/de/d07/cycle__sort_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 3c7a075fb..e8046f82a 100644 --- a/de/d07/cycle__sort_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/de/d07/cycle__sort_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: merge_insertion Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
        @@ -42,21 +41,22 @@
        std::vector<T> sorting::cycle_sort::cycleSort std::vector< T > sorting::cycle_sort::cycleSort ( const std::vector< T > &  in_arr)
        -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('de/d0a/namespacemerge__insertion.html'
        -
        -
        merge_insertion Namespace Reference
        +
        merge_insertion Namespace Reference

        Combined Intersion-Merge sorting algorithm. More...

        Detailed Description

        -

        Combined Intersion-Merge sorting algorithm.

        +

        Combined Intersion-Merge sorting algorithm.

        diff --git a/de/d0d/fibonacci__search_8cpp.html b/de/d0d/fibonacci__search_8cpp.html index e6d629882..67239f2f0 100644 --- a/de/d0d/fibonacci__search_8cpp.html +++ b/de/d0d/fibonacci__search_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: search/fibonacci_search.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,12 +92,11 @@ $(document).ready(function(){initNavTree('de/d0d/fibonacci__search_8cpp.html','.
        -
        -
        fibonacci_search.cpp File Reference
        +
        fibonacci_search.cpp File Reference
        -

        Fibonacci search algorithm +

        Fibonacci search algorithm More...

        #include <iostream>
        #include <vector>
        @@ -111,27 +110,25 @@ Include dependency graph for fibonacci_search.cpp:
        - - - + + - - + +

        +

        Functions

        int fibonacci_search (const std::vector< int > &arr, int value)
         using fibonacci search algorithm finds an index of a given element in a sorted array More...
         
        -bool no_occurence_tests ()
         random tests for checking performance when an array doesn't contain an element
        bool no_occurence_tests ()
         random tests for checking performance when an array doesn't contain an element More...
         
        -bool random_tests ()
         random tests which cover cases when we have one, multiple or zero occurences of the value we're looking for
        bool random_tests ()
         random tests which cover cases when we have one, multiple or zero occurences of the value we're looking for More...
         
        int main ()
         

        Detailed Description

        -

        Fibonacci search algorithm

        +

        Function Documentation

        - +

        ◆ fibonacci_search()

        @@ -166,51 +163,51 @@ bool 
        Returns
        if the array contains the value, returns an index of the element. otherwise -1.
        -
        23  {
        -
        24  // initialize last and current members of Fibonacci sequence
        -
        25  int last = 0, current = 1;
        -
        26  int length = arr.size(); // array size
        -
        27  // next member of Fibonacci sequence which is "last" + "current"
        -
        28  int next = last + current;
        -
        29 
        -
        30  // "next" will store the smallest Fibonacci number greater or equal to "length"
        -
        31  while(next < length){
        -
        32  last = current;
        -
        33  current = next;
        -
        34  next = last + current;
        -
        35  }
        -
        36 
        -
        37  // "offset" is the end of eliminated range from front
        -
        38  int offset = -1, index;
        -
        39  // while loop until there are elements left to consider.
        -
        40  // when "next" becomes 1, last is equal to 0, so search is done,
        -
        41  // because arr[offset] will already be eliminated
        -
        42  while(next > 1){
        -
        43  // check if "last" is valid location
        -
        44  index = std::min(offset + last, length-1);
        -
        45  // if value is greater than the value at "index", eliminate the subarray from offset to index
        -
        46  if(arr[index] < value){
        -
        47  next = current;
        -
        48  current = last;
        -
        49  last = next - current;
        -
        50  offset = index;
        -
        51  // if value is less than the value at "index", eliminate the subarray after index+1
        -
        52  } else if(arr[index] > value){
        -
        53  next = last;
        -
        54  current = current - last;
        -
        55  last = next - current;
        -
        56  // element is found
        -
        57  } else {
        -
        58  return index;
        -
        59  }
        -
        60  }
        -
        61  // comparing the last element
        -
        62  if(current && !arr.empty() && arr[offset+1] == value){
        -
        63  return offset+1;
        -
        64  }
        -
        65  // value was not found, return -1
        -
        66  return -1;
        -
        67 }
        +
        23 {
        +
        24 // initialize last and current members of Fibonacci sequence
        +
        25 int last = 0, current = 1;
        +
        26 int length = arr.size(); // array size
        +
        27 // next member of Fibonacci sequence which is "last" + "current"
        +
        28 int next = last + current;
        +
        29
        +
        30 // "next" will store the smallest Fibonacci number greater or equal to "length"
        +
        31 while(next < length){
        +
        32 last = current;
        +
        33 current = next;
        +
        34 next = last + current;
        +
        35 }
        +
        36
        +
        37 // "offset" is the end of eliminated range from front
        +
        38 int offset = -1, index;
        +
        39 // while loop until there are elements left to consider.
        +
        40 // when "next" becomes 1, last is equal to 0, so search is done,
        +
        41 // because arr[offset] will already be eliminated
        +
        42 while(next > 1){
        +
        43 // check if "last" is valid location
        +
        44 index = std::min(offset + last, length-1);
        +
        45 // if value is greater than the value at "index", eliminate the subarray from offset to index
        +
        46 if(arr[index] < value){
        +
        47 next = current;
        +
        48 current = last;
        +
        49 last = next - current;
        +
        50 offset = index;
        +
        51 // if value is less than the value at "index", eliminate the subarray after index+1
        +
        52 } else if(arr[index] > value){
        +
        53 next = last;
        +
        54 current = current - last;
        +
        55 last = next - current;
        +
        56 // element is found
        +
        57 } else {
        +
        58 return index;
        +
        59 }
        +
        60 }
        +
        61 // comparing the last element
        +
        62 if(current && !arr.empty() && arr[offset+1] == value){
        +
        63 return offset+1;
        +
        64 }
        +
        65 // value was not found, return -1
        +
        66 return -1;
        +
        67}
        T empty(T... args)
        T min(T... args)
        T next(T... args)
        @@ -224,7 +221,7 @@ Here is the call graph for this function:
        - +

        ◆ main()

        @@ -239,12 +236,12 @@ Here is the call graph for this function:
        -

        Main Function testing the algorithm

        -
        123  {
        -
        124  assert(no_occurence_tests());
        -
        125  assert(random_tests());
        -
        126  return 0;
        -
        127 }
        +

        Main Function testing the algorithm

        +
        123 {
        +
        124 assert(no_occurence_tests());
        +
        125 assert(random_tests());
        +
        126 return 0;
        +
        127}
        bool random_tests()
        random tests which cover cases when we have one, multiple or zero occurences of the value we're looki...
        Definition: fibonacci_search.cpp:96
        bool no_occurence_tests()
        random tests for checking performance when an array doesn't contain an element
        Definition: fibonacci_search.cpp:72
        @@ -254,6 +251,108 @@ Here is the call graph for this function:
        + + + +

        ◆ no_occurence_tests()

        + +
        +
        + + + + + + + +
        bool no_occurence_tests ()
        +
        + +

        random tests for checking performance when an array doesn't contain an element

        +
        72 {
        +
        73 bool passed = true;
        +
        74 int rand_num, rand_value, index, num_tests = 1000;
        + +
        76 while(num_tests--){
        +
        77 arr.clear();
        +
        78 for(int i = 0; i < 100; i++){
        +
        79 rand_num = std::rand() % 1000;
        +
        80 arr.push_back(rand_num);
        +
        81 }
        +
        82 rand_value = std::rand() % 1000;
        +
        83 while(std::find(arr.begin(), arr.end(), rand_value) != arr.end()){
        +
        84 std::remove(arr.begin(), arr.end(), rand_value);
        +
        85 }
        +
        86 sort(arr.begin(), arr.end());
        +
        87 index = fibonacci_search(arr, rand_value);
        +
        88 passed = passed && (index == -1);
        +
        89 }
        +
        90 return passed;
        +
        91}
        +
        T begin(T... args)
        +
        T clear(T... args)
        +
        T end(T... args)
        +
        int fibonacci_search(const std::vector< int > &arr, int value)
        using fibonacci search algorithm finds an index of a given element in a sorted array
        Definition: fibonacci_search.cpp:23
        +
        T find(T... args)
        +
        T push_back(T... args)
        +
        T rand(T... args)
        +
        T remove(T... args)
        +
        T sort(T... args)
        + +
        +Here is the call graph for this function:
        +
        +
        +
        +
        + +
        +
        + +

        ◆ random_tests()

        + +
        +
        + + + + + + + +
        bool random_tests ()
        +
        + +

        random tests which cover cases when we have one, multiple or zero occurences of the value we're looking for

        +
        96 {
        +
        97 bool passed = true;
        +
        98 int rand_num, rand_value, index, real_value, num_tests = 10000;
        + +
        100 while(num_tests--){
        +
        101 arr.clear();
        +
        102 for(int i = 0; i < 100; i++){
        +
        103 rand_num = std::rand() % 1000;
        +
        104 arr.push_back(rand_num);
        +
        105 }
        +
        106 rand_value = std::rand() % 1000;
        +
        107 std::sort(arr.begin(), arr.end());
        +
        108 index = fibonacci_search(arr, rand_value);
        +
        109 if(index != -1){
        +
        110 real_value = arr[index];
        +
        111 passed = passed && (real_value == rand_value);
        +
        112 } else {
        +
        113 passed = passed && (std::find(arr.begin(), arr.end(), rand_value) == arr.end());
        +
        114 }
        +
        115 }
        +
        116 return passed;
        +
        117}
        +
        +Here is the call graph for this function:
        +
        +
        +
        +
        +
        @@ -262,7 +361,7 @@ Here is the call graph for this function: diff --git a/de/d0d/fibonacci__search_8cpp_a0bc61b3903d9a53061bf31e5d110fe61_cgraph.svg b/de/d0d/fibonacci__search_8cpp_a0bc61b3903d9a53061bf31e5d110fe61_cgraph.svg index e837f7a33..f8f4377ab 100644 --- a/de/d0d/fibonacci__search_8cpp_a0bc61b3903d9a53061bf31e5d110fe61_cgraph.svg +++ b/de/d0d/fibonacci__search_8cpp_a0bc61b3903d9a53061bf31e5d110fe61_cgraph.svg @@ -1,7 +1,7 @@ - + + + + + + + + + + + + + diff --git a/de/d0d/fibonacci__search_8cpp_a2aa09bef74ee063c1331de0883af4f4f_cgraph.md5 b/de/d0d/fibonacci__search_8cpp_a2aa09bef74ee063c1331de0883af4f4f_cgraph.md5 new file mode 100644 index 000000000..57ba59ea4 --- /dev/null +++ b/de/d0d/fibonacci__search_8cpp_a2aa09bef74ee063c1331de0883af4f4f_cgraph.md5 @@ -0,0 +1 @@ +090020658332cc4ae4bf1c5a1195a05e \ No newline at end of file diff --git a/de/d0d/fibonacci__search_8cpp_a2aa09bef74ee063c1331de0883af4f4f_cgraph.svg b/de/d0d/fibonacci__search_8cpp_a2aa09bef74ee063c1331de0883af4f4f_cgraph.svg new file mode 100644 index 000000000..02096c3cb --- /dev/null +++ b/de/d0d/fibonacci__search_8cpp_a2aa09bef74ee063c1331de0883af4f4f_cgraph.svg @@ -0,0 +1,187 @@ + + + + + + +random_tests + + + +Node1 + + +random_tests + + + + + +Node2 + + +std::vector::begin + + + + + +Node1->Node2 + + + + + +Node3 + + +std::vector::clear + + + + + +Node1->Node3 + + + + + +Node4 + + +std::vector::end + + + + + +Node1->Node4 + + + + + +Node5 + + +fibonacci_search + + + + + +Node1->Node5 + + + + + +Node9 + + +std::find + + + + + +Node1->Node9 + + + + + +Node10 + + +std::vector::push_back + + + + + +Node1->Node10 + + + + + +Node11 + + +std::rand + + + + + +Node1->Node11 + + + + + +Node12 + + +std::sort + + + + + +Node1->Node12 + + + + + +Node6 + + +std::vector::empty + + + + + +Node5->Node6 + + + + + +Node7 + + +std::min + + + + + +Node5->Node7 + + + + + +Node8 + + +std::vector::size + + + + + +Node5->Node8 + + + + + diff --git a/de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.map b/de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.map new file mode 100644 index 000000000..f84afde1e --- /dev/null +++ b/de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.map @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.md5 b/de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.md5 new file mode 100644 index 000000000..cd3a05dde --- /dev/null +++ b/de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.md5 @@ -0,0 +1 @@ +a2d632cc9344efe20fc17531568a90c0 \ No newline at end of file diff --git a/de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.svg b/de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.svg new file mode 100644 index 000000000..80b105a8a --- /dev/null +++ b/de/d0d/fibonacci__search_8cpp_a5e144326104e57a3808aed7eb098db0d_cgraph.svg @@ -0,0 +1,187 @@ + + + + + + +no_occurence_tests + + + +Node1 + + +no_occurence_tests + + + + + +Node2 + + +std::vector::begin + + + + + +Node1->Node2 + + + + + +Node3 + + +std::vector::clear + + + + + +Node1->Node3 + + + + + +Node4 + + +std::vector::end + + + + + +Node1->Node4 + + + + + +Node5 + + +fibonacci_search + + + + + +Node1->Node5 + + + + + +Node9 + + +std::find + + + + + +Node1->Node9 + + + + + +Node10 + + +std::vector::push_back + + + + + +Node1->Node10 + + + + + +Node11 + + +std::rand + + + + + +Node1->Node11 + + + + + +Node12 + + +std::remove + + + + + +Node1->Node12 + + + + + +Node6 + + +std::vector::empty + + + + + +Node5->Node6 + + + + + +Node7 + + +std::min + + + + + +Node5->Node7 + + + + + +Node8 + + +std::vector::size + + + + + +Node5->Node8 + + + + + diff --git a/de/d0d/fibonacci__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/de/d0d/fibonacci__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 39541adc5..63bc80534 100644 --- a/de/d0d/fibonacci__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/de/d0d/fibonacci__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,25 +90,24 @@ $(document).ready(function(){initNavTree('d6/dc1/classmath_1_1ncr__modulo__p_1_1
        -
        -
        math::ncr_modulo_p::NCRModuloP Member List
        +
        math::ncr_modulo_p::NCRModuloP Member List

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

        - + - + - +
        fac (defined in math::ncr_modulo_p::NCRModuloP)math::ncr_modulo_p::NCRModuloPprivate
        gcdExtended(const uint64_t &a, const uint64_t &b, int64_t *x, int64_t *y)math::ncr_modulo_p::NCRModuloPinline
        gcdExtended(const uint64_t &a, const uint64_t &b, int64_t *x, int64_t *y)math::ncr_modulo_p::NCRModuloPinline
        modInverse(const uint64_t &a, const uint64_t &m)math::ncr_modulo_p::NCRModuloPinline
        ncr(const uint64_t &n, const uint64_t &r, const uint64_t &p)math::ncr_modulo_p::NCRModuloPinline
        ncr(const uint64_t &n, const uint64_t &r, const uint64_t &p)math::ncr_modulo_p::NCRModuloPinline
        NCRModuloP(const uint64_t &size, const uint64_t &mod)math::ncr_modulo_p::NCRModuloPinline
        pmath::ncr_modulo_p::NCRModuloPprivate
        pmath::ncr_modulo_p::NCRModuloPprivate
        diff --git a/de/d23/disjoint__set_8cpp.html b/de/d23/disjoint__set_8cpp.html index b12566536..08703755b 100644 --- a/de/d23/disjoint__set_8cpp.html +++ b/de/d23/disjoint__set_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: data_structures/disjoint_set.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('de/d23/disjoint__set_8cpp.html','../.. -
        -
        disjoint_set.cpp File Reference
        +
        disjoint_set.cpp File Reference
        -

        Disjoint Sets Data Structure (Disjoint Sets) +

        Disjoint Sets Data Structure (Disjoint Sets) More...

        #include <iostream>
        #include <vector>
        @@ -109,7 +108,7 @@ Include dependency graph for disjoint_set.cpp:
        - @@ -122,21 +121,21 @@ Functions

        +

        Functions

        void CreateSet (int n)
         
        int main ()
         
        - - -

        +

        Variables

        +
        vector< int > root
         
        +
        vector< int > rank
         

        Detailed Description

        -

        Disjoint Sets Data Structure (Disjoint Sets)

        -
        Author
        leoyang429
        +

        Disjoint Sets Data Structure (Disjoint Sets)

        +
        Author
        leoyang429

        A disjoint set data structure (also called union find or merge find set) is a data structure that tracks a set of elements partitioned into a number of disjoint (non-overlapping) subsets. Some situations where disjoint sets can be used are- to find connected components of a graph, kruskal's algorithm for finding Minimum Spanning Tree etc. There are two operation which we perform on disjoint sets - 1) Union 2) Find

        Function Documentation

        - +

        ◆ CreateSet()

        @@ -151,24 +150,24 @@ Variables
        -

        Function to create a set

        Parameters
        +

        Function to create a set

        Parameters
        nnumber of element
        -
        37  {
        -
        38  root = vector<int>(n + 1);
        -
        39  rank = vector<int>(n + 1, 1);
        -
        40  for (int i = 1; i <= n; ++i) {
        -
        41  root[i] = i;
        -
        42  }
        -
        43 }
        +
        37 {
        +
        38 root = vector<int>(n + 1);
        +
        39 rank = vector<int>(n + 1, 1);
        +
        40 for (int i = 1; i <= n; ++i) {
        +
        41 root[i] = i;
        +
        42 }
        +
        43}
        - +

        ◆ Find()

        @@ -183,24 +182,24 @@ Variables
        -

        Find operation takes a number x and returns the set to which this number belongs to.

        Parameters
        +

        Find operation takes a number x and returns the set to which this number belongs to.

        Parameters
        xelement of some set
        Returns
        set to which x belongs to
        -
        53  {
        -
        54  if (root[x] == x) {
        -
        55  return x;
        -
        56  }
        -
        57  return root[x] = Find(root[x]);
        -
        58 }
        +
        53 {
        +
        54 if (root[x] == x) {
        +
        55 return x;
        +
        56 }
        +
        57 return root[x] = Find(root[x]);
        +
        58}
        int Find(int x)
        Definition: disjoint_set.cpp:53
        - +

        ◆ InSameUnion()

        @@ -225,14 +224,14 @@ Variables
        -

        A utility function to check if x and y are from same set or not

        Parameters
        +

        A utility function to check if x and y are from same set or not

        Parameters
        xelement of some set
        yelement of some set
        -
        67 { return Find(x) == Find(y); }
        +
        67{ return Find(x) == Find(y); }
        Here is the call graph for this function:
        @@ -242,7 +241,7 @@ Here is the call graph for this function:
        - +

        ◆ main()

        @@ -257,29 +256,29 @@ Here is the call graph for this function:
        -

        Main function

        -
        93  {
        -
        94  // tests CreateSet & Find
        -
        95  int n = 100;
        -
        96  CreateSet(n);
        -
        97  for (int i = 1; i <= 100; ++i) {
        -
        98  if (root[i] != i) {
        -
        99  cout << "Fail" << endl;
        -
        100  break;
        -
        101  }
        -
        102  }
        -
        103  // tests InSameUnion & Union
        -
        104  cout << "1 and 2 are initially not in the same subset" << endl;
        -
        105  if (InSameUnion(1, 2)) {
        -
        106  cout << "Fail" << endl;
        -
        107  }
        -
        108  Union(1, 2);
        -
        109  cout << "1 and 2 are now in the same subset" << endl;
        -
        110  if (!InSameUnion(1, 2)) {
        -
        111  cout << "Fail" << endl;
        -
        112  }
        -
        113  return 0;
        -
        114 }
        +

        Main function

        +
        93 {
        +
        94 // tests CreateSet & Find
        +
        95 int n = 100;
        +
        96 CreateSet(n);
        +
        97 for (int i = 1; i <= 100; ++i) {
        +
        98 if (root[i] != i) {
        +
        99 cout << "Fail" << endl;
        +
        100 break;
        +
        101 }
        +
        102 }
        +
        103 // tests InSameUnion & Union
        +
        104 cout << "1 and 2 are initially not in the same subset" << endl;
        +
        105 if (InSameUnion(1, 2)) {
        +
        106 cout << "Fail" << endl;
        +
        107 }
        +
        108 Union(1, 2);
        +
        109 cout << "1 and 2 are now in the same subset" << endl;
        +
        110 if (!InSameUnion(1, 2)) {
        +
        111 cout << "Fail" << endl;
        +
        112 }
        +
        113 return 0;
        +
        114}
        void CreateSet(int n)
        Definition: disjoint_set.cpp:37
        bool InSameUnion(int x, int y)
        Definition: disjoint_set.cpp:67
        @@ -294,7 +293,7 @@ Here is the call graph for this function:
        - +

        ◆ Union()

        @@ -319,26 +318,26 @@ Here is the call graph for this function:
        -

        Union operation combines two disjoint sets to make a single set in this union function we pass two elements and check if they are from different sets then combine those sets

        Parameters
        +

        Union operation combines two disjoint sets to make a single set in this union function we pass two elements and check if they are from different sets then combine those sets

        Parameters
        xelement of some set
        yelement of some set
        -
        78  {
        -
        79  int a = Find(x), b = Find(y);
        -
        80  if (a != b) {
        -
        81  if (rank[a] < rank[b]) {
        -
        82  root[a] = b;
        -
        83  } else if (rank[a] > rank[b]) {
        -
        84  root[b] = a;
        -
        85  } else {
        -
        86  root[a] = b;
        -
        87  ++rank[b];
        -
        88  }
        -
        89  }
        -
        90 }
        +
        78 {
        +
        79 int a = Find(x), b = Find(y);
        +
        80 if (a != b) {
        +
        81 if (rank[a] < rank[b]) {
        +
        82 root[a] = b;
        +
        83 } else if (rank[a] > rank[b]) {
        +
        84 root[b] = a;
        +
        85 } else {
        +
        86 root[a] = b;
        +
        87 ++rank[b];
        +
        88 }
        +
        89 }
        +
        90}
        Here is the call graph for this function:
        @@ -354,7 +353,7 @@ Here is the call graph for this function:
        diff --git a/de/d23/disjoint__set_8cpp.js b/de/d23/disjoint__set_8cpp.js index 0533264bf..20a69c6e4 100644 --- a/de/d23/disjoint__set_8cpp.js +++ b/de/d23/disjoint__set_8cpp.js @@ -4,7 +4,5 @@ var disjoint__set_8cpp = [ "Find", "de/d23/disjoint__set_8cpp.html#a34b9ead0608e676d9ae5188672427cc8", null ], [ "InSameUnion", "de/d23/disjoint__set_8cpp.html#a2fb0a7cd26a477e2d48ba7e0118bc985", null ], [ "main", "de/d23/disjoint__set_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "Union", "de/d23/disjoint__set_8cpp.html#a44481bb75386fbb0f958a388d4b9f757", null ], - [ "rank", "de/d23/disjoint__set_8cpp.html#a9bbf7f3dcc785986a407cfb70f54e303", null ], - [ "root", "de/d23/disjoint__set_8cpp.html#a31ade23371565792a3434bc6f2e3bdef", null ] + [ "Union", "de/d23/disjoint__set_8cpp.html#a44481bb75386fbb0f958a388d4b9f757", null ] ]; \ No newline at end of file diff --git a/de/d23/disjoint__set_8cpp_a2fb0a7cd26a477e2d48ba7e0118bc985_cgraph.svg b/de/d23/disjoint__set_8cpp_a2fb0a7cd26a477e2d48ba7e0118bc985_cgraph.svg index 5058e700f..26cb0c890 100644 --- a/de/d23/disjoint__set_8cpp_a2fb0a7cd26a477e2d48ba7e0118bc985_cgraph.svg +++ b/de/d23/disjoint__set_8cpp_a2fb0a7cd26a477e2d48ba7e0118bc985_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,27 +90,26 @@ $(document).ready(function(){initNavTree('dd/d91/class_fenwick_tree.html','../..
        -
        -
        FenwickTree Member List
        +
        FenwickTree Member List

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

        - + - + - + - +
        bit (defined in FenwickTree)FenwickTreeprivate
        FenwickTree(const std::vector< int > &arr)FenwickTreeinlineexplicit
        FenwickTree(const std::vector< int > &arr)FenwickTreeinlineexplicit
        FenwickTree(int x)FenwickTreeinlineexplicit
        n (defined in FenwickTree)FenwickTreeprivate
        n (defined in FenwickTree)FenwickTreeprivate
        offset(int x)FenwickTreeinlineprivate
        sum(int id)FenwickTreeinline
        sum(int id)FenwickTreeinline
        sum_range(int l, int r)FenwickTreeinline
        update(int id, int val)FenwickTreeinline
        update(int id, int val)FenwickTreeinline
        diff --git a/de/d33/binary__search__tree2_8cpp__incl.svg b/de/d33/binary__search__tree2_8cpp__incl.svg index d570bb5d0..b8ce67152 100644 --- a/de/d33/binary__search__tree2_8cpp__incl.svg +++ b/de/d33/binary__search__tree2_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - diff --git a/de/d33/classdata__structures_1_1linked__list_1_1link__coll__graph.md5 b/de/d33/classdata__structures_1_1linked__list_1_1link__coll__graph.md5 deleted file mode 100644 index 67866c71b..000000000 --- a/de/d33/classdata__structures_1_1linked__list_1_1link__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -4bffc9d3c5d7e06e142e0fd23855edc7 \ No newline at end of file diff --git a/de/d33/classdata__structures_1_1linked__list_1_1link__coll__graph.svg b/de/d33/classdata__structures_1_1linked__list_1_1link__coll__graph.svg deleted file mode 100644 index cfa19d465..000000000 --- a/de/d33/classdata__structures_1_1linked__list_1_1link__coll__graph.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - -data_structures::linked_list::link - - - -Node1 - - -data_structures::linked -_list::link - - - - - -Node2 - - -std::shared_ptr< data -_structures::linked_list -::link > - - - - - -Node2->Node1 - - - psucc - - - diff --git a/de/d36/binary__exponent_8cpp__incl.svg b/de/d36/binary__exponent_8cpp__incl.svg index 7bca3dade..5c4a234bc 100644 --- a/de/d36/binary__exponent_8cpp__incl.svg +++ b/de/d36/binary__exponent_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: n_bonacci Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('de/d36/namespacen__bonacci.html','../.
        -
        -
        n_bonacci Namespace Reference
        +
        n_bonacci Namespace Reference
        -

        Functions for the N-bonacci implementation. +

        Functions for the N-bonacci implementation. More...

        Detailed Description

        -

        Functions for the N-bonacci implementation.

        +

        Functions for the N-bonacci implementation.

        diff --git a/de/d3d/minimum__edit__distance_8cpp__incl.svg b/de/d3d/minimum__edit__distance_8cpp__incl.svg index 338904eee..d43fa5d36 100644 --- a/de/d3d/minimum__edit__distance_8cpp__incl.svg +++ b/de/d3d/minimum__edit__distance_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: karatsuba_algorithm Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('de/d41/namespacekaratsuba__algorithm.h
        -
        -
        karatsuba_algorithm Namespace Reference
        +
        karatsuba_algorithm Namespace Reference
        diff --git a/de/d47/string__fibonacci_8cpp.html b/de/d47/string__fibonacci_8cpp.html index b8fd48aa8..bd786b66c 100644 --- a/de/d47/string__fibonacci_8cpp.html +++ b/de/d47/string__fibonacci_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: math/string_fibonacci.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('de/d47/string__fibonacci_8cpp.html','.
        -
        -
        string_fibonacci.cpp File Reference
        +
        string_fibonacci.cpp File Reference
        @@ -108,7 +107,7 @@ Include dependency graph for string_fibonacci.cpp:
        - @@ -118,11 +117,11 @@ Functions

        +

        Functions

        std::string add (std::string a, std::string b)
         
         

        Detailed Description

        -

        This Programme returns the Nth fibonacci as a string.

        -

        The method used is manual addition with carry and placing it in a string which is called string addition This makes it have no bounds or limits

        +

        This Programme returns the Nth fibonacci as a string.

        +

        The method used is manual addition with carry and placing it in a string which is called string addition This makes it have no bounds or limits

        See also
        fibonacci_large.cpp, fibonacci_fast.cpp, fibonacci.cpp

        Function Documentation

        - +

        ◆ add()

        @@ -147,7 +146,7 @@ Functions
        -

        function to add two string numbers

        Parameters
        +

        function to add two string numbers

        Parameters
        @@ -155,46 +154,46 @@ Functions
        Returns
        sum as a std::string
        -
        24  {
        -
        25  std::string temp = "";
        -
        26 
        -
        27  // carry flag
        -
        28  int carry = 0;
        -
        29 
        -
        30  // fills up with zeros
        -
        31  while (a.length() < b.length()) {
        -
        32  a = "0" + a;
        -
        33  }
        -
        34 
        -
        35  // fills up with zeros
        -
        36  while (b.length() < a.length()) {
        -
        37  b = "0" + b;
        -
        38  }
        -
        39 
        -
        40  // adds the numbers a and b
        -
        41  for (int i = a.length() - 1; i >= 0; i--) {
        -
        42  char val = static_cast<char>(((a[i] - 48) + (b[i] - 48)) + 48 + carry);
        -
        43  if (val > 57) {
        -
        44  carry = 1;
        -
        45  val -= 10;
        -
        46  } else {
        -
        47  carry = 0;
        -
        48  }
        -
        49  temp = val + temp;
        -
        50  }
        -
        51 
        -
        52  // processes the carry flag
        -
        53  if (carry == 1) {
        -
        54  temp = "1" + temp;
        -
        55  }
        -
        56 
        -
        57  // removes leading zeros.
        -
        58  while (temp[0] == '0' && temp.length() > 1) {
        -
        59  temp = temp.substr(1);
        -
        60  }
        -
        61 
        -
        62  return temp;
        -
        63 }
        +
        24 {
        +
        25 std::string temp = "";
        +
        26
        +
        27 // carry flag
        +
        28 int carry = 0;
        +
        29
        +
        30 // fills up with zeros
        +
        31 while (a.length() < b.length()) {
        +
        32 a = "0" + a;
        +
        33 }
        +
        34
        +
        35 // fills up with zeros
        +
        36 while (b.length() < a.length()) {
        +
        37 b = "0" + b;
        +
        38 }
        +
        39
        +
        40 // adds the numbers a and b
        +
        41 for (int i = a.length() - 1; i >= 0; i--) {
        +
        42 char val = static_cast<char>(((a[i] - 48) + (b[i] - 48)) + 48 + carry);
        +
        43 if (val > 57) {
        +
        44 carry = 1;
        +
        45 val -= 10;
        +
        46 } else {
        +
        47 carry = 0;
        +
        48 }
        +
        49 temp = val + temp;
        +
        50 }
        +
        51
        +
        52 // processes the carry flag
        +
        53 if (carry == 1) {
        +
        54 temp = "1" + temp;
        +
        55 }
        +
        56
        +
        57 // removes leading zeros.
        +
        58 while (temp[0] == '0' && temp.length() > 1) {
        +
        59 temp = temp.substr(1);
        +
        60 }
        +
        61
        +
        62 return temp;
        +
        63}
        T length(T... args)
        T substr(T... args)
        @@ -207,7 +206,7 @@ Here is the call graph for this function:
        - +

        ◆ fib_Accurate()

        @@ -222,23 +221,23 @@ Here is the call graph for this function:
        [in]afirst number in string to add
        [in]bsecond number in string to add
        -

        Fibonacci iterator

        Parameters
        +

        Fibonacci iterator

        Parameters
        [in]nn^th Fibonacci number
        -
        68  {
        -
        69  std::string tmp = "";
        -
        70  std::string fibMinus1 = "1";
        -
        71  std::string fibMinus2 = "0";
        -
        72  for (uint64_t i = 0; i < n; i++) {
        -
        73  tmp = add(fibMinus1, fibMinus2);
        -
        74  fibMinus2 = fibMinus1;
        -
        75  fibMinus1 = tmp;
        -
        76  }
        -
        77  std::cout << fibMinus2;
        -
        78 }
        +
        68 {
        +
        69 std::string tmp = "";
        +
        70 std::string fibMinus1 = "1";
        +
        71 std::string fibMinus2 = "0";
        +
        72 for (uint64_t i = 0; i < n; i++) {
        +
        73 tmp = add(fibMinus1, fibMinus2);
        +
        74 fibMinus2 = fibMinus1;
        +
        75 fibMinus1 = tmp;
        +
        76 }
        +
        77 std::cout << fibMinus2;
        +
        78}
        std::string add(std::string a, std::string b)
        Definition: string_fibonacci.cpp:24
        @@ -250,7 +249,7 @@ Here is the call graph for this function:
        - +

        ◆ main()

        @@ -265,16 +264,16 @@ Here is the call graph for this function:
        -

        main function

        -
        81  {
        -
        82  int n;
        -
        83  std::cout << "Enter whatever number N you want to find the fibonacci of\n";
        -
        84  std::cin >> n;
        -
        85  std::cout << n << " th Fibonacci is \n";
        -
        86  fib_Accurate(n);
        -
        87 
        -
        88  return 0;
        -
        89 }
        +

        main function

        +
        81 {
        +
        82 int n;
        +
        83 std::cout << "Enter whatever number N you want to find the fibonacci of\n";
        +
        84 std::cin >> n;
        +
        85 std::cout << n << " th Fibonacci is \n";
        +
        86 fib_Accurate(n);
        +
        87
        +
        88 return 0;
        +
        89}
        void fib_Accurate(uint64_t n)
        Definition: string_fibonacci.cpp:68
        @@ -292,7 +291,7 @@ Here is the call graph for this function:
        diff --git a/de/d47/string__fibonacci_8cpp_a28052eee05d43c2ebc5147c52bd50c35_cgraph.svg b/de/d47/string__fibonacci_8cpp_a28052eee05d43c2ebc5147c52bd50c35_cgraph.svg index fd9fd7e51..c48a6659e 100644 --- a/de/d47/string__fibonacci_8cpp_a28052eee05d43c2ebc5147c52bd50c35_cgraph.svg +++ b/de/d47/string__fibonacci_8cpp_a28052eee05d43c2ebc5147c52bd50c35_cgraph.svg @@ -1,7 +1,7 @@ - - - - - + + Algorithms_in_C++: Trie::TrieNode Struct Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,28 +93,21 @@ $(document).ready(function(){initNavTree('de/d48/struct_trie_1_1_trie_node.html' -
        -
        Trie::TrieNode Struct Reference
        +
        Trie::TrieNode Struct Reference
        -
        -Collaboration diagram for Trie::TrieNode:
        -
        -
        -
        -
        [legend]
        - - -

        +

        Public Attributes

        +
        std::shared_ptr< TrieNodecharacter [ALPHABETS] {nullptr}
         
        +
        bool isEndOfWord {false}
         

        Detailed Description

        -

        Structure of trie node. This struct doesn't need a constructor as we are initializing using intializer list which is more efficient than if we had done so with constructor.

        +

        Structure of trie node. This struct doesn't need a constructor as we are initializing using intializer list which is more efficient than if we had done so with constructor.


        The documentation for this struct was generated from the following file: @@ -124,7 +117,7 @@ bool isEndOfWord {fals diff --git a/de/d48/struct_trie_1_1_trie_node.js b/de/d48/struct_trie_1_1_trie_node.js deleted file mode 100644 index fc7e87f8f..000000000 --- a/de/d48/struct_trie_1_1_trie_node.js +++ /dev/null @@ -1,5 +0,0 @@ -var struct_trie_1_1_trie_node = -[ - [ "character", "de/d48/struct_trie_1_1_trie_node.html#ae13ae4b74d997d3e83d7bb51b204d99e", null ], - [ "isEndOfWord", "de/d48/struct_trie_1_1_trie_node.html#a73bba435c8e304cc97fd3dc40c95d52f", null ] -]; \ No newline at end of file diff --git a/de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.map b/de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.map deleted file mode 100644 index 0a9ccbb8a..000000000 --- a/de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.map +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.md5 b/de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.md5 deleted file mode 100644 index 94c65fa02..000000000 --- a/de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -2a4f39d133e81c5858d19787d0ea5b3a \ No newline at end of file diff --git a/de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.svg b/de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.svg deleted file mode 100644 index 1b3bbae8d..000000000 --- a/de/d4c/classrange__queries_1_1heavy__light__decomposition_1_1_tree__coll__graph.svg +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - -range_queries::heavy_light_decomposition::Tree< X > - - - -Node1 - - -range_queries::heavy -_light_decomposition -::Tree< X > - - - - - -Node2 - - -std::vector< std::vector -< int > > - - - - - -Node2->Node1 - - - t_par - - - -Node3 - - -std::vector< int > - - - - - -Node3->Node1 - - - t_depth -t_size - - - -Node3->Node2 - - - elements - - - -Node4 - - -std::vector< std::list -< int > > - - - - - -Node4->Node1 - - - t_adj - - - -Node5 - - -std::list< int > - - - - - -Node5->Node4 - - - elements - - - -Node6 - - -std::vector< X > - - - - - -Node6->Node1 - - - t_val - - - diff --git a/de/d4c/saddleback__search_8cpp__incl.svg b/de/d4c/saddleback__search_8cpp__incl.svg index f5f6413ab..5604d514d 100644 --- a/de/d4c/saddleback__search_8cpp__incl.svg +++ b/de/d4c/saddleback__search_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - - - - diff --git a/de/d61/classrange__queries_1_1per_seg_tree_1_1_node__coll__graph.md5 b/de/d61/classrange__queries_1_1per_seg_tree_1_1_node__coll__graph.md5 deleted file mode 100644 index caa2f82ac..000000000 --- a/de/d61/classrange__queries_1_1per_seg_tree_1_1_node__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -c3cd31a283f6bd33f5d197ce7a564b63 \ No newline at end of file diff --git a/de/d61/classrange__queries_1_1per_seg_tree_1_1_node__coll__graph.svg b/de/d61/classrange__queries_1_1per_seg_tree_1_1_node__coll__graph.svg deleted file mode 100644 index 086f001ce..000000000 --- a/de/d61/classrange__queries_1_1per_seg_tree_1_1_node__coll__graph.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - -range_queries::perSegTree::Node - - - -Node1 - - -range_queries::perSegTree -::Node - - - - - -Node2 - - -std::shared_ptr< range -_queries::perSegTree:: -Node > - - - - - -Node2->Node1 - - - left -right - - - diff --git a/de/d69/knuth__morris__pratt_8cpp__incl.svg b/de/d69/knuth__morris__pratt_8cpp__incl.svg index 7dd385a43..ddbc5ae5a 100644 --- a/de/d69/knuth__morris__pratt_8cpp__incl.svg +++ b/de/d69/knuth__morris__pratt_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: strings/knuth_morris_pratt.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('de/d6a/knuth__morris__pratt_8cpp.html' -
        -
        knuth_morris_pratt.cpp File Reference
        +
        knuth_morris_pratt.cpp File Reference
        -

        The Knuth-Morris-Pratt Algorithm for finding a pattern within a piece of text with complexity O(n + m) +

        The Knuth-Morris-Pratt Algorithm for finding a pattern within a piece of text with complexity O(n + m) More...

        #include <iostream>
        #include <cstring>
        @@ -110,29 +109,29 @@ Include dependency graph for knuth_morris_pratt.cpp:
        - - +

        +

        Namespaces

         
        - - - + +

        +

        Functions

        std::vector< int > string_search::getFailureArray (const std::string &pattern)
         
        std::vector< int > string_search::getFailureArray (const std::string &pattern)
         
        bool string_search::kmp (const std::string &pattern, const std::string &text)
         
        int main ()
         

        Detailed Description

        -

        The Knuth-Morris-Pratt Algorithm for finding a pattern within a piece of text with complexity O(n + m)

        +

        The Knuth-Morris-Pratt Algorithm for finding a pattern within a piece of text with complexity O(n + m)

        1. Preprocess pattern to identify any suffixes that are identical to prefixes. This tells us where to continue from if we get a mismatch between a character in our pattern and the text.
        2. Step through the text one character at a time and compare it to a character in the pattern updating our location within the pattern if necessary

        Function Documentation

        - +

        ◆ main()

        @@ -147,27 +146,27 @@ Functions
        -

        Main function

        -
        76  {
        -
        77  std::string text = "alskfjaldsabc1abc1abc12k23adsfabcabc";
        -
        78  std::string pattern = "abc1abc12l";
        -
        79 
        -
        80  if (kmp(pattern, text) == true) {
        -
        81  std::cout << "Found" << std::endl;
        -
        82  } else {
        -
        83  std::cout << "Not Found" << std::endl;
        -
        84  }
        -
        85 
        -
        86  text = "abcabc";
        -
        87  pattern = "bca";
        -
        88  if (kmp(pattern, text) == true) {
        -
        89  std::cout << "Found" << std::endl;
        -
        90  } else {
        -
        91  std::cout << "Not Found" << std::endl;
        -
        92  }
        -
        93 
        -
        94  return 0;
        -
        95 }
        +

        Main function

        +
        76 {
        +
        77 std::string text = "alskfjaldsabc1abc1abc12k23adsfabcabc";
        +
        78 std::string pattern = "abc1abc12l";
        +
        79
        +
        80 if (kmp(pattern, text) == true) {
        +
        81 std::cout << "Found" << std::endl;
        +
        82 } else {
        +
        83 std::cout << "Not Found" << std::endl;
        +
        84 }
        +
        85
        +
        86 text = "abcabc";
        +
        87 pattern = "bca";
        +
        88 if (kmp(pattern, text) == true) {
        +
        89 std::cout << "Found" << std::endl;
        +
        90 } else {
        +
        91 std::cout << "Not Found" << std::endl;
        +
        92 }
        +
        93
        +
        94 return 0;
        +
        95}
        T endl(T... args)
        @@ -187,7 +186,7 @@ Here is the call graph for this function:
        diff --git a/de/d6a/knuth__morris__pratt_8cpp.js b/de/d6a/knuth__morris__pratt_8cpp.js index 39364b9ad..194671815 100644 --- a/de/d6a/knuth__morris__pratt_8cpp.js +++ b/de/d6a/knuth__morris__pratt_8cpp.js @@ -1,6 +1,6 @@ var knuth__morris__pratt_8cpp = [ - [ "getFailureArray", "de/d6a/knuth__morris__pratt_8cpp.html#aa422aab133d4ed5e5d6022a7f701271f", null ], + [ "getFailureArray", "de/d6a/knuth__morris__pratt_8cpp.html#a996573527312d5255e1495b879e8a34f", null ], [ "kmp", "de/d6a/knuth__morris__pratt_8cpp.html#a26a58225ce7d3fa9d4c2f5349a65ed93", null ], [ "main", "de/d6a/knuth__morris__pratt_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] ]; \ No newline at end of file diff --git a/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 1018840c8..48705cc24 100644 --- a/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -2,6 +2,6 @@ - + diff --git a/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 920ecb6ed..46adddee4 100644 --- a/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -cf61d89bb2bba39920c8cb7f03b911d5 \ No newline at end of file +b3f68c98ba2d13ce39ebca157fab69ae \ No newline at end of file diff --git a/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 54c2d783c..aaacacd1d 100644 --- a/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/de/d6a/knuth__morris__pratt_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - Node4 - + string_search::getFailure Array diff --git a/de/d6b/namespacerandom__pivot__quick__sort.html b/de/d6b/namespacerandom__pivot__quick__sort.html index 69e2baf0b..00b6ec61e 100644 --- a/de/d6b/namespacerandom__pivot__quick__sort.html +++ b/de/d6b/namespacerandom__pivot__quick__sort.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: random_pivot_quick_sort Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('de/d6b/namespacerandom__pivot__quick__
        -
        -
        random_pivot_quick_sort Namespace Reference
        +
        random_pivot_quick_sort Namespace Reference
        -

        Functions for the Random Pivot Quick Sort implementation. +

        Functions for the Random Pivot Quick Sort implementation. More...

        Detailed Description

        -

        Functions for the Random Pivot Quick Sort implementation.

        +

        Functions for the Random Pivot Quick Sort implementation.

        diff --git a/de/d6c/palindrome__of__number_8cpp__incl.svg b/de/d6c/palindrome__of__number_8cpp__incl.svg index dcf56821a..f4b317349 100644 --- a/de/d6c/palindrome__of__number_8cpp__incl.svg +++ b/de/d6c/palindrome__of__number_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: numerical_methods/qr_eigen_values.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('de/d75/qr__eigen__values_8cpp.html','. Namespaces | Macros | Functions -
        -
        qr_eigen_values.cpp File Reference
        +
        qr_eigen_values.cpp File Reference
        -

        Compute real eigen values and eigen vectors of a symmetric matrix using QR decomposition method. +

        Compute real eigen values and eigen vectors of a symmetric matrix using QR decomposition method. More...

        #include <cassert>
        #include <cmath>
        @@ -114,25 +113,25 @@ Include dependency graph for qr_eigen_values.cpp:
        - - - + +

        +

        Namespaces

         qr_algorithm
         Functions to compute QR decomposition of any rectangular matrix.
        namespace  qr_algorithm
         Functions to compute QR decomposition of any rectangular matrix.
         
        -

        +

        Macros

        #define LIMS   9
         
        - - - - - - - + + + + + + @@ -141,10 +140,10 @@ Functions

        +

        Functions

        void create_matrix (std::valarray< std::valarray< double >> *A)
         
        void mat_mul (const std::valarray< std::valarray< double >> &A, const std::valarray< std::valarray< double >> &B, std::valarray< std::valarray< double >> *OUT)
         
        std::valarray< double > qr_algorithm::eigen_values (std::valarray< std::valarray< double >> *A, bool print_intermediates=false)
         
        void create_matrix (std::valarray< std::valarray< double > > *A)
         
        void mat_mul (const std::valarray< std::valarray< double > > &A, const std::valarray< std::valarray< double > > &B, std::valarray< std::valarray< double > > *OUT)
         
        std::valarray< double > qr_algorithm::eigen_values (std::valarray< std::valarray< double > > *A, bool print_intermediates=false)
         
        void test1 ()
         
        void test2 ()
         

        Detailed Description

        -

        Compute real eigen values and eigen vectors of a symmetric matrix using QR decomposition method.

        -
        Author
        Krishna Vedala
        +

        Compute real eigen values and eigen vectors of a symmetric matrix using QR decomposition method.

        +
        Author
        Krishna Vedala

        Macro Definition Documentation

        - +

        ◆ LIMS

        @@ -155,13 +154,13 @@ Functions
        -

        limit of range of matrix values

        +

        limit of range of matrix values

        Function Documentation

        - -

        ◆ create_matrix()

        + +

        ◆ create_matrix()

        @@ -169,48 +168,48 @@ Functions void create_matrix ( - std::valarray< std::valarray< double >> *  + std::valarray< std::valarray< double > > *  A)
        -

        create a symmetric square matrix of given size with random elements. A symmetric square matrix will always have real eigen values.

        +

        create a symmetric square matrix of given size with random elements. A symmetric square matrix will always have real eigen values.

        Parameters
        [out]Amatrix to create (must be pre-allocated in memory)
        -
        28  {
        -
        29  int i, j, tmp, lim2 = LIMS >> 1;
        -
        30  int N = A->size();
        -
        31 
        -
        32 #ifdef _OPENMP
        -
        33 #pragma omp for
        -
        34 #endif
        -
        35  for (i = 0; i < N; i++) {
        -
        36  A[0][i][i] = (std::rand() % LIMS) - lim2;
        -
        37  for (j = i + 1; j < N; j++) {
        -
        38  tmp = (std::rand() % LIMS) - lim2;
        -
        39  A[0][i][j] = tmp; // summetrically distribute random values
        -
        40  A[0][j][i] = tmp;
        -
        41  }
        -
        42  }
        -
        43 }
        +
        28 {
        +
        29 int i, j, tmp, lim2 = LIMS >> 1;
        +
        30 int N = A->size();
        +
        31
        +
        32#ifdef _OPENMP
        +
        33#pragma omp for
        +
        34#endif
        +
        35 for (i = 0; i < N; i++) {
        +
        36 A[0][i][i] = (std::rand() % LIMS) - lim2;
        +
        37 for (j = i + 1; j < N; j++) {
        +
        38 tmp = (std::rand() % LIMS) - lim2;
        +
        39 A[0][i][j] = tmp; // summetrically distribute random values
        +
        40 A[0][j][i] = tmp;
        +
        41 }
        +
        42 }
        +
        43}
        constexpr uint32_t N
        A struct to represent sparse table for min() as their invariant function, for the given array A....
        Definition: sparse_table.cpp:47
        #define LIMS
        Definition: qr_eigen_values.cpp:20
        T rand(T... args)
        Here is the call graph for this function:
        -
        +
        - +

        ◆ main()

        @@ -235,58 +234,58 @@ Here is the call graph for this function:
        -

        main function

        -
        243  {
        -
        244  int mat_size = 5;
        -
        245  if (argc == 2) {
        -
        246  mat_size = atoi(argv[1]);
        -
        247  } else { // if invalid input argument is given run tests
        -
        248  test1();
        -
        249  test2();
        -
        250  std::cout << "Usage: ./qr_eigen_values [mat_size]\n";
        -
        251  return 0;
        -
        252  }
        -
        253 
        -
        254  if (mat_size < 2) {
        -
        255  fprintf(stderr, "Matrix size should be > 2\n");
        -
        256  return -1;
        -
        257  }
        -
        258 
        -
        259  // initialize random number generator
        -
        260  std::srand(std::time(nullptr));
        -
        261 
        -
        262  int i, rows = mat_size, columns = mat_size;
        -
        263 
        - -
        265 
        -
        266  for (int i = 0; i < rows; i++) {
        -
        267  A[i] = std::valarray<double>(columns);
        -
        268  }
        -
        269 
        -
        270  /* create a random matrix */
        -
        271  create_matrix(&A);
        -
        272 
        -
        273  std::cout << A << "\n";
        -
        274 
        -
        275  clock_t t1 = clock();
        - -
        277  double dtime = static_cast<double>(clock() - t1) / CLOCKS_PER_SEC;
        -
        278 
        -
        279  std::cout << "Eigen vals: ";
        -
        280  for (i = 0; i < mat_size; i++) std::cout << eigen_vals[i] << "\t";
        -
        281  std::cout << "\nTime taken to compute: " << dtime << " sec\n";
        -
        282 
        -
        283  return 0;
        -
        284 }
        +

        main function

        +
        243 {
        +
        244 int mat_size = 5;
        +
        245 if (argc == 2) {
        +
        246 mat_size = atoi(argv[1]);
        +
        247 } else { // if invalid input argument is given run tests
        +
        248 test1();
        +
        249 test2();
        +
        250 std::cout << "Usage: ./qr_eigen_values [mat_size]\n";
        +
        251 return 0;
        +
        252 }
        +
        253
        +
        254 if (mat_size < 2) {
        +
        255 fprintf(stderr, "Matrix size should be > 2\n");
        +
        256 return -1;
        +
        257 }
        +
        258
        +
        259 // initialize random number generator
        +
        260 std::srand(std::time(nullptr));
        +
        261
        +
        262 int i, rows = mat_size, columns = mat_size;
        +
        263
        + +
        265
        +
        266 for (int i = 0; i < rows; i++) {
        +
        267 A[i] = std::valarray<double>(columns);
        +
        268 }
        +
        269
        +
        270 /* create a random matrix */
        +
        271 create_matrix(&A);
        +
        272
        +
        273 std::cout << A << "\n";
        +
        274
        +
        275 clock_t t1 = clock();
        + +
        277 double dtime = static_cast<double>(clock() - t1) / CLOCKS_PER_SEC;
        +
        278
        +
        279 std::cout << "Eigen vals: ";
        +
        280 for (i = 0; i < mat_size; i++) std::cout << eigen_vals[i] << "\t";
        +
        281 std::cout << "\nTime taken to compute: " << dtime << " sec\n";
        +
        282
        +
        283 return 0;
        +
        284}
        T atoi(T... args)
        T clock(T... args)
        T fprintf(T... args)
        ll mat_size
        Definition: matrix_exponentiation.cpp:45
        -
        std::valarray< double > eigen_values(std::valarray< std::valarray< double >> *A, bool print_intermediates=false)
        Definition: qr_eigen_values.cpp:98
        +
        std::valarray< double > eigen_values(std::valarray< std::valarray< double > > *A, bool print_intermediates=false)
        Definition: qr_eigen_values.cpp:98
        void test2()
        Definition: qr_eigen_values.cpp:210
        void test1()
        Definition: qr_eigen_values.cpp:177
        -
        void create_matrix(std::valarray< std::valarray< double >> *A)
        Definition: qr_eigen_values.cpp:28
        +
        void create_matrix(std::valarray< std::valarray< double > > *A)
        Definition: qr_eigen_values.cpp:28
        T srand(T... args)
        T time(T... args)
        @@ -299,8 +298,8 @@ Here is the call graph for this function:
        - -

        ◆ mat_mul()

        + +

        ◆ mat_mul()

        @@ -308,19 +307,19 @@ Here is the call graph for this function:
        void mat_mul ( - const std::valarray< std::valarray< double >> &  + const std::valarray< std::valarray< double > > &  A, - const std::valarray< std::valarray< double >> &  + const std::valarray< std::valarray< double > > &  B, - std::valarray< std::valarray< double >> *  + std::valarray< std::valarray< double > > *  OUT  @@ -330,7 +329,7 @@ Here is the call graph for this function:
        -

        Perform multiplication of two matrices.

          +

          Perform multiplication of two matrices.

          • R2 must be equal to C1
          • Resultant matrix size should be R1xC2
            Parameters
            @@ -343,30 +342,30 @@ Here is the call graph for this function:
            Returns
            pointer to resultant matrix
            -
            56  {
            -
            57  int R1 = A.size();
            -
            58  int C1 = A[0].size();
            -
            59  int R2 = B.size();
            -
            60  int C2 = B[0].size();
            -
            61  if (C1 != R2) {
            -
            62  perror("Matrix dimensions mismatch!");
            -
            63  return;
            -
            64  }
            -
            65 
            -
            66  for (int i = 0; i < R1; i++) {
            -
            67  for (int j = 0; j < C2; j++) {
            -
            68  OUT[0][i][j] = 0.f;
            -
            69  for (int k = 0; k < C1; k++) {
            -
            70  OUT[0][i][j] += A[i][k] * B[k][j];
            -
            71  }
            -
            72  }
            -
            73  }
            -
            74 }
            +
            56 {
            +
            57 int R1 = A.size();
            +
            58 int C1 = A[0].size();
            +
            59 int R2 = B.size();
            +
            60 int C2 = B[0].size();
            +
            61 if (C1 != R2) {
            +
            62 perror("Matrix dimensions mismatch!");
            +
            63 return;
            +
            64 }
            +
            65
            +
            66 for (int i = 0; i < R1; i++) {
            +
            67 for (int j = 0; j < C2; j++) {
            +
            68 OUT[0][i][j] = 0.f;
            +
            69 for (int k = 0; k < C1; k++) {
            +
            70 OUT[0][i][j] += A[i][k] * B[k][j];
            +
            71 }
            +
            72 }
            +
            73 }
            +
            74}
            T perror(T... args)
            - +

            ◆ test1()

            @@ -380,31 +379,31 @@ Here is the call graph for this function:
        -

        test function to compute eigen values of a 2x2 matrix

        +

        test function to compute eigen values of a 2x2 matrix

        \[\begin{bmatrix} 5 & 7\\ 7 & 11 \end{bmatrix}\]

        which are approximately, {15.56158, 0.384227}

        -
        177  {
        -
        178  std::valarray<std::valarray<double>> X = {{5, 7}, {7, 11}};
        -
        179  double y[] = {15.56158, 0.384227}; // corresponding y-values
        -
        180 
        -
        181  std::cout << "------- Test 1 -------" << std::endl;
        - -
        183 
        -
        184  for (int i = 0; i < 2; i++) {
        -
        185  std::cout << i + 1 << "/2 Checking for " << y[i] << " --> ";
        -
        186  bool result = false;
        -
        187  for (int j = 0; j < 2 && !result; j++) {
        -
        188  if (std::abs(y[i] - eig_vals[j]) < 0.1) {
        -
        189  result = true;
        -
        190  std::cout << "(" << eig_vals[j] << ") ";
        -
        191  }
        -
        192  }
        -
        193  assert(result); // ensure that i^th expected eigen value was computed
        -
        194  std::cout << "found\n";
        -
        195  }
        -
        196  std::cout << "Test 1 Passed\n\n";
        -
        197 }
        +
        177 {
        +
        178 std::valarray<std::valarray<double>> X = {{5, 7}, {7, 11}};
        +
        179 double y[] = {15.56158, 0.384227}; // corresponding y-values
        +
        180
        +
        181 std::cout << "------- Test 1 -------" << std::endl;
        + +
        183
        +
        184 for (int i = 0; i < 2; i++) {
        +
        185 std::cout << i + 1 << "/2 Checking for " << y[i] << " --> ";
        +
        186 bool result = false;
        +
        187 for (int j = 0; j < 2 && !result; j++) {
        +
        188 if (std::abs(y[i] - eig_vals[j]) < 0.1) {
        +
        189 result = true;
        +
        190 std::cout << "(" << eig_vals[j] << ") ";
        +
        191 }
        +
        192 }
        +
        193 assert(result); // ensure that i^th expected eigen value was computed
        +
        194 std::cout << "found\n";
        +
        195 }
        +
        196 std::cout << "Test 1 Passed\n\n";
        +
        197}
        T endl(T... args)
        uint64_t result(uint64_t n)
        Definition: fibonacci_sum.cpp:76
        @@ -416,7 +415,7 @@ Here is the call graph for this function:
        - +

        ◆ test2()

        @@ -430,39 +429,39 @@ Here is the call graph for this function:
        -

        test function to compute eigen values of a 2x2 matrix

        +

        test function to compute eigen values of a 2x2 matrix

        \[\begin{bmatrix} -4& 4& 2& 0& -3\\ 4& -4& 4& -3& -1\\ 2& 4& 4& 3& -3\\ 0& -3& 3& -1&-1\\ -3& -1& -3& -3& 0 \end{bmatrix}\]

        which are approximately, {9.27648, -9.26948, 2.0181, -1.03516, -5.98994}

        -
        210  {
        -
        211  std::valarray<std::valarray<double>> X = {{-4, 4, 2, 0, -3},
        -
        212  {4, -4, 4, -3, -1},
        -
        213  {2, 4, 4, 3, -3},
        -
        214  {0, -3, 3, -1, -3},
        -
        215  {-3, -1, -3, -3, 0}};
        -
        216  double y[] = {9.27648, -9.26948, 2.0181, -1.03516,
        -
        217  -5.98994}; // corresponding y-values
        -
        218 
        -
        219  std::cout << "------- Test 2 -------" << std::endl;
        - -
        221 
        -
        222  std::cout << X << "\n"
        -
        223  << "Eigen values: " << eig_vals << "\n";
        -
        224 
        -
        225  for (int i = 0; i < 5; i++) {
        -
        226  std::cout << i + 1 << "/5 Checking for " << y[i] << " --> ";
        -
        227  bool result = false;
        -
        228  for (int j = 0; j < 5 && !result; j++) {
        -
        229  if (std::abs(y[i] - eig_vals[j]) < 0.1) {
        -
        230  result = true;
        -
        231  std::cout << "(" << eig_vals[j] << ") ";
        -
        232  }
        -
        233  }
        -
        234  assert(result); // ensure that i^th expected eigen value was computed
        -
        235  std::cout << "found\n";
        -
        236  }
        -
        237  std::cout << "Test 2 Passed\n\n";
        -
        238 }
        +
        210 {
        +
        211 std::valarray<std::valarray<double>> X = {{-4, 4, 2, 0, -3},
        +
        212 {4, -4, 4, -3, -1},
        +
        213 {2, 4, 4, 3, -3},
        +
        214 {0, -3, 3, -1, -3},
        +
        215 {-3, -1, -3, -3, 0}};
        +
        216 double y[] = {9.27648, -9.26948, 2.0181, -1.03516,
        +
        217 -5.98994}; // corresponding y-values
        +
        218
        +
        219 std::cout << "------- Test 2 -------" << std::endl;
        + +
        221
        +
        222 std::cout << X << "\n"
        +
        223 << "Eigen values: " << eig_vals << "\n";
        +
        224
        +
        225 for (int i = 0; i < 5; i++) {
        +
        226 std::cout << i + 1 << "/5 Checking for " << y[i] << " --> ";
        +
        227 bool result = false;
        +
        228 for (int j = 0; j < 5 && !result; j++) {
        +
        229 if (std::abs(y[i] - eig_vals[j]) < 0.1) {
        +
        230 result = true;
        +
        231 std::cout << "(" << eig_vals[j] << ") ";
        +
        232 }
        +
        233 }
        +
        234 assert(result); // ensure that i^th expected eigen value was computed
        +
        235 std::cout << "found\n";
        +
        236 }
        +
        237 std::cout << "Test 2 Passed\n\n";
        +
        238}
        Here is the call graph for this function:
        @@ -478,7 +477,7 @@ Here is the call graph for this function:
        diff --git a/de/d75/qr__eigen__values_8cpp.js b/de/d75/qr__eigen__values_8cpp.js index efcc5d814..7d90b62bb 100644 --- a/de/d75/qr__eigen__values_8cpp.js +++ b/de/d75/qr__eigen__values_8cpp.js @@ -1,10 +1,10 @@ var qr__eigen__values_8cpp = [ [ "LIMS", "de/d75/qr__eigen__values_8cpp.html#aee57a411f07599034f5ceb8cc7d65b40", null ], - [ "create_matrix", "de/d75/qr__eigen__values_8cpp.html#a33cb0a68c36aa26fd599c7c66da86ed7", null ], - [ "eigen_values", "de/d75/qr__eigen__values_8cpp.html#a763896dbb4a7e95c4a1e614ac0819d66", null ], + [ "create_matrix", "de/d75/qr__eigen__values_8cpp.html#a9bbf469d5525a816b0d6ca812119093d", null ], + [ "eigen_values", "de/d75/qr__eigen__values_8cpp.html#a28e2fa3e803abaea6c568dc45d69d8cc", null ], [ "main", "de/d75/qr__eigen__values_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ], - [ "mat_mul", "de/d75/qr__eigen__values_8cpp.html#a7558fd7779bf207157ced66f275951a0", null ], + [ "mat_mul", "de/d75/qr__eigen__values_8cpp.html#abb8bf4c55e10685a5eb2ad3797fde1ae", null ], [ "test1", "de/d75/qr__eigen__values_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0", null ], [ "test2", "de/d75/qr__eigen__values_8cpp.html#a0283886819c7c140a023582b7269e2d0", null ] ]; \ No newline at end of file diff --git a/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map b/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map index 0b5cd99da..e80f850e7 100644 --- a/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map +++ b/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.map @@ -1,12 +1,12 @@ - + - - - + + + - + diff --git a/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 b/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 index 1115e5b86..a7a8bca1a 100644 --- a/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 +++ b/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.md5 @@ -1 +1 @@ -20beb17cb7a7d5d39b4c44cf3614039e \ No newline at end of file +07b42662cca12b8cc6de389e0a87f448 \ No newline at end of file diff --git a/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg b/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg index 84d45a324..5c0a4358c 100644 --- a/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg +++ b/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg @@ -1,7 +1,7 @@ - @@ -67,7 +67,7 @@ var sectionId = 'dynsection-4'; Node2 - + qr_algorithm::eigen _values @@ -98,7 +98,7 @@ var sectionId = 'dynsection-4'; Node3 - + mat_mul @@ -113,7 +113,7 @@ var sectionId = 'dynsection-4'; Node4 - + qr_algorithm::qr_decompose @@ -128,7 +128,7 @@ var sectionId = 'dynsection-4'; Node5 - + machine_learning::sum @@ -158,7 +158,7 @@ var sectionId = 'dynsection-4'; Node9 - + qr_algorithm::vector_proj diff --git a/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg b/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg index 7f2c43a3e..29bee14af 100644 --- a/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg +++ b/de/d75/qr__eigen__values_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph_org.svg @@ -1,7 +1,7 @@ - Node2 - + qr_algorithm::eigen _values @@ -52,7 +52,7 @@ Node3 - + mat_mul @@ -67,7 +67,7 @@ Node4 - + qr_algorithm::qr_decompose @@ -82,7 +82,7 @@ Node5 - + machine_learning::sum @@ -112,7 +112,7 @@ Node9 - + qr_algorithm::vector_proj diff --git a/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map b/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map index 10d1e780f..9316baac9 100644 --- a/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map +++ b/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.map @@ -1,12 +1,12 @@ - + - - - + + + - + diff --git a/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 b/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 index acccc234a..639b626a0 100644 --- a/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 +++ b/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.md5 @@ -1 +1 @@ -aeda2a648b9d027b7f05ea62924cc23b \ No newline at end of file +90ff97f917ffaf005ea0b06644ee1216 \ No newline at end of file diff --git a/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg b/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg index ed6d40a54..3e3ac370f 100644 --- a/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg +++ b/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph.svg @@ -1,7 +1,7 @@ - @@ -67,7 +67,7 @@ var sectionId = 'dynsection-3'; Node2 - + qr_algorithm::eigen _values @@ -98,7 +98,7 @@ var sectionId = 'dynsection-3'; Node3 - + mat_mul @@ -113,7 +113,7 @@ var sectionId = 'dynsection-3'; Node4 - + qr_algorithm::qr_decompose @@ -128,7 +128,7 @@ var sectionId = 'dynsection-3'; Node5 - + machine_learning::sum @@ -158,7 +158,7 @@ var sectionId = 'dynsection-3'; Node9 - + qr_algorithm::vector_proj diff --git a/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg b/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg index 44b1678c3..08654222a 100644 --- a/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg +++ b/de/d75/qr__eigen__values_8cpp_a1440a7779ac56f47a3f355ce4a8c7da0_cgraph_org.svg @@ -1,7 +1,7 @@ - Node2 - + qr_algorithm::eigen _values @@ -52,7 +52,7 @@ Node3 - + mat_mul @@ -67,7 +67,7 @@ Node4 - + qr_algorithm::qr_decompose @@ -82,7 +82,7 @@ Node5 - + machine_learning::sum @@ -112,7 +112,7 @@ Node9 - + qr_algorithm::vector_proj diff --git a/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map b/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map index 9e2e75cb9..0cb83ac34 100644 --- a/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map +++ b/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map @@ -1,17 +1,17 @@ - - + + - - - + + + - + diff --git a/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 b/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 index 50d769690..dce5e43d0 100644 --- a/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 +++ b/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5 @@ -1 +1 @@ -8b37f37c64ef634d3ae5db6cc0ca87e1 \ No newline at end of file +d2b3e777c146fc05293f3da43e3376a7 \ No newline at end of file diff --git a/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg b/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg index a801703e5..21ab01908 100644 --- a/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg +++ b/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.svg @@ -1,7 +1,7 @@ - @@ -67,7 +67,7 @@ var sectionId = 'dynsection-2'; Node2 - + create_matrix @@ -82,7 +82,7 @@ var sectionId = 'dynsection-2'; Node4 - + qr_algorithm::eigen _values @@ -173,7 +173,7 @@ var sectionId = 'dynsection-2'; Node5 - + mat_mul @@ -188,7 +188,7 @@ var sectionId = 'dynsection-2'; Node6 - + qr_algorithm::qr_decompose @@ -203,7 +203,7 @@ var sectionId = 'dynsection-2'; Node7 - + machine_learning::sum @@ -233,7 +233,7 @@ var sectionId = 'dynsection-2'; Node11 - + qr_algorithm::vector_proj diff --git a/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg b/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg index ab7575594..a9dc730a0 100644 --- a/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg +++ b/de/d75/qr__eigen__values_8cpp_a3c04138a5bfe5d72780bb7e82a18e627_cgraph_org.svg @@ -1,7 +1,7 @@ - Node2 - + create_matrix @@ -36,7 +36,7 @@ Node4 - + qr_algorithm::eigen _values @@ -127,7 +127,7 @@ Node5 - + mat_mul @@ -142,7 +142,7 @@ Node6 - + qr_algorithm::qr_decompose @@ -157,7 +157,7 @@ Node7 - + machine_learning::sum @@ -187,7 +187,7 @@ Node11 - + qr_algorithm::vector_proj diff --git a/de/d75/qr__eigen__values_8cpp_a33cb0a68c36aa26fd599c7c66da86ed7_cgraph.map b/de/d75/qr__eigen__values_8cpp_a9bbf469d5525a816b0d6ca812119093d_cgraph.map similarity index 100% rename from de/d75/qr__eigen__values_8cpp_a33cb0a68c36aa26fd599c7c66da86ed7_cgraph.map rename to de/d75/qr__eigen__values_8cpp_a9bbf469d5525a816b0d6ca812119093d_cgraph.map diff --git a/de/d75/qr__eigen__values_8cpp_a33cb0a68c36aa26fd599c7c66da86ed7_cgraph.md5 b/de/d75/qr__eigen__values_8cpp_a9bbf469d5525a816b0d6ca812119093d_cgraph.md5 similarity index 100% rename from de/d75/qr__eigen__values_8cpp_a33cb0a68c36aa26fd599c7c66da86ed7_cgraph.md5 rename to de/d75/qr__eigen__values_8cpp_a9bbf469d5525a816b0d6ca812119093d_cgraph.md5 diff --git a/de/d75/qr__eigen__values_8cpp_a33cb0a68c36aa26fd599c7c66da86ed7_cgraph.svg b/de/d75/qr__eigen__values_8cpp_a9bbf469d5525a816b0d6ca812119093d_cgraph.svg similarity index 96% rename from de/d75/qr__eigen__values_8cpp_a33cb0a68c36aa26fd599c7c66da86ed7_cgraph.svg rename to de/d75/qr__eigen__values_8cpp_a9bbf469d5525a816b0d6ca812119093d_cgraph.svg index 2b2760212..1798ca15d 100644 --- a/de/d75/qr__eigen__values_8cpp_a33cb0a68c36aa26fd599c7c66da86ed7_cgraph.svg +++ b/de/d75/qr__eigen__values_8cpp_a9bbf469d5525a816b0d6ca812119093d_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: sorting/merge_insertion_sort.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -93,12 +93,11 @@ $(document).ready(function(){initNavTree('de/d7b/merge__insertion__sort_8cpp.htm -
        -
        merge_insertion_sort.cpp File Reference
        +
        merge_insertion_sort.cpp File Reference
        -

        Algorithm that combines insertion sort and merge sort. Wiki link +

        Algorithm that combines insertion sort and merge sort. Wiki link More...

        #include <algorithm>
        #include <array>
        @@ -113,16 +112,16 @@ Include dependency graph for merge_insertion_sort.cpp:
        - - + - +

        +

        Namespaces

         sorting
        namespace  sorting
         Sorting algorithms.
         
         merge_insertion
        namespace  merge_insertion
         Combined Intersion-Merge sorting algorithm.
         
        - @@ -144,13 +143,13 @@ Functions

        +

        Functions

        template<typename T , size_t N>
        static void sorting::merge_insertion::InsertionSort (std::array< T, N > *A, size_t start, size_t end)
         

        Detailed Description

        -

        Algorithm that combines insertion sort and merge sort. Wiki link

        -
        Author
        @sinkyoungdeok
        +

        Algorithm that combines insertion sort and merge sort. Wiki link

        +
        Author
        @sinkyoungdeok
        -Krishna Vedala
        +Krishna Vedala
        See also
        Individual algorithms: insertion_sort.cpp and merge_sort.cpp

        Function Documentation

        - +

        ◆ InsertionSort()

        @@ -209,24 +208,24 @@ template<typename T , size_t N>
        -
        37  {
        -
        38  size_t i = 0, j = 0;
        -
        39  T *ptr = A->data();
        -
        40 
        -
        41  for (i = start; i < end; i++) {
        -
        42  T temp = ptr[i];
        -
        43  j = i;
        -
        44  while (j > start && temp < ptr[j - 1]) {
        -
        45  ptr[j] = ptr[j - 1];
        -
        46  j--;
        -
        47  }
        -
        48  // for (j = i; j > start && temp < ptr[j - 1]; --j) {
        -
        49  // ptr[j] = ptr[j - 1];
        -
        50  // }
        -
        51 
        -
        52  ptr[j] = temp;
        -
        53  }
        -
        54 }
        +
        37 {
        +
        38 size_t i = 0, j = 0;
        +
        39 T *ptr = A->data();
        +
        40
        +
        41 for (i = start; i < end; i++) {
        +
        42 T temp = ptr[i];
        +
        43 j = i;
        +
        44 while (j > start && temp < ptr[j - 1]) {
        +
        45 ptr[j] = ptr[j - 1];
        +
        46 j--;
        +
        47 }
        +
        48 // for (j = i; j > start && temp < ptr[j - 1]; --j) {
        +
        49 // ptr[j] = ptr[j - 1];
        +
        50 // }
        +
        51
        +
        52 ptr[j] = temp;
        +
        53 }
        +
        54}
        T data(T... args)
        T end(T... args)
        @@ -238,7 +237,7 @@ Here is the call graph for this function:
        - +

        ◆ main()

        @@ -256,11 +255,11 @@ Here is the call graph for this function:

        Main function.

        Returns
        0 on exit
        -
        159  {
        -
        160  std::srand(std::time(nullptr));
        -
        161  test();
        -
        162  return 0;
        -
        163 }
        +
        159 {
        +
        160 std::srand(std::time(nullptr));
        +
        161 test();
        +
        162 return 0;
        +
        163}
        static void test()
        Function to test code using random arrays.
        Definition: merge_insertion_sort.cpp:132
        T srand(T... args)
        T time(T... args)
        @@ -273,7 +272,7 @@ Here is the call graph for this function:
        - +

        ◆ merge()

        @@ -338,31 +337,31 @@ template<typename T , size_t N>
        -
        67  {
        -
        68  size_t firstIndex = min;
        -
        69  size_t secondIndex = mid + 1;
        -
        70 
        -
        71  auto ptr = array->data();
        -
        72  std::array<T, N + 1> tempArray{0};
        -
        73 
        -
        74  // While there are elements in the left or right runs
        -
        75  for (size_t index = min; index <= max; index++) {
        -
        76  // If left run head exists and is <= existing right run head.
        -
        77  if (firstIndex <= mid &&
        -
        78  (secondIndex > max || ptr[firstIndex] <= ptr[secondIndex])) {
        -
        79  tempArray[index] = ptr[firstIndex];
        -
        80  firstIndex++;
        -
        81  } else {
        -
        82  tempArray[index] = ptr[secondIndex];
        -
        83  secondIndex++;
        -
        84  }
        -
        85  }
        -
        86 
        -
        87  // transfer to the initial array
        -
        88  memcpy(ptr + min, tempArray.data() + min, (max - min) * sizeof(T));
        -
        89  // for (int index = min; index <= max; index++) ptr[index] =
        -
        90  // tempArray[index];
        -
        91 }
        +
        67 {
        +
        68 size_t firstIndex = min;
        +
        69 size_t secondIndex = mid + 1;
        +
        70
        +
        71 auto ptr = array->data();
        +
        72 std::array<T, N + 1> tempArray{0};
        +
        73
        +
        74 // While there are elements in the left or right runs
        +
        75 for (size_t index = min; index <= max; index++) {
        +
        76 // If left run head exists and is <= existing right run head.
        +
        77 if (firstIndex <= mid &&
        +
        78 (secondIndex > max || ptr[firstIndex] <= ptr[secondIndex])) {
        +
        79 tempArray[index] = ptr[firstIndex];
        +
        80 firstIndex++;
        +
        81 } else {
        +
        82 tempArray[index] = ptr[secondIndex];
        +
        83 secondIndex++;
        +
        84 }
        +
        85 }
        +
        86
        +
        87 // transfer to the initial array
        +
        88 memcpy(ptr + min, tempArray.data() + min, (max - min) * sizeof(T));
        +
        89 // for (int index = min; index <= max; index++) ptr[index] =
        +
        90 // tempArray[index];
        +
        91}
        T max(T... args)
        T memcpy(T... args)
        @@ -376,7 +375,7 @@ Here is the call graph for this function:
        - +

        ◆ mergeSort()

        @@ -433,35 +432,35 @@ template<typename T , size_t N>
        -
        108  {
        -
        109  // prerequisite
        -
        110  if ((max - min) <= threshold) {
        -
        111  InsertionSort(array, min, max);
        -
        112  } else {
        -
        113  // get the middle point
        -
        114  size_t mid = (max + min) >> 1;
        -
        115 
        -
        116  // apply merge sort to both parts of this
        -
        117  mergeSort(array, min, mid, threshold);
        -
        118  mergeSort(array, mid, max, threshold);
        -
        119 
        -
        120  // and finally merge all that sorted stuff
        -
        121  merge(array, min, max, mid);
        -
        122  }
        -
        123 }
        +
        108 {
        +
        109 // prerequisite
        +
        110 if ((max - min) <= threshold) {
        +
        111 InsertionSort(array, min, max);
        +
        112 } else {
        +
        113 // get the middle point
        +
        114 size_t mid = (max + min) >> 1;
        +
        115
        +
        116 // apply merge sort to both parts of this
        +
        117 mergeSort(array, min, mid, threshold);
        +
        118 mergeSort(array, mid, max, threshold);
        +
        119
        +
        120 // and finally merge all that sorted stuff
        +
        121 merge(array, min, max, mid);
        +
        122 }
        +
        123}
        void merge(int *arr, int l, int m, int r)
        Definition: merge_sort.cpp:33
        void mergeSort(int *arr, int l, int r)
        Definition: merge_sort.cpp:71
        static void InsertionSort(std::array< T, N > *A, size_t start, size_t end)
        Insertion merge algorithm.
        Definition: merge_insertion_sort.cpp:37
        Here is the call graph for this function:
        -
        +
        - +

        ◆ test()

        @@ -486,28 +485,28 @@ Here is the call graph for this function:

        Function to test code using random arrays.

        Returns
        none
        -
        132  {
        -
        133  constexpr size_t size = 30;
        -
        134  std::array<int, size> array{0};
        -
        135  // input
        -
        136  for (int i = 0; i < size; i++) {
        -
        137  array[i] = std::rand() % 100 - 50;
        -
        138  std::cout << array[i] << " ";
        -
        139  }
        -
        140  std::cout << std::endl;
        -
        141 
        - -
        143  // sorting::merge_insertion::mergeSort(&array, 0, size, 10);
        -
        144 
        -
        145  // output
        -
        146  for (int i = 0; i < size; ++i) {
        -
        147  std::cout << array[i] << " ";
        -
        148  }
        -
        149  std::cout << std::endl;
        -
        150 
        -
        151  assert(std::is_sorted(std::begin(array), std::end(array)));
        -
        152  std::cout << "Test passed\n";
        -
        153 }
        +
        132 {
        +
        133 constexpr size_t size = 30;
        +
        134 std::array<int, size> array{0};
        +
        135 // input
        +
        136 for (int i = 0; i < size; i++) {
        +
        137 array[i] = std::rand() % 100 - 50;
        +
        138 std::cout << array[i] << " ";
        +
        139 }
        + +
        141
        + +
        143 // sorting::merge_insertion::mergeSort(&array, 0, size, 10);
        +
        144
        +
        145 // output
        +
        146 for (int i = 0; i < size; ++i) {
        +
        147 std::cout << array[i] << " ";
        +
        148 }
        + +
        150
        +
        151 assert(std::is_sorted(std::begin(array), std::end(array)));
        +
        152 std::cout << "Test passed\n";
        +
        153}
        T begin(T... args)
        T endl(T... args)
        @@ -522,7 +521,7 @@ Here is the call graph for this function:
        diff --git a/de/d7b/merge__insertion__sort_8cpp_a0cba4fbf287ab8cb978ed7f8fef886b1_cgraph.svg b/de/d7b/merge__insertion__sort_8cpp_a0cba4fbf287ab8cb978ed7f8fef886b1_cgraph.svg index e633e528c..8dbf51e46 100644 --- a/de/d7b/merge__insertion__sort_8cpp_a0cba4fbf287ab8cb978ed7f8fef886b1_cgraph.svg +++ b/de/d7b/merge__insertion__sort_8cpp_a0cba4fbf287ab8cb978ed7f8fef886b1_cgraph.svg @@ -1,7 +1,7 @@ - - + - + diff --git a/de/d7b/merge__insertion__sort_8cpp_a7161278f18e83b671c6454b139cc5674_cgraph.md5 b/de/d7b/merge__insertion__sort_8cpp_a7161278f18e83b671c6454b139cc5674_cgraph.md5 index ab1c8087c..fee96e46f 100644 --- a/de/d7b/merge__insertion__sort_8cpp_a7161278f18e83b671c6454b139cc5674_cgraph.md5 +++ b/de/d7b/merge__insertion__sort_8cpp_a7161278f18e83b671c6454b139cc5674_cgraph.md5 @@ -1 +1 @@ -27f3fed4a37732ab56a0fe330b9145d8 \ No newline at end of file +2f5cbb1a714c44d2e3b94234bed95d65 \ No newline at end of file diff --git a/de/d7b/merge__insertion__sort_8cpp_a7161278f18e83b671c6454b139cc5674_cgraph.svg b/de/d7b/merge__insertion__sort_8cpp_a7161278f18e83b671c6454b139cc5674_cgraph.svg index 89e77313f..e7ffd3a35 100644 --- a/de/d7b/merge__insertion__sort_8cpp_a7161278f18e83b671c6454b139cc5674_cgraph.svg +++ b/de/d7b/merge__insertion__sort_8cpp_a7161278f18e83b671c6454b139cc5674_cgraph.svg @@ -1,21 +1,21 @@ - - - + + sorting::merge_insertion::mergeSort - + Node1 - -sorting::merge_insertion -::mergeSort + +sorting::merge_insertion +::mergeSort @@ -23,32 +23,32 @@ Node2 - -sorting::merge_insertion -::InsertionSort + +sorting::merge_insertion +::InsertionSort Node1->Node2 - - + + Node4 - -sorting::merge + +sorting::merge Node1->Node4 - - + + @@ -62,44 +62,50 @@ Node1->Node6 - - + + Node2->Node2 - - + + Node3 - -std::array::data + +std::array::data Node2->Node3 - - + + Node5 - -std::move + +std::move Node4->Node5 - - + + + + + +Node6->Node6 + + diff --git a/de/d7b/merge__insertion__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/de/d7b/merge__insertion__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 227d01903..0522120e3 100644 --- a/de/d7b/merge__insertion__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/de/d7b/merge__insertion__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - - - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,21 +90,20 @@ $(document).ready(function(){initNavTree('de/d48/struct_trie_1_1_trie_node.html'
        -
        -
        Trie::TrieNode Member List
        +
        Trie::TrieNode Member List

        This is the complete list of members for Trie::TrieNode, including all inherited members.

        - +
        character (defined in Trie::TrieNode)Trie::TrieNode
        isEndOfWord (defined in Trie::TrieNode)Trie::TrieNode
        isEndOfWord (defined in Trie::TrieNode)Trie::TrieNode
        diff --git a/de/d83/namespaceis__graph__bipartite.html b/de/d83/namespaceis__graph__bipartite.html index efd6aa425..bae0b223a 100644 --- a/de/d83/namespaceis__graph__bipartite.html +++ b/de/d83/namespaceis__graph__bipartite.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: is_graph_bipartite Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('de/d83/namespaceis__graph__bipartite.h
        -
        -
        is_graph_bipartite Namespace Reference
        +
        is_graph_bipartite Namespace Reference

        Functions for checking whether a graph is bipartite or not. More...

        Detailed Description

        -

        Functions for checking whether a graph is bipartite or not.

        +

        Functions for checking whether a graph is bipartite or not.

        diff --git a/de/d85/decimal__to__roman__numeral_8cpp.html b/de/d85/decimal__to__roman__numeral_8cpp.html index 7baac22d7..f2e595338 100644 --- a/de/d85/decimal__to__roman__numeral_8cpp.html +++ b/de/d85/decimal__to__roman__numeral_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: others/decimal_to_roman_numeral.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('de/d85/decimal__to__roman__numeral_8cp
        -
        -
        decimal_to_roman_numeral.cpp File Reference
        +
        decimal_to_roman_numeral.cpp File Reference
        @@ -110,7 +109,7 @@ Include dependency graph for decimal_to_roman_numeral.cpp:
        - @@ -122,9 +121,9 @@ Functions

        +

        Functions

        std::string fill (char c, int n)
         
         

        Detailed Description

        -

        This Programme Converts a given decimal number in the range [0,4000) to both Lower case and Upper case Roman Numeral.

        +

        This Programme Converts a given decimal number in the range [0,4000) to both Lower case and Upper case Roman Numeral.

        Function Documentation

        - +

        ◆ fill()

        @@ -149,17 +148,17 @@ Functions
        -

        This functions fills a string with character c, n times and returns it

        Note
        This can probably be replace by memcpy function.
        -
        15  {
        -
        16  std::string s = "";
        -
        17  while (n--) s += c;
        -
        18  return s;
        -
        19 }
        +

        This functions fills a string with character c, n times and returns it

        Note
        This can probably be replace by memcpy function.
        +
        15 {
        +
        16 std::string s = "";
        +
        17 while (n--) s += c;
        +
        18 return s;
        +
        19}
        - +

        ◆ main()

        @@ -174,16 +173,16 @@ Functions
        -

        main function

        -
        90  {
        -
        91  int n;
        -
        92  std::cout << "\t\tRoman numbers converter\n\n";
        -
        93  std::cout << "Type in decimal number between 0 up to 4000 (exclusive): ";
        -
        94  std::cin >> n;
        -
        95  std::cout << n << " in Upper Roman Numerals is " << toupperRoman(n) << "\n";
        -
        96  std::cout << n << " in Lower Roman Numerals is " << tolowerRoman(n) << "\n";
        -
        97  return 0;
        -
        98 }
        +

        main function

        +
        90 {
        +
        91 int n;
        +
        92 std::cout << "\t\tRoman numbers converter\n\n";
        +
        93 std::cout << "Type in decimal number between 0 up to 4000 (exclusive): ";
        +
        94 std::cin >> n;
        +
        95 std::cout << n << " in Upper Roman Numerals is " << toupperRoman(n) << "\n";
        +
        96 std::cout << n << " in Lower Roman Numerals is " << tolowerRoman(n) << "\n";
        +
        97 return 0;
        +
        98}
        std::string tolowerRoman(int n)
        Definition: decimal_to_roman_numeral.cpp:24
        @@ -191,13 +190,13 @@ Functions
        Here is the call graph for this function:
        -
        +
        - +

        ◆ tolowerRoman()

        @@ -212,48 +211,48 @@ Here is the call graph for this function:
        -

        to convert to lowercase Roman Numeral the function works recursively

        -
        24  {
        -
        25  if (n < 4)
        -
        26  return fill('i', n);
        -
        27  if (n < 6)
        -
        28  return fill('i', 5 - n) + "v";
        -
        29  if (n < 9)
        -
        30  return std::string("v") + fill('i', n - 5);
        -
        31  if (n < 11)
        -
        32  return fill('i', 10 - n) + "x";
        -
        33  if (n < 40)
        -
        34  return fill('x', n / 10) + tolowerRoman(n % 10);
        -
        35  if (n < 60)
        -
        36  return fill('x', 5 - n / 10) + 'l' + tolowerRoman(n % 10);
        -
        37  if (n < 90)
        -
        38  return std::string("l") + fill('x', n / 10 - 5) + tolowerRoman(n % 10);
        -
        39  if (n < 110)
        -
        40  return fill('x', 10 - n / 10) + "c" + tolowerRoman(n % 10);
        -
        41  if (n < 400)
        -
        42  return fill('c', n / 100) + tolowerRoman(n % 100);
        -
        43  if (n < 600)
        -
        44  return fill('c', 5 - n / 100) + 'd' + tolowerRoman(n % 100);
        -
        45  if (n < 900)
        -
        46  return std::string("d") + fill('c', n / 100 - 5) +
        -
        47  tolowerRoman(n % 100);
        -
        48  if (n < 1100)
        -
        49  return fill('c', 10 - n / 100) + "m" + tolowerRoman(n % 100);
        -
        50  if (n < 4000)
        -
        51  return fill('m', n / 1000) + tolowerRoman(n % 1000);
        -
        52  return "?";
        -
        53 }
        +

        to convert to lowercase Roman Numeral the function works recursively

        +
        24 {
        +
        25 if (n < 4)
        +
        26 return fill('i', n);
        +
        27 if (n < 6)
        +
        28 return fill('i', 5 - n) + "v";
        +
        29 if (n < 9)
        +
        30 return std::string("v") + fill('i', n - 5);
        +
        31 if (n < 11)
        +
        32 return fill('i', 10 - n) + "x";
        +
        33 if (n < 40)
        +
        34 return fill('x', n / 10) + tolowerRoman(n % 10);
        +
        35 if (n < 60)
        +
        36 return fill('x', 5 - n / 10) + 'l' + tolowerRoman(n % 10);
        +
        37 if (n < 90)
        +
        38 return std::string("l") + fill('x', n / 10 - 5) + tolowerRoman(n % 10);
        +
        39 if (n < 110)
        +
        40 return fill('x', 10 - n / 10) + "c" + tolowerRoman(n % 10);
        +
        41 if (n < 400)
        +
        42 return fill('c', n / 100) + tolowerRoman(n % 100);
        +
        43 if (n < 600)
        +
        44 return fill('c', 5 - n / 100) + 'd' + tolowerRoman(n % 100);
        +
        45 if (n < 900)
        +
        46 return std::string("d") + fill('c', n / 100 - 5) +
        +
        47 tolowerRoman(n % 100);
        +
        48 if (n < 1100)
        +
        49 return fill('c', 10 - n / 100) + "m" + tolowerRoman(n % 100);
        +
        50 if (n < 4000)
        +
        51 return fill('m', n / 1000) + tolowerRoman(n % 1000);
        +
        52 return "?";
        +
        53}
        std::string fill(char c, int n)
        Definition: decimal_to_roman_numeral.cpp:15
        Here is the call graph for this function:
        -
        +
        - +

        ◆ toupperRoman()

        @@ -268,41 +267,41 @@ Here is the call graph for this function:
        -

        to convert to uppercase Roman Numeral the function works recursively

        -
        58  {
        -
        59  if (n < 4)
        -
        60  return fill('I', n);
        -
        61  if (n < 6)
        -
        62  return fill('I', 5 - n) + "V";
        -
        63  if (n < 9)
        -
        64  return std::string("V") + fill('I', n - 5);
        -
        65  if (n < 11)
        -
        66  return fill('I', 10 - n) + "X";
        -
        67  if (n < 40)
        -
        68  return fill('X', n / 10) + toupperRoman(n % 10);
        -
        69  if (n < 60)
        -
        70  return fill('X', 5 - n / 10) + 'L' + toupperRoman(n % 10);
        -
        71  if (n < 90)
        -
        72  return std::string("L") + fill('X', n / 10 - 5) + toupperRoman(n % 10);
        -
        73  if (n < 110)
        -
        74  return fill('X', 10 - n / 10) + "C" + toupperRoman(n % 10);
        -
        75  if (n < 400)
        -
        76  return fill('C', n / 100) + toupperRoman(n % 100);
        -
        77  if (n < 600)
        -
        78  return fill('C', 5 - n / 100) + 'D' + toupperRoman(n % 100);
        -
        79  if (n < 900)
        -
        80  return std::string("D") + fill('C', n / 100 - 5) +
        -
        81  toupperRoman(n % 100);
        -
        82  if (n < 1100)
        -
        83  return fill('C', 10 - n / 100) + "M" + toupperRoman(n % 100);
        -
        84  if (n < 4000)
        -
        85  return fill('M', n / 1000) + toupperRoman(n % 1000);
        -
        86  return "?";
        -
        87 }
        +

        to convert to uppercase Roman Numeral the function works recursively

        +
        58 {
        +
        59 if (n < 4)
        +
        60 return fill('I', n);
        +
        61 if (n < 6)
        +
        62 return fill('I', 5 - n) + "V";
        +
        63 if (n < 9)
        +
        64 return std::string("V") + fill('I', n - 5);
        +
        65 if (n < 11)
        +
        66 return fill('I', 10 - n) + "X";
        +
        67 if (n < 40)
        +
        68 return fill('X', n / 10) + toupperRoman(n % 10);
        +
        69 if (n < 60)
        +
        70 return fill('X', 5 - n / 10) + 'L' + toupperRoman(n % 10);
        +
        71 if (n < 90)
        +
        72 return std::string("L") + fill('X', n / 10 - 5) + toupperRoman(n % 10);
        +
        73 if (n < 110)
        +
        74 return fill('X', 10 - n / 10) + "C" + toupperRoman(n % 10);
        +
        75 if (n < 400)
        +
        76 return fill('C', n / 100) + toupperRoman(n % 100);
        +
        77 if (n < 600)
        +
        78 return fill('C', 5 - n / 100) + 'D' + toupperRoman(n % 100);
        +
        79 if (n < 900)
        +
        80 return std::string("D") + fill('C', n / 100 - 5) +
        +
        81 toupperRoman(n % 100);
        +
        82 if (n < 1100)
        +
        83 return fill('C', 10 - n / 100) + "M" + toupperRoman(n % 100);
        +
        84 if (n < 4000)
        +
        85 return fill('M', n / 1000) + toupperRoman(n % 1000);
        +
        86 return "?";
        +
        87}
        Here is the call graph for this function:
        -
        +
        @@ -314,7 +313,7 @@ Here is the call graph for this function:
        diff --git a/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.map b/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.map index 086de5f36..b1407c1f0 100644 --- a/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.map +++ b/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.md5 b/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.md5 index 597e57075..8ea6cdaf6 100644 --- a/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.md5 +++ b/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.md5 @@ -1 +1 @@ -f710e2d8b6cc6f50984992fe66292e0b \ No newline at end of file +017d8641aa34b5352e1c28c1eed68765 \ No newline at end of file diff --git a/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.svg b/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.svg index f55ec8660..277dca027 100644 --- a/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.svg +++ b/de/d85/decimal__to__roman__numeral_8cpp_a003fb4e1b08279fe4cd50fbbc2782c2d_cgraph.svg @@ -1,14 +1,14 @@ - - - + + tolowerRoman - + Node1 @@ -18,6 +18,12 @@ + + +Node1->Node1 + + + Node2 diff --git a/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.map b/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.map index 728da62ec..c6a08f984 100644 --- a/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.map +++ b/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.map @@ -1,4 +1,4 @@ - - + + diff --git a/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.md5 b/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.md5 index bc99c4e0a..95affa0da 100644 --- a/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.md5 +++ b/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.md5 @@ -1 +1 @@ -728539a9650eb359a199ea70c18650c0 \ No newline at end of file +b2803cda799917a5af0fc4e10d09fe58 \ No newline at end of file diff --git a/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.svg b/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.svg index 5d8e2a4ff..c4f100629 100644 --- a/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.svg +++ b/de/d85/decimal__to__roman__numeral_8cpp_a214743638eff1336f835310049aef979_cgraph.svg @@ -1,14 +1,14 @@ - - - + + toupperRoman - + Node1 @@ -18,6 +18,12 @@ + + +Node1->Node1 + + + Node2 diff --git a/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index a93bda525..9c7407e3c 100644 --- a/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 99d418038..6f318986c 100644 --- a/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -c8cd6b7042ff5ebfdf1b6db8235899a6 \ No newline at end of file +00f3bda028b3f3d411bf952865f0f034 \ No newline at end of file diff --git a/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 79feb8984..2c57e7948 100644 --- a/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/de/d85/decimal__to__roman__numeral_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,20 +1,20 @@ - - - + + main - + Node1 - -main + +main @@ -22,16 +22,16 @@ Node2 - -tolowerRoman + +tolowerRoman Node1->Node2 - - + + @@ -43,31 +43,43 @@ - + Node1->Node4 - - + + + + + +Node2->Node2 + + Node3 - -fill + +fill Node2->Node3 - - + + - + Node4->Node3 - - + + + + + +Node4->Node4 + + diff --git a/de/d8a/class_trie-members.html b/de/d8a/class_trie-members.html index 0cdd2a230..e72472217 100644 --- a/de/d8a/class_trie-members.html +++ b/de/d8a/class_trie-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,27 +90,26 @@ $(document).ready(function(){initNavTree('dd/d2f/class_trie.html','../../'); ini
        -
        -
        Trie Member List
        +
        Trie Member List

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

        - + - + - + - +
        ALPHABETS (defined in Trie)Trieprivatestatic
        hasChildren(std::shared_ptr< TrieNode > node)Trieinlineprivatestatic
        hasChildren(std::shared_ptr< TrieNode > node)Trieinlineprivatestatic
        insert(const std::string &word)Trieinline
        m_root (defined in Trie)Trieprivate
        m_root (defined in Trie)Trieprivate
        removeWord(const std::string &word) (defined in Trie)Trieinline
        removeWordHelper(const std::string &word, std::shared_ptr< TrieNode > curr, size_t index)Trieinlineprivate
        removeWordHelper(const std::string &word, std::shared_ptr< TrieNode > curr, size_t index)Trieinlineprivate
        search(const std::string &word)Trieinline
        Trie()Trieinline
        Trie()Trieinline
        diff --git a/de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.map b/de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.map deleted file mode 100644 index a0282f600..000000000 --- a/de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.md5 b/de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.md5 deleted file mode 100644 index cc7a5992f..000000000 --- a/de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -9146029675392e7b1dca30df9aa4030a \ No newline at end of file diff --git a/de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.svg b/de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.svg deleted file mode 100644 index 7f5996efe..000000000 --- a/de/d8e/classothers_1_1postfix__expression_1_1_stack__coll__graph.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -others::postfix_expression::Stack - - - -Node1 - - -others::postfix_expression -::Stack - - - - - -Node2 - - -std::array< float, 20 > - - - - - -Node2->Node1 - - - stack - - - diff --git a/de/d91/structlist-members.html b/de/d91/structlist-members.html index 5ea38bbf6..859c68d71 100644 --- a/de/d91/structlist-members.html +++ b/de/d91/structlist-members.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: Member List @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,21 +90,20 @@ $(document).ready(function(){initNavTree('d8/d10/structlist.html','../../'); ini
        -
        -
        list Member List
        +
        list Member List

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

        - +
        keylist
        nextlist
        nextlist
        diff --git a/de/d94/iterative__tree__traversals_8cpp__incl.svg b/de/d94/iterative__tree__traversals_8cpp__incl.svg index b5f1bc15b..080a40dc8 100644 --- a/de/d94/iterative__tree__traversals_8cpp__incl.svg +++ b/de/d94/iterative__tree__traversals_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: Subsets Namespace Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -90,22 +90,21 @@ $(document).ready(function(){initNavTree('de/d95/namespace_subsets.html','../../
        -
        -
        Subsets Namespace Reference
        +
        Subsets Namespace Reference
        -

        Functions for the Subset Sum problem. +

        Functions for the Subset Sum problem. More...

        Detailed Description

        -

        Functions for the Subset Sum problem.

        +

        Functions for the Subset Sum problem.

        diff --git a/de/d99/trie__tree_8cpp__incl.svg b/de/d99/trie__tree_8cpp__incl.svg index ae7f3e024..dfda8547d 100644 --- a/de/d99/trie__tree_8cpp__incl.svg +++ b/de/d99/trie__tree_8cpp__incl.svg @@ -1,7 +1,7 @@ - - - + + Algorithms_in_C++: math/prime_numbers.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -92,8 +92,7 @@ $(document).ready(function(){initNavTree('de/d9b/prime__numbers_8cpp.html','../.
        -
        -
        prime_numbers.cpp File Reference
        +
        prime_numbers.cpp File Reference
        @@ -108,18 +107,18 @@ Include dependency graph for prime_numbers.cpp:
        - - - + +

        +

        Functions

        std::vector< int > primes (int max)
         
        std::vector< int > primes (int max)
         
        int main ()
         

        Detailed Description

        -

        Get list of prime numbers.

        +

        Get list of prime numbers.

        See also
        primes_up_to_billion.cpp sieve_of_eratosthenes.cpp

        Function Documentation

        - +

        ◆ main()

        @@ -134,21 +133,21 @@ Functions
        -

        main function

        -
        26  {
        -
        27  std::cout << "Calculate primes up to:\n>> ";
        -
        28  int n;
        -
        29  std::cin >> n;
        - -
        31  for (int i = 0; i < ans.size(); i++) std::cout << ans[i] << ' ';
        - -
        33 }
        +

        main function

        +
        26 {
        +
        27 std::cout << "Calculate primes up to:\n>> ";
        +
        28 int n;
        +
        29 std::cin >> n;
        + +
        31 for (int i = 0; i < ans.size(); i++) std::cout << ans[i] << ' ';
        + +
        33}
        T endl(T... args)
        ll ans(ll n)
        Definition: matrix_exponentiation.cpp:91
        -
        std::vector< int > primes(int max)
        Definition: prime_numbers.cpp:12
        - +
        std::vector< int > primes(int max)
        Definition: prime_numbers.cpp:12
        +
        Here is the call graph for this function:
        @@ -158,14 +157,14 @@ Here is the call graph for this function:
        - -

        ◆ primes()

        + +

        ◆ primes()

        - + @@ -173,25 +172,25 @@ Here is the call graph for this function:
        std::vector<int> primes std::vector< int > primes ( int  max)
        -

        Generate an increasingly large number of primes and store in a list

        -
        12  {
        -
        13  max++;
        -
        14  std::vector<int> res;
        -
        15  std::vector<bool> numbers(max, false);
        -
        16  for (int i = 2; i < max; i++) {
        -
        17  if (!numbers[i]) {
        -
        18  for (int j = i; j < max; j += i) numbers[j] = true;
        -
        19  res.push_back(i);
        -
        20  }
        -
        21  }
        -
        22  return res;
        -
        23 }
        +

        Generate an increasingly large number of primes and store in a list

        +
        12 {
        +
        13 max++;
        + +
        15 std::vector<bool> numbers(max, false);
        +
        16 for (int i = 2; i < max; i++) {
        +
        17 if (!numbers[i]) {
        +
        18 for (int j = i; j < max; j += i) numbers[j] = true;
        +
        19 res.push_back(i);
        +
        20 }
        +
        21 }
        +
        22 return res;
        +
        23}
        T max(T... args)
        T push_back(T... args)
        Here is the call graph for this function:
        -
        +
        @@ -203,7 +202,7 @@ Here is the call graph for this function:
        diff --git a/de/d9b/prime__numbers_8cpp.js b/de/d9b/prime__numbers_8cpp.js index 4132bd5cf..a251a2604 100644 --- a/de/d9b/prime__numbers_8cpp.js +++ b/de/d9b/prime__numbers_8cpp.js @@ -1,5 +1,5 @@ var prime__numbers_8cpp = [ [ "main", "de/d9b/prime__numbers_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "primes", "de/d9b/prime__numbers_8cpp.html#a3b91f208e8365c95a295cfe3e67df5c3", null ] + [ "primes", "de/d9b/prime__numbers_8cpp.html#a541b9728fd1db77516fee913763da90e", null ] ]; \ No newline at end of file diff --git a/de/d9b/prime__numbers_8cpp_a3b91f208e8365c95a295cfe3e67df5c3_cgraph.map b/de/d9b/prime__numbers_8cpp_a541b9728fd1db77516fee913763da90e_cgraph.map similarity index 100% rename from de/d9b/prime__numbers_8cpp_a3b91f208e8365c95a295cfe3e67df5c3_cgraph.map rename to de/d9b/prime__numbers_8cpp_a541b9728fd1db77516fee913763da90e_cgraph.map diff --git a/de/d9b/prime__numbers_8cpp_a3b91f208e8365c95a295cfe3e67df5c3_cgraph.md5 b/de/d9b/prime__numbers_8cpp_a541b9728fd1db77516fee913763da90e_cgraph.md5 similarity index 100% rename from de/d9b/prime__numbers_8cpp_a3b91f208e8365c95a295cfe3e67df5c3_cgraph.md5 rename to de/d9b/prime__numbers_8cpp_a541b9728fd1db77516fee913763da90e_cgraph.md5 diff --git a/de/d9b/prime__numbers_8cpp_a3b91f208e8365c95a295cfe3e67df5c3_cgraph.svg b/de/d9b/prime__numbers_8cpp_a541b9728fd1db77516fee913763da90e_cgraph.svg similarity index 96% rename from de/d9b/prime__numbers_8cpp_a3b91f208e8365c95a295cfe3e67df5c3_cgraph.svg rename to de/d9b/prime__numbers_8cpp_a541b9728fd1db77516fee913763da90e_cgraph.svg index 3a377d7cc..70639c2e5 100644 --- a/de/d9b/prime__numbers_8cpp_a3b91f208e8365c95a295cfe3e67df5c3_cgraph.svg +++ b/de/d9b/prime__numbers_8cpp_a541b9728fd1db77516fee913763da90e_cgraph.svg @@ -1,7 +1,7 @@ - - + diff --git a/de/d9b/prime__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/de/d9b/prime__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index c9bd06746..12951567f 100644 --- a/de/d9b/prime__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/de/d9b/prime__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -d533b1708db145740cdf4068e454acff \ No newline at end of file +4ab432d9bebd5828dbc11ffe9acb6140 \ No newline at end of file diff --git a/de/d9b/prime__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/de/d9b/prime__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index 24734832c..e3b5940bd 100644 --- a/de/d9b/prime__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/de/d9b/prime__numbers_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -1,7 +1,7 @@ - Node4 - + primes diff --git a/de/d9d/classdata__structures_1_1linked__list_1_1link.html b/de/d9d/classdata__structures_1_1linked__list_1_1link.html index 096f644b5..fbafb0f17 100644 --- a/de/d9d/classdata__structures_1_1linked__list_1_1link.html +++ b/de/d9d/classdata__structures_1_1linked__list_1_1link.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: data_structures::linked_list::link Class Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@ -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        @@ -42,21 +41,22 @@
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -94,41 +94,34 @@ $(document).ready(function(){initNavTree('de/d9d/classdata__structures_1_1linked Public Member Functions | Private Attributes | List of all members
        -
        -
        data_structures::linked_list::link Class Reference
        +
        data_structures::linked_list::link Class Reference
        -
        -Collaboration diagram for data_structures::linked_list::link:
        -
        -
        -
        -
        [legend]
        - - - + +

        +

        Public Member Functions

        int val ()
         
        std::shared_ptr< link > & succ ()
         
        std::shared_ptr< link > & succ ()
         
         link (int value=0)
         
        - - + - +

        +

        Private Attributes

        -int pvalue
        +int pvalue
         value of the current link
         
        -std::shared_ptr< linkpsucc
        +std::shared_ptr< linkpsucc
         pointer to the next value on the list
         

        Detailed Description

        -

        A link class containing a value and pointer to another link

        +

        A link class containing a value and pointer to another link

        Constructor & Destructor Documentation

        - +

        ◆ link()

        @@ -151,21 +144,21 @@ int  -

        Creates link with provided value and pointer to next link

        Parameters
        +

        Creates link with provided value and pointer to next link

        Parameters
        valueis the integer stored in the link
        -
        75 : pvalue(value), psucc(nullptr) {}
        +
        75: pvalue(value), psucc(nullptr) {}

        Member Function Documentation

        - -

        ◆ succ()

        + +

        ◆ succ()

        @@ -174,7 +167,7 @@ int  - + @@ -186,12 +179,12 @@ int  @@ -42,21 +41,22 @@
        std::shared_ptr<link>& data_structures::linked_list::link::succ std::shared_ptr< link > & data_structures::linked_list::link::succ ( ) -

        function returns the pointer to next link

        Returns
        the pointer to the next link
        -
        69 { return psucc; }
        +

        function returns the pointer to next link

        Returns
        the pointer to the next link
        +
        69{ return psucc; }
        - +

        ◆ val()

        @@ -213,8 +206,8 @@ int 
        -

        function returns the integer value stored in the link.

        Returns
        the integer value stored in the link.
        -
        63 { return pvalue; }
        +

        function returns the integer value stored in the link.

        Returns
        the integer value stored in the link.
        +
        63{ return pvalue; }
        @@ -227,7 +220,7 @@ int 
        diff --git a/de/d9d/classdata__structures_1_1linked__list_1_1link.js b/de/d9d/classdata__structures_1_1linked__list_1_1link.js index 6325ba124..e71d6d029 100644 --- a/de/d9d/classdata__structures_1_1linked__list_1_1link.js +++ b/de/d9d/classdata__structures_1_1linked__list_1_1link.js @@ -1,7 +1,7 @@ var classdata__structures_1_1linked__list_1_1link = [ [ "link", "de/d9d/classdata__structures_1_1linked__list_1_1link.html#aba4672fbc40c38962d1510b843a577bb", null ], - [ "succ", "de/d9d/classdata__structures_1_1linked__list_1_1link.html#a28781355a468a1b95278ffe6277f3b6c", null ], + [ "succ", "de/d9d/classdata__structures_1_1linked__list_1_1link.html#af6bbeb9bfde1683ba917071edeedd5c3", null ], [ "val", "de/d9d/classdata__structures_1_1linked__list_1_1link.html#acf96f3a9a1d3b15268c38e8822300c11", null ], [ "psucc", "de/d9d/classdata__structures_1_1linked__list_1_1link.html#af94c06f3220e5406245680f58b8e7081", null ], [ "pvalue", "de/d9d/classdata__structures_1_1linked__list_1_1link.html#ac121ce37b6ea864b160ebcada0bce936", null ] diff --git a/de/dab/ncr__modulo__p_8cpp.html b/de/dab/ncr__modulo__p_8cpp.html index 05ab1ee62..7006d8eb3 100644 --- a/de/dab/ncr__modulo__p_8cpp.html +++ b/de/dab/ncr__modulo__p_8cpp.html @@ -2,8 +2,8 @@ - - + + Algorithms_in_C++: math/ncr_modulo_p.cpp File Reference @@ -17,9 +17,9 @@ @@ -32,8 +32,7 @@
        -
        Algorithms_in_C++ -  1.0.0 +
        Algorithms_in_C++ 1.0.0
        Set of algorithms implemented in C++.
        - + +/* @license-end */ +
        @@ -70,7 +70,7 @@ $(function() {
        @@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('de/dab/ncr__modulo__p_8cpp.html','../. Classes | Namespaces | Functions
        -
        -
        ncr_modulo_p.cpp File Reference
        +
        ncr_modulo_p.cpp File Reference
        -

        This program aims at calculating nCr modulo p. +

        This program aims at calculating nCr modulo p. More...

        #include <cassert>
        #include <iostream>
        @@ -111,22 +110,22 @@ Include dependency graph for ncr_modulo_p.cpp:
        -

        +

        Classes

        class  math::ncr_modulo_p::NCRModuloP
         Class which contains all methods required for calculating nCr mod p. More...
         
        - - + - - + +

        +

        Namespaces

         math
        namespace  math
         for IO operations
         
         ncr_modulo_p
         Functions for nCr modulo p implementation.
        namespace  ncr_modulo_p
         Functions for nCr modulo p implementation.
         
        - @@ -136,10 +135,10 @@ Functions

        +

        Functions

        static void tests (math::ncr_modulo_p::NCRModuloP ncrObj)
         Test implementations. More...
         

        Detailed Description

        -

        This program aims at calculating nCr modulo p.

        -

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

        Author
        Kaustubh Damania
        +

        This program aims at calculating nCr modulo p.

        +

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

        Author
        Kaustubh Damania

        Function Documentation

        - +

        ◆ main()

        @@ -157,20 +156,20 @@ Functions

        Main function.

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

        ◆ tests()

        @@ -210,14 +209,14 @@ Functions
        Returns
        void
        -
        124  {
        -
        125  // (52323 C 26161) % (1e9 + 7) = 224944353
        -
        126  assert(ncrObj.ncr(52323, 26161, 1000000007) == 224944353);
        -
        127  // 6 C 2 = 30, 30%5 = 0
        -
        128  assert(ncrObj.ncr(6, 2, 5) == 0);
        -
        129  // 7C3 = 35, 35 % 29 = 8
        -
        130  assert(ncrObj.ncr(7, 3, 29) == 6);
        -
        131 }
        +
        124 {
        +
        125 // (52323 C 26161) % (1e9 + 7) = 224944353
        +
        126 assert(ncrObj.ncr(52323, 26161, 1000000007) == 224944353);
        +
        127 // 6 C 2 = 30, 30%5 = 0
        +
        128 assert(ncrObj.ncr(6, 2, 5) == 0);
        +
        129 // 7C3 = 35, 35 % 29 = 8
        +
        130 assert(ncrObj.ncr(7, 3, 29) == 6);
        +
        131}
        Here is the call graph for this function:
        @@ -233,7 +232,7 @@ Here is the call graph for this function:
        diff --git a/de/dab/ncr__modulo__p_8cpp.js b/de/dab/ncr__modulo__p_8cpp.js index e4a8196f6..d539e73f3 100644 --- a/de/dab/ncr__modulo__p_8cpp.js +++ b/de/dab/ncr__modulo__p_8cpp.js @@ -1,6 +1,6 @@ var ncr__modulo__p_8cpp = [ - [ "NCRModuloP", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p" ], + [ "math::ncr_modulo_p::NCRModuloP", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p.html", "d6/dc1/classmath_1_1ncr__modulo__p_1_1_n_c_r_modulo_p" ], [ "main", "de/dab/ncr__modulo__p_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], [ "tests", "de/dab/ncr__modulo__p_8cpp.html#af0a3e6827f41c151e47451f5ff98b1f1", null ] ]; \ No newline at end of file diff --git a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.map b/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.map index b0b16c9d1..553adb9c9 100644 --- a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.map +++ b/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.map @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.md5 b/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.md5 index 94c86fdf7..d49651786 100644 --- a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.md5 +++ b/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.md5 @@ -1 +1 @@ -a538ae273576cdda42d3b4905d6266ef \ No newline at end of file +1ef005474d33f923b26e80be128df0ea \ No newline at end of file diff --git a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.svg b/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.svg index ec19f294c..00649a86f 100644 --- a/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.svg +++ b/de/dab/ncr__modulo__p_8cpp_af0a3e6827f41c151e47451f5ff98b1f1_cgraph.svg @@ -1,10 +1,10 @@ - - +